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 |
|---|---|---|---|---|---|
yask123/django | tests/admin_filters/models.py | 98 | 2149 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compa... | bsd-3-clause |
arista-eosplus/ansible | lib/ansible/parsing/splitter.py | 16 | 10667 | # (c) 2014 James Cammarata, <jcammarata@ansible.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 late... | gpl-3.0 |
pombreda/swtoolkit | test/visual_studio_solution_test.py | 18 | 3689 | #!/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... | bsd-3-clause |
willthames/ansible | lib/ansible/modules/packaging/language/gem.py | 70 | 8690 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Johan Wiren <johan.wiren.se@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 th... | gpl-3.0 |
texttochange/vusion-backend | vusion/persist/participant/participant.py | 1 | 8551 | import re
from datetime import datetime
from vusion.persist import Model
from vusion.error import InvalidField, MissingField
from vusion.utils import time_to_vusion_format
## TODO update the validation
class Participant(Model):
MODEL_TYPE = 'participant'
MODEL_VERSION = '5'
REGEX_RAW = re.compile('.*_ra... | bsd-3-clause |
apixandru/intellij-community | python/lib/Lib/ctypes/__init__.py | 110 | 7851 | import jffi
__version__ = "0.0.1"
_TypeMap = {
'b': jffi.Type.BYTE,
'B': jffi.Type.UBYTE,
'h': jffi.Type.SHORT,
'H': jffi.Type.USHORT,
'i': jffi.Type.INT,
'I': jffi.Type.UINT,
'l': jffi.Type.LONG,
'L': jffi.Type.ULONG,
'q': jffi.Type.LONGLONG,
'Q': jffi.Type.ULONGLONG,
'f':... | apache-2.0 |
noxrepo/nox-classic | src/nox/netapps/tests/pyunittests/bs_location_test.py | 10 | 6003 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... | gpl-3.0 |
mystique1029/namebench | nb_third_party/simplejson/ordered_dict.py | 1039 | 3370 | """Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... | apache-2.0 |
abeconnelly/Concordance | utils/gff.py | 1 | 8483 | #!/usr/bin/python
# This code is part of GET-Evidence.
# Copyright: see COPYING
# Authors: see git-blame(1)
# A GFF file parser
from warnings import warn
from intervals import Interval, IntervalFile
# for maximum compatibility, we assume GFF files are version 2 unless otherwise specified
DEFAULT_GFF_VERSION = 2
DEFA... | agpl-3.0 |
brianjgeiger/osf.io | osf/models/banner.py | 16 | 1944 | from django.db import models
from datetime import datetime
from osf.utils.storage import BannerImageStorage
from osf.exceptions import ValidationValueError
from osf.utils.fields import NonNaiveDateTimeField
def validate_banner_dates(banner_id, start_date, end_date):
if start_date > end_date:
raise Valid... | apache-2.0 |
raphael0202/spaCy | spacy/tests/conftest.py | 1 | 3454 | # coding: utf-8
from __future__ import unicode_literals
from ..en import English
from ..de import German
from ..es import Spanish
from ..it import Italian
from ..ja import Japanese
from ..fr import French
from ..pt import Portuguese
from ..nl import Dutch
from ..sv import Swedish
from ..hu import Hungarian
from ..fi i... | mit |
ItsLastDay/academic_university_2016-2018 | subjects/SoftwareDesign/au-software_design-2017/roguelike/src/roguelike/game_operations.py | 1 | 2523 | """
Module that encapsulates possible game reactions to user in put.
From the MVC point of view, this is part of the Controller.
"""
import random
import logging
import abc
from .world.enumerations import TileType
from .world.monster import Monster
from .world import factories
from . import event_history
from .world.... | gpl-3.0 |
fission6/python-oauth2 | tests/test_oauth.py | 1 | 53879 | # -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2009 Vic Fryzel
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, co... | mit |
artwr/airflow | airflow/operators/hive_to_samba_operator.py | 5 | 2796 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
SUSE/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/generic_resource_filter.py | 7 | 1161 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
brion/lilypond | python/rational.py | 10 | 8377 | """Implementation of rational arithmetic."""
from __future__ import division
import math as _math
def _gcf(a, b):
"""Returns the greatest common factor of a and b."""
a = abs(a)
b = abs(b)
while b:
a, b = b, a % b
return a
class Rational(object):
"""
This class provides an exact ... | gpl-3.0 |
murrayrm/python-control | control/xferfcn.py | 1 | 58980 | """xferfcn.py
Transfer function representation and functions.
This file contains the TransferFunction class and also functions
that operate on transfer functions. This is the primary representation
for the python-control library.
"""
# Python 3 compatibility (needs to go here)
from __future__ import print_function
... | bsd-3-clause |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/xml/dom/minicompat.py | 209 | 3330 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... | gpl-2.0 |
IITBinterns13/edx-platform-dev | common/lib/capa/capa/util.py | 19 | 3128 | from calc import evaluator
from cmath import isinf
#-----------------------------------------------------------------------------
#
# Utility functions used in CAPA responsetypes
def compare_with_tolerance(v1, v2, tol):
''' Compare v1 to v2 with maximum tolerance tol
tol is relative if it ends in %; otherwis... | agpl-3.0 |
howie6879/novels-search | owllook/views/novels_blueprint.py | 2 | 14829 | #!/usr/bin/env python
import time
from jinja2 import Environment, PackageLoader, select_autoescape
from operator import itemgetter
from sanic import Blueprint
from sanic.response import redirect, html, text, json
from owllook.config import RULES, LOGGER, REPLACE_RULES, ENGINE_PRIORITY, CONFIG
from owllook.database.mo... | apache-2.0 |
tailorian/Sick-Beard | lib/rtorrent/rpc/__init__.py | 158 | 10775 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# 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, ... | gpl-3.0 |
kslundberg/pants | src/python/pants/option/ranked_value.py | 5 | 4369 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy
class ... | apache-2.0 |
jpshort/odoo | addons/mail/res_partner.py | 379 | 2454 | # -*- 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 |
rampage644/impala-cut | tests/query_test/test_compute_stats.py | 5 | 2517 | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, 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 requir... | apache-2.0 |
CTSRD-SOAAP/chromium-42.0.2311.135 | build/android/gyp/create_dist_jar.py | 99 | 1031 | #!/usr/bin/env python
#
# 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.
"""Merges a list of jars into a single jar."""
import optparse
import sys
from util import build_utils
def main(args):
args = bu... | bsd-3-clause |
vmora/QGIS | python/plugins/processing/algs/grass7/ext/r_li_shape_ascii.py | 12 | 1538 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_shape_ascii.py
-------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************... | gpl-2.0 |
highweb-project/highweb-webcl-html5spec | tools/grit/grit/format/rc_unittest.py | 61 | 14584 | #!/usr/bin/env python
# Copyright (c) 2011 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 grit.format.rc'''
import os
import re
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.pa... | bsd-3-clause |
sidorof/Thymus-timeseries | thymus/freq_conversions.py | 1 | 4756 | # freq_conversions.py
"""
This module converts timeseries from one type to another.
"""
import numpy as np
from .constants import FREQ_D, FREQ_M, FREQ_Q, FREQ_Y
from .constants import FREQ_H, FREQ_MIN, FREQ_SEC
from .constants import TS_ORDINAL, TS_TIMESTAMP
HIERARCHY = (FREQ_SEC, FREQ_MIN, FREQ_H, FREQ_D, FREQ_M, ... | mit |
FICTURE7/youtube-dl | youtube_dl/extractor/googlesearch.py | 168 | 1699 | from __future__ import unicode_literals
import itertools
import re
from .common import SearchInfoExtractor
from ..compat import (
compat_urllib_parse,
)
class GoogleSearchIE(SearchInfoExtractor):
IE_DESC = 'Google Video search'
_MAX_RESULTS = 1000
IE_NAME = 'video.google:search'
_SEARCH_KEY = 'g... | unlicense |
sakura-internet/saklient.python | saklient/cloud/models/model_bridge.py | 1 | 4541 | # -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.bridge import Bridge
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.mo... | mit |
kamenim/samba | source4/dsdb/tests/python/ldap_schema.py | 25 | 23001 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is a port of the original in testprogs/ejs/ldap.js
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008-2011
#
# 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... | gpl-3.0 |
TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/thirdparty/src/reportlab/graphics/samples/simple_pie.py | 14 | 2914 | #Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.charts.piecharts import Pie
from reportlab.graphics.widgets.grids import ShadedRect
from reportlab.graphics.charts.legends import Legend
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
from reportlab.graphics.charts.textl... | gpl-3.0 |
meechanic/infsrcmanage | infsrcmanage/urls.py | 1 | 1747 | """infsrcmanage URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | mit |
jasonzzz/ansible | lib/ansible/plugins/action/pause.py | 79 | 7055 | # 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 |
stoyannk/profi | tests/gtest-1.6.0/test/gtest_break_on_failure_unittest.py | 1050 | 7214 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-2-clause |
balloob/home-assistant | tests/components/metoffice/test_weather.py | 7 | 6086 | """The tests for the Met Office sensor component."""
from datetime import timedelta
import json
from homeassistant.components.metoffice.const import DOMAIN
from homeassistant.const import STATE_UNAVAILABLE
from homeassistant.util import utcnow
from . import NewDateTime
from .const import (
METOFFICE_CONFIG_KINGSL... | apache-2.0 |
tchellomello/home-assistant | homeassistant/components/cast/const.py | 21 | 1071 | """Consts for Cast integration."""
DOMAIN = "cast"
DEFAULT_PORT = 8009
# Stores a threading.Lock that is held by the internal pychromecast discovery.
INTERNAL_DISCOVERY_RUNNING_KEY = "cast_discovery_running"
# Stores all ChromecastInfo we encountered through discovery or config as a set
# If we find a chromecast with... | apache-2.0 |
patmcb/odoo | addons/l10n_be_hr_payroll/__openerp__.py | 312 | 1872 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
futurepress/futurepress | models/author_model.py | 1 | 2105 | __author__ = 'ajrenold'
# Libs
from flask import url_for
from flask.ext.sqlalchemy import ( SQLAlchemy )
# Our Imports
from core import db
from model_utils import slugify
class Author(db.Model):
__tablename__ = 'author'
# primary key
author_id = db.Column(db.Integer, primary_key=True)
# relations
... | bsd-2-clause |
3dfxsoftware/cbss-addons | google_account/google_account.py | 16 | 8652 | # -*- 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... | gpl-2.0 |
jonboiser/kolibri | kolibri/core/discovery/test/test_filesystem_utils.py | 6 | 8193 | from __future__ import absolute_import, print_function, unicode_literals
from django.test import TestCase
from mock import patch
import ntpath
import os
import posixpath
import sys
from .dummydata import windows_data, osx_data, linux_data
from ..utils.filesystem import enumerate_mounted_disk_partitions, EXPORT_FOLDE... | mit |
pikepdf/pikepdf | src/pikepdf/_cpphelpers.py | 1 | 2555 | # 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/.
#
# Copyright (C) 2017, James R. Barlow (https://github.com/jbarlow83/)
"""
Support functions called by the C++ library ... | mpl-2.0 |
pombreda/libforensics | demo/info2ls.py | 13 | 6805 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics 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 License, or
# (at your option) any later ver... | gpl-3.0 |
henryfjordan/django | django/conf/locale/sk/formats.py | 504 | 1173 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i'
DATET... | bsd-3-clause |
abadger/ansible | lib/ansible/plugins/action/template.py | 15 | 9750 | # Copyright: (c) 2015, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2018, 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
import os
import shutil
import st... | gpl-3.0 |
aristanetworks/neutron | neutron/tests/unit/agent/linux/test_daemon.py | 12 | 11313 | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | apache-2.0 |
google/audio-to-tactile | extras/python/phonetics/make_training_data.py | 1 | 14304 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
vnaboychenko/pecan | pecan/tests/test_conf.py | 1 | 11743 | import os
import sys
import tempfile
from pecan.tests import PecanTestCase
from six import b as b_
__here__ = os.path.dirname(__file__)
class TestConf(PecanTestCase):
def test_update_config_fail_identifier(self):
"""Fail when naming does not pass correctness"""
from pecan import configuration
... | bsd-3-clause |
splunk/splunk-webframework | contrib/django/django/db/backends/creation.py | 1 | 19020 | import hashlib
import sys
import time
from django.conf import settings
from django.db.utils import load_backend
from django.utils.encoding import force_bytes
from django.utils.six.moves import input
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
cl... | apache-2.0 |
Zaneh-/bearded-tribble-back | tests/integration/resources_permissions/test_users_resources.py | 1 | 7202 | from tempfile import NamedTemporaryFile
from django.core.urlresolvers import reverse
from taiga.base.utils import json
from taiga.users.serializers import UserSerializer
from tests import factories as f
from tests.utils import helper_test_http_method, disconnect_signals, reconnect_signals
import pytest
pytestmark =... | agpl-3.0 |
DePierre/owtf | tests/testing_framework/config/environments.py | 3 | 2445 | from flexmock import flexmock
from framework.config.plugin import PluginConfig
from framework.config.config import Config
from framework.shell.blocking_shell import Shell
from os import path
PLUGINS_DIR = path.abspath("test_cases/resources/plugins_dir") + "/" # Relative to the owtf/tests directory
WEB_TEST_GROUPS = ... | bsd-3-clause |
Qalthos/ansible | lib/ansible/plugins/doc_fragments/opennebula.py | 44 | 1422 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, www.privaz.io Valletech AB
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# OpenNebula common documentation
DOCUMENTATION = r'''
options:
api_url:
description:
... | gpl-3.0 |
tommo/gii | lib/3rdparty/common/pygments/formatters/latex.py | 72 | 17615 | # -*- coding: utf-8 -*-
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division
from pygments.formatter import Forma... | mit |
osvalr/odoo | addons/account_budget/__init__.py | 444 | 1097 | # -*- 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 |
AmberWhiteSky/TeamTalk | win-client/3rdParty/src/json/amalgamate.py | 127 | 6807 | """Amalgate json-cpp library sources into a single source and header file.
Requires Python 2.6
Example of invocation (must be invoked from json-cpp top directory):
python amalgate.py
"""
import os
import os.path
import sys
class AmalgamationFile:
def __init__( self, top_dir ):
self.top_dir = top_dir
... | apache-2.0 |
quamilek/django | tests/auth_tests/urls.py | 189 | 4614 | from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth import views
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.urls import urlpatterns as auth_urlpatterns
from django.contrib.messages.api... | bsd-3-clause |
geekboxzone/mmallow_external_protobuf | python/google/protobuf/internal/encoder.py | 73 | 26730 | # 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
# met:
#
# * Redi... | bsd-3-clause |
arokem/nipype | nipype/interfaces/slicer/legacy/tests/test_auto_MultiResolutionAffineRegistration.py | 9 | 1761 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.legacy.registration import MultiResolutionAffineRegistration
def test_MultiResolutionAffineRegistration_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
... | bsd-3-clause |
Gussy/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/sunar.py | 61 | 2559 | """engine.SCons.Tool.sunar
Tool-specific initialization for Solaris (Forte) ar (library archive). If CC
exists, static libraries should be built with it, so that template
instantians can be resolved.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic S... | apache-2.0 |
kinooo/Sick-Beard | sickbeard/clients/requests/packages/charade/langhungarianmodel.py | 184 | 12761 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 Ri... | gpl-3.0 |
SeavantUUz/lolibot | lolibot/loli.py | 1 | 7130 | # coding:utf-8
from flask import Flask,request
import logging
import xml.etree.ElementTree as ET
from elementtree import SimpleXMLTreeBuilder
import hashlib
from template import Template
from utils import to_unicode
ET.XMLTreeBuilder = SimpleXMLTreeBuilder.TreeBuilder
__all__ = ['Loli','Shoujo']
class Loli(object):
... | gpl-2.0 |
xuru/pyvisdk | pyvisdk/do/host_port_group_spec.py | 1 | 1108 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostPortGroupSpec(vim, *args, **kwargs):
'''This data object type describes the PortG... | mit |
amenonsen/ansible | lib/ansible/plugins/action/bigip.py | 37 | 4448 | #
# (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 |
wechatpy/wechatpy | wechatpy/work/messages.py | 2 | 1096 | # -*- coding: utf-8 -*-
from wechatpy import messages
from wechatpy.fields import IntegerField, StringField
MESSAGE_TYPES = {}
def register_message(msg_type):
def register(cls):
MESSAGE_TYPES[msg_type] = cls
return cls
return register
@register_message("text")
class TextMessage(messages.... | mit |
rui-castro/Sick-Beard | lib/hachoir_parser/misc/ole2.py | 90 | 14227 | """
Microsoft Office documents parser.
Informations:
* wordole.c of AntiWord program (v0.35)
Copyright (C) 1998-2003 A.J. van Os
Released under GNU GPL
http://www.winfield.demon.nl/
* File gsf-infile-msole.c of libgsf library (v1.14.0)
Copyright (C) 2002-2004 Jody Goldberg (jody@gnome.org)
Released under GNU... | gpl-3.0 |
eonpatapon/nova | nova/tests/unit/compute/test_compute_api.py | 6 | 126372 | #
# 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 |
joelpinheiro/safebox-smartcard-auth | Server/veserver/lib/python2.7/site-packages/pkg_resources.py | 130 | 100868 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | gpl-2.0 |
acshan/odoo | addons/mail/mail_group.py | 247 | 12877 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-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 |
nerosketch/djing | djing/formfields.py | 2 | 1201 | from django.forms import CharField
from django.forms.widgets import TextInput
from django.core.validators import RegexValidator, _lazy_re_compile
from django.forms.fields import EMPTY_VALUES
from django.forms.utils import ValidationError
from django.utils.translation import gettext_lazy as _
from netaddr import EUI, Ad... | unlicense |
mtagle/airflow | tests/providers/microsoft/msqql/operators/test_mssql.py | 4 | 1769 | #
# 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... | apache-2.0 |
stephane-martin/salt-debian-packaging | salt-2016.3.2/tests/unit/states/timezone_test.py | 2 | 2349 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rahul Handay <rahulha@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salt.exceptions import CommandExecutionError
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_sys... | apache-2.0 |
andrewgodwin/lastgraph | lastrender/renderer.py | 2 | 6941 | #!/usr/bin/python
"""
LastGraph rendering client
"""
import sys
import os
import json
import urllib
from httppost import posturl, extract_django_error
from graphication import FileOutput, Series, SeriesSet, Label, AutoWeekDateScale, Colourer, css
from graphication.wavegraph import WaveGraph
def render_poster():
... | bsd-3-clause |
aaltay/beam | sdks/python/apache_beam/examples/streaming_wordcount.py | 1 | 3893 | #
# 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 us... | apache-2.0 |
broferek/ansible | lib/ansible/modules/network/eos/eos_config.py | 12 | 20736 | #!/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 distribut... | gpl-3.0 |
tmenjo/cinder-2015.1.0 | cinder/tests/test_exception.py | 8 | 4426 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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... | apache-2.0 |
skycucumber/xuemc | python/venv/lib/python2.7/site-packages/docutils/languages/zh_cn.py | 148 | 2026 | # -*- coding: utf-8 -*-
# $Id: zh_cn.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Pan Junyong <panjy@zopechina.com>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two ... | gpl-2.0 |
kimjaejoong/nova | nova/tests/unit/virt/test_volumeutils.py | 26 | 1788 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
# Copyright 2012 University Of Minho
# Copyright 2010 OpenStack Foundation
#
# 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 |
Versent/ansible | v1/ansible/runner/connection_plugins/funcd.py | 110 | 3517 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 |
Effi-01/Testing | script.video.F4mProxy/lib/f4mUtils/python_rsakey.py | 136 | 4374 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Pure-Python RSA implementation."""
from .cryptomath import *
from .asn1parser import ASN1Parser
from .rsakey import *
from .pem import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=... | gpl-2.0 |
riklaunim/django-custom-multisite | django/conf/locale/pt_BR/formats.py | 86 | 1536 | # -*- 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 = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \d\e F \d\e Y... | bsd-3-clause |
googledatalab/pydatalab | tests/stackdriver/monitoring/group_tests.py | 2 | 5439 | # Copyright 2016 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 agreed ... | apache-2.0 |
EKiefer/edge-starter | py34env/Lib/site-packages/django/core/management/commands/dbshell.py | 467 | 1192 | from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
requires_system_checks = False
def add... | mit |
endlessm/chromium-browser | build/locale_tool.py | 5 | 51300 | #!/usr/bin/env vpython
# Copyright 2019 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.
"""Helper script used to manage locale-related files in Chromium.
This script is used to check, and potentially fix, many locale-rela... | bsd-3-clause |
divio/django-filer | filer/templatetags/filer_image_tags.py | 2 | 3509 | import re
from django.template import Library
register = Library()
RE_SIZE = re.compile(r'(\d+)x(\d+)$')
def percentage(part, whole):
return 100 * float(part) / float(whole)
def _recalculate_size(size, index, divisor=0, padding=0,
keep_aspect_ratio=False):
new_one = size[index]
... | bsd-3-clause |
yselivonchyk/TensorFlow_DCIGN | model_interpreter.py | 1 | 7313 | import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
import network_utils as nut
import utils as ut
import re
import os
from Bunch import Bunch
INPUT = 'input'
FC = 'fully_connected'
CONV = 'convolutional'
POOL = 'max_pooling'
POOL_ARG = 'maxpool_with_args'
DO = 'dropout'
LOSS = 'loss'
ac... | mit |
mumuwoyou/vnpy-dev | vn.api/vn.xspeed/pyscript/generate_struct.py | 15 | 1965 | # encoding: UTF-8
__author__ = 'CHENXY'
from xspeed_data_type import *
import re
def main():
"""主函数"""
fcpp = open('DFITCApiStruct.h', 'r')
fpy = open('xspeed_struct.py', 'w')
fpy.write('# encoding: UTF-8\n')
fpy.write('\n')
fpy.write('structDict = {}\n')
fpy.write('\n')
for no, lin... | mit |
Bobobol/nemubot-1 | server/__init__.py | 1 | 4230 | # -*- coding: utf-8 -*-
# Nemubot is a smart and modulable IM bot.
# Copyright (C) 2012-2014 nemunaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | agpl-3.0 |
pepeportela/edx-platform | openedx/core/djangoapps/user_api/management/commands/email_opt_in_list.py | 8 | 10131 | """Generate a list indicating whether users have opted in or out of receiving email from an org.
Email opt-in is stored as an org-level preference.
When reports are generated, we need to handle:
1) Org aliases: some organizations might have multiple course key "org" values.
We choose the most recently set prefere... | agpl-3.0 |
martynovp/edx-platform | lms/tests.py | 31 | 1952 | """Tests for the lms module itself."""
import mimetypes
from mock import patch
from django.test import TestCase
from django.core.urlresolvers import reverse
from edxmako import add_lookup, LOOKUP
from lms import startup
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.djan... | agpl-3.0 |
egoid/baytree | lib/python2.7/site-packages/sqlparse/filters/output.py | 20 | 4051 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
from sqlparse import sql, tokens as T
from sqlparse.compat import text_type
class OutputFilter(object)... | mit |
hiteshradia/android_kernel_Lenovo_Kraft_A6000 | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
raycarnes/odoomrp-wip | mrp_production_add_middle_stuff_operations/wizard/wizard_addition.py | 19 | 2709 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of th... | agpl-3.0 |
alanjw/GreenOpenERP-Win-X86 | python/Lib/test/test_pwd.py | 9 | 3757 | import sys
import unittest
from test import test_support
pwd = test_support.import_module('pwd')
class PwdTest(unittest.TestCase):
def test_values(self):
entries = pwd.getpwall()
entriesbyname = {}
entriesbyuid = {}
for e in entries:
self.assertEqual(len... | agpl-3.0 |
orvice/shadowsocks | tests/coverage_server.py | 1072 | 1655 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... | apache-2.0 |
TurkuNLP/SRNNMT | s_lengths.py | 1 | 1314 | import sys
import numpy
import pickle
def gather():
lens={} #length -> [sim,sim....]
for line in sys.stdin:
line=line.strip()
cols=line.split("\t")
if len(cols)==4: #output with numbered lines, drop
cols=cols[1:]
sim,en,fi=cols
sim=float(sim)
fi_le... | apache-2.0 |
hastexo/edx-platform | cms/djangoapps/xblock_config/tests/test_models.py | 8 | 3775 | """
Tests for the models that configures Edit LTI fields feature.
"""
from contextlib import contextmanager
import ddt
from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator
from request_cache.middleware import RequestCache
from xblock_config.models import CourseEditLTIFieldsEnabledFlag
... | agpl-3.0 |
svenstaro/uni-projekt | assembler/operands/immediate.py | 1 | 1099 | import string
from ..misc import tools
from .operand import Operand
from ..errors import EncodingError, DecodingError
def Immediate(size):
class Immediate(Operand):
start = "#"
@classmethod
def fromText(cls, arg, state):
ex = EncodingError(arg, "Not a valid %s-bit Immediate" ... | gpl-3.0 |
sharad1126/owtf | framework/db/resource_manager.py | 3 | 3759 | from framework.db import models
from framework.config import config
from framework.dependency_management.dependency_resolver import BaseComponent
from framework.dependency_management.interfaces import ResourceInterface
from framework.lib.general import cprint
import os
import logging
from framework.utils import FileOpe... | bsd-3-clause |
archatas/whoosh | whoosh/ramdb/ramreading.py | 4 | 6133 | #===============================================================================
# Copyright 2009 Matt Chaput
#
# 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/li... | apache-2.0 |
entoo/portage-src | pym/portage/tests/dbapi/test_fakedbapi.py | 5 | 2137 | # Copyright 2011-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import tempfile
from portage import os
from portage import shutil
from portage.dbapi.virtual import fakedbapi
from portage.package.ebuild.config import config
from portage.tests import TestCase
class TestFakedb... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.