repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
google-research/google-research | dreg_estimators/utils.py | 1 | 4227 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
home-assistant/home-assistant | tests/components/wilight/__init__.py | 2 | 2363 | """Tests for the WiLight component."""
from pywilight.const import DOMAIN
from homeassistant.components.ssdp import (
ATTR_SSDP_LOCATION,
ATTR_UPNP_MANUFACTURER,
ATTR_UPNP_MODEL_NAME,
ATTR_UPNP_MODEL_NUMBER,
ATTR_UPNP_SERIAL,
)
from homeassistant.components.wilight.config_flow import (
CONF_MO... | apache-2.0 |
nfelsen/ansible-modules-core | cloud/rackspace/rax_keypair.py | 157 | 4957 | #!/usr/bin/python
# 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 distributed... | gpl-3.0 |
PeterPetrik/QGIS | scripts/mkuidefaults.py | 45 | 2909 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
***************************************************************************
mkuidefaults.py
---------------------
Date : June 2013
Copyright : (C) 2013 by Juergen E. Fischer
Email : jef at norbit dot de
***... | gpl-2.0 |
kaustubhhiware/coala-bears | bears/general/FilenameBear.py | 7 | 3379 | import os.path
from coalib.bears.LocalBear import LocalBear
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.bearlib.naming_conventions import (
to_camelcase, to_kebabcase, to_pascalcase, to_snakecase, to_spacecase)
class FilenameBear(LocalBear):
LANGUAGES = {'All'}
... | agpl-3.0 |
JioCloud/neutron | neutron/tests/unit/plugins/ml2/extensions/fake_extension.py | 15 | 2260 | # 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
# d... | apache-2.0 |
kogotko/carburetor | openstack_dashboard/dashboards/project/images/images/tests.py | 3 | 22912 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
sigma-random/pwndbg | pwndbg/commands/context.py | 1 | 5268 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import gdb
import pwndbg.arguments
import pwndbg.chain
import pwndbg.color
import pwndbg.commands
import pwndbg.commands.nearpc
import pwndbg.commands.telescope
import pwndbg.disasm
import pwndbg.events
import pwndbg.ida
import pwndbg.regs
import pwndbg.symbol
import pwndbg... | mit |
sumedhasingla/VTK | ThirdParty/Twisted/twisted/runner/inetdconf.py | 66 | 5397 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""
Parser for inetd.conf files
Maintainer: Andrew Bennetts
Future Plans: xinetd configuration file support?
"""
# Various exceptions
class InvalidConfError(Exception):
"""Invalid configuration file"""
class InvalidInetdConfError(Inval... | bsd-3-clause |
CankingApp/cankingapp.github.io | node_modules/.npminstall/node-gyp/3.3.1/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | apache-2.0 |
thundernet8/WRGameVideos-Server | venv/lib/python2.7/site-packages/sqlalchemy/inspection.py | 81 | 3093 | # sqlalchemy/inspect.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 inspection module provides the :func:`.inspect` function,
which deliver... | gpl-2.0 |
tiagocoutinho/bliss | bliss/tango/servers/keithley428_ds.py | 1 | 8344 | # -*- coding: utf-8 -*-
#
# This file is part of the bliss project
#
# Copyright (c) 2016 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
""" Keithley428 Current Amplifier
Class for controlling the Keithley428 current amplifier.
"""
__all__ = ["Keithley428", "main"]
# tang... | lgpl-3.0 |
basicthinker/Sexain-MemController | gem5-stable/src/cpu/ExeTracer.py | 27 | 1788 | # Copyright (c) 2007 The Regents of The University of Michigan
# 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 ... | apache-2.0 |
SmartInfrastructures/fuel-web-dev | nailgun/nailgun/api/v1/handlers/orchestrator.py | 1 | 12504 | # -*- coding: utf-8 -*-
# Copyright 2013 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 requi... | apache-2.0 |
yangdongsheng/autotest | installation_support/database_manager/dummy.py | 3 | 1096 | """
Dummy implementation of the database manager interface
"""
import logging
from autotest.installation_support.database_manager import base
class DummyDatabaseManager(base.BaseDatabaseManager):
'''
Dummy class that manages no database
'''
def exists(self):
'''
Checks if the databas... | gpl-2.0 |
dya2/python-for-android | python3-alpha/extra_modules/atom/url.py | 47 | 4351 | #!/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 |
0x0all/nupic | py/regions/PictureSensorExplorers/block1DOF.py | 9 | 2947 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... | gpl-3.0 |
toshywoshy/ansible | test/units/modules/network/cnos/test_cnos_static_route.py | 38 | 3285 | # (c) 2016 Red Hat Inc.
# Copyright (C) 2017 Lenovo.
#
# 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 late... | gpl-3.0 |
dbbhattacharya/kitsune | kitsune/dashboards/tests/test_models.py | 17 | 4111 | # -*- coding: utf-8 -*-
from mock import patch
from nose.tools import eq_
from kitsune.dashboards import models
from kitsune.dashboards.models import (
WikiDocumentVisits, LAST_7_DAYS, googleanalytics)
from kitsune.sumo.tests import TestCase
from kitsune.wiki.tests import document, revision
class DocumentVisitsT... | bsd-3-clause |
varunnaganathan/django | django/core/management/commands/inspectdb.py | 6 | 12242 | from __future__ import unicode_literals
import keyword
import re
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = "Introspects the database tables in the given database and... | bsd-3-clause |
CG-F16-24-Rutgers/steersuite-rutgers | steerstats/tools/GetTests.py | 8 | 1650 | #!/usr/bin/python
# Replace <USERNAME_DATABASE>, <USERNAME>, and <PASSWORD> below with your actual DB, user, and password.
import psycopg2
import psycopg2.extras
import sys
# Append parent directory to access steersuite api.
sys.path.append("../")
test_ids_file_name = sys.argv[1]
save_dir = sys.argv[2]
from steersu... | gpl-3.0 |
ubgarbage/gae-blog | external_auth/auth_backends.py | 1 | 1210 | from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
import logging
from models import AllowedUser
class NoPassBackend( ModelBackend ):
def check_if_allowed( self, name ):
try:
AllowedUser.objects.get( username=name )
except AllowedUser.... | bsd-3-clause |
0jpq0/kbengine | kbe/src/lib/python/Lib/test/test_codecmaps_kr.py | 60 | 1321 | #
# test_codecmaps_kr.py
# Codec mapping tests for ROK encodings
#
from test import support
from test import multibytecodec_support
import unittest
class TestCP949Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'cp949'
mapfileurl = 'http://www.unicode.org/Publi... | lgpl-3.0 |
mit-crpg/openmc | tests/regression_tests/mg_legendre/test.py | 10 | 1425 | import os
import numpy as np
import openmc
from openmc.examples import slab_mg
from tests.testing_harness import PyAPITestHarness
def create_library():
# Instantiate the energy group data and file object
groups = openmc.mgxs.EnergyGroups(group_edges=[0.0, 0.625, 20.0e6])
mg_cross_sections_file = openm... | mit |
evansd/django | tests/queries/test_q.py | 25 | 3262 | from django.db.models import F, Q
from django.test import SimpleTestCase
class QTests(SimpleTestCase):
def test_combine_and_empty(self):
q = Q(x=1)
self.assertEqual(q & Q(), q)
self.assertEqual(Q() & q, q)
def test_combine_and_both_empty(self):
self.assertEqual(Q() & Q(), Q())... | bsd-3-clause |
ubic135/odoo-design | addons/web/doc/conf.py | 494 | 8552 | # -*- 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 |
larsbergstrom/servo | tests/wpt/web-platform-tests/eventsource/resources/cors.py | 116 | 1335 | import os
from wptserve import pipes
def run_other(request, response, path):
#This is a terrible hack
environ = {"__file__": path}
execfile(path, environ, environ)
rv = environ["main"](request, response)
return rv
def main(request, response):
origin = request.GET.first("origin", request.header... | mpl-2.0 |
kushG/osf.io | scripts/populate_conferences.py | 1 | 6164 | #!/usr/bin/env python
# encoding: utf-8
import os
import sys
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth.core import User
from website import settings
from website.app import init_app
from website.conferences.model import Conference
def main():
init_app(s... | apache-2.0 |
DrMeers/django | tests/admin_widgets/widgetadmin.py | 68 | 1222 | from django.contrib import admin
from . import models
class WidgetAdmin(admin.AdminSite):
pass
class CarAdmin(admin.ModelAdmin):
list_display = ['make', 'model', 'owner']
list_editable = ['owner']
class CarTireAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs... | bsd-3-clause |
BizzCloud/PosBox | addons/mrp/report/bom_structure.py | 66 | 2475 | ## -*- 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 GN... | agpl-3.0 |
civisanalytics/ansible | lib/ansible/playbook/playbook_include.py | 20 | 6614 | # (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 |
t794104/ansible | lib/ansible/modules/files/synchronize.py | 19 | 22606 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012-2013, Timothy Appnel <tim@appnel.com>
# 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__ = typ... | gpl-3.0 |
OctoJobs/Octojobs | octojobs/models/__init__.py | 1 | 2197 | from sqlalchemy import engine_from_config
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import configure_mappers
import zope.sqlalchemy
# import or define all models here to ensure they are attached to the
# Base.metadata prior to any initialization routines
from .mymodel import Job # noqa
# run config... | mit |
MAECProject/vt-to-maec | virustotal_to_maec/virustotal_maec_packager.py | 1 | 5744 | """ Copyright (c) 2018, The MITRE Corporation. All rights reserved.
BY USING THE VIRSUTOTAL MAEC PACKER MODULE SCRIPT, YOU SIGNIFY YOUR ACCEPTANCE
OF THE TERMS AND CONDITIONS OF USE. IF YOU DO NOT AGREE TO THESE TERMS, DO
NOT USE THE VIRSUTOTAL MAEC PACKER MODULE.
For more information, please refer to the LICENSE.tx... | bsd-3-clause |
cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Tools/scripts/ptags.py | 97 | 1226 | #! /usr/bin/env python3
# ptags
#
# Create a tags file for Python programs, usable with vi.
# Tagged are:
# - functions (even inside other defs or classes)
# - classes
# - filenames
# Warns about files it cannot open.
# No warnings about duplicate tags.
import sys, re, os
tags = [] # Modified global variable!
de... | lgpl-3.0 |
adrianschroeter/kiwi | test/unit/tasks_result_list_test.py | 2 | 1560 | import sys
import mock
import os
from mock import patch
import kiwi
from .test_helper import argv_kiwi_tests
from kiwi.tasks.result_list import ResultListTask
class TestResultListTask(object):
def setup(self):
sys.argv = [
sys.argv[0], 'result', 'list', '--target-dir', 'directory'
]... | gpl-3.0 |
seem-sky/kbengine | kbe/src/lib/python/Lib/stat.py | 106 | 4400 | """Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... | lgpl-3.0 |
matthiasdiener/spack | var/spack/repos/builtin/packages/py-pysqlite/package.py | 4 | 1641 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
silentbob73/kitsune | scripts/crontab/gen-crons.py | 12 | 1521 | #!/usr/bin/env python
import os
from optparse import OptionParser
from jinja2 import Template
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
def main():
parser = OptionParser()
parser.add_option("-k", "--kitsune",
help="Location of kitsune (required)")
... | bsd-3-clause |
Krossom/python-for-android | python3-alpha/python3-src/Lib/test/test_multiprocessing.py | 47 | 65380 | #!/usr/bin/env python3
#
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import time
import io
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import test.support
# Skip tests if _multiprocessing wasn't built.
_... | apache-2.0 |
rerobins/rhobot_framework | test/components/scheduler/promises/test_2_1_2.py | 1 | 4726 | """
2.1.2.1 When fulfilled, a promise: must not transition to any other state.
https://github.com/promises-aplus/promises-tests/blob/2.1.1/lib/tests/2.1.2.js
"""
from sleekxmpp.test import SleekTest
import unittest
import threading
class Promise_2_1_2_TestCase(SleekTest):
dummy = {}
def setUp(self):
... | bsd-3-clause |
yetilinux/yetiweb | mirrors/migrations/0003_auto__add_mirrorlog.py | 5 | 4537 | # 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 'MirrorLog'
db.create_table('mirrors_mirrorlog', (
('id', self.gf('django.db.models.fiel... | gpl-2.0 |
nostrademons/pyjsdoc | setup.py | 1 | 1100 | #!/usr/bin/env python2.5
from setuptools import setup, find_packages
setup(
name='PyJSDoc',
version='0.9.0',
py_modules=['pyjsdoc'],
packages=['static'],
include_package_data=True,
zip_safe=True,
author='Jonathan Tang',
author_email='jonathan.d.tang@gmail.com',
license="MIT License... | apache-2.0 |
Comunitea/CMNT_004_15 | project-addons/reserve_without_save_sale/models/sale.py | 1 | 9322 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models, api
import odoo.addons.decimal_precision as dp
from datetime import datetime
from dateutil.relativedelta import relativedelta
class SaleOrder(models.Model):
_inherit = 'sale.order'
# state = fields.Selection(sel... | agpl-3.0 |
dsfsdgsbngfggb/odoo | addons/point_of_sale/report/__init__.py | 381 | 1238 | # -*- 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 |
meejah/crossbarexamples | rest/publisher/publish_signed.py | 12 | 2127 | ###############################################################################
##
## Copyright (C) 2014, Tavendo GmbH and/or collaborators. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
... | apache-2.0 |
taigaio/taiga-back | taiga/projects/migrations/0024_auto_20150810_1247.py | 1 | 1739 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.contrib.postgres.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('pro... | agpl-3.0 |
aisipos/django | django/contrib/gis/db/backends/mysql/introspection.py | 700 | 1771 | from MySQLdb.constants import FIELD_TYPE
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.mysql.introspection import DatabaseIntrospection
class MySQLIntrospection(DatabaseIntrospection):
# Updating the data_types_reverse dictionary with the appropriate
# type for Geometry fields.
... | bsd-3-clause |
tsufiev/horizon | openstack_dashboard/dashboards/project/data_processing/jobs/urls.py | 34 | 1733 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
shubhdev/edx-platform | pavelib/paver_tests/test_prereqs.py | 99 | 1862 | import os
import unittest
from pavelib.prereqs import no_prereq_install
class TestPaverPrereqInstall(unittest.TestCase):
"""
Test the status of the NO_PREREQ_INSTALL variable, its presence and how
paver handles it.
"""
def check_val(self, set_val, expected_val):
"""
Verify that set... | agpl-3.0 |
atruberg/django-custom | tests/validators/tests.py | 9 | 9491 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import types
from datetime import datetime, timedelta
from django.core.exceptions import ValidationError
from django.core.validators import *
from django.test.utils import str_prefix
from django.utils.unittest import TestCase
NOW = datetime.n... | bsd-3-clause |
TimothyVandenbrande/ansible-modules-extras | cloud/centurylink/clc_group.py | 25 | 17067 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# 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 la... | gpl-3.0 |
rednach/mod-webui | module/plugins/groups/groups.py | 1 | 4101 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
# Frederic Mohier, frederic.mohier@gmail.com
#
# This file is part of Shin... | agpl-3.0 |
charleswhchan/compose | tests/integration/testcases.py | 7 | 2355 | from __future__ import absolute_import
from __future__ import unicode_literals
from docker import errors
from .. import unittest
from compose.cli.docker_client import docker_client
from compose.config.config import ServiceLoader
from compose.const import LABEL_PROJECT
from compose.progress_stream import stream_output... | apache-2.0 |
thjashin/tensorflow | tensorflow/contrib/seq2seq/python/ops/helper.py | 8 | 18740 | # 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 |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/markupsafe/__init__.py | 27 | 10126 | # -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements an escape function and a Markup string to replace HTML
special characters with safe representations.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
import re
import string
from ._compat import int_types
from ._compat import iteritems
from ._compat imp... | mit |
domob1812/namecore | test/functional/test_framework/test_framework.py | 1 | 30327 | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
import configparser
from enum import Enum
import argparse
import loggin... | mit |
openhdf/enigma2-wetek | tools/svg2skin.py | 43 | 2483 | #!/usr/bin/python
# don't expect too much.
# this is a really simple&stupid svg parser, which will use rectangles
# and text fields to produce <widget> snippets for a skin.
# use object "id" fields for source names if you want.
# extracting font information is buggy.
# if you want text fields, please use flow text reg... | gpl-2.0 |
Teamxrtc/webrtc-streaming-node | third_party/depot_tools/tests/owners_unittest.py | 27 | 19429 | #!/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.
"""Unit tests for owners.py."""
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.a... | mit |
AsimmHirani/ISpyPi | tensorflow/contrib/tensorflow-master/tensorflow/python/framework/proto_test.py | 178 | 1704 | # 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 |
mohsenSy/zulip | zproject/jinja2/backends.py | 9 | 3647 | from __future__ import absolute_import
import sys
from typing import Any, Optional, Union
from six import text_type
import jinja2
from django.utils import six
from django.test.signals import template_rendered
from django.template.backends import jinja2 as django_jinja2
from django.template import TemplateDoesNotExist... | apache-2.0 |
matsengrp/bioboxpartis | bin/plot-data-vs-simu.py | 2 | 2588 | #!/usr/bin/env python
from subprocess import check_call
import argparse
import sys
import os
sys.path.insert(1, './python')
import utils
import plotting
from humans import humans, colors, all_subdirs
parser = argparse.ArgumentParser()
parser.add_argument('-b', action='store_true') # passed on to ROOT when plotting
p... | gpl-3.0 |
Intel-tensorflow/tensorflow | tensorflow/python/saved_model/loader_impl.py | 5 | 20558 | # 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 |
fjorba/invenio | modules/bibedit/lib/bibedit_config.py | 1 | 7374 | ## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option... | gpl-2.0 |
Niteesh01/sp17-i524 | project/S17-IR-P013/code/weather_data_analysis/src/iu/i524/S17IRP013/dao/hbase_connect.py | 19 | 1205 | import happybase as hbase
hb_conn = hbase.Connection('localhost', table_prefix='wda')
##############################################################
def create_table(table_name, families):
is_table_exists = False;
try:
is_table_exists = hb_conn.is_table_enabled(table_name)
except:
is_table... | apache-2.0 |
cyclops8456/vyatta-op | scripts/maya-date.py | 1 | 7503 | #!/usr/bin/env python
#
# Copyright (c) 2013 Daniil Baturin <daniil at baturin dot org>
#
# 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 the... | gpl-2.0 |
WillieMaddox/scipy | scipy/linalg/blas.py | 4 | 6663 | """
Low-level BLAS functions (:mod:`scipy.linalg.blas`)
===================================================
This module contains low-level functions from the BLAS library.
.. versionadded:: 0.12.0
.. warning::
These functions do little to no error checking.
It is possible to cause crashes by mis-using them,
... | bsd-3-clause |
cpicanco/player_plugins | filter_opencv_threshold.py | 1 | 3093 | # -*- coding: utf-8 -*-
'''
Pupil Player Third Party Plugins by cpicanco
Copyright (C) 2016 Rafael Picanço.
The present file is distributed under the terms of the GNU General Public License (GPL v3.0).
You should have received a copy of the GNU General Public License
along with this program. If not, see <ht... | gpl-3.0 |
tuomas2/automate | src/automate/worker.py | 1 | 4062 | # -*- coding: utf-8 -*-
# (c) 2015 Tuomas Airaksinen
#
# This file is part of Automate.
#
# Automate 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 l... | gpl-3.0 |
ahuarte47/QGIS | python/plugins/db_manager/db_plugins/spatialite/connector.py | 13 | 27423 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
stansonhealth/ansible-modules-core | cloud/amazon/ec2_vpc.py | 14 | 29673 | #!/usr/bin/python
# 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 distributed... | gpl-3.0 |
EliteTK/qutebrowser | qutebrowser/misc/httpclient.py | 6 | 3708 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
dpo/nlpy | nlpy/optimize/tr/trustregion.py | 3 | 8159 | """
Class definition for Trust-Region Algorithm
"""
from nlpy.krylov.pcg import TruncatedCG
from nlpy.krylov.ppcg import ProjectedCG
import numpy as np
from math import sqrt
__docformat__ = 'restructuredtext'
class TrustRegionFramework(object):
"""
Initializes an object allowing management of a trust region... | gpl-3.0 |
synasius/django | tests/utils_tests/test_baseconv.py | 326 | 1787 | from unittest import TestCase
from django.utils.baseconv import (
BaseConverter, base2, base16, base36, base56, base62, base64,
)
from django.utils.six.moves import range
class TestBaseConv(TestCase):
def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100))
for converte... | bsd-3-clause |
ddico/server-tools | base_multi_image/models/image.py | 11 | 5948 | # -*- coding: utf-8 -*-
# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import base64
import urllib
import os
import logging
from... | agpl-3.0 |
gannetson/sportschooldeopenlucht | env/lib/python2.7/site-packages/setuptools/command/upload.py | 12 | 6711 | """distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
from distutils import errors
from distutils import log
from distutils.core import Command
from distutils.spawn import spawn
try:
from hashlib import md5
except ImportError:
from md5 import md5
import os
impor... | bsd-3-clause |
HolgerPeters/scikit-learn | benchmarks/bench_plot_nmf.py | 28 | 15630 | """
Benchmarks of Non-Negative Matrix Factorization
"""
# Authors: Tom Dupre la Tour (benchmark)
# Chih-Jen Linn (original projected gradient NMF implementation)
# Anthony Di Franco (projected gradient, Python and NumPy port)
# License: BSD 3 clause
from __future__ import print_function
from time imp... | bsd-3-clause |
zcoder/p2pool | wstools/Utility.py | 292 | 50865 | # Copyright (c) 2003, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of
# any required approvals from the U.S. Dept. of Energy). All rights
# reserved.
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is ... | gpl-3.0 |
willhardy/django | tests/forms_tests/field_tests/test_filefield.py | 37 | 4004 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pickle
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import FileField, ValidationError
from django.test import SimpleTestCase
class FileFieldTest(SimpleTestCase):
def test_filefield_1(self):
f = Fil... | bsd-3-clause |
snkismKurian/titaniummobileProject | plugins/ti.alloy/plugin.py | 1729 | 5251 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
sora7/listparse | src/listparse/loader.py | 1 | 1078 | import urllib.request
class Loader(object):
def __init__(self):
pass
@staticmethod
def get_file(url):
req = urllib.request.Request(url)
ua = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:44.0) Gecko/20100101 Firefox/44.0'
accept = 'text/html,application/xhtml+xml,applicat... | gpl-2.0 |
tinchoss/Python_Android | python/src/Lib/distutils/text_file.py | 53 | 15145 | """text_file
provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""
__revision__ = "$Id: text_file.py 60923 2008-02-21 18:18:37Z guido.van.rossum $"
from types import *
import sys, os, string... | apache-2.0 |
boshnivolo/TIY-Assignments | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | cc0-1.0 |
sosolimited/Cinder | docs/libs/bs4/dammit.py | 408 | 29302 | # -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and XML, but it does not rewrite the
XML or HTML to reflect a new encoding; tha... | bsd-2-clause |
Brother-Simon/CodeIgniter | user_guide_src/source/conf.py | 86 | 8554 | # -*- coding: utf-8 -*-
#
# CodeIgniter documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 28 07:24:38 2011.
#
# 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.
#
#... | mit |
cbuntain/redditResponseExtractor | tester.py | 1 | 1422 | #!/usr/bin/python
import sys
import csv
import pprint
import cPickle
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.tree import export_graphviz
from sklearn.externals.six import StringIO
classifierPath = sys.arg... | mit |
svenkreiss/PyROOTUtils | PyROOTUtils/Marker.py | 1 | 1904 | import ROOT
from array import array
class Marker( ROOT.TMarker ):
def __init__( self, x,y, markerColor=None, markerStyle=5 ):
ROOT.TMarker.__init__( self, x,y, markerStyle )
if markerColor: self.SetMarkerColor( markerColor )
class CrossMarker( ROOT.TMarker ):
""" A special class just for "cr... | mit |
stewartpark/django | tests/template_tests/filter_tests/test_default.py | 521 | 2159 | from django.template.defaultfilters import default
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class DefaultTests(SimpleTestCase):
"""
Literal string arguments to the default filter are always treated as
safe strings, regardless of the au... | bsd-3-clause |
pearu/sympycore | sympycore/utils.py | 1 | 7700 | """Provides various implementation specific constants (expression heads, etc).
"""
__docformat__ = 'restructuredtext'
import inspect
class HEAD(object):
""" Base class to head constants.
Head constants are singletons.
"""
_cache = {}
def __new__(cls, *args):
key = '%s%s' % (cls.__name__,... | bsd-3-clause |
JingZhou0404/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/diff_parser.py | 154 | 7841 | # 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... | bsd-3-clause |
amitsi/networkscripts | tolly_config_setup.py | 2 | 25241 | from __future__ import print_function
import subprocess
import argparse
import errno
import time
import sys
####################
# Dynamic Constants
####################
g_loopback_ipv4 = "104.255.61.1"
g_loopback_ipv6 = "2620:0000:167F:b000::10"
g_ipv4_start = "104.255.61.68"
g_ipv6_start = "2620:0000:167F:b001::40"
... | gpl-3.0 |
jaruba/chromium.src | chrome/browser/chromeos/login/test/https_forwarder.py | 48 | 7132 | # 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.
"""An https server that forwards requests to another server. This allows a
server that supports http only to be accessed over https.
"""
import BaseHTTPServ... | bsd-3-clause |
nomaro/SickBeard_Backup | lib/subliminal/services/tvsubtitles.py | 30 | 7310 | # -*- coding: utf-8 -*-
# Copyright 2012 Nicolas Wack <wackou@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 Software Foundation; either version 3 of the Licen... | gpl-3.0 |
haroldl/homeworklog | django/conf/locale/en_GB/formats.py | 234 | 2048 | # -*- 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 = 'N j, Y' # 'Oct. 25, 2006'
TIME_FORMAT = 'P' ... | bsd-3-clause |
wangtuanjie/airflow | airflow/operators/s3_to_hive_operator.py | 38 | 6541 | from builtins import next
from builtins import zip
import logging
from tempfile import NamedTemporaryFile
from airflow.utils import AirflowException
from airflow.hooks import HiveCliHook, S3Hook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class S3ToHiveTransfer(BaseOperator):
... | apache-2.0 |
sinkuri256/python-for-android | python-modules/twisted/twisted/test/test_ftp.py | 49 | 100886 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
FTP tests.
Maintainer: Andrew Bennetts
"""
import os
import errno
from StringIO import StringIO
import getpass
from zope.interface import implements
from zope.interface.verify import verifyClass
from twisted.trial import unittest... | apache-2.0 |
eguitler/studentools | studentools/models.py | 1 | 2843 | from django.db import models
from django.contrib.auth.models import User
class EntityModel(models.Model):
name = models.CharField(max_length=50, default=None)
email = models.EmailField(default=None)
phone = models.CharField(max_length=15, default=None)
address = models.CharField(max_length=50, default... | gpl-3.0 |
yapkke/PyFinance | bin/pyf-crosscheckaccount.py | 1 | 1638 | #!/usr/bin/env python
import sys
import getopt
import simplejson
import pyfinance.files as pyfiles
def usage():
"""Display usage
"""
print "Usage "+sys.argv[0]+" <account to check against> <account to check>\n"+\
"\n"+\
"Accounts should be in the following format\n"+\
"\t<Fil... | apache-2.0 |
andrewleech/plugin.video.netflixbmc | resources/lib/pyOpenSSL/pyOpenSSL-0.13-py2.7-win32/OpenSSL/test/test_ssl.py | 81 | 71862 | # Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
"""
Unit tests for L{OpenSSL.SSL}.
"""
from gc import collect
from errno import ECONNREFUSED, EINPROGRESS, EWOULDBLOCK
from sys import platform, version_info
from socket import error, socket
from os import makedirs
from os.path import join
from unittest i... | gpl-2.0 |
ebukoz/thrive | erpnext/hr/doctype/job_offer/test_job_offer.py | 7 | 2889 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import nowdate, add_days
from erpnext.hr.doctype.job_applicant.test_job_applicant import create_job_applicant
from erpnext.hr.d... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.