repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
dsemi/Flexget | flexget/tests/test_couchpotato_list.py | 3 | 4492 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import json
import os
import mock
movie_list_file = os.path.join(os.path.dirname(__file__), 'couchpotato_movie_list_test_response.json')
qualities_profiles_file = os.path.join... | mit |
SteveDiamond/cvxpy | cvxpy/reductions/dcp2cone/atom_canonicalizers/__init__.py | 2 | 3720 | """
Copyright 2013 Steven Diamond
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... | gpl-3.0 |
elioth010/lugama | venv/lib/python2.7/site-packages/sqlalchemy/sql/annotation.py | 55 | 6136 | # sql/annotation.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The :class:`.Annotated` class and related routines; creates hash-equivalent
cop... | gpl-2.0 |
krageon/closure-linter | closure_linter/full_test.py | 24 | 3542 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | apache-2.0 |
schqiushui/kernel_sense_442_dlxwl | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
MingdaZhou/gnuradio | docs/doxygen/doxyxml/base.py | 333 | 6794 | #
# Copyright 2010 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 option)
# any later version.
#
#... | gpl-3.0 |
tseaver/google-cloud-python | asset/synth.py | 1 | 3228 | # Copyright 2018 Google 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
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
sergecodd/FireFox-OS | B2G/external/protobuf/python/google/protobuf/internal/type_checkers.py | 527 | 12163 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | apache-2.0 |
adelina-t/nova | nova/api/openstack/compute/contrib/multinic.py | 69 | 3469 | # Copyright 2011 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
fnouama/intellij-community | python/helpers/pydev/pydevd_constants.py | 39 | 8413 | '''
This module holds the constants used for specifying the states of the debugger.
'''
STATE_RUN = 1
STATE_SUSPEND = 2
PYTHON_SUSPEND = 1
try:
__setFalse = False
except:
import __builtin__
setattr(__builtin__, 'True', 1)
setattr(__builtin__, 'False', 0)
class DebugInfoHolder:
#we have to put it... | apache-2.0 |
nachandr/cfme_tests | cfme/tests/infrastructure/test_vm_delete.py | 2 | 1150 | import pytest
from cfme import test_requirements
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.utils.log_validator import LogValidator
from cfme.utils.wait import TimedOutError
from cfme.utils.wait import wait_for
pytestmark = [
pytest.mark.provider([RHEVMProvider], scope="module"),
p... | gpl-2.0 |
brittanystoroz/kitsune | kitsune/sumo/form_fields.py | 5 | 5859 | from django import forms
from django.conf import settings
from django.contrib.auth.models import User
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils import translation
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from babel import L... | bsd-3-clause |
karel-brinda/rnftools | rnftools/rnfformat/Validator.py | 1 | 4484 | import rnftools.rnfformat
import re
reg_lrn = re.compile(r"^([!-?A-^`-~]*)__([0-9a-f]+)__([!-?A-^`-~]+)__([!-?A-^`-~]*)$")
reg_prefix_part = re.compile(r"^[!-?A-^`-~]*$")
reg_id_part = re.compile(r"^[0-9a-f]+$")
reg_segmental_part = re.compile(r"^(?:(\([0-9FRN,]*\))(?:,(?!$)|$))+$")
reg_suffix_part = re.compile(r"^(?:... | mit |
bright-sparks/chromium-spacewalk | tools/find_depot_tools.py | 45 | 1412 | # 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.
"""Small utility function to find depot_tools and add it to the python path.
Will throw an ImportError exception if depot_tools can't be found since it
i... | bsd-3-clause |
40223117cda/w17test | static/Brython3.1.0-20150301-090019/Lib/opcode.py | 714 | 5442 |
"""
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
"""
__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
"haslocal", "hascompare", "hasfree", "opname", "opmap",
"HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"]
... | gpl-3.0 |
alliance-genome/agr_prototype | indexer/src/files/pickle_file.py | 3 | 1220 | import cPickle as pickle
class PickleFile:
def __init__(self, filename):
self.filename = filename
def save(self, objects):
print "Saving objects into file (" + self.filename + ") ..."
with open(self.filename, "wb") as f:
pickle.dump(objects, f, pickle.HIGHEST_PROTOCOL)
... | mit |
ychfan/tensorflow | tensorflow/python/framework/dtypes_test.py | 10 | 14160 | # 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 |
socketpair/asynqp | doc/examples/helloworld.py | 3 | 1283 | import asyncio
import asynqp
@asyncio.coroutine
def hello_world():
"""
Sends a 'hello world' message and then reads it from the queue.
"""
# connect to the RabbitMQ broker
connection = yield from asynqp.connect('localhost', 5672, username='guest', password='guest')
# Open a communications cha... | mit |
xpoft/babel | babel/messages/tests/__init__.py | 11 | 1025 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | bsd-3-clause |
awkspace/ansible | lib/ansible/vars/hostvars.py | 33 | 4272 | # (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 |
mlperf/inference_results_v0.5 | closed/NVIDIA/code/common/harness.py | 1 | 13993 | # Copyright (c) 2019, NVIDIA CORPORATION. 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 |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/_threading_local.py | 241 | 7456 | """Thread-local objects.
(Note that this module provides a Python version of the threading.local
class. Depending on the version of Python you're using, there may be a
faster one available. You should always import the `local` class from
`threading`.)
Thread-local objects support the management of thread-local d... | gpl-2.0 |
sils1297/readthedocs.org | readthedocs/redirects/utils.py | 39 | 1316 | from django.conf import settings
from django.core.urlresolvers import reverse
def redirect_filename(project, filename=None):
"""
Return a url for a page. Always use http for now,
to avoid content warnings.
"""
protocol = "http"
# Handle explicit http redirects
if filename.startswith(protoc... | mit |
alnaav/shredNN | nn/train/gradient_descent_trainer.py | 1 | 3264 | import numpy as np
from nn.train.trainer import Trainer
class LayerData:
def __init__(self, layer):
self.z = np.zeros(layer.size)
self.a = np.zeros(layer.size)
self.neuron_error = np.zeros(layer.size)
self.grad_w = np.zeros(layer.w.shape)
self.grad_b = np.zeros(layer.b.sha... | apache-2.0 |
dqnykamp/sympy | sympy/plotting/pygletplot/plot_rotation.py | 24 | 1460 | from __future__ import print_function, division
from pyglet.gl import *
from math import sqrt as _sqrt, acos as _acos
def cross(a, b):
return (a[1] * b[2] - a[2] * b[1],
a[2] * b[0] - a[0] * b[2],
a[0] * b[1] - a[1] * b[0])
def dot(a, b):
return a[0] * b[0] + a[1] * b[1] + a[2] * b[... | bsd-3-clause |
zhuyongyong/crosswalk-test-suite | webapi/tct-2dtransforms-css3-tests/inst.apk.py | 1996 | 3186 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
andyvand/cygsystem-config-llvm | src/Properties_Renderer.py | 1 | 7792 | """This renderer class renders volume properties into a separate
drawing area next to the main volume rendering drawing area.
"""
import sys
import math
import operator
import types
import select
import signal
import gobject
import pango
import string
import os
from lvmui_constants import *
import stat
import gett... | gpl-2.0 |
israeltobias/DownMedia | youtube-dl/youtube_dl/extractor/aljazeera.py | 22 | 1313 | from __future__ import unicode_literals
from .common import InfoExtractor
class AlJazeeraIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?aljazeera\.com/programmes/.*?/(?P<id>[^/]+)\.html'
_TEST = {
'url': 'http://www.aljazeera.com/programmes/the-slum/2014/08/deliverance-201482883754237240.html'... | gpl-3.0 |
AndrewSallans/osf.io | scripts/consistency/find_bad_registrations.py | 64 | 1244 | """
"""
from website.app import init_app
from website import models
from framework import Q
app = init_app()
known_schemas = [
'Open-Ended_Registration',
'OSF-Standard_Pre-Data_Collection_Registration',
'Replication_Recipe_(Brandt_et_al__!dot!__,_2013):_Pre-Registration',
'Replication_Recipe_(Brandt... | apache-2.0 |
nkgilley/home-assistant | homeassistant/components/isy994/climate.py | 6 | 8182 | """Support for Insteon Thermostats via ISY994 Platform."""
from typing import Callable, List, Optional
from pyisy.constants import (
CMD_CLIMATE_FAN_SETTING,
CMD_CLIMATE_MODE,
PROP_HEAT_COOL_STATE,
PROP_HUMIDITY,
PROP_SETPOINT_COOL,
PROP_SETPOINT_HEAT,
PROP_UOM,
PROTO_INSTEON,
)
from h... | apache-2.0 |
qinjian623/emacs-config | .python-environments/default/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/charsetgroupprober.py | 2929 | 3791 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | gpl-3.0 |
mrjefftang/psutil | psutil/_pssunos.py | 2 | 19493 | # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Sun OS Solaris platform implementation."""
import errno
import os
import socket
import subprocess
import sys
from collections import namedtuple
from .... | bsd-3-clause |
droobey/meeseeksbox | src/action.py | 1 | 16274 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | mit |
tomasreimers/tensorflow-emscripten | tensorflow/contrib/deprecated/summaries_test.py | 130 | 2236 | # 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 |
betoesquivel/PLYpractice | env/lib/python2.7/site-packages/pip/utils/logging.py | 91 | 3186 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
try:
from pip._vendor import colorama
# Lots of different errors can come from this, incl... | mit |
jhsenjaliya/incubator-airflow | airflow/example_dags/docker_copy_data.py | 16 | 3307 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
kerma/Sublime-AdvancedNewFile | advanced_new_file/completions/windows_completion.py | 4 | 2532 | import re
from .completion_base import GenerateCompletionListBase
from ..anf_util import *
class WindowsCompletion(GenerateCompletionListBase):
def __init__(self, command):
super(WindowsCompletion, self).__init__(command)
self.view = command.view
def completion(self, path_in):
pattern... | mit |
hamish/SmeltCMS | packages/flask/signals.py | 123 | 2209 | # -*- coding: utf-8 -*-
"""
flask.signals
~~~~~~~~~~~~~
Implements signals based on blinker if available, otherwise
falls silently back to a noop.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
signals_available = False
try:
from blinker import Nam... | gpl-3.0 |
ondra-novak/chromium.src | chrome/common/extensions/docs/server2/mock_file_system_test.py | 85 | 4664 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from copy import deepcopy
from file_system import FileNotFoundError, StatInfo
from mock_file_system import MockFileSystem
from test_fil... | bsd-3-clause |
markslwong/tensorflow | tensorflow/python/saved_model/main_op_impl.py | 15 | 2244 | # 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 |
nysan/yocto-autobuilder | lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/internet/ssl.py | 18 | 6230 | # -*- test-case-name: twisted.test.test_ssl -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
SSL transport. Requires PyOpenSSL (http://pyopenssl.sf.net).
SSL connections require a ContextFactory so they can create SSL contexts.
End users should only use the ContextFactory classes direc... | gpl-2.0 |
arbrandes/edx-platform | lms/djangoapps/course_api/blocks/serializers.py | 3 | 8465 | """
Serializers for Course Blocks related return objects.
"""
from django.conf import settings
from rest_framework import serializers
from rest_framework.reverse import reverse
from lms.djangoapps.course_blocks.transformers.visibility import VisibilityTransformer
from .transformers.block_completion import BlockComp... | agpl-3.0 |
theeluwin/textrankr | textrankr/utils.py | 1 | 2716 | from typing import (
List,
Tuple,
Callable,
)
from re import split
from itertools import combinations
from collections import Counter
from networkx import Graph
from .sentence import Sentence
__all__: Tuple[str, ...] = (
'parse_text_into_sentences',
'multiset_jaccard_index',
'build_sentence... | mit |
alash3al/rethinkdb | external/v8_3.30.33.16/build/gyp/test/mac/gyptest-app.py | 75 | 4193 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that app bundles are built correctly.
"""
import TestGyp
import os
import plistlib
import subprocess
import sys
def GetStdou... | agpl-3.0 |
dc3-plaso/plaso | plaso/parsers/winreg_plugins/usbstor.py | 1 | 4441 | # -*- coding: utf-8 -*-
"""File containing a Windows Registry plugin to parse the USBStor key."""
import logging
from plaso.containers import windows_events
from plaso.parsers import winreg
from plaso.parsers.winreg_plugins import interface
__author__ = 'David Nides (david.nides@gmail.com)'
class USBStorPlugin(in... | apache-2.0 |
loveyoupeng/rt | modules/web/src/main/native/Tools/Scripts/webkitpy/common/read_checksum_from_png_unittest.py | 124 | 3570 | # 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:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | gpl-2.0 |
remitamine/youtube-dl | youtube_dl/extractor/vidlii.py | 28 | 4530 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
float_or_none,
get_element_by_id,
int_or_none,
strip_or_none,
unified_strdate,
urljoin,
)
class VidLiiIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vidlii\.com... | unlicense |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/idlelib/ToolTip.py | 149 | 2736 | # general purpose 'tooltip' routines - currently unused in idlefork
# (although the 'calltips' extension is partly based on this code)
# may be useful for some purposes in (or almost in ;) the current project scope
# Ideas gleaned from PySol
from Tkinter import *
class ToolTipBase:
def __init__(self, button):
... | mit |
JetBrains/intellij-community | python/helpers/third_party/thriftpy/_shaded_thriftpy/transport/memory/__init__.py | 5 | 1271 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from io import BytesIO
from _shaded_thriftpy._compat import CYTHON
from ..base import TTransportBase
class TMemoryBuffer(TTransportBase):
"""Wraps a BytesIO object as a TTransport."""
def __init__(self, value=None):
"""value -- a value... | apache-2.0 |
shastah/spacewalk | client/tools/rhncustominfo/rhn-custom-info.py | 7 | 6864 | #!/usr/bin/python -u
#
# 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 sho... | gpl-2.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/pickletester.py | 48 | 32504 | import unittest
import pickle
import cPickle
import pickletools
import copy_reg
from test.test_support import TestFailed, have_unicode, TESTFN, \
run_with_locale
# Tests that try a number of pickle protocols should have a
# for proto in protocols:
# kind of outer loop.
assert pickle.... | apache-2.0 |
unreal666/outwiker | src/outwiker/gui/basepagepanel.py | 2 | 4433 | # -*- coding: utf-8 -*-
import logging
import os.path
import wx
from wx.lib.scrolledpanel import ScrolledPanel
from outwiker.core.event import Event
logger = logging.getLogger('outwiker.gui.pasepagepanel')
class BasePagePanel(ScrolledPanel):
"""
Базовый класс для панелей представления страниц
"""
... | gpl-3.0 |
MakeHer/edx-platform | pavelib/utils/test/suites/acceptance_suite.py | 28 | 5220 | """
Acceptance test suite
"""
from paver.easy import sh, call_task
from pavelib.utils.test import utils as test_utils
from pavelib.utils.test.suites.suite import TestSuite
from pavelib.utils.envs import Env
__test__ = False # do not collect
class AcceptanceTest(TestSuite):
"""
A class for running lettuce ac... | agpl-3.0 |
Beauhurst/django | tests/select_related/models.py | 27 | 3041 | """
Tests for select_related()
``select_related()`` follows all relationships and pre-caches any foreign key
values so that complex trees can be fetched in a single query. However, this
isn't always a good idea, so the ``depth`` argument control how many "levels"
the select-related behavior will traverse.
"""
from dj... | bsd-3-clause |
CDSherrill/psi4 | psi4/driver/qcdb/textables.py | 3 | 18654 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2019 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
colby/tenyks-contrib | src/tenyksafk/main.py | 3 | 3809 | import sqlite3
from os.path import join
from tenyksservice import TenyksService, FilterChain, run_service
from tenyksservice.config import settings
class AFK(TenyksService):
irc_message_filters = {
'depart': FilterChain([r'^(?i)(xopa|away|afk|brb)'], direct_only=False),
'return': FilterChain([r'^(?... | mit |
ppiotr/Invenio | modules/webmessage/lib/webmessage_webinterface.py | 25 | 18284 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 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 the
## ... | gpl-2.0 |
Designist/sympy | sympy/diffgeom/rn.py | 123 | 4501 | """Predefined R^n manifolds together with common coord. systems.
Coordinate systems are predefined as well as the transformation laws between
them.
Coordinate functions can be accessed as attributes of the manifold (eg `R2.x`),
as attributes of the coordinate systems (eg `R2_r.x` and `R2_p.theta`), or by
using the us... | bsd-3-clause |
fzheng/codejam | lib/python2.7/site-packages/ipywidgets/__init__.py | 2 | 2219 | """Interactive widgets for the Jupyter notebook.
Provide simple interactive controls in the notebook.
Each Widget corresponds to an object in Python and Javascript,
with controls on the page.
To put a Widget on the page, you can display it with IPython's display machinery::
from ipywidgets import IntSlider
f... | mit |
joyechan/shadowsocks | shadowsocks/crypto/table.py | 1044 | 8108 | # !/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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... | apache-2.0 |
exploreodoo/datStruct | odoo/addons/hr_evaluation/__init__.py | 432 | 1084 | # -*- encoding: 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 G... | gpl-2.0 |
jmckaskill/subversion | tools/dev/iz/ff2csv.py | 5 | 6462 | #!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
mozilla-it/mozlibldap | examples/make-pubkeys-investigation.py | 1 | 3570 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2015 Mozilla Corporation
# Author: jvehent@mozilla.com
# Requires:
# mozlibldap
f... | mpl-2.0 |
x303597316/hue | desktop/core/ext-py/Django-1.6.10/tests/urls.py | 70 | 1050 | from django.conf.urls import patterns, include
urlpatterns = patterns('',
# test_client urls
(r'^test_client/', include('test_client.urls')),
(r'^test_client_regress/', include('test_client_regress.urls')),
# File upload test views
(r'^file_uploads/', include('file_uploads.urls')),
# Always p... | apache-2.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/eventlet-0.9.14/build/lib.linux-i686-2.7/eventlet/greenpool.py | 13 | 8995 | import itertools
import traceback
from eventlet import event
from eventlet import greenthread
from eventlet import queue
from eventlet import semaphore
from eventlet.support import greenlets as greenlet
__all__ = ['GreenPool', 'GreenPile']
DEBUG = True
class GreenPool(object):
"""The GreenPool class is a pool o... | apache-2.0 |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/test/time_hashlib.py | 213 | 2856 | # It's intended that this script be run by hand. It runs speed tests on
# hashlib functions; it does not test for correctness.
import sys, time
import hashlib
def creatorFunc():
raise RuntimeError, "eek, creatorFunc not overridden"
def test_scaled_msg(scale, name):
iterations = 106201/scale * 20
longSt... | mit |
BlackHole/enigma2-obh10 | lib/python/Components/TimerSanityCheck.py | 2 | 13683 | import NavigationInstance
from time import localtime, mktime, gmtime, time
from enigma import iServiceInformation, eServiceCenter, eServiceReference, getBestPlayableServiceReference
from timer import TimerEntry
import RecordTimer
from Tools.CIHelper import cihelper
from Components.config import config
class TimerSani... | gpl-2.0 |
thegreatoldone/flaxscript | qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py | 185 | 5065 |
"""
Copyright 2011 Jeff Garzik
AuthServiceProxy has the following improvements over python-jsonrpc's
ServiceProxy class:
- HTTP connections persist for the life of the AuthServiceProxy object
(if server supports HTTP/1.1)
- sends protocol 'version', per JSON-RPC 1.1
- sends proper, incrementing 'id'
... | mit |
scorpilix/Golemtest | golem/interface/client/environments.py | 1 | 1674 | from golem.core.deferred import sync_wait
from golem.interface.command import group, Argument, command, CommandResult
@group(name="envs", help="Manage environments")
class Environments(object):
name = Argument('name', help="Environment name")
table_headers = ['name', 'supported', 'active', 'performance',
... | gpl-3.0 |
davidmueller13/efficientkernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
credativ/gofer | src/gofer/messaging/adapter/proton/producer.py | 2 | 2787 | # Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | lgpl-2.1 |
darktears/chromium-crosswalk | tools/telemetry/third_party/modulegraph/setup.py | 50 | 24959 | """
Shared setup file for simple python packages. Uses a setup.cfg that
is the same as the distutils2 project, unless noted otherwise.
It exists for two reasons:
1) This makes it easier to reuse setup.py code between my own
projects
2) Easier migration to distutils2 when that catches on.
Additional functionality:... | bsd-3-clause |
GitHublong/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlrd/formatting.py | 64 | 45189 | # -*- coding:cp1252 -*-
##
# Module for formatting information.
#
# <p>Copyright © 2005-2008 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>Copyright © 2005-2009 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under
# a BSD-style licence.</p>
##
# No part of the c... | apache-2.0 |
pbs/django-select2 | tests/testapp/forms/__init__.py | 10 | 1725 | # -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import forms
from django_select2.fields import Select2MultipleWidget
from django_select2.widgets import Select2Widget, HeavySelect2Widget, HeavySelect2MultipleWidget
from tests.testapp import models
from . import fields
cla... | apache-2.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-machinelearningcompute/setup.py | 2 | 2845 | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | mit |
ionelmc/python-aspectlib | tests/test_aspectlib_test.py | 1 | 17683 | from __future__ import print_function
from pytest import raises
from test_pkg1.test_pkg2 import test_mod
from aspectlib import PY2
from aspectlib.test import OrderedDict
from aspectlib.test import Story
from aspectlib.test import StoryResultWrapper
from aspectlib.test import _Binds
from aspectlib.test import _format_... | bsd-2-clause |
abstract-open-solutions/OCB | addons/sale_service/__init__.py | 354 | 1060 | # -*- 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 |
pyrrho314/recipesystem | trunk/astrodata/DataSpider.py | 1 | 42351 | try:
import pyfits
except:
pass
import os
import re
from AstroData import *
ldebug = False
verbose = False
from astrodata.adutils import terminal
from ReductionContextRecords import AstroDataRecord
import subprocess
import os
from copy import copy,deepcopy
from AstroData import Errors
from astrodata import new... | mpl-2.0 |
kswiat/django | django/contrib/gis/geos/prototypes/geom.py | 114 | 4443 | from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_sized_string, check_string, check_zero)
from django.contrib.gis.geos.prototypes.threadsafe import G... | bsd-3-clause |
jstoxrocky/statsmodels | statsmodels/tsa/statespace/tests/results/results_kalman_filter.py | 37 | 41500 | """
Results for Kalman Filter
Author: Chad Fulton
License: Simplified-BSD
Notes
-----
There was an error in the loglikelihood computation in the GAUSS code from
Kim and Nelson for the Clark 1989 model, omitting the exponent term on
``2 pi''. Therefore the loglikelihood in the test results for uc_bi is instead
from t... | bsd-3-clause |
shakamunyi/nova | nova/api/openstack/compute/schemas/v3/reset_server_state.py | 110 | 1090 | # Copyright 2014 NEC Corporation. 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 ... | apache-2.0 |
eBay/restcommander | play-1.2.4/python/Lib/msilib/schema.py | 91 | 83726 | from . import Table
_Validation = Table('_Validation')
_Validation.add_field(1,'Table',11552)
_Validation.add_field(2,'Column',11552)
_Validation.add_field(3,'Nullable',3332)
_Validation.add_field(4,'MinValue',4356)
_Validation.add_field(5,'MaxValue',4356)
_Validation.add_field(6,'KeyTable',7679)
_Validation.add_field... | apache-2.0 |
teamclairvoyant/airflow-scheduler-failover-controller | scheduler_failover_controller/metadata/base_metadata_service.py | 1 | 1260 | import datetime
from scheduler_failover_controller.utils import date_utils
class BaseMetadataService:
def initialize_metadata_source(self):
raise NotImplementedError
def get_failover_heartbeat(self):
raise NotImplementedError
def set_failover_heartbeat(self):
raise NotImplemente... | apache-2.0 |
initNirvana/Easyphotos | env/lib/python3.4/site-packages/gunicorn/config.py | 25 | 45431 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
# Please remember to run "make -C docs html" after update "desc" attributes.
import copy
import grp
import inspect
try:
import argparse
except ImportError: # python 2.6
from . import... | mit |
muff1nman/duplicity | testing/functional/test_badupload.py | 3 | 1496 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
# Copyright 2011 Canonical Ltd
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of... | gpl-2.0 |
proximo256/kernel_samsung_exynos7420 | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
surhudm/scipy | benchmarks/benchmarks/go_benchmark_functions/go_funcs_I.py | 47 | 1181 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from numpy import sin, sum
from .go_benchmark import Benchmark
class Infinity(Benchmark):
r"""
Infinity objective function.
This class defines the Infinity [1]_ global optimization problem. This
is a multimodal... | bsd-3-clause |
kerr-huang/SL4A | python-build/python-libs/gdata/src/gdata/tlslite/messages.py | 273 | 18429 | """Classes representing TLS messages."""
from utils.compat import *
from utils.cryptomath import *
from errors import *
from utils.codec import *
from constants import *
from X509 import X509
from X509CertChain import X509CertChain
import sha
import md5
class RecordHeader3:
def __init__(self):
self.type ... | apache-2.0 |
40223245/40223245W11 | static/Brython3.1.0-20150301-090019/Lib/colorsys.py | 1066 | 3691 | """Conversion functions between RGB and other color systems.
This modules provides two functions for each color system ABC:
rgb_to_abc(r, g, b) --> a, b, c
abc_to_rgb(a, b, c) --> r, g, b
All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly... | gpl-3.0 |
stephentyrone/swift | utils/build_swift/build_swift/wrappers/xcrun.py | 18 | 5608 | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list o... | apache-2.0 |
freiheit/Bay-Oh-Woolph | cogs/basicpromotions.py | 1 | 14770 | from discord.ext import commands
from utils import *
import discord
import asyncio
from cogs.updateroster import UpdateRoster
from config import Config
import logging
logger = logging.getLogger('bayohwoolph.cogs.basicpromotions')
BASICPROMOTIONS = Config.config['BASICPROMOTIONS']
ROLE_CADET = BASICPROMOTIONS['ROLE_... | agpl-3.0 |
Hao-Liu/tp-libvirt | libguestfs/tests/guestfs_block_operations.py | 8 | 13825 | import re
import logging
from autotest.client.shared import error, utils
from virttest import virt_vm, remote, aexpect
from virttest import utils_test
def prepare_attached_device(guestfs, device):
"""
Prepare attached device for block test.
:param guestfs: instance of GuestfishTools
:param device: at... | gpl-2.0 |
stvstnfrd/edx-platform | lms/djangoapps/verify_student/tasks.py | 1 | 5646 | """
Django Celery tasks for service status app
"""
import logging
from smtplib import SMTPException
import requests
import simplejson
from celery import Task, shared_task
from celery.states import FAILURE
from django.conf import settings
from django.core.mail import EmailMessage
from edx_django_utils.monitoring impor... | agpl-3.0 |
locksmithone/qcnsim | tag/20140102/doc/validations/weibull/weibullGenerator.py | 3 | 3655 | import numpy
#import scipy
import matplotlib.pyplot
import math
def weibullGenerator(scale, shape, start, end, step):
'''
Generates Weibull sample lists per the parameters.
Returns two lists of X and Y values distributed per Weibull.
'''
weibullSamplesY = []
weibullSamplesX = []
for i ... | lgpl-2.1 |
wumch/shadowsocks | shadowsocks/udprelay.py | 24 | 10478 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 |
sanjeevtripurari/hue | desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euctwprober.py | 2994 | 1676 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | apache-2.0 |
lgeiger/ide-python | lib/debugger/VendorLib/vs-py-debugger/pythonFiles/parso/python/parser.py | 5 | 10640 | from parso.python import tree
from parso.python.token import (DEDENT, INDENT, ENDMARKER, NEWLINE, NUMBER,
STRING, tok_name, NAME, FSTRING_STRING,
FSTRING_START, FSTRING_END)
from parso.parser import BaseParser
from parso.pgen2.parse import token_to_ilabel
... | mit |
jimcunderwood/MissionPlanner | Lib/encodings/mac_iceland.py | 93 | 14061 | """ Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.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 deco... | gpl-3.0 |
nrwahl2/ansible | lib/ansible/modules/system/kernel_blacklist.py | 26 | 4112 | #!/usr/bin/python
# encoding: utf-8 -*-
# (c) 2013, Matthias Vogelgesang <matthias.vogelgesang@gmail.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_v... | gpl-3.0 |
jlasolis/xhtml2pdf | test/helloworld.py | 154 | 1057 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.