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 |
|---|---|---|---|---|---|
abstract-open-solutions/l10n-italy | account_fiscal_year_closing/__init__.py | 16 | 1132 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <jesteve@zikzakmedia.com>
# $Id$
#
# Th... | agpl-3.0 |
stormsson/procedural_city_generation_wrapper | vendor/josauder/procedural_city_generation/roadmap/growth_rules/minor_road.py | 2 | 1679 | from __future__ import division
import numpy as np
import random
from procedural_city_generation.roadmap.Vertex import Vertex
from procedural_city_generation.additional_stuff.rotate import rotate
from procedural_city_generation.additional_stuff.Singleton import Singleton
singleton=Singleton("roadmap")
def minor_road... | mpl-2.0 |
rajadhva/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_handshake.py | 452 | 7134 | #!/usr/bin/env python
#
# Copyright 2012, 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... | mpl-2.0 |
paulproteus/django | django/contrib/localflavor/za/forms.py | 109 | 1977 | """
South Africa-specific Form helpers
"""
from __future__ import unicode_literals
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import CharField, RegexField
from django.utils.checksums import luhn
from django.utils.translation import gettext as _
imp... | bsd-3-clause |
coreentin/android_kernel_nvidia_s8515 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
phiLangley/openPHD | [CODE]/processing/modes/PythonMode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/l_system.py | 1 | 1430 | class LSystem(object):
def __init__(self):
self.steps = 0
self.axiom = "F"
self.rule = "F+F-F"
self.startLength = 90.0
self.theta = radians(120.0)
self.reset()
def reset(self):
self.production = self.axiom
self.drawLength = self.startLength
... | gpl-2.0 |
wso2/product-private-paas | components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/thrift/transport/TTwisted.py | 19 | 6528 | #
# 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 |
Alecto3-D/testable-greeter | bb-master/sandbox/lib/python3.5/site-packages/buildbot/data/masters.py | 11 | 7229 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | mit |
hackebrot/click | examples/termui/termui.py | 32 | 4332 | # coding: utf-8
import click
import math
import time
import random
try:
range_type = xrange
except NameError:
range_type = range
@click.group()
def cli():
"""This script showcases different terminal UI helpers in Click."""
pass
@cli.command()
def colordemo():
"""Demonstrates ANSI color support.... | bsd-3-clause |
coders-circle/Notifica | web/routine/views.py | 1 | 4456 | from django.shortcuts import render, redirect
from django.views.generic import View, TemplateView
from django.db.models import Q
import json
from classroom.models import *
from classroom.utils import *
from routine.models import *
from routine.utils import *
days = ["Sunday", "Monday", "Tuesday",
"Wednesday... | gpl-2.0 |
jenalgit/django | tests/migrations/test_base.py | 292 | 4620 | import os
import shutil
import tempfile
from contextlib import contextmanager
from importlib import import_module
from django.apps import apps
from django.db import connection
from django.db.migrations.recorder import MigrationRecorder
from django.test import TransactionTestCase
from django.test.utils import extend_sy... | bsd-3-clause |
SimplyAutomationized/python-snap7 | snap7/snap7types.py | 1 | 5544 | """
Python equivalent for snap7 specific types.
"""
import ctypes
from snap7.common import ADict
S7Object = ctypes.c_void_p
buffer_size = 65536
buffer_type = ctypes.c_ubyte * buffer_size
time_t = ctypes.c_uint64 # TODO: check if this is valid for all platforms
word = ctypes.c_uint16
longword = ctypes.c_uint32
# // P... | mit |
hasteur/hasteurbot_task_3 | families/wikivoyage_family.py | 3 | 3953 | # -*- coding: utf-8 -*-
__version__ = '$Id$'
# The new wikivoyage family that is hosted at wikimedia
import family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikivoyage'
self.languages_by_size = [
'en', 'de', 'pt', 'n... | gpl-2.0 |
sidrakesh93/grpc | src/python/interop/interop/methods.py | 8 | 14237 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
dbaxa/django | django/utils/inspect.py | 323 | 4195 | from __future__ import absolute_import
import inspect
from django.utils import six
def getargspec(func):
if six.PY2:
return inspect.getargspec(func)
sig = inspect.signature(func)
args = [
p.name for p in sig.parameters.values()
if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWOR... | bsd-3-clause |
leeseulstack/openstack | neutron/tests/unit/agent/l2population_rpc_base.py | 8 | 6003 | # Copyright (C) 2014 VA Linux Systems Japan K.K.
# Copyright (C) 2014 Fumihiko Kakuma <kakuma 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... | apache-2.0 |
DavidAndreev/indico | migrations/versions/201511121701_134a1c372738_add_currency_to_registration.py | 2 | 1725 | """Add currency to registration
Revision ID: 134a1c372738
Revises: 98f411f40bb
Create Date: 2015-11-12 17:01:41.117908
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '134a1c372738'
down_revision = '98f411f40bb'
def upgrade():
op.add_column('forms', sa.Co... | gpl-3.0 |
stephanie-wang/ray | python/ray/gcs_utils.py | 1 | 2203 | from ray.core.generated.gcs_pb2 import (
ActorCheckpointIdData,
ActorTableData,
GcsNodeInfo,
JobTableData,
ErrorTableData,
ErrorType,
GcsEntry,
HeartbeatBatchTableData,
HeartbeatTableData,
ObjectTableData,
ProfileTableData,
TablePrefix,
TablePubsub,
TaskTableData,... | apache-2.0 |
alrusdi/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/geos/tests/test_io.py | 321 | 4159 | import binascii, ctypes, unittest
from django.contrib.gis.geos import GEOSGeometry, WKTReader, WKTWriter, WKBReader, WKBWriter, geos_version_info
class GEOSIOTest(unittest.TestCase):
def test01_wktreader(self):
# Creating a WKTReader instance
wkt_r = WKTReader()
wkt = 'POINT (5 23)'
... | gpl-3.0 |
beni55/dipy | dipy/reconst/tests/test_shore_metrics.py | 6 | 3418 | import numpy as np
from dipy.data import get_gtab_taiwan_dsi
from numpy.testing import (assert_almost_equal,
assert_equal,
run_module_suite)
from dipy.reconst.shore import ShoreModel, shore_matrix, shore_indices, shore_order
from dipy.sims.voxel import (
MultiTe... | bsd-3-clause |
punchagan/zulip | zerver/migrations/0044_reaction.py | 6 | 1273 | import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("zerver", "0043_realm_filter_validators"),
]
operations = [
migrations.CreateModel(
name="Reaction",
... | apache-2.0 |
jmansar/empathy | release.py | 2 | 8128 | #!/usr/bin/env python
import os
import re
import urllib
import csv
import datetime
import time
from string import Template
from optparse import OptionParser
last_tag_patern = 'EMPATHY_2_29*'
upload_server = 'master.gnome.org'
template = '''\
$name $version is now available for download from:
$download
$md5sums
What... | gpl-2.0 |
splunk/splunk-webframework | contrib/django/django/contrib/admin/helpers.py | 100 | 13631 | from __future__ import unicode_literals
from django import forms
from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.contenttypes.models import ContentT... | apache-2.0 |
moylop260/odoo-dev | addons/account/wizard/account_move_bank_reconcile.py | 385 | 2684 | # -*- 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 |
fentas/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py | 115 | 12236 | # 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 f... | bsd-3-clause |
ukanga/SickRage | lib/libgrowl/gntp.py | 150 | 12750 | import re
import hashlib
import time
import platform
__version__ = '0.1'
class BaseError(Exception):
pass
class ParseError(BaseError):
def gntp_error(self):
error = GNTPError(errorcode=500,errordesc='Error parsing the message')
return error.encode()
class AuthError(BaseError):
def gntp_error(self):
error =... | gpl-3.0 |
tdjordan/tortoisegit | tortoisegit/test/testiconoverlay.py | 1 | 3213 | #
# development and stub-testing module for overlay icon handlers
#
import os, sys, time, atexit
from mercurial import ui
from mercurial.i18n import _
# FIXMEL: quick & dirty hack to add tortoise to module search path
import __init__
moddir = os.path.dirname(__init__.__file__)
sys.path.insert(0, os.path.join(moddir, ... | gpl-2.0 |
migue/voltdb | tests/sqlcoverage/schema/matview-advanced-nonjoin-schema.py | 2 | 2228 | #!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2017 VoltDB Inc.
#
# 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 limitati... | agpl-3.0 |
terbolous/SickRage | lib/sqlalchemy/engine/threadlocal.py | 79 | 4097 | # engine/threadlocal.py
# Copyright (C) 2005-2014 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
"""Provides a thread-local transactional wrapper around the root Engine class.
... | gpl-3.0 |
mkmelin/bedrock | tests/redirects/map_htaccess.py | 6 | 8752 | from __future__ import absolute_import
from .base import flatten, url_test
URLS = flatten((
# Bug 774331 - European press pages
# en-GB
url_test('/en-GB/press/', 'https://blog.mozilla.org/press-uk/'),
url_test('/en-GB/press/media/', 'https://blog.mozilla.org/press-uk/media-library/'),
url_test('/... | mpl-2.0 |
hochem/osmdeviationfinder | web/basic.py | 1 | 4276 | # -*- coding: utf-8 -*-
"""
OSM Deviation Finder - Web Interface
~~~~~~~~~~~~~~~~~~~~
Implementation of a web interface for the OSM Deviation Finder library.
It uses the flask microframework by Armin Ronacher
For more information see https://github.com/mitsuhiko/flask/
To interact with the Ge... | mit |
nirmeshk/oh-mainline | vendor/packages/requests/requests/packages/chardet/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versio... | agpl-3.0 |
edx/configuration | util/jenkins/missing_alerts_checker/missing_alerts_checker.py | 4 | 10313 | from __future__ import absolute_import
from __future__ import print_function
import boto3
import requests
import click
from botocore.exceptions import ClientError
import sys
import re
class NewRelic:
def __init__(self, new_relic_api_key):
self.url_alert_extractor = "https://api.newrelic.com/v2/alerts_poli... | agpl-3.0 |
jonnor/FreeCAD | src/Mod/Draft/WorkingPlane.py | 16 | 18204 | #***************************************************************************
#* *
#* Copyright (c) 2009, 2010 *
#* Ken Cline <cline@frii.com> *
#* ... | lgpl-2.1 |
AuyaJackie/odoo | addons/calendar/calendar.py | 81 | 86439 | # -*- coding: utf-8 -*-
import pytz
import re
import time
import openerp
import openerp.service.report
import uuid
import collections
import babel.dates
from werkzeug.exceptions import BadRequest
from datetime import datetime, timedelta
from dateutil import parser
from dateutil import rrule
from dateutil.relativedelta... | agpl-3.0 |
bastik/youtube-dl | youtube_dl/extractor/francetv.py | 44 | 12637 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
clean_html,
ExtractorError,
int_or_none,
parse_duration,
determine_ext,
)
from .dailymotion import DailymotionCloudIE
clas... | unlicense |
TeamHG-Memex/agnostic | tests/test_sqlite.py | 1 | 2220 | import os
import shutil
import sqlite3
import tempfile
import unittest
from tests.abstract import AbstractDatabaseTest
class TestSqlLite(AbstractDatabaseTest, unittest.TestCase):
''' Integration tests for SQLite '''
def __init__(self, *args, **kwargs):
''' Override super class: set param style. '''
... | mit |
rosarior/rua | rua/apps/acls/models.py | 6 | 3257 | from __future__ import absolute_import
import logging
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from permissions.models i... | gpl-3.0 |
fillycheezstake/MissionPlanner | Lib/io.py | 53 | 3722 | """The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams;... | gpl-3.0 |
damanjitsingh/StackExchange-python- | demo/versus.py | 3 | 1296 | #!/usr/bin/env python
from __future__ import print_function
import sys
sys.path.append('.')
sys.path.append('..')
import stackexchange, stackauth
if len(sys.argv) < 3:
print('Usage: versus.py YOUR_SO_UID THEIR_SO_UID')
sys.exit(1)
so = stackexchange.Site(stackexchange.StackOverflow, impose_throttling=True)
... | bsd-3-clause |
beiko-lab/gengis | bin/Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/extern/pygments/plugin.py | 27 | 1841 | # -*- coding: utf-8 -*-
"""
pygments.plugin
~~~~~~~~~~~~~~~
Pygments setuptools plugin interface. The methods defined
here also work if setuptools isn't installed but they just
return nothing.
lexer plugins::
[pygments.lexers]
yourlexer = yourmodule:YourLexer
formatter pl... | gpl-3.0 |
htwenhe/DJOA | env/Lib/site-packages/markdown/extensions/abbr.py | 123 | 2738 | '''
Abbreviation Extension for Python-Markdown
==========================================
This extension adds abbreviation handling to Python-Markdown.
See <https://pythonhosted.org/Markdown/extensions/abbreviations.html>
for documentation.
Oringinal code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/) ... | mit |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/distutils/tests/test_spawn.py | 138 | 1924 | """Tests for distutils.spawn."""
import unittest
import os
import time
from test.test_support import captured_stdout, run_unittest
from distutils.spawn import _nt_quote_args
from distutils.spawn import spawn, find_executable
from distutils.errors import DistutilsExecError
from distutils.tests import support
class Spa... | bsd-3-clause |
ritzk/ansible-modules-extras | cloud/rackspace/rax_mon_entity.py | 123 | 6171 | #!/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 |
jotes/ansible | v2/ansible/plugins/action/pause.py | 16 | 5387 | # Copyright 2012, Tim Bielawa <tbielawa@redhat.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) any later... | gpl-3.0 |
heeraj123/oh-mainline | vendor/packages/twisted/twisted/names/dns.py | 18 | 53586 | # -*- test-case-name: twisted.names.test.test_dns -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
@author: Moshe Zadka
@author: Jean-Paul Calderone
"""
__all__ = [
'IEncodable', 'IRecord',
'A'... | agpl-3.0 |
shriyanka/daemo-forum | spirit/core/utils/timezone.py | 9 | 2362 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
TIMEZONE_CHOICES = [
('Etc/GMT+12', _("(GMT -12:00) Eniwetok, Kwajalein")),
('Etc/GMT+11', _("(GMT -11:00) Midway Island, Samoa")),
('Etc/GMT+10', _("(GMT -10:00) Hawaii")),
('Pacific/M... | mit |
wuhengzhi/chromium-crosswalk | tools/cr/cr/base/arch.py | 113 | 1544 | # Copyright 2013 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.
"""A module for the basic architectures supported by cr."""
import cr
DEFAULT = cr.Config.From(
CR_ENVSETUP_ARCH='{CR_ARCH}',
)
class Arch(cr.Plugin,... | bsd-3-clause |
tchernomax/ansible | lib/ansible/modules/network/eos/eos_lldp.py | 58 | 2962 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
deadblue/baidupan_shell | baidupan/vcode.py | 1 | 2375 | # -*- coding: utf-8 -*-
from StringIO import StringIO
try:
import Image
except:
from PIL import Image
__author__ = 'deadblue'
def convert_ascii(img_data):
return _matrix_to_ascii(
_crop_and_border(
_image_to_matrix(img_data)
)
)
def _image_to_matrix(img_data):
img = ... | gpl-2.0 |
eltonsantos/django | tests/generic_views/test_edit.py | 2 | 16597 | from __future__ import absolute_import
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django import forms
from django.test import TestCase
from django.utils.unittest import expectedFailure
from django.views.generic.base import View
from django... | bsd-3-clause |
ace8957/SeniorDesignKernel | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
saturday-shi/spark | python/pyspark/find_spark_home.py | 66 | 2761 | #!/usr/bin/env python
#
# 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 "Li... | apache-2.0 |
product-definition-center/pdc-client | .tito/lib/copr_user/releasers.py | 8 | 2716 | import os.path
from tito.release import CoprReleaser
from tito.common import run_command, find_git_root, tito_config_dir, info_out
from tito.compat import RawConfigParser
class CoprUserReleaser(CoprReleaser):
def _load_user_config(self):
"""
Try to load copr user configs if any
# 1. copr... | mit |
Adel-Magebinary/odoo | addons/sale/edi/sale_order.py | 403 | 10861 | # -*- 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 |
sencha/chromium-spacewalk | chrome/common/extensions/docs/examples/apps/hello-python/httplib2/iri2uri.py | 885 | 3850 | """
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | bsd-3-clause |
firebase/grpc-SwiftPM | bazel/test/python_test_repo/helloworld_moved.py | 13 | 2584 | # Copyright 2019 the gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | apache-2.0 |
0xffea/keystone | keystone/service.py | 1 | 2930 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | apache-2.0 |
vynncentgm/limbo-android | jni/qemu/roms/seabios/tools/readserial.py | 118 | 6006 | #!/usr/bin/env python
# Script that can read from a serial device and show timestamps.
#
# Copyright (C) 2009 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
# Usage:
# tools/readserial.py /dev/ttyUSB0 115200
import sys
import time
import select
import... | gpl-2.0 |
nathanaevitas/odoo | openerp/addons/auth_signup/res_users.py | 8 | 15061 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
mozilla/normandy | normandy/recipes/migrations/0007_convert_simple_filters_to_filter_objects.py | 1 | 2458 | import json
from django.db import migrations
def simple_filters_to_filter_objects(apps, schema_editor):
RecipeRevision = apps.get_model("recipes", "RecipeRevision")
for revision in RecipeRevision.objects.all():
filter_object = []
if revision.locales.count():
filter_object.append(... | mpl-2.0 |
AndreasMadsen/gensim | gensim/test/test_lee.py | 15 | 5404 | #!/usr/bin/env python
# encoding: utf-8
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated test to reproduce the results of Lee et al. (2005)
Lee et al. (2005) compares different models for semantic
similarity and verifies the results with similarity judgements from humans.
As... | gpl-3.0 |
oliverlee/sympy | sympy/interactive/session.py | 43 | 15119 | """Tools for setting up interactive sessions. """
from __future__ import print_function, division
from distutils.version import LooseVersion as V
from sympy.core.compatibility import range
from sympy.external import import_module
from sympy.interactive.printing import init_printing
preexec_source = """\
from __futu... | bsd-3-clause |
sandeepgupta2k4/tensorflow | tensorflow/contrib/labeled_tensor/python/ops/test_util.py | 139 | 1741 | # 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 |
garrettcap/Bulletproof-Backup | Python2.7/lib/python2.7/site-packages/setuptools/command/upload_docs.py | 77 | 6975 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
import os
import socket
import zipfile
import tempfile
import sys
import shutil
from base64 import standard_b64encode
from pkg_resources import iter_entry_points
from distuti... | gpl-2.0 |
jabibi/sale-workflow | sale_payment_term_interest/__openerp__.py | 15 | 1227 | # -*- coding: utf-8 -*-
#
#
# Authors: Guewen Baconnier
# Copyright 2015 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
# Licens... | agpl-3.0 |
Qalthos/ansible | lib/ansible/modules/windows/win_domain_membership.py | 51 | 3428 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATI... | gpl-3.0 |
koditr/xbmc-tr-team-turkish-addons | script.module.html5lib/lib/html5lib/inputstream.py | 618 | 30855 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from six.moves import http_client
import codecs
import re
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import encodings, ReparseException
from . import utils
from io import String... | gpl-2.0 |
patsissons/Flexget | tests/test_whatcd.py | 13 | 1146 | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase, use_vcr
class TestInputWhatCD(FlexGetBase):
__yaml__ = """
tasks:
no_fields:
whatcd:
no_user:
whatcd:
password: test
no_pass:
... | mit |
madhurrajn/samashthi | lib/gevent/builtins.py | 9 | 4440 | # Copyright (c) 2015 gevent contributors. See LICENSE for details.
"""gevent friendly implementations of builtin functions."""
from __future__ import absolute_import
import imp # deprecated since 3.4; issues PendingDeprecationWarning in 3.5
import sys
import weakref
from gevent.lock import RLock
# Normally we'd have ... | bsd-3-clause |
madhusudancs/test-infra | gubernator/github/classifier_test.py | 2 | 10021 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... | apache-2.0 |
dxwu/BinderFilter | resources/android-toolchain-16/lib/python2.7/lib2to3/fixes/fix_itertools.py | 148 | 1549 | """ Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and
itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363)
imports from itertools are fixed in fix_itertools_import.py
If itertools is imported as something else (ie: import itertools as it;
it.izip(spam, eggs)) method calls w... | mit |
WillieMaddox/numpy | numpy/f2py/crackfortran.py | 44 | 126845 | #!/usr/bin/env python
"""
crackfortran --- read fortran (77,90) code and extract declaration information.
Copyright 1999-2004 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSE... | bsd-3-clause |
Jelloeater/forgeLandWallGUI | wallGui/requests/packages/urllib3/request.py | 567 | 5808 | # urllib3/request.py
# Copyright 2008-2013 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... | mit |
riklaunim/django-custom-multisite | tests/modeltests/tablespaces/models.py | 150 | 1819 | from django.db import models
# Since the test database doesn't have tablespaces, it's impossible for Django
# to create the tables for models where db_tablespace is set. To avoid this
# problem, we mark the models as unmanaged, and temporarily revert them to
# managed during each test. We also set them to use the same... | bsd-3-clause |
akpotter/OWASP-ZSC | lib/encoder/linux_x86/xor_random.py | 2 | 16830 | #!/usr/bin/env python
'''
ZCR Shellcoder
ZeroDay Cyber Research
Z3r0D4y.Com
Ali Razmjoo
'''
import random,binascii,string
chars = string.digits + string.ascii_letters
def start(shellcode,job):
if 'chmod(' in job:
t = True
eax = str('0x0f')
while t:
eax_1 = binascii.b2a_hex(''.join(random.choice(chars) for i... | gpl-3.0 |
mpare002/HackTech_2017 | env/Lib/site-packages/pip/_vendor/distlib/database.py | 203 | 49199 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... | mit |
catapult-project/catapult-csm | third_party/google-endpoints/rsa/varblock.py | 82 | 5406 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Un... | bsd-3-clause |
kantlove/flask-simple-page | Lib/site-packages/pip/_vendor/requests/cookies.py | 413 | 17191 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
# grr, pyflakes... | mit |
jonashaag/ansible | lib/ansible/plugins/lookup/indexed_items.py | 103 | 1323 | # (c) 2012, 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) any lat... | gpl-3.0 |
ojengwa/odoo | addons/email_template/__init__.py | 381 | 1144 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
joergkappes/opengm | src/interfaces/python/examples/ad3_posteriors.py | 13 | 2384 | import opengm
import numpy
# do not get used to this example, api might change
length = 6 # slow if large and model == '3OrderRandomChain'
numLabels = 2 # slow if more than 2 or 3 for large length
ilp = False # slow if true '3OrderRandomChain' if large
model = '2OrderSubmodublarGrid'
model = '3OrderRandomC... | mit |
rcharp/toyota-flask | venv/lib/python2.7/site-packages/numpy/core/tests/test_shape_base.py | 47 | 8240 | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (TestCase, assert_, assert_raises, assert_array_equal,
assert_equal, run_module_suite)
from numpy.core import (array, arange, atleast_1d, atleast_2d, atleast_3d,
... | apache-2.0 |
jesramirez/odoo | addons/website_membership/models/product.py | 338 | 1264 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
dendisuhubdy/tensorflow | tensorflow/python/ops/linalg_ops.py | 10 | 23635 | # 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 |
fxfitz/ansible | test/units/modules/network/cnos/test_cnos_config.py | 9 | 5237 | #
# (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 d... | gpl-3.0 |
Yelp/pootle | tests/models/translationproject.py | 1 | 2685 | import os
import shutil
import pytest
from django.db import IntegrityError
from pootle_language.models import Language
from pootle_project.models import Project
from pootle_translationproject.models import TranslationProject
@pytest.mark.django_db
def test_tp_create_fail(tutorial, english):
# Trying to create... | gpl-3.0 |
shoopio/shoop | shuup/front/views/checkout.py | 2 | 3591 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.core.urlresolvers import reverse
from django.shortcuts... | agpl-3.0 |
ConnorGBrewster/servo | tests/wpt/web-platform-tests/css/tools/apiclient/apiclient/apiclient.py | 79 | 10723 | # coding=utf-8
#
# Copyright © 2013 Hewlett-Packard Development Company, L.P.
#
# This work is distributed under the W3C® Software License [1]
# in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# ... | mpl-2.0 |
Dr-Bean/spkrepo | spkrepo/tests/test_admin.py | 1 | 12182 | # -*- coding: utf-8 -*-
import os
from unittest import TestSuite, TestLoader
from flask import url_for, current_app
from spkrepo.ext import db
from spkrepo.models import Version, Package
from spkrepo.tests.common import BaseTestCase, BuildFactory, PackageFactory, create_image, VersionFactory
class IndexTestCase(Bas... | mit |
tumb1er/django-celery-rpc | celery_rpc/tests/test_tasks.py | 2 | 15994 | from __future__ import absolute_import
from random import randint
from uuid import uuid4
from django.core.exceptions import ObjectDoesNotExist
from celery_rpc.tests import factories
from celery_rpc.tests.utils import (get_model_dict, SimpleModelTestMixin,
get_model_dict_from_list, ... | unlicense |
chemelnucfin/tensorflow | tensorflow/lite/schema/upgrade_schema_test.py | 26 | 8644 | # Copyright 2017 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 |
RO-ny9/python-for-android | python3-alpha/extra_modules/gdata/apps/multidomain/client.py | 48 | 13872 | #!/usr/bin/python2.4
#
# Copyright 2011 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 ... | apache-2.0 |
saurabh6790/med_app_rels | setup/utils.py | 21 | 1350 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _, msgprint
import json
def get_company_currency(company):
currency = webnotes.conn.get_value("Company", compa... | agpl-3.0 |
ayushagrawal288/zamboni | mkt/search/tests/test_middleware.py | 19 | 1188 | from django.test.client import RequestFactory
import elasticsearch
import mock
from nose.tools import eq_
import mkt.site.tests
from mkt.search.middleware import ElasticsearchExceptionMiddleware as ESM
class TestElasticsearchExceptionMiddleware(mkt.site.tests.TestCase):
def setUp(self):
self.request = ... | bsd-3-clause |
axbaretto/beam | sdks/python/.tox/py27gcp/lib/python2.7/site-packages/google/protobuf/internal/more_extensions_dynamic_pb2.py | 37 | 3979 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/internal/more_extensions_dynamic.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from go... | apache-2.0 |
sestrella/ansible | test/units/modules/network/f5/test_bigip_firewall_log_profile_network.py | 22 | 5706 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
Francis-Liu/animated-broccoli | nova/servicegroup/drivers/mc.py | 19 | 3627 | # Service heartbeat driver using Memcached
# Copyright (c) 2013 Akira Yoshiyama <akirayoshiyama at gmail dot com>
#
# This is derived from nova/servicegroup/drivers/db.py.
# Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | apache-2.0 |
JaSpa/swift | utils/swift_build_support/swift_build_support/cache_util.py | 48 | 1586 | # swift_build_support/cache_util.py -----------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | apache-2.0 |
DanePubliczneGovPl/ckanext-archiver | ckanext/archiver/interfaces.py | 3 | 1204 | import logging
import ckan.plugins as plugins
from ckan.plugins.interfaces import Interface
log = logging.getLogger(__name__)
class IPipe(Interface):
"""
Process data in a Data Pipeline.
Inherit this to subscribe to events in the Data Pipeline and be able to
broadcast the results for others to proc... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.