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 |
|---|---|---|---|---|---|
tswast/google-cloud-python | bigquery/samples/undelete_table.py | 2 | 2396 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
saddingtonbaynes/rez | src/rez/tests/test_shells.py | 3 | 9971 | """
test shell invocation
"""
from rez.system import system
from rez.shells import create_shell
from rez.resolved_context import ResolvedContext
from rez.rex import RexExecutor, literal, expandable
import rez.vendor.unittest2 as unittest
from rez.tests.util import TestBase, TempdirMixin, shell_dependent, \
install_... | gpl-3.0 |
ijat/Hotspot-PUTRA-Auto-login | PyInstaller-3.2/PyInstaller/hooks/hook-IPython.py | 1 | 1076 | #-----------------------------------------------------------------------------
# Copyright (c) 2013-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | gpl-3.0 |
coreyfarrell/testsuite | lib/python/asterisk/ari.py | 2 | 29367 | """
Copyright (C) 2013, Digium, Inc.
David M. Lee, II <dlee@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
"""
import datetime
import json
import logging
import re
import requests
import traceback
try:
from urllib.parse import urlencode
except:
... | gpl-2.0 |
CalvinChhour/GoogleTest | test/gtest_uninitialized_test.py | 2901 | 2480 | #!/usr/bin/env python
#
# Copyright 2008, 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... | bsd-3-clause |
foufou55/Sick-Beard | lib/requests/packages/urllib3/request.py | 107 | 5427 | # urllib3/request.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencod... | gpl-3.0 |
caot/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/cl/forms.py | 110 | 3188 | """
Chile specific form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
class CLRegionSelect(Select):
""... | apache-2.0 |
EZchip/gdb | gdb/testsuite/gdb.python/py-pp-maint.py | 19 | 2875 | # Copyright (C) 2010-2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | gpl-2.0 |
joachimmetz/plaso | plaso/analyzers/manager.py | 4 | 3480 | # -*- coding: utf-8 -*-
"""This file contains a class for managing digest analyzers for Plaso."""
class AnalyzersManager(object):
"""Class that implements the analyzers manager."""
_analyzer_classes = {}
@classmethod
def DeregisterAnalyzer(cls, analyzer_class):
"""Deregisters a analyzer class.
The ... | apache-2.0 |
cechrist/cardoon | cardoon/devices/cppaddev.py | 1 | 5902 | """CppAD device interface. Provides functions to implement evaluation of
nonlinear equations and derivatives using the pycppad library:
http://www.seanet.com/~bradbell/pycppad/index.xml
Usage:
=====
import cppaddev as ad
...
def process_params(self):
...
# Add the following at the end to make su... | gpl-3.0 |
piiswrong/mxnet | tools/caffe_converter/convert_symbol.py | 35 | 13432 | # 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 |
Flimm/linkchecker | scripts/debugparse.py | 9 | 1429 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2011-2014 Bastian Kleineidam
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | gpl-2.0 |
open-synergy/sale-workflow | product_special_type_sale/sale.py | 33 | 5086 | # -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier
# Copyright 2012 Camptocamp SA
#
# 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... | agpl-3.0 |
zhangjiajie/PTP-light | PTP.py | 1 | 11582 | #! /usr/bin/env python
try:
import sys
import math
import collections
import os
import argparse
import treeIO
from treeIO import Tree, SeqGroup
from nexus import NexusReader
from PTPLLH import lh_ratio_test, exp_distribution, species_setting, exponential_mixture
from summary import partitionparser
except Impo... | gpl-3.0 |
MayankGo/ec2-api | ec2api/db/api.py | 1 | 3832 | # Copyright 2013 Cloudscaling Group, 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 applicabl... | apache-2.0 |
alwayskidd/LRB | .waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Options.py | 330 | 5458 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,tempfile,optparse,sys,re
from waflib import Logs,Utils,Context
cmds='distclean configure build install clean uninstall check dist distcheck'.split()
options={}
comma... | gpl-2.0 |
PeterDing/iScript | leetcode_problems.py | 19 | 4146 | #!/usr/bin/env python
# -*- coding=utf-8 -*-
import sys
import re
import os
import argparse
import requests
from lxml import html as lxml_html
try:
import html
except ImportError:
import HTMLParser
html = HTMLParser.HTMLParser()
try:
import cPickle as pk
except ImportError:
import pickle as pk
c... | mit |
40223125/40223125-2 | static/Brython3.1.0-20150301-090019/Lib/xml/sax/saxutils.py | 730 | 11688 | """\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urllib.parse, urllib.request
import io
from . import handler
from . import xmlreader
def __dict_replace(s, d):
"""Replace substrings of a string using a dictionary."""
for key, val... | gpl-3.0 |
callowayproject/django-resources | contentrelations/related.py | 1 | 7787 | from django.db.models import Q
from django.db import models
from django.contrib.contenttypes.models import ContentType
try:
from django.contrib.contenttypes.fields import GenericForeignKey
except ImportError:
from django.contrib.contenttypes.generic import GenericForeignKey
from .generic import GFKOptimizedQue... | apache-2.0 |
ahb0327/intellij-community | python/testData/types/NumpyArrayIntMultiplicationType/numpy/core/multiarray.py | 79 | 4929 | class ndarray(object):
"""
ndarray(shape, dtype=float, buffer=None, offset=0,
strides=None, order=None)
An array object represents a multidimensional, homogeneous array
of fixed-size items. An associated data-type object describes the
format of each element in the array... | apache-2.0 |
tadebayo/myedge | myvenv/Lib/site-packages/easy_thumbnails/get_version.py | 13 | 1911 | from __future__ import unicode_literals
import datetime
import os
import subprocess
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
if version is None:
from easy_thumbnails import VERSION as version
else:
assert len(version) == 5
assert ve... | mit |
hbmartin/robotframework-selenium2library | src/Selenium2Library/locators/tableelementfinder.py | 33 | 3235 | from selenium.common.exceptions import NoSuchElementException
from Selenium2Library import utils
from elementfinder import ElementFinder
class TableElementFinder(object):
def __init__(self, element_finder=None):
if not element_finder:
element_finder = ElementFinder()
self._element_find... | apache-2.0 |
midnightmagic/p2pool | wstools/Namespaces.py | 292 | 9396 | # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISC... | gpl-3.0 |
keichan100yen/ode-ext | boost/tools/build/test/preprocessor.py | 58 | 1070 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test the C/C++ preprocessor.
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.... | mit |
google/struct2tensor | struct2tensor/expression_impl/promote_and_broadcast.py | 1 | 4361 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
zwqjsj0404/HBase-Research | src/examples/thrift2/DemoClient.py | 23 | 2351 | """
Copyright 2011 The Apache Software Foundation
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 Apach... | apache-2.0 |
guewen/OpenUpgrade | doc/conf.py | 52 | 8573 | # -*- coding: utf-8 -*-
#
# OpenERP Technical Documentation configuration file, created by
# sphinx-quickstart on Fri Feb 17 16:14:06 2012.
#
# 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.
#
#... | agpl-3.0 |
madmouser1/beets | beets/plugins.py | 11 | 16228 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... | mit |
plotly/python-api | packages/python/plotly/plotly/validators/barpolar/marker/colorbar/title/_font.py | 2 | 1543 | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="font", parent_name="barpolar.marker.colorbar.title", **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
paren... | mit |
WoLpH/CouchPotatoServer | libs/bs4/builder/_html5lib.py | 119 | 7746 | __all__ = [
'HTML5TreeBuilder',
]
import warnings
from bs4.builder import (
PERMISSIVE,
HTML,
HTML_5,
HTMLTreeBuilder,
)
from bs4.element import NamespacedAttribute
import html5lib
from html5lib.constants import namespaces
from bs4.element import (
Comment,
Doctype,
NavigableStr... | gpl-3.0 |
hawkowl/treq | treq/auth.py | 8 | 1208 | from twisted.web.http_headers import Headers
import base64
class UnknownAuthConfig(Exception):
def __init__(self, config):
super(Exception, self).__init__(
'{0!r} not of a known type.'.format(config))
class _RequestHeaderSettingAgent(object):
def __init__(self, agent, request_headers):
... | mit |
v1bri/gnuradio | grc/core/utils/odict.py | 12 | 3417 | """
Copyright 2008-2015 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
cjb/etherpad-lite | bin/dirty-db-cleaner.py | 70 | 1394 | #!/usr/bin/python -u
#
# Created by Bjarni R. Einarsson, placed in the public domain. Go wild!
#
import json
import os
import sys
try:
dirtydb_input = sys.argv[1]
dirtydb_output = '%s.new' % dirtydb_input
assert(os.path.exists(dirtydb_input))
assert(not os.path.exists(dirtydb_output))
except:
print... | apache-2.0 |
Rogentos/argent-anaconda | scripts/getlangnames.py | 4 | 1394 | #
# getlangnames.py
#
# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later... | gpl-2.0 |
sxpert/ansible-modules-core | utilities/logic/async_status.py | 137 | 3042 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
#
# 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 ... | gpl-3.0 |
minhphung171093/OpenERP_V7 | openerp/addons/hr_recruitment/__init__.py | 433 | 1145 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
nuxleus/cherokee-webserver | admin/plugins/rrd.py | 3 | 1705 | # -*- coding: utf-8 -*-
#
# Cheroke-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2009 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Softwar... | gpl-2.0 |
vikatory/kbengine | kbe/res/scripts/common/Lib/unittest/test/_test_warnings.py | 858 | 2304 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... | lgpl-3.0 |
dberroya/trad-arducopter | Tools/autotest/pysim/fdpexpect.py | 264 | 2488 | """This is like pexpect, but will work on any file descriptor that you pass it.
So you are reponsible for opening and close the file descriptor.
$Id: fdpexpect.py 505 2007-12-26 21:33:50Z noah $
"""
from pexpect import *
import os
__all__ = ['fdspawn']
class fdspawn (spawn):
"""This is like pexpect.spawn but a... | gpl-3.0 |
tarasane/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_loss_behaviorGBM.py | 5 | 2967 | import sys
sys.path.insert(1, "../../../")
import h2o, tests
def distribution_behaviorGBM():
#Log.info("==============================")
#Log.info("Default Behavior - Gaussian")
#Log.info("==============================")
eco = h2o.import_file(path=h2o.locate("smalldata/gbm_test/ecology_model.csv"))
#... | apache-2.0 |
loveward/yingsuo | mujson_mgr.py | 1 | 10335 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import traceback
from shadowsocks import shell, common
from configloader import load_config, get_config
import random
import getopt
import sys
import json
import base64
class MuJsonLoader(object):
def __init__(self):
self.json = None
def load(self, path):
l = "[]"
t... | apache-2.0 |
goodes/fit4school | fit4school/core/migrations/0007_trackeractivity.py | 1 | 1072 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-12-10 07:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0006_auto_20171207_0148'),
]
operations = ... | apache-2.0 |
EvanK/ansible-modules-extras | monitoring/zabbix_group.py | 45 | 7421 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013-2014, Epic Games, 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 |
hgl888/flatbuffers | python/flatbuffers/table.py | 20 | 4708 | # 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 a... | apache-2.0 |
ychen820/microblog | y/google-cloud-sdk/.install/.backup/lib/googlecloudsdk/compute/subcommands/forwarding_rules/create.py | 2 | 5592 | # Copyright 2014 Google Inc. All Rights Reserved.
"""Command for creating forwarding rules."""
from googlecloudapis.compute.v1 import compute_v1_messages
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.compute.lib import base_classes
from googlecloudsdk.compute.lib import forwarding_rules_utils as u... | bsd-3-clause |
devttys0/idascript | src/idascript.py | 1 | 1858 | ##################################################################################################
# Python module for IDAPython scripts executed via idascript.
#
# Copied from the original idascript utility, with minor changes: http://www.hexblog.com/?p=128
#
# Craig Heffner
# 14-November-2012
# http://www.tacn... | mit |
wfxiang08/django178 | tests/queries/tests.py | 3 | 145751 | from __future__ import unicode_literals
import datetime
import pickle
import unittest
import warnings
from collections import OrderedDict
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db import DEFAULT_DB_ALIAS, connection
from django.db.models import F, Q, Count
from djang... | bsd-3-clause |
albertomurillo/ansible | test/units/modules/network/routeros/routeros_module.py | 52 | 2521 | # (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
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
shahar-stratoscale/nova | nova/api/ec2/inst_state.py | 103 | 1486 | # Copyright 2011 Isaku Yamahata <yamahata at valinux co jp>
# 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-... | apache-2.0 |
poppy-project/pypot | pypot/vrep/__init__.py | 1 | 5778 | import json
import logging
from functools import partial
from collections import OrderedDict
from .io import (VrepIO, close_all_connections,
VrepIOError, VrepConnectionError)
from .controller import VrepController, VrepObjectTracker
from .controller import VrepCollisionTracker, VrepCollisionDetector... | gpl-3.0 |
mushtaqak/edx-platform | common/djangoapps/student/migrations/0003_auto__add_usertestgroup.py | 188 | 8942 | # encoding: 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 'UserTestGroup'
db.create_table('student_usertestgroup', (
('id', self.gf('django.db.m... | agpl-3.0 |
ChrisChinchilla/compose | tests/acceptance/cli_test.py | 2 | 32568 | from __future__ import absolute_import
import os
import shlex
import signal
import subprocess
import time
from collections import namedtuple
from operator import attrgetter
from docker import errors
from .. import mock
from compose.cli.command import get_project
from compose.cli.docker_client import docker_client
fr... | apache-2.0 |
childsish/lhc-python | setup.py | 1 | 1367 | import os
from subprocess import Popen, PIPE
from setuptools import setup, find_packages, Extension
bitap_extension = Extension(
'lhc.misc.bitap',
['lib/bitap/bitapmodule.cpp', 'lib/bitap/bitap.cpp'],
include_dirs=['lib/bitap'])
with open('README.rst', encoding='utf-8') if os.path.exists('README.rst') e... | gpl-2.0 |
realsobek/freeipa | ipatests/test_xmlrpc/tracker/group_plugin.py | 4 | 9655 | #
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
from ipatests.test_xmlrpc import objectclasses
from ipatests.test_xmlrpc.xmlrpc_test import fuzzy_digits, fuzzy_uuid
from ipatests.test_xmlrpc.tracker.base import Tracker
from ipatests.util import assert_deepequal, get_group_dn
class GroupTracke... | gpl-3.0 |
siriuscoin/siriuscoin | contrib/testgen/base58.py | 2139 | 2818 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... | mit |
edoko/android_lg_mako | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
chaubold/hytra | empryonic/learning/quantification.py | 1 | 34287 | import unittest as _ut
import numpy as np
from empryonic import io as _io
import math
###
### Events as members of sets for the calculation of performance measures
###
class Event( object ):
@property
def setid( self ):
return self._setid
@property
def timestep( self ):
return self._ti... | mit |
chaubold/hytra | scripts/train_transition_classifier.py | 1 | 17108 | # pythonpath modification to make hytra and empryonic available
# for import without requiring it to be installed
from __future__ import print_function, absolute_import, nested_scopes, generators, division, with_statement, unicode_literals
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# standard impor... | mit |
cogeorg/black_rhino | examples/degroot/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py | 75 | 7708 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
import networkx
from nose.plugins.attrib import attr
from networkx import edge_current_flow_betweenness_centrality \
as edge_current_flow
from networkx import edge_current_flow_betweenness_centrality_subset \
as edge_current_flow_subset
... | gpl-3.0 |
csrocha/OpenUpgrade | addons/account_followup/report/account_followup_print.py | 7 | 5990 | # -*- 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 |
chanderbgoel/pybrain | examples/supervised/backprop/parityrnn.py | 26 | 2046 | from __future__ import print_function
#!/usr/bin/env python
""" A simple recurrent neural network that detects parity for arbitrary sequences. """
__author__ = 'Tom Schaul (tom@idsia.ch)'
from datasets import ParityDataSet #@UnresolvedImport
from pybrain.supervised.trainers.backprop import BackpropTrainer
from pybra... | bsd-3-clause |
nemesiscodex/JukyOS-sugar | extensions/deviceicon/speech.py | 1 | 5531 | # Copyright (C) 2011 One Laptop Per Child
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribu... | gpl-2.0 |
sunny94/temp | sympy/plotting/pygletplot/plot_controller.py | 120 | 6965 | from __future__ import print_function, division
from pyglet.window import key
from pyglet.window.mouse import LEFT, RIGHT, MIDDLE
from util import get_direction_vectors, get_basis_vectors
class PlotController(object):
normal_mouse_sensitivity = 4.0
modified_mouse_sensitivity = 1.0
normal_key_sensitivit... | bsd-3-clause |
robotcator/gensim | gensim/examples/dmlcz/sources.py | 83 | 12976 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module contains implementations (= different classes) which encapsulate the
idea of a Digital Library document source.
A docum... | lgpl-2.1 |
abn/coreemu | daemon/examples/netns/iperf-performance-chain.py | 11 | 3196 | #!/usr/bin/python
# Copyright (c)2013 the Boeing Company.
# See the LICENSE file included in this distribution.
# This script creates a CORE session, that will connect n nodes together
# in a chain, with static routes between nodes
# number of nodes / number of hops
# 2 0
# 3 ... | bsd-2-clause |
xsteadfastx/subsonic-xbmc-addon | plugin.audio.subsonic/resources/lib/requests/adapters.py | 293 | 14608 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib3.response impo... | mit |
openstack/heat | heat/engine/resources/openstack/heat/remote_stack.py | 1 | 18516 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 |
pgroudas/pants | tests/python/pants_test/tasks/test_listtargets.py | 1 | 5725 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textw... | apache-2.0 |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/pandas/compat/__init__.py | 6 | 11686 | """
compat
======
Cross-compatible functions for Python 2 and 3.
Key items to import for 2/3 compatible code:
* iterators: range(), map(), zip(), filter(), reduce()
* lists: lrange(), lmap(), lzip(), lfilter()
* unicode: u() [u"" is a syntax error in Python 3.0-3.2]
* longs: long (int in Python 3)
* callable
* iterab... | mit |
joongh/robotframework | atest/testresources/listeners/attributeverifyinglistener.py | 4 | 2788 | import os
import sys
if sys.version_info[0] > 2:
long = int
basestring = str
ROBOT_LISTENER_API_VERSION = '2'
OUTFILE = open(os.path.join(os.getenv('TEMPDIR'), 'listener_attrs.txt'), 'w')
START = 'doc starttime '
END = START + 'endtime elapsedtime status '
SUITE = 'id longname metadata source tests suites ... | apache-2.0 |
encukou/freeipa | ipatests/test_integration/test_forced_client_reenrollment.py | 2 | 11881 | # Authors:
# Ana Krivokapic <akrivoka@redhat.com>
#
# Copyright (C) 2013 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... | gpl-3.0 |
KontorConsulting/odoo | addons/hr_timesheet_invoice/wizard/__init__.py | 433 | 1159 | # -*- 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 |
ownport/ansible-lookups | src/lookups/lookup/first_found.py | 1 | 5368 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
# take a list of files and (optionally) a list of paths
# return the first existing file found in the paths
# [file1, file2, file3], [path1, path2, path3]
# search order is:
# path1/file1
# path1/file2
# path1/file3
# path2/file1
#... | gpl-3.0 |
FreeFighter77/venom-xbmc-addons-beta | plugin.video.vstream/resources/sites/trash/moviemaze_de.py | 4 | 10148 | from resources.lib.util import cUtil
from resources.lib.handler.outputParameterHandler import cOutputParameterHandler
from resources.lib.handler.inputParameterHandler import cInputParameterHandler
from resources.lib.parser import cParser
from resources.lib.handler.requestHandler import cRequestHandler
from resources.li... | gpl-2.0 |
geimer/easybuild-framework | easybuild/tools/build_log.py | 1 | 5969 | # #
# Copyright 2009-2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (ht... | gpl-2.0 |
azavea/django-jenkins | django_jenkins/tasks/run_sloccount.py | 3 | 1638 | # -*- coding: utf-8 -*-
import os
import sys
from optparse import make_option
from django_jenkins.functions import check_output
from django_jenkins.tasks import BaseTask, get_apps_locations
class Task(BaseTask):
option_list = [
make_option("--sloccount-with-migrations",
action="store_t... | lgpl-3.0 |
tovrstra/horton | horton/part/mbis.py | 4 | 7124 | # -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | gpl-3.0 |
textioHQ/pattern | pattern/vector/svm/liblinear.py | 4 | 10842 | #!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
from os import path
import sys
# For unix the prefix 'lib' is not considered.
if find_library('linear'):
liblinear = CDLL(find_library('linear'))
elif find_library('liblinear'):
liblinear = CDLL(find_library('liblinear'))
else:
... | bsd-3-clause |
mdworks2016/work_development | Python/05_FirstPython/Chapter8_ThirdParty/fpython_develop/lib/python3.7/site-packages/bs4/builder/__init__.py | 2 | 19839 | # Use of this source code is governed by the MIT license.
__license__ = "MIT"
from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
Stylesheet,
Script,
TemplateString,
nonwhitespace_re
)
__all__ = [
'... | apache-2.0 |
jacky-young/crosswalk-test-suite | misc/webapi-service-tests/inst.py | 5 | 3206 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
Brett777/Predict-Risk | ApprovalModel.py | 1 | 1979 |
# coding: utf-8
# In[ ]:
import h2o
import pandas as pd
# initialize the model scoring server
h2o.init(nthreads=1,max_mem_size=1, start_h2o=True, strict_version_check = False)
def approve_loan(Loan_Amount,Term,Interest_Rate,Employment_Years,Home_Ownership,Annual_Income,Verification_Status,Loan_Purpose,State,
... | apache-2.0 |
jborean93/ntlm-auth | tests/test_compute_hash.py | 1 | 1658 | import ntlm_auth.compute_hash as compute_hash
class TestComputeHash(object):
def test_lmowfv1(self):
# 4.2.2.1.1 - LMOWFv1()
expected = b"\xe5\x2c\xac\x67\x41\x9a\x9a\x22" \
b"\x4a\x3b\x10\x8f\x3f\xa6\xcb\x6d"
actual = compute_hash._lmowfv1("Password")
assert ac... | mit |
h3biomed/ansible | lib/ansible/playbook/become.py | 12 | 3669 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
IKholopov/HackUPC2017 | hackupc/env/lib/python3.5/site-packages/social_core/backends/line.py | 1 | 3104 | # vim:fileencoding=utf-8
import requests
import json
from .oauth import BaseOAuth2
from ..exceptions import AuthFailed
from ..utils import handle_http_errors
class LineOAuth2(BaseOAuth2):
name = 'line'
AUTHORIZATION_URL = 'https://access.line.me/dialog/oauth/weblogin'
ACCESS_TOKEN_URL = 'https://api.line... | apache-2.0 |
Instagram/django | tests/modeltests/generic_relations/models.py | 90 | 2521 | """
34. Generic relations
Generic relations let an object have a foreign key to any object through a
content-type/object-id field. A ``GenericForeignKey`` field can point to any
object, be it animal, vegetable, or mineral.
The canonical example is tags (although this example implementation is *far*
from complete).
""... | bsd-3-clause |
zooba/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/encodings/cp1254.py | 272 | 13502 | """ Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.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,in... | apache-2.0 |
yamila-moreno/django | django/conf/locale/lt/formats.py | 504 | 1830 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. E j \d.'
TIME_FORMAT = 'H:... | bsd-3-clause |
thaim/ansible | lib/ansible/modules/storage/purestorage/purefa_connect.py | 21 | 4803 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | mit |
Plain-Andy-legacy/android_external_chromium_org | net/tools/testserver/backoff_server.py | 189 | 2760 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This is a simple HTTP server for manually testing exponential
back-off functionality in Chrome.
"""
import BaseHTTPServer
impo... | bsd-3-clause |
nmoya/whatsapp-parser | wp_parser/parsers/facebook.py | 3 | 1029 | from datetime import datetime
import message
class ParserFacebook():
''' A line is a dict object in this format:
{u'message': u'text text', u'from': u'Username One', u'id':
u'3294659605566648_1432085429', u'datetime': u'2015-05-20T01:30:29+0000'}
'''
def __init__(self, raw_messages):
... | mit |
C-Pro/pgdocgen | pgdocgen/ddlobject/schema.py | 1 | 1808 | '''Schema description module'''
import copy
from pgdocgen.ddlobject.ddlobject import DDLObject
from pgdocgen.utils import get_logger
class Schema(DDLObject):
'''SQL schema class'''
contents = []
def read_contents(self, name, conn):
'''Read schema tables'''
sql = '''select c.relname,
... | gpl-2.0 |
horczech/coala-bears | bears/python/PyUnusedCodeBear.py | 5 | 1681 | import autoflake
from coalib.bears.LocalBear import LocalBear
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.results.Diff import Diff
from coalib.results.Result import Result
class PyUnusedCodeBear(LocalBear):
LANGUAGES = {'Python', 'Python 2', 'Python 3'}
REQUIREMEN... | agpl-3.0 |
pquentin/libcloud | libcloud/compute/types.py | 2 | 11687 | # 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 use ... | apache-2.0 |
mitya57/django | tests/shell/tests.py | 56 | 2372 | import sys
import unittest
from unittest import mock
from django import __version__
from django.core.management import CommandError, call_command
from django.test import SimpleTestCase
from django.test.utils import captured_stdin, captured_stdout, patch_logger
class ShellCommandTestCase(SimpleTestCase):
def tes... | bsd-3-clause |
j-mracek/dnf | tests/test_libcomps.py | 5 | 2463 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed ... | gpl-2.0 |
Alignak-monitoring-contrib/alignak-app | test/test_about_dialog.py | 1 | 2159 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2018:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) 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 Sof... | agpl-3.0 |
75651/kbengine_cloud | kbe/src/lib/python/Lib/lib2to3/fixes/fix_set_literal.py | 203 | 1697 | """
Optional fixer to transform set() calls to set literals.
"""
# Author: Benjamin Peterson
from lib2to3 import fixer_base, pytree
from lib2to3.fixer_util import token, syms
class FixSetLiteral(fixer_base.BaseFix):
BM_compatible = True
explicit = True
PATTERN = """power< 'set' trailer< '('
... | lgpl-3.0 |
SUSE/azurectl | azurectl/commands/base.py | 1 | 3692 | # Copyright (c) 2015 SUSE Linux GmbH. 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 la... | apache-2.0 |
ezequielpereira/Time-Line | libs_arm/wx/py/interpreter.py | 4 | 6422 | """Interpreter executes Python commands."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com> / "
__author__ += "David N. Mashburn <david.n.mashburn@gmail.com>"
__cvsid__ = "$Id$"
__revision__ = "$Revision$"[11:-2]
import os
import sys
from code import InteractiveInterpreter, compile_command
import dispatcher
im... | gpl-3.0 |
nevercast/home-assistant | homeassistant/components/sensor/time_date.py | 5 | 2649 | """
homeassistant.components.sensor.time_date
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Date and Time service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.time_date/
"""
import logging
import homeassistant.util.dt as dt_util
from homeassistant... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.