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 |
|---|---|---|---|---|---|
junhuac/MQUIC | depot_tools/git_rebase_update.py | 1 | 11254 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Tool to update all branches to have the latest changes from their upstreams.
"""
import argparse
import collections
import logging... | mit |
MultiPath/Dep-Compo | execute.py | 1 | 1033 | #/usr/bin/python2.7
#*-coding:utf-8-*-
from structure import DependencyTree
from DepNN import DepNN
#Main class to execute the task.
class Execute(object):
def __init__(self):
self.depnn = DepNN()
self.depnn.extendLookUp('../data/depcheck2')
self.depnn.load_wordvector('../data/word-vec.bin'... | gpl-2.0 |
FreeAgent/djangoappengine-starter | djangotoolbox/middleware.py | 85 | 2801 | from django.conf import settings
from django.http import HttpResponseRedirect
from django.utils.cache import patch_cache_control
LOGIN_REQUIRED_PREFIXES = getattr(settings, 'LOGIN_REQUIRED_PREFIXES', ())
NO_LOGIN_REQUIRED_PREFIXES = getattr(settings, 'NO_LOGIN_REQUIRED_PREFIXES', ())
ALLOWED_DOMAINS = getattr(setting... | bsd-3-clause |
soasme/rio | tests/blueprints/dashboard/test_views.py | 1 | 1243 | # -*- coding: utf-8 -*-
from flask import url_for
from flask_login import login_user
def test_new_project_require_name(client, login):
resp = client.post(url_for('dashboard.new_project'), data={'name': ''})
assert resp.status_code == 400
assert resp.json['errors']['name']
def test_new_project_success(cli... | mit |
teoliphant/numpy-refactor | numpy/lib/twodim_base.py | 5 | 22944 | """ Basic functions for manipulating 2d arrays
"""
__all__ = ['diag','diagflat','eye','fliplr','flipud','rot90','tri','triu',
'tril','vander','histogram2d','mask_indices',
'tril_indices','tril_indices_from','triu_indices','triu_indices_from',
]
from numpy.core.numeric import asanyarr... | bsd-3-clause |
ChronoMonochrome/android_external_chromium_org | tools/linux/procfs.py | 23 | 20724 | #!/usr/bin/env python
# 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.
# A Python library to read and store procfs (/proc) information on Linux.
#
# Each information storage class in this file stores origin... | bsd-3-clause |
sorgerlab/indra | indra/sources/isi/experiments.py | 6 | 2074 | import pickle
import time
import os
from indra.sources.isi.api import process_preprocessed
from indra.sources.isi.preprocessor import IsiPreprocessor
def abstracts_runtime():
pfile = '/Users/daniel/Downloads/text_content_sample.pkl'
dump = pickle.load(open(pfile, 'rb'))
all_abstracts = dump['pubmed']
... | bsd-2-clause |
cfelton/rhea | rhea/build/fpga.py | 1 | 8511 | #
# Copyright (c) 2014-2015 Christopher Felton
#
import os
import shutil
import inspect
from random import randint
from copy import copy
import myhdl
from myhdl._block import _Block as Block
from .extintf import Port
from .extintf import Clock
from .extintf import Reset
class FPGA(object):
""" """
vendor =... | mit |
h4r5h1t/django-hauthy | django/db/migrations/autodetector.py | 87 | 54478 | from __future__ import unicode_literals
import datetime
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOpti... | bsd-3-clause |
ThreeSixes/airSuck | airSuckClient.py | 1 | 41255 | #!/usr/bin/python
"""
airSuckClient by ThreeSixes (https://github.com/ThreeSixes)
This project is licensed under GPLv3. See COPYING for dtails.
This file is part of the airSuck project (https://github.com/ThreeSixes/airSUck).
"""
###########
# Imports #
###########
try:
import config
except:
raise IOError(... | gpl-3.0 |
bhargav2408/python-for-android | python-build/python-libs/gdata/src/gdata/media/__init__.py | 221 | 12093 | # -*-*- encoding: utf-8 -*-*-
#
# This is gdata.photos.media, implementing parts of the MediaRSS spec in gdata structures
#
# $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $
#
# Copyright 2007 Håvard Gulldahl
# Portions copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | apache-2.0 |
mikelalcon/bazel | third_party/py/mock/docs/conf.py | 108 | 6310 | # -*- coding: utf-8 -*-
#
# Mock documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 17 18:12:00 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable... | apache-2.0 |
Luxoft/Twister | lib/Ixia/generate.py | 2 | 15483 | #!/usr/bin/env python
# File: generate.py ; This file is part of Twister.
# version: 2.003
# Copyright (C) 2013 , Luxoft
# Authors:
# Adrian Toader <adtoader@luxoft.com>
# Andrei Costachi <acostachi@luxoft.com>
# Andrei Toma <atoma@luxoft.com>
# Cristi Constantin <crconstantin@luxoft.com>
# Daniel Ci... | apache-2.0 |
charactory/namcap | Namcap/fhsmanpages.py | 2 | 1594 | #
# namcap rules - fhsmanpages
# Copyright (C) 2008 Aaron Griffin <aaronmgriffin@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at ... | gpl-2.0 |
dparlevliet/zelenka-report-storage | server-db/twisted/trial/_dist/test/test_worker.py | 33 | 14642 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test for distributed trial worker side.
"""
import os
from cStringIO import StringIO
from zope.interface.verify import verifyObject
from twisted.trial.reporter import TestResult
from twisted.trial.unittest import TestCase
from twisted.trial... | lgpl-3.0 |
konrado0/vosqa | forum_modules/oauthauth/lib/oauth2/httplib2/socks.py | 29 | 16293 | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | gpl-3.0 |
zachmullen/boto | boto/configservice/exceptions.py | 135 | 2528 | # Copyright (c) 2015 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 ... | mit |
sanghinitin/golismero | tools/sqlmap/plugins/dbms/mssqlserver/filesystem.py | 8 | 14284 | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import ntpath
import os
from lib.core.common import getLimitRange
from lib.core.common import isNumPosStrValue
from lib.core.common import isTechniqueAvailable
from lib.core.... | gpl-2.0 |
nuagenetworks/vspk-python | vspk/v6/fetchers/nuipfilterprofiles_fetcher.py | 2 | 2156 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | bsd-3-clause |
bols-blue/ansible | plugins/inventory/jail.py | 132 | 1288 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# 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 |
maikodaraine/EnlightenmentUbuntu | bindings/python/python-efl/examples/elementary/test_segment_control.py | 1 | 2798 | #!/usr/bin/env python
# encoding: utf-8
import os
from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL
from efl import elementary
from efl.elementary.window import StandardWindow
from efl.elementary.box import Box
from efl.elementary.icon import Icon
from efl.elementary.segment_control import SegmentControl
EXPAND_... | unlicense |
AlexanderKaluzhny/instanotifier | instanotifier/notification/serializers.py | 1 | 1953 | from copy import deepcopy
import hashlib
from bs4 import BeautifulSoup
from rest_framework import serializers
from instanotifier.notification.models import RssNotification
from instanotifier.notification.utils import html
def _parse_country(summary):
soup = BeautifulSoup(summary, features="html5lib")
countr... | mit |
stgraber/snapcraft | integration_tests/test_make_plugin.py | 6 | 2306 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in... | gpl-3.0 |
gustavomazevedo/tbackup-client | client/migrations/0009_auto__add_field_backup_origin__chg_field_backup_remote_id.py | 1 | 4529 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Backup.origin'
db.add_column(u'client_backup', 'origin',
... | mit |
makacodewalker/etsgh | django/utils/datetime_safe.py | 496 | 2685 | # Python's datetime strftime doesn't handle dates before 1900.
# These classes override date and datetime to support the formatting of a date
# through its full "proleptic Gregorian" date range.
#
# Based on code submitted to comp.lang.python by Andrew Dalke
#
# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was... | bsd-3-clause |
j00bar/django-widgy | widgy/contrib/form_builder/views.py | 1 | 1271 | from django.views.generic.edit import FormMixin
from django.shortcuts import get_object_or_404
from widgy.models import Node
class HandleFormMixin(FormMixin):
"""
An abstract view mixin for handling form_builder.Form submissions.
"""
def post(self, *args, **kwargs):
"""
copied from dja... | apache-2.0 |
fighterCui/L4ReFiascoOC | l4/pkg/python/contrib/Lib/tokenize.py | 62 | 16326 | """Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line of input (or "" for EOF). It generates
5-tuples with these members:
the token type (see token.py)
... | gpl-2.0 |
Jionglun/-w16b_test | static/Brython3.1.3-20150514-095342/Lib/heapq.py | 628 | 18065 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... | agpl-3.0 |
log2timeline/dfvfs | dfvfs/file_io/compressed_stream_io.py | 2 | 9519 | # -*- coding: utf-8 -*-
"""The compressed stream file-like object implementation."""
import os
from dfvfs.compression import manager as compression_manager
from dfvfs.file_io import file_io
from dfvfs.lib import errors
from dfvfs.resolver import resolver
class CompressedStream(file_io.FileIO):
"""File input/outpu... | apache-2.0 |
ppries/tensorflow | tensorflow/python/kernel_tests/softmax_op_test.py | 11 | 6928 | # 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 |
vipul-sharma20/oh-mainline | vendor/packages/Django/tests/modeltests/model_formsets/tests.py | 51 | 61280 | from __future__ import absolute_import, unicode_literals
import datetime
import re
from datetime import date
from decimal import Decimal
from django import forms
from django.db import models
from django.forms.models import (_get_foreign_key, inlineformset_factory,
modelformset_factory)
from django.test import Tes... | agpl-3.0 |
hargup/sympy | sympy/integrals/trigonometry.py | 83 | 10631 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
from sympy.core.compatibility import range
from sympy.core import cacheit, Dummy, Eq, Integer, Rational, S, Wild
from sympy.functions import binomial, sin, cos, Piecewise
# TODO sin(a*x)*cos(b*x) -> sin((a+b)x) + sin((a-b)x) ?
# creating, each ... | bsd-3-clause |
buqing2009/MissionPlanner | Lib/email/iterators.py | 68 | 2275 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Various types of useful iterators and generators."""
__all__ = [
'body_line_iterator',
'typed_subpart_iterator',
'walk',
# Do not include _structure() since it's part of the debuggi... | gpl-3.0 |
maurerpe/FreeCAD | src/Mod/Fem/FemCommands.py | 3 | 6302 | #***************************************************************************
#* *
#* Copyright (c) 2015 - FreeCAD Developers *
#* Author (c) 2015 - Przemo Fiszt < przemo@firszt.eu> *
#* ... | lgpl-2.1 |
spjmurray/openstack-sentinel | sentinel/api/controllers/network/v2/floatingips.py | 1 | 1120 | # Copyright 2017 DataCentred Ltd
#
# 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 ag... | apache-2.0 |
xiandiancloud/ji | common/djangoapps/user_api/tests/test_models.py | 52 | 1757 | from django.db import IntegrityError
from django.test import TestCase
from student.tests.factories import UserFactory
from user_api.tests.factories import UserPreferenceFactory
from user_api.models import UserPreference
class UserPreferenceModelTest(TestCase):
def test_duplicate_user_key(self):
user = Use... | agpl-3.0 |
caibo2014/teuthology | teuthology/prune.py | 3 | 4784 | import logging
import os
import shutil
import time
import teuthology
from teuthology.contextutil import safe_while
log = logging.getLogger(__name__)
# If we see this in any directory, we do not prune it
PRESERVE_FILE = '.preserve'
def main(args):
"""
Main function; parses args and calls prune_archive()
... | mit |
lucywyman/slides-ii | v/lib/python2.7/site-packages/pygments/lexers/factor.py | 72 | 17864 | # -*- coding: utf-8 -*-
"""
pygments.lexers.factor
~~~~~~~~~~~~~~~~~~~~~~
Lexers for the Factor language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, default, words
from ... | apache-2.0 |
pawkoz/dyplom | blender/build_files/cmake/project_source_info.py | 2 | 7070 | # ***** BEGIN GPL LICENSE BLOCK *****
#
# 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 version.
#
# This program is distributed ... | gpl-2.0 |
openhatch/oh-mainline | vendor/packages/django-extensions/django_extensions/utils/uuid.py | 44 | 20400 | r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... | agpl-3.0 |
vjmac15/Lyilis | lib/youtube_dl/extractor/dailymotion.py | 13 | 18180 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
import itertools
from .common import InfoExtractor
from ..utils import (
determine_ext,
error_to_compat_str,
ExtractorError,
int_or_none,
parse_iso8601,
sanitized_Request,
str_to_int,
unescapeHTML,
mimet... | gpl-3.0 |
chvrga/outdoor-explorer | java/play-1.4.4/python/Lib/site-packages/win32/lib/win32traceutil.py | 9 | 1528 | # This is a helper for the win32trace module
# If imported from a normal Python program, it sets up sys.stdout and sys.stderr
# so output goes to the collector.
# If run from the command line, it creates a collector loop.
# Eg:
# C:>start win32traceutil.py (or python.exe win32traceutil.py)
# will start a pr... | mit |
hawken93/mplayerhq | TOOLS/vobshift.py | 71 | 1048 | #!/usr/bin/env python
#usage:
#
# vobshift.py in.idx out.idx -8.45
#
# this will read in in.idx,shift it by 8.45 seconds back,
# and save it as out.idx
#
# license: i don't care ;)
#
import datetime
import sys
def tripletize(line):
begin = line[:11]
middle = line[11:23]
end = line[23:]
return (begin,middle,end)
... | gpl-2.0 |
aprefontaine/TMScheduler | tests/regressiontests/forms/localflavor/uy.py | 14 | 2014 | # -*- coding: utf-8 -*-
# Tests for the contrib/localflavor/ UY form fields.
tests = r"""
# UYDepartamentSelect #########################################################
>>> from django.contrib.localflavor.uy.forms import UYDepartamentSelect
>>> f = UYDepartamentSelect()
>>> f.render('departamentos', 'S')
u'<select n... | bsd-3-clause |
earshel/PokeyPyManager | POGOProtos/Networking/Requests/Messages/DownloadRemoteConfigVersionMessage_pb2.py | 16 | 4749 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Requests/Messages/DownloadRemoteConfigVersionMessage.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import m... | mit |
chubbymaggie/CuckooSploit | utils/db_migration/versions/from_0_6_to_1_1.py | 6 | 14422 | # Copyright (C) 2010-2015 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
"""Database migration from Cuckoo 0.6 to Cuckoo 1.1.
Revision ID: 263a45963c72
Revises: None
Create Date: 2014-03-23 23:30:36.756792
"""
# Revision ... | gpl-3.0 |
brokenjacobs/ansible | lib/ansible/modules/utilities/logic/include.py | 50 | 2305 | #!/usr/bin/python
# -*- mode: python -*-
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the... | gpl-3.0 |
gooddata/openstack-nova | nova/tests/unit/virt/vmwareapi/test_volumeops.py | 2 | 33206 | # 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 |
m4yers/crutch | crutch/core/repl/keys.py | 1 | 2604 | # -*- coding: utf-8 -*-
# Copyright © 2017 Artyom Goncharov
#
# 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... | mit |
eMarco/kernel_samsung_tuna | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
umitanuki/chainer | chainer/functions/negative_sampling.py | 4 | 6735 | import numpy
import six
from chainer import cuda
from chainer import function
from chainer.utils import type_check
from chainer.utils import walker_alias
class NegativeSampling(function.Function):
"""Implementation of negative sampling.
In natural language processing, especially language modeling, the numbe... | mit |
alexallah/django | django/db/models/fields/files.py | 11 | 18028 | import datetime
import posixpath
from django import forms
from django.core import checks
from django.core.files.base import File
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.core.validators import validate_image_file_extension
from django.db.models im... | bsd-3-clause |
Medigate/cutiuta-server | cutiuta-server/env/lib/python3.4/site-packages/django/utils/termcolors.py | 87 | 7302 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... | gpl-3.0 |
javierTerry/odoo | addons/web/doc/_themes/flask_theme_support.py | 2228 | 4875 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = "... | agpl-3.0 |
wfxiang08/django178 | django/contrib/formtools/tests/wizard/namedwizardtests/forms.py | 95 | 1760 | import os
import tempfile
from django import forms
from django.core.files.storage import FileSystemStorage
from django.forms.formsets import formset_factory
from django.http import HttpResponse
from django.template import Template, Context
from django.contrib.auth.models import User
from django.contrib.formtools.wiz... | bsd-3-clause |
Evil-Green/Lonas_KL-GT-I9300 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
ikona23/driftsuspensions | node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 1366 | 120842 | # 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.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... | mit |
40223220/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/display.py | 603 | 25179 | #!/usr/bin/env python
'''Pygame module to control the display window and screen.
This module offers control over the pygame display. Pygame has a single display
Surface that is either contained in a window or runs full screen. Once you
create the display you treat it as a regular Surface. Changes are not
immediately ... | gpl-3.0 |
jjscarafia/server-tools | base_optional_quick_create/model.py | 41 | 2507 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 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 |
cloudbase/neutron | neutron/services/trunk/drivers/linuxbridge/driver.py | 4 | 1688 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 |
vmarkovtsev/django | tests/invalid_models_tests/test_backend_specific.py | 191 | 1024 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.core.checks import Error
from django.db import connections, models
from django.test import mock
from .base import IsolatedModelsTestCase
def dummy_allow_migrate(db, app_label, **hints):
# Prevent checks from being run on the 'other' d... | bsd-3-clause |
caot/intellij-community | python/lib/Lib/site-packages/django/core/management/base.py | 248 | 16452 | """
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
import os
import sys
from optparse import make_option, OptionParser
import django
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color import ... | apache-2.0 |
jonyroda97/redbot-amigosprovaveis | lib/youtube_dl/extractor/youtube.py | 1 | 131830 | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import os.path
import random
import re
import time
import traceback
from .common import InfoExtractor, SearchInfoExtractor
from ..jsinterp import JSInterpreter
from ..swfinterp import SWFInterpreter
from ..compat import (
compa... | gpl-3.0 |
michaelkirk/QGIS | python/plugins/processing/algs/qgis/PointsInPolygonWeighted.py | 1 | 5085 | # -*- coding: utf-8 -*-
"""
***************************************************************************
PointsInPolygon.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... | gpl-2.0 |
xrg/django-static-gitified | django/core/management/commands/runserver.py | 77 | 5859 | from optparse import make_option
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application
from django.utils import autoreload
naiveip_re = re.compil... | bsd-3-clause |
dongpf/hadoop-0.19.1 | src/contrib/hod/testing/helper.py | 182 | 1122 | #Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... | apache-2.0 |
dstrockis/outlook-autocategories | lib/azure/storage/queue/_encryption.py | 1 | 7544 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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://ww... | apache-2.0 |
olexiim/edx-platform | lms/djangoapps/instructor_task/tests/test_views.py | 204 | 17817 |
"""
Test for LMS instructor background task views.
"""
import json
from celery.states import SUCCESS, FAILURE, REVOKED, PENDING
from mock import Mock, patch
from django.utils.datastructures import MultiValueDict
from instructor_task.models import PROGRESS
from instructor_task.tests.test_base import (InstructorTaskT... | agpl-3.0 |
yxcoin/yxcoin | src/boost_1_55_0/tools/build/v2/test/library_chain.py | 44 | 3427 | #!/usr/bin/python
# Copyright 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test that a chain of libraries works ok, no matter if we use static or shared
# linking.
import BoostBuil... | mit |
brennie/reviewboard | reviewboard/admin/widgets.py | 7 | 17971 | from __future__ import unicode_literals
import datetime
import logging
import re
import time
from django.core.cache import cache
from django.contrib.auth.models import User
from django.db.models.aggregates import Count
from django.db.models.signals import post_save, post_delete
from django.template.context import Req... | mit |
eli-schwartz/Sigil | src/Resource_Files/plugin_launchers/python/sigil_bs4/builder/_htmlparser.py | 6 | 9793 | from __future__ import unicode_literals, division, absolute_import, print_function
import sys
PY3 = sys.version_info[0] == 3
if PY3:
text_type = str
binary_type = bytes
unicode = str
basestring = str
else:
range = xrange
text_type = unicode
binary_type = str
chr = unichr
"""Use the HTM... | gpl-3.0 |
susilehtola/psi4 | psi4/driver/procrouting/findif_response_utils/data_collection_helper.py | 6 | 4102 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
wangjun/odoo | openerp/addons/base/tests/test_menu.py | 501 | 1450 | import openerp.tests.common as common
class test_menu(common.TransactionCase):
def setUp(self):
super(test_menu,self).setUp()
self.Menus = self.registry('ir.ui.menu')
def test_00_menu_deletion(self):
"""Verify that menu deletion works properly when there are child menus, and those
... | agpl-3.0 |
angad/libjingle-mac | scons-2.2.0/engine/SCons/exitfuncs.py | 14 | 2436 | """SCons.exitfuncs
Register functions which are executed when SCons exits for any reason.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associate... | bsd-3-clause |
gpoesia/servo | tests/wpt/harness/wptrunner/manifestupdate.py | 116 | 17251 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import urlparse
from collections import namedtuple, defaultdict
from wptmanifest.node import (DataNode, Condi... | mpl-2.0 |
LorneWu/e-Gental-downloader | note tor_try_cloudflare_fail.py | 1 | 1111 | import socks
import socket
from urllib.request import urlopen
import requests
import header_s
import time
from bs4 import BeautifulSoup
socks.set_default_proxy(socks.SOCKS5, "localhost", 9050)
socket.socket = socks.socksocket
print(requests.get('http://icanhazip.com').text)
print(urlopen('http://icanhazip.com').r... | gpl-3.0 |
aperigault/ansible | lib/ansible/modules/cloud/amazon/ec2_metric_alarm.py | 11 | 12566 | #!/usr/bin/python
# Copyright: 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': ['stableinterf... | gpl-3.0 |
ulnic/weatherSensor | data/ConfigurationReader.py | 1 | 2775 | #!/usr/bin/python
"""
Configuration Handler
"""
import logging
# noinspection PyCompatibility
import ConfigParser
import data.Constants
logger = logging.getLogger(data.Constants.Constant.LOGGER_NAME)
class ConfigurationReader(object):
"""
Class handling the configuration parser from the configuration.ini fil... | mit |
rodrigc/buildbot | master/buildbot/test/unit/util/test_netstrings.py | 6 | 1708 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
kigawas/shadowsocks | shadowsocks/daemon.py | 694 | 5602 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014-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 requi... | apache-2.0 |
simartin/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptrunner.py | 1 | 18782 | from __future__ import print_function, unicode_literals
import json
import os
import sys
from six import iteritems, itervalues
import wptserve
from wptserve import sslutils
from . import environment as env
from . import instruments
from . import mpcontext
from . import products
from . import testloader
from . impor... | mpl-2.0 |
boddmg/dsp-playground | experiment.py | 1 | 2717 | from matplotlib import pyplot as plt
import numpy as np
import math
import pickle
from scipy import signal
from numpy.fft import rfft, irfft
from numpy import argmax, sqrt, mean, absolute, arange, log10
from scipy.signal import blackmanharris
import thdn
def single_frequency_filter(input_signal):
y_f_all = np.fft.... | mit |
sidzan/netforce | netforce_general/netforce_general/set_module_version.py | 2 | 1178 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, publ... | mit |
farra/apachecon-consite | public/javascripts/fckeditor/_samples/py/sampleposteddata.py | 1 | 2067 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2007 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | mit |
Akson/RemoteConsolePlus3 | RemoteConsolePlus3/RCP3/Backends/Sources/ZMQ/Tools/UI.py | 1 | 5885 | #Created by Dmytro Konobrytskyi, 2013 (github.com/Akson)
import wx
from RCP3.Backends.Sources.ZMQ.Tools.RoutersListProvider import GetAvailableRoutersList
class ServerSelectionDialog(wx.Dialog):
def __init__(self, currentServerAddress = None):
super(ServerSelectionDialog, self).__init__(parent=None, size=(... | lgpl-3.0 |
imrandomizer/Algorithm-Implementations | Hamming_Code/Python/AlexMathew/HammingCode.py | 27 | 1830 | """
AUTHOR : Alex Mathew
EMAIL : alexmathew003@gmail.com
There is a lot I can do to improve this implementation.
"""
"""For a given binary word, print out its corresponding Hamming Coded word"""
import math
def FindKeyBits(n):
keyBits=[]
pad = int(math.ceil(math.log(n)/math.log(2)))
for i in xrange(1, n+1):... | mit |
nachandr/cfme_tests | cfme/tests/perf/workloads/test_idle.py | 2 | 2619 | """Runs Idle Workload by resetting appliance and enabling specific roles with no providers."""
import time
import pytest
from cfme.utils.conf import cfme_performance
from cfme.utils.grafana import get_scenario_dashboard_urls
from cfme.utils.log import logger
from cfme.utils.smem_memory_monitor import add_workload_qua... | gpl-2.0 |
optimizers/nlpy | nlpy/optimize/solvers/nlpy_funnel.py | 3 | 5078 | #!/usr/bin/env python
from nlpy import __version__
from nlpy.model import AmplModel
from nlpy.optimize.solvers.funnel import Funnel, LSTRFunnel, LDFPFunnel, \
StructuredLDFPFunnel
from nlpy.tools.timing import cputime
from optparse import OptionParser
import numpy
import nlpy.t... | gpl-3.0 |
MostlyOpen/odoo_addons | myo_document/models/document_seq.py | 1 | 3257 | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
#... | agpl-3.0 |
sanghinitin/golismero | tools/theHarvester/discovery/DNS/Base.py | 24 | 11574 | """
$Id: Base.py,v 1.12.2.4 2007/05/22 20:28:31 customdesigned Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License.
Base functionality. Request and Response classes, that sort of thing.
"""
import socket, string, types, time
im... | gpl-2.0 |
station7/xbmc | addons/service.xbmc.versioncheck/lib/common.py | 82 | 6948 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Team-XBMC
#
# 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 versio... | gpl-2.0 |
sbesson/openmicroscopy | docs/sphinx-api/conf.py | 6 | 4384 | # -*- coding: utf-8 -*-
#
# OMERO.py API documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 23 12:22:32 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | gpl-2.0 |
mfacorcoran/pycaldb | nustar_caldb/nustar_caldb_patch.py | 1 | 9035 | def patch_nustar_caldb(version,
nupatchserver = "hassif.caltech.edu",
nupatchworkdir = "/pub/nustar/pipeline",
caldb = "/FTP/caldb",
caldbstage = "/FTP/caldb/staging",
ck_file_exists='True'):
"""
C... | gpl-2.0 |
chand3040/sree_odoo | openerp/addons/l10n_ar/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
camptocamp/ngo-addons-backport | addons/resource/resource.py | 35 | 25745 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
ethereum/solidity | scripts/regressions.py | 1 | 4285 | #!/usr/bin/env python3
from argparse import ArgumentParser
import sys
import os
import subprocess
import re
import glob
import threading
import time
DESCRIPTION = """Regressor is a tool to run regression tests in a CI env."""
class PrintDotsThread(object):
"""Prints a dot every "interval" (default is 300) second... | gpl-3.0 |
zhjunlang/kbengine | kbe/src/lib/python/Lib/multiprocessing/dummy/__init__.py | 79 | 2881 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [
'Process', 'current_process', 'active_children', 'freeze_support',
'Lock', 'RLock', 'Semaphore', 'Boun... | lgpl-3.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/eventlet-0.9.14/tests/parse_results.py | 7 | 3671 | import sys
import os
import traceback
try:
import sqlite3
except ImportError:
import pysqlite2.dbapi2 as sqlite3
import re
import glob
def parse_stdout(s):
argv = re.search('^===ARGV=(.*?)$', s, re.M).group(1)
argv = argv.split()
testname = argv[-1]
del argv[-1]
hub = None
reactor = Non... | apache-2.0 |
perzizzle/ansible-modules-extras | packaging/os/zypper_repository.py | 22 | 8763 | #!/usr/bin/python
# encoding: utf-8
# (c) 2013, Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
# (c) 2014, Justin Lecher <jlec@gentoo.org>
#
# 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
#... | gpl-3.0 |
lishuai12/onosfw-L3 | tools/test/topos/rftesttopo.py | 35 | 1679 | #!/usr/bin/env python
"""
"""
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.node import Node
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.util i... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.