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 |
|---|---|---|---|---|---|
xakepru/x14.11-coding-hyperv | src/hyperv4/distorm/examples/tests/test_distorm3.py | 4 | 68909 | #
# Gil Dabah 2006, http://ragestorm.net/distorm
# Tests for diStorm3
#
import os
import distorm3
from distorm3 import *
import struct
import unittest
import random
REG_NONE = 255
_REGISTERS = ["RAX", "RCX", "RDX", "RBX", "RSP", "RBP", "RSI", "RDI", "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15",
"EAX", "ECX",... | mit |
minhphung171093/GreenERP_V9 | openerp/addons/sale_service/__openerp__.py | 23 | 1356 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Create Tasks from SO',
'version': '1.0',
'category': 'Project Management',
'description': """
Automatically creates project tasks from procurement lines.
======================================... | gpl-3.0 |
fidomason/kbengine | kbe/src/lib/python/Lib/encodings/cp037.py | 266 | 13121 | """ Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | lgpl-3.0 |
luistorresm/odoo | addons/email_template/email_template.py | 196 | 30189 | # -*- 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 |
kaushik94/boto | boto/mws/__init__.py | 429 | 1101 | # Copyright (c) 2008, Chris Moyer http://coredumped.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 rights to use, copy, modify, ... | mit |
GoogleCloudPlatform/Data-Pipeline | app/src/pipelines/shardstage_test.py | 1 | 3800 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
sbellem/django | django/utils/regex_helper.py | 432 | 12673 | """
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
from __future__ import unicode_literals
... | bsd-3-clause |
jitendra29/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | mpl-2.0 |
dimm0/tacc_stats | tacc_stats/pickler/tests/pickler_test.py | 1 | 4459 | from __future__ import print_function
import os, sys
from nose import with_setup
import cPickle as pickle
from tacc_stats.pickler import job_pickles
from tacc_stats.pickler import job_stats, batch_acct
sys.modules['pickler.job_stats'] = job_stats
sys.modules['pickler.batch_acct'] = batch_acct
path = os.path.dirname(o... | lgpl-2.1 |
Slezhuk/ansible | lib/ansible/modules/network/nmcli.py | 21 | 41915 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Chris Long <alcamie@gmail.com> <chlong@redhat.com>
#
# This file is a module for Ansible that interacts with Network Manager
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#... | gpl-3.0 |
noisemaster/AdamTestBot | future/builtins/newround.py | 2 | 3204 | """
``python-future``: pure Python implementation of Python 3 round().
"""
from future.utils import PYPY, PY26, bind_method
# Use the decimal module for simplicity of implementation (and
# hopefully correctness).
from decimal import Decimal, ROUND_HALF_EVEN
def newround(number, ndigits=None):
"""
... | mit |
glwu/python-for-android | python-build/python-libs/xmpppy/xmpp/roster.py | 203 | 9163 | ## roster.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
... | apache-2.0 |
Astrophilic/Algorithms_Example | Bitap Algorithm/Python/BiTap.py | 9 | 6159 | # -*- coding: utf-8 -*-
import sys
"""Auxiliary procedure for printing each item of row in columns in binary form
"""
def _printTable(t, size):
out = ""
for i in range(len(t)):
binaryForm = bin(t[i])
binaryForm = binaryForm[2 : ]
binaryForm = binaryForm.zfill(size)
out += binary... | apache-2.0 |
cyberark-bizdev/ansible | lib/ansible/modules/clustering/k8s/k8s_raw.py | 2 | 4093 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Chris Houseknecht <@chouseknecht>
# 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 |
LookThisCode/DeveloperBus | Season 2013/Brazil/Projects/QueroMe-master/openid/test/discoverdata.py | 87 | 4109 | """Module to make discovery data test cases available"""
import urlparse
import os.path
from openid.yadis.discover import DiscoveryResult, DiscoveryFailure
from openid.yadis.constants import YADIS_HEADER_NAME
tests_dir = os.path.dirname(__file__)
data_path = os.path.join(tests_dir, 'data')
testlist = [
# success, i... | apache-2.0 |
urisimchoni/samba | python/samba/tests/dcerpc/string.py | 9 | 4393 | # Unix SMB/CIFS implementation.
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2016
#
# 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)... | gpl-3.0 |
brandsoulmates/incubator-airflow | airflow/utils/operator_helpers.py | 30 | 1546 | # -*- coding: utf-8 -*-
#
# 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 |
demarle/VTK | Examples/Modelling/Python/SpherePuzzle.py | 14 | 3824 | #!/usr/bin/env python
# A game with VTK and Tkinter. :)
import Tkinter
import vtk
from vtk.tk.vtkTkRenderWindowInteractor import vtkTkRenderWindowInteractor
# Create the pipeline
puzzle = vtk.vtkSpherePuzzle()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(puzzle.GetOutputPort())
actor = vtk.vtkActor()
a... | bsd-3-clause |
koomik/CouchPotatoServer | libs/caper/__init__.py | 81 | 5426 | # Copyright 2013 Dean Gardiner <gardiner91@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | gpl-3.0 |
TEAM-Gummy/platform_external_chromium_org | tools/telemetry/telemetry/core/backends/chrome/inspector_runtime_unittest.py | 25 | 1042 | # 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.
from telemetry.core import exceptions
from telemetry.unittest import tab_test_case
class InspectorRuntimeTest(tab_test_case.TabTestCase):
def testRuntimeEv... | bsd-3-clause |
MiltosD/CEFELRC | lib/python2.7/site-packages/django/middleware/http.py | 154 | 1696 | from django.core.exceptions import MiddlewareNotUsed
from django.utils.http import http_date, parse_http_date_safe
class ConditionalGetMiddleware(object):
"""
Handles conditional GET operations. If the response has a ETag or
Last-Modified header, and the request has If-None-Match or
If-Modified-Since, ... | bsd-3-clause |
littley/pyvolution | internal/BreedingPool.py | 1 | 3508 | import random
import math
class BreedingPool(object):
"""
This class is a container for Chromosomes. Allows efficient selection of chromosomes to be "bred".
This class implements a binary tree
"""
class node():
"""
Each node represents the "value" of a single chromosome. Used to... | apache-2.0 |
GodBlessPP/w16b_test | static/Brython3.1.3-20150514-095342/Lib/numbers.py | 883 | 10398 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
TODO: Fill out more detailed documentation on the operators."""
from abc import ABCMeta, abstractmethod
__all__ = ["Number", "Complex", "Real", "Rat... | agpl-3.0 |
kw217/omim | 3party/protobuf/python/google/protobuf/internal/message_python_test.py | 74 | 2359 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... | apache-2.0 |
nekulin/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/cygwinccompiler.py | 50 | 17299 | """distutils.cygwinccompiler
Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows. It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
"""
# problems:
#
# * if you use a msvc com... | apache-2.0 |
pixelated-project/pixelated-user-agent | service/test/functional/features/page_objects/backup_account_page.py | 2 | 1111 | #
# Copyright (c) 2017 ThoughtWorks, Inc.
#
# Pixelated 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, or
# (at your option) any later version.
#
# Pixelated is distrib... | agpl-3.0 |
gnowledge/ncert_nroer | objectapp/cnlgb.py | 3 | 21411 | from objectapp.models import *
from gstudio.models import *
from django.template.defaultfilters import slugify
import inflect
def get_cnlgb_list(self):
z = []
k = get_lex_sentence(self)
if not k:
pass
else:
z.extend(k)
l = get_lex_sentence_optional(self)
if not l:
pass
else:
z.extend(l)
m = get... | agpl-3.0 |
dbbhattacharya/kitsune | vendor/packages/logilab-common/optparser.py | 6 | 3225 | # -*- coding: utf-8 -*-
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser Genera... | bsd-3-clause |
agilemobiledev/spiderfoot | ext/dns/rdtypes/ANY/NSEC3PARAM.py | 85 | 3169 | # Copyright (C) 2004-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-2.0 |
ilastikdev/ilastik | ilastik/applets/objectClassification/opObjectClassification.py | 1 | 59400 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | gpl-3.0 |
direvus/ansible | lib/ansible/modules/cloud/amazon/ecs_cluster.py | 25 | 7340 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
dbjohnson/spanner | test/test_countdown.py | 1 | 1191 | import unittest
import sys
from cStringIO import StringIO
from spanner import countdown
include = True
class CountdownTestCase(unittest.TestCase):
def setUp(self):
# redirect stdout
self.old_stdout = sys.stdout
self.trapped_stdout = sys.stdout = StringIO()
def tearDown(self):
... | mit |
nsmoooose/csp | csp/data/ui/scripts/windows/quitresume.py | 1 | 2828 | #!/usr/bin/python
# Combat Simulator Project
# Copyright (C) 2002-2005 The Combat Simulator Project
# http://csp.sourceforge.net
#
# 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... | gpl-2.0 |
ferchaure/bci | Parsers/beta_fpga.py | 1 | 7945 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 17:28:58 2015
@author: fernando chaure
"""
from configuration import GENERAL_CONFIG as CONFIG
from multiprocess_config import *
import numpy as np
from configuration import CONFIG_PARSER
from os import path
COMM = {}
for x in CONFIG_PARSER['FORMAT_CONFIG']:
if CO... | mit |
pynag/pynag | tests/test_utils.py | 1 | 18547 | from __future__ import absolute_import
import os
import sys
# Make sure we import from working tree
pynagbase = os.path.dirname(os.path.realpath(__file__ + "/.."))
sys.path.insert(0, pynagbase)
import unittest2 as unittest
from mock import patch
import shutil
import tempfile
import pynag.Utils as utils
import pynag.M... | gpl-2.0 |
IveWong/jasmine | setup.py | 56 | 1974 | from setuptools import setup, find_packages, os
import json
with open('package.json') as packageFile:
version = json.load(packageFile)['version']
setup(
name="jasmine-core",
version=version,
url="http://jasmine.github.io",
author="Pivotal Labs",
author_email="jasmine-js@googlegroups.com",
de... | mit |
semonte/intellij-community | plugins/hg4idea/testData/bin/mercurial/repo.py | 88 | 1379 | # repo.py - repository base classes for mercurial
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
im... | apache-2.0 |
angelapper/edx-platform | common/djangoapps/track/tests/test_shim.py | 24 | 10533 | """Ensure emitted events contain the fields legacy processors expect to find."""
from collections import namedtuple
import ddt
from django.test.utils import override_settings
from mock import sentinel
from openedx.core.lib.tests.assertions.events import assert_events_equal
from . import FROZEN_TIME, EventTrackingTe... | agpl-3.0 |
m-urban/beets | test/test_mpdstats.py | 24 | 1572 | # This file is part of beets.
# Copyright 2015
#
# 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 rights to use, copy, modify, merge, pu... | mit |
nysan/yocto-autobuilder | lib/python2.6/site-packages/SQLAlchemy-0.7.1-py2.6-linux-x86_64.egg/sqlalchemy/dialects/postgresql/base.py | 8 | 53160 | # postgresql/base.py
# Copyright (C) 2005-2011 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
"""Support for the PostgreSQL database.
For information on connecting using specif... | gpl-2.0 |
shssoichiro/servo | tests/wpt/css-tests/tools/pytest/_pytest/cacheprovider.py | 188 | 8939 | """
merged implementation of the cache provider
the name cache was not choosen to ensure pluggy automatically
ignores the external pytest-cache
"""
import py
import pytest
import json
from os.path import sep as _sep, altsep as _altsep
class Cache(object):
def __init__(self, config):
self.config = config... | mpl-2.0 |
krafczyk/spack | var/spack/repos/builtin/packages/font-bh-type1/package.py | 5 | 2082 | ##############################################################################
# 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 |
ddayguerrero/blogme | flask/lib/python3.4/site-packages/werkzeug/contrib/atom.py | 259 | 15588 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... | mit |
alexbredo/site-packages | mail.py | 1 | 2015 | # Copyright (c) 2014 Alexander Bredo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions ... | bsd-2-clause |
matmutant/sl4a | python/src/Lib/lib-tk/FixTk.py | 49 | 2844 | import sys, os
# Delay import _tkinter until we have set TCL_LIBRARY,
# so that Tcl_FindExecutable has a chance to locate its
# encoding directory.
# Unfortunately, we cannot know the TCL_LIBRARY directory
# if we don't know the tcl version, which we cannot find out
# without import Tcl. Fortunately, Tcl will itself ... | apache-2.0 |
txm/potato | 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 |
prarthitm/edxplatform | pavelib/servers.py | 15 | 10450 | """
Run and manage servers for local development.
"""
from __future__ import print_function
import argparse
import sys
from paver.easy import call_task, cmdopts, consume_args, needs, sh, task
from .assets import collect_assets
from .utils.cmd import django_cmd
from .utils.process import run_process, run_multi_process... | agpl-3.0 |
louyihua/edx-platform | common/djangoapps/contentserver/admin.py | 27 | 1455 | """
Django admin page for CourseAssetCacheTtlConfig, which allows you to configure the TTL
that gets used when sending cachability headers back with request course assets.
"""
from django.contrib import admin
from config_models.admin import ConfigurationModelAdmin
from .models import CourseAssetCacheTtlConfig, CdnUserA... | agpl-3.0 |
ioef/tlslite-ng | tlslite/utils/asn1parser.py | 206 | 1191 | # Author: Trevor Perrin
# Patch from Google adding getChildBytes()
#
# See the LICENSE file for legal information regarding use of this file.
"""Class for parsing ASN.1"""
from .compat import *
from .codec import *
#Takes a byte array which has a DER TLV field at its head
class ASN1Parser(object):
def __init__(se... | lgpl-2.1 |
gemmaan/moviesenal | Hasil/Lib/site-packages/pip/_vendor/ipaddress.py | 339 | 80176 | # Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
"""A fast, lightweight IPv4/IPv6 manipulation library in Python.
This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.
"""
from __future__ import unicode_literals
import itertools
import struct
__version... | mit |
bubichain/blockchain | src/3rd/src/jsoncpp/scons-2.1.0/engine/SCons/Script/__init__.py | 21 | 14158 | """SCons.Script
This file implements the main() function used by the scons script.
Architecturally, this *is* the scons script, and will likely only be
called from the external "scons" wrapper. Consequently, anything here
should not be, or be considered, part of the build engine. If it's
something that we expect ot... | apache-2.0 |
abligh/xen | tools/python/xen/xend/XendTask.py | 48 | 7801 | #===========================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope tha... | gpl-2.0 |
tcheehow/MissionPlanner | Lib/distutils/command/bdist_dumb.py | 50 | 5259 | """distutils.command.bdist_dumb
Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""
__revision__ = "$Id$"
import os
from sysconfig import get_python_version
from distutils.util import get_platform
... | gpl-3.0 |
pypingou/mock | docs/conf.py | 7 | 6297 | # -*- coding: utf-8 -*-
#
# Mock documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 17 18:12:00 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable... | bsd-2-clause |
wtmmac/airflow | airflow/operators/hive_stats_operator.py | 38 | 6082 | from builtins import str
from builtins import zip
from collections import OrderedDict
import json
import logging
from airflow.utils import AirflowException
from airflow.hooks import PrestoHook, HiveMetastoreHook, MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class HiveSta... | apache-2.0 |
jcodybaker/snip | tests/lib/gtest-1.8.0/test/gtest_help_test.py | 2968 | 5856 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mit |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/flower/events.py | 16 | 4189 | from __future__ import absolute_import
from __future__ import with_statement
import time
import shelve
import logging
import threading
import collections
from functools import partial
import celery
from tornado.ioloop import PeriodicCallback
from tornado.ioloop import IOLoop
from celery.events import EventReceiver... | gpl-3.0 |
bbenko/shinkicker | django/core/management/commands/diffsettings.py | 411 | 1296 | from django.core.management.base import NoArgsCommand
def module_to_dict(module, omittable=lambda k: k.startswith('_')):
"Converts a module namespace to a Python dictionary. Used by get_settings_diff."
return dict([(k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)])
class Command(NoArgsComm... | bsd-3-clause |
RackSec/ansible | lib/ansible/modules/network/lenovo/cnos_vlag.py | 59 | 13338 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, 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 |
jbbskinny/sympy | sympy/series/kauers.py | 94 | 1807 | from __future__ import print_function, division
def finite_diff(expression, variable, increment=1):
"""
Takes as input a polynomial expression and the variable used to construct
it and returns the difference between function's value when the input is
incremented to 1 and the original function value. I... | bsd-3-clause |
smscannell/crazyflie-clients-python | lib/cfclient/utils/input/inputinterfaces/__init__.py | 5 | 3515 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
RubikonAlpha/RIOT | dist/tools/pyterm/pytermcontroller/pytermcontroller.py | 100 | 4769 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Philipp Rosenkranz <philipp.rosenkranz@fu-berlin.de>
#
# 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
# versi... | lgpl-2.1 |
dmillington/ansible-modules-core | files/template.py | 11 | 3875 | # this is a virtual module that is entirely implemented server side
# 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 op... | gpl-3.0 |
spasovski/zamboni | apps/versions/views.py | 3 | 4674 | import posixpath
from django import http
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404, redirect
import caching.base as caching
import commonware.log
import jingo
from mobility.decorators import mobile_template
import amo
from amo.urlresolvers import reverse
from ... | bsd-3-clause |
AbsentMoniker/ECE463Honors | web2py/gluon/contrib/feedparser.py | 22 | 165632 | """Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit https://code.google.com/p/feedparser/ for the latest version
Visit http://packages.python.org/feedparser/ for the latest documentation
Required: Python 2.4 or later
Recommended: iconv_codec <http://cjkpython.i18n.org... | gpl-2.0 |
eadgarchen/tensorflow | tensorflow/python/kernel_tests/numerics_test.py | 45 | 5057 | # 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 |
alexmilesyounger/ds_basics | src/numpy_utils.py | 2 | 3188 | # coding: utf-8
# numpy_utils for Intro to Data Science with Python
# Author: Kat Chuang
# Created: Nov 2014
# --------------------------------------
import numpy
## Stage 2 begin
fieldNames = ['', 'id', 'priceLabel', 'name','brandId', 'brandName', 'imageLink',
'desc', 'vendor', 'patterned', 'materi... | mit |
sameetb-cuelogic/edx-platform-test | common/djangoapps/student/management/commands/add_to_group.py | 182 | 1968 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User, Group
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--list',
action='store_true',
de... | agpl-3.0 |
flavour/tldrmp | modules/tests/inv/create_item.py | 25 | 2382 | # -*- coding: utf-8 -*-
""" Sahana Eden Automated Tests - INV005 Create Item
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to dea... | mit |
XiaodunServerGroup/ddyedx | cms/envs/common.py | 1 | 18114 | # -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change th... | agpl-3.0 |
wanderine/nipype | nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py | 9 | 1130 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.afni.preprocess import AFNItoNIFTI
def test_AFNItoNIFTI_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(n... | bsd-3-clause |
HonzaKral/django | tests/generic_inline_admin/tests.py | 15 | 22206 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User
from django.contrib.contenttypes.admin import GenericTabularInline
from django.contrib.contenttypes.forms import... | bsd-3-clause |
insta-code1/Instafit-ecommerce-Django | Scripts/enhancer.py | 1 | 1522 | #!d:\e-commers\scripts\python.exe
#
# The Python Imaging Library
# $Id$
#
# this demo script creates four windows containing an image and a slider.
# drag the slider to modify the image.
#
try:
from tkinter import Tk, Toplevel, Frame, Label, Scale, HORIZONTAL
except ImportError:
from Tkinter import Tk, Topleve... | mit |
thesuperzapper/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/data_feeder_test.py | 71 | 12923 | # 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 |
creyesp/RF_Estimation | Clustering/clustering/gmm.py | 2 | 6063 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SpectralClustering.py
#
# Copyright 2014 Carlos "casep" Sepulveda <casep@alumnos.inf.utfsm.cl>
#
# 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 Fo... | gpl-2.0 |
txamqp/txamqp | src/examples/simple/txconsumer.py | 1 | 2216 | from twisted.internet.defer import inlineCallbacks
from twisted.internet import reactor
from twisted.internet.protocol import ClientCreator
from twisted.python import log
from txamqp.protocol import AMQClient
from txamqp.client import TwistedDelegate
import txamqp.spec
@inlineCallbacks
def gotConnection(conn, userna... | apache-2.0 |
platformio/platformio-core | platformio/debug/exception.py | 2 | 1138 | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 |
Alkemic/yaCBV | yacbv/mixins.py | 1 | 1041 | from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.http.response import HttpResponseNotAllowed
class HttpMethodRestrictMixin(object):
allowed_methods = [
'options', 'get', 'head', 'post',
'put', 'delete', 'trace', 'connect',
]
de... | mit |
slipstream/SlipStreamClient | client/src/external/chardet/mbcssm.py | 289 | 25481 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | apache-2.0 |
bbenko/shinkicker | django/contrib/localflavor/in_/forms.py | 309 | 1741 | """
India-specific Form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import gettext
import re
class INZipCodeField(RegexFiel... | bsd-3-clause |
michaelwu/servo | components/script/dom/bindings/codegen/Configuration.py | 6 | 13290 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from WebIDL import IDLInterface
autogenerated_comment = "/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n"
class Confi... | mpl-2.0 |
Turlough/keyczar | cpp/src/tools/swtoolkit/site_scons/site_tools/collada_dom.py | 12 | 1830 | #!/usr/bin/python2.4
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | apache-2.0 |
mateoqac/unqTip | lib_gb/six.py | 878 | 29664 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | gpl-3.0 |
wakatime/wakatime | wakatime/packages/py26/pygments/lexers/configs.py | 25 | 28266 | # -*- coding: utf-8 -*-
"""
pygments.lexers.configs
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for configuration file formats.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, default, words, bygro... | bsd-3-clause |
JCBarahona/edX | common/djangoapps/course_modes/migrations/0007_add_description.py | 114 | 2270 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseMode.description'
db.add_column('course_modes_coursemode', 'description',
... | agpl-3.0 |
c0hen/django-venv | lib/python3.4/site-packages/django/contrib/gis/db/backends/spatialite/models.py | 510 | 2946 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper
from django.db import connection, models
from django.db.backends.signals import connectio... | gpl-3.0 |
smily77/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/connectionpool.py | 184 | 20547 | # urllib3/connectionpool.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
import logging
import socket
import errno
from socket import error as SocketError, time... | lgpl-2.1 |
timothycrosley/isort | isort/stdlibs/py39.py | 3 | 3295 | """
File contains the standard library of Python 3.9.
DO NOT EDIT. If the standard library changes, a new list should be created
using the mkstdlibs.py script.
"""
stdlib = {
"_thread",
"abc",
"aifc",
"argparse",
"array",
"ast",
"asynchat",
"asyncio",
"asyncore",
"atexit",
... | mit |
olemis/brython | www/src/Lib/encodings/cp861.py | 37 | 35331 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.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_map)
def decode(self,input,errors=... | bsd-3-clause |
entwanne/Rodolphe | rodolphe/main/views/tag.py | 2 | 1805 | from django.shortcuts import render_to_response
from django.db.models import Q
from django.template import RequestContext
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.utils.translation import ugettext as _
from main.models import Post, Tag
from main.forms import PostForm
from ut... | bsd-2-clause |
KyoungRan/Django_React_ex | Django_React_Workshop-mbrochh/django/myvenv/lib/python3.4/site-packages/pip/_vendor/progress/helpers.py | 521 | 2854 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | mit |
BigRefT/bionic_cms | vendor/plugins/bionic-fckeditor/public/javascripts/fckeditor/editor/filemanager/connectors/py/zope.py | 89 | 5685 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2009 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | mit |
Simran-B/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_textwrap.py | 55 | 23220 | #
# Test suite for the textwrap module.
#
# Original tests written by Greg Ward <gward@python.net>.
# Converted to PyUnit by Peter Hansen <peter@engcorp.com>.
# Currently maintained by Greg Ward.
#
# $Id: test_textwrap.py 67896 2008-12-21 17:01:26Z benjamin.peterson $
#
import unittest
from test import test_support
f... | apache-2.0 |
louietsai/python-for-android | python-modules/twisted/twisted/test/test_hook.py | 81 | 4290 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for twisted.hook module.
"""
from twisted.python import hook
from twisted.trial import unittest
class BaseClass:
"""
dummy class to help in testing.
"""
def __init__(self):
"""
dummy ini... | apache-2.0 |
alexpilotti/stackalytics-1 | stackalytics/openstack/common/importutils.py | 19 | 2186 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/L... | apache-2.0 |
EmpireProject/Empire | lib/common/encryption.py | 7 | 16803 | """
Empire encryption functions.
Includes:
pad() - performs PKCS#7 padding
depad() - Performs PKCS#7 depadding
rsa_xml_to_key() - parses a PowerShell RSA xml import and builds a M2Crypto object
rsa_encrypt() - encrypts data us... | bsd-3-clause |
thepiper/standoff | venv/lib/python2.7/site-packages/pip/_vendor/requests/utils.py | 618 | 21334 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
import wa... | gpl-3.0 |
mathLab/RBniCS | rbnics/problems/elliptic/elliptic_coercive_compliant_rb_reduced_problem.py | 1 | 1383 | # Copyright (C) 2015-2021 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from math import sqrt
from numpy import isclose
from rbnics.problems.elliptic.elliptic_coercive_compliant_problem import EllipticCoerciveCompliantProblem
from rbnics.problems.elliptic.ellipti... | lgpl-3.0 |
Buggaarde/youtube-dl | youtube_dl/extractor/livestream.py | 107 | 10261 | from __future__ import unicode_literals
import re
import json
import itertools
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_urlparse,
compat_urlparse,
)
from ..utils import (
ExtractorError,
find_xpath_attr,
int_or_none,
orderedSet,
xpath_wit... | unlicense |
ActionAdam/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x0a4.py | 252 | 4437 | data = (
'qiet', # 0x00
'qiex', # 0x01
'qie', # 0x02
'qiep', # 0x03
'quot', # 0x04
'quox', # 0x05
'quo', # 0x06
'quop', # 0x07
'qot', # 0x08
'qox', # 0x09
'qo', # 0x0a
'qop', # 0x0b
'qut', # 0x0c
'qux', # 0x0d
'qu', # 0x0e
'qup', # 0x0f
'qurx', # 0x10
'qur', # 0x11
... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.