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 |
|---|---|---|---|---|---|
bob-the-hamster/commandergenius | project/jni/python/src/Doc/conf.py | 32 | 5656 | # -*- coding: utf-8 -*-
#
# Python documentation build configuration file
#
# 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 (module imports are okay, they're removed automatically).
... | lgpl-2.1 |
lucashmorais/x-Bench | mozmill-env/python/Lib/lib2to3/pgen2/driver.py | 212 | 5164 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Modifications:
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser driver.
This provides a high-level interface to parse a file into a synta... | mit |
benbovy/xarray-simlab | xsimlab/tests/fixture_process.py | 1 | 6399 | from textwrap import dedent
import attr
import pytest
import xsimlab as xs
from xsimlab.process import get_process_obj
@xs.process
class SomeProcess:
"""Just used for foreign variables in ExampleProcess."""
some_var = xs.variable(
groups="some_group", intent="out", global_name="some_global_var"
... | bsd-3-clause |
hyperized/ansible | test/units/modules/network/fortios/test_fortios_switch_controller_switch_interface_tag.py | 21 | 7873 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
ngovindaraj/Udacity_Projects | Data_Wrangling/osm_to_csv.py | 1 | 6585 | import csv
import codecs
import pprint
import re
import xml.etree.cElementTree as ET
import cerberus
import schema
# Converting the cleaned osm file to csv
OSM_PATH = "san-francisco_sample.osm"
# OSM_PATH = "san-francisco-modified.osm"
NODES_PATH = "nodes.csv"
NODE_TAGS_PATH = "nodes_tags.csv"
WAYS_PATH = "ways.c... | mit |
AICP/external_chromium_org | chrome/common/extensions/docs/server2/path_canonicalizer.py | 16 | 4879 | # 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.
from collections import defaultdict
import posixpath
from future import Future
from path_util import SplitParent
from special_paths import SITE_VERIFICATION... | bsd-3-clause |
clinton-hall/nzbToMedia | libs/common/subliminal/video.py | 14 | 7852 | # -*- coding: utf-8 -*-
from __future__ import division
from datetime import datetime, timedelta
import logging
import os
from guessit import guessit
logger = logging.getLogger(__name__)
#: Video extensions
VIDEO_EXTENSIONS = ('.3g2', '.3gp', '.3gp2', '.3gpp', '.60d', '.ajp', '.asf', '.asx', '.avchd', '.avi', '.bik'... | gpl-3.0 |
thingsinjars/electron | tools/js2asar.py | 7 | 1416 | #!/usr/bin/env python
import errno
import os
import shutil
import subprocess
import sys
import tempfile
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
archive = sys.argv[1]
js_source_files = sys.argv[2:]
output_dir = tempfile.mkdtemp()
copy_js(js_source_files, output_dir)
call_asar(... | mit |
alaski/nova | nova/scheduler/scheduler_options.py | 15 | 3340 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
mecamiratries/printrundensity | printrun/gui/bufferedcanvas.py | 21 | 3286 | """
BufferedCanvas -- flicker-free canvas widget
Copyright (C) 2005, 2006 Daniel Keep, 2011 Duane Johnson
To use this widget, just override or replace the draw method.
This will be called whenever the widget size changes, or when
the update method is explicitly called.
Please submit any improvements/bugfixes/ideas to... | gpl-3.0 |
sergio-incaser/bank-payment | __unported__/account_banking/wizard/banktools.py | 13 | 11967 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General ... | agpl-3.0 |
o5k/openerp-oemedical-v0.1 | openerp/addons/auth_openid/__init__.py | 443 | 1090 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
coderbone/SickRage | lib/subliminal/video.py | 9 | 19384 | # -*- coding: utf-8 -*-
from __future__ import division
from datetime import datetime, timedelta
import hashlib
import logging
import os
import struct
from babelfish import Error as BabelfishError, Language
from enzyme import Error as EnzymeError, MKV
from guessit import guess_episode_info, guess_file_info, guess_movi... | gpl-3.0 |
dhananjay92/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/wait.py | 263 | 3563 | # Copyright 2011 Software Freedom Conservancy.
#
# 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... | mpl-2.0 |
shabab12/edx-platform | common/lib/xmodule/xmodule/tests/test_conditional.py | 131 | 12910 | import json
import unittest
from fs.memoryfs import MemoryFS
from mock import Mock, patch
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.error_module import NonStaffErrorDescriptor
from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location
from xmodule.modules... | agpl-3.0 |
littlstar/chromium.src | third_party/tlslite/tlslite/utils/openssl_tripledes.py | 202 | 1788 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""OpenSSL/M2Crypto 3DES implementation."""
from .cryptomath import *
from .tripledes import *
if m2cryptoLoaded:
def new(key, mode, IV):
return OpenSSL_TripleDES(key, mode, IV)
class OpenSSL_TripleDES(... | bsd-3-clause |
tuxfux-hlp-notes/python-batches | batch-67/19-files/myenv/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py | 320 | 103230 | # coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... | gpl-3.0 |
twiest/openshift-tools | openshift/installer/vendored/openshift-ansible-3.7.42-1/roles/lib_openshift/src/class/oc_adm_csr.py | 18 | 7497 | # pylint: skip-file
# flake8: noqa
class OCcsr(OpenShiftCLI):
''' Class to wrap the oc adm certificate command line'''
kind = 'csr'
# pylint: disable=too-many-arguments
def __init__(self,
nodes=None,
approve_all=False,
service_account=None,
... | apache-2.0 |
mtrgroup/django-mtr-sync | mtr/sync/lib/processors/xlsx.py | 1 | 2227 | import os
os.environ['OPENPYXL_LXML'] = 'False'
import openpyxl
from ..processor import Processor
from ..manager import manager
from ...translation import gettext_lazy as _
@manager.register('processor')
class XlsxProcessor(Processor):
file_format = '.xlsx'
file_description = _('Microsoft Excel 2007/2010/2... | mit |
necaris/python3-openid | openid/store/filestore.py | 1 | 12673 | """
This module contains an C{L{OpenIDStore}} implementation backed by
flat files.
"""
import string
import os
import os.path
import time
import logging
from errno import EEXIST, ENOENT
from tempfile import mkstemp
from openid.association import Association
from openid.store.interface import OpenIDStore
from openid... | apache-2.0 |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/ZBng/PyScripts/Lib/zbng/mca/network/cmd/shares/type_Result.py | 1 | 9203 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: type_Result.py
from types import *
RESULT_LIST_TYPE_UNKNOWN = 0
RESULT_LIST_TYPE_WILDCARD = 1
RESULT_LIST_TYPE_DISK_DEVICE = 2
RESULT_LIST_TYPE_SPOOL... | unlicense |
sidartaoliveira/ansible | lib/ansible/modules/network/f5/bigip_gtm_wide_ip.py | 49 | 5381 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Michael Perzel
#
# 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 you... | gpl-3.0 |
towc/secret-ox | node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py | 1363 | 58344 | # 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.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import gyp.xcode_ninja
import errno
import os
import sys
import posixpath
import re
import shutil
import... | mit |
vrenaville/ngo-addons-backport | addons/point_of_sale/controllers/main.py | 56 | 5627 | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import openerp
from openerp.addons.web.controllers.main import manifest_list, module_boot, html_template
class PointOfSaleController(openerp.addons.web.http.Controller):
_cp_path = '/pos'
@openerp.addons.web.http.httprequest
def app(self,... | agpl-3.0 |
midospan/profitpy | profit/workbench/tickerplotdisplay.py | 18 | 4333 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase <troy@gci.net>
# Distributed under the terms of the GNU General Public License v2
from PyQt4.QtCore import QVariant, pyqtSignature
from PyQt4.QtGui import QFrame
from profit.lib import Settings, Signals
from profit.lib.widgets.plot import Pl... | gpl-2.0 |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/ec.py | 13 | 11124 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import (
... | gpl-2.0 |
hdinsight/hue | apps/oozie/src/oozie/migrations/0017_auto__add_bundledcoordinator__add_bundle.py | 39 | 25408 | # encoding: 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 model 'BundledCoordinator'
db.create_table('oozie_bundledcoordinator', (
('coordinator', self... | apache-2.0 |
rht/zulip | zerver/management/commands/send_custom_email.py | 1 | 4907 | import hashlib
import shutil
import subprocess
from argparse import ArgumentParser
from typing import Any, Dict, List
from zerver.lib.management import CommandError, ZulipBaseCommand
from zerver.lib.send_email import FromAddress, send_email
from zerver.models import UserProfile
from zerver.templatetags.app_filters imp... | apache-2.0 |
belokop/indico_bare | indico/modules/events/registration/controllers/management/tickets.py | 1 | 5344 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/django/views/generic/detail.py | 78 | 5572 | from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import Http404
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, View
class SingleObjectMixin(object):
"""
Prov... | agpl-3.0 |
2014c2g2/2014c2 | wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/testmock/testpatch.py | 739 | 53126 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import os
import sys
import unittest
from unittest.test.testmock import support
from unittest.test.testmock.support import SomeClass, is_instance
from unittest.mock import... | gpl-2.0 |
marc-sensenich/ansible | lib/ansible/modules/cloud/cloudstack/cs_host.py | 13 | 18375 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, 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 Software Foundation, either version 3 of the Lice... | gpl-3.0 |
captiosus/treadmill | treadmill/cli/admin/cloud.py | 1 | 24095 | import os
import click
from pprint import pprint
import logging
from treadmill.infra import constants, connection, vpc, subnet
from treadmill.infra.setup import ipa, ldap, node, cell
from treadmill.infra.utils import security_group, hosted_zones
from treadmill.infra.utils import mutually_exclusive_option, cli_callback... | apache-2.0 |
cheif/django-rest-framework | tests/test_routers.py | 79 | 13237 | from __future__ import unicode_literals
from collections import namedtuple
from django.conf.urls import include, url
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.test import TestCase
from rest_framework import permissions, serializers, viewsets
from rest_framework.... | bsd-2-clause |
RAPD/RAPD | src/sites/detectors/lscat_dectris_eiger9m.py | 1 | 8852 | """
Detector description for LS-CAT Eiger 9M
Designed to read the CBF version of the Eiger file
"""
"""
This file is part of RAPD
Copyright (C) 2017, Cornell University
All rights reserved.
RAPD is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as pub... | agpl-3.0 |
cristiana214/cristianachavez214-cristianachavez | python/src/Lib/encodings/cp855.py | 593 | 34106 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.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_map)
def decode(self,input,errors='strict'):
... | apache-2.0 |
aperigault/ansible | lib/ansible/module_utils/digital_ocean.py | 104 | 5769 | # 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
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
Ander-Alvarez/android_kernel_motorola_msm8916 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
hgl888/chromium-crosswalk | build/empty_google_play_services_lib.py | 7 | 2305 | #!/usr/bin/env python
# Copyright (c) 2015 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Create an empty google-play-services.jar inside src/third_party/android_tools.
https://chromium-review.googlesource.com/#/c/2478... | bsd-3-clause |
yrizk/django-blog | blogvenv/lib/python3.4/site-packages/setuptools/tests/test_easy_install.py | 71 | 19213 | # -*- coding: utf-8 -*-
"""Easy install Tests
"""
from __future__ import absolute_import
import sys
import os
import shutil
import tempfile
import site
import contextlib
import tarfile
import logging
import itertools
import distutils.errors
import pytest
try:
from unittest import mock
except ImportError:
imp... | apache-2.0 |
omerhasan/namebench | nb_third_party/dns/rdtypes/ANY/NSEC.py | 235 | 5296 | # Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
luxus/home-assistant | homeassistant/components/sensor/torque.py | 5 | 3109 | """
Support for the Torque OBD application.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.torque/
"""
import re
from homeassistant.const import HTTP_OK
from homeassistant.helpers.entity import Entity
DOMAIN = 'torque'
DEPENDENCIES = ['http']
S... | mit |
Arcanemagus/SickRage | lib/hachoir_parser/video/mpeg_video.py | 86 | 22580 | """
Moving Picture Experts Group (MPEG) video version 1 and 2 parser.
Information:
- http://www.mpucoder.com/DVD/
- http://dvd.sourceforge.net/dvdinfo/
- http://www.mit.jyu.fi/mweber/leffakone/software/parsempegts/
- http://homepage.mac.com/rnc/EditMpegHeaderIFO.html
- http://standards.iso.org/ittf/PubliclyAvailableSt... | gpl-3.0 |
kevinmel2000/sl4a | python-build/python-libs/gdata/src/gdata/photos/service.py | 162 | 24363 | #!/usr/bin/env python
# -*-*- encoding: utf-8 -*-*-
#
# This is the service file for the Google Photo python client.
# It is used for higher level operations.
#
# $Id: service.py 144 2007-10-25 21:03:34Z havard.gulldahl $
#
# Copyright 2007 Håvard Gulldahl
#
# Licensed under the Apache License, Version 2.0 (the "Licen... | apache-2.0 |
gg7/sentry | tests/sentry/api/endpoints/test_project_member_index.py | 23 | 1234 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.testutils import APITestCase
class ProjectMemberIndexTest(APITestCase):
def test_simple(self):
user_1 = self.create_user('foo@localhost', username='foo')
user_2 = self.create_user('bar@localhost', use... | bsd-3-clause |
voriux/Flexget | flexget/plugins/output/exec.py | 3 | 7367 | from __future__ import unicode_literals, division, absolute_import
from collections import Mapping
import logging
import subprocess
from flexget import plugin
from flexget.event import event
from flexget.utils.template import render_from_entry, render_from_task, RenderError
from flexget.utils.tools import io_encoding... | mit |
staute/shinken-mod-livestatus | module/livestatus_query_metainfo.py | 3 | 25571 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redist... | agpl-3.0 |
mgyenik/micropython | tests/float/float1.py | 16 | 1625 | # test basic float capabilities
# literals
print(.12)
print(1.)
print(1.2)
# float construction
print(float(1.2))
print(float("1.2"))
print(float("+1"))
print(float("1e1"))
print(float("1e+1"))
print(float("1e-1"))
print(float("inf"))
print(float("-inf"))
print(float("INF"))
print(float("infinity"))
print(float("INFI... | mit |
angelman/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/host.py | 119 | 4515 | # Copyright (c) 2010 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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... | bsd-3-clause |
f2um2326/LogisticRegression | LogisticReg_myfit.py | 1 | 3358 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 16 14:40:08 2015
@author: shimba
"""
# print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn import linear_model
from sklearn import datasets
from sklearn import cross_validation
from sklear... | mit |
JustinWingChungHui/MyFamilyRoot | auth_api/tests.py | 2 | 5613 | from django.test import TestCase
from django.test.utils import override_settings
from rest_framework import status
from rest_framework.test import APIClient
from axes.signals import user_locked_out
import json
import time
from family_tree.models.family import Family
from family_tree.models.person import Person
from cu... | gpl-2.0 |
pombredanne/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Sig.py | 61 | 2358 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... | apache-2.0 |
migonzalvar/youtube-dl | youtube_dl/extractor/comcarcoff.py | 85 | 2219 | # encoding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import parse_iso8601
class ComCarCoffIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?comediansincarsgettingcoffee\.com/(?P<id>[a-z0-9\-]*)'
_TESTS = [{
'url': 'http://comediansinca... | unlicense |
kost/volatility | volatility/plugins/pooltracker.py | 8 | 9708 | # Volatility
# Copyright (C) Michael Ligh <michael.ligh@mnin.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 2 of the License, or (at
# your option) any later version.
#
# ... | gpl-2.0 |
eliangidoni/rethinkdb | test/common/http_support/werkzeug/testsuite/test.py | 145 | 18933 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.test
~~~~~~~~~~~~~~~~~~~~~~~
Tests the testing tools.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
import unittest
from io import BytesIO
from werkzeug._com... | agpl-3.0 |
memtoko/django | tests/utils_tests/test_html.py | 10 | 8173 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from datetime import datetime
from unittest import TestCase
from django.test import ignore_warnings
from django.utils import html, safestring
from django.utils._os import upath
from django.utils.deprecation import RemovedInDjango20Warning
from ... | bsd-3-clause |
gdementen/PyTables | bench/postgres_backend.py | 13 | 5223 | from __future__ import print_function
import subprocess # Needs Python 2.4
from indexed_search import DB
import psycopg2 as db2
CLUSTER_NAME = "base"
DATA_DIR = "/scratch2/postgres/data/%s" % CLUSTER_NAME
#DATA_DIR = "/var/lib/pgsql/data/%s" % CLUSTER_NAME
DSN = "dbname=%s port=%s"
CREATE_DB = "createdb %s"
DROP_DB =... | bsd-3-clause |
fedelemantuano/thug | thug/DOM/Plugin.py | 3 | 1536 | #!/usr/bin/env python
#
# Plugin.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; wi... | gpl-2.0 |
AnonymousBee/anonymousbee.github.io | tools/arbitrage/mb.py | 10 | 3129 | #!/usr/bin/env python
import sys
import urllib2
from time import sleep
import json
from arbitrator import BlinkTradeArbitrator
import datetime
import hmac
import hashlib
import ConfigParser
from ws4py.exc import HandshakeError
MB_API_KEY = 'XXXX'
MB_API_SECRET = 'YYYY'
def send_order_to_MB(sender, order):
nonce ... | gpl-3.0 |
alisidd/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/models/decisions_to_data_then_nn.py | 190 | 1889 | # 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 |
HyperBaton/ansible | test/units/modules/network/check_point/test_cp_mgmt_threat_profile_facts.py | 19 | 2869 | # Ansible module to manage CheckPoint Firewall (c) 2019
#
# 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 dist... | gpl-3.0 |
yuanming-hu/taichi | python/taichi/lang/ops.py | 1 | 13930 | import builtins
import ctypes
import functools
import math
import operator as _bt_ops_mod # bt for builtin
import traceback
from taichi.core.util import ti_core as _ti_core
from taichi.lang import impl, matrix
from taichi.lang.exception import TaichiSyntaxError
from taichi.lang.expr import Expr, make_expr_group
from ... | mit |
skulbrane/metagoofil | unzip.py | 25 | 3848 | """ unzip.py
Version: 1.1
Extract a zipfile to the directory provided
It first creates the directory structure to house the files
then it extracts the files to it.
Sample usage:
command line
unzip.py -p 10 -z c:\testfile.zip -o c:\testoutput
python class
import unzip
un = unzi... | gpl-2.0 |
abravalheri/pypiple | pypiple/index.py | 1 | 8399 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pypiple index
-------------
Domain logic behing pypiple.
The class ``pypiple.index.Index`` is used to build a logic package index.
This index contains meta-information about all packages inside a given
directory, like file paht, author, homepage, etc and provides fast... | mpl-2.0 |
sqlalchemy/sqlalchemy | lib/sqlalchemy/types.py | 3 | 2883 | # types.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Compatibility namespace for sqlalchemy.sql.types.
"""
__all__ = [
"TypeEngine",
... | mit |
Ant-OS/android_packages_apps_OTAUpdates | jni/boost_1_57_0/tools/build/test/sort_rule.py | 51 | 2493 | #!/usr/bin/python
# Copyright (C) 2008. Jurko Gospodnetic
# 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)
# Tests for the Boost Jam builtin SORT rule.
import BoostBuild
#########################################... | apache-2.0 |
travisfcollins/gnuradio | gr-vocoder/examples/g723_40_audio_loopback.py | 58 | 1477 | #!/usr/bin/env python
#
# Copyright 2011 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 (at your option)
# ... | gpl-3.0 |
frnhr/django-cms | cms/south_migrations/0004_textobjects.py | 1680 | 20032 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
KylinMod/android_kernel_motorola_msm8960-common | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
ashhher3/invenio | modules/websession/lib/webuser.py | 6 | 58171 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio 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; eit... | gpl-2.0 |
iameli/kubernetes | cluster/juju/layers/kubernetes/reactive/k8s.py | 27 | 21547 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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 appli... | apache-2.0 |
akosyakov/intellij-community | plugins/hg4idea/testData/bin/hgext/gpg.py | 90 | 9365 | # Copyright 2005, 2006 Benoit Boissinot <benoit.boissinot@ens-lyon.org>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''commands to sign and verify changesets'''
import os, tempfile, binascii
from mercurial import util, comman... | apache-2.0 |
danieldresser/cortex | test/IECore/ImageConvolveOpTest.py | 12 | 2389 | ##########################################################################
#
# Copyright (c) 2010, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
AltSchool/django-allauth | allauth/socialaccount/providers/trello/provider.py | 3 | 1169 | from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth.provider import OAuthProvider
class TrelloAccount(ProviderAccount):
def get_profile_url(self):
return None
def get_avatar_url(self):
return None
class TrelloProvider(OAuthProvider):
... | mit |
ravindrapanda/tensorflow | tensorflow/contrib/kfac/examples/mlp_mnist_main.py | 21 | 1949 | # 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 |
projectcalico/calico-neutron | neutron/plugins/bigswitch/extensions/routerrule.py | 4 | 4565 | # Copyright 2013 Big Switch Networks, 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 ... | apache-2.0 |
bruinAlex/indoor-stomach | exercise_2/extweetwordcount/src/bolts/wordcount.py | 1 | 1599 | from __future__ import absolute_import, print_function, unicode_literals
from collections import Counter
from streamparse.bolt import Bolt
import psycopg2
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
class WordCounter(Bolt):
def initialize(self, conf, ctx):
self.counts = Counter()
def... | mit |
t0in4/django | django/core/cache/backends/filebased.py | 428 | 5387 | "File-based cache backend"
import errno
import glob
import hashlib
import io
import os
import random
import tempfile
import time
import zlib
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.core.files.move import file_move_safe
from django.utils.encoding import force_bytes
try:
f... | bsd-3-clause |
KingxBanana/zulip | zerver/management/commands/send_password_reset_email.py | 8 | 4172 | from __future__ import absolute_import
import logging
from typing import Any, List, Optional, Text
from argparse import ArgumentParser
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.core.mail import send_mail, BadHeaderError
from zerver.forms import Pass... | apache-2.0 |
thisispuneet/potato-blog | django/core/management/commands/makemessages.py | 154 | 16507 | import fnmatch
import glob
import os
import re
import sys
from itertools import dropwhile
from optparse import make_option
from subprocess import PIPE, Popen
from django.core.management.base import CommandError, NoArgsCommand
from django.utils.text import get_text_list
pythonize_re = re.compile(r'(?:^|\n)\s*//')
plur... | bsd-3-clause |
Hao-Liu/tp-libvirt | libvirt/tests/src/nwfilter/nwfilter_edit_uuid.py | 7 | 2275 | import logging
from autotest.client.shared import error
from virttest import virsh
from virttest import libvirt_xml
from virttest import aexpect
from virttest import remote
from provider import libvirt_version
def run(test, params, env):
"""
Test virsh nwfilter-edit with uuid.
1) Prepare parameters.
... | gpl-2.0 |
sidmitra/django_nonrel_testapp | django/contrib/localflavor/pt/forms.py | 309 | 1561 | """
PT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_re = re.com... | bsd-3-clause |
KristopherJH/ENGI7854US | Despeckle.py | 1 | 10592 | import cv2
import matplotlib.pyplot as plt
import numpy as np
import UltraLibrary as ul
from FrameType import f_type
def hist_despeckle(img,goodImg):
dsimg, homog = quickieHomo(img)
return ul.filtered_match(img,dsimg,goodImg)
def detection(im):
detector = cv2.SimpleBlobDetector_create()
# D... | gpl-3.0 |
landism/pants | tests/python/pants_test/engine/test_parsers.py | 4 | 10280 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import u... | apache-2.0 |
Yellowen/daarmaan | daarmaan/server/views/index.py | 1 | 12020 | # -----------------------------------------------------------------------------
# Daarmaan - Single Sign On Service for Yellowen
# Copyright (C) 2012 Yellowen
#
# 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
# ... | gpl-2.0 |
rashmi815/incubator-madlib | src/madpack/yaml/scanner.py | 126 | 52589 |
# Scanner produces tokens of the following types:
# STREAM-START
# STREAM-END
# DIRECTIVE(name, value)
# DOCUMENT-START
# DOCUMENT-END
# BLOCK-SEQUENCE-START
# BLOCK-MAPPING-START
# BLOCK-END
# FLOW-SEQUENCE-START
# FLOW-MAPPING-START
# FLOW-SEQUENCE-END
# FLOW-MAPPING-END
# BLOCK-ENTRY
# FLOW-ENTRY
# KEY
# VALUE
# AL... | apache-2.0 |
kennethdecker/MagnePlane | src/hyperloop/Python/pod/cycle/flow_path.py | 4 | 11938 | """
A group that models an inlet->compressor->duct->nozzle->shaft
using pycycle v2 https://github.com/OpenMDAO/pycycle2.
Calculates flow properties at the front and back of each thermodynamic
element, compressor power required, some geometry, and drag/thrust.
"""
from __future__ import print_function
import numpy as np... | apache-2.0 |
lnielsen/zenodo | tests/unit/deposit/test_sips.py | 2 | 3891 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio 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... | gpl-2.0 |
DirtyUnicorns/android_kernel_oppo_msm8939 | 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 |
cfei18/incubator-airflow | tests/operators/bash_operator.py | 2 | 2554 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
jvrsantacruz/XlsxWriter | xlsxwriter/test/worksheet/test_cond_format10.py | 8 | 2976 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from datetime import datetime
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet im... | bsd-2-clause |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/test/test_types.py | 112 | 29723 | # Python test set -- part 6, built-in types
from test.test_support import run_unittest, have_unicode, run_with_locale, \
check_py3k_warnings
import unittest
import sys
import locale
class TypesTests(unittest.TestCase):
def test_truth_values(self):
if None: self.fail('None is... | mit |
TodoOrTODO/p4factory | targets/l2_switch/tests/ptf-tests/l2_switch.py | 7 | 2582 | # Copyright 2013-present Barefoot Networks, 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 agr... | apache-2.0 |
spandanb/horizon | openstack_dashboard/dashboards/router/nexus1000v/urls.py | 1 | 1211 | # 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
# d... | apache-2.0 |
hackupc/backend | app/hackathon_variables.py | 1 | 4066 | # HACKATHON PERSONALIZATION
import os
from django.utils import timezone
HACKATHON_NAME = 'HackAssistant'
# What's the name for the application
HACKATHON_APPLICATION_NAME = 'HackAssistant registration'
# Hackathon timezone
TIME_ZONE = 'MST'
# This description will be used on the html and sharing meta tags
HACKATHON_DE... | mit |
stvstnfrd/edx-platform | common/lib/xmodule/xmodule/template_module.py | 1 | 2587 | """
Template module
"""
from string import Template
from lxml import etree
from xmodule.raw_module import RawDescriptor
from xmodule.x_module import DEPRECATION_VSCOMPAT_EVENT, XModule # lint-amnesty, pylint: disable=unused-import
class CustomTagModule(XModule):
"""
This module supports tags of the form
... | agpl-3.0 |
jdugge/QGIS | tests/src/python/test_qgspallabeling_base.py | 13 | 17945 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPalLabeling: base suite setup
From build dir, run: ctest -R PyQgsPalLabelingBase -V
See <qgis-src-dir>/tests/testdata/labeling/README.rst for description.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Gen... | gpl-2.0 |
jroyal/plexpy | lib/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | gpl-3.0 |
HKUST-SING/tensorflow | tensorflow/python/util/nest.py | 24 | 17585 | # 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 |
scrollback/kuma | vendor/packages/nose/nose/plugins/prof.py | 106 | 5357 | """This plugin will run tests using the hotshot profiler, which is part
of the standard library. To turn it on, use the ``--with-profile`` option
or set the NOSE_WITH_PROFILE environment variable. Profiler output can be
controlled with the ``--profile-sort`` and ``--profile-restrict`` options,
and the profiler output f... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.