repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
kracwarlock/neon | neon/metrics/tests/test_roc.py | 13 | 3158 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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
#
# ... | apache-2.0 |
xxd3vin/spp-sdk | opt/Python27/Lib/site-packages/numpy/distutils/tests/test_npy_pkg_config.py | 37 | 3003 | import os
from tempfile import mkstemp
from numpy.testing import *
from numpy.distutils.npy_pkg_config import read_config, parse_flags
simple = """\
[meta]
Name = foo
Description = foo lib
Version = 0.1
[default]
cflags = -I/usr/include
libs = -L/usr/lib
"""
simple_d = {'cflags': '-I/usr/include', 'libflags': '-L/us... | mit |
zyzyis/monetdb | clients/examples/python/sqlsample.py | 1 | 1132 | #!/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 2008-2015 MonetDB B.V.
import monetdb.sql
import sys
dbh = monetdb.sql.Connection... | mpl-2.0 |
enatheme/ducking-robot | main.py | 1 | 3845 | import os, sys, re
nbLine = 0
nbFolder = 0
nbCfile = 0
target_folder = ""
header_folder = ""
#get arguments
def read_args(argv):
#var
number_args = len(argv) - 1
ret = 0
#we have arguments
if (number_args > 0):
ret = 1
target_folder = argv[1]
print("Target folder = %s" % (target_folder))
if(number_args... | gpl-2.0 |
Geoion/pili-sdk-python | pili/auth.py | 3 | 2016 | """
Auth provide class Auth for authentication account. You can use decorator
auth_interface to create a function with auto generated authentication.
"""
import pili.conf as conf
from urlparse import urlparse
from .utils import send_and_decode, __hmac_sha1__
class Credentials(object):
def __init__(self, access_key... | mit |
UIKit0/marsyas | scripts/Python/batch.py | 7 | 1475 | import os
from glob import glob
inputDirectory = "../../../../Databases/taslp/";
outputDirectory = "../../../output3 ";
testCommand = " ";
#testCommand = " -q 1 ";
beginCommand = "../../bin/release/peakClustering ";
beginCommand = "..\\..\\bin\\release\\peakClustering.exe ";
endCommand = " -P -f -S 0 ... | gpl-2.0 |
hfeeki/transifex | transifex/txcommon/management/commands/txmakemessages.py | 3 | 3273 | import os
import glob
from django.core.management.base import CommandError, BaseCommand
from optparse import make_option
from django.core.management.commands.makemessages import (make_messages,
handle_extensions)
class Command(BaseCommand):
option_list = Ba... | gpl-2.0 |
5t111111/markdown-preview.vim | markdownpreview_lib/markdown/inlinepatterns.py | 46 | 16802 | """
INLINE PATTERNS
=============================================================================
Inline patterns such as *emphasis* are handled by means of auxiliary
objects, one per pattern. Pattern objects must be instances of classes
that extend markdown.Pattern. Each pattern object uses a single regular
express... | lgpl-2.1 |
leeseulstack/openstack | neutron/debug/commands.py | 4 | 5254 | # Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# U... | apache-2.0 |
cryptobanana/ansible | lib/ansible/modules/identity/cyberark/cyberark_authentication.py | 83 | 10846 | #!/usr/bin/python
# Copyright: (c) 2017, Ansible Project
# 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_version': '1.1',
'status': ['pre... | gpl-3.0 |
dtuchsch/rpi-linux-preempt_rt | tools/perf/scripts/python/futex-contention.py | 1997 | 1508 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
anryko/ansible | test/units/modules/storage/netapp/test_na_elementsw_cluster_snmp.py | 38 | 7481 | # (c) 2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test for Ansible module: na_elementsw_cluster_snmp.py '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch... | gpl-3.0 |
menegon/geonode | geonode/services/models.py | 29 | 5369 | import logging
from django.conf import settings
from django.db import models
from geoserver.catalog import FailedRequestError, Catalog
from geonode.base.models import ResourceBase
from geonode.services.enumerations import SERVICE_TYPES, SERVICE_METHODS, GXP_PTYPES
from geonode.layers.models import Layer
from django.ut... | gpl-3.0 |
TheTypoMaster/chromium-crosswalk | tools/perf/page_sets/alexa1-10000.py | 35 | 1340 | # 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.
import json
import os
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
__location__ ... | bsd-3-clause |
shootsoft/practice | LeetCode/python/031-060/054-spiral-matrix/spiral.py | 1 | 1308 | class Solution:
# @param matrix, a list of lists of integers
# @return a list of integers
def spiralOrder(self, matrix):
r =[]
n = len(matrix)
m = 0
if n>0:
m = len(matrix[0])
i = 0
j = 0
count = m*n
maxn = n
minin = 0
... | apache-2.0 |
ZellMechanik-Dresden/dclab | dclab/features/emodulus/pxcorr.py | 1 | 4837 | """Pixelation correction definitions"""
import numpy as np
def corr_deform_with_area_um(area_um, px_um=0.34):
"""Deformation correction for area_um-deform data
The contour in RT-DC measurements is computed on a
pixelated grid. Due to sampling problems, the measured
deformation is overestimated and m... | gpl-2.0 |
dfalt974/SickRage | lib/bs4/tests/test_tree.py | 20 | 78279 |
# -*- coding: utf-8 -*-
"""Tests for Beautiful Soup's tree traversal methods.
The tree traversal methods are the main advantage of using Beautiful
Soup over just using a parser.
Different parsers will build different Beautiful Soup trees given the
same markup, but all Beautiful Soup trees can be traversed with the
m... | gpl-3.0 |
secynic/nfsinkhole | nfsinkhole/tests/test_utils.py | 1 | 1282 | import logging
from nfsinkhole.exceptions import SubprocessError
from nfsinkhole.tests import TestCommon
from nfsinkhole.utils import (popen_wrapper, get_default_interface,
get_interface_addr, set_system_timezone)
LOG_FORMAT = ('[%(asctime)s] [%(levelname)s] [%(filename)s:%(lineno)s] '
... | bsd-2-clause |
Krossom/python-for-android | python3-alpha/python3-src/Lib/ctypes/test/test_anon.py | 264 | 2051 | import unittest
from ctypes import *
class AnonTest(unittest.TestCase):
def test_anon(self):
class ANON(Union):
_fields_ = [("a", c_int),
("b", c_int)]
class Y(Structure):
_fields_ = [("x", c_int),
("_", ANON),
... | apache-2.0 |
TFenby/python-mode | pymode/libs/pylama/lint/pylama_pylint/pylint/checkers/imports.py | 17 | 15940 | # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... | lgpl-3.0 |
PearsonIOKI/compose-forum | askbot/deps/django_authopenid/forms.py | 1 | 19635 | # -*- coding: utf-8 -*-
# Copyright (c) 2007, 2008, Benoît Chesneau
#
# 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... | gpl-3.0 |
paweljasinski/ironpython3 | Src/StdLib/Lib/sched.py | 88 | 6354 | """A generally useful event scheduler class.
Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.
Each instance is parametrized with two functions, one that is
supposed to return the current time, one that i... | apache-2.0 |
fatihzkaratana/AutobahnPython | autobahn/autobahn/resource.py | 17 | 6104 | ###############################################################################
##
## Copyright 2012-2013 Tavendo GmbH
##
## 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:... | apache-2.0 |
wtsi-hgi/python-sequencescape-client | sequencescape/tests/_json_converters_test_factory.py | 3 | 4050 | import json
import unittest
from typing import Callable, Tuple, Sequence
from sequencescape.models import Model
class _TestJSONEncoder(unittest.TestCase):
"""
Tests for custom JSON encoders.
"""
def __init__(self, model_factory: Callable[[], Model], expected_json_properties: Sequence[str], encoder_ty... | gpl-3.0 |
YuhangSong/GTN | main.py | 1 | 20478 | import copy
import glob
import os
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
from arguments import get_args
from common.vec_env.s... | mit |
adist/drunken-sansa | openerp/addons/base/ir/ir_fields.py | 4 | 18108 | # -*- coding: utf-8 -*-
import datetime
import functools
import operator
import itertools
import time
import psycopg2
import pytz
from openerp.osv import orm
from openerp.tools.translate import _
from openerp.tools.misc import DEFAULT_SERVER_DATE_FORMAT,\
DEFAULT_SERVER_DATETIME_FORMAT
... | agpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/sqlite3/test/py25tests.py | 127 | 2736 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/regression.py: pysqlite regression tests
#
# Copyright (C) 2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
#... | mit |
teriyakichild/ansible-modules-extras | cloud/webfaction/webfaction_domain.py | 153 | 5304 | #!/usr/bin/python
#
# Create Webfaction domains and subdomains using Ansible and the Webfaction API
#
# ------------------------------------------
#
# (c) Quentin Stafford-Fraser 2015
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | gpl-3.0 |
TimsTechDev/android_kernel_samsung_kanas3gnfcxx | tools/perf/util/setup.py | 2079 | 1438 | #!/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 |
ME-ICA/me-ica | meica.libs/mdp/test/test_NeuralGasNode.py | 2 | 2420 | from _tools import *
def _uniform(min_, max_, dims):
return uniform(dims)*(max_-min_)+min_
def test_NeuralGasNode():
### test 1D distribution in a 10D space
# line coefficients
dim = 10
npoints = 1000
const = _uniform(-100,100,[dim])
dir = _uniform(-1,1,[dim])
dir /= utils.norm2(dir)
... | lgpl-2.1 |
eleonrk/SickRage | lib/past/types/olddict.py | 62 | 2735 | """
A dict subclass for Python 3 that behaves like Python 2's dict
Example use:
>>> from past.builtins import dict
>>> d1 = dict() # instead of {} for an empty dict
>>> d2 = dict(key1='value1', key2='value2')
The keys, values and items methods now return lists on Python 3.x and there are
methods for iterkeys, ite... | gpl-3.0 |
bearstech/ansible | lib/ansible/modules/windows/win_environment.py | 29 | 3774 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
#
# 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, eith... | gpl-3.0 |
akashsinghal/Speech-Memorization-App | Python_Backend/lib/itsdangerous.py | 626 | 31840 | # -*- coding: utf-8 -*-
"""
itsdangerous
~~~~~~~~~~~~
A module that implements various functions to deal with untrusted
sources. Mainly useful for web applications.
:copyright: (c) 2014 by Armin Ronacher and the Django Software Foundation.
:license: BSD, see LICENSE for more details.
"""
imp... | apache-2.0 |
laszlocsomor/tensorflow | tensorflow/python/kernel_tests/as_string_op_test.py | 119 | 8652 | # 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 |
HLFH/CouchPotatoServer | couchpotato/core/media/movie/searcher.py | 43 | 19822 | from datetime import date
import random
import re
import time
import traceback
from couchpotato import get_db
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import simplifyString
from couchpotato.core.helpers.variable... | gpl-3.0 |
BitFunnel/BitFunnel | NativeJIT/googletest/googletest/test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 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... | mit |
CodeDJ/qt5-hidpi | qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py | 121 | 4542 | # Copyright (C) 2009 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... | lgpl-2.1 |
winking324/pyactivemq | src/test/test_openwire_async.py | 11 | 2696 | # Copyright 2007 Albert Strasheim <fullung@gmail.com>
#
# 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 ... | apache-2.0 |
visualputty/Landing-Lights | django/db/backends/dummy/base.py | 5 | 1611 | """
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import *
from django.db.back... | bsd-3-clause |
wujuguang/tornado | tornado/test/web_test.py | 4 | 115285 | from tornado.concurrent import Future
from tornado import gen
from tornado.escape import (
json_decode,
utf8,
to_unicode,
recursive_unicode,
native_str,
to_basestring,
)
from tornado.httpclient import HTTPClientError
from tornado.httputil import format_timestamp
from tornado.iostream import IOSt... | apache-2.0 |
LecomteEmerick/Essentia-build | .waf-1.7.9-16e1644c17ba46b94844133bac6e2a8c/waflib/Tools/xlcxx.py | 330 | 1222 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_xlcxx(conf):
cxx=conf.find_program(['xlc++_r','xlc++'],var='CXX')
cxx=conf.cmd_to_list(cx... | agpl-3.0 |
Dandandan/wikiprogramming | jsrepl/build/extern/python/unclosured/lib/python2.7/unittest/runner.py | 109 | 6502 | """Running tests"""
import sys
import time
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __getattr__(self, at... | mit |
NejcZupec/ggrc-core | src/ggrc_basic_permissions/migrations/versions/20131210004352_1a22bb208258_auditors_have_docume.py | 7 | 1448 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Auditors have document and meeting permissions in audit context.
Revision ID: 1a22bb208258
Revises: 1f865f61312
Create Date: 2013-12-10 00:43:52.151598
"""
# revision identifiers, used by Alembic.
rev... | apache-2.0 |
defionscode/ansible | test/units/modules/network/exos/test_exos_config.py | 30 | 10656 | #
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ans... | gpl-3.0 |
spininertia/graph-mining-rdbms | src/phase-2/src/eigenvalue/lanczos.py | 1 | 3785 | from common.basic_operation import *
from eigen_quodratic import *
def lanczos(A, b, n, m, conn):
"""
A: n X n matrix
b: initial vector
m: number of steps
"""
beta = "beta"
v = ["v%s" % i for i in range(m+2)] # TODO: why this fixed?
v_tmp = "v_tmp"
alpha = "alpha"
create_vecto... | mit |
chemelnucfin/tensorflow | tensorflow/contrib/eager/python/examples/revnet/cifar_tfrecords.py | 32 | 5089 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
AkA84/edx-platform | lms/djangoapps/certificates/migrations/0019_auto__add_certificatehtmlviewconfiguration.py | 101 | 7978 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CertificateHtmlViewConfiguration'
db.create_table('certificates_certificatehtmlviewconfigura... | agpl-3.0 |
glass-bead-labs/data-connector | github-api/issue-tracker.py | 2 | 3064 | import requests
import json
from datetime import datetime
import time
GITHUB_USERNAME = 'glass-bead-labs'
GITHUB_REPO = 'sensor-group'
with open('GitHubAuthKey.txt') as f:
key = f.readline().strip()
print(key)
#Runs updateASBase every 10 seconds
def main():
while True:
updateASBase();
time.sleep(10);
"""
... | isc |
canhhs91/greenpointtrees | src/oscar/apps/shipping/migrations/0001_initial.py | 119 | 4281 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import oscar.models.fields.autoslugfield
from decimal import Decimal
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('address', '0001_initial'),
]
oper... | mit |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/pygments/lexers/smalltalk.py | 31 | 7215 | # -*- coding: utf-8 -*-
"""
pygments.lexers.smalltalk
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Smalltalk and related languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, defa... | gpl-3.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/pygments/formatters/svg.py | 31 | 5840 | # -*- coding: utf-8 -*-
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/utils/external/rope/base/fscommands.py | 29 | 7524 | """Project file system commands.
This modules implements file system operations used by rope. Different
version control systems can be supported by implementing the interface
provided by `FileSystemCommands` class. See `SubversionCommands` and
`MercurialCommands` for example.
"""
import os, re
import shutil
import ... | gpl-3.0 |
AnishShah/tensorflow | tensorflow/contrib/tpu/python/tpu/tpu_context.py | 1 | 26214 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
kenshay/ImageScript | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdataset.py | 215 | 11527 | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | gpl-3.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/whoosh/analysis/tokenizers.py | 93 | 12678 | # Copyright 2007 Matt Chaput. 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 the... | bsd-3-clause |
atsolakid/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/sample_courses.py | 100 | 9544 | # encoding: utf-8
"""
The data type and use of it for declaratively creating test courses.
"""
# used to create course subtrees in ModuleStoreTestCase.create_test_course
# adds to self properties w/ the given block_id which hold the UsageKey for easy retrieval.
# fields is a dictionary of keys and values. sub_tree is a... | agpl-3.0 |
emedinaa/contentbox | third_party/django/utils/datetime_safe.py | 179 | 2747 | # Python's datetime strftime doesn't handle dates before 1900.
# These classes override date and datetime to support the formatting of a date
# through its full "proleptic Gregorian" date range.
#
# Based on code submitted to comp.lang.python by Andrew Dalke
#
# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was... | apache-2.0 |
Lujeni/ansible | lib/ansible/modules/monitoring/sensu/sensu_subscription.py | 36 | 4897 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Anders Ingemann <aim@secoya.dk>
# 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_version': '1.1',
... | gpl-3.0 |
insomnia-lab/calibre | src/calibre/devices/folder_device/driver.py | 13 | 3191 | '''
Created on 15 May 2010
@author: charles
'''
import os
from calibre.devices.usbms.driver import USBMS, BookList
from calibre.ebooks import BOOK_EXTENSIONS
# This class is added to the standard device plugin chain, so that it can
# be configured. It has invalid vendor_id etc, so it will never match a
# device. The... | gpl-3.0 |
subutai/htmresearch | projects/location_layer/location_module_experiment/three_layer_tracing.py | 4 | 10150 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2017, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
cherusk/ansible | lib/ansible/modules/windows/win_say.py | 45 | 4641 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
#
# 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, eith... | gpl-3.0 |
nubark/odoo | addons/account_budget/wizard/account_budget_analytic.py | 47 | 1099 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import fields, osv
class account_budget_analytic(osv.osv_memory):
_name = 'account.budget.analytic'
_description = 'Account Budget report for analytic account'
_columns = {... | gpl-3.0 |
vidyacraghav/zerorpc-python | zerorpc/patterns.py | 103 | 3937 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
ueno/ibus | setup/enginecombobox.py | 2 | 5814 | # vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2007-2010 Red Hat, Inc.
#
# 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 Sof... | lgpl-2.1 |
zhumingliang1209/Ardupilot | ardupilot/Tools/LogAnalyzer/tests/TestIMUMatch.py | 100 | 4071 | from LogAnalyzer import Test,TestResult
import DataflashLog
from math import sqrt
class TestIMUMatch(Test):
'''test for empty or near-empty logs'''
def __init__(self):
Test.__init__(self)
self.name = "IMU Mismatch"
def run(self, logdata, verbose):
#tuning parameters:
war... | gpl-3.0 |
qwefi/nova | nova/tests/api/openstack/compute/plugins/v3/test_server_diagnostics.py | 3 | 2790 | # Copyright 2011 Eldar Nugaev
# 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 ... | apache-2.0 |
tersmitten/ansible | lib/ansible/modules/cloud/ovirt/ovirt_tag_facts.py | 55 | 4848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
hand-iemura/lightpng | boost_1_53_0/tools/build/v2/test/indirect_conditional.py | 20 | 1389 | #!/usr/bin/python
# Copyright (C) Vladimir Prus 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.jam", """
exe a1 : a1.cpp : <conditional>@a1-rule ... | mit |
kasioumis/invenio | invenio/modules/workflows/models.py | 9 | 33638 | # -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your o... | gpl-2.0 |
Storj/bitcointalkbot | crawler.py | 1 | 4595 | #!/usr/bin/env python3
# Written by Jonathon Vogel, 2014
import bs4
import feedparser
import requests
import slack
import slack.chat
import time
import traceback
import urllib.parse
KEYWORDS = ['Storj', 'Storj Labs', 'SJCX', 'Storjcoin X', 'Storjcoin']
PING_TIME = 2 # how many seconds to wait between checking Bitco... | mit |
JVillella/tensorflow | tensorflow/contrib/keras/python/keras/utils/generic_utils.py | 12 | 11458 | # 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 |
UOMx/edx-platform | openedx/core/djangoapps/user_api/tests/test_views.py | 2 | 73163 | """Tests for the user API at the HTTP request level. """
import datetime
import json
from unittest import skipUnless, SkipTest
import ddt
import httpretty
import mock
from django.conf import settings
from django.contrib.auth.models import User
from django.core import mail
from django.core.urlresolvers import reverse
... | agpl-3.0 |
darjeeling/django | django/template/context.py | 15 | 9076 | from contextlib import contextmanager
from copy import copy
# Hard-coded processor for easier use of CSRF protection.
_builtin_context_processors = ('django.template.context_processors.csrf',)
class ContextPopException(Exception):
"pop() has been called more times than push()"
pass
class ContextDict(dict):... | bsd-3-clause |
dhruvsrivastava/OJ | flask/lib/python2.7/site-packages/coverage/pickle2json.py | 93 | 1489 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Convert pickle to JSON for coverage.py."""
from coverage.backward import pickle
from coverage.data import CoverageData
def pickle_read_raw_data(cls_unused, fi... | bsd-3-clause |
drexly/openhgsenti | lib/django/db/migrations/operations/special.py | 374 | 7425 | from __future__ import unicode_literals
from django.db import router
from .base import Operation
class SeparateDatabaseAndState(Operation):
"""
Takes two lists of operations - ones that will be used for the database,
and ones that will be used for the state change. This allows operations
that don't ... | apache-2.0 |
shashankrao/RC6-Block-Cipher | decrypt.py | 1 | 1816 | from helpers import *
import sys
def decrypt(esentence,s):
encoded = blockConverter(esentence)
enlength = len(encoded)
A = long(encoded[0],2)
B = long(encoded[1],2)
C = long(encoded[2],2)
D = long(encoded[3],2)
cipher = []
cipher.append(A)
cipher.append(B)
cipher.append(C)
c... | gpl-2.0 |
infyponics/infyponics | requests/packages/urllib3/fields.py | 514 | 5931 | from __future__ import absolute_import
import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
... | apache-2.0 |
CenterForOpenScience/osf.io | tasks/__init__.py | 3 | 28875 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of
commands, run ``$ invoke --list``.
"""
import os
import sys
import json
import platform
import subprocess
import logging
import sqlite3
import invoke
from invoke import Collection
from website i... | apache-2.0 |
thundernet8/WRGameVideos-API | venv/lib/python2.7/site-packages/sqlalchemy/sql/selectable.py | 13 | 118995 | # sql/selectable.py
# Copyright (C) 2005-2015 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:`.FromClause` class of SQL expression elements, representing
SQL tab... | gpl-2.0 |
insomnia-lab/calibre | src/calibre/devices/usbms/deviceconfig.py | 5 | 5614 | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
from calibre.utils.config_base import Config, ConfigProxy
class DeviceConfig(object):
HELP_MESSAGE = _('Configure Device')
#: Can be None, a string or a list of ... | gpl-3.0 |
clinton-hall/nzbToMedia | libs/common/unidecode/x084.py | 252 | 4646 | data = (
'Hu ', # 0x00
'Qi ', # 0x01
'He ', # 0x02
'Cui ', # 0x03
'Tao ', # 0x04
'Chun ', # 0x05
'Bei ', # 0x06
'Chang ', # 0x07
'Huan ', # 0x08
'Fei ', # 0x09
'Lai ', # 0x0a
'Qi ', # 0x0b
'Meng ', # 0x0c
'Ping ', # 0x0d
'Wei ', # 0x0e
'Dan ', # 0x0f
'Sha ', # 0x10
'Hu... | gpl-3.0 |
n0m4dz/odoo | addons/resource/faces/timescale.py | 263 | 3899 | ############################################################################
# Copyright (C) 2005 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
#
# faces is free software; you can redistribute it and/or modify
# ... | agpl-3.0 |
refreshoxford/django-cbv-inspector | cbv/management/commands/populate_cbv.py | 1 | 13731 | import importlib
import inspect
import sys
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand
from django.utils.functional import Promise
from blessings import Terminal
from cbv.models import Project, ProjectVersio... | bsd-2-clause |
dmilith/SublimeText3-dmilith | Package Storage/lsp_utils/node-runtime/12.20.2/node/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 8 | 1966 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
MrLoick/python-for-android | python3-alpha/python3-src/Lib/encodings/cp500.py | 266 | 13121 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | apache-2.0 |
shsingh/ansible | lib/ansible/modules/cloud/rackspace/rax_mon_notification.py | 77 | 5180 | #!/usr/bin/python
# Copyright: Ansible Project
# 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_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interface_load_balancers_operations.py | 1 | 5727 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
Fraunhofer-IIS/GNSS-DSP-tools | gnsstools/beidou/b1i.py | 1 | 1840 | # Beidou B1I code construction (serves also for B2I)
#
# Copyright 2014 Peter Monta
import numpy as np
chip_rate = 2046000
code_length = 2046
secondary_code = np.array([0,0,0,0,0,1,0,0,1,1,0,1,0,1,0,0,1,1,1,0])
secondary_code = 1.0 - 2.0*secondary_code
b1i_g2_taps = {
1: (1,3), 2: (1,4), 3: (1,5), 4: (1... | mit |
fabianvf/osf.io | website/addons/figshare/tests/utils.py | 53 | 4566 | import mock
from website.addons.figshare.api import Figshare
article = {u'count': 1, u'items': [{u'status': u'Draft', u'files': [{u'thumb': None, u'download_url': u'http://files.figshare.com/1348803/0NUTZ', u'name': u'0NUTZ', u'id': 1348803, u'mime_type': u'text/plain', u'size': u'0 KB'}, {u'thumb': None, u'download_... | apache-2.0 |
lukasfenix/namebench | nb_third_party/jinja2/nodes.py | 207 | 27369 | # -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:... | apache-2.0 |
randynobx/ansible | lib/ansible/modules/system/alternatives.py | 66 | 5544 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage symbolic link alternatives.
(c) 2014, Gabe Mulley <gabe.mulley@gmail.com>
(c) 2015, David Wittman <dwittman@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 Gene... | gpl-3.0 |
DooMLoRD/android_kernel_sony_msm8960t | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
bigswitch/neutron | neutron/tests/unit/agent/l3/test_legacy_router.py | 1 | 3278 | # Copyright (c) 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
harshilasu/LinkurApp | y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/vpc/test_internetgateway.py | 10 | 6075 | from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection, InternetGateway
class TestDescribeInternetGateway(AWSMockServiceTestCase):
connection_class = VPCConnection
def default_body(self):
return """
<DescribeInternetGatewaysRespo... | gpl-3.0 |
shawger/s-kape | lib/requests/packages/chardet/sjisprober.py | 1777 | 3764 | ######################## 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... | gpl-3.0 |
coderbone/SickRage | lib/unidecode/x0c2.py | 253 | 4710 | data = (
'syon', # 0x00
'syonj', # 0x01
'syonh', # 0x02
'syod', # 0x03
'syol', # 0x04
'syolg', # 0x05
'syolm', # 0x06
'syolb', # 0x07
'syols', # 0x08
'syolt', # 0x09
'syolp', # 0x0a
'syolh', # 0x0b
'syom', # 0x0c
'syob', # 0x0d
'syobs', # 0x0e
'syos', # 0x0f
'syoss', #... | gpl-3.0 |
sweimer/ICFID8 | docroot/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 2013 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | mit |
paolodedios/pybuilder | docs/conf.py | 10 | 9282 | # -*- coding: utf-8 -*-
#
# PyBuilder documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 23 20:15:57 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | apache-2.0 |
fabiopetroni/Dato-Core | src/unity/python/graphlab/data_structures/sarray.py | 13 | 91593 | """
This module defines the SArray class which provides the
ability to create, access and manipulate a remote scalable array object.
SArray acts similarly to pandas.Series but without indexing.
The data is immutable, homogeneous, and is stored on the GraphLab Server side.
"""
'''
Copyright (C) 2015 Dato, Inc.
All rig... | agpl-3.0 |
koniiiik/django | tests/sitemaps_tests/test_http.py | 16 | 11105 | from __future__ import unicode_literals
import os
from datetime import date
from unittest import skipUnless
from django.apps import apps
from django.conf import settings
from django.contrib.sitemaps import GenericSitemap, Sitemap
from django.contrib.sites.models import Site
from django.core.exceptions import Improper... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.