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 |
|---|---|---|---|---|---|
pytroll/pygac | pygac/tests/test_calibrate_pod.py | 1 | 5529 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, 2015 Martin Raspaud
# Author(s):
# Martin Raspaud <martin.raspaud@smhi.se>
# 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 Foundatio... | gpl-3.0 |
mohae/packer-templates | jessie-salt-vbox-vagrant/salt-masterless/saltbase/salt/roots/salt/vim/files/pyflakes/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py | 40 | 7252 |
from _ast import PyCF_ONLY_AST
from twisted.trial.unittest import TestCase
from pyflakes import messages as m, checker
from pyflakes.test import harness
class Test(harness.Test):
def test_undefined(self):
self.flakes('bar', m.UndefinedName)
def test_definedInListComp(self):
self.flakes('[a... | mit |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py | 354 | 5544 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | mit |
dbckz/ansible | lib/ansible/utils/module_docs_fragments/backup.py | 427 | 1071 | # Copyright (c) 2015 Ansible, 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.
#
# Ansi... | gpl-3.0 |
mind1master/aiohttp | tests/test_client_session.py | 1 | 14280 | import asyncio
import contextlib
import gc
import http.cookies
import re
import types
from unittest import mock
import pytest
from multidict import CIMultiDict, MultiDict
import aiohttp
from aiohttp import web
from aiohttp.client import ClientSession
from aiohttp.connector import BaseConnector, TCPConnector
@pytest... | apache-2.0 |
shinate/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/feeders.py | 121 | 4477 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
masayukig/tempest | tempest/api/compute/admin/test_hosts_negative.py | 1 | 6175 | # Copyright 2013 Huawei Technologies Co.,LTD.
#
# 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 |
chiviak/headphones | lib/unidecode/x02c.py | 246 | 3596 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | gpl-3.0 |
dnanexus/rseqc | rseqc/scripts/read_distribution.py | 1 | 11931 | #!/usr/bin/env python
'''-------------------------------------------------------------------------------------------------
Check reads distribution over exon, intron, UTR, intergenic ... etc
-------------------------------------------------------------------------------------------------'''
#import built-in modules
im... | gpl-3.0 |
nickname456/pbots | poker.py | 1 | 5255 | #-----------------------------------------------------------#
# Heads Up Omaha Challange - Starter Bot #
#===========================================================#
# #
# Last update: 22 May, 2014 #
# ... | mit |
pombredanne/http-repo.gem5.org-gem5- | src/arch/x86/isa/insts/x87/control/__init__.py | 91 | 2495 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
patrickrolanddg/jaikuengine | common/exception.py | 30 | 7976 | # Copyright 2009 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, ... | apache-2.0 |
minhtuancn/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py | 293 | 4469 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
sacooper/dotfiles | .conky_hud/dbus-mon.py | 4 | 2464 | #! /bin/env/python
from gi.repository import GLib
import subprocess
import dbus
import datetime
import threading
import time
from dbus.mainloop.glib import DBusGMainLoop
messages = []
messages_map = {}
counter = 1
cco = 1
def curTime():
ts = datetime.datetime.timestamp(datetime.datetime.now())
return ts
d... | mit |
babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/pickletools.py | 5 | 76619 | '''"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=None,... | mit |
certifiedloud/e6b | tests.py | 1 | 2317 | from e6b import E6B
import unittest
class TimeSpeedDistance(unittest.TestCase):
'''Test time, speed and distance calculations'''
def setUp(self):
self.e6b = E6B()
def test_time(self):
'''Test time calculations'''
time = self.e6b.time(1, 60)
self.assertEqual(60, time)
... | mit |
cmbclh/vnpy1.7 | vnpy/trader/app/login/uiLoginWidget.py | 1 | 7055 | # encoding: UTF-8
'''
登陆模块相关的GUI控制组件
'''
import sys
sys.path.append('../')
#sys.path.append('D:\\tr\\vnpy-master\\vn.trader\\DAO')
sys.path.append('D:\\tr\\vnpy-1.7\\vnpy\\DAO')
sys.path.append('D:\\tr\\vnpy-1.7\\vnpy\\common')
import vnpy.DAO
import vnpy.common
from vnpy.DAO import *
import pandas as pd
import Tki... | mit |
fast90/christian | modules/hq.py | 1 | 1507 | from datetime import datetime
class HQ(object):
def __init__(self):
self.people_in_hq = 0
self.keys_in_hq = 0
self.joined_users = []
self.hq_status = 'unknown'
self.status_since = datetime.now().strftime('%Y-%m-%d %H:%M')
self.is_clean = True
self.joined_key... | gpl-3.0 |
specialkevin/ansible-modules-core | utilities/logic/set_fact.py | 115 | 2015 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Dag Wieers <dag@wieers.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 Lice... | gpl-3.0 |
micbou/YouCompleteMe | python/ycm/client/completer_available_request.py | 2 | 1716 | # Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 vers... | gpl-3.0 |
developerworks/sorl-thumbnail | tests/runtests.py | 5 | 1715 | #!/usr/bin/env python
import os
import sys
from os.path import abspath, dirname, join as pjoin
from django.conf import settings
def runtests(verbosity=1, interactive=True, failfast=True, settings_module='settings.default'):
here = abspath(dirname(__file__))
root = pjoin(here, os.pardir)
sys.path[0:0] = [ ... | bsd-3-clause |
signed/intellij-community | python/helpers/profiler/thriftpy/parser/__init__.py | 39 | 2151 | # -*- coding: utf-8 -*-
"""
thriftpy.parser
~~~~~~~~~~~~~~~
Thrift parser using ply
"""
from __future__ import absolute_import
import os
import sys
from .parser import parse, parse_fp
def load(path, module_name=None, include_dirs=None, include_dir=None):
"""Load thrift file as a module.
The ... | apache-2.0 |
Groterik/qtcreator-dlangeditor | build/generate_bintray.py | 2 | 2298 | import datetime
import os
import sys
project_dir = sys.argv[1]
conf_file = os.path.join(project_dir, '.bintray.json')
template_file = conf_file + '.in'
curr_date = datetime.date.today().strftime('%Y-%m-%d')
class VarInfo:
def __init__(self, name, user_defined = '',
travis='', appveyor='',
... | mit |
samuelctabor/ardupilot | Tools/autotest/param_metadata/param_parse.py | 2 | 17382 | #!/usr/bin/env python
from __future__ import print_function
import glob
import os
import re
import sys
from argparse import ArgumentParser
from param import (Library, Parameter, Vehicle, known_group_fields,
known_param_fields, required_param_fields, known_units)
from htmlemit import HtmlEmit
from rs... | gpl-3.0 |
NetDBNCKU/GAE-Conference-Web-App | django/conf/locale/ru/formats.py | 86 | 1348 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y г.'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j E Y г. G:i:s'
YEAR_M... | bsd-3-clause |
zcbenz/cefode-chromium | third_party/closure_linter/closure_linter/common/filetestcase.py | 135 | 3835 | #!/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
#... | bsd-3-clause |
mvidalgarcia/indico | indico/util/caching.py | 2 | 3447 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from functools import wraps
from inspect import getcallargs
from flask import current_app, g, has_request... | mit |
FormAlchemy/formalchemy | formalchemy/fields.py | 2 | 73745 | # Copyright (C) 2007 Alexandre Conrad, alexandre (dot) conrad (at) gmail (dot) com
#
# This module is part of FormAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import cgi
import logging
logger = logging.getLogger('formalchemy.' + __name__)
from copy import copy, d... | mit |
cyli/volatility | volatility/plugins/linux/pstree.py | 50 | 1893 | # This file is part of Volatility.
# Copyright (C) 2007-2013 Volatility Foundation
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any late... | gpl-2.0 |
vivisect/synapse | synapse/cryotank.py | 1 | 49542 | import os
import types
import shutil
import struct
import logging
import threading
import contextlib
from functools import partial, wraps
from collections import defaultdict
import lmdb # type: ignore
import synapse.lib.cell as s_cell
import synapse.lib.lmdb as s_lmdb
import synapse.lib.queue as s_queue
import synap... | apache-2.0 |
leeseuljeong/leeseulstack_neutron | neutron/tests/unit/ml2/drivers/test_mech_mlnx.py | 9 | 4275 | # Copyright (c) 2014 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 ... | apache-2.0 |
zhouzhenghui/python-for-android | python-build/python-libs/gdata/tests/atom_tests/token_store_test.py | 128 | 2896 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... | apache-2.0 |
icloudrnd/automation_tools | openstack_dashboard/api/rest/keystone.py | 23 | 18281 | # Copyright 2014, Rackspace, US, 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 w... | apache-2.0 |
nke001/attention-lvcsr | libs/Theano/theano/gof/sandbox/equilibrium.py | 2 | 5462 | from __future__ import print_function
from six.moves import reduce
from six import string_types
if 0:
class _EquilibriumOptimizer(NavigatorOptimizer):
def __init__(self,
local_optimizers,
failure_callback=None,
max_depth=None,
... | mit |
mdhaman/superdesk-core | tests/es_utils_test.py | 1 | 2861 |
from superdesk.tests import TestCase
from superdesk import es_utils
class ESUtilsTestCase(TestCase):
def test_filter2query(self):
"""Check that a saved_searches style filter is converted correctly to Elastic Search DSL"""
filter_ = {"query": {"spike": "exclude", "notgenre": '["Article (news)"]'}}... | agpl-3.0 |
marcuskelly/recover | Lib/encodings/aliases.py | 35 | 15542 | """ Encoding Aliases Support
This module is used by the encodings package search function to
map encodings names to module names.
Note that the search function normalizes the encoding names before
doing the lookup, so the mapping will have to map normalized
encoding names to module names.
Con... | bsd-2-clause |
NetApp/cinder | cinder/wsgi/wsgi.py | 9 | 1282 | # 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
# di... | apache-2.0 |
dulems/hue | apps/oozie/setup.py | 40 | 1206 | # 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 |
ramusus/django-vkontakte-photos | vkontakte_photos/migrations/0001_initial.py | 2 | 13382 | # -*- 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 'Album'
db.create_table('vkontakte_photos_album', (
('id', self.gf('django.db.mod... | bsd-3-clause |
davidfraser/sqlalchemy | lib/sqlalchemy/sql/type_api.py | 6 | 44798 | # sql/types_api.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
"""Base types API.
"""
from .. import exc, util
from . import operators
from .vi... | mit |
dati91/servo | tests/wpt/mozilla/tests/mozilla/referrer-policy/generic/tools/generate.py | 53 | 7650 | #!/usr/bin/env python
import os, sys, json
from common_paths import *
import spec_validator
import argparse
def expand_test_expansion_pattern(spec_test_expansion, test_expansion_schema):
expansion = {}
for artifact in spec_test_expansion:
artifact_value = spec_test_expansion[artifact]
if arti... | mpl-2.0 |
SebasSBM/django | tests/custom_columns/models.py | 282 | 1716 | """
Custom column/table names
If your database column name is different than your model attribute, use the
``db_column`` parameter. Note that you'll use the field's name, not its column
name, in API usage.
If your database table name is different than your model name, use the
``db_table`` Meta attribute. This has no ... | bsd-3-clause |
zhujzhuo/Sahara | sahara/plugins/cdh/v5_3_0/db_helper.py | 6 | 2948 | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
TribeMedia/sky_engine | sky/tools/skypy/skyserver.py | 6 | 2135 | # 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 socket
import subprocess
import logging
import os.path
SKYPY_PATH = os.path.dirname(os.path.abspath(__file__))
SRC_ROOT = os.path.dirname(os.path.dir... | bsd-3-clause |
sumeetsk/NEXT-1 | next/database_client/CacheStore/redis_data_structures/redisDictionary.py | 6 | 6589 | import redis
from itertools import chain
DICT_KEY = 'exp%s:%s' # Hash key for a matrixOriginal
DICT_KEYS = 'exp%s:%s:keys' # Hash key for a matrixOriginal
class Dictionary:
def __init__(self, expId, subId, dictionary=None):
self.conn = redis.StrictRedis(host='localhost', ... | apache-2.0 |
Tufin/pytos | pytos/securetrack/xml_objects/rest/nat_rules.py | 1 | 13490 | import logging
from pytos.common.base_types import XML_List, XML_Object_Base, Comparable
from pytos.common.definitions.xml_tags import Elements
from pytos.common.logging.definitions import XML_LOGGER_NAME
from pytos.common.functions import get_xml_int_value, get_xml_text_value, get_xml_node, create_tagless_xml_objects... | apache-2.0 |
Texju/DIT-Machine_Learning | Codes/validation.py | 1 | 1983 | # -*- coding: utf-8 -*-
"""
Created on Wed May 24 15:00:15 2017
@author: Julien Couillard & Jean Thevenet
"""
from sklearn import cross_validation
from sklearn import metrics
import numpy
class MLValidation:
"""This class calculates the preciseness of our tree against a set of data"""
def __init__(self, ... | gpl-3.0 |
brandonw/photo-album | photo_album/rotate_and_thumbs.py | 1 | 1245 | import os, sys
from PIL import Image, ExifTags
size = (128, 128)
for infile in os.listdir(sys.argv[1]):
inpath = os.path.join(sys.argv[1], infile)
pieces = os.path.splitext(inpath)
outpath = pieces[0] + ".thumb" + pieces[1]
if (inpath != outpath and not os.path.exists(outpath) and
'thumb' not ... | bsd-3-clause |
innovation-cat/DeepLearningBook | cifar10 classification/py3/softmax.py | 1 | 4468 | # coding: utf-8
#
# softmax.py
#
# Author: Huang Anbu
# Date: 2017.3
#
# Description: Implementation of softmax classification
#
# Copyright©2017. All Rights Reserved.
# ===============================================================================================
from __future__ import print_function, division
fro... | mit |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/numpy/core/tests/test_nditer.py | 10 | 104224 | from __future__ import division, absolute_import, print_function
import sys
import warnings
import numpy as np
from numpy import array, arange, nditer, all
from numpy.compat import asbytes, sixu
from numpy.core.multiarray_tests import test_nditer_too_large
from numpy.testing import (
run_module_suite, assert_, as... | mit |
SU-ECE-17-7/hotspotter | _graveyard/voting_rules1.py | 2 | 20685 |
#_________________
# OLD
def build_voters_profile(hs, qcx, K):
'''This is too similar to assign_matches_vsmany right now'''
cx2_nx = hs.tables.cx2_nx
hs.ensure_matcher(match_type='vsmany', K=K)
K += 1
cx2_desc = hs.feats.cx2_desc
cx2_kpts = hs.feats.cx2_kpts
cx2_rchip_size = hs.get_cx2_rch... | apache-2.0 |
dslomov/intellij-community | python/lib/Lib/site-packages/django/views/decorators/http.py | 94 | 6854 | """
Decorators for views based on HTTP headers.
"""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from calendar import timegm
from datetime import timedelta
from email.Utils import formatdate
from django.utils.decorators import decorato... | apache-2.0 |
Thierry46/CalcAl | database/DatabaseReaderFactory.py | 1 | 3131 | # -*- coding: utf-8 -*-
"""
************************************************************************************
Class : DatabaseReaderFactory
Author : Thierry Maillard (TMD)
Date : 13/6/2016 - 17/12/2016
Role : Return a database reader according parameters.
Licence : GPLv3
Copyright (c) 2016 - Thierry Maillard
Th... | gpl-3.0 |
sthesing/Podstatty | db.py | 1 | 4858 | # -*- coding: utf8 -*-
## Copyright (c) 2013 Stefan Thesing
##
##This file is part of Podstatty.
##
##Podstatty 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 op... | gpl-3.0 |
hvaibhav/am335x-linux | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
AgostonSzepessy/servo | tests/wpt/update/update.py | 224 | 1348 | # 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/.
import os
from wptrunner.update.base import Step, StepRunner
from wptrunner.update.update import LoadConfig, SyncFromUp... | mpl-2.0 |
dendisuhubdy/tensorflow | tensorflow/python/ops/metrics_impl.py | 6 | 157837 | # 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 |
damocles972/Sick-Beard | SickBeard.py | 11 | 15016 | #!/usr/bin/env python
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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... | gpl-3.0 |
SabaFar/plc | examples/plc-ccphy-example.py | 1 | 4082 | # -*- Mode:Python; -*-
# /*
# * Copyright (c) 2010 INRIA
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# *
# * This program is distributed in the hope that it will b... | gpl-3.0 |
prparikh02/LeapMotion-Sign-Language-Interpretor | signpy/lib/Leap.py | 34 | 89500 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.3
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path imp... | apache-2.0 |
StuartLittlefair/astropy | astropy/io/fits/tests/test_nonstandard.py | 12 | 2346 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import numpy as np
from astropy.io import fits
from . import FitsTestCase
class TestNonstandardHdus(FitsTestCase):
def test_create_fitshdu(self):
"""
A round trip test of creating a FitsHDU, adding a FITS file to it,
writing ... | bsd-3-clause |
mquad/DNN_Lab_UPF | exercise/img_classification/logreg_raw.py | 1 | 4523 | # -*- coding: utf-8 -*-
# @Author: massimo
# @Date: 2016-03-10 17:09:49
# @Last Modified by: massimo
# @Last Modified time: 2016-03-11 15:54:15
import numpy as np
import theano
import theano.tensor as T
from collections import OrderedDict
import gzip
import cPickle as pkl # python 2.x
import time
def load_gz(gz... | mit |
wxiang7/airflow | airflow/hooks/dbapi_hook.py | 3 | 7095 |
from builtins import str
from past.builtins import basestring
from datetime import datetime
import numpy
import logging
from airflow.hooks.base_hook import BaseHook
from airflow.exceptions import AirflowException
class DbApiHook(BaseHook):
"""
Abstract base class for sql hooks.
"""
# Override to pro... | apache-2.0 |
ayepezv/GAD_ERP | addons/website_sale/models/product.py | 1 | 8355 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, _
class ProductStyle(models.Model):
_name = "product.style"
name = fields.Char(string='Style Name', required=True)
html_class = fields.Char(string='HTML Classes'... | gpl-3.0 |
bensternthal/lumbergh | vendor-local/lib/python/south/tests/db.py | 12 | 34542 | import datetime
from south.db import db, generic
from django.db import connection, models, IntegrityError
from south.tests import unittest, skipUnless
# Create a list of error classes from the various database libraries
errors = []
try:
from psycopg2 import ProgrammingError
errors.append(ProgrammingE... | bsd-3-clause |
zstackio/zstack-woodpecker | integrationtest/vm/vpc/test_vpc_ospf_stub_md5.py | 1 | 3923 | '''
@author: Hengguo Ge
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.vpc_operations as vpc_ops
import os
import time
from itertools import izip
VPC1_VLAN, VPC1_VXLAN = ['l3VlanNetwork... | apache-2.0 |
lenovor/scikit-learn | sklearn/tests/test_qda.py | 155 | 3481 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ignore_war... | bsd-3-clause |
poldracklab/cogat | cognitive/apps/atlas/forms.py | 1 | 18517 | from django import forms
from django.core.exceptions import ValidationError
from django.urls import reverse
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Div, Field, HTML, Layout, Reset, Submit
from cognitive.apps.atlas.query import Assertion, Disorder, Task, Battery, ConceptClass, Concep... | mit |
repotvsupertuga/tvsupertuga.repository | instal/script.module.universalscrapers/lib/universalscrapers/scraperplugins/broken or need checking/couchtuner.py | 3 | 3613 | import re
import urllib,time,xbmcaddon
import requests,base64
from ..common import clean_title,clean_search, random_agent,filter_host,send_log,error_log
from ..scraper import Scraper
dev_log = xbmcaddon.Addon('script.module.universalscrapers').getSetting("dev_log")
User_Agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; ... | gpl-2.0 |
chokribr/inveniotest | modules/miscutil/lib/upgrades/invenio_2014_01_24_seqSTORE_larger_value.py | 16 | 1190 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 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 option) a... | gpl-2.0 |
CSAILVision/sceneparsing | evaluationCode/utils_eval.py | 1 | 1826 | import numpy as np
# This function takes the prediction and label of a single image, returns intersection and union areas for each class
# To compute over many images do:
# for i in range(Nimages):
# (area_intersection[:,i], area_union[:,i]) = intersectionAndUnion(imPred[i], imLab[i])
# IoU = 1.0 * np.sum(area_inters... | bsd-3-clause |
onceuponatimeforever/oh-mainline | vendor/packages/Jinja2/jinja2/constants.py | 1169 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | agpl-3.0 |
ivesbai/mediadrop | mediadrop/controllers/admin/groups.py | 10 | 4481 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
hexid/WordGenerator | GenerateChain.py | 1 | 1975 | #!/bin/env python
# usage: depth , inDictionary [, outJSON]
def generateChain(depth, inFile):
import collections, re
numChar, endChar = '#', '.'
regexWord = re.compile('^[a-z]+$')
depthRange = range(depth - 1)
padStr = ' ' * (depth - 1)
chars = collections.deque(maxlen = depth) # limit to depth chars
de... | mit |
funrollloops/nebree8 | ice.py | 2 | 1223 | #!/usr/bin/env python
import time
from physical_robot import PhysicalRobot
from actions.ice import PrepareIce, DispenseIce, ICE_LOCATION, StartIce, StopIce
from actions.move import Move
from actions.led import SetLedForValve, Led
from parts import io_bank
robot = PhysicalRobot()
time.sleep(2)
#robot.io.nano.WriteDel... | gpl-2.0 |
laiy/Database_Project | third_party/nltk/parse/malt.py | 5 | 10238 | # Natural Language Toolkit: Interface to MaltParser
#
# 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
import os
import tempfile
import glob
from operator import add
from fun... | apache-2.0 |
guorendong/iridium-browser-ubuntu | third_party/typ/typ/runner.py | 25 | 31522 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | bsd-3-clause |
krummler/zxing-ios | cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/rmic.py | 34 | 4136 | """SCons.Tool.rmic
Tool-specific initialization for rmic.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
#... | apache-2.0 |
garbled1/ansible | lib/ansible/modules/cloud/google/gcdns_zone.py | 29 | 12483 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 CallFire Inc.
# 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
###########################################################... | gpl-3.0 |
beepee14/scikit-learn | sklearn/linear_model/__init__.py | 270 | 3096 | """
The :mod:`sklearn.linear_model` module implements generalized linear models. It
includes Ridge regression, Bayesian Regression, Lasso and Elastic Net
estimators computed with Least Angle Regression and coordinate descent. It also
implements Stochastic Gradient Descent related algorithms.
"""
# See http://scikit-le... | bsd-3-clause |
olivierdalang/QGIS | python/console/console.py | 4 | 34736 | # -*- coding:utf-8 -*-
"""
/***************************************************************************
Python Console for QGIS
-------------------
begin : 2012-09-10
copyright : (C) 2012 by Salvatore Larosa
email : lrssvtml (at) gmail (dot) com
***... | gpl-2.0 |
martynovp/edx-platform | lms/djangoapps/instructor/tests/test_legacy_raw_download_csv.py | 60 | 2477 | # -*- coding: utf-8 -*-
"""
Create course and answer a problem to test raw grade CSV
"""
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from nose.plugins.attrib import attr
from courseware.tests.test_submitting_problems import TestSubmittingProblems
from student.roles import ... | agpl-3.0 |
ldtri0209/robotframework | src/robot/libraries/DeprecatedOperatingSystem.py | 5 | 2029 | # Copyright 2008-2014 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
benthomasson/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_user.py | 5 | 8931 | #!/usr/bin/python
#
# (c) 2017, Daniel Korn <korndaniel1@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 o... | gpl-3.0 |
oasiswork/odoo | addons/purchase/edi/purchase_order.py | 439 | 9703 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
CristianBB/SickRage | lib/unidecode/x00d.py | 252 | 4121 | data = (
'[?]', # 0x00
'[?]', # 0x01
'N', # 0x02
'H', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'R', # 0x0b
'L', # 0x0c
'[?]', # 0x0d
'e', # 0x0e
'ee', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'o', # 0x12
'oo', # ... | gpl-3.0 |
odubno/microblog | venv/lib/python2.7/site-packages/flask/testsuite/reqctx.py | 557 | 5960 | # -*- coding: utf-8 -*-
"""
flask.testsuite.reqctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the request context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
try:
from greenlet import greenlet
except ImportError:
greenlet = None... | bsd-3-clause |
smartforceplus/SmartForceplus | .local/share/Odoo/addons/8.0/builder/models/demo/base.py | 1 | 5437 | import json
import pickle
import os
import random
from openerp import models, api, fields, _
class GeneratorInterface(models.AbstractModel):
_name = 'builder.ir.model.demo.generator.base'
_description = 'Generator Interface'
@api.multi
def get_generator(self, field):
raise NotImplementedErro... | agpl-3.0 |
akariv/redash | redash/handlers/data_sources.py | 1 | 4792 | from flask import make_response, request
from flask_restful import abort
from funcy import project
from redash import models
from redash.utils.configuration import ConfigurationContainer, ValidationError
from redash.permissions import require_admin, require_permission, require_access, view_only
from redash.query_runne... | bsd-2-clause |
Drudenhaus/aws-ec2rescue-linux | lib/boto3/docs/collection.py | 18 | 9721 | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | apache-2.0 |
redeyser/IceCash2 | install/pyusb-1.0.0rc1/build/lib.linux-armv7l-2.7/usb/_debug.py | 29 | 3215 | # Copyright (C) 2009-2014 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided... | gpl-3.0 |
osrg/ryu | ryu/services/protocols/bgp/info_base/vpn.py | 9 | 4066 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
ivarptr/support-tools | googlecode-issues-exporter/issues_test.py | 90 | 9573 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
mat128/netman | netman/adapters/switches/juniper/standard.py | 2 | 1751 | # Copyright 2015 Internap.
#
# 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, so... | apache-2.0 |
nandhp/youtube-dl | youtube_dl/extractor/shared.py | 11 | 2168 | from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
sanitized_Request,
urlencode_postdata,
)
class SharedIE(InfoExtractor):
IE_DESC = 'shared.sx and vivo.sx'
_VALID_URL = r'https?://(?:shared|vivo)\.sx/(?P... | unlicense |
solintegra/addons | product_variants_no_automatic_creation/models/pricelist.py | 29 | 7484 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
jgeskens/django | tests/fixtures_model_package/tests.py | 5 | 3627 | from __future__ import unicode_literals
from django.core import management
from django.db import transaction
from django.test import TestCase, TransactionTestCase
from .models import Article, Book
class SampleTestCase(TestCase):
fixtures = ['fixture1.json', 'fixture2.json']
def testClassFixtures(self):
... | bsd-3-clause |
krbeverx/Firmware | msg/tools/generate_microRTPS_bridge.py | 2 | 27149 | #!/usr/bin/env python3
################################################################################
#
# Copyright 2017 Proyectos y Sistemas de Mantenimiento SL (eProsima).
# Copyright (c) 2018-2019 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# mo... | bsd-3-clause |
hiidef/hiicart | hiicart/tests/paypal_express.py | 1 | 2736 | import base
from hiicart.gateway.paypal_express.gateway import PaypalExpressCheckoutGateway
STORE_SETTINGS = {
'API_USERNAME': 'sdk-three_api1.sdk.com',
'API_PASSWORD': 'QFZCWN5HZM8VBG7Q',
'API_SIGNATURE': 'A-IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU',
'RETURN_URL': 'http:/... | mit |
Djabbz/scikit-learn | sklearn/externals/odict.py | 63 | 9149 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger
# http://code.activestate.com/recipes/576693/
"Ordered dictionary"
try:
from thread import get_ident as _get_ident
except Im... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.