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 |
|---|---|---|---|---|---|
shakamunyi/sahara | sahara/tests/unit/service/validation/edp/test_job_executor.py | 3 | 16869 | # Copyright (c) 2013 Red Hat 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 or agreed to in writi... | apache-2.0 |
cetic/ansible | lib/ansible/modules/packaging/os/apt.py | 3 | 37562 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Flowroute LLC
# Written by Matthew Williams <matthew@flowroute.com>
# Based on yum module written by Seth Vidal <skvidal at fedoraproject.org>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import abs... | gpl-3.0 |
sallaire/Sick-Beard | sickbeard/scheduler.py | 30 | 2863 | # 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 the Lice... | gpl-3.0 |
zachallaun/zulip | api/integrations/asana/zulip_asana_config.py | 124 | 2157 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#... | apache-2.0 |
sunlianqiang/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## 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 Rights R... | lgpl-3.0 |
sankhesh/VTK | ThirdParty/Twisted/twisted/protocols/postfix.py | 71 | 3297 | # -*- test-case-name: twisted.test.test_postfix -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Postfix mail transport agent related protocols.
"""
import sys
import UserDict
import urllib
from twisted.protocols import basic
from twisted.protocols import policies
from twisted.internet... | bsd-3-clause |
dfunckt/django-rules | tests/testsuite/test_predicates.py | 1 | 12870 | import functools
from unittest import TestCase
from rules.predicates import (
NO_VALUE,
Predicate,
always_allow,
always_deny,
always_false,
always_true,
predicate,
)
class PredicateKwonlyTests(TestCase):
def test_predicate_kwargonly(self):
def p(foo, *, bar):
retur... | mit |
lavalamp-/ws-backend-community | rest/models/networks.py | 1 | 5535 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.db import models
from .organizations import Organization
from .base import BaseWsModel
class Network(BaseWsModel):
"""
This is a class for representing a network range that an organization knows about.
"""
# Columns
add... | gpl-3.0 |
mrkm4ntr/incubator-airflow | airflow/providers/microsoft/azure/operators/azure_cosmos.py | 7 | 2749 | #
# 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 |
vit2/vit-e2 | lib/python/Plugins/SystemPlugins/Videomode/plugin.py | 7 | 8970 | from Screens.Screen import Screen
from Plugins.Plugin import PluginDescriptor
from Components.SystemInfo import SystemInfo
from Components.ConfigList import ConfigListScreen
from Components.config import getConfigListEntry, config, ConfigBoolean, ConfigNothing, ConfigSlider
from Components.Label import Label
from Compo... | gpl-2.0 |
vlegoff/tsunami | src/secondaires/calendrier/masques/date/__init__.py | 1 | 3229 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 AYDIN Ali-Kémal
# 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
... | bsd-3-clause |
yade/trunk | examples/chained-cylinders/CohesiveCylinderSphere.py | 5 | 1855 | # encoding: utf-8
from yade import qt
from yade.gridpfacet import *
qt.View()
O.dt=5e-07
O.materials.append(CohFrictMat(young=8e5,poisson=0.3,density=4e3,frictionAngle=radians(30),normalCohesion=1e5,shearCohesion=1e5,momentRotationLaw=True,label='cylindermat'))
O.materials.append(CohFrictMat(young=8e5,poisson=0.3,d... | gpl-2.0 |
barykaed/Pelican-Test | activate/Lib/encodings/base64_codec.py | 201 | 1533 | """Python 'base64_codec' Codec - base64 content transfer encoding.
This codec de/encodes from bytes to bytes.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import base64
### Codec APIs
def base64_encode(input, errors='strict'):
assert errors == 'strict'
return (base64.encodebytes(input... | mit |
Lx37/pyqtgraph | examples/ROItypes.py | 24 | 3329 | #!/usr/bin/python -i
# -*- coding: utf-8 -*-
## Add path to library (just for examples; you do not need this)
import initExample
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
import pyqtgraph as pg
## create GUI
app = QtGui.QApplication([])
w = pg.GraphicsWindow(size=(800,800), border=True)
v = w.addVi... | mit |
samdoran/ansible | lib/ansible/modules/windows/win_iis_webapppool.py | 46 | 4506 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
#
# 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 t... | gpl-3.0 |
turon/openthread | tests/toranj/test-030-slaac-address-ncp.py | 1 | 14220 | #!/usr/bin/env python
#
# 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 |
doganov/edx-platform | scripts/runone.py | 182 | 3124 | #!/usr/bin/env python
import argparse
import os
import sys
# I want this:
# ERROR: test_update_and_fetch (edx-platform.cms.djangoapps.contentstore.tests.test_course_settings.CourseDetailsViewTest)
# to become:
# test --settings=cms.envs.test --pythonpath=. -s cms/djangoapps/contentstore/tests/test_course_settings... | agpl-3.0 |
Learningtribes/edx-platform | openedx/core/djangoapps/bookmarks/api.py | 44 | 4973 | """
Bookmarks Python API.
"""
from eventtracking import tracker
from . import DEFAULT_FIELDS, OPTIONAL_FIELDS
from xmodule.modulestore.django import modulestore
from django.conf import settings
from xmodule.modulestore.exceptions import ItemNotFoundError
from .models import Bookmark
from .serializers import BookmarkSer... | agpl-3.0 |
charmasaur/M-LOOP | mloop/controllers.py | 1 | 37336 | '''
Module of all the controllers used in M-LOOP. The controllers, as the name suggests, control the interface to the experiment and all the learners employed to find optimal parameters.
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import datetime
import mloop.utilities as ... | mit |
kbase/browse | ws-browser/views/mv/data/json-to-xml.py | 11 | 3668 | #!/usr/bin/env python
import io
import json
import sys
import os
from xml.dom import minidom
map_ids = ['00281', '00522', '00640', '00907pr', '01130', '03060', '04520', '05060',
'00290', '00523', '00641', '00907pu', '01140', '03070', '04530', '05110',
'00300', '00530', '00642', '00907sc', '01150', '03080', '04540'... | mit |
bop/hybrid | lib/python2.6/site-packages/django/contrib/formtools/wizard/views.py | 100 | 27474 | import re
from django import forms
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.forms import formsets, ValidationError
from django.views.generic import TemplateView
from django.utils.datastructures import SortedDict
from django.utils.decorators import classonlymethod
f... | gpl-2.0 |
curtisstpierre/django | django/utils/jslex.py | 251 | 7779 | """JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
from __future__ import unicode_literals
import re
class Tok(object):
"""
A specification for a token class.
"""
num = 0
def __init__(self, name, regex, next=None):
self.id = Tok.num
Tok.num += 1... | bsd-3-clause |
maxfischer2781/cpy2py | cpy2py_unittests/test_utility/test_compat.py | 1 | 2940 | from __future__ import print_function
import random
import unittest
from cpy2py.utility.compat import range, check_output, stringabc, unicode_str, str_to_bytes, long_int
from subprocess import CalledProcessError, STDOUT
class TestCheckOutput(unittest.TestCase):
def test_output(self):
"""Capture output fr... | apache-2.0 |
dfalt974/SickRage | lib/rtorrent/peer.py | 174 | 3699 | # 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 |
mikeboyer85/CS573FNC_Project | cnn_classifier_Tensorflow.py | 1 | 10706 | ###################################################
# FNC-1 Neural Network Implementation
# Mike Boyer
# 2017/11/06
#
# 2017/11/22 Mike Boyer simplify / rewrite again
###################################################
import numpy as np
import tensorflow as tf
import time
from datetime import datetime
from Vect... | apache-2.0 |
Zhongqilong/mykbengineer | kbe/src/lib/python/Lib/tkinter/test/support.py | 59 | 3128 | import sys
import tkinter
import unittest
from test.support import requires
class AbstractTkTest:
@classmethod
def setUpClass(cls):
cls._old_support_default_root = tkinter._support_default_root
destroy_default_root()
tkinter.NoDefaultRoot()
cls.root = tkinter.Tk()
cls.w... | lgpl-3.0 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/mpl_toolkits/axes_grid1/axes_divider.py | 1 | 29627 | """
The axes_divider module provide helper classes to adjust the positions of
multiple axes at the drawing time.
Divider: this is the class that is used calculates the axes
position. It divides the given rectangular area into several sub
rectangles. You initialize the divider by setting the horizontal
and... | gpl-3.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sklearn/datasets/species_distributions.py | 7 | 7758 | """
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | agpl-3.0 |
pombredanne/parakeet | parakeet/ndtypes/closure_type.py | 2 | 2981 | import ctypes
from core_types import Type, IncompatibleTypes, StructT, ImmutableT
from scalar_types import Int64
import type_conv
###########################################
#
# Closures!
#
###########################################
class ClosureT(StructT, ImmutableT):
def __init__(self, fn, arg_types):
... | bsd-3-clause |
teamfx/openjfx-10-dev-rt | modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/benchmark_runner/benchmark_results.py | 2 | 11922 | # Copyright (C) 2015 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | gpl-2.0 |
svartalf/python-wargaming | tests/test_wargaming.py | 2 | 10114 | import unittest
import six
import json
from datetime import datetime
from mock import patch, mock_open
from wargaming import WoT, WGN, WoTB, WoWP, WoWS, WoTX, settings
from wargaming.meta import MetaAPI, BaseAPI, WGAPI
from wargaming.settings import RETRY_COUNT, HTTP_USER_AGENT_HEADER
from wargaming.exceptions import ... | mit |
masayukig/tempest | tempest/api/compute/admin/test_server_diagnostics.py | 4 | 3388 | # Copyright 2017 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
Vizerai/grpc | src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py | 12 | 5511 | # Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/scripts/addons/io_export_dxf/model/migiusModel.py | 7 | 5111 | """
Created on Sep 2, 2011
@author: vencax
"""
from .model import DxfDrawing
try:
from . import dxfLibrary as DXF
#reload(DXF)
#reload(dxfLibrary)
#from dxfLibrary import *
except Exception:
raise Exception("No dxfLibrary.py module in Blender script folder found!")
#---------------------... | gpl-3.0 |
yonglehou/grpc | tools/buildgen/plugins/expand_bin_attrs.py | 9 | 2097 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
detiber/ansible | lib/ansible/executor/playbook_executor.py | 57 | 12811 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
EmuxEvans/Wox | PythonHome/Lib/site-packages/requests/packages/urllib3/contrib/ntlmpool.py | 714 | 4741 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... | mit |
kernc/scikit-learn | sklearn/neighbors/base.py | 30 | 30564 | """Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Jol... | bsd-3-clause |
zwadar/pyqode.python | setup.py | 1 | 2997 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This setup script packages pyqode.python
"""
import sys
from setuptools import setup, find_packages
from pyqode.python import __version__
from setuptools.command.test import test as TestCommand
#
# add ``build_ui command`` (optional, for development only)
# this comman... | mit |
wri/gfw-api | lib/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## 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 Rights R... | gpl-2.0 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/django/utils/ipv6.py | 44 | 8127 | # This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. https://github.com/google/ipaddr-py
# Licensed under the Apache License, Version 2.0 (the "License").
import re
from django.core.exceptions import ValidationError
from django.utils.six.moves import range
from django.utils.translation import ugettex... | apache-2.0 |
radiasoft/sirepo | tests/template/srw_generate_data/mask-example.py | 1 | 25057 | #!/usr/bin/env python
import os
try:
__IPYTHON__
import sys
del sys.argv[1:]
except:
pass
import srwl_bl
import srwlib
import srwlpy
import math
import srwl_uti_smp
def set_optics(v=None):
el = []
pp = []
names = ['VFM', 'VFM_HFM', 'HFM', 'HFM_Watchpoint', 'Watchpoint', 'Watchpoint_Mask', ... | apache-2.0 |
kalugny/pypachy | tests/test_client.py | 1 | 6196 | import io
import pytest
import python_pachyderm
from tests import util
"""Tests generic client functionality"""
def test_client_init_with_default_host_port():
client = python_pachyderm.Client()
assert client.address == "localhost:30650"
def test_client_init_with_args():
client = python_pachyderm.Clien... | mit |
hnjamba/onaclone | onadata/libs/mixins/multi_lookup_mixin.py | 11 | 1260 | from django.shortcuts import get_object_or_404
from rest_framework import serializers
from rest_framework.exceptions import ParseError
class MultiLookupMixin(object):
def get_object(self, queryset=None):
if queryset is None:
queryset = self.filter_queryset(self.get_queryset())
filter_k... | bsd-2-clause |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/tests/unit/gapic/googleads.v6/services/test_group_placement_view_service.py | 1 | 31380 | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
chrisfranzen/django | tests/regressiontests/signing/tests.py | 60 | 4580 | from __future__ import unicode_literals
import time
from django.core import signing
from django.test import TestCase
from django.utils.encoding import force_str
from django.utils import six
class TestSigner(TestCase):
def test_signature(self):
"signature() method should generate a signature"
si... | bsd-3-clause |
robertnishihara/ray | python/ray/tests/test_global_gc.py | 1 | 4655 | # coding: utf-8
import gc
import logging
import weakref
import numpy as np
import pytest
import ray
import ray.cluster_utils
from ray.test_utils import wait_for_condition
from ray.internal.internal_api import global_gc
logger = logging.getLogger(__name__)
def test_global_gc(shutdown_only):
cluster = ray.clust... | apache-2.0 |
onestarshang/flask_super_config | venv/lib/python2.7/site-packages/jinja2/constants.py | 1169 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | gpl-2.0 |
maximz/recal | course_selection/api.py | 1 | 12303 | # from django.db.models import Q
from tastypie.resources import ModelResource
from tastypie.constants import ALL, ALL_WITH_RELATIONS
from tastypie.cache import SimpleCache
from tastypie.cache import NoCache
from tastypie.authorization import Authorization
from tastypie.exceptions import Unauthorized
from tastypie impor... | mit |
Azure/azure-sdk-for-python | sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py | 1 | 2585 | # 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 may ... | mit |
dmacdonaldRobotiq/Robotiq | addons/robotiq_data/models/stock_picking.py | 1 | 1564 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it a... | agpl-3.0 |
gglyptodon/Enzymania | enzymania/EnzymaniaClasses_ali.py | 1 | 16709 | import pygame
import math
class Drawable(object):
ID = 0
def __init__(self, name="",
x=0, y=0, xvel=1.0, yvel=1.0,
angle= math.pi/2, xsize=10, ysize=10,
color=(0, 255, 0), shapeStr="rectangle"):
Drawable.ID += 1
self.id = Drawable.ID
... | gpl-3.0 |
supergis/QGIS | python/plugins/db_manager/db_plugins/spatialite/connector.py | 9 | 29735 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
willusher/ansible-modules-core | cloud/rackspace/rax_scaling_group.py | 51 | 14507 | #!/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 |
wimnat/ansible | test/lib/ansible_test/_data/pytest/plugins/ansible_pytest_collections.py | 18 | 2763 | """Enable unit testing of Ansible collections. PYTEST_DONT_REWRITE"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
# set by ansible-test to a single directory, rather than a list of directories as supported by Ansible itself
ANSIBLE_COLLECTIONS_PATH = os.path.join(... | gpl-3.0 |
RedstonerServer/redstoner-utils | forcefield.py | 1 | 7861 | #pylint: disable = F0401
import thread
from helpers import *
from org.bukkit.util import Vector
from math import sin
ff_perm = "utils.forcefield"
pass_perm = "utils.forcefield.ignore"
ff_prefix = "&8[&bFF&8] "
ff_users = []
fd = 6 # forcefield distance
Xv = 2.95 / fd # used in move_away(), this ... | mit |
sdulal/oppia | extensions/interactions/SetInput/SetInput.py | 17 | 1211 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
FlaPer87/django-nonrel | tests/regressiontests/templates/parser.py | 14 | 2618 | """
Testing some internals of the template processing. These are *not* examples to be copied in user code.
"""
token_parsing=r"""
Tests for TokenParser behavior in the face of quoted strings with spaces.
>>> from django.template import TokenParser
Test case 1: {% tag thevar|filter sometag %}
>>> p = TokenParser("t... | bsd-3-clause |
YehudaItkin/virt-test | virttest/libvirt_xml/nwfilter_protocols/base.py | 23 | 3983 | """
Common base classes for filter rule protocols
"""
import logging
from StringIO import StringIO
from virttest import xml_utils
from virttest.libvirt_xml import base, xcepts, accessors
class UntypedDeviceBase(base.LibvirtXMLBase):
"""
Base class implementing common functions for all rule protocol XML w/o ... | gpl-2.0 |
dbentley/pants | tests/python/pants_test/backend/project_info/tasks/test_eclipse_integration.py | 24 | 3037 | # 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 os
from pant... | apache-2.0 |
PAIR-code/lit | lit_nlp/components/word_replacer_test.py | 1 | 8052 | # Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
Allow2CEO/browser-ios | brave/node_modules/ad-block/vendor/depot_tools/third_party/boto/provider.py | 51 | 14660 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright 2010 Google Inc.
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated document... | mpl-2.0 |
ian-garrett/meetMe | env/lib/python3.4/site-packages/pyasn1/type/namedval.py | 172 | 2163 | # ASN.1 named integers
from pyasn1 import error
__all__ = [ 'NamedValues' ]
class NamedValues:
def __init__(self, *namedValues):
self.nameToValIdx = {}; self.valToNameIdx = {}
self.namedValues = ()
automaticVal = 1
for namedValue in namedValues:
if isinstance(na... | artistic-2.0 |
tecnovert/particl-core | test/functional/rpc_net.py | 4 | 10658 | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC calls related to net.
Tests correspond to code in rpc/net.cpp.
"""
from decimal import Decim... | mit |
arximboldi/pigeoncide | src/game/flock.py | 1 | 9521 | #
# Copyright (C) 2009 Juan Pedro Bolivar Puente, Alberto Villegas Erce
#
# This file is part of Pigeoncide.
#
# Pigeoncide 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
# Lic... | gpl-3.0 |
richbs/colourlens | colourlens/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/escprober.py | 2936 | 3187 | ######################## 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... | mit |
sivaprakashniet/push_pull | p2p/lib/python2.7/site-packages/celery/tests/events/test_events.py | 1 | 8544 | from __future__ import absolute_import
import socket
from mock import Mock
from celery.events import Event
from celery.tests.case import AppCase
class MockProducer(object):
raise_on_publish = False
def __init__(self, *args, **kwargs):
self.sent = []
def publish(self, msg, *args, **kwargs):
... | bsd-3-clause |
taigaio/taiga-back | taiga/users/migrations/0013_auto_20150901_1600.py | 1 | 1496 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.postgres.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0012_auto_20150812_1142'),
]
operations = [
migrations.AlterField(
... | agpl-3.0 |
gpitel/pyjs | pyjswidgets/pyjamas/Canvas/VMLContext.py | 8 | 2275 | """
* Copyright 2008 Google Inc.
* Copyright 2011 Bob Hampton
*
* 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 |
tymofij/adofex | transifex/resources/migrations/0011_remove_deprecated_tables.py | 3 | 17280 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.db.transaction import commit_on_success
DEPRECATED_TABLES = [
"addons_locks_pofile_lock",
"codebases_unit",
"django_authopenid_association",
"django_authopenid_nonce",
... | gpl-3.0 |
tqchen/tvm | vta/scripts/tune_conv2d_transpose.py | 3 | 5439 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
chriskmanx/qmole | QMOLEDEV64/nmap-4.76/zenmap/build/lib/radialnet/gui/Dialogs.py | 2 | 1521 | # vim: set fileencoding=utf-8 :
# Copyright (C) 2008 Insecure.Com LLC.
#
# Author: João Paulo de Souza Medeiros <ignotus21@gmail.com>
#
# 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 ve... | gpl-3.0 |
teltek/edx-platform | lms/djangoapps/ccx/modulestore.py | 24 | 13437 | # -*- coding: utf-8 -*-
"""A modulestore wrapper
It will 'unwrap' ccx keys on the way in and re-wrap them on the way out
In practical terms this means that when an object is retrieved from modulestore
using a CCXLocator or CCXBlockUsageLocator as the key, the equivalent
CourseLocator or BlockUsageLocator will actuall... | agpl-3.0 |
laurent-george/weboob | docs/source/genapi.py | 7 | 1446 | #!/usr/bin/env python
import os
def genapi():
os.system('rm -rf api')
os.system('mkdir api')
os.chdir('api')
for root, dirs, files in os.walk('../../../weboob/'):
root = root.split('/', 4)[-1]
if root.startswith('applications'):
continue
if root.strip():
... | agpl-3.0 |
axitkhurana/stem | test/unit/response/events.py | 4 | 45081 | """
Unit tests for the stem.response.events classes.
"""
import datetime
import threading
import unittest
import stem.response
import stem.response.events
import stem.util.log
from stem import * # enums and exceptions
from test import mocking
# ADDRMAP event
ADDRMAP = '650 ADDRMAP www.atagar.com 75.119.206.243 "2... | lgpl-3.0 |
abhiQmar/servo | tests/wpt/web-platform-tests/mathml/tools/utils/mathfont.py | 101 | 6209 | from __future__ import print_function
import fontforge
from misc import MathMLAssociationCopyright
em = 1000
def create(aName):
print("Generating %s.woff..." % aName, end="")
mathFont = fontforge.font()
mathFont.fontname = aName
mathFont.familyname = aName
mathFont.fullname = aName
mathFont.co... | mpl-2.0 |
keedio/hue | desktop/core/src/desktop/api2.py | 21 | 4908 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
deevarvar/myLab | baidu_code/soap_mockserver/spyne/interface/xml_schema/model.py | 1 | 15307 |
#
# spyne - Copyright (C) Spyne contributors.
#
# 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
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | mit |
noba3/KoTos | addons/script.module.youtube.dl/lib/youtube_dl/extractor/chirbit.py | 136 | 2584 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
)
class ChirbitIE(InfoExtractor):
IE_NAME = 'chirbit'
_VALID_URL = r'https?://(?:www\.)?chirb\.it/(?:(?:wp|pl)/|fb_chirbit_player\.swf\?key=)?(?P<id>[\da-zA-Z]+... | gpl-2.0 |
bhilburn/gnuradio | gr-wxgui/python/wxgui/scopesink2.py | 92 | 1447 | #
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
kaedroho/wagtail | wagtail/core/tests/test_translatablemixin.py | 2 | 5461 | from unittest.mock import patch
from django.conf import settings
from django.core import checks
from django.test import TestCase
from wagtail.core.models import Locale
from wagtail.tests.i18n.models import InheritedTestModel, TestModel
def make_test_instance(model=None, **kwargs):
if model is None:
mode... | bsd-3-clause |
AlexOugh/horizon | horizon/test/tests/messages.py | 31 | 2239 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
ddksr/toshlayzer | lib/__init__.py | 1 | 6761 | import json
import re
import datetime
class Config:
EXCEPTION_MODE_IGNORE = 'ignore'
EXCEPTION_MODE_HIDE = 'hide'
EXCEPTION_MODES = (EXCEPTION_MODE_IGNORE, EXCEPTION_MODE_HIDE, )
TEMPLATE_PLAN = lambda: { 'tags': [], 'value': 0, 'date': None}
TEMPLATE_EXCEPTION = lambda: { 'tag': '', 'mode': None }
ARG_OPTIONS... | gpl-3.0 |
seocam/django | django/http/multipartparser.py | 105 | 24204 | """
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
from __future__ import unicode_literals
import base64
import binascii
import cgi
import sys
from django.conf import settings
from django.core.exceptions imp... | bsd-3-clause |
googleapis/proto-plus-python | tests/test_modules.py | 1 | 2901 | # Copyright 2018 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 |
ghchinoy/tensorflow | tensorflow/contrib/keras/api/keras/applications/resnet50/__init__.py | 37 | 1106 | # 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 |
googleapis/googleapis-gen | google/cloud/asset/v1p2beta1/asset-v1p2beta1-py/google/cloud/asset_v1p2beta1/types/assets.py | 1 | 6707 | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
dumoulinj/ers | ers_backend/dataset_manager/models.py | 1 | 29490 | import os
import logging
import collections
import shutil
from PIL import Image, ImageStat
from converter.ffmpeg import FFMpeg
import cv2
from cv2 import cv
from django.db import models
from swampdragon.models import SelfPublishModel
from django_enumfield import enum
from jsonfield.fields import JSONField
from django.c... | mit |
stardust66/math3d | app.py | 2 | 6426 | # MIT License
#
# Copyright (c) 2017 Luming Chen
#
# 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, ... | mit |
michael-dev2rights/ansible | lib/ansible/modules/network/f5/bigip_device_ntp.py | 16 | 7567 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks 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 |
pminervini/DeepKGC | data/util.py | 2 | 15516 | #!/usr/bin/python -uB
# -*- coding: utf-8 -*-
import numpy as np
import scipy
import scipy.sparse as sp
import theano
import socket
import copy, pickle, codecs, sys
import logging
from ConfigParser import SafeConfigParser
def configuration(file='config.ini', encoding='utf-8'):
parser = SafeConfigParser()
wi... | mit |
Tatsh/youtube-dl | youtube_dl/extractor/vh1.py | 30 | 1541 | # coding: utf-8
from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
class VH1IE(MTVServicesInfoExtractor):
IE_NAME = 'vh1.com'
_FEED_URL = 'http://www.vh1.com/feeds/mrss/'
_TESTS = [{
'url': 'http://www.vh1.com/episodes/0umwpq/hip-hop-squares-kent-jones-vs-nick-young... | unlicense |
jymannob/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/cbsnews.py | 16 | 3353 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
class CBSNewsIE(InfoExtractor):
IE_DESC = 'CBS News'
_VALID_URL = r'http://(?:www\.)?cbsnews\.com/(?:[^/]+/)+(?P<id>[\da-z_-]+)'
_TESTS = [
{
'url': 'http://www.cbsnews.... | gpl-3.0 |
RosesTheN00b/BudgetButlerWeb | butler_offline/test/views/sparen/add_depotauszug_test.py | 1 | 15128 | from butler_offline.test.core.file_system_stub import FileSystemStub
from butler_offline.test.RequestStubs import GetRequest
from butler_offline.test.RequestStubs import PostRequest
from butler_offline.test.RequestStubs import VersionedPostRequest
from butler_offline.views.sparen import add_depotauszug
from butler_offl... | agpl-3.0 |
Jgarcia-IAS/localizacion | openerp/addons-extra/odoo-pruebas/odoo-server/addons/website_twitter/models/twitter_config.py | 377 | 2095 | import logging
from openerp.osv import fields, osv
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
class twitter_config_settings(osv.osv_memory):
_inherit = 'website.config.settings'
_columns = {
'twitter_api_key': fields.related(
'website_id', 'twitter_a... | agpl-3.0 |
johnswanson/pypicloud | pypicloud/views/api.py | 1 | 6626 | """ Views for simple api calls that return json data """
import posixpath
import logging
import six
from contextlib import closing
from paste.httpheaders import CONTENT_DISPOSITION
from pyramid.httpexceptions import HTTPNotFound, HTTPForbidden, HTTPBadRequest
from pyramid.security import NO_PERMISSION_REQUIRED, rememb... | mit |
multiSnow/secure-gappproxy | localproxy/synctime.py | 1 | 4083 | #! /usr/bin/env python
# coding=utf-8
#======================================================================
# SecureGAppProxy is a security-strengthened version of GAppProxy.
# http://secure-gappproxy.googlecode.com
# This file is a part of SecureGAppProxy.
# Copyright (C) 2011 nleven <www.nleven.com i@nleven.com>
#... | gpl-3.0 |
mozilla/verbatim | vendor/lib/python/django/contrib/formtools/tests/wizard/wizardtests/tests.py | 78 | 15534 | from __future__ import with_statement
import os
from django import forms
from django.test import TestCase
from django.test.client import RequestFactory
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.formtools.wizard.views import CookieWizardView
from django.contrib.for... | gpl-2.0 |
Tesora/tesora-horizon | openstack_dashboard/settings.py | 1 | 12249 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_custom_ip_prefixes_operations.py | 1 | 27129 | # 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 may ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.