repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
r0fls/sanic | sanic/app.py | 1 | 29389 | import logging
import logging.config
import re
import warnings
from asyncio import get_event_loop, ensure_future, CancelledError
from collections import deque, defaultdict
from functools import partial
from inspect import isawaitable, stack, getmodulename
from traceback import format_exc
from urllib.parse import urlenc... | mit |
knusbaum/incubator-storm | dev-tools/release_notes.py | 20 | 5672 | #!/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 "Lice... | apache-2.0 |
jerbob92/CouchPotatoServer | couchpotato/core/notifications/email/main.py | 2 | 1975 | from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import splitString
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
from couchpotato.environment import Env
from email.mime.text import MIMEText
import smtplib
import trac... | gpl-3.0 |
petewarden/tensorflow | tensorflow/python/distribute/values_util.py | 11 | 14810 | # Copyright 2020 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 |
WeAreCloudar/troposphere | troposphere/cloudformation.py | 22 | 5724 | # Copyright (c) 2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSHelperFn, AWSObject, AWSProperty, Ref, BaseAWSObject
from .validators import integer, boolean, encoding
class Stack(AWSObject):
resource_type = "AWS::CloudFormation::Stack"
props = ... | bsd-2-clause |
grdlok/UStar-dl | src/youtube_dl/extractor/auengine.py | 4 | 1708 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
determine_ext,
ExtractorError,
)
class AUEngineIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?auengine\.com/embed\.php\?.*?file=(?P<id>[^&]+).*?'
_TEST = {
... | unlicense |
richhaase/kafka | tests/kafkatest/tests/core/consumer_group_command_test.py | 4 | 4585 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
Metaswitch/calico-neutron | neutron/tests/unit/cisco/cfg_agent/test_csr1kv_routing_driver.py | 17 | 12132 | # Copyright 2014 Cisco Systems, 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 |
DarkFenX/Pyfa | eos/db/migrations/upgrade18.py | 4 | 2933 | """
Migration 8
- Converts modules from old Warfare Links to Command Modules
"""
CONVERSIONS = {
42526: ( # Armor Command Burst I
20069, # Armored Warfare Link - Damage Control I
20409, # Armored Warfare Link - Passive Defense I
22227, # Armored Warfare Link - Rapid Repair I
),
... | gpl-3.0 |
mattmccarthy11/vidly-development | mediadrop/migrations/versions/003-4d27ff5680e5-normalize_comment_approval_setting.py | 10 | 2516 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
carlye566/IoT-POX | pox/py.py | 41 | 3883 | # Copyright 2012 James McCauley
#
# 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 writi... | apache-2.0 |
gwpy/gwpy | gwpy/timeseries/tests/test_io_gwf_lalframe.py | 3 | 4751 | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2014-2020)
#
# This file is part of GWpy.
#
# GWpy 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 |
kaichogami/scikit-learn | examples/cluster/plot_ward_structured_vs_unstructured.py | 320 | 3369 | """
===========================================================
Hierarchical clustering: structured vs unstructured ward
===========================================================
Example builds a swiss roll dataset and runs
hierarchical clustering on their position.
For more information, see :ref:`hierarchical_clus... | bsd-3-clause |
georgestarcher/TA-SyncKVStore | bin/ta_synckvstore/cloudconnectlib/splunktalib/credentials.py | 4 | 11063 | """
Handles credentials related stuff
"""
import re
import xml.dom.minidom as xdm
from . import rest
from .common import util
from .common import xml_dom_parser as xdp
# Splunk can only encrypt string when length <=255
SPLUNK_CRED_LEN_LIMIT = 255
class CredException(Exception):
pass
class CredNotFound(CredEx... | mit |
impedimentToProgress/Ratchet | llvm/utils/llvm-build/llvmbuild/configutil.py | 121 | 2084 | """
Defines utilities useful for performing standard "configuration" style tasks.
"""
import re
import os
def configure_file(input_path, output_path, substitutions):
"""configure_file(input_path, output_path, substitutions) -> bool
Given an input and output path, "configure" the file at the given input path
... | mit |
barykaed/Pelican-Test | fsp_env/Lib/site-packages/pip/_vendor/__init__.py | 84 | 3423 | """
pip._vendor is for vendoring dependencies of pip to prevent needing pip to
depend on something external.
Files inside of pip._vendor should be considered immutable and should only be
updated to versions from upstream.
"""
from __future__ import absolute_import
import glob
import os.path
import sys
# By default,... | mit |
joshuajan/odoo | addons/purchase_analytic_plans/__init__.py | 441 | 1220 | # -*- 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... | agpl-3.0 |
lmanul/awty | deletesubproject.py | 1 | 2264 | # -*- coding: utf-8 -*- #
# Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
Obus/scikit-learn | benchmarks/bench_glmnet.py | 297 | 3848 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of... | bsd-3-clause |
windy1/headerman.py | headerman/headerman.py | 1 | 5997 | """
Copyright (c) 2014 Walker Crouse
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, publish, distribute, ... | mit |
catapult-project/catapult | third_party/google-endpoints/apitools/base/protorpclite/descriptor.py | 30 | 19703 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | bsd-3-clause |
docmeth02/CouchPotatoServer | libs/subliminal/services/addic7ed.py | 105 | 5549 | # -*- coding: utf-8 -*-
# Copyright 2012 Olivier Leveau <olifozzy@gmail.com>
# Copyright 2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# t... | gpl-3.0 |
chiragjogi/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py | 384 | 8450 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
kurttheviking/agileid-py | tests/test_to_hexstring.py | 1 | 1201 | from bson.objectid import ObjectId
import os
import sys
import unittest
sys.path.insert(0, os.path.abspath('..'))
import agileid
def to_hexstring_invalid():
return agileid.to_hexstring('rar')
def to_hexstring_invalid_oid():
oid = str(ObjectId())
return agileid.to_hexstring('user!' + oid)
class Test(... | isc |
masami256/Anaconda-for-ore-ore-kernel | pyanaconda/textw/language_text.py | 1 | 2653 | #
# language_text.py: text mode language selection dialog
#
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software F... | gpl-2.0 |
wangyum/spark | examples/src/main/python/ml/tokenizer_example.py | 27 | 2044 | #
# 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 |
Dandandan/wikiprogramming | jsrepl/extern/python/unclosured/lib/python2.7/lib2to3/fixes/fix_print.py | 326 | 2865 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for print.
Change:
'print' into 'print()'
'print ...' into 'print(...)'
'print ... ,' into 'print(..., end=" ")'
'print >>x, ...' into 'print(..., file=x)'
No changes are appl... | mit |
jfantom/incubator-airflow | airflow/utils/decorators.py | 66 | 3194 | # -*- 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 |
barseghyanartur/django-extensions | tests/test_clean_pyc.py | 12 | 2392 | import fnmatch
import os
import shutil
import six
from django.core.management import call_command
from django.test import TestCase
from django_extensions.management.utils import get_project_root
class CleanPycTests(TestCase):
def setUp(self):
self._settings = os.environ.get('DJANGO_SETTINGS_MODULE')
... | mit |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/test/test_marshal.py | 29 | 10569 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from test import test_support
import marshal
import sys
import unittest
import os
class IntTestCase(unittest.TestCase):
def test_ints(self):
# Test the full range of Python ints.
n = sys.maxint
while n:
for expected in (-n, n):... | mit |
jianghuaw/nova | nova/cells/scheduler.py | 3 | 10939 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
sekikn/incubator-airflow | airflow/contrib/operators/sagemaker_endpoint_operator.py | 7 | 1212 | #
# 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 |
miguelparaiso/PracticaOdoo | openerp/addons/test_converter/tests/test_html.py | 257 | 13533 | # -*- encoding: utf-8 -*-
import json
import os
import datetime
from lxml import etree
from openerp.tests import common
from openerp.tools import html_escape as e
from openerp.addons.base.ir import ir_qweb
directory = os.path.dirname(__file__)
class TestExport(common.TransactionCase):
_model = None
def set... | agpl-3.0 |
hfp/tensorflow-xsmm | tensorflow/contrib/proto/python/ops/decode_proto_op.py | 37 | 1155 | # =============================================================================
# Copyright 2018 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
#... | apache-2.0 |
oh-moore/followpie | followpie.py | 3 | 10425 | # DO NOT TOUCH THESE THREE CONST VARIABLES
POPULAR = 1
LIKE = 2
LIKE_FOLLOW = 3
UNFOLLOW = 4
#Choose the tag you want to like based on, keep the word in double quotes, do not put a # sign in front of the tag
TAGS = ["beach", "lolcats", "kerry", "tree"]
#IF YOU WANT THE ACTION TO FOLLOW OR LIKE SOMEONE BASED ON THE CH... | mit |
aequitas/home-assistant | homeassistant/components/epsonworkforce/sensor.py | 2 | 2653 | """Support for Epson Workforce Printer."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_HOST, CONF_MONITORED_CONDITIONS
from homeassistant.exceptions import PlatformNotReady
import homeassistant.... | apache-2.0 |
ddjokic/HydraulicCalcsToolbox | Examples/PipingSystemCalc/Example1/example11.py | 2 | 4166 | #!/usr/bin/env python
# calculation file - your calculation code coming below line approx. 45
# Copyright (c) D.Djokic, 2013
# This code is released under GNU General Public Licence, Version 2
# No Warranties, whatsoever
''' List of functions in "Building Blocks file":
flow(H,A,B) - calculates flow for given Headloss
... | gpl-2.0 |
ossdemura/django-miniblog | src/Lib/site-packages/pip/_vendor/html5lib/filters/whitespace.py | 353 | 1139 | from __future__ import absolute_import, division, unicode_literals
import re
from . import base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(base.Filter):
spacePreserveElements = frozenset([... | mit |
creativcoder/servo | tests/wpt/harness/wptrunner/tests/test_chunker.py | 59 | 2807 | # 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/.
import unittest
import sys
from os.path import join, dirname
from mozlog import structured
import pytest
sys.path.inse... | mpl-2.0 |
nonnib/eve-metrics | web2py/applications/welcome/languages/zh.py | 152 | 10080 | # coding: utf8
{
'!langcode!': 'zh-tw',
'!langname!': '中文',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"',
'%s %%{row} deleted': '已刪除 %s 筆',
'%s %%{row} updated': '已更新 %s 筆',
'%s s... | mit |
waseem18/oh-mainline | vendor/packages/twill/twill/other_packages/pyparsing.py | 19 | 99305 | # module pyparsing.py
#
# Copyright (c) 2003-2006 Paul T. McGuire
#
# 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 u... | agpl-3.0 |
vitaly4uk/django | tests/resolve_url/tests.py | 199 | 3167 | from __future__ import unicode_literals
from django.contrib.auth.views import logout
from django.core.urlresolvers import NoReverseMatch, reverse_lazy
from django.shortcuts import resolve_url
from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.utils import six
from django.utils.depre... | bsd-3-clause |
camilonova/django | tests/template_tests/templatetags/inclusion.py | 65 | 8486 | import operator
from django.template import Engine, Library
engine = Engine(app_dirs=True)
register = Library()
@register.inclusion_tag('inclusion.html')
def inclusion_no_params():
"""Expected inclusion_no_params __doc__"""
return {"result": "inclusion_no_params - Expected result"}
inclusion_no_params.any... | bsd-3-clause |
DolphinDream/sverchok | nodes/curve/blend_curves.py | 2 | 10315 |
import numpy as np
import bpy
from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import (updateNode, zip_long_repeat, ensure_nesting_level,
repeat_last_for_length, throttle_... | gpl-3.0 |
motion2015/edx-platform | common/djangoapps/external_auth/tests/test_ssl.py | 116 | 18120 | """
Provides unit tests for SSL based authentication portions
of the external_auth app.
"""
import copy
import unittest
from django.conf import settings
from django.contrib.auth import SESSION_KEY
from django.contrib.auth.models import AnonymousUser, User
from django.contrib.sessions.middleware import SessionMiddlewar... | agpl-3.0 |
kzhong1991/Flight-AR.Drone-2 | src/3rdparty/Qt4.8.4/src/3rdparty/webkit/Source/ThirdParty/gyp/test/library/gyptest-shared-obj-install-path.py | 20 | 1077 | #!/usr/bin/env python
# Copyright (c) 2010 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that .so files that are order only dependencies are specified by
their install location rather than by their alias.
"""
# Pyth... | bsd-3-clause |
Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/setuptools/msvc.py | 40 | 40838 | """
Improved support for Microsoft Visual C++ compilers.
Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
Microsoft Windows SDK 6.1 (x86, x64, ia64)
Microsoft Windows SDK 7.0 (x86, x64, ia64)
Microsoft Visual C++ 10.0... | apache-2.0 |
MBARIMike/stoqs | stoqs/contrib/parquet/extract_columns.py | 2 | 11789 | #!/usr/bin/env python
"""
Pull all the temperature and salinity data out of a STOQS database no
matter what platform and write it out in Parquet file format.
This is a companion to select_data_in_columns_for_data_science.ipynb
where we operationalize the explorations demonstrated in this Notebook:
https://nbviewer.j... | gpl-3.0 |
gwpy/seismon | RfPrediction/StackedEnsemble_Rfamplitude_prediction.py | 2 | 11411 | # Stacked Ensemble RfAmp Prediction Model
# Multiple ML regressors are individually trained and then combined via meta-regressor.
# Hyperparameters are tuned via GridSearchCV
# coding: utf-8
from __future__ import division
import optparse
import numpy as np
import pandas as pd
import os
if not os.getenv("DISPLAY"... | gpl-3.0 |
RubenKelevra/rethinkdb | external/v8_3.30.33.16/testing/gtest/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | agpl-3.0 |
bmanojlovic/ansible | lib/ansible/modules/cloud/amazon/rds_subnet_group.py | 25 | 5369 | #!/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 |
raviflipsyde/servo | tests/wpt/web-platform-tests/old-tests/webdriver/command_contexts/open_and_close_window_test.py | 141 | 2529 | import os
import sys
import random
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
from webdriver import exceptions
class OpenAndCl... | mpl-2.0 |
ryfx/modrana | core/backports/collections.py | 2 | 6302 | ## {{{ http://code.activestate.com/recipes/500261/ (r15)
from operator import itemgetter as _itemgetter
from keyword import iskeyword as _iskeyword
import sys as _sys
from core.backports.six import string_types as basestring
def namedtuple(typename, field_names, verbose=False, rename=False):
"""Returns a new subcl... | gpl-3.0 |
aisthesis/mfstockmkt | options/db/trackpuller.py | 1 | 1181 | """
.. Copyright (c) 2016 Marshall Farrier
license http://opensource.org/licenses/MIT
Get options to be tracked
"""
import datetime as dt
from bson.codec_options import CodecOptions
import config
import constants
from dbwrapper import job
class TrackPuller(object):
def __init__(self, logger):
self.l... | mit |
jtl999/certbot | acme/acme/fields_test.py | 62 | 2083 | """Tests for acme.fields."""
import datetime
import unittest
import pytz
from acme import jose
class FixedTest(unittest.TestCase):
"""Tests for acme.fields.Fixed."""
def setUp(self):
from acme.fields import Fixed
self.field = Fixed('name', 'x')
def test_decode(self):
self.asser... | apache-2.0 |
kenwang815/KodiPlugins | script.module.oceanktv/lib/youtube_dl/extractor/videofyme.py | 111 | 1750 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class VideofyMeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.videofy\.me/.+?|p\.videofy\.me/v)/(?P<id>\d+)(&|#|$)'
IE_NAME = 'videofy.me'
_TEST = {
'url': 'h... | gpl-2.0 |
srluge/SickRage | lib/tornado/test/locks_test.py | 44 | 14878 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | gpl-3.0 |
adiyengar/Spirit | spirit/topic/poll/forms.py | 7 | 5605 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.forms.models import inlineformset_factory, BaseInlineFormSet
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_text
from django.core.exceptions import ValidationError
fro... | mit |
jwhui/openthread | tests/scripts/thread-cert/pktverify/layer_fields.py | 3 | 26574 | #!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# 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
# ... | bsd-3-clause |
Lukas0907/feeds | feeds/spiders/wienerlinien_at.py | 2 | 1970 | import scrapy
from scrapy.http import HtmlResponse
from feeds.loaders import FeedEntryItemLoader
from feeds.spiders import FeedsSpider
class WienerLinienAtSpider(FeedsSpider):
name = "wienerlinien.at"
custom_settings = {
"DEFAULT_REQUEST_HEADERS": {
"Accept": "text/html",
# Do... | agpl-3.0 |
SimpleAOSP-Kernel/kernel_flo | 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 |
thresholdsoftware/asylum | openerp/addons/project_long_term/wizard/project_compute_phases.py | 46 | 3290 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
willthames/ansible | lib/ansible/modules/network/lenovo/cnos_conditional_template.py | 59 | 8492 | #!/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 |
rafaelcor/turtleclick | Xlib/support/lock.py | 2 | 1591 | # $Id: lock.py,v 1.2 2007/06/10 14:11:58 mggrant Exp $
#
# Xlib.support.lock -- allocate a lock
#
# Copyright (C) 2000 Peter Liljenberg <petli@ctrl-c.liu.se>
#
# 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 ... | gpl-2.0 |
tkdchen/nitrate-xmlrpc | nitratexmlrpc/api/testcaserun.py | 1 | 23763 | # -*- coding: utf-8 -*-
#
# Nitrate is copyright 2010 Red Hat, Inc.
#
# Nitrate is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version. This pr... | gpl-2.0 |
tntraina/aff4 | scons-local-1.2.0/SCons/Tool/mingw.py | 12 | 5682 | """SCons.Tool.gcc
Tool-specific initialization for MinGW (http://www.mingw.org/)
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Fou... | gpl-3.0 |
yawnosnorous/python-for-android | python3-alpha/extra_modules/gdata/youtube/service.py | 46 | 58047 | #!/usr/bin/python
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
mfherbst/spack | var/spack/repos/builtin/packages/r-tsne/package.py | 5 | 1760 | ##############################################################################
# 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 |
gchq/gaffer-tools | python-shell/src/test/test_gaffer_functions_it.py | 1 | 2491 | #
# Copyright 2016-2019 Crown Copyright
#
# 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 i... | apache-2.0 |
jmcarbo/openerp7 | openerp/addons/crm_partner_assign/__openerp__.py | 48 | 2297 | # -*- 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 |
dudepare/django | django/core/management/base.py | 31 | 23960 | # -*- coding: utf-8 -*-
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
from __future__ import unicode_literals
import os
import sys
import warnings
from argparse import ArgumentParser
from optparse import OptionParser
import djang... | bsd-3-clause |
cytec/Sick-Beard | sickbeard/versionChecker.py | 2 | 18662 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
llvmpy/llvmpy | llvm_cbuilder/executor.py | 1 | 2016 | '''
This is mostly a convenience module for testing with ctypes.
'''
from llvm.core import Type, Module
import llvm.ee as le
import ctypes as ct
MAP_CTYPES = {
'void' : None,
'bool' : ct.c_bool,
'char' : ct.c_char,
'uchar' : ct.c_ubyte,
'short' : ct.c_short,
'ushort' : ct.c... | bsd-3-clause |
bigswitch/horizon | openstack_dashboard/test/integration_tests/pages/admin/system/routerspage.py | 9 | 1652 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
cemarchi/biosphere | Src/BioDataManagement/DataAccess/Entities/MicroRnaExpressionLevel.py | 1 | 1169 | from typing import Dict
from Src.BioDataManagement.DataAccess.Entities.BiologicalMeasureType import BiologicalMeasureType
from Src.Core.Entity.EntityBase import EntityBase
class MicroRnaExpressionLevel(BiologicalMeasureType, EntityBase):
"""description of class"""
def __init__(self, **kargs):
"""
... | bsd-3-clause |
moves-rwth/storm | resources/3rdparty/googletest/googlemock/test/gmock_output_test.py | 66 | 6154 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-3.0 |
rtnews/rtsfnt | node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | 10585 | # Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... | mit |
Adward-R/InfoVis | Wang/xlsx2json.py | 1 | 3582 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
import xlrd
import xlwt
def parse_sheet(sheet, filename, root):
'''Parse the sheet and tranfer it to a json file'''
output = file(filename, 'w')
header = []
data = []
for col in range(sheet.ncols):
header.append(sheet.cell_value(0, col))
f... | apache-2.0 |
SerpentCS/odoo | addons/crm_partner_assign/crm_lead.py | 221 | 3039 | # -*- 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 |
NathanW2/QGIS | python/plugins/processing/algs/qgis/TextToFloat.py | 4 | 3145 | # -*- coding: utf-8 -*-
"""
***************************************************************************
TextToFloat.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
*************************... | gpl-2.0 |
daizhengy/RDS | trove/tests/api/mgmt/accounts.py | 5 | 8097 | # Copyright 2011 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
piluke/BasicEventEngineFrontend | ui/eventdialog.py | 1 | 1539 | # Copyright (c) 2017-18 Luke Montalvo <lukemontalvo@gmail.com>
#
# This file is part of BEEF.
# BEEF is free software and comes with ABSOLUTELY NO WARANTY.
# See LICENSE for more details.
try:
import wx
except ImportError:
raise ImportError("The wxPython module is required to run this program")
from resources.enum ... | mit |
mhaessig/servo | tests/wpt/css-tests/css21_dev/html4/reference/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
hgl888/web-testing-service | wts/tests/csp/csp_font-src_none_blocked_int-manual.py | 30 | 2712 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
response.headers.set("Content... | bsd-3-clause |
rofolel/DonjonMasterExploder- | DD/combat.py | 1 | 1449 | import random
import console.Combat
import DD.person
class battle(object):
class hit(object):
def __init__(self,value,attacker,attackee):
self.value = value
self.attacker = attacker
self.attackee = attackee
def __str__(self):
return "%s hit %s for %i"%... | mit |
andrecunha/coh-metrix-dementia | coh/tools/syllable/tonic.py | 1 | 6223 | #-*- encoding:utf-8 -*-
# tonic.py - Tonic vowel finding using the algorithm described in Silva [2011].
# Copyright (C) 2014 Alessandro Bokan
#
# 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, e... | gpl-3.0 |
rabitt/motif | motif/feature_extractors/melodia.py | 1 | 2442 | """Melodia feature extractor.
"""
import numpy as np
from motif.core import FeatureExtractor
from motif.feature_extractors import utils
class MelodiaFeatures(FeatureExtractor):
'''Melodia feature extractor
Attributes
----------
ref_hz : float
Reference frequency (Hz) for converting to cents.... | mit |
ngugi/geonode | geonode/services/tests.py | 5 | 4297 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | gpl-3.0 |
endlessm/chromium-browser | build/android/gyp/zip.py | 3 | 2376 | #!/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.
"""Archives a set of files."""
import argparse
import os
import sys
import zipfile
from util import build_utils
def main(args):
... | bsd-3-clause |
bubenkoff/pylama | dummy.py | 3 | 3314 | #!/usr/bin/env python
# coding: utf-8
# (c) 2005 Divmod, Inc. See LICENSE file for details
class Message(object):
message = ''
message_args = ()
def __init__(self, filename, loc, use_column=True):
self.filename = filename
self.lineno = loc.lineno
self.col = getattr(loc, 'col_offse... | lgpl-3.0 |
firerszd/kbengine | kbe/src/lib/python/Lib/encodings/cp273.py | 212 | 14132 | """ Python Character Mapping Codec cp273 generated from 'python-mappings/CP273.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,errors='strict... | lgpl-3.0 |
redbear/micropython | esp8266/scripts/onewire.py | 8 | 3338 | # 1-Wire driver for MicroPython on ESP8266
# MIT license; Copyright (c) 2016 Damien P. George
import _onewire as _ow
class OneWireError(Exception):
pass
class OneWire:
SEARCH_ROM = const(0xf0)
MATCH_ROM = const(0x55)
SKIP_ROM = const(0xcc)
def __init__(self, pin):
self.pin = pin
... | mit |
blindroot/django | django/db/backends/base/base.py | 41 | 23063 | import copy
import time
import warnings
from collections import deque
from contextlib import contextmanager
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import utils
from django.db.backends.signals import connect... | bsd-3-clause |
luci/recipes-py | recipe_modules/runtime/api.py | 2 | 2238 | # Copyright 2017 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
from recipe_engine import recipe_api
from recipe_engine.internal.global_shutdown import GLOBAL_SHUTDOWN
class RuntimeApi(recipe_api.RecipeApi):... | apache-2.0 |
HealthAPI/helmet | node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/__init__.py | 574 | 21473 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | mit |
ujdhesa/unisubs | apps/teams/migrations/0118_teammember_created.py | 5 | 41404 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
for tm in orm['teams.TeamMember'].objects.all():
try:
... | agpl-3.0 |
bob-the-hamster/commandergenius | project/jni/python/src/Lib/test/test_iter.py | 80 | 28003 | # Test iterators.
import unittest
from test.test_support import run_unittest, TESTFN, unlink, have_unicode
# Test result of triple loop (too big to inline)
TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2),
(0, 1, 0), (0, 1, 1), (0, 1, 2),
(0, 2, 0), (0, 2, 1), (0, 2, 2),
(1, 0, 0), (1,... | lgpl-2.1 |
robhudson/django | django/template/response.py | 84 | 5682 | from django.http import HttpResponse
from django.utils import six
from .loader import get_template, select_template
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks']
def __init__(self... | bsd-3-clause |
shanemcd/ansible | lib/ansible/modules/system/locale_gen.py | 26 | 7451 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 |
g1o/trinityrnaseq | util/misc/TPM_weighted_gene_length.py | 1 | 4564 | #!/usr/bin/env python
# encoding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import os, sys, re
import logging
import argparse
import collections
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
logger = logging.getLogger(__file__)
de... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.