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
ArthurGarnier/SickRage
lib/imdb/parser/http/searchCompanyParser.py
76
2929
""" parser.http.searchCompanyParser module (imdb package). This module provides the HTMLSearchCompanyParser class (and the search_company_parser instance), used to parse the results of a search for a given company. E.g., when searching for the name "Columbia Pictures", the parsed page would be: http://akas.imdb.co...
gpl-3.0
nvoron23/hadoop-fundamentals
tfidf/framework.py
17
1300
import os import sys from itertools import groupby from operator import itemgetter SEPARATOR = "\t" class Streaming(object): @staticmethod def get_job_conf(name): name = name.replace(".", "_").upper() return os.environ.get(name) def __init__(self, infile=sys.stdin, separator=SEPARATOR):...
mit
mikeh77/mi-instrument
mi/instrument/seabird/sbe37smb/ooicore/test/sample_data.py
2
2612
from mi.instrument.seabird.sbe37smb.ooicore.driver import NEWLINE SAMPLE_DS = "SBE37-SMP V 2.6 SERIAL NO. 2165 05 Feb 2013 19:11:43" + NEWLINE + \ "not logging: received stop command" + NEWLINE + \ "sample interval = 20208 seconds" + NEWLINE + \ "samplenumber = 0, free = 200000"...
bsd-2-clause
wzmao/mbio
mbio/Application/math.py
1
11942
# -*- coding: utf-8 -*- """This module contains some math and statistics functions. In the future plan: Eigenvalue, Inverse, Matrix Multiplication, SVD, PCA """ __author__ = 'Wenzhi Mao' __all__ = ['isSquare', 'ANOVA', 'performRegression', 'performPolyRegression'] def isSquare(x): """It is a...
mit
sysadminmatmoz/OCB
addons/auth_signup/res_users.py
25
14601
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta import random from urlparse import urljoin import werkzeug from openerp.addons.base.ir.ir_mail_server import MailDeliveryException from openerp.osv import osv, fields from openerp...
agpl-3.0
arsenovic/clifford
clifford/test/test_g3c_tools.py
1
54096
import random from functools import reduce import time import functools import numpy as np import numpy.testing as npt from numpy import exp import pytest import numba from clifford import Cl from clifford.g3c import * from clifford import general_exp from clifford.tools.g3c import * from clifford.tools.g3c.rotor_pa...
bsd-3-clause
wummel/linkchecker
third_party/dnspython/tests/set.py
9
5255
# Copyright (C) 2003-2007, 2009-2011 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 "...
gpl-2.0
siddhuwarrier/lockindicator-applet
src/xkb/XkbWrapper.py
2
14017
import ctypes.util import types import logging.handlers from typeutils.TypeChecker import require # Copyright (c) 2010 Siddhu Warrier (http://siddhuwarrier.homelinux.org, # siddhuwarrier AT gmail DOT com). # # This file is part of the xkb package. # The xkb package is free software: you can redistribute it and/or m...
gpl-3.0
VRciF/springy
src/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
gpl-3.0
snnn/tensorflow
tensorflow/python/kernel_tests/matrix_solve_op_test.py
47
7968
# Copyright 2015 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
boyxuper/urllib3
test/test_util.py
3
17347
import hashlib import warnings import logging import unittest import ssl from itertools import chain from mock import patch, Mock from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers from urllib3.util.timeout import Timeout from urllib3.util.url import ( get_host, ...
mit
nckx/dstat
plugins/dstat_vm_mem.py
4
1136
### Author: Bert de Bruijn <bert+dstat$debruijn,be> ### VMware memory stats ### Displays memory stats coming from the hypervisor inside VMware VMs. ### The vmGuestLib API from VMware Tools needs to be installed class dstat_plugin(dstat): def __init__(self): self.name = 'vmware memory' self.vars = ...
gpl-2.0
jbogaardt/chainladder-python
chainladder/development/tests/test_munich.py
1
1554
import numpy as np import chainladder as cl from rpy2.robjects.packages import importr from rpy2.robjects import r CL = importr("ChainLadder") def test_mcl_paid(): df = r("MunichChainLadder(MCLpaid, MCLincurred)").rx("MCLPaid") p = cl.MunichAdjustment(paid_to_incurred=("paid", "incurred")).fit( cl.De...
mit
darkforestzero/buck
third-party/py/pex/pex/interpreter.py
52
12996
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """pex support for interacting with interpreters.""" from __future__ import absolute_import import os import re import subprocess import sys from collections import defaultdict from pkg...
apache-2.0
meteorcloudy/tensorflow
tensorflow/contrib/image/python/ops/image_ops.py
6
21765
# 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
simongoffin/my_odoo_tutorial
addons/crm/report/crm_phonecall_report.py
16
4157
# -*- 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
pratikmallya/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/manifest.py
84
1387
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2006-2007 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...
apache-2.0
sureleo/leetcode
archive/python/math/MaxPointsOnALine.py
2
1654
# Definition for a point class Point: def __init__(self, a=0, b=0): self.x = a self.y = b class Solution: # @param points, a list of Points # @return an integer def maxPoints(self, points): result = 0 for i in xrange(len(points)): d = {} duplicate...
mit
kubeflow/kfp-tekton-backend
sdk/python/kfp/azure.py
1
3009
# Copyright 2019 The Kubeflow 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...
apache-2.0
mortenthansen/linux
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
rockerbox/kazoo
docs/conf.py
8
8004
# -*- coding: utf-8 -*- # # kazoo documentation build configuration file, created by # sphinx-quickstart on Fri Nov 11 13:23:01 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
apache-2.0
nikhilprathapani/python-for-android
python3-alpha/python3-src/Lib/ctypes/test/test_struct_fields.py
264
1503
import unittest from ctypes import * class StructFieldsTestCase(unittest.TestCase): # Structure/Union classes must get 'finalized' sooner or # later, when one of these things happen: # # 1. _fields_ is set. # 2. An instance is created. # 3. The type is used as field of another Structure/Union. ...
apache-2.0
kevin-who/socket-chat
node_modules/node-gyp/gyp/pylib/gyp/common.py
366
19638
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
mit
rokups/Urho3D
Source/Tools/BindTool/util.py
1
2213
import os import subprocess def cpp_demangle(name): return subprocess.check_output(['c++filt', name]).decode('utf-8').strip() def split_identifier(identifier): """Splits string at _ or between lower case and uppercase letters.""" prev_split = 0 parts = [] if '_' in identifier: parts = [...
mit
mhnatiuk/phd_sociology_of_religion
scrapper/build/Twisted/twisted/trial/_dist/workerreporter.py
43
3922
# -*- test-case-name: twisted.trial._dist.test.test_workerreporter -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test reporter forwarding test results over trial distributed AMP commands. @since: 12.3 """ from twisted.python.failure import Failure from twisted.python.reflect impor...
gpl-2.0
arowla/commando
commando/tests/test_conf.py
5
1988
from commando.conf import AutoProp, ConfigDict class TestClass(AutoProp): @AutoProp.default def source(self): return 'source' def test_auto(): t = TestClass() assert t.source == 'source' def test_override(): t = TestClass() t.source = 'source1' assert t.source == 'source1' ...
mit
jss-emr/openerp-7-src
openerp/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py
51
2829
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
VaibhavAgarwalVA/sympy
sympy/physics/optics/medium.py
93
4875
""" **Contains** * Medium """ from __future__ import division __all__ = ['Medium'] from sympy import Symbol, sympify, sqrt from sympy.physics.units import c, u0, e0 class Medium(Symbol): """ This class represents an optical medium. The prime reason to implement this is to facilitate refraction, Fermat...
bsd-3-clause
zzzirk/boto
boto/ses/exceptions.py
151
1830
""" Various exceptions that are specific to the SES module. """ from boto.exception import BotoServerError class SESError(BotoServerError): """ Sub-class all SES-related errors from here. Don't raise this error directly from anywhere. The only thing this gets us is the ability to catch SESErrors separ...
mit
robinro/ansible
lib/ansible/playbook/loop_control.py
66
1328
# (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...
gpl-3.0
soldag/home-assistant
homeassistant/components/nexia/sensor.py
10
7063
"""Support for Nexia / Trane XL Thermostats.""" from nexia.const import UNIT_CELSIUS from homeassistant.const import ( DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, PERCENTAGE, TEMP_CELSIUS, TEMP_FAHRENHEIT, ) from .const import DOMAIN, NEXIA_DEVICE, UPDATE_COORDINATOR from .entity import Nexi...
apache-2.0
samsu/neutron
tests/unit/services/vpn/test_vpnaas_driver_plugin.py
12
7430
# Copyright 2013, Nachi Ueno, NTT I3, 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...
apache-2.0
Openlights/firemix
plugins/fixture_step.py
1
2195
# This file is part of Firemix. # # Copyright 2013-2016 Jonathan Evans <jon@craftyjon.com> # # Firemix 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...
gpl-3.0
sgallagher/anaconda
pyanaconda/modules/storage/storage.py
1
14418
# # Kickstart module for the storage. # # Copyright (C) 2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is di...
gpl-2.0
kustodian/ansible
lib/ansible/modules/network/aci/aci_rest.py
13
14126
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.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_ve...
gpl-3.0
LLNL/spack
var/spack/repos/builtin/packages/muparser/package.py
5
1625
# 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 Muparser(Package): """C++ math expression parser library.""" homepage = "http://mupars...
lgpl-2.1
pkuyym/Paddle
paddle/contrib/float16/float16_transpiler.py
3
11063
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
lshain-android-source/external-chromium_org
media/tools/constrained_network_server/traffic_control_test.py
187
5943
#!/usr/bin/env python # 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. """End-to-end tests for traffic control library.""" import os import re import sys import unittest import traffic_control class...
bsd-3-clause
nishad-jobsglobal/odoo-marriot
addons/account/project/project.py
273
2423
# -*- 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 GNU...
agpl-3.0
blaze/dask
dask/array/reductions.py
1
52217
import builtins from collections.abc import Iterable import operator from functools import partial from itertools import product, repeat from math import factorial, log, ceil, log2 import numpy as np from numbers import Integral, Number from tlz import compose, partition_all, get, accumulate, pluck, drop from . impo...
bsd-3-clause
1suming/readthedocs.org
readthedocs/projects/migrations/0035_make_null.py
13
12994
# -*- 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): # Changing field 'Project.num_point' db.alter_column('projects_project', 'num_point', self.gf('django.db.mo...
mit
wilx/autoconf-archive
macro.py
9
4436
#! /usr/bin/env python from contextlib import closing import os, sys, subprocess, re, textwrap def loadFile(path): with closing( open(path) ) as fd: return fd.read() def writeFile(path, buffer): with closing( open(path, "w") ) as fd: fd.write(buffer) def splitSections(buffer): while buffer: assert...
gpl-3.0
PhonologicalCorpusTools/PyAnnotationGraph
polyglotdb/query/base/query.py
1
15416
from .results import BaseQueryResults from .func import Count from ..base.helper import key_for_cypher, value_for_cypher class BaseQuery(object): query_template = '''{match} {where} {optional_match} {with} {return}''' delete_template = '''DETACH DELETE {alias}''' aggregate_template = ''...
mit
tigersirvine/occtigerscricket
django/core/management/commands/reset.py
78
2540
from optparse import make_option from django.core.management.base import AppCommand, CommandError from django.core.management.color import no_style from django.core.management.sql import sql_reset from django.db import connections, transaction, DEFAULT_DB_ALIAS class Command(AppCommand): option_list = AppCommand....
bsd-3-clause
sheadovas/tools
misc/plotter.py
1
1780
#!/usr/bin/python # created by shead import sys import numpy as np import matplotlib.pyplot as plt import pylab """ USAGE ============ ./plotter.py [log] ./plotter.py my_log.log REQUIRED DEPENDENCIES ============ * Python2 * Matplot http://matplotlib.org/users/installing.html FILE FORMAT ============ [iterat...
mit
mihaip/NewsBlur
vendor/yaml/tokens.py
985
2573
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
mit
rdeheele/odoo
openerp/tools/pdf_utils.py
456
3659
# -*- 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...
agpl-3.0
compmech/meshless
meshless/espim/plate2d_add_k0s.py
1
1946
from meshless.espim.plate2d_add_k0s_cell_based import add_k0s as add_k0s_cell from meshless.espim.plate2d_add_k0s_cell_based_no_smoothing import add_k0s as add_k0s_cell_no_smoothing from meshless.espim.plate2d_add_k0s_edge_based import add_k0s as add_k0s_edge def add_k0s(k0, mesh, prop_from_node, method='cell-based', ...
bsd-2-clause
mrunge/horizon
openstack_dashboard/dashboards/admin/info/tables.py
11
6531
# 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 # distributed under t...
apache-2.0
Team-Blackout/BeastMode-Evita
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
dcosentino/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py
41
8713
""" Tests for testing the modulestore settings migration code. """ import copy import ddt from tempfile import mkdtemp from unittest import TestCase from xmodule.modulestore.modulestore_settings import ( convert_module_store_setting_if_needed, update_module_store_settings, get_mixed_stores, ) @ddt.ddt cl...
agpl-3.0
kunthar/hustle
test/test_pipeline.py
3
6724
import unittest from hustle.core.column_fn import ip_ntoa from hustle.core.pipeline import SelectPipe, _get_sort_range from hustle.core.marble import Marble from operator import itemgetter EMP_FIELDS = ("+@2id", "+$name", "+%2hire_date", "+@4salary", "+@2department_id") DEPT_FIELDS = ("+@2id", "+%2name", "+%2building...
mit
joshbruning/selenium
py/selenium/webdriver/phantomjs/service.py
53
2587
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
fayvlad/ArduinoJson
third-party/gtest-1.7.0/test/gtest_catch_exceptions_test.py
2139
9901
#!/usr/bin/env python # # Copyright 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 o...
mit
dushu1203/chromium.src
tools/perf/page_sets/simple_mobile_sites.py
9
1794
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class SimplePage(page_module.Page): def __init__(se...
bsd-3-clause
maxdeliso/elevatorSim
Lib/test/test_iterlen.py
59
7747
""" Test Iterator Length Transparency Some functions or methods which accept general iterable arguments have optional, more efficient code paths if they know how many items to expect. For instance, map(func, iterable), will pre-allocate the exact amount of space required whenever the iterable can report its length. T...
bsd-2-clause
jbrahy/capstone
bindings/python/test_skipdata.py
31
2425
#!/usr/bin/env python # Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com> from __future__ import print_function from capstone import * import binascii from xprint import to_x, to_hex, to_x_32 X86_CODE32 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00\x00\x91\x92" RANDOM_CODE = b"\xed\x00\x00\x0...
bsd-3-clause
Stargrazer82301/CAAPR
CAAPR/CAAPR_AstroMagic/PTS/pts/magic/catalog/builder.py
1
7693
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
mit
foobarbazblarg/stayclean
stayclean-2017-march/participant.py
60
1524
import datetime class Participant: def __init__(self): self.name = "" self.isStillIn = True self.hasCheckedIn = False self.relapseDate = None @property def hasRelapsed(self): return self.relapseDate is not None def setFromLine(self, lineString): # form...
mit
nskinkel/oppy
oppy/tests/integration/cell/test_fixedlen.py
1
12689
import struct import unittest from collections import OrderedDict from oppy.cell.fixedlen import ( FixedLenCell, Create2Cell, Created2Cell, CreatedFastCell, CreatedCell, CreateFastCell, CreateCell, DestroyCell, EncryptedCell, NetInfoCell, PaddingCell, ) from oppy.cell.util ...
bsd-3-clause
kevin8909/xjerp
openerp/addons/auth_signup/res_config.py
445
2860
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
lnls-fac/apsuite
apsuite/commisslib/injsi_optimization.py
1
3074
""".""" import time as _time import numpy as _np from epics import PV from apsuite.optimization import SimulAnneal from siriuspy.devices import Tune, TuneCorr, CurrInfoSI from ..utils import MeasBaseClass as _BaseClass, \ ParamsBaseClass as _ParamsBaseClass class InjSIParams(_ParamsBaseClass): """.""" de...
mit
alessandro-aglietti/git-repo
subcmds/abandon.py
48
2034
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
apache-2.0
Maqical/Firestorm
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
apagac/cfme_tests
cfme/test_framework/config.py
3
2560
""" classes to manage the cfme test framework configuration """ import os import warnings import attr import yaycl class Configuration(object): """ holds the current configuration """ def __init__(self): self.yaycl_config = None def configure(self, config_dir, crypt_key_file=None): ...
gpl-2.0
YuriyIlyin/ansible-modules-core
files/find.py
109
11313
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Ruggero Marchei <ruggero.marchei@daemonzone.net> # (c) 2015, Brian Coca <bcoca@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 #...
gpl-3.0
ecolitan/fatics
src/timer.py
1
2084
# Copyright (C) 2010 Wil Mahan <wmahan+fatics@gmail.com> # # This file is part of FatICS. # # FatICS 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 License, or # (at your optio...
agpl-3.0
codrut3/tensorflow
tensorflow/python/kernel_tests/garbage_collection_test.py
82
2102
# 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
CloudServer/cinder
cinder/volume/drivers/lvm.py
1
30310
# 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
LukeHoersten/ansible
lib/ansible/inventory/host.py
9
3582
# (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...
gpl-3.0
anedos/sqlalchemy-migrate-egg
migrate/changeset/databases/oracle.py
6
3748
""" Oracle database specific implementations of changeset classes. """ import sqlalchemy as sa from sqlalchemy.databases import oracle as sa_base from migrate import exceptions from migrate.changeset import ansisql, SQLA_06 if not SQLA_06: OracleSchemaGenerator = sa_base.OracleSchemaGenerator else: Oracle...
mit
kevclarx/ansible
lib/ansible/module_utils/dellos9.py
51
5696
# # (c) 2015 Peter Sprygada, <psprygada@ansible.com> # (c) 2017 Red Hat, Inc # # Copyright (c) 2016 Dell Inc. # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamica...
gpl-3.0
mpenning/exscript
src/Exscript/util/weakmethod.py
7
3634
# Copyright (C) 2007-2010 Samuel Abels. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANT...
gpl-2.0
makermade/arm_android-21_arm-linux-androideabi-4.8
lib/python2.7/distutils/tests/test_dist.py
83
15708
# -*- coding: utf8 -*- """Tests for distutils.dist.""" import os import StringIO import sys import unittest import warnings import textwrap from distutils.dist import Distribution, fix_help_options from distutils.cmd import Command import distutils.dist from test.test_support import TESTFN, captured_stdout, run_unitt...
gpl-2.0
suneel0101/django-easyrest
setup.py
1
1212
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright <2013> Suneel Chakravorty <suneel0101@gmail.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 3 of the License, or ...
mit
loic/django
django/conf/locale/pt/formats.py
504
1717
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = '...
bsd-3-clause
wangjun/simDownloader
simDHT.py
5
7047
#!/usr/bin/env python # encoding: utf-8 import socket import threading from hashlib import sha1 from random import randint from struct import unpack from socket import inet_ntoa from threading import Timer, Thread from time import sleep from collections import deque from bencode import bencode, bdecode from Queue impo...
gpl-2.0
unreal666/outwiker
src/outwiker/pages/search/htmlreport.py
3
2955
# -*- coding: UTF-8 -*- import html from outwiker.gui.guiconfig import GeneralGuiConfig from outwiker.core.system import getOS class HtmlReport (object): """ Класс для генерации HTML-а, для вывода найденных страниц """ def __init__(self, pages, searchPhrase, searchTags, application): """ ...
gpl-3.0
twitchyliquid64/misc-scripts
s3tool/boto/ec2/elb/__init__.py
110
32520
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software wi...
mit
pcameron/javafuse-read-only
fs/build/mx4j/tools/jython/jmxUtils.py
7
5355
""" Copyright (C) MX4J. All rights reserved. This software is distributed under the terms of the MX4J License version 1.0. See the terms of the MX4J License in the documentation provided with this software. author <a href="mailto:tibu@users.sourceforge.net">Carlos Quiroz</a> version $Revision: 1.1 $ ...
gpl-3.0
baidu/Paddle
python/paddle/fluid/tests/unittests/test_py_reader_push_pop.py
7
3749
# Copyright (c) 2018 PaddlePaddle 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 appli...
apache-2.0
ronekko/chainer
tests/chainer_tests/functions_tests/math_tests/test_clip.py
2
2885
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'shape': [(3, 2), ()], 'dtype': [numpy.float16, numpy.float32, ...
mit
reinout/django
tests/forms_tests/field_tests/test_datefield.py
23
8167
from datetime import date, datetime from django.forms import ( DateField, Form, HiddenInput, SelectDateWidget, ValidationError, ) from django.test import SimpleTestCase, override_settings from django.utils import translation class GetDate(Form): mydate = DateField(widget=SelectDateWidget) class DateFieldTe...
bsd-3-clause
VishvajitP/readthedocs.org
readthedocs/rtd_tests/tests/test_redirects.py
20
10441
from django.test import TestCase from django.test.utils import override_settings from django_dynamic_fixture import get from django_dynamic_fixture import fixture from readthedocs.builds.constants import LATEST from readthedocs.projects.models import Project from readthedocs.redirects.models import Redirect import l...
mit
isi-nlp/bolinas
extractor_synsem/extractor_synsem.py
2
14687
from common.exceptions import InvocationException from common.hgraph.hgraph import Hgraph from common.cfg import NonterminalLabel from lib.tree import Tree import re from collections import defaultdict as ddict import itertools from parser.vo_rule import Rule import sys DEFAULT_COMPOSITION_DEPTH = 3 class ExtractorSy...
mit
apache/incubator-airflow
airflow/providers/cncf/kubernetes/sensors/spark_kubernetes.py
5
4691
# # 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...
apache-2.0
mfm24/ChordViz
ChordViz.py
1
20081
# -*- coding: utf-8 -*- """ Created on Fri May 3 21:09:10 2013 @author: matt # based on MyPlayer3_Callback (which is newer than MyPlayer3.py) """ from __future__ import division import time, math, logging import numpy as np from threading import Lock, Thread import itertools # not sure I've added correct path in la...
mit
ferabra/edx-platform
common/djangoapps/course_action_state/tests/test_managers.py
126
7219
# pylint: disable=invalid-name, attribute-defined-outside-init """ Tests for basic common operations related to Course Action State managers """ from ddt import ddt, data from django.test import TestCase from collections import namedtuple from opaque_keys.edx.locations import CourseLocator from course_action_state.mode...
agpl-3.0
pymedusa/SickRage
ext/boto/sdb/db/blob.py
153
2437
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
gpl-3.0
pymedusa/SickRage
ext/boto/ec2/__init__.py
22
3094
# Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
gpl-3.0
GunoH/intellij-community
python/helpers/py2only/docutils/parsers/rst/languages/de.py
121
3465
# -*- coding: utf-8 -*- # $Id: de.py 7223 2011-11-21 16:43:06Z milde $ # Authors: Engelbert Gruber <grubert@users.sourceforge.net>; # Lea Wiemann <LeWiemann@gmail.com> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # ...
apache-2.0
openfun/edx-platform
common/djangoapps/pipeline_mako/__init__.py
140
2444
from edxmako.shortcuts import render_to_string from pipeline.conf import settings from pipeline.packager import Packager from pipeline.utils import guess_type from static_replace import try_staticfiles_lookup def compressed_css(package_name, raw=False): package = settings.PIPELINE_CSS.get(package_name, {}) i...
agpl-3.0
takeshineshiro/horizon
openstack_dashboard/dashboards/project/networks/tests.py
6
99697
# Copyright 2012 NEC Corporation # # 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 ag...
apache-2.0
cpg1111/kubernetes
cluster/juju/charms/trusty/kubernetes/unit_tests/lib/test_registrator.py
96
2163
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
dubourg/openturns
python/test/t_DistFunc_noncentralchisquare.py
8
2054
#! /usr/bin/env python from __future__ import print_function from openturns import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: # NonCentralChiSquare related functions # dNonCentralChiSquare nuMin = 0.2 nuMax = 5.0 n1 = 5 lambdaMin = 0.2 lambdaMax = 5.0 n2 = 5 xMin = 0.1 x...
gpl-3.0
bopo/cookiecutter-django
{{cookiecutter.project_slug}}/config/settings/production.py
2
11973
# -*- coding: utf-8 -*- """ Production Configurations - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis for cache {% if cookiecutter.use_sentry_for_error_reporting == 'y' %} - Use sentry for error logging {% endif %} {% if cookiecutter.use_opbeat == 'y' %} - Use opb...
bsd-3-clause
tukutela/Kay-Framework
kay/lib/werkzeug/contrib/atom.py
25
14976
# -*- coding: utf-8 -*- """ werkzeug.contrib.atom ~~~~~~~~~~~~~~~~~~~~~ This module provides a class called :class:`AtomFeed` which can be used to generate feeds in the Atom syndication format (see :rfc:`4287`). Example:: def atom_feed(request): feed = AtomFeed("My Blog", feed...
bsd-3-clause
fo2rist/infra-strike
backend/venv/Lib/site-packages/pip/_vendor/distlib/locators.py
129
50493
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
lgpl-3.0
crobby/sahara
sahara/tests/unit/plugins/cdh/test_config_helper.py
11
1492
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
tsdgeos/snapcraft
snapcraft/tests/test_formatting_utils.py
7
1952
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015, 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in...
gpl-3.0