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 |
|---|---|---|---|---|---|
Rogdham/pelican | setup.py | 1 | 2505 | #!/usr/bin/env python
from os import walk
from os.path import join, relpath
from setuptools import setup
requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils',
'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4',
'python-dateutil']
entry_points = {
'console_scripts': ... | agpl-3.0 |
mchristopher/PokemonGo-DesktopMap | app/pywin/Lib/lib-tk/test/test_ttk/test_widgets.py | 2 | 59491 | import unittest
import Tkinter as tkinter
from Tkinter import TclError
import ttk
from test.test_support import requires, run_unittest
import sys
from test_functions import MockTclObj
from support import (AbstractTkTest, tcl_version, get_tk_patchlevel,
simulate_mouse_click)
from widget_t... | mit |
michellemorales/OpenMM | kaldi/egs/babel/s5b/local/resegment/segmentation.py | 4 | 59691 | #! /usr/bin/env python
# Copyright 2014 Vimal Manohar
# Apache 2.0
import os, glob, argparse, sys, re, time
from argparse import ArgumentParser
use_numpy = True
try:
import numpy as np
except ImportError:
use_numpy = False
# Global stats for analysis taking RTTM file as reference
global_analysis_get_initial_se... | gpl-2.0 |
ibinti/intellij-community | python/lib/Lib/site-packages/django/db/models/sql/expressions.py | 323 | 3772 | from django.core.exceptions import FieldError
from django.db.models.fields import FieldDoesNotExist
from django.db.models.sql.constants import LOOKUP_SEP
class SQLEvaluator(object):
def __init__(self, expression, query, allow_joins=True):
self.expression = expression
self.opts = query.get_meta()
... | apache-2.0 |
trosa/forca | gluon/contrib/markmin/markmin2pdf.py | 1 | 3551 | """
Created by Massimo Di Pierro
Licese BSD
"""
import subprocess
import os
import os.path
import re
import sys
from tempfile import mkstemp, mkdtemp, NamedTemporaryFile
from markmin2latex import markmin2latex
__all__ = ['markmin2pdf']
def removeall(path):
ERROR_STR= """Error removing %(path)s, %(error)s """
... | gpl-2.0 |
dimdung/boto | boto/s3/connection.py | 90 | 26192 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation file... | mit |
oscaro/django | tests/admin_filters/models.py | 4 | 2011 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@... | bsd-3-clause |
Coelhon/MasterRepo.repository | plugin.video.specto/resources/lib/libraries/cleandate.py | 33 | 1876 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | gpl-2.0 |
allenling/bugfixavatar | avatar/models.py | 25 | 5588 | import datetime
import os
import hashlib
from PIL import Image
from django.db import models
from django.core.files import File
from django.core.files.base import ContentFile
from django.core.files.storage import get_storage_class
from django.utils.translation import ugettext as _
from django.utils import six
from djan... | bsd-3-clause |
stacywsmith/ansible | lib/ansible/modules/cloud/amazon/efs_facts.py | 27 | 11489 | #!/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 |
aisipos/django | tests/db_functions/models.py | 31 | 1918 | """
Tests for built in Function expressions.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=50)
alias = models.CharField(max_leng... | bsd-3-clause |
bwohlberg/sporco | examples/scripts/dl/bpdndl.py | 1 | 2910 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""
Dictionary Learning
===================
This example demonstrates the use of class :class:`.bpdndl.BPDNDictLea... | bsd-3-clause |
purduejun/webpymail | webpymail/mailapp/views/message.py | 7 | 5252 | # -*- coding: utf-8 -*-
# WebPyMail - IMAP python/django web mail client
# Copyright (C) 2008 Helder Guerreiro
## This file is part of WebPyMail.
##
## WebPyMail 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 Foundat... | gpl-3.0 |
syjeon/new_edx | common/lib/xmodule/xmodule/modulestore/split_mongo/split.py | 6 | 62611 | import threading
import datetime
import logging
import pymongo
import re
from importlib import import_module
from path import path
from xmodule.errortracker import null_error_tracker
from xmodule.x_module import XModuleDescriptor
from xmodule.modulestore.locator import BlockUsageLocator, DescriptionLocator, CourseLoca... | agpl-3.0 |
ivmech/iviny-scope | lib/xlsxwriter/test/comparison/test_chart_table01.py | 1 | 2165 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.TestC... | gpl-3.0 |
MaheshIBM/keystone | keystone/common/base64utils.py | 9 | 13071 | # Copyright 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 agre... | apache-2.0 |
Communities-Communications/cc-odoo | addons/project/tests/__init__.py | 260 | 1089 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/twisted/internet/gireactor.py | 27 | 6123 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module provides support for Twisted to interact with the glib
mainloop via GObject Introspection.
In order to use this support, simply do the following::
from twisted.internet import gireactor
gireactor.install()
If you wish to... | mit |
joansmith/openmicroscopy | examples/Delete/Options.py | 15 | 1216 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Passes a non-empty options map to specify
that all Annotations should be kept.
"""
import omero
import omero.callbacks
c = omero.client()
s = c.createSession()
try:
deleteServicePrx = s.getDeleteService()
# The path here can either be relative or absolute, e... | gpl-2.0 |
airbnb/airflow | tests/providers/google/cloud/transfers/test_bigquery_to_gcs.py | 10 | 2703 | #
# 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 |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/logger/test/test_file.py | 13 | 5622 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.logger._file}.
"""
from io import StringIO
from zope.interface.verify import verifyObject, BrokenMethodImplementation
from twisted.trial.unittest import TestCase
from twisted.python.failure import Failure
from twis... | mit |
jmtalarn/material-design-lite-ghost-theme | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSSettings.py | 383 | 45223 | # 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.
r"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. Th... | gpl-2.0 |
MCslo/plugin.video.test3 | html5lib/filters/formfiller.py | 135 | 5839 | #
# The goal is to finally have a form filler where you pass data for
# each form, using the algorithm for "Seeding a form with initial values"
# See http://www.whatwg.org/specs/web-forms/current-work/#seeding
#
import _base
from html5lib.constants import spaceCharacters
spaceCharacters = u"".join(spaceCharacters)
c... | gpl-2.0 |
dqnykamp/sympy | sympy/simplify/tests/test_hyperexpand.py | 13 | 37344 | from random import randrange
from sympy.simplify.hyperexpand import (ShiftA, ShiftB, UnShiftA, UnShiftB,
MeijerShiftA, MeijerShiftB, MeijerShiftC, MeijerShiftD,
MeijerUnShiftA, MeijerUnShiftB, MeijerUnShiftC,
MeijerUnShiftD,
Re... | bsd-3-clause |
ZefQ/Flexget | flexget/plugins/filter/only_new.py | 23 | 1053 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('only_new')
class FilterOnlyNew(object):
"""Causes input plugins to only emit entries that haven't been seen on previous runs."""
schema = {'t... | mit |
loretoparisi/pattern | pattern/text/it/__init__.py | 21 | 7248 | #### PATTERN | IT ##################################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2013 University of Antwerp, Belgium
# Copyright (c) 2013 St. Lucas University College of Art & Design, Antwerp.
# Author: Tom De Smedt <tom@organisms.be>, Fabio Marfia <marfia@ele... | bsd-3-clause |
junhuac/MQUIC | src/tools/memory_inspector/memory_inspector/data/serialization.py | 89 | 4465 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module handles the JSON de/serialization of the core classes.
This is needed for both long term storage (e.g., loading/storing traces to local
files... | mit |
coffenbacher/askbot-devel | askbot/user_messages/context_processors.py | 10 | 1947 | """
Context processor for lightweight session messages.
Time-stamp: <2008-07-19 23:16:19 carljm context_processors.py>
"""
from django.conf import settings as django_settings
from django.utils.encoding import StrAndUnicode
from askbot.user_messages import get_and_delete_messages
def user_messages(request):
"""
... | gpl-3.0 |
glaserti/LibraryTwitter | Python/6.0 - Tweet Archive.py | 1 | 7752 | #
# Getting the Tweet Archive
#
# In this Notebook, the tweet archive for each library is harvested and saved to a json-file as __[screen\_name]\_TimeLine \_[datestamp].json__.
#
# Due to the range limit of the twitter api, only the last 3,200 tweets can be harvested for each screen_name.
# Harvesting Functions
... | mit |
brett-patterson/pyface | pyface/tasks/i_editor.py | 5 | 2901 | # Enthought library imports.
from traits.api import Any, Bool, Event, HasTraits, Interface, \
Instance, Property, Unicode, Vetoable, VetoableEvent, cached_property
class IEditor(Interface):
""" The base interface for all panes (central and dock) in a Task.
"""
# The editor's user-visible name.
na... | bsd-3-clause |
FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/weakref.py | 8 | 20481 | """Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
"""
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function imported from ... | gpl-2.0 |
demarle/VTK | IO/EnSight/Testing/Python/EnSightBlow4Bin.py | 20 | 1510 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.StereoCapableWindowOn()
iren = vtk.vtkRenderWindowInte... | bsd-3-clause |
abetkin/declared | tests/filters.py | 1 | 1289 | import abc
from functools import reduce
import operator
from django.db.models.query import Q, QuerySet
from declared import DeclaredMeta, Declared
class DeclaredFilters(Declared):
declared_types = Q,
@classmethod
def build_declaration(cls, obj):
if isinstance(obj, Q):
return afilt... | mit |
Haellsigh/La-guerre-des-herissons | tests/equations2.py | 1 | 1892 | """
trajectory.py
"""
from pylab import *
from scipy.integrate import odeint
## set initial conditions and parameters
g = 9.81 # acceleration due to gravity
th = 45. # set launch angle
th = th * pi/180. # convert launch angle to radians
v0 = 10.0 # set speed
k = 0.3 # cont... | mit |
thedemz/python-gems | modules/pycrypto-2.6.1/pct-speedtest.py | 36 | 7848 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pct-speedtest.py: Speed test for the Python Cryptography Toolkit
#
# Written in 2009 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
... | mit |
SpectreJan/gnuradio | gr-blocks/python/blocks/qa_boolean_operators.py | 57 | 7304 | #!/usr/bin/env python
#
# Copyright 2004,2007,2008,2010,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 |
abenzbiria/clients_odoo | addons/project_issue/__init__.py | 433 | 1131 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
ehirt/odoo | addons/payment_buckaroo/tests/test_buckaroo.py | 54 | 8132 | # -*- coding: utf-8 -*-
from lxml import objectify
import urlparse
import openerp
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_buckaroo.controllers.main import BuckarooController
from opener... | agpl-3.0 |
ryfeus/lambda-packs | Opencv_pil/source36/PIL/FliImagePlugin.py | 2 | 4393 | #
# The Python Imaging Library.
# $Id$
#
# FLI/FLC file handling.
#
# History:
# 95-09-01 fl Created
# 97-01-03 fl Fixed parser, setup decoder tile
# 98-07-15 fl Renamed offset attribute to avoid name clash
#
# Copyright (c) Secret Labs AB 1997-98.
# Copyright (c) Fredrik Lundh 1995-97.
#
... | mit |
crlang/sublime-text---front-end-config | Data/Packages/wakatime/packages/wakatime/packages/pygments/lexers/urbi.py | 31 | 5750 | # -*- coding: utf-8 -*-
"""
pygments.lexers.urbi
~~~~~~~~~~~~~~~~~~~~
Lexers for UrbiScript language.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import ExtendedRegexLexer, words
from pygments.token ... | mit |
blademainer/intellij-community | python/lib/Lib/encodings/utf_16_le.py | 860 | 1037 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... | apache-2.0 |
MycChiu/tensorflow | tensorflow/contrib/session_bundle/gc.py | 47 | 6397 | # 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 |
brain-tec/website | website_sale_unsaleable_options/controllers/main.py | 33 | 2441 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... | agpl-3.0 |
tgroh/incubator-beam | sdks/python/apache_beam/typehints/native_type_compatibility_test.py | 9 | 3659 | #
# 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 |
entropy1337/infernal-twin | Modules/build/pillow/Tests/test_psdraw.py | 12 | 1231 | from helper import unittest, PillowTestCase
class TestPsDraw(PillowTestCase):
def test_draw_postscript(self):
# Based on Pillow tutorial, but there is no textsize:
# http://pillow.readthedocs.org/en/latest/handbook/tutorial.html
# Arrange
from PIL import Image
from PIL i... | gpl-3.0 |
MoritzGruber/instabot | app/remoteExec.py | 1 | 2087 | from socketIO_client import SocketIO
import time
import Services.Content.Comments as Comments
import Services.Content.Statistics as Statistics
import Services.Content.Hashtags as Hashtags
import Services.Content.Images as Images
import main
def on_get_comments(*args):
print('get comments')
try:
args... | mit |
Tesi-Luca-Davide/ryu | ryu/lib/packet/packet_base.py | 58 | 2613 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | apache-2.0 |
Sauron754/MS | MPS.py | 1 | 1169 | #main module launcher module
#
#VERSION: 1.0.0
#
#
#
#
#
#
#
def MPS(precision, time_total, object_1_posx, object_1_posy, object_1_posz, object_1_xmov, object_1_ymov, object_1_zmov):
import MPS_object
import MPS_modules
import decimal
global sequence_time
global object_interstage
#creates needed presets for MPS t... | mit |
JorisDeRieck/Flexget | flexget/components/managed_lists/lists/subtitle_list.py | 2 | 14705 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import os
from collections import MutableSet
from datetime import datetime, date, time
from sqlalchemy import Column, Unicode, Integer, ForeignKey, func, Da... | mit |
gwq5210/litlib | thirdparty/sources/boost_1_60_0/tools/build/test/zlib.py | 30 | 3615 | #!/usr/bin/python
# Copyright (C) 2013 Steven Watanabe
# 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)
import BoostBuild
import MockToolset
t = BoostBuild.Tester(arguments=['toolset=mock', '--ignore-site-config',... | gpl-3.0 |
FIWARE-TMForum/business-ecosystem-charging-backend | src/wstore/asset_manager/resource_plugins/plugin_loader.py | 1 | 6874 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 - 2017 CoNWeT Lab., Universidad Politécnica de Madrid
# This file belongs to the business-charging-backend
# of the Business API Ecosystem.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License... | agpl-3.0 |
milwaukeegdi/milwaukeegdi.github.io | intro/node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py | 1382 | 30567 | # Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... | mit |
Florenz23/wifi_signals | py/json_converter.py | 1 | 1477 | from __future__ import print_function # Only needed for Python 2
import json
import glob
import os
# Input Format:
# {"key":"value"}
# {"key":"value"}
#Output Format:
# [
# {"key":"value"}
# ,
# {"key":"value"}
# ]
# change these values
readFolder = '../src/data/new_files'
writeFolder = './new_folder'
def compi... | mit |
energyPATHWAYS/energyPATHWAYS | energyPATHWAYS/dispatch_budget.py | 1 | 4838 |
import util
import numpy as np
from scipy import optimize
import logging
import pdb
##################################################################
##################################################################
## POWER TO GAS, ELECTROLYSIS AND HYDRO DISPATCH
#################################################... | mit |
mediawiki-utilities/python-mediawiki-utilities | mw/xml_dump/__init__.py | 4 | 1291 | """
This module is a collection of utilities for efficiently processing MediaWiki's
XML database dumps. There are two important concerns that this module intends
to address: *performance* and the *complexity* of streaming XML parsing.
Performance
Performance is a serious concern when processing large database XML... | mit |
TheWaWaR/shadowsocks | shadowsocks/lru_cache.py | 983 | 4290 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
rsunder10/PopularityBased-SearchEngine | lib/python3.4/site-packages/django/core/management/commands/makemigrations.py | 162 | 12597 | import os
import sys
from itertools import takewhile
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from django.db.migrations import Migration
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.loader import MigrationLoader
from... | mit |
TheAlgorithms/Python | project_euler/problem_056/sol1.py | 1 | 1061 | """
Project Euler Problem 56: https://projecteuler.net/problem=56
A googol (10^100) is a massive number: one followed by one-hundred zeros;
100^100 is almost unimaginably large: one followed by two-hundred zeros.
Despite their size, the sum of the digits in each number is only 1.
Considering natural numbers of the fo... | mit |
ROMFactory/android_external_chromium_org | tools/telemetry/telemetry/page/actions/click_element_unittest.py | 29 | 1894 | # 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.
import os
from telemetry.page.actions import click_element
from telemetry.unittest import tab_test_case
class ClickElementActionTest(tab_test_case.TabTe... | bsd-3-clause |
pitch-sands/i-MPI | flask/Lib/abc.py | 9 | 7072 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
import types
# Instance of old-style class
class _C: pass
_InstanceType = type(_C())
def abstractmethod(funcobj):
"""A decorator indicating abstract met... | bsd-3-clause |
Inspq/ansible | lib/ansible/module_utils/f5_cli.py | 76 | 2593 | #
# Copyright (c) 2017 Tim Rupp, <caphrim007@gmail.com>
# Copyright (c) 2017 F5 Networks Inc.
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
#... | gpl-3.0 |
40223119/-2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/datetime.py | 628 | 75044 | """Concrete date/time and related types.
See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
"""
import time as _time
import math as _math
def _cmp(x, y):
return 0 if x == y else 1 if x > y else -1
MINYEAR = 1
MAXYEAR = 9999
_MAXORDINAL = 3652059 # date.max.toordinal()... | gpl-3.0 |
douban/dpark | examples/pagerank.py | 1 | 1651 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import sys, os.path
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from dpark import DparkContext
from dpark.bagel import Vertex, Edge, Bagel
def parse_vertex(line, numV):
fields =... | bsd-3-clause |
Reroot/stagger | stagger/conversion.py | 18 | 4982 | #
# conversion.py
# From the stagger project: http://code.google.com/p/stagger/
#
# Copyright (c) 2009-2011 Karoly Lorentey <karoly@lorentey.hu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met... | bsd-2-clause |
dougbeal/nosy | setup.py | 1 | 1454 | from __future__ import with_statement
from setuptools import setup, find_packages
import sys
version_classifiers = ['Programming Language :: Python :: %s' % version
for version in ['2', '2.5', '2.6', '2.7']]
other_classifiers = [
'Development Status :: 5 - Production/Stable',
'License ::... | bsd-3-clause |
varunarya10/contrail-neutron-plugin | neutron_plugin_contrail/plugins/opencontrail/vnc_client/sg_res_handler.py | 3 | 13092 | # Copyright 2015. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
redhat-openstack/django | tests/empty/tests.py | 58 | 1221 | from __future__ import absolute_import
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_app
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
from .models import Empty
class EmptyModelTests(TestCase):
def... | bsd-3-clause |
elainenaomi/sciwonc-dataflow-examples | sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/pegasus/externals/python/boto/redshift/__init__.py | 145 | 1654 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | gpl-3.0 |
alvin319/CarnotKE | jyhton/lib-python/2.7/timeit.py | 99 | 12101 | #! /usr/bin/env python
"""Tool for measuring execution time of small code snippets.
This module avoids a number of common traps for measuring execution
times. See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.
Library usage: see the Timer class.
Command line ... | apache-2.0 |
ilo10/scikit-learn | sklearn/svm/setup.py | 321 | 3157 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('svm', parent_package, top_path)
config.add_subpackage('tests')
# Section L... | bsd-3-clause |
ataylor32/django | tests/modeladmin/tests.py | 20 | 55776 | from __future__ import unicode_literals
from datetime import date
from django import forms
from django.contrib.admin import BooleanFieldListFilter, SimpleListFilter
from django.contrib.admin.options import (
HORIZONTAL, VERTICAL, ModelAdmin, TabularInline,
)
from django.contrib.admin.sites import AdminSite
from d... | bsd-3-clause |
cournape/pig-it | pygit/pack.py | 1 | 7628 | import struct
import binascii
from hashlib import \
sha1
_V2_MAGIC = "\377tOc"
_V2_VERINT = "\0\0\0\2"
class Pack:
pass
# Size in bytes
FANOUT_SIZE = 4
FANOUT_NUMBER = 256
# Support only V2 for now
# Structure of a pack index V2 (from git doc sources + jgit PackIndexV2.java)
#
# +--------------------------... | bsd-3-clause |
co63oc/p2pool | fpconst.py | 310 | 5754 | """Utilities for handling IEEE 754 floating point special values
This python module implements constants and functions for working with
IEEE754 double-precision special values. It provides constants for
Not-a-Number (NaN), Positive Infinity (PosInf), and Negative Infinity
(NegInf), as well as functions to test for th... | gpl-3.0 |
mountaindust/Parasitoids | CompareToData.py | 1 | 37857 | #! /usr/bin/env python3
'''This module is for comparing model results to data and generating
publication quality figures.
Author: Christopher Strickland
Email: wcstrick@live.unc.edu
'''
import argparse
import numpy as np
from scipy import sparse, stats
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot ... | gpl-3.0 |
hequn8128/flink | flink-python/pyflink/table/tests/test_aggregate.py | 9 | 1817 | ################################################################################
# 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... | apache-2.0 |
ser/pypayd-ng | pypayd/insight.py | 2 | 2044 | """
http://insight.bitpay.com/
"""
import logging
from time import sleep
import requests
import config
def getUrl(request_string):
while True:
try:
insighturl = requests.get(request_string).json()
except Exception: # something got wrong, we want to loop until API is available
... | mit |
apatriciu/OpenStackOpenCL | computeOpenCL/nova/nova/tests/OpenCL/testOpenCLInterfaceMemoryCopy.py | 1 | 10994 | import unittest
from nova.OpenCL import OpenCLContextsAPI
from nova.OpenCL import OpenCLClientException
from nova.OpenCL import OpenCLCommandQueuesAPI
from nova.OpenCL import OpenCLBuffersAPI
import sys
import binascii
from binascii import unhexlify
from binascii import hexlify
import random
class LaptopResources:
... | apache-2.0 |
ghtdak/txtorcon | test/test_stream.py | 3 | 14193 | from txtorcon.util import maybe_ip_addr
from twisted.trial import unittest
from twisted.internet import defer
from zope.interface import implements
from txtorcon import Stream
from txtorcon import IStreamListener
from txtorcon import ICircuitContainer
from txtorcon import StreamListenerMixin
class FakeCircuit:
d... | mit |
wunderlins/learning | python/django/lib/python2.7/site-packages/django/views/decorators/vary.py | 586 | 1200 | from functools import wraps
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-langu... | gpl-2.0 |
marionleborgne/nupic | src/nupic/encoders/adaptivescalar.py | 32 | 8059 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
rosudrag/Freemium-winner | VirtualEnvironment/Lib/site-packages/pip-7.1.0-py3.4.egg/pip/_vendor/distlib/scripts.py | 203 | 12894 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... | mit |
pgmcd/ansible | lib/ansible/playbook/play.py | 30 | 11887 | # (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 |
ssalevan/fogmachine | fogmachine/taskomatic.py | 1 | 4512 | #!/usr/bin/python
# Simple periodic task scheduler
# mostly ganked from:
# http://stackoverflow.com/questions/373335/suggestions-for-a-cron-like-scheduler-in-python
import logging
import signal
import traceback
import time
import os
import sys
import pdb
from datetime import datetime, timedelta
from periodic_tasks im... | gpl-2.0 |
Jaemu/haiku.py | nltk/chat/rude.py | 5 | 2702 | # Natural Language Toolkit: Rude Chatbot
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Peter Spiller <pspiller@csse.unimelb.edu.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function
from util import Chat, reflections
pairs = (
(r'We (.*)',
... | apache-2.0 |
hfiguiere/niepce | third_party/googletest/googletest/test/gtest_color_test.py | 3259 | 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... | gpl-3.0 |
geopm/geopm | integration/apps/hpcg/hpcg.py | 2 | 2970 | # Copyright (c) 2015 - 2021, Intel Corporation
#
# 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... | bsd-3-clause |
beni55/django | django/conf/locale/en/formats.py | 1007 | 1815 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIM... | bsd-3-clause |
hsaputra/tensorflow | tensorflow/contrib/boosted_trees/python/ops/stats_accumulator_ops.py | 62 | 9211 | # Copyright 2017 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 |
domibarton/ansible | lib/ansible/plugins/connection/accelerate.py | 30 | 12971 | # (c) 2012, 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) any lat... | gpl-3.0 |
ryfeus/lambda-packs | HDF4_H5_NETCDF/source2.7/Cython/Tests/TestJediTyper.py | 6 | 6996 | # -*- coding: utf-8 -*-
# tag: jedi
from __future__ import absolute_import
import sys
import os.path
from textwrap import dedent
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from Cython.Compiler.ParseTreeTransforms import NormalizeTree, InterpretCompilerDirectives
from Cython.Compil... | mit |
stclair/wes-cms | django/core/management/commands/startproject.py | 322 | 1680 | from django.core.management.base import copy_helper, CommandError, LabelCommand
from django.utils.importlib import import_module
import os
import re
from random import choice
class Command(LabelCommand):
help = "Creates a Django project directory structure for the given project name in the current directory."
... | bsd-3-clause |
RalpH-himself/MusicLibrarySyncForMSC | mlsLibrary.py | 1 | 2769 | # Library.py
#
# imports the XML library and returns a list of Songs
import mlsSong as sng
from pyItunes import *
import os
import config
def ReadLibrary():
# read library xml file
l = Library(config.SOURCE_LIBRARYPATH)
for _id,song in l.songs.items():
# check if song is within SOURCE_MUSICF... | gpl-3.0 |
johngian/remo | vendor-local/lib/python/django_browserid/admin.py | 5 | 1924 | # 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/.
from django.contrib.admin.sites import AdminSite
class BrowserIDAdminSite(AdminSite):
"""Support logging in to the ... | bsd-3-clause |
tannmay/Algorithms-1 | dataStructures/constructTree.py | 1 | 1775 | # Python program to construct tree using inorder and
# preorder traversals
# A binary tree node
class Node:
# Constructor to create a new node
def __init__(self, data):
self.data = data
self.left = None
self.right = None
"""Recursive function to construct binary of size len f... | gpl-3.0 |
ModdedPA/android_external_chromium_org | chrome/common/extensions/docs/server2/appengine_blobstore.py | 25 | 1634 | # 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.
import blob_reference_store as datastore
from blob_reference_store import BlobReferenceStore
from appengine_wrappers import blobstore
from appengine_wrap... | bsd-3-clause |
yalewoosoft/shadowsocks | shadowsocks/udprelay.py | 1 | 41706 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
AntouanK/rethinkdb | external/v8_3.30.33.16/build/gyp/test/win/gyptest-cl-buffer-security-check.py | 344 | 1612 | #!/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.
"""
Make sure buffer security check setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = Tes... | agpl-3.0 |
hrpt-se/hrpt | apps/pollster/migrations/0006_survey_group.py | 1 | 1319 | # Generated by Django 2.2.16 on 2021-02-04 11:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '0011_update_pro... | agpl-3.0 |
davisein/jitsudone | django/django/conf/project_template/project_name/wsgi.py | 108 | 1158 | """
WSGI config for {{ project_name }} project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APP... | bsd-3-clause |
Liyier/learning_log | env/Lib/site-packages/pip/commands/wheel.py | 341 | 7729 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
import warnings
from pip.basecommand import RequirementCommand
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import RequirementSet
from pip.utils import import_or_raise
from pip.utils.build import Bui... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.