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 |
|---|---|---|---|---|---|
MarkMolina/moneypenny-bot | lib/chardet/latin1prober.py | 290 | 5370 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
lmazuel/ansible | lib/ansible/modules/cloud/amazon/sns_topic.py | 50 | 14100 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distri... | gpl-3.0 |
hmgaudecker/econ-project-templates | docs/bld/example/python/python_example/.mywaflib/waflib/extras/slow_qt4.py | 54 | 2814 | #! /usr/bin/env python
# Thomas Nagy, 2011 (ita)
"""
Create _moc.cpp files
The builds are 30-40% faster when .moc files are included,
you should NOT use this tool. If you really
really want it:
def configure(conf):
conf.load('compiler_cxx qt4')
conf.load('slow_qt4')
See playground/slow_qt/wscript for a complete e... | bsd-3-clause |
slisson/intellij-community | python/lib/Lib/random.py | 86 | 30486 | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | apache-2.0 |
tpsatish95/Python-Workshop | Python Environment Setup/Alternate/1. Python/1. Installer/Python-3.4.0(Linux)/Lib/test/win_console_handler.py | 194 | 1416 | """Script used to test os.kill on Windows, for issue #1220212
This script is started as a subprocess in test_os and is used to test the
CTRL_C_EVENT and CTRL_BREAK_EVENT signals, which requires a custom handler
to be written into the kill target.
See http://msdn.microsoft.com/en-us/library/ms685049%28v=VS.85%29.aspx ... | apache-2.0 |
nrz/ylikuutio | external/bullet3/examples/pybullet/gym/pybullet_envs/agents/configs.py | 2 | 4587 | # Copyright 2017 The TensorFlow Agents 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 ag... | agpl-3.0 |
wgwoods/dnf | tests/test_cli.py | 8 | 10569 | # Copyright (C) 2012-2014 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 version.
# This program is distributed in the hope that it will... | gpl-2.0 |
ovnicraft/odoo | addons/mass_mailing/models/mass_mailing_report.py | 364 | 2244 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
from openerp import tools
class MassMailingReport(osv.Model):
_name = 'mail.statistics.report'
_auto = False
_description = 'Mass Mailing Statistics'
_columns = {
'scheduled_date': fields.datetime('Scheduled Date', readonly=True),
... | agpl-3.0 |
PolymorhicCode/Veil-Evasion | modules/payloads/python/shellcode_inject/download_inject.py | 3 | 4767 | """
Downloads shellcode over HTTP and executes it in memory
Optionally beacons back every X seconds
Based on the PoC from @midnite_runr https://github.com/secretsquirrel/shellcode_retriever
Module by @byt3bl33d3r
"""
from modules.common import helpers
class Payload:
def __init__(self):
self.description = "Do... | gpl-3.0 |
jimgong92/allezViens | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
wolcomm/prngmgr | setup.py | 1 | 1795 | #!/usr/bin/env python
# Copyright 2016-2017 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are 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://... | apache-2.0 |
assaron/pynlc | tests/test_board.py | 1 | 9235 | # -*- coding: utf-8 -*-
#
# Copyrigt 2010 Aleksey Sergushichev <alsergbox@gmail.com>
#
# This file is part of pynlc.
# Pynlc 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, ... | gpl-3.0 |
temasek/android_external_chromium_org | build/android/pylib/utils/reraiser_thread.py | 26 | 3965 | # 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.
"""Thread and ThreadGroup that reraise exceptions on the main thread."""
import logging
import sys
import threading
import time
import traceback
import wat... | bsd-3-clause |
coreynicholson/youtube-dl | youtube_dl/update.py | 66 | 6923 | from __future__ import unicode_literals
import io
import json
import traceback
import hashlib
import os
import subprocess
import sys
from zipimport import zipimporter
from .utils import encode_compat_str
from .version import __version__
def rsa_verify(message, signature, key):
from hashlib import sha256
as... | unlicense |
dfunckt/django | tests/unmanaged_models/tests.py | 62 | 2176 | from __future__ import unicode_literals
from django.db import connection
from django.test import TestCase
from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2
class SimpleTests(TestCase):
def test_simple(self):
"""
The main test here is that the all the models can be created w... | bsd-3-clause |
adam111316/SickGear | lib/hachoir_parser/network/common.py | 86 | 3443 | from hachoir_core.field import FieldSet, Field, Bits
from hachoir_core.bits import str2hex
from hachoir_parser.network.ouid import REGISTERED_OUID
from hachoir_core.endian import BIG_ENDIAN
from socket import gethostbyaddr, herror as socket_host_error
def ip2name(addr):
if not ip2name.resolve:
return addr
... | gpl-3.0 |
twz915/django | tests/model_inheritance/test_abstract_inheritance.py | 27 | 12010 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.checks import Error
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.db import models
from django.test import TestCase
from d... | bsd-3-clause |
nghia-huynh/gem5-stable | util/oprofile-top.py | 77 | 3162 | #! /usr/bin/env python
# Copyright (c) 2005 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 copyri... | bsd-3-clause |
robocomp/robocomp | tools/robocompdsl/templates/templateCPP/templatecpp.py | 1 | 1432 | import datetime
import os
from ..common.abstracttemplatesmanager import ComponentTemplatesManager
from ..common.plugin_collection import PluginCollection
from . import plugins
FILE_PATH = os.path.dirname(os.path.realpath(__file__))
class TemplatesManagerCpp(ComponentTemplatesManager):
def __init__(self, compone... | gpl-3.0 |
gojira/tensorflow | tensorflow/contrib/specs/python/specs_lib.py | 166 | 6145 | # 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 applicable ... | apache-2.0 |
40223112/0623test1 | static/Brython3.1.1-20150328-091302/Lib/sre_parse.py | 630 | 29657 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | gpl-3.0 |
jeasoft/odoo | addons/survey/__init__.py | 385 | 1037 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-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 |
JonatanS/cleanHackathonStarter | docqr_hackathonstarter1/node_modules/node-sass-middleware/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/common.py | 366 | 19638 | # 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.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
LubyRuffy/spiderfoot | ext/openxmllib/namespaces.py | 13 | 1153 | # -*- coding: utf-8 -*-
"""
Namespaces that may be used in various XML files
"""
# $Id: namespaces.py 6800 2007-12-04 11:17:01Z glenfant $
CONTENT_TYPES = 'http://schemas.openxmlformats.org/package/2006/content-types'
# Properties (common for all openxml types)
CORE_PROPERTIES = 'http://schemas.openxmlformats.org/pac... | gpl-2.0 |
rnirmal/cinder | cinder/tests/api/openstack/volume/test_types.py | 4 | 7160 | # Copyright 2011 OpenStack LLC.
# 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 b... | apache-2.0 |
auscompgeek/chickenpie | chickenpie/debugger.py | 1 | 2507 | #!/usr/bin/env python
from __future__ import print_function
import sys
import traceback
from chickenpie import opcodes
from chickenpie.vm import Machine
def boot(argv=sys.argv):
m = Machine()
m.load_file(argv[1])
if len(argv) >= 3:
m.load_input(argv[2])
return m
def input_reader():
EX... | mit |
40223102/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/types.py | 756 | 3167 | """
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... | gpl-3.0 |
jeffdwyatt/taiga-back | taiga/external_apps/api.py | 8 | 4262 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 the F... | agpl-3.0 |
telefonicaid/fiware-IoTAgent-Cplusplus | third_party/mosquitto-1.4.4/test/broker/03-publish-b2c-timeout-qos2.py | 6 | 2400 | #!/usr/bin/env python
# Test whether a SUBSCRIBE to a topic with QoS 2 results in the correct SUBACK packet.
import subprocess
import socket
import time
from os import environ
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpat... | agpl-3.0 |
fireeye/flare-ida | python/flare/objc2_xrefs_helper.py | 1 | 21650 | ############################################
##Author: James T. Bennett
##Objective-C xrefs helper IDApython script
############################################
########################################################################
# Copyright 2019 FireEye
#
# FireEye licenses this file to you under the Apac... | apache-2.0 |
timchen86/ntulifeguardapp | gdata-2.0.18/tests/gdata_tests/resumable_upload_test.py | 41 | 4572 | #!/usr/bin/env python
#
# Copyright (C) 2008, 2009 Google 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 appli... | apache-2.0 |
jazkarta/edx-platform-for-isc | lms/djangoapps/staticbook/views.py | 57 | 6333 | """
Views for serving static textbooks.
"""
from django.contrib.auth.decorators import login_required
from django.http import Http404
from edxmako.shortcuts import render_to_response
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.annotator_token import retrieve_token
from courseware.acces... | agpl-3.0 |
frastlin/PyAudioGame | pyaudiogame/console.py | 1 | 4516 | """Simple example showing how to get keyboard events.
Note that the mouse events don't work very well. Something is wrong with the pipe process that keeps the mouse event process from exiting in the inputs script. The bug has been reported, and as soon as it is fixed, uncommenting the run_mouse() function will work.
pr... | mit |
SuriyaaKudoIsc/olympia | apps/devhub/tests/test_views_versions.py | 1 | 33530 | import re
from datetime import datetime, timedelta
import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
from django.core.files import temp
import amo
import amo.tests
from amo.urlresolvers import reverse
from amo.tests import formset, initial
from addons.models import Addon
from applications.mode... | bsd-3-clause |
ctk3b/mbuild | mbuild/recipes/monolayer.py | 3 | 3520 | from copy import deepcopy
from warnings import warn
import numpy as np
import mbuild as mb
__all__ = ['Monolayer']
class Monolayer(mb.Compound):
"""A general monolayer recipe.
Parameters
----------
surface : mb.Compound
Surface on which the monolayer will be built.
chains : list of mb.... | mit |
coberger/DIRAC | Core/Utilities/DEncode.py | 12 | 6959 | # $HeadURL$
"""
Encoding and decoding for dirac, Ids:
i -> int
I -> long
f -> float
b -> bool
s -> string
z -> datetime
n -> none
l -> list
t -> tuple
d -> dictionary
"""
__RCSID__ = "$Id$"
import types
import datetime
_dateTimeObject = datetime.datetime.utcnow()
_dateTimeType = type( _dateTimeObject )
_dat... | gpl-3.0 |
DivineHime/seishirou | lib/youtube_dl/extractor/bellmedia.py | 35 | 2862 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class BellMediaIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?P<domain>
(?:
ctv|
tsn|
bnn|
thecomedynetwork|
... | gpl-3.0 |
gisce/OCB | addons/account/account_bank_statement.py | 12 | 29621 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
kyoren/https-github.com-h2oai-h2o-3 | py2/h2o_gbm.py | 30 | 16328 |
import re, random, math
import h2o_args
import h2o_nodes
import h2o_cmd
from h2o_test import verboseprint, dump_json, check_sandbox_for_errors
def plotLists(xList, xLabel=None, eListTitle=None, eList=None, eLabel=None, fListTitle=None, fList=None, fLabel=None, server=False):
if h2o_args.python_username!='kevin':
... | apache-2.0 |
eltonsantos/django | django/contrib/staticfiles/utils.py | 322 | 1973 | import os
import fnmatch
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patter... | bsd-3-clause |
rocky/python2-trepan | trepan/processor/command/info_subcmd/display.py | 2 | 1780 | # -*- coding: utf-8 -*-
# Copyright (C) 2009, 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 you... | gpl-3.0 |
thanm/devel-scripts | build-aosp-toolchain.py | 1 | 8147 | #!/usr/bin/python3
"""Perform a previously configured AOSP toolchain build.
This script kicks off a series of builds of the toolchain gcc compiler
for Android. It relies on previously established symbolic links set
up by hand or by "setup-aosp-toolchain-build.py".
"""
import getopt
import importlib
import multiproce... | apache-2.0 |
madprof/alpha-hub | prototype/config.py | 1 | 1644 | # put this into ~/.alphahub/config.py and make sure it's not
# readable by anyone else (it contains passwords!)
# the host we run on and want to receive packets on; note
# that "localhost" is probably the wrong thing here, you
# want a host name that refers to an external network so you
# can receive packets from the ... | agpl-3.0 |
thomasrogers03/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py | 652 | 14786 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
badloop/SickRage | lib/mako/lookup.py | 34 | 12847 | # mako/lookup.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import os
import stat
import posixpath
import re
from mako import exceptions, util
from mako.templa... | gpl-3.0 |
chekunkov/scrapy | scrapy/contrib/pipeline/__init__.py | 142 | 1270 | """
Item pipeline
See documentation in docs/item-pipeline.rst
"""
from scrapy.middleware import MiddlewareManager
from scrapy.utils.conf import build_component_list
class ItemPipelineManager(MiddlewareManager):
component_name = 'item pipeline'
@classmethod
def _get_mwlist_from_settings(cls, settings):
... | bsd-3-clause |
shacker/django | tests/gis_tests/geoadmin/tests.py | 35 | 4277 | from django.contrib.gis import admin
from django.contrib.gis.geos import Point
from django.test import TestCase, override_settings
from django.test.utils import patch_logger
from .admin import UnmodifiableAdmin
from .models import City, site
@override_settings(ROOT_URLCONF='django.contrib.gis.tests.geoadmin.urls')
c... | bsd-3-clause |
ejucovy/django-opendebates | opendebates/tests/test_registration.py | 1 | 4946 | import os
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from .factories import UserFactory
class RegisterTest(TestCase):
def setUp(self):
self.url = reverse('registration_regis... | apache-2.0 |
abdoosh00/edx-rtl-final | lms/djangoapps/certificates/migrations/0003_auto__add_field_generatedcertificate_enabled.py | 188 | 6869 | # -*- coding: utf-8 -*-
import 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 'GeneratedCertificate.enabled'
db.add_column('certificates_generatedcertificate', 'enabled',
... | agpl-3.0 |
dimara/synnefo | snf-pithos-app/pithos/api/management/commands/reconcile-resources-pithos.py | 10 | 5407 | # Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-3.0 |
AdamDynamic/TwitterMetrics | TrendingTermsSentiment.py | 1 | 1025 | #!/usr/bin/env python
# Scans twitter for trending terms, populates a database with the results and
# then creates a json file showing trends based on the data
import CreateJson as j
import TwitterSearch as t
import KeywordSearch as k
import Log as l
import logging
ProcessResult = False
FN_NAME = "TrendingTermsSenti... | gpl-2.0 |
MOOCworkbench/MOOCworkbench | docs_manager/views.py | 1 | 2518 | from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.shortcuts import redirect, render
from django.views import View
from experiments_manager.consumers import send_message
from experiments_manager.helper import MessageStatus
from git_manager.helpers.git_helper impo... | mit |
mystique1029/namebench | libnamebench/selectors.py | 176 | 3262 | #!/usr/bin/env python
# Copyright 2009 Google 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/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
pitch-sands/i-MPI | flask/Lib/site-packages/pip-1.5.6-py2.7.egg/pip/commands/bundle.py | 392 | 1787 | import textwrap
from pip.locations import build_prefix, src_prefix
from pip.util import display_path, backup_dir
from pip.log import logger
from pip.exceptions import InstallationError
from pip.commands.install import InstallCommand
class BundleCommand(InstallCommand):
"""Create pybundles (archives containing mul... | bsd-3-clause |
nigroup/pypet | pypet/tests/profiling/speed_analysis/storage_analysis/avg_runtima_as_function_of_length_plot_times.py | 2 | 3376 | __author__ = 'robert'
from pypet import Environment, Trajectory
from pypet.tests.testutils.ioutils import make_temp_dir, get_log_config
import os
import matplotlib.pyplot as plt
import numpy as np
import time
import numpy as np
import scipy.sparse as spsp
from pycallgraph import PyCallGraph, Config, GlobbingFilter
... | bsd-3-clause |
sameetb-cuelogic/edx-platform-test | common/lib/xmodule/xmodule/contentstore/utils.py | 235 | 1470 | from xmodule.contentstore.content import StaticContent
from .django import contentstore
def empty_asset_trashcan(course_locs):
'''
This method will hard delete all assets (optionally within a course_id) from the trashcan
'''
store = contentstore('trashcan')
for course_loc in course_locs:
... | agpl-3.0 |
tsgit/invenio | modules/webjournal/lib/elements/bfe_webjournal_rss.py | 25 | 5765 | # -*- coding: utf-8 -*-
## $Id: bfe_webjournal_widget_whatsNew.py,v 1.24 2009/01/27 07:25:12 jerome Exp $
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## publis... | gpl-2.0 |
Nepherhotep/django | tests/custom_managers/tests.py | 178 | 23098 | from __future__ import unicode_literals
from django.db import models
from django.test import TestCase
from django.utils import six
from .models import (
Book, Car, CustomManager, CustomQuerySet, DeconstructibleCustomManager,
FunPerson, OneToOneRestrictedModel, Person, PersonFromAbstract,
PersonManager, Pu... | bsd-3-clause |
AlexandrDemin/flask_app | dbProvider.py | 1 | 6554 | import json
import random
from operator import itemgetter
# absolutePath = '/home/noidea91/flask_app/'
absolutePath = ''
def randomize(inArray, randomSeed = None, count = None):
tempList = inArray[:]
result = []
if count == None:
count = len(tempList) + 1
for i in range(1, count):
if randomSeed == None:
ra... | mit |
gangadhar-kadam/verve_test_erp | erpnext/buying/doctype/supplier/supplier.py | 6 | 3637 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe import msgprint, _
from frappe.model.naming import make_autoname
from erpnext.utilities.address_and_con... | agpl-3.0 |
alexzoo/python | selenium_tests/env/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py | 2994 | 1676 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | apache-2.0 |
mar10/wsgidav | wsgidav/prop_man/couch_property_manager.py | 1 | 8148 | # -*- coding: utf-8 -*-
# (c) 2009-2021 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Implements a property manager based on CouchDB.
http://wiki.apache.org/couchdb/Reference
http://packages.python.o... | mit |
mortenpi/ubuntu-software-center | softwarecenter/db/debfile.py | 3 | 8185 | # Copyright (C) 2010 Canonical
#
# Authors:
# Michael Vogt
#
# 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; version 3.
#
# This program is distributed in the hope that it will be useful, but W... | gpl-3.0 |
roxyboy/bokeh | bokeh/_glyph_functions.py | 13 | 32591 | from __future__ import absolute_import
from .models import glyphs, markers, BoxSelectTool
def _glyph_function(glyphclass, dsnames, argnames, docstring):
def func(plot, *args, **kwargs):
# Note: We want to reuse the glyph functions by attaching them the Plot
# class. Imports are here to prevent c... | bsd-3-clause |
iw3hxn/server | openerp/pychart/afm/Helvetica_LightOblique.py | 15 | 1529 | # -*- coding: utf-8 -*-
# AFM font Helvetica-LightOblique (path: /usr/share/fonts/afms/adobe/phvlo8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
import dir
dir.afm["Helvetica-LightOblique"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500... | agpl-3.0 |
iradul/phantomjs-clone | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py | 122 | 16269 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
chyeh727/django | tests/staticfiles_tests/test_views.py | 279 | 1312 | from __future__ import unicode_literals
import posixpath
from django.conf import settings
from django.test import override_settings
from .cases import StaticFilesTestCase, TestDefaults
@override_settings(ROOT_URLCONF='staticfiles_tests.urls.default')
class TestServeStatic(StaticFilesTestCase):
"""
Test sta... | bsd-3-clause |
isaacyeaton/pyadisi | pyadisi/pyqtgraph/tests/test_functions.py | 4 | 2026 | import pyqtgraph as pg
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_almost_equal
np.random.seed(12345)
def testSolve3D():
p1 = np.array([[0,0,0,1],
[1,0,0,1],
[0,1,0,1],
[0,0,1,1]], dtype=float)
# transform points ... | bsd-3-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.5.0/Lib/distutils/tests/test_filelist.py | 98 | 10073 | """Tests for distutils.filelist."""
import os
import re
import unittest
from distutils import debug
from distutils.log import WARN
from distutils.errors import DistutilsTemplateError
from distutils.filelist import glob_to_re, translate_pattern, FileList
from test.support import captured_stdout, run_unittest
from distu... | mit |
avneesh91/django | tests/test_client/test_conditional_content_removal.py | 131 | 1958 | import gzip
from django.http import HttpRequest, HttpResponse, StreamingHttpResponse
from django.test import SimpleTestCase
from django.test.client import conditional_content_removal
class ConditionalContentTests(SimpleTestCase):
def test_conditional_content_removal(self):
"""
Content is removed... | bsd-3-clause |
dpassante/ansible | test/sanity/code-smell/package-data.py | 4 | 12692 | #!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import contextlib
import fnmatch
import glob
import os
import re
import shutil
import subprocess
import sys
import tarfile
import tempfile
def assemble_files_to_ship(complete_file_list):
"""
This loo... | gpl-3.0 |
dyoung418/tensorflow | tensorflow/python/framework/registry_test.py | 143 | 1684 | # 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 |
codepython/Diamond | src/collectors/websitemonitor/websitemonitor.py | 35 | 2758 | # coding=utf-8
"""
Gather HTTP Response code and Duration of HTTP request
#### Dependencies
* urllib2
"""
import urllib2
import time
from datetime import datetime
import diamond.collector
class WebsiteMonitorCollector(diamond.collector.Collector):
"""
Gather HTTP response code and Duration of HTTP reques... | mit |
wetneb/django | tests/generic_relations_regress/tests.py | 25 | 11190 | from django.db.models import Q, Sum
from django.db.models.deletion import ProtectedError
from django.db.utils import IntegrityError
from django.forms.models import modelform_factory
from django.test import TestCase, skipIfDBFeature
from .models import (
A, B, C, D, Address, Board, CharLink, Company, Contact, Conte... | bsd-3-clause |
ah-anssi/SecuML | SecuML/core/Data/Predictions.py | 1 | 1490 | # SecuML
# Copyright (C) 2018 ANSSI
#
# SecuML 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.
#
# SecuML is distributed in the hope t... | gpl-2.0 |
ajoshpratt/westpa | src/oldtools/stats/accumulator.py | 4 | 1912 | # Copyright (C) 2013 Matthew C. Zwier and Lillian T. Chong
#
# This file is part of WESTPA.
#
# WESTPA 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 |
calben/retino | scripts/generate_overview_figure_one.py | 1 | 6562 | import pickle
import retino
from retino.plot import *
from retino.utils import *
sns.set_style("ticks")
def plot_axon_growth_direction_algorithm(origin, end, target, ax):
a_origin = origin
a_end = end
desired_direction_weight = 1.1
momentum_direction_weight = 1
desired_direction = get_unit_dir... | mit |
xia2/xia2 | tests/Modules/Scaler/test_DialsScalerHelper.py | 1 | 14958 | import random
import pytest
from cctbx import sgtbx
from dials.algorithms.symmetry.cosym._generate_test_data import generate_intensities
from dials.array_family import flex
from dxtbx.model import Beam, Crystal, Experiment, Scan
from dxtbx.model.experiment_list import ExperimentList
from dxtbx.serialize import load
fr... | bsd-3-clause |
kstrauser/ansible | plugins/inventory/softlayer.py | 91 | 6106 | #!/usr/bin/env python
"""
SoftLayer external inventory script.
The SoftLayer Python API client is required. Use `pip install softlayer` to install it.
You have a few different options for configuring your username and api_key. You can pass
environment variables (SL_USERNAME and SL_API_KEY). You can also write INI fil... | gpl-3.0 |
shubhamg31/columbus_julia | lib/gtest-1.7.0/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | apache-2.0 |
adamLange/moose | gui/gui/InputFileWidget.py | 22 | 10291 | #!/usr/bin/python
import os, sys, getopt
try:
from PyQt4 import QtCore, QtGui
QtCore.Signal = QtCore.pyqtSignal
QtCore.Slot = QtCore.pyqtSlot
except ImportError:
try:
from PySide import QtCore, QtGui
QtCore.QString = str
except ImportError:
raise ImportError("Cannot load eit... | lgpl-2.1 |
Edraak/edraak-platform | cms/djangoapps/maintenance/tests.py | 9 | 9303 | """
Tests for the maintenance app views.
"""
import json
import ddt
from django.conf import settings
from django.urls import reverse
from contentstore.management.commands.utils import get_course_versions
from student.tests.factories import AdminFactory, UserFactory
from xmodule.modulestore import ModuleStoreEnum
from... | agpl-3.0 |
soldag/home-assistant | homeassistant/components/risco/const.py | 15 | 1258 | """Constants for the Risco integration."""
from homeassistant.const import (
CONF_SCAN_INTERVAL,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
)
DOMAIN = "risco"
RISCO_EVENT = "risco_event"
DATA_COORDINATOR = "risco"
EVENTS_COORDINATOR = "risco_events"
DEFAULT_SCAN_INTERVAL = 30
CONF_CODE_ARM_REQUIR... | apache-2.0 |
mlu/PyMata | examples/i2c/pymata_i2c_read/i2c_read_callback.py | 3 | 2203 | #!/usr/bin/env python
__author__ = 'Copyright (c) 2013 Alan Yorinks All rights reserved.'
"""
Copyright (c) 2013 Alan Yorinks All rights reserved.
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; e... | gpl-3.0 |
mit-probabilistic-computing-project/crosscat | src/utils/file_utils.py | 2 | 2073 | #
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# Lead Developers: Dan Lovell and Jay Baxter
# Authors: Dan Lovell, Baxter Eaves, Jay Baxter, Vikash Mansinghka
# Research Leads: Vikash Mansinghka, Patrick Shafto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may... | apache-2.0 |
k11a/snmptablemixer | pysnmp/proto/secmod/rfc3414/priv/des.py | 2 | 4838 | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pysnmp.sf.net/license.html
#
import random
from pysnmp.proto.secmod.rfc3414.priv import base
from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha
from pysnmp.proto.secmod.rfc3414 import loc... | gpl-3.0 |
sunzhxjs/JobGIS | lib/python2.7/site-packages/pandas/util/terminal.py | 16 | 3559 | """
get_terminal_size() -- return width and height of terminal as a tuple
code from:
http://stackoverflow.com/questions/566746/how-to-get-console- window-width-in-
python
written by
Harco Kuppens (http://stackoverflow.com/users/825214/harco-kuppens)
It is mentioned in the stackoverflow response that this code works
... | mit |
SellWellDesigns/orion | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/sql.py | 198 | 23461 | # -*- coding: utf-8 -*-
"""
pygments.lexers.sql
~~~~~~~~~~~~~~~~~~~
Lexers for various SQL dialects and related interactive sessions.
Postgres specific lexers:
`PostgresLexer`
A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL
lexer are:
- keywords and dat... | mit |
diorcety/intellij-community | python/lib/Lib/sched.py | 83 | 4538 | """A generally useful event scheduler class.
Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.
Each instance is parametrized with two functions, one that is
supposed to return the current time, one that i... | apache-2.0 |
lenstr/rethinkdb | external/v8_3.30.33.16/tools/testrunner/server/status_handler.py | 123 | 4154 | # Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | agpl-3.0 |
goir/virtualenv-creator | create_virtualenv.py | 1 | 7979 | #!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import argparse
import hashlib
import inspect
import subprocess
import sys
import os
import urllib2
import shutil
WHEEL_PIP = 'https://pypi.python.org/packages/py2.p... | gpl-2.0 |
sharkerz/deluge-yarss-plugin | yarss2/lib/requests/packages/chardet/mbcssm.py | 215 | 18214 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
vFense/vFenseAgent-nix | agent/deps/rpm6-32/Python-2.7.5/lib/python2.7/encodings/mac_roman.py | 593 | 13736 | """ Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.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,input,err... | lgpl-3.0 |
regebro/svg.path | src/svg/path/tests/test_tokenizer.py | 1 | 2492 | import pytest
from svg.path import parser
PATHS = [
(
"M 100 100 L 300 100 L 200 300 z",
[("M", "100 100"), ("L", "300 100"), ("L", "200 300"), ("z", "")],
[("M", 100 + 100j), ("L", 300 + 100j), ("L", 200 + 300j), ("z",)],
),
(
"M 5 1 v 7.344 A 3.574 3.574 0 003.5 8 3.515 3.... | mit |
Carmezim/tensorflow | tensorflow/python/kernel_tests/extract_image_patches_grad_test.py | 132 | 3405 | # 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 |
sestrella/ansible | lib/ansible/modules/network/avi/avi_cloud.py | 24 | 11640 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
Qalthos/ansible | test/units/modules/cloud/kubevirt/test_kubevirt_vm.py | 18 | 5399 | import json
import pytest
from units.compat.mock import patch, MagicMock
from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes
from ansible.module_utils.k8s.common import K8sAnsibleMixin
from ansible.module_utils.k8s.raw import KubernetesRawModule
from ansible.modules.cloud.kubevirt ... | gpl-3.0 |
VirtusLab/ansible-modules-extras | cloud/cloudstack/cs_volume.py | 33 | 15246 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Jefferson Girão <jefferson@girao.net>
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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... | gpl-3.0 |
biodrone/plex-desk | desk/flask/lib/python3.4/site-packages/sqlalchemy/dialects/mysql/__init__.py | 79 | 1171 | # mysql/__init__.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from . import base, mysqldb, oursql, \
pyodbc, zxjdbc, mysqlconnector, pymysql... | mit |
hfp/tensorflow-xsmm | tensorflow/python/data/kernel_tests/repeat_test.py | 6 | 3296 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.