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 |
|---|---|---|---|---|---|
yahoo/pulsar | dashboard/django/stats/models.py | 4 | 8654 | #
# 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 |
yiqingj/work | tests/python_tests/sqlite_test.py | 3 | 17828 | #!/usr/bin/env python
from nose.tools import *
from utilities import execution_path, run_all
import os, mapnik
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
if 'sqlite' in mapnik.DatasourceCache.plugin_nam... | lgpl-2.1 |
jianghuaw/nova | nova/conductor/manager.py | 1 | 56574 | # Copyright 2013 IBM Corp.
#
# 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 |
eyalfa/spark | examples/src/main/python/mllib/summary_statistics_example.py | 128 | 1550 | #
# 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 |
leiferikb/bitpop | build/third_party/twisted_10_2/twisted/conch/test/test_mixin.py | 62 | 1110 | # -*- twisted.conch.test.test_mixin -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
import time
from twisted.internet import reactor, protocol
from twisted.trial import unittest
from twisted.test.proto_helpers import StringTransport
from twisted.conch import mixin
class TestB... | gpl-3.0 |
Jackeagle/kernel_caf | 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 |
abhiroyg/coala | tests/results/ResultTest.py | 4 | 6085 | import unittest
import json
from os.path import abspath
from coalib.results.Diff import Diff
from coalib.results.Result import RESULT_SEVERITY, Result
from coalib.results.SourceRange import SourceRange
from coalib.output.JSONEncoder import create_json_encoder
class ResultTest(unittest.TestCase):
def test_origin... | agpl-3.0 |
landism/pants | contrib/android/tests/python/pants_test/contrib/android/tasks/test_aapt_builder_integration.py | 14 | 3770 | # 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
import re
... | apache-2.0 |
jeffreyliu3230/osf.io | website/addons/dataverse/views/config.py | 3 | 4673 | # -*- coding: utf-8 -*-
import httplib as http
from flask import request
from modularodm import Q
from modularodm.storage.base import KeyExistsException
from framework.exceptions import HTTPError
from framework.auth.decorators import must_be_logged_in
from website.project import decorators
from website.util.sanitize... | apache-2.0 |
jakobharlan/avango | avango-blender/blender-addon/avango_panel.py | 3 | 1843 | import bpy
from bpy.props import BoolProperty
class AvangoPanel(bpy.types.Panel):
'''
: intended to handle io of OSC messages
'''
bl_idname = "AvangoPanel"
bl_label = "Avango panel"
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
bl_category = 'FLOW'
bl_options = {'DEFAULT_CLOS... | lgpl-3.0 |
E7ernal/quizwhiz | quizard/views/Results.py | 1 | 5042 | # vim: ts=4:sw=4:expandtabs
__author__ = 'zach.mott@gmail.com'
from django.conf import settings
from django.views import generic
from django.contrib import messages
from django.shortcuts import redirect
from django.template.loader import get_template
from django.utils.translation import ugettext_lazy as _
from email... | mit |
hj3938/panda3d | direct/src/gui/DirectFrame.py | 8 | 6980 | """Undocumented Module"""
__all__ = ['DirectFrame']
from panda3d.core import *
import DirectGuiGlobals as DGG
from DirectGuiBase import *
from OnscreenImage import OnscreenImage
from OnscreenGeom import OnscreenGeom
import types
class DirectFrame(DirectGuiWidget):
DefDynGroups = ('text', 'geom', 'image')
def... | bsd-3-clause |
macosforge/ccs-calendarserver | calendarserver/tools/agent.py | 1 | 10761 | #!/usr/bin/env python
# -*- test-case-name: calendarserver.tools.test.test_agent -*-
##
# Copyright (c) 2013-2017 Apple 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 ... | apache-2.0 |
shivam1111/odoo | openerp/report/render/html2html/__init__.py | 381 | 1091 | # -*- 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... | agpl-3.0 |
JioEducation/edx-platform | openedx/core/djangoapps/content/course_overviews/migrations/0002_add_course_catalog_fields.py | 81 | 1065 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_overviews', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='courseoverview',
... | agpl-3.0 |
rocky/python2-trepan | trepan/bwprocessor/main.py | 1 | 18126 | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2010, 2013-2015 Rocky Bernstein <rocky@gnu.org>
#
# 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... | gpl-3.0 |
dzo/kernel_ville | 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 |
drewp/commentserve | commentServe.py | 1 | 12072 | #!/usr/bin/python
"""comment storage for blogs, photo site, etc
see also:
sioc:Post sioc:has_reply sioc:Post / types:Comment
sioc:content
content:encoded
dcterms:created
types:BlogPost
types:Comment
"""
import web, time, logging, pystache, trac... | bsd-2-clause |
peterwilletts24/Python-Scripts | EMBRACE/modules/model_name_convert_title.py | 2 | 1563 | 'Converts model run names e.g djznu to sub title for plots'
def main(experiment_id):
djznu = ('1.5km LAM', '4500 km', '10s', 'L118, 78km lid', 'Explicit 3D SMAG', 'djznu')
dkbhu = ('2.2 km LAM', '4500 km', '10s', 'L118, 78km lid', 'Explicit 3D SMAG', 'dkbhu')
djzns = ('4km LAM', '4500 km', '10s', 'L118, ... | mit |
joninvski/ts_7500_kernel | scripts/rt-tester/rt-tester.py | 904 | 5366 | #!/usr/bin/env python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
impor... | gpl-2.0 |
kivymd/KivyMD | demos/shrine/libs/baseclass/box_bottom_sheet.py | 1 | 4932 | from kivy.animation import Animation
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.metrics import dp
from kivy.properties import BooleanProperty, ObjectProperty, StringProperty
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.image import Image
from kivy.uix.recycleview import Re... | mit |
pilou-/ansible | test/units/modules/network/f5/test_bigip_dns_resolver.py | 16 | 3687 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
JacobCallahan/robottelo | tests/foreman/api/test_location.py | 2 | 10317 | """Unit tests for the ``locations`` paths.
A full API reference for locations can be found here:
http://theforeman.org/api/apidoc/v2/locations.html
:Requirement: Location
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: OrganizationsLocations
:Assignee: shwsingh
:TestType: Functional
:CaseImpor... | gpl-3.0 |
wtsi-hgi/irobot | irobot/authentication/_http.py | 1 | 7456 | """
Copyright (c) 2017 Genome Research Ltd.
Author: Christopher Harrison <ch12@sanger.ac.uk>
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 ... | gpl-3.0 |
hyperized/ansible | lib/ansible/modules/cloud/google/gcp_compute_instance.py | 5 | 66410 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
sernst/Trackway-Gait-Analysis | tracksim/cli/commands/list_.py | 1 | 1859 | from argparse import ArgumentParser
from tracksim import system
from tracksim import reader
from tracksim import paths
from tracksim import cli
DESCRIPTION = """
Removes all existing group and trial results from cached results folders
"""
def list_groups():
system.log('===== GROUPS =====', whitespace_bo... | mit |
stclair/wes-cms | django/db/backends/creation.py | 79 | 22561 | import sys
import time
from django.conf import settings
from django.utils.datastructures import DictWrapper
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
class BaseDatabaseCreation(object):
"""
This class encapsulates all backend-specific d... | bsd-3-clause |
Swiftea/Crawler | crawler/index/database_ii.py | 2 | 3746 | from time import time
from pymongo import IndexModel, TEXT
from pymongo.write_concern import WriteConcern
from pymodm import connection, MongoModel, EmbeddedMongoModel, fields, errors
from crawler.index import index
class Word(MongoModel):
word = fields.CharField()
documents = fields.DictField(blank=True)
lang... | gpl-3.0 |
MFoster/breeze | django/contrib/gis/tests/distapp/tests.py | 104 | 19051 | from __future__ import absolute_import
from django.db import connection
from django.db.models import Q
from django.contrib.gis.geos import GEOSGeometry, LineString
from django.contrib.gis.measure import D # alias for Distance
from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_spatial... | bsd-3-clause |
Ayub-Khan/edx-platform | common/test/acceptance/tests/studio/base_studio_test.py | 12 | 5145 | """
Base classes used by studio tests.
"""
from bok_choy.web_app_test import WebAppTest
from ...pages.studio.auto_auth import AutoAuthPage
from ...fixtures.course import CourseFixture
from ...fixtures.library import LibraryFixture
from ..helpers import UniqueCourseTest
from ...pages.studio.overview import CourseOutline... | agpl-3.0 |
Ahmad31/Web_Flask_Cassandra | flask/lib/python2.7/site-packages/flask_wtf/recaptcha/validators.py | 91 | 2398 | try:
import urllib2 as http
except ImportError:
# Python 3
from urllib import request as http
from flask import request, current_app
from wtforms import ValidationError
from werkzeug import url_encode
from .._compat import to_bytes, to_unicode
import json
RECAPTCHA_VERIFY_SERVER = 'https://www.google.com/... | apache-2.0 |
chris-chris/tensorflow | tensorflow/contrib/solvers/python/ops/linear_equations.py | 117 | 4452 | # 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 |
arju88nair/projectCulminate | venv/lib/python3.5/site-packages/jinja2/nodes.py | 130 | 29392 | # -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:... | apache-2.0 |
llonchj/sentry | src/sentry/api/permissions.py | 2 | 1954 | from __future__ import absolute_import
from rest_framework import permissions
from sentry.models import OrganizationMemberType, ProjectKey
class NoPermission(permissions.BasePermission):
def has_permission(self, request, view):
return False
class ScopedPermission(permissions.BasePermission):
"""
... | bsd-3-clause |
rmfranciacastillo/freecodecamp_projects | weather/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | apache-2.0 |
num1r0/bb_tools | wordlist_generator.py | 1 | 4922 | """
Wordlist generator tool.
Generates extended wordlist based on an initial list of possible words
Used mainly with hash cracking tools: hashcat, john, etc.
TO DO:
- Add logging function
"""
import datetime
import itertools
import sys
import os
def usage():
""" Usage function """
usage_message = """Us... | gpl-3.0 |
openshift/openshift-tools | openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/openshift_health_checker/library/rpm_version.py | 56 | 4226 | #!/usr/bin/python
"""
Ansible module for rpm-based systems determining existing package version information in a host.
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six import string_types
IMPORT_EXCEPTION = None
try:
import rpm # pylint: disable=import-error
except ImportErr... | apache-2.0 |
beakman/droidlab | droidlab/experiments/serializers.py | 1 | 1991 | from rest_framework import serializers
from rest_framework.reverse import reverse
from .models import Experiment, Result
class ResultSerializer(serializers.ModelSerializer):
class Meta:
model = Result
exclude = ('experiment',)
# class ExperimentSerializer(serializers.HyperlinkedModelSerializer):
# results = ser... | bsd-3-clause |
tracierenea/gnuradio | grc/gui/Colors.py | 4 | 1969 | """
Copyright 2008,2013 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
ilo10/scikit-learn | examples/cluster/plot_agglomerative_clustering_metrics.py | 402 | 4492 | """
Agglomerative clustering with different metrics
===============================================
Demonstrates the effect of different metrics on the hierarchical clustering.
The example is engineered to show the effect of the choice of different
metrics. It is applied to waveforms, which can be seen as
high-dimens... | bsd-3-clause |
mcallistersean/b2-issue-tracker | toucan/user_profile/forms.py | 2 | 2699 | from django import forms
from django.utils.translation import ugettext_lazy as _
from phonenumber_field.formfields import PhoneNumberField
from phonenumber_field.widgets import PhoneNumberPrefixWidget
from ..organisations.models import Organisation
from .models import Profile, NotificationSettings
from allauth.accoun... | mit |
aroche/django | tests/utils_tests/test_text.py | 243 | 9471 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.test import SimpleTestCase
from django.utils import six, text
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils.translation import override
lazystr = lazy(force_text, six.text... | bsd-3-clause |
FabianHahn/libstore | thirdparty/googletest/googletest/test/gtest_color_test.py | 17 | 4911 | #!/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... | mit |
tomtor/QGIS | tests/src/python/test_qgspropertyoverridebutton.py | 45 | 5307 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPropertyOverrideButton.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later vers... | gpl-2.0 |
zanemcca/node-inspector | front-end/cm/PRESUBMIT.py | 148 | 2368 | # Copyright (C) 2014 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 ... | bsd-2-clause |
icarito/sugar | src/jarabe/frame/clipboardmenu.py | 3 | 8708 | # Copyright (C) 2007, One Laptop Per Child
#
# 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 distrib... | gpl-3.0 |
lmyrefelt/CouchPotatoServer | libs/flask/logging.py | 838 | 1398 | # -*- coding: utf-8 -*-
"""
flask.logging
~~~~~~~~~~~~~
Implements the logging support for Flask.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from logging import getLogger, StreamHandler, Formatter, getLoggerClas... | gpl-3.0 |
jroyal/plexpy | lib/requests/packages/urllib3/response.py | 243 | 11686 | import zlib
import io
from socket import timeout as SocketTimeout
from ._collections import HTTPHeaderDict
from .exceptions import ProtocolError, DecodeError, ReadTimeoutError
from .packages.six import string_types as basestring, binary_type
from .connection import HTTPException, BaseSSLError
from .util.response impor... | gpl-3.0 |
neogis-de/PPPP_utilities | pointcloud/identification_de_plan.py | 2 | 3554 | # -*- coding: utf-8 -*-
""" ce module permet de trouver un plan dans un nuage de points par RANSAC
@author Islam
copyriught 2015 Thales
"""
import numpy as np
import ransac as ran
import random
def creation_tableau(nb):
"""Creation d'un tableau de points
Args:
nb: Nombre de points
Return:
n... | lgpl-3.0 |
cfriedt/gnuradio | gr-digital/python/digital/qa_simple_framer.py | 57 | 2053 | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012,2013 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... | gpl-3.0 |
RobotLocomotion/libbot | bot2-procman/python/src/bot_procman/sheriff.py | 3 | 60827 | """@package sheriff
\defgroup python_api Python API
"""
import os
import platform
import sys
import time
import random
import signal
import gobject
import lcm
from bot_procman.info_t import info_t
from bot_procman.orders_t import orders_t
from bot_procman.sheriff_cmd_t import sheriff_cmd_t
from bot_procman.command2_... | lgpl-3.0 |
OSSOS/MOP | src/ossos/core/scripts/process.py | 1 | 1397 |
from ossos.pipeline import mk_mopheader, mkpsf, step1, slow
from ossos import util, storage
import logging
import sys
import os
import shutil
util.config_logging(logging.INFO)
version='p'
force=False
dry_run=False
prefix=''
lines = open(sys.argv[1]).readlines()
basedir=os.getcwd()
for line in lines:
expnum =... | gpl-3.0 |
grpc/grpc | src/python/grpcio/grpc/aio/_call.py | 8 | 23750 | # Copyright 2019 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 |
vlachoudis/sl4a | python/src/Tools/framer/framer/function.py | 48 | 4246 | """Functions."""
from framer import template
from framer.util import cstring, unindent
METH_O = "METH_O"
METH_NOARGS = "METH_NOARGS"
METH_VARARGS = "METH_VARARGS"
def parsefmt(fmt):
for c in fmt:
if c == '|':
continue
yield c
class Argument:
def __init__(self, name):
sel... | apache-2.0 |
akaariai/django | django/db/backends/base/base.py | 103 | 17962 | import time
import warnings
from collections import deque
from contextlib import contextmanager
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import utils
from django.db.backends.signals import connection_created
from django.db.transaction import TransactionManagementE... | bsd-3-clause |
rrahmati/roboinstruct-2 | demonstrate_ros_package/scripts/record_demonstration.py | 1 | 15168 | #! /usr/bin/python
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import numpy as np
import cv2
import sys
import os
from os.path import expanduser
import signal
import threading
from multiprocessing import Pool
import time
from random import randint
from std_msgs.msg impo... | mit |
meletakis/collato | lib/python2.7/site-packages/endless_pagination/tests/integration/test_twitter.py | 9 | 1615 | """Twitter-style pagination integration tests."""
from __future__ import unicode_literals
from endless_pagination.tests.integration import SeleniumTestCase
class TwitterPaginationTest(SeleniumTestCase):
view_name = 'twitter'
def test_new_elements_loaded(self):
# Ensure a new page is loaded on clic... | gpl-2.0 |
jied83/kernel_back | tools/perf/python/twatch.py | 3213 | 1338 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
andreparrish/python-for-android | python-modules/twisted/twisted/test/time_helpers.py | 59 | 2005 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Helper class to writing deterministic time-based unit tests.
Do not use this module. It is a lie. See L{twisted.internet.task.Clock}
instead.
"""
import warnings
warnings.warn(
"twisted.test.time_helpers is deprecated since T... | apache-2.0 |
Dryra/SosAnimauxWeb | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | 3506 | #Copyright (c) 2010 Fabien Potencier
#
#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, distrib... | mit |
krishnazure/Flask | Work/Trivia - Module 5/env/Lib/site-packages/jinja2/ext.py | 603 | 25078 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2 import nod... | apache-2.0 |
nuigroup/kivy | kivy/modules/touchring.py | 3 | 2215 | '''
Touchring
=========
Show ring around every touch on the table. You can use this module for checking
if you don't have any calibration trouble with touches.
Configuration
-------------
:Parameters:
`image`: str, default to '<kivy>/data/images/ring.png'
Filename of the image to use.
`scale`: float,... | lgpl-3.0 |
pulilab/rapidpro | temba/orgs/migrations/0032_fix_org_with_nexmo_config.py | 4 | 4386 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 09:17
from __future__ import unicode_literals
import json
from uuid import uuid4
import nexmo as nx
import six
from django.conf import settings
from django.core.cache import cache
from django.db import migrations
from django.urls import reverse
from ... | agpl-3.0 |
nloopa/linux-reiser4 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
UrusTeam/android_ndk_toolchain_cross | lib/python2.7/encodings/cp1258.py | 593 | 13620 | """ Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.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,in... | gpl-2.0 |
mistercrunch/airflow | docs/exts/redirects.py | 5 | 2708 | # 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 |
hobson/pug-invest | pug/invest/bin/fit-test.py | 1 | 4498 | from statsmodels.tsa import arima_model
import numpy as np
from pug.invest import util
y = util.simulate(poly=100, sinusoids=(10, 100, -20)).values
hr = np.arange(365*96)*.25
t = hr * 3600
sinusoids = [
np.random.normal(0.0, 0.1, 365*96)+10 + 3*np.sin(hr*2*np.pi/96/.25),
np.random.normal(0.0, 0.1, 365*96)+15 ... | mit |
romain-dartigues/ansible | lib/ansible/plugins/filter/urlsplit.py | 146 | 1136 | # Copyright (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
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by':... | gpl-3.0 |
gmacchi93/serverInfoParaguay | apps/venv/lib/python2.7/site-packages/setuptools/extension.py | 284 | 1404 | import sys
import distutils.core
import distutils.extension
from setuptools.dist import _get_unpatched
_Extension = _get_unpatched(distutils.core.Extension)
def have_pyrex():
"""
Return True if Cython or Pyrex can be imported.
"""
pyrex_impls = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext... | apache-2.0 |
ChromiumWebApps/chromium | mojo/public/bindings/generators/mojom_js_generator.py | 1 | 7742 | # 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.
"""Generates JavaScript source files from a mojom.Module."""
from generate import mojom
from generate import mojom_pack
from generate import mojom_generator... | bsd-3-clause |
etashjian/ECE757-final | src/cpu/o3/O3CPU.py | 14 | 7870 | # Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 |
kmolab/kmolab.github.io | data/Brython-3.3.4/Lib/logging/brython_handlers.py | 1 | 1179 | import logging
from browser.ajax import ajax
class XMLHTTPHandler(logging.Handler):
"""
A class which sends records to a Web server, using either GET or
POST semantics.
"""
def __init__(self, url, method="GET"):
"""
Initialize the instance with the host, the request URL, and the m... | agpl-3.0 |
jmcarbo/openerp7 | openerp/addons/crm/crm_phonecall.py | 14 | 14638 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
MakeHer/edx-platform | common/djangoapps/static_replace/test/test_static_replace.py | 4 | 20954 | """Tests for static_replace"""
from urllib import quote_plus
import ddt
import re
from PIL import Image
from cStringIO import StringIO
from nose.tools import assert_equals, assert_true, assert_false # pylint: disable=no-name-in-module
from static_replace import (
replace_static_urls,
replace_course_urls,
... | agpl-3.0 |
fuziontech/sentry | tests/sentry/models/test_team.py | 24 | 1884 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.models import OrganizationMember, OrganizationMemberTeam
from sentry.testutils import TestCase
class TeamTest(TestCase):
def test_global_member(self):
user = self.create_user()
org = self.create_organization(owner=user)
... | bsd-3-clause |
Mozhuowen/brython | www/src/Lib/test/test_builtin.py | 28 | 56161 | # Python test set -- built-in functions
import ast
import builtins
import collections
import io
import locale
import os
import pickle
import platform
import random
import sys
import traceback
import types
import unittest
import warnings
from operator import neg
from test.support import TESTFN, unlink, run_unittest, c... | bsd-3-clause |
EvanK/ansible | lib/ansible/modules/cloud/google/gcp_iam_service_account_facts.py | 10 | 4246 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
rizard/fast-failover-demo | example/packetStreamerClientExample.py | 148 | 3893 | #!/usr/bin/python
import urllib2
import json
import re
import sys
from optparse import OptionParser
sys.path.append('~/floodlight/target/gen-py')
sys.path.append('~/floodlight/thrift/lib/py')
from packetstreamer import PacketStreamer
from packetstreamer.ttypes import *
from thrift import Thrift
from thrift.transpo... | apache-2.0 |
ville-k/tensorflow | tensorflow/python/saved_model/utils.py | 65 | 1207 | # 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 |
pongem/python-bot-project | appengine/standard/botapp/env/lib/python2.7/site-packages/pip/wheel.py | 338 | 32010 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... | apache-2.0 |
tylertian/Openstack | openstack F/python-glanceclient/tests/test_base.py | 4 | 2258 | # Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! 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/licens... | apache-2.0 |
rghe/ansible | lib/ansible/modules/packaging/os/rpm_key.py | 100 | 6840 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to import third party repo keys to your rpm db
# Copyright: (c) 2013, Héctor Acosta <hector.acosta@gazzang.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, pri... | gpl-3.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py | 356 | 1555 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName, Attrs
from genshi.core import START, END, TEXT, COMMENT, DOCTYPE
def to_genshi(walker):
text = []
for token in walker:
type = token["type"]
if type in ("Characters", "SpaceCharacters"):
... | gpl-2.0 |
kod3r/pyh3 | h3/node.py | 3 | 1583 | import collections
import json
from h3math import Point4d
"""
The node structure storing all attributes of a tree node.
"""
class Node(object):
"""
The node constructor.
:param int node_id: the id of node in the node lookup table in tree object
:param int parent_id: the id of parent node in the ... | mit |
jounex/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/sitemaps/views.py | 109 | 2968 | import warnings
from functools import wraps
from django.contrib.sites.models import get_current_site
from django.core import urlresolvers
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.http import Http404
from django.template.response import TemplateResponse
from django.utils import six
def... | apache-2.0 |
nightjean/Deep-Learning | tensorflow/tools/compatibility/tf_upgrade.py | 20 | 26502 | # 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 |
mne-tools/mne-tools.github.io | 0.16/_downloads/plot_dics_source_power.py | 4 | 2479 | """
=========================================
Compute source power using DICS beamfomer
=========================================
Compute a Dynamic Imaging of Coherent Sources (DICS) [1]_ filter from
single-trial activity to estimate source power across a frequency band.
References
----------
.. [1] Gross et al. Dyna... | bsd-3-clause |
HousekeepLtd/django | tests/urlpatterns_reverse/included_namespace_urls.py | 199 | 1357 | import warnings
from django.conf.urls import include, patterns, url
from django.utils.deprecation import RemovedInDjango110Warning
from .namespace_urls import URLObject
from .views import view_class_instance
testobj3 = URLObject('testapp', 'test-ns3')
testobj4 = URLObject('testapp', 'test-ns4')
# test deprecated pa... | bsd-3-clause |
40223141/0505 | static/Brython3.1.1-20150328-091302/Lib/xml/dom/minicompat.py | 781 | 3228 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... | agpl-3.0 |
jesramirez/odoo | addons/stock/res_config.py | 115 | 8115 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
rholy/dnf | tests/test_history_undo.py | 13 | 12049 | # test_history_undo.py
# Tests of the history undo command.
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later versio... | gpl-2.0 |
heathseals/CouchPotatoServer | libs/pyutil/test/current/json_tests/test_unicode.py | 106 | 1973 | from unittest import TestCase
from pyutil import jsonutil as json
class TestUnicode(TestCase):
def test_encoding1(self):
encoder = json.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
... | gpl-3.0 |
jianajavier/pnc-cli | pnc_cli/swagger_client/models/product_version_singleton.py | 2 | 2920 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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 |
bguillot/OpenUpgrade | openerp/report/printscreen/__init__.py | 381 | 1203 | # -*- 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... | agpl-3.0 |
chris2727/BeastBot | src/inc/modules/hack.py | 4 | 3996 | # coding=utf8
"""
hack.py - Pretend you're doing hacker-ish things (based on http://shinytoylabs.com/jargon/)
Copyright 2014 Max Gurela
Licensed under the Eiffel Forum License 2.
"""
import random
from inc import *
modFunc.addCommand('hack', 'hack', 'hack')
abbreviations = [
'TCP',
'HTTP',
'SDD',
'... | gpl-3.0 |
Arable/evepod | lib/python2.7/site-packages/pymongo/replica_set_connection.py | 13 | 11843 | # Copyright 2011-2012 10gen, 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 writing... | apache-2.0 |
ximion/dak | dak/dakdb/update95.py | 7 | 1794 | #!/usr/bin/env python
# coding=utf8
"""
Require SHA-1 and SHA-256 checksums in "files" table.
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2013, Ansgar Burchardt <ansgar@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it ... | gpl-2.0 |
mrquim/mrquimrepo | script.module.youtube.dl/lib/youtube_dl/extractor/eroprofile.py | 61 | 3218 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlencode
from ..utils import (
ExtractorError,
unescapeHTML
)
class EroProfileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
... | gpl-2.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/operations/_route_filters_operations.py | 1 | 27170 | # 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 |
maoxuxiang/termite_mallet_project | web2py/gluon/contrib/rss2.py | 44 | 16164 | """
PyRSS2Gen - A Python library for generating RSS 2.0 feeds.
(This is the BSD license, based on the template at
http://www.opensource.org/licenses/bsd-license.php )
Copyright (c) 2003, Dalke Scientific Software, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modific... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.