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 |
|---|---|---|---|---|---|
google/google-ctf | third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_imaplib.py | 9 | 7469 | from test import test_support as support
# If we end up with a significant number of tests that don't require
# threading, this test module should be split. Right now we skip
# them all if we don't have threading.
threading = support.import_module('threading')
from contextlib import contextmanager
import imapl... | apache-2.0 |
kazemakase/scikit-learn | sklearn/externals/joblib/format_stack.py | 238 | 15536 | """
Represent an exception with a lot of information.
Provides 2 useful functions:
format_exc: format an exception into a complete traceback, with full
debugging instruction.
format_outer_frames: format the current position in the stack call.
Adapted from IPython's VerboseTB.
"""
# Authors: Gael Varoqua... | bsd-3-clause |
MahmoudDolah/Firmware-Entry-Points-In-Memory | openwrt/OpenWrt-ImageBuilder-15.05.1-x86-generic.Linux-x86_64/staging_dir/host/bin/scons.py | 14 | 6796 | #! /usr/bin/env python
#
# SCons - a Software Constructor
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
... | apache-2.0 |
joequery/django | django/utils/_os.py | 502 | 3581 | from __future__ import unicode_literals
import os
import sys
import tempfile
from os.path import abspath, dirname, isabs, join, normcase, normpath, sep
from django.core.exceptions import SuspiciousFileOperation
from django.utils import six
from django.utils.encoding import force_text
if six.PY2:
fs_encoding = sy... | bsd-3-clause |
neoscoin/neos-core | qa/rpc-tests/smartfees.py | 129 | 4301 | #!/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.
#
# Test fee estimation code
#
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy impo... | mit |
sadleader/odoo | addons/hr_timesheet_sheet/report/hr_timesheet_report.py | 71 | 3842 | # -*- 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 |
Guneet-Dhillon/mxnet | tests/python/common/models.py | 54 | 2065 | # 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 |
temasek/android_external_chromium_org_third_party_WebKit | Source/bindings/scripts/utilities.py | 9 | 8354 | # 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.
"""Utility functions (file reading, simple IDL parsing by regexes) for IDL build.
Design doc: http://www.chromium.org/developers/design-documents/idl-build
... | bsd-3-clause |
jt6562/XX-Net | python27/1.0/lib/noarch/yaml/error.py | 691 | 2559 |
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']
class Mark(object):
def __init__(self, name, index, line, column, buffer, pointer):
self.name = name
self.index = index
self.line = line
self.column = column
self.buffer = buffer
self.pointer = pointer
def get... | bsd-2-clause |
selecsosi/django-cms | cms/test_utils/project/urls_no18n.py | 14 | 1342 | from cms.utils.compat.dj import is_installed
from cms.utils.conf import get_cms_setting
from django.conf import settings
from django.conf.urls import patterns, include, \
url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
admin.autodiscover()
urlpatterns = pa... | bsd-3-clause |
lezizi/A-Framework | python/net-soruce/src/xmpp/session.py | 1 | 17248 | ##
## XMPP server
##
## Copyright (C) 2004 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later v... | apache-2.0 |
mway08/grpc | src/python/src/grpc/framework/base/_emission.py | 39 | 4850 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
fuchsia-mirror/third_party-grpc | tools/buildgen/plugins/expand_version.py | 5 | 3140 | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
akumar21NCSU/servo | components/script/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py | 106 | 1379 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
callback Function = any(any... arguments);
interface TestTreatNonCallableAsNull1 {
[TreatNonCallableAsNull] attribute Function? onfoo;
attribute Function? onbar;
};
""")
results = parser.finish()
... | mpl-2.0 |
lip6-mptcp/ns3mptcp | src/click/bindings/modulegen__gcc_ILP32.py | 124 | 289391 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
ElchinValiyev/GameAI | Project_3/breakout/fuzzy_agent.py | 1 | 1804 | import numpy as np
import skfuzzy as fuzz
from skfuzzy import control as ctrl
import matplotlib.pyplot as plt
class FuzzyAgent:
def __init__(self):
# Generate universe variables
distance = ctrl.Antecedent(np.arange(-440, 441, 1), 'distance') # paddle.x - ball.x
paddle_speed = ctrl.Conseq... | mit |
alepulver/my-thesis | results-tables/serializers/experiment.py | 1 | 2623 | from . import stage_groups as sz_stage
from . import groups
import stages
class Summary:
def header_for(self, experiment_class):
return [
'id', 'num_stages', 'start_time',
'duration', 'is_complete', 'size_in_bytes'
]
def data_for(self, experiment):
return [
... | mit |
gfneto/bitcoin-abe | Abe/Chain/Namecoin.py | 28 | 2180 | # Copyright(C) 2014 by Abe developers.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is dist... | agpl-3.0 |
zhangjiajie/tax_benchmark | script/ete2/clustering/clustertree.py | 2 | 8566 | __VERSION__="ete2-2.2rev1026"
# -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the t... | gpl-3.0 |
devs4v/devs4v-information-retrieval15 | project/venv/lib/python2.7/site-packages/nltk/sem/linearlogic.py | 10 | 16617 | # Natural Language Toolkit: Linear Logic
#
# Author: Dan Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2015 NLTK Project
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function, unicode_literals
from nltk.internals import Counter
from nltk.compat import strin... | mit |
zhengzhihust/tablib | tablib/packages/xlwt3/Row.py | 46 | 10111 | # -*- coding: windows-1252 -*-
from . import BIFFRecords
from . import Style
from .Cell import StrCell, BlankCell, NumberCell, FormulaCell, MulBlankCell, BooleanCell, ErrorCell, \
_get_cells_biff_data_mul
from . import ExcelFormula
import datetime as dt
try:
from decimal import Decimal
except ImportE... | mit |
40223105/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/xml/etree/ElementInclude.py | 784 | 5146 | #
# 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... | gpl-3.0 |
taknevski/tensorflow-xsmm | tensorflow/python/ops/data_flow_ops.py | 10 | 64969 | # 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 |
kifcaliph/odoo | addons/portal_sale/res_config.py | 445 | 1479 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
jylaxp/django | django/db/backends/mysql/client.py | 520 | 1518 | import subprocess
from django.db.backends.base.client import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'mysql'
@classmethod
def settings_to_cmd_args(cls, settings_dict):
args = [cls.executable_name]
db = settings_dict['OPTIONS'].get('db', settings_dic... | bsd-3-clause |
BechtelCIRT/cassava | cassava/Automater/outputs.py | 2 | 33878 | """
The outputs.py module represents some form of all outputs
from the Automater program to include all variation of
output files. Any addition to the Automater that brings
any other output requirement should be programmed in this module.
Class(es):
SiteDetailOutput -- Wrapper class around all functions that pass #NOM... | mit |
zchking/odoo | addons/portal_project_issue/tests/test_access_rights.py | 338 | 10547 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
arkabytes/abc | ABC/migrations/0029_auto_20180122_1032.py | 1 | 2973 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-01-22 10:32
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ABC', '0028_auto_20180121_1322'),
]
... | gpl-3.0 |
stylianos-kampakis/scikit-learn | sklearn/linear_model/theil_sen.py | 164 | 14315 | # -*- coding: utf-8 -*-
"""
A Theil-Sen Estimator for Multiple Linear Regression Model
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
#
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import warnings
from itertools import combinations
import numpy as np
from scipy... | bsd-3-clause |
popazerty/zde-e2 | lib/python/Plugins/SystemPlugins/NFIFlash/flasher.py | 33 | 9056 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.Standby import TryQuitMainloop
from Screens.Console import Console
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Components.Sources.Prog... | gpl-2.0 |
zhenyu-zhou/floodlight_exp | src/main/python/debugserver.py | 110 | 2124 | #!/usr/bin/env python
import sys
from threading import currentThread
from SocketServer import BaseRequestHandler, TCPServer
from code import InteractiveConsole
_locals = None
class DebugLogger(object):
def do_print(self, *args):
for i in args:
print i,
print
info = do_print
wa... | apache-2.0 |
lscsoft/gwdetchar | gwdetchar/io/datafind.py | 1 | 7423 | # coding=utf-8
# Copyright (C) Duncan Macleod (2015)
#
# This file is part of the GW DetChar python package.
#
# GW DetChar 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
#... | gpl-3.0 |
anasanzari/Cowcopy | tools/perf/util/setup.py | 766 | 1540 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
jruben/jruben.github.io | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_sourcemodbuiltins.py | 274 | 21929 | # -*- coding: utf-8 -*-
"""
pygments.lexers._sourcemodbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names of SourceMod functions.
It is able to re-generate itself.
Do not edit the FUNCTIONS list by hand.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
... | mit |
rcrowder/marsyas | src/marsyas_python/wekatest.py | 7 | 2096 | #!/usr/bin/env python
from pylab import *
from marsyas import MarSystemManager,MarControlPtr
msm = MarSystemManager()
weka= msm.create("WekaSource", "weka")
classifier= msm.create("GaussianClassifier", "classifier")
summary= msm.create("Summary", "summary")
pipe = msm.create("Series","pipe")
pipe.addMarSystem(weka)... | gpl-2.0 |
Imaginashion/cloud-vision | .fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/django/contrib/auth/tokens.py | 433 | 2803 | from datetime import date
from django.conf import settings
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.http import base36_to_int, int_to_base36
class PasswordResetTokenGenerator(object):
"""
Strategy object used to generate and check token... | mit |
fajoy/horizon-example | openstack_dashboard/dashboards/admin/info/urls.py | 1 | 1055 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
chenfengyuan/shadowsocks | shadowsocks/lru_cache.py | 983 | 4290 | #!/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 |
ryfeus/lambda-packs | Lxml_requests/source/click/_compat.py | 66 | 20706 | import re
import io
import os
import sys
import codecs
from weakref import WeakKeyDictionary
PY2 = sys.version_info[0] == 2
WIN = sys.platform.startswith('win')
DEFAULT_COLUMNS = 80
_ansi_re = re.compile('\033\[((?:\d|;)*)([a-zA-Z])')
def get_filesystem_encoding():
return sys.getfilesystemencoding() or sys.ge... | mit |
scudette/gtest | 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... | bsd-3-clause |
tlatzko/spmcluster | .tox/clean/lib/python2.7/site-packages/wheel/metadata.py | 219 | 10424 | """
Tools for converting old- to new-style metadata.
"""
from collections import defaultdict, namedtuple
from .pkginfo import read_pkg_info
import re
import os.path
import textwrap
import pkg_resources
import email.parser
import wheel
METADATA_VERSION = "2.0"
PLURAL_FIELDS = { "classifier" : "classifiers",
... | bsd-2-clause |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Demo/curses/rain.py | 12 | 2403 | #!/usr/bin/env python
#
# $Id$
#
# somebody should probably check the randrange()s...
import curses
from random import randrange
def next_j(j):
if j == 0:
j = 4
else:
j -= 1
if curses.has_colors():
z = randrange(0, 3)
color = curses.color_pair(z)
if z:
... | gpl-3.0 |
srickardti/openthread | tests/toranj/test-029-data-poll-interval.py | 7 | 5365 | #!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# 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
# ... | bsd-3-clause |
bobphill/compose | tests/unit/cli_test.py | 10 | 6308 | from __future__ import unicode_literals
from __future__ import absolute_import
import logging
import os
from .. import unittest
import docker
import mock
from compose.cli import main
from compose.cli.docopt_command import NoSuchCommand
from compose.cli.main import TopLevelCommand
from compose.service import Service
... | apache-2.0 |
Branlala/docker-sickbeardfr | sickbeard/lib/hachoir_parser/audio/au.py | 90 | 3327 | """
AU audio file parser
Author: Victor Stinner
Creation: 12 july 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import UInt32, Enum, String, RawBytes
from lib.hachoir_core.endian import BIG_ENDIAN
from lib.hachoir_core.text_handler import displayHandler, filesizeHandler
from lib.hachoir_c... | mit |
defionscode/ansible-modules-core | cloud/openstack/os_server_actions.py | 63 | 7057 | #!/usr/bin/python
# coding: utf-8 -*-
# Copyright (c) 2015, Jesse Keating <jlk@derpops.bike>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | gpl-3.0 |
sinkuri256/python-for-android | python3-alpha/python3-src/Lib/test/test_zipfile64.py | 66 | 4377 | # Tests of the full ZIP64 functionality of zipfile
# The support.requires call is the only reason for keeping this separate
# from test_zipfile
from test import support
# XXX(nnorwitz): disable this test by looking for extra largfile resource
# which doesn't exist. This test takes over 30 minutes to run in general
# ... | apache-2.0 |
MichaelDrogalis/ansible | lib/ansible/inventory/dir.py | 73 | 10727 | # (c) 2013, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2014, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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, ... | gpl-3.0 |
sdulal/oppia | core/domain/value_generators_domain.py | 18 | 4005 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
Ecpy/i3py | tests/backends/test_visa.py | 1 | 13911 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2016-2018 by I3py Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ----------------... | bsd-3-clause |
cyberia-/Volafile-API | volapi/multipart.py | 1 | 7861 | #!/usr/bin/env python3
'''
This file is part of Volapi.
Volapi 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.
Volapi is distributed in th... | gpl-3.0 |
depop/txstatsd | txstatsd/hashing.py | 1 | 2494 | # Copyright 2009 Chris Davis
#
# 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 |
USGSDenverPychron/pychron | pychron/extraction_line/extraction_line_learner.py | 1 | 7128 | # ===============================================================================
# Copyright 2012 Jake Ross
#
# 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/licens... | apache-2.0 |
garrettr/securedrop | securedrop/tests/functional/source_navigation_steps.py | 1 | 9653 | import tempfile
import time
from selenium.webdriver.common.action_chains import ActionChains
from step_helpers import screenshots
class SourceNavigationStepsMixin():
@screenshots
def _source_visits_source_homepage(self):
self.driver.get(self.source_location)
if not hasattr(self, 'accept_lan... | agpl-3.0 |
defionscode/ansible-modules-extras | cloud/vmware/vmware_vswitch.py | 71 | 6816 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
ddxgz/smartcity-demo | surveillance/reaper.py | 1 | 3840 | import os
import commands
import time
import string
import logging
import functools
import swiftclient
from swiftclient.exceptions import ClientException
from utils import funclogger, time2Stamp, stamp2Time
from config import Config
from videoedit import get_file_with_prefix
# logging.basicConfig(level=logging.DEBU... | mit |
jolyonb/edx-platform | lms/djangoapps/gating/tests/test_signals.py | 2 | 1641 | """
Unit tests for gating.signals module
"""
from __future__ import absolute_import
from mock import Mock, patch
from gating.signals import evaluate_subsection_gated_milestones
from student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_util... | agpl-3.0 |
karlp/libsigrokdecode | decoders/sdcard_spi/pd.py | 13 | 14535 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012-2014 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 t... | gpl-3.0 |
DLR-SC/DataFinder | src/datafinder/gui/user/controller/unmanaged_repository.py | 1 | 6778 | # $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the following conditions are
#met:
#
... | bsd-3-clause |
alexthered/kienhoc-platform | cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py | 137 | 4028 | """
Unittests for migrating a course to split mongo
"""
import unittest
from django.core.management import CommandError, call_command
from contentstore.management.commands.migrate_to_split import Command
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestC... | agpl-3.0 |
A425/django-nadmin | nadmin/plugins/quickfilter.py | 1 | 7051 | '''
Created on Mar 26, 2014
@author: LAB_ADM
'''
from django.utils.translation import ugettext_lazy as _
from nadmin.filters import manager,MultiSelectFieldListFilter
from nadmin.plugins.filters import *
@manager.register
class QuickFilterMultiSelectFieldListFilter(MultiSelectFieldListFilter):
""" Delegates the f... | mit |
thetimetravelerokarin/neural-hack | the-movie-bot.py | 1 | 4351 | '''
Name of the Task : The Movie Bot
KIITFEST ID : KF36723
Operating System : MacOS Sierra
Programming Language used: Python
External modules used (if any) : urllib2 htmlparser csv datetime codecs cstringIO
Additional instructions to use the program (if any) : None.
'''
import urllib2
import HTMLParser
import csv
impor... | gpl-3.0 |
sixfeetup/cloud-custodian | tests/test_query.py | 1 | 3164 | # Copyright 2016-2017 Capital One Services, 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 ... | apache-2.0 |
dupriest/EyeReader | eyex/types.py | 1 | 1842 | import ctypes as c
class TX_SYSTEMCOMPONENTOVERRIDEFLAGS():
TX_SYSTEMCOMPONENTOVERRIDEFLAG_NONE = 0
TX_SYSTEMCOMPONENTOVERRIDEFLAG_MEMORYMODEL = 1 << 0,
TX_SYSTEMCOMPONENTOVERRIDEFLAG_THREADINGMODEL = 1 << 1,
TX_SYSTEMCOMPONENTOVERRIDEFLAG_LOGGINGMODEL = 1 << 2,
TX_SYSTEMCOMPONENTOVERRIDEFLAG_SCHE... | mit |
GitHublong/hue | apps/impala/setup.py | 39 | 1222 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
killerstorm/ngcccbase | ngcccbase/tests/test_verifier.py | 4 | 3545 | #!/usr/bin/env python
import unittest
from ngcccbase.verifier import Verifier, hash_decode
from ngcccbase.services.electrum import (
ElectrumInterface, EnhancedBlockchainState)
class FakeBlockchainState(object):
def get_height(self):
return 100
def get_merkle(self, tx_hash):
l = ["3a459e... | mit |
mjescobar/RF_Estimation | Clustering/clustering/spaceClustering.py | 2 | 4653 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# spaceClustering.py
#
# Copyright 2014 Carlos "casep" Sepulveda <carlos.sepulveda@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 Found... | gpl-2.0 |
yuchangfu/pythonfun | flaskenv/Lib/encodings/punycode.py | 586 | 6813 | # -*- coding: iso-8859-1 -*-
""" Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = []
extended = {}
for c in st... | gpl-3.0 |
RydrDojo/Ridr_app | pylotVenv/lib/python2.7/site-packages/markupsafe/tests.py | 674 | 6107 | # -*- coding: utf-8 -*-
import gc
import sys
import unittest
from markupsafe import Markup, escape, escape_silent
from markupsafe._compat import text_type
class MarkupTestCase(unittest.TestCase):
def test_adding(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="appl... | mit |
algorithm-ninja/territoriali-backend | terry/schema.py | 1 | 5992 | #!/usr/bin/env python3
# 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 2017-2019 - Edoardo Morassutto <edoardo.morassutto@gmail.com>
# Copyright 2017 - Luc... | mpl-2.0 |
MihaiMoldovanu/ansible | lib/ansible/modules/cloud/cloudstack/cs_configuration.py | 48 | 8413 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
chenyuntc/pox | pox/messenger/__init__.py | 37 | 19551 | # Copyright 2011,2012 James McCauley
#
# 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 |
BMJHayward/numpy | numpy/linalg/info.py | 264 | 1198 | """\
Core Linear Algebra Tools
-------------------------
Linear algebra basics:
- norm Vector or matrix norm
- inv Inverse of a square matrix
- solve Solve a linear system of equations
- det Determinant of a square matrix
- lstsq Solve linear least-squares problem... | bsd-3-clause |
Stibbons/guake | guake/guake_app.py | 1 | 56873 | # -*- coding: utf-8; -*-
"""
Copyright (C) 2007-2012 Lincoln de Sousa <lincoln@minaslivre.org>
Copyright (C) 2007 Gabriel Falcão <gabrielteratos@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 Foundat... | gpl-2.0 |
d10genes/pystan | pystan/tests/test_basic_array.py | 4 | 2004 | import unittest
import numpy as np
import pystan
class TestBasicArray(unittest.TestCase):
@classmethod
def setUpClass(cls):
model_code = """
data {
int<lower=2> K;
}
parameters {
real beta[K,1,2];
}
model {
for (k in 1:K)
... | gpl-3.0 |
1032231418/python | day9/app/user.py | 4 | 1796 | #!/usr/bin/env python
# -*-coding:utf-8 -*-
from flask import request,render_template, redirect,session
from utils import getone,check,_update,_delete,insert_sql
from . import app
from sessions import sessionmsg
import json
# 用户个人中心
@app.route('/center/')
def center():
if 'username' not in session:
ret... | apache-2.0 |
jjmleiro/hue | desktop/core/ext-py/cryptography-1.3.1/src/cryptography/hazmat/primitives/padding.py | 21 | 5733 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import six
from cryptography import utils
from cryptography.... | apache-2.0 |
Kirembu/django-avatar | avatar/tests.py | 10 | 5524 | import os.path
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from avatar.settings import AVATAR_DEFAULT_URL, AVATAR_MAX_AVATARS_PER_USER
from avatar.util import get_primary_avatar, User
from avatar.models import Avatar
try:
from PIL import Image
... | bsd-3-clause |
pedropena/iteexe | twisted/protocols/policies.py | 14 | 17390 | # -*- test-case-name: twisted.test.test_policies -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Resource limiting policies.
@seealso: See also L{twisted.protocols.htb} for rate limiting.
"""
# system imports
import sys, operator
# twisted imports
from twisted.internet.pr... | gpl-2.0 |
raj454raj/eden | modules/tests/staff/create_staff_job_title.py | 25 | 2077 | """ Sahana Eden Automated Test - HRM001 Create Job Title
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 wit... | mit |
ePlusParkingInnovations/PresentacionPrimeraFase | node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py | 1835 | 1748 | #!/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.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | gpl-3.0 |
utamaro/youtube-dl | youtube_dl/extractor/thvideo.py | 151 | 3033 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate
)
class THVideoIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?thvideo\.tv/(?:v/th|mobile\.php\?cid=)(?P<id>[0-9]+)'
_TEST = {
'url': 'http://thvideo.tv/v/... | unlicense |
ea4862/boeffla444 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
ferzerkerx/gitOverseer | src/main/main.py | 2 | 2534 | #!/usr/bin/env python
import sys
import os
print(sys.path)
from setup import *
from percentage import PercentageContributorCalculator
from category_percentage_html_report import render_contribution_percentage_by_committer_using_categories
from category_percentage_html_report import render_categroy_contribution_perce... | mit |
powerjg/gem5-ci-test | src/gpu-compute/GPUStaticInstFlags.py | 16 | 4449 | # Copyright (c) 2016 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# 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 retai... | bsd-3-clause |
dionyziz/rupture | backend/breach/migrations/0004_auto_20160305_1146.py | 4 | 1793 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-05 11:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('breach', '0003_target_maxreflectionlength'),
]
operations = [
migrations.Add... | mit |
stefjakobs/puppet-zarafa | zarafa/files/sabre/get-folder-name.py | 1 | 1555 | #!/usr/bin/python
# -*- coding: utf-8; indent-tabs-mode: nil -*-
## THIS FILE IS MANAGED BY PUPPET ##
import MAPI
MAPI.unicode = True
from MAPI.Util import *
from MAPI.Struct import *
from MAPI.Tags import *
import locale
import sys
import string
import time
import getopt
def main(argv):
user = ''
try:
opts, ar... | mit |
kkoksvik/FreeCAD | src/Mod/Arch/importOBJ.py | 2 | 5928 | #***************************************************************************
#* *
#* Copyright (c) 2011 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... | lgpl-2.1 |
ciex/mietlimbo | api/model.py | 1 | 3464 | #!/usr/bin/env python3
"""
Mietspiegel Persistence Model
"""
import json
from main import db, create_app, logger
from flask_sqlalchemy import SQLAlchemy
import pickle
MIETSPIEGEL = "data/mietspiegel.json"
class Street(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(120))
... | mit |
linusw/linux-mt7630e | tools/perf/scripts/python/net_dropmonitor.py | 1812 | 1749 | # 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 |
MonicaHsu/truvaluation | venv/lib/python2.7/site-packages/jinja2/testsuite/debug.py | 415 | 1935 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.debug
~~~~~~~~~~~~~~~~~~~~~~
Tests the debug system.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase, filesystem_loader
from jinja2 import Environment,... | mit |
rohangoel96/IRCLogParser | IRCLogParser/lib/deprecated/scripts/parser-time_series.py | 2 | 6235 | #This code generates a time-series graph. Such a graph has users on the y axis and msg transmission time on x axis.This means that if there exit 4 users- A,B,C,D.
#Then if any of these users send a message at time t, then we put a dot infront of that user at time t in the graph.
import os.path
import re
import network... | mit |
Canpio/Paddle | python/paddle/fluid/transpiler/distribute_transpiler.py | 1 | 55353 | # 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 |
rspavel/spack | var/spack/repos/builtin/packages/figlet/package.py | 5 | 1161 | # 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 Figlet(MakefilePackage):
"""FIGlet is a program that creates large characters out of ordin... | lgpl-2.1 |
mschenck/aurora | src/test/python/apache/aurora/client/api/test_job_monitor.py | 4 | 4306 | #
# 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 ... | apache-2.0 |
hilalh/reactiveretail | Arduino/pyserial-2.7/serial/tools/list_ports.py | 149 | 3221 | #!/usr/bin/env python
# portable serial port access with python
# this is a wrapper module for different platform implementations of the
# port enumeration feature
#
# (C) 2011-2013 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt
"""\
This module will provide a fu... | mit |
frank10704/DF_GCS_W | MissionPlanner-master/Lib/site-packages/scipy/special/tests/test_spfun_stats.py | 61 | 1048 | import numpy as np
from numpy.testing import assert_array_equal, TestCase, run_module_suite
from scipy.special import gammaln, multigammaln
class TestMultiGammaLn(TestCase):
def test1(self):
a = np.abs(np.random.randn())
assert_array_equal(multigammaln(a, 1), gammaln(a))
def test_ararg(self)... | gpl-3.0 |
schumi2004/NOT_UPDATED_Sick-Beard-Dutch | lib/hachoir_parser/video/asf.py | 90 | 12897 | """
Advanced Streaming Format (ASF) parser, format used by Windows Media Video
(WMF) and Windows Media Audio (WMA).
Informations:
- http://www.microsoft.com/windows/windowsmedia/forpros/format/asfspec.aspx
- http://swpat.ffii.org/pikta/xrani/asf/index.fr.html
Author: Victor Stinner
Creation: 5 august 2006
"""
from l... | gpl-3.0 |
phatblat/AbletonLiveMIDIRemoteScripts | Push2/device_parameter_bank.py | 1 | 5834 | # Source Generated with Decompyle++
# File: device_parameter_bank.pyc (Python 2.5)
from __future__ import absolute_import
from ableton.v2.base import SlotManager, Subject, find_if, listens, listens_group, listenable_property, liveobj_valid, clamp
from bank_definitions import PARAMETERS_KEY, MAIN_KEY
from banking_util ... | mit |
franekp/ankidict | ankidict/thirdparty/sqlalchemy/exc.py | 38 | 11706 | # sqlalchemy/exc.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
"""Exceptions used with SQLAlchemy.
The base exception class is :exc:`.SQLAlchemy... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.