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
bensonhsu2013/old_samsung-lt02wifi-kernel
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
rhinstaller/pykickstart
tests/commands/selinux.py
2
1293
import unittest from tests.baseclass import CommandTest from pykickstart.constants import SELINUX_DISABLED, SELINUX_ENFORCING, SELINUX_PERMISSIVE class FC3_TestCase(CommandTest): command = "selinux" def runTest(self): # pass self.assert_parse("selinux") self.assert_parse("selinux --per...
gpl-2.0
sujeet4github/MyLangUtils
LangPython/oreilly-intro-to-flask-video/venv/lib/python3.6/site-packages/pip/_vendor/distlib/_backport/sysconfig.py
327
26955
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import Conf...
gpl-3.0
nop33/indico
indico/web/forms/fields/principals.py
2
5299
# This file is part of Indico. # Copyright (C) 2002 - 2017 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
sanjeevtripurari/hue
desktop/core/ext-py/Django-1.6.10/tests/nested_foreign_keys/tests.py
59
9647
from __future__ import absolute_import from django.test import TestCase from .models import Person, Movie, Event, Screening, ScreeningNullFK, Package, PackageNullFK # These are tests for #16715. The basic scheme is always the same: 3 models with # 2 relations. The first relation may be null, while the second is non-...
apache-2.0
donovan-duplessis/pwnurl
docs/conf.py
1
8358
#!/usr/bin/env python # -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 # au...
mit
google/contentbox
third_party/openid/yadis/manager.py
167
6081
class YadisServiceManager(object): """Holds the state of a list of selected Yadis services, managing storing it in a session and iterating over the services in order.""" def __init__(self, starting_url, yadis_url, services, session_key): # The URL that was used to initiate the Yadis protocol ...
apache-2.0
devops2014/djangosite
django/contrib/admin/bin/compress.py
100
2075
#!/usr/bin/env python import argparse import os import subprocess import sys js_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', 'admin', 'js') def main(): description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires ...
bsd-3-clause
selfcommit/gaedav
pyxml/sax/drivers/drv_xmlproc.py
4
4400
""" A SAX driver for xmlproc $Id: drv_xmlproc.py,v 1.13 2001/12/30 12:13:45 loewis Exp $ """ version="0.95" from pyxml.sax import saxlib, saxutils from pyxml.parsers.xmlproc import xmlproc import os # --- SAX_XPParser class SAX_XPParser(saxlib.Parser,xmlproc.Application,xmlproc.DTDConsumer, xml...
lgpl-2.1
AlexHill/django
django/utils/importlib.py
9
1485
# Taken from Python 2.7 with permission from/by the original author. import warnings import sys from django.utils import six warnings.warn("django.utils.importlib will be removed in Django 1.9.", PendingDeprecationWarning, stacklevel=2) def _resolve_name(name, package, level): """Return the absolute name of...
bsd-3-clause
pombredanne/pants
tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/jvm_platform_integration_mixin.py
6
9647
# 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 os import re ...
apache-2.0
sergio-incaser/odoo
addons/hw_posbox_upgrade/__openerp__.py
313
1696
# -*- 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
dunkhong/grr
grr/server/setup.py
1
7769
#!/usr/bin/env python """This is the setup.py file for the GRR client. This is just a meta-package which pulls in the minimal requirements to create a full grr server. """ from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import itertools import os import s...
apache-2.0
danijar/sets
sets/process/glove.py
1
1218
from zipfile import ZipFile import numpy as np from sets.core import Embedding class Glove(Embedding): """ The pretrained word embeddings from the Standford NLP group computed by the Glove model. From: http://nlp.stanford.edu/projects/glove/ """ URL = 'http://nlp.stanford.edu/data/glove.6B.zip' ...
mit
xbianonpi/xbian-package-development
content/usr/local/lib/python2.7/dist-packages/distribute-0.6.30-py2.7.egg/setuptools/command/bdist_wininst.py
137
1548
from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst import os, sys class bdist_wininst(_bdist_wininst): def create_exe(self, arcname, fullname, bitmap=None): _bdist_wininst.create_exe(self, arcname, fullname, bitmap) dist_files = getattr(self.distribution, 'dist_files', [])...
gpl-2.0
obnam-mirror/obnam
obnamlib/__init__.py
1
5952
# Copyright (C) 2009-2017 Lars Wirzenius # # 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 distribu...
gpl-3.0
nilmini20s/gem5-2016-08-13
src/python/m5/debug.py
51
3475
# Copyright (c) 2008 The Hewlett-Packard Development Company # 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...
bsd-3-clause
arlowhite/kivy
examples/canvas/tesselate.py
6
4478
''' Tesselate Demonstration ======================= This demonstrates the experimental library for tesselating polygons. You should see a hollow square with some buttons below it. You can click and drag to create additional shapes, watching the number of vertexes and elements at the top of the screen. The 'debug' butt...
mit
sorenh/cc
nova/tests/network_unittest.py
1
5207
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
apache-2.0
Learningtribes/edx-platform
common/djangoapps/external_auth/views.py
12
36626
import functools import json import logging import random import re import string import fnmatch import unicodedata import urllib from textwrap import dedent from external_auth.models import ExternalAuthMap from external_auth.djangostore import DjangoOpenIDStore from django.conf import settings from django.contrib.au...
agpl-3.0
overfl0/Bulletproof-Arma-Launcher
src/utils/popupchain.py
1
2070
# Bulletproof Arma Launcher # Copyright (C) 2016 Lukasz Taczuk # # 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 the hope that it will be useful, # b...
gpl-3.0
KL-WLCR/incubator-airflow
tests/contrib/operators/test_spark_submit_operator.py
6
6332
# -*- 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
CaptainThrowback/kernel_htc_m8whl
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
ivanhorvath/openshift-tools
ansible/roles/lib_aos_modules/library/aos_rhsm_repos.py
13
6664
#!/usr/bin/python """ansible module for rhsm repo management""" # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 DOCUMENTATION = ''' --- module: aos_rhsm_repos short_description: this module manages rhsm repositories description: - this module manages rhsm repositories options: enabled: description: ...
apache-2.0
asm666/sympy
sympy/physics/quantum/dagger.py
116
2242
"""Hermitian conjugation.""" from __future__ import print_function, division from sympy.core import Expr from sympy.functions.elementary.complexes import adjoint __all__ = [ 'Dagger' ] class Dagger(adjoint): """General Hermitian conjugate operation. Take the Hermetian conjugate of an argument [1]_. Fo...
bsd-3-clause
FrankBian/kuma
vendor/packages/ipython/IPython/Extensions/ipy_which.py
8
1973
r""" %which magic command %which <cmd> => search PATH for files matching PATH. Also scans aliases """ import IPython.ipapi ip = IPython.ipapi.get() import os,sys from fnmatch import fnmatch def which(fname): fullpath = filter(os.path.isdir,os.environ['PATH'].split(os.pathsep)) if '.' not in fullpath: ...
mpl-2.0
elffersj/cnfgen
cnfformula/families/graphisomorphism.py
1
4562
#!/usr/bin/env python # -*- coding:utf-8 -*- """Graph isomorphimsm/automorphism formulas """ from cnfformula.cnf import CNF from cnfformula.cmdline import SimpleGraphHelper from cnfformula.cmdline import register_cnfgen_subcommand from cnfformula.families import register_cnf_generator from cnfformula.graphs import ...
gpl-3.0
lmb/Supermega
supermega/tests/test_session.py
1
2433
import unittest import hashlib import os import random from StringIO import StringIO from .. import Session, User, File, Directory from .. import errors USERNAME = os.environ.get('MEGA_USERNAME', None) PASSWORD = os.environ.get('MEGA_PASSWORD', None) def random_string(length): return (('%0'+str(length)+'x') % rando...
bsd-3-clause
rhertzog/django
tests/indexes/models.py
7
1816
from django.db import connection, models class CurrentTranslation(models.ForeignObject): """ Creates virtual relation to the translation with model cache enabled. """ # Avoid validation requires_unique_target = False def __init__(self, to, on_delete, from_fields, to_fields, **kwargs): ...
bsd-3-clause
sujitbehera27/MyRoboticsProjects-Arduino
src/resource/Python/examples/InMoov2.Alessandruino.py
4
1744
headPort = "COM5" i01 = Runtime.createAndStart("i01", "InMoov") mouthControl=i01.startMouthControl("COM5") head = i01.startHead(headPort) leftArm = i01.startLeftArm(headPort) leftHand = i01.startLeftHand(headPort) headTracking = i01.startHeadTracking("COM5") eyesTracking= i01.startEyesTracking("COM5") i01.headTrac...
apache-2.0
muddy1/herckernels
scripts/build-all.py
1250
9474
#! /usr/bin/env python # Copyright (c) 2009-2011, Code Aurora Forum. 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 # n...
gpl-2.0
bcarroll/authmgr
python-3.6.2-Win64/Lib/site-packages/sqlalchemy/schema.py
32
1200
# schema.py # Copyright (C) 2005-2017 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 """Compatibility namespace for sqlalchemy.sql.schema and related. """ from .sql.base imp...
bsd-3-clause
eudoxos/woodem
scripts/test-OLD/dispatcher-torture.py
3
2017
""" Script that shows dispatch matrices when all available functors are loaded. Later ones will overwrite earlier ones, this is not what you will get in reality. Pipe the output to file and open it in browser: $ woo-trunk dispatcher-torture.py > /tmp/aa.html $ firefox /tmp/aa.html """ import collections Dispatch=co...
gpl-2.0
mblue9/tools-iuc
tools/raxml/raxml.py
17
4043
#!/usr/bin/env python """ Runs RAxML on a sequence file. For use with RAxML version 8.2.4 """ import fnmatch import glob import optparse def getint(name): basename = name.partition('RUN.') if basename[2] != '': num = basename[2] return int(num) def __main__(): # Parse the primary wrapper...
mit
belmiromoreira/nova
nova/tests/unit/api/openstack/compute/test_api.py
26
5850
# Copyright 2010 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 requ...
apache-2.0
CiscoSystems/avos
openstack_dashboard/test/integration_tests/pages/project/compute/overviewpage.py
3
1619
# 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
nvoron23/statsmodels
statsmodels/graphics/mosaicplot.py
6
26886
"""Create a mosaic plot from a contingency table. It allows to visualize multivariate categorical data in a rigorous and informative way. see the docstring of the mosaic function for more informations. """ # Author: Enrico Giampieri - 21 Jan 2013 from __future__ import division from statsmodels.compat.python import ...
bsd-3-clause
HRF92/myflask
foobar/app.py
1
1483
# -*- coding: utf-8 -*- '''The app module, containing the app factory function.''' from flask import Flask, render_template from foobar.settings import ProdConfig from foobar.assets import assets from foobar.extensions import ( bcrypt, cache, db, login_manager, migrate, debug_toolbar, ) from fo...
bsd-3-clause
veltzer/demos-python
src/examples/short/multi_processing/single_process.py
1
1245
#!/usr/bin/env python import fcntl import os import os.path import sys import time ''' This is an example of how to make sure only a single python process is running of a specific kind... References: - http://stackoverflow.com/questions/220525/ensure-a-single-instance-of-an-application-in-linux ''' do_fork = False ...
gpl-3.0
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/policy_forwarding/policies/policy/rules/rule/config/__init__.py
1
12349
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
tonysyu/deli
deli/layout/grid_layout.py
1
4491
""" Tick generator classes and helper functions for calculating axis tick-related values (i.e., bounds and intervals). """ import numpy as np from traits.api import (Array, HasStrictTraits, Instance, Property, cached_property) from .bounding_box import BoundingBox class BaseGridLayout(HasSt...
bsd-3-clause
dcneeme/droidcontroller
droidcontroller/uniscada.py
1
36234
# This Python file uses the following encoding: utf-8 # send and receive monitoring and control messages to from UniSCADA monitoring system # udp kuulamiseks thread? # neeme import time, datetime import sqlite3 import traceback from socket import * import sys import os import gzip import tarfile import requests impor...
gpl-3.0
xenim/django-radioportal
radioportal/migrations/0011_auto_20151116_1920.py
2
1771
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def forwards_func(apps, schema_editor): Stream = apps.get_model("radioportal", "Stream") db_alias = schema_editor.connection.alias for s in Stream.objects.all(): if s.format == "mp3": ...
bsd-3-clause
Denisolt/IEEE-NYIT-MA
local/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/operations.py
41
11651
""" SQL functions reference lists: http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html """ import re import sys from django.contrib.gis.db.backends.base.operations import \ ...
gpl-3.0
manqala/erpnext
erpnext/config/setup.py
29
3006
from __future__ import unicode_literals from frappe import _ from frappe.desk.moduleview import add_setup_section def get_data(): data = [ { "label": _("Settings"), "icon": "fa fa-wrench", "items": [ { "type": "doctype", "name": "Global Defaults", "label": _("Global Settings"), "des...
gpl-3.0
dwadler/QGIS
tests/src/python/test_qgsserver_projectutils.py
22
2949
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServerProject. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """...
gpl-2.0
YuriyIlyin/ansible-modules-core
cloud/azure/azure.py
11
24048
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
jswanljung/iris
lib/iris/tests/unit/fileformats/grib/load_convert/test_product_definition_template_31.py
2
4414
# (C) British Crown Copyright 2014 - 2016, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
beedesk/django-tastypie
tests/core/tests/http.py
10
1911
# Basically just a sanity check to make sure things don't change from underneath us. from django.test import TestCase from tastypie.http import HttpAccepted, HttpBadRequest, HttpConflict,\ HttpCreated, HttpGone, HttpMethodNotAllowed, HttpNoContent, HttpNotFound,\ HttpNotImplemented, HttpNotModified, HttpSeeOthe...
bsd-3-clause
exsodus3249/kite
src/back/tests/test_maildir.py
2
1429
import kite.maildir import unittest import types mockdata = {"from": {"address": "gerard", "name": ""}, "subject": "test", "contents": "empty", "to": "gerard", "date": "November 13, 2007"} class EmptyObject(object): """Empty class used by mocks. Required because python doesn't let us add attributes to an empt...
bsd-3-clause
KhasMek/kernel_matricom_mx2
tools/perf/python/twatch.py
3213
1338
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
IanSav/enigma2
lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py
2
7963
from Screens.Screen import Screen from Components.ActionMap import ActionMap from Components.Sources.List import List from Components.Sources.StaticText import StaticText from Components.Pixmap import Pixmap from enigma import ePicLoad from Components.config import config, getConfigListEntry, ConfigInteger from Compone...
gpl-2.0
mauricioabreu/speakerfight
deck/models.py
1
12968
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.core.exceptions import ValidationError from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger fr...
mit
40223117cda/w16cdaa
static/Brython3.1.0-20150301-090019/Lib/multiprocessing/dummy/__init__.py
693
4380
# # Support for the API of the multiprocessing package using threads # # multiprocessing/dummy/__init__.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: ...
gpl-3.0
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/tensorflow/python/estimator/inputs/queues/feeding_queue_runner.py
123
6899
# 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...
mit
jnerin/ansible
lib/ansible/plugins/connection/jail.py
52
8087
# Based on local.py by Michael DeHaan <michael.dehaan@gmail.com> # and chroot.py by Maykel Moya <mmoya@speedyrails.com> # Copyright (c) 2013, Michael Scherer <misc@zarb.org> # Copyright (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYIN...
gpl-3.0
martbhell/wasthereannhlgamelastnight
src/lib/requests/adapters.py
79
21344
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket from urllib3.poolmanager import PoolManager, proxy_from_url from urllib3.response import HTTPResponse from urllib3.util ...
mit
hn8841182/2015cd_0505
static/Brython3.1.1-20150328-091302/Lib/_csv.py
639
21705
"""CSV parsing and writing. [Copied from PyPy https://bitbucket-assetroot.s3.amazonaws.com/pypy/pypy/1400171824.19/641/_csv.py?Signature=cc%2Bc8m06cBMbsxt2e15XXXUDACk%3D&Expires=1404136251&AWSAccessKeyId=0EMWEFSGA12Z1HF1TZ82 and adapted to Python 3 syntax for Brython] This module provides classes that assist in the ...
agpl-3.0
mrquim/repository.mrquim
script.module.pycryptodome/lib/Crypto/SelfTest/Hash/common.py
5
8596
# -*- coding: utf-8 -*- # # SelfTest/Hash/common.py: Common code for Crypto.SelfTest.Hash # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedicat...
gpl-2.0
qiankunshe/sky_engine
sky/tools/webkitpy/common/net/networktransaction.py
190
2926
# Copyright (C) 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 of conditions and the ...
bsd-3-clause
bdh1011/wau
venv/lib/python2.7/site-packages/wheel/tool/__init__.py
238
13310
""" Wheel command-line utility. """ import os import hashlib import sys import json import wheel.paths from glob import iglob from .. import signatures from ..util import (urlsafe_b64decode, urlsafe_b64encode, native, binary, matches_requirement) from ..install import WheelFile def require_pkgre...
mit
pistruiatul/hartapoliticii
python/src/ro/vivi/youtube_crawler/gdata/tlslite/utils/Cryptlib_TripleDES.py
359
1408
"""Cryptlib 3DES implementation.""" from cryptomath import * from TripleDES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_TripleDES(key, mode, IV) class Cryptlib_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDES.__init__(self, key, mode,...
agpl-3.0
thomas-bottesch/fcl
python/utils/create_pca_vectors_from_dataset.py
1
2284
from __future__ import print_function import fcl import os import time from os.path import abspath, join, dirname, isfile from fcl import kmeans from fcl.datasets import load_sector_dataset, load_usps_dataset from fcl.matrix.csr_matrix import get_csr_matrix_from_object, csr_matrix_to_libsvm_string from sklearn.decompos...
mit
ask/celery
celery/utils/__init__.py
2
5421
# -*- coding: utf-8 -*- """ celery.utils ~~~~~~~~~~~~ Utility functions. :copyright: (c) 2009 - 2012 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from __future__ import with_statement import operator import sys import threading import trac...
bsd-3-clause
fbradyirl/home-assistant
homeassistant/components/fleetgo/device_tracker.py
4
2778
"""Support for FleetGO Platform.""" import logging import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.device_tracker import PLATFORM_SCHEMA from homeassistant.const import CONF_USERNAME, CONF_PASSWORD from homeassistant.helpers.event import trac...
apache-2.0
skycucumber/Messaging-Gateway
webapp/venv/lib/python2.7/site-packages/setuptools/command/alias.py
285
2486
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in ...
gpl-2.0
morissette/devopsdays-hackathon-2016
venv/lib/python2.7/site-packages/botocore/vendored/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
gpl-3.0
gabelula/b-counted
django/contrib/localflavor/id/id_choices.py
65
3089
from django.utils.translation import ugettext_lazy as _ # Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia # Indonesia does not have an official Province code standard. # I decided to use unambiguous and consistent (some are common) 3-letter codes. PROVINCE_CHOICES = ( ('BLI', _('Bali')), ('...
apache-2.0
Dhivyap/ansible
test/units/mock/vault_helper.py
206
1559
# Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ...
gpl-3.0
chris-chris/tensorflow
tensorflow/contrib/layers/python/layers/target_column.py
125
18698
# 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
MooglyGuy/mame
scripts/minimaws/minimaws.py
29
6527
#!/usr/bin/python ## ## license:BSD-3-Clause ## copyright-holders:Vas Crabb ## ## Demonstrates use of MAME's XML system information output ## ## This script requires Python 2.7 or Python 3.4, and SQLite 3.6.19 at ## the very least. Help is provided for all command-line options (use ## -h or --help). ## ## Before you c...
gpl-2.0
tareqalayan/ansible
test/units/modules/network/iosxr/test_iosxr_command.py
45
4152
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
flexVDI/cerbero
cerbero/packages/android.py
5
3864
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
KohlsTechnology/ansible
lib/ansible/modules/cloud/amazon/sns.py
32
7273
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Michael J. Schultz <mjschultz@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1...
gpl-3.0
k3nnyfr/s2a_fr-nsis
s2a/Python/Lib/test/test_cookielib.py
9
72203
# -*- coding: latin-1 -*- """Tests for cookielib.py.""" import cookielib import os import re import time from unittest import TestCase from test import test_support class DateTimeTests(TestCase): def test_time2isoz(self): from cookielib import time2isoz base = 1019227000 day = 24*3600...
gpl-3.0
Chenmxs/pyspider
pyspider/message_queue/rabbitmq.py
53
8696
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<17175297.hk@gmail.com> # http://binux.me # Created on 2012-11-15 17:27:54 import time import socket import select import logging import umsgpack import threading import amqp from six.moves import q...
apache-2.0
nitinitprof/odoo
addons/stock_account/__openerp__.py
269
2348
# -*- 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
grade-it/grader
redkyn-grader/grader/commands/list.py
2
3714
'''TODO: List command docs ''' import itertools import logging from collections import OrderedDict from functools import reduce from prettytable import PrettyTable from grader.models import Grader from grader.utils.config import require_grader_config logger = logging.getLogger(__name__) help = "List student submiss...
mit
SeanCameronConklin/aima-python
tests/test_mdp.py
25
1392
import pytest from mdp import * # noqa def test_value_iteration(): assert value_iteration(sequential_decision_environment, .01) == {(3, 2): 1.0, (3, 1): -1.0, (3, 0): 0.12958868267972745, (0, 1): 0.39810203830605462, (0, 2): 0.509285...
mit
albertomurillo/ansible
lib/ansible/module_utils/common/parameters.py
12
5167
# -*- coding: utf-8 -*- # Copyright (c) 2019 Ansible Project # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible.module_utils._text import to_native from ansible.mo...
gpl-3.0
farodin91/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/echo_noext_wsh.py
465
2404
# Copyright 2013, 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...
mpl-2.0
Radium-Devices/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
vorwerkc/pymatgen
pymatgen/core/tests/test_xcfunc.py
5
2615
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from pymatgen.core.xcfunc import XcFunc from pymatgen.util.testing import PymatgenTest class LibxcFuncTest(PymatgenTest): def test_xcfunc_api(self): """Testing XcFunc API.""" # Aliases sho...
mit
credativUK/connector-magento
__unported__/magentoerpconnect/partner.py
1
25089
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
GalaxyTab4/twrp_kernel_samsung_degaswifi
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
luotao1/Paddle
python/paddle/static/io.py
1
30947
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
mwarkentin/ansible
lib/ansible/runner/lookup_plugins/env.py
22
1201
# (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
gpl-3.0
kirbyfan64/pygments-unofficial
pygments/styles/manni.py
135
2374
# -*- coding: utf-8 -*- """ pygments.styles.manni ~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. This is a port of the style used in the `php port`_ of pygments by Manni. The style is called 'default' there. :copyright: Copyright 2006-2014 by the Pygments...
bsd-2-clause
kemalakyol48/python-for-android
python3-alpha/python3-src/Lib/test/test_cgi.py
46
13764
from test.support import run_unittest, check_warnings import cgi import os import sys import tempfile import unittest from io import StringIO, BytesIO class HackedSysModule: # The regression test will have real values in sys.argv, which # will completely confuse the test of the cgi module argv = [] std...
apache-2.0
tropp/acq4
acq4/modules/Patch/PatchTemplate.py
3
19449
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'PatchTemplate.ui' # # Created: Sat Feb 21 11:45:16 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except ...
mit
Erotemic/hotspotter
hsgui/_frontend/EditPrefSkel.py
1
2626
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/joncrall/code/hotspotter/hsgui/_frontend/EditPrefSkel.ui' # # Created: Mon Feb 10 13:40:41 2014 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: ...
apache-2.0
canaltinova/servo
tests/wpt/web-platform-tests/tools/third_party/funcsigs/tests/test_inspect.py
40
37844
# Copyright 2001-2013 Python Software Foundation; All Rights Reserved from __future__ import absolute_import, division, print_function import collections import sys try: import unittest2 as unittest except ImportError: import unittest import funcsigs as inspect class TestSignatureObject(unittest.TestCase): ...
mpl-2.0
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/apis/cloudbilling/v1/cloudbilling_v1_messages.py
6
9240
"""Generated message classes for cloudbilling version v1. Allows developers to manage billing for their Google Cloud Platform projects programmatically. """ # NOTE: This file is autogenerated and should not be edited by hand. from apitools.base.protorpclite import messages as _messages from apitools.base.py import en...
apache-2.0
thomas-maurice/docker-minecraft-webapp
webapp/lib/mcrcon.py
1
1703
import socket import select import struct class MCRconException(Exception): pass class MCRcon: socket = None def connect(self, host, port): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.connect((host, port)) def disconnect(self): self.socket.close...
gpl-3.0
neuropycon/ephypype
ephypype/externals/click/core.py
20
75305
import errno import inspect import os import sys from contextlib import contextmanager from itertools import repeat from functools import update_wrapper from .types import convert_type, IntRange, BOOL from .utils import PacifyFlushWrapper, make_str, make_default_short_help, \ echo, get_os_args from .exceptions im...
bsd-3-clause
epam-mooc/edx-platform
common/lib/xmodule/xmodule/tests/test_split_test_module.py
11
21753
""" Tests for the Split Testing Module """ import ddt import lxml from mock import Mock, patch from fs.memoryfs import MemoryFS from xmodule.tests.xml import factories as xml from xmodule.tests.xml import XModuleXmlImportTest from xmodule.tests import get_test_system from xmodule.x_module import AUTHOR_VIEW, STUDENT_V...
agpl-3.0
mpurzynski/MozDef
mq/plugins/large_strings.py
2
1926
# 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 https://mozilla.org/MPL/2.0/. # Copyright (c) 2014 Mozilla Corporation class message(object): def __init__(self): self.registration = ['...
mpl-2.0
formath/mxnet
example/rcnn/rcnn/core/metric.py
41
5952
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
elainenaomi/sciwonc-dataflow-examples
dissertation2017/Experiment 2/instances/10_0_wikiflow_1sh_1s_annot/computeusergroup_0/ComputeUserGroup_0.py
6
3237
#!/usr/bin/env python from sciwonc.dataflow.DataStoreClient import DataStoreClient import ConfigDB_UserGroup_0 import re import json # connector and config client = DataStoreClient("mongodb", ConfigDB_UserGroup_0) # according to config data = client.getData() # return an array of docs (like a csv reader) output = [...
gpl-3.0
danidee10/Votr
api/api.py
1
3600
from os import getenv from models import db, Users, Polls, Topics, Options, UserPolls from flask import Blueprint, request, jsonify, session from datetime import datetime from config import SQLALCHEMY_DATABASE_URI if getenv('APP_MODE') == 'PRODUCTION': from production_settings import SQLALCHEMY_DATABASE_URI api...
gpl-3.0