repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
smartanthill/plugin-handler-compiler | smartanthill_phc/antlr_parser/CVisitor.py | 2 | 11540 | # Generated from java-escape by ANTLR 4.5
from antlr4 import *
# This class defines a complete generic visitor for a parse tree produced by CParser.
class CVisitor(ParseTreeVisitor):
# Visit a parse tree produced by CParser#FunctionExpression.
def visitFunctionExpression(self, ctx):
return self.visit... | gpl-2.0 |
apollo13/ansible | test/support/integration/plugins/modules/azure_rm_mariadbfirewallrule_info.py | 29 | 6309 | #!/usr/bin/python
#
# Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.com>
# Copyright (c) 2019 Matti Ranta, (@techknowlogick)
#
# 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
AN... | gpl-3.0 |
nert-gu/Xposition | tests/plugins/images/test_views.py | 1 | 9004 | import base64
import os
from io import BytesIO
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.urls import reverse
from PIL import Image
from wiki.core.plugins import registry as plugin_registry
from wiki.models import URLPath
from wiki.plugins.images import models
from wiki.plugins.images.... | gpl-3.0 |
kongseokhwan/kulcloud-iitp-neutron | neutron/plugins/ml2/managers.py | 1 | 36204 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
goliveirab/odoo | openerp/addons/base/tests/test_view_validation.py | 396 | 3427 | # This test can be run stand-alone with something like:
# > PYTHONPATH=. python2 openerp/tests/test_view_validation.py
from lxml import etree
from StringIO import StringIO
import unittest2
from openerp.tools.view_validation import (valid_page_in_book, valid_att_in_form, valid_type_in_colspan,
... | agpl-3.0 |
mwest1066/PrairieLearn | exampleCourse/questions/demoDrawingInclinedPlane/server.py | 3 | 2014 | import random
import math
import numpy as np
def generate(data):
height_canvas = 400
data["params"]["height_canvas"] = height_canvas
a = random.choice([80,100,120])
b = random.choice([140,150,160])
c = random.choice([180,190,200,210])
data["params"]["a"] = a
da... | agpl-3.0 |
jaimahajan1997/sympy | sympy/polys/fglmtools.py | 21 | 4396 | """Implementation of matrix FGLM Groebner basis conversion algorithm. """
from __future__ import print_function, division
from sympy.polys.monomials import monomial_mul, monomial_div
from sympy.core.compatibility import range
def matrix_fglm(F, ring, O_to):
"""
Converts the reduced Groebner basis ``F`` of a ... | bsd-3-clause |
chrisk44/android_kernel_lge_hammerhead | scripts/gcc-wrapper.py | 181 | 3495 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
arokem/scipy | scipy/sparse/linalg/tests/test_expm_multiply.py | 1 | 9651 | """Test functions for the sparse.linalg._expm_multiply module
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (assert_allclose, assert_, assert_equal,
suppress_warnings)
from scipy.sparse import SparseEfficiencyWarning
import... | bsd-3-clause |
liu602348184/django | django/template/backends/django.py | 240 | 5574 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import sys
import warnings
from importlib import import_module
from pkgutil import walk_packages
from django.apps import apps
from django.conf import settings
from django.template import TemplateDoesN... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/232_test_os.py | 4 | 10718 | # As a test suite for the os module, this is woefully inadequate, but this
# does add tests for a few functions which have been determined to be more
# more portable than they had been thought to be.
import os
import unittest
import warnings
from test import test_support
warnings.filterwarnings("ignore", "tempnam", R... | gpl-3.0 |
shteeven/conference | main.py | 1 | 1566 | #!/usr/bin/env python
"""
main.py -- Udacity conference server-side Python App Engine
HTTP controller handlers for memcache & task queue access
"""
__author__ = 'stevenbarnhurst@gmail.com (Steven Barnhurst)'
import webapp2
from google.appengine.api import app_identity
from google.appengine.api import mail
from ... | apache-2.0 |
BonexGu/Blik2D-SDK | Blik2D/addon/opencv-3.1.0_for_blik/modules/ts/misc/run_android.py | 7 | 8267 | #!/usr/bin/env python
import sys
from run_utils import *
from run_suite import TestSuite
def exe(program):
return program + ".exe" if hostos == 'nt' else program
class ApkInfo:
def __init__(self):
self.pkg_name = None
self.pkg_target = None
self.pkg_runner = None
def forcePackage... | mit |
willingc/pip | tests/functional/test_list.py | 5 | 5581 | import os
import pytest
def test_list_command(script, data):
"""
Test default behavior of list command.
"""
script.pip(
'install', '-f', data.find_links, '--no-index', 'simple==1.0',
'simple2==3.0',
)
result = script.pip('list')
assert 'simple (1.0)' in result.stdout, str(... | mit |
SAM-IT-SA/odoo | addons/fleet/__openerp__.py | 267 | 2245 | # -*- 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 |
antb/TPT----My-old-mod | src/python/stdlib/test/test_bigaddrspace.py | 133 | 1303 | from test import test_support
from test.test_support import bigaddrspacetest, MAX_Py_ssize_t
import unittest
import operator
import sys
class StrTest(unittest.TestCase):
@bigaddrspacetest
def test_concat(self):
s1 = 'x' * MAX_Py_ssize_t
self.assertRaises(OverflowError, operator.add, s1, '?')... | gpl-2.0 |
Paul-Ezell/cinder-1 | cinder/api/contrib/image_create.py | 44 | 1062 | # Copyright (c) 2012 NTT.
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | apache-2.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/django/contrib/gis/measure.py | 118 | 12286 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# 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,
#... | bsd-3-clause |
willingc/oh-mainline | vendor/packages/Django/tests/modeltests/field_subclassing/fields.py | 115 | 2164 | from __future__ import unicode_literals
import json
from django.db import models
from django.utils.encoding import force_text
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Small(object):
"""
A simple class to show that non-trivi... | agpl-3.0 |
benthomasson/ansible | lib/ansible/modules/network/avi/avi_controllerproperties.py | 7 | 13790 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.2
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
hdmetor/scikit-learn | examples/ensemble/plot_voting_probas.py | 316 | 2824 | """
===========================================================
Plot class probabilities calculated by the VotingClassifier
===========================================================
Plot the class probabilities of the first sample in a toy dataset
predicted by three different classifiers and averaged by the
`VotingC... | bsd-3-clause |
ego008/ijd8 | bae/pygments/lexers/shell.py | 71 | 14782 | # -*- coding: utf-8 -*-
"""
pygments.lexers.shell
~~~~~~~~~~~~~~~~~~~~~
Lexers for various shells.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu... | mit |
KaranToor/MA450 | google-cloud-sdk/platform/gsutil/gslib/commands/cp.py | 3 | 56552 | # -*- coding: utf-8 -*-
# Copyright 2011 Google Inc. All Rights Reserved.
# Copyright 2011, Nexenta Systems 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/... | apache-2.0 |
netroby/vitess | test/topo_flavor/zookeeper.py | 2 | 2788 | #!/usr/bin/env python
# Copyright 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.
import logging
import os
import json
import server
class ZkTopoServer(server.TopoServer):
"""Implementation of TopoServer for ZooKeeper"""... | bsd-3-clause |
mscuthbert/abjad | abjad/tools/scoretools/set_measure_denominator_and_adjust_numerator.py | 2 | 1791 | # -*- encoding: utf-8 -*-
from abjad.tools import indicatortools
from abjad.tools import durationtools
from abjad.tools import mathtools
from abjad.tools.topleveltools import attach
from abjad.tools.topleveltools import detach
# TODO: implement scoretools.set_measure_denominator_and_adjust_contents().
def set_measure... | gpl-3.0 |
cg31/tensorflow | tensorflow/contrib/tensor_forest/python/ops/inference_ops.py | 15 | 2143 | # 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 |
CubicERP/geraldo | site/newsite/site-geraldo/django/contrib/sitemaps/views.py | 55 | 1891 | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.utils.encoding import smart_str
from django.core.paginator import EmptyPage, PageNotAnInteger
def index(request, sitemaps):
current_site = S... | lgpl-3.0 |
Tiger66639/ansible-modules-core | network/basics/uri.py | 14 | 19263 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Romeo Theriault <romeot () hawaii.edu>
#
# 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 |
tyb0807/angr | angr/simos/cgc.py | 1 | 6180 |
import logging
import claripy
from cle import BackedCGC
from ..misc import IRange
from ..procedures import SIM_LIBRARIES as L
from ..state_plugins import SimActionData
from .. import sim_options as o
from .userland import SimUserland
_l = logging.getLogger('angr.simos.cgc')
class SimCGC(SimUserland):
"""
... | bsd-2-clause |
SOKP/external_chromium_org | third_party/protobuf/python/google/protobuf/internal/unknown_fields_test.py | 215 | 6585 | #! /usr/bin/python
# -*- coding: utf-8 -*-
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following cond... | bsd-3-clause |
bmaggard/luigi | luigi/task.py | 1 | 20793 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
Clivern/PyArchiver | setup.py | 1 | 1098 | """
PyArchiver Compression and Archiving Library
@author: Clivern U{hello@clivern.com}
"""
from setuptools import setup
from pyarchiver import __VERSION__
import os
# Utility function to read the README file.
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "... | mit |
hryamzik/ansible | docs/bin/dump_keywords.py | 19 | 2987 | #!/usr/bin/env python
import optparse
import re
from distutils.version import LooseVersion
import jinja2
import yaml
from jinja2 import Environment, FileSystemLoader
from ansible.playbook import Play
from ansible.playbook.block import Block
from ansible.playbook.role import Role
from ansible.playbook.task import Tas... | gpl-3.0 |
NullSoldier/django | django/db/models/sql/aggregates.py | 57 | 4842 | """
Classes to represent the default SQL aggregate functions
"""
import copy
import warnings
from django.db.models.fields import FloatField, IntegerField
from django.db.models.lookups import RegisterLookupMixin
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cached_pr... | bsd-3-clause |
Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/twilio/rest/resources/pricing/phone_numbers.py | 35 | 2261 | from .. import NextGenInstanceResource, NextGenListResource
class PhoneNumbers(object):
"""Holds references to the Number pricing resources."""
name = "Number"
key = "Number"
def __init__(self, base_uri, auth, timeout):
self.uri = "%s/PhoneNumbers" % base_uri
self.countries = PhoneNu... | gpl-2.0 |
biospi/seamass-windeps | src/boost_1_57_0/tools/build/src/build/engine.py | 14 | 7374 | # Copyright Pedro Ferreira 2005.
# Copyright Vladimir Prus 2007.
# Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
bjam_interface = __import__('bjam')
import operator
import re
import b2.build.property_set as prope... | apache-2.0 |
sergiohgz/incubator-airflow | airflow/utils/dates.py | 4 | 9493 | # -*- 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 |
waheedahmed/edx-platform | openedx/core/lib/xblock_pipeline/finder.py | 27 | 4672 | """
Django pipeline finder for handling static assets required by XBlocks.
"""
from datetime import datetime
import os
from pkg_resources import resource_exists, resource_listdir, resource_isdir, resource_filename
from xblock.core import XBlock
from django.contrib.staticfiles import utils
from django.contrib.staticfi... | agpl-3.0 |
openstack/packstack | packstack/installer/core/sequences.py | 6 | 3650 | # -*- 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 |
havard024/prego | venv/lib/python2.7/site-packages/django/db/models/sql/aggregates.py | 195 | 3977 | """
Classes to represent the default SQL aggregate functions
"""
from django.db.models.fields import IntegerField, FloatField
# Fake fields used to identify aggregate types in data-conversion operations.
ordinal_aggregate_field = IntegerField()
computed_aggregate_field = FloatField()
class Aggregate(object):
"""... | mit |
XiaosongWei/chromium-crosswalk | tools/diagnose-me.py | 128 | 3534 | #!/usr/bin/python
# Copyright (c) 2012 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.
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
import os
import subprocess
import sys
all_chec... | bsd-3-clause |
mrquim/repository.mrquim | plugin.video.live.magellan/pyaesnew/aes.py | 177 | 60310 | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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, mod... | gpl-2.0 |
stshine/servo | tests/wpt/web-platform-tests/old-tests/webdriver/user_input/clear_test.py | 142 | 2601 | # -*- mode: python; fill-column: 100; comment-column: 100; -*-
import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from selenium.common import exceptions
class ElementClearTest(base_test.WebDriverBaseTest):
def test_writable_text_input_eleme... | mpl-2.0 |
myrdd/firefox-ui-tests | create_venv.py | 2 | 3999 | #!/usr/bin/env python
# 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/.
"""
The script can be used to setup a virtual environment for running Firefox UI Tests.
It will a... | mpl-2.0 |
Senseg/Py4A | python-modules/twisted/twisted/names/dns.py | 49 | 53596 | # -*- test-case-name: twisted.names.test.test_dns -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
@author: Moshe Zadka
@author: Jean-Paul Calderone
"""
__all__ = [
'IEncodable', 'IRecord'... | apache-2.0 |
fangxingli/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/authn_context/timesync.py | 37 | 107827 | #!/usr/bin/env python
#
# Generated Thu May 16 21:05:38 2013 by parse_xsd.py version 0.5.
#
import saml2
from saml2 import SamlBase
NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken'
class PhysicalVerification(SamlBase):
"""The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:
Physical... | apache-2.0 |
anurag-ks/eden | modules/unit_tests/s3/s3hierarchy.py | 14 | 78245 | # -*- coding: utf-8 -*-
#
# S3Hierarchy Unit Tests
#
# To run this script use:
# python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3hierarchy.py
#
import unittest
from lxml import etree
from s3dal import Field, Query
from s3.s3utils import *
from s3.s3rest import s3_request
from s3 import FS, S3... | mit |
chromium2014/src | tools/json_schema_compiler/ppapi_generator.py | 37 | 10976 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import datetime
import os.path
import sys
import code
import cpp_util
import model
try:
import jinja2
except ImportError:
sys.path.a... | bsd-3-clause |
openhealthcare/openspirometer | lib/python2.7/site-packages/setuptools/_backport/hashlib/__init__.py | 77 | 5011 | # $Id$
#
# Copyright (C) 2005 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
__doc__ = """hashlib module - A common interface to many hash functions.
new(name, string='') - returns a new hash object implementing the
given hash function; initializing th... | agpl-3.0 |
BDI-pathogens/phyloscanner | tools/EstimateReadCountPerWindow.py | 1 | 14576 | #!/usr/bin/env python
from __future__ import print_function
## Author: Chris Wymant, c.wymant@imperial.ac.uk
## Acknowledgement: I wrote this while funded by ERC Advanced Grant PBDR-339251
##
## Overview:
ExplanatoryMessage = '''For each bam file in the list given as input, this
script does the following. The distribu... | gpl-3.0 |
FreeCX/shakalator | main.py | 1 | 3902 | from flask import Flask, render_template, redirect, url_for
from flask import request, jsonify, send_file
from multiprocessing import Process, Pipe
from werkzeug import secure_filename
from os import path, system, remove
from hashlib import md5
import time
# 5m
TIME_DELTA = 5 * 60
""" инициализируем fl... | cc0-1.0 |
AnhellO/DAS_Sistemas | Ene-Jun-2020/garcia-morales-luis-fernando/1er Parcial/Primer Parcial/Ejercicio2.py | 1 | 1329 | import abc
from Ejercicio1 import Page
class PageComponent(metaclass=abc.ABCMeta):
@abc.abstractmethod
def ContenidoPagina():
pass
class TagOpen(PageComponent):
def ContenidoPagina(self):
return '<p'
class Estilo(PageComponent):
def __init__(self, style: PageComponent):
self.st... | mit |
aaniin/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/base/Graphics.py | 41 | 22080 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
yanheven/keystone | keystone/tests/unit/test_v3_identity.py | 6 | 24955 | # Copyright 2012 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 law or agreed to in... | apache-2.0 |
anand-c-goog/tensorflow | tensorflow/python/kernel_tests/logging_ops_test.py | 29 | 2411 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
lukas/scikit-class | examples/keras-cnn/resnet-cnn.py | 2 | 1929 | from keras.datasets import mnist
from keras.models import Sequential, Model
from keras.layers import Conv2D, MaxPooling2D, Dropout, Dense, Flatten, Input, Add
from keras.utils import np_utils
from wandb.keras import WandbCallback
import wandb
import os
run = wandb.init()
config = run.config
config.first_layer_convs = ... | gpl-2.0 |
bigswitch/nova | nova/api/openstack/compute/hypervisors.py | 3 | 8033 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
joeyjojo/django_offline | src/django/contrib/flatpages/forms.py | 79 | 1727 | from django import forms
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext, ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
help_text = _("... | mit |
0x7678/youtube-dl | youtube_dl/extractor/infoq.py | 36 | 2115 | from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
)
class InfoQIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?infoq\.com/[^/]+/(?P<id>[^/]+)$'
_TEST = {
'url': 'http://www.infoq.com/presentations/A-Few-of-My... | unlicense |
andmos/ansible | lib/ansible/plugins/callback/context_demo.py | 118 | 1793 | # (C) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
# (c) 2017 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
DOCUMENTATION = '''
callback: context_demo
type... | gpl-3.0 |
michelts/lettuce | tests/integration/lib/Django-1.3/django/utils/tree.py | 310 | 5778 | """
A class for storing a tree graph. Primarily used for filter constructs in the
ORM.
"""
from django.utils.copycompat import deepcopy
class Node(object):
"""
A single internal node in the tree graph. A Node should be viewed as a
connection (the root) with the children being either leaf nodes or other
... | gpl-3.0 |
dsquareindia/gensim | gensim/models/coherencemodel.py | 8 | 10693 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Module for calculating topic coherence in python. This is the implementation of
the four stage topic coherence pipeline from the pap... | lgpl-2.1 |
evanma92/routeh | flask/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... | bsd-3-clause |
jphilipsen05/zulip | zerver/management/commands/change_user_email.py | 41 | 1146 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_change_user_email
from zerver.models import UserProfile, get_user_profile_by_email
class Comman... | apache-2.0 |
didzis/CAMR | stanfordnlp/unidecode/x0ca.py | 253 | 5007 | data = (
'jjael', # 0x00
'jjaelg', # 0x01
'jjaelm', # 0x02
'jjaelb', # 0x03
'jjaels', # 0x04
'jjaelt', # 0x05
'jjaelp', # 0x06
'jjaelh', # 0x07
'jjaem', # 0x08
'jjaeb', # 0x09
'jjaebs', # 0x0a
'jjaes', # 0x0b
'jjaess', # 0x0c
'jjaeng', # 0x0d
'jjaej', # 0x0e
'jjaec', # 0x... | gpl-2.0 |
ritchyteam/odoo | addons/account_payment/wizard/__init__.py | 436 | 1144 | # -*- 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 |
apocalypsebg/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py | 384 | 3903 | #########################################################################
#
# 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 |
mixturemodel-flow/tensorflow | tensorflow/contrib/training/python/training/sampling_ops_threading_test.py | 129 | 2884 | # 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 |
andrewsy97/Treehacks | websocket/_abnf.py | 52 | 12382 | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
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, ... | mit |
A-HostMobile/MobileApp | node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 2710 | 5094 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... | apache-2.0 |
fracpete/python-weka-wrapper | tests/wekatests/experiments.py | 2 | 8264 | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# b... | gpl-3.0 |
j-greffe/mbed-os | tools/host_tests/host_tests_plugins/host_test_plugins.py | 92 | 4881 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
walbert947/ansible-modules-core | network/nxos/nxos_vrrp.py | 10 | 13515 | #!/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 |
haxoza/django | django/core/management/commands/sendtestemail.py | 349 | 1449 | import socket
from django.core.mail import mail_admins, mail_managers, send_mail
from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = "Sends a test email to the email addresses specified as arguments."
missing_args_message = "You must specif... | bsd-3-clause |
gitgik/flask-rest-api | migrations/env.py | 557 | 2883 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... | mit |
RudoCris/horizon | openstack_dashboard/dashboards/identity/roles/forms.py | 91 | 1701 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 |
apdavison/python-neo | neo/core/block.py | 3 | 4982 | '''
This module defines :class:`Block`, the main container gathering all the data,
whether discrete or continous, for a given recording session. base class
used by all :module:`neo.core` classes.
:class:`Block` derives from :class:`Container`,
from :module:`neo.core.container`.
'''
from datetime import datetime
from... | bsd-3-clause |
eceglov/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/ez_setup.py | 454 | 10334 | #!python
# This file was obtained from:
# http://peak.telecommunity.com/dist/ez_setup.py
# on 2011/1/21.
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup... | bsd-3-clause |
JaDogg/__py_playground | reference/parsley/examples/test_iso8601.py | 3 | 1888 | import datetime
import unittest
import pytest
pytz = pytest.importorskip('pytz')
from iso8601 import DateTimeParser
class TestDatetimeParsing(unittest.TestCase):
def test_date(self):
self.assertEqual(
datetime.date(2001, 12, 25),
DateTimeParser('2001-12-25').date())
def test... | mit |
jhawkesworth/ansible-modules-extras | cloud/amazon/ec2_vpc_dhcp_options_facts.py | 31 | 5118 | #!/usr/bin/python
#
# This is a 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.
#
# This Ansible library is distributed in the hope that i... | gpl-3.0 |
pchavanne/yadll | yadll/model.py | 2 | 16213 | # -*- coding: UTF-8 -*-
import pickle
import sys
import yadll
from .layers import *
from .exceptions import *
import logging
logger = logging.getLogger(__name__)
def save_model(model, file=None):
"""
Save the model to file with cPickle
This function is used by the training function to save the model.
... | mit |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/traits-4.3.0-py2.7-macosx-10.10-x86_64.egg/traits/util/home_directory.py | 1 | 1435 | #------------------------------------------------------------------------------
# Copyright (c) 2005, 2006 by Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions ... | gpl-2.0 |
mazaclub/electrum-dash | scripts/util.py | 2 | 2083 | import time, electrum, Queue
from electrum_dash import Interface, SimpleConfig
from electrum_dash.network import filter_protocol, parse_servers
# electrum_dash.util.set_verbosity(1)
def get_peers():
# 1. start interface and wait for connection
q = Queue.Queue()
interface = electrum_dash.Interface('ecdsa.n... | gpl-3.0 |
ezequielpereira/Time-Line | libs/wx/animate.py | 10 | 9600 | # This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
"""
Simple animation player classes, including `GIFAnimationCtrl` for displaying
animated GIF files
"""
import _animate
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(se... | gpl-3.0 |
chudaol/edx-platform | common/djangoapps/pipeline_js/views.py | 162 | 1215 | """
Views for returning XModule JS (used by requirejs)
"""
import json
from django.conf import settings
from django.http import HttpResponse
from staticfiles.storage import staticfiles_storage
from edxmako.shortcuts import render_to_response
def get_xmodule_urls():
"""
Returns a list of the URLs to hit to gra... | agpl-3.0 |
blueyed/jedi | test/completion/generators.py | 8 | 1887 | # -----------------
# yield statement
# -----------------
def gen():
yield 1
yield ""
gen_exe = gen()
#? int() str()
next(gen_exe)
#? int() str() list
next(gen_exe, list)
def gen_ret(value):
yield value
#? int()
next(gen_ret(1))
#? []
next(gen_ret())
# -----------------
# generators should not be in... | mit |
Hundsbuah/tf700t_kernel | 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 |
mKeRix/home-assistant | homeassistant/helpers/event.py | 2 | 21555 | """Helpers for listening to events."""
import asyncio
from datetime import datetime, timedelta
import functools as ft
import logging
import time
from typing import Any, Awaitable, Callable, Dict, Iterable, Optional, Union
import attr
from homeassistant.const import (
ATTR_NOW,
EVENT_CORE_CONFIG_UPDATE,
EV... | mit |
PaoloW8/android_kernel_ZTE_NX505J | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
codercold/Veil-Evasion | modules/common/shellcode.py | 1 | 21068 | """
Contains main Shellcode class as well as the Completer class used
for tab completion of metasploit payload selection.
"""
# Import Modules
import commands
import socket
import sys
import os
import sys
import re
import readline
import subprocess
import binascii
from modules.common import messages
from modules.com... | gpl-3.0 |
wikimedia/mediawiki-extensions-WikidataEntitySuggester | wikiparser/createtables.py | 2 | 1087 | #!/usr/bin/python
"""Creates the DB and tables for wikiparser_db.py to insert into."""
import sys
import MySQLdb as mdb
def main():
con = mdb.connect('localhost', 'root', 'password', 'wikidatawiki');
with con:
cur = con.cursor()
try:
cur.execute("DROP TABLE IF EXISTS plabel")
... | mit |
jeeb/spica-2.6.38 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
chundongwang/Guess2014 | lib/flask/ctx.py | 776 | 14266 | # -*- coding: utf-8 -*-
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
from functools import update_wrapper
from werkzeug.excep... | apache-2.0 |
asdf2014/superset | superset/migrations/versions/a99f2f7c195a_rewriting_url_from_shortner_with_new_.py | 9 | 1825 | """rewriting url from shortner with new format
Revision ID: a99f2f7c195a
Revises: 53fc3de270ae
Create Date: 2017-02-08 14:16:34.948793
"""
# revision identifiers, used by Alembic.
revision = 'a99f2f7c195a'
down_revision = 'db0c65b146bd'
from alembic import op
import json
import sqlalchemy as sa
from superset import... | apache-2.0 |
axilleas/ansible | v1/tests/TestPlayVarsFiles.py | 95 | 12363 | #!/usr/bin/env python
import os
import shutil
from tempfile import mkstemp
from tempfile import mkdtemp
from ansible.playbook.play import Play
import ansible
import unittest
from nose.plugins.skip import SkipTest
class FakeCallBacks(object):
def __init__(self):
pass
def on_vars_prompt(self):
... | gpl-3.0 |
kirca/OpenUpgrade | addons/board/controllers.py | 348 | 1970 | # -*- coding: utf-8 -*-
from xml.etree import ElementTree
from openerp.addons.web.controllers.main import load_actions_from_ir_values
from openerp.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, menu_id, act... | agpl-3.0 |
daenamkim/ansible | test/units/parsing/test_unquote.py | 298 | 1602 | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@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 o... | gpl-3.0 |
youprofit/scikit-image | skimage/measure/_find_contours.py | 38 | 9217 | import numpy as np
from . import _find_contours_cy
from collections import deque
_param_options = ('high', 'low')
def find_contours(array, level,
fully_connected='low', positive_orientation='low'):
"""Find iso-valued contours in a 2D array for a given level value.
Uses the "marching squar... | bsd-3-clause |
bittlingmayer/Theano-Lights | models/lm_lstm_bn.py | 11 | 5709 | import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams
from theano.tensor.nnet.conv import conv2d
from theano.tensor.signal.downsample import max_pool_2d
from theano.tensor.shared_randomstreams import RandomStreams
import numpy as np
from toolbox import *
from modelbase import *
... | mit |
kreczko/rootpy | rootpy/root2hdf5.py | 1 | 16375 | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
"""
This module handles conversion of ROOT's TFile and
contained TTrees into HDF5 format with PyTables
"""
from __future__ import absolute_import
import os
import sys
import warnings
from pkg_resources import parse_v... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.