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 |
|---|---|---|---|---|---|
jmighion/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_extension.py | 21 | 10097 | #!/usr/bin/python
#
# Copyright (c) 2017 Sertac Ozercan <seozerca@microsoft.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.1',
... | gpl-3.0 |
pedja1/aNmap | dSploit/jni/nmap/zenmap/zenmapGUI/ScansListStore.py | 4 | 12542 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is *
# * also a registered trademark of Inse... | gpl-3.0 |
Lyleo/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/pygments/lexers/html.py | 72 | 18617 | # -*- coding: utf-8 -*-
"""
pygments.lexers.html
~~~~~~~~~~~~~~~~~~~~
Lexers for HTML, XML and related markup.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, inclu... | mit |
Rogentos/entropy | server/eit/commands/inject.py | 5 | 4426 | # -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Infrastructure Toolkit}.
"""
import sys
import os
import argparse
from entropy.const import const_file_readable
from entropy.i18n import _
fr... | gpl-2.0 |
lzambella/Qyoutube-dl | youtube_dl/extractor/limelight.py | 2 | 8906 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
)
class LimelightBaseIE(InfoExtractor):
_PLAYLIST_SERVICE_URL = 'http://production-ps.lvp.llnw.net/r/PlaylistService/%s/%s/%s'
_API... | gpl-3.0 |
imaculate/scikit-learn | sklearn/linear_model/coordinate_descent.py | 4 | 81256 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD 3 clause
import sys
import warnings
from abc import ABCMeta, abstractmethod
import n... | bsd-3-clause |
hydratk/hydratk | src/hydratk/lib/messaging/zmq/queue.py | 1 | 2756 | # -*- coding: utf-8 -*-
"""A Zeromq queue driver
.. module:: lib.messaging.zmq.queue
:platform: Unix
:synopsis: A Zeromq queue driver
.. moduleauthor:: Petr Czaderna <pc@hydratk.org>
"""
import zmq
from pyx.messaging import queue
class Queue(zmq):
"""Class Queue
"""
__options = {}
__type = N... | bsd-3-clause |
renyi533/tensorflow | tensorflow/python/eager/remote_cloud_tpu_test.py | 3 | 3181 | # Copyright 2019 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 |
afandria/mojo | third_party/jinja2/loaders.py | 255 | 17027 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.excepti... | bsd-3-clause |
jusbrasil/pycan | pycan/__init__.py | 1 | 4600 | # -*- coding: utf-8 -*-
import exceptions
import inspect
import operator
_permissions = {}
def allow_to_all(user, context, resource):
return True
def can(action_set, target_set, authorization, load_before=lambda _, __: None,
load_after=lambda _, __: None, exception=None):
assert authorization, "An a... | mit |
cloudera/hue | desktop/core/ext-py/MySQL-python-1.2.5/MySQLdb/connections.py | 76 | 11777 | """
This module implements connections for MySQLdb. Presently there is
only one class: Connection. Others are unlikely. However, you might
want to make your own subclasses. In most cases, you will probably
override Connection.default_cursor with a non-standard Cursor class.
"""
from MySQLdb import cursors
fr... | apache-2.0 |
dagwieers/ansible | lib/ansible/modules/network/fortios/fortios_firewall_address6_template.py | 24 | 10360 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 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 Lic... | gpl-3.0 |
rynomster/django | django/contrib/auth/forms.py | 22 | 14665 | from __future__ import unicode_literals
from django import forms
from django.contrib.auth import (
authenticate, get_user_model, password_validation,
)
from django.contrib.auth.hashers import (
UNUSABLE_PASSWORD_PREFIX, identify_hasher,
)
from django.contrib.auth.models import User
from django.contrib.auth.tok... | bsd-3-clause |
PHSCRC/phsled | nfc/ndef/error.py | 5 | 1241 | # -*- coding: latin-1 -*-
# -----------------------------------------------------------------------------
# Copyright 2012 Stephen Tiedemann <stephen.tiedemann@googlemail.com>
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (t... | mit |
sillydan1/WhatEverEngine | packages/IronPython.StdLib.2.7.5/content/Lib/encodings/iso8859_15.py | 593 | 13468 | """ Python Character Mapping Codec iso8859_15 generated from 'MAPPINGS/ISO8859/8859-15.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,errors... | apache-2.0 |
theshteves/tweet-the-wolf | pips/oauthlib/oauth2/rfc6749/endpoints/token.py | 71 | 3673 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
import logging
from oauthlib.common import Request
from .base import BaseEn... | mit |
mzizzi/ansible | lib/ansible/modules/monitoring/zabbix_screen.py | 35 | 17493 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, 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
# (... | gpl-3.0 |
pongem/python-bot-project | appengine/standard/botapp/env/lib/python2.7/site-packages/django/views/decorators/cache.py | 586 | 2304 | from functools import wraps
from django.middleware.cache import CacheMiddleware
from django.utils.cache import add_never_cache_headers, patch_cache_control
from django.utils.decorators import (
available_attrs, decorator_from_middleware_with_args,
)
def cache_page(*args, **kwargs):
"""
Decorator for view... | apache-2.0 |
nara-l/foursquared | util/gen_class.py | 262 | 3173 | #!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
HEADER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.types;
%(imports)s
/**
* Auto-generated: %(timestamp)s
*
* @author Joe LaPenna (joe@joelapenna.com)
*/
public class %(type... | apache-2.0 |
FluidityStokes/fluidity | mayavi/mayavi_amcg/triangle_reader.py | 17 | 10262 | # Author: Daryl Harrison
# Enthought library imports.
from enthought.traits.api import Instance, String, List, Int
from enthought.traits.ui.api import View, Item
from enthought.tvtk.api import tvtk
# Local imports.
from enthought.mayavi.core.file_data_source import FileDataSource
from enthought.mayavi.core.pipeline_i... | lgpl-2.1 |
jbalm/ActuarialCashFlowModel | market_environment/Market_Environment.py | 1 | 4521 | ## Python packages
from xlrd import open_workbook
import matplotlib
import matplotlib.pyplot as plt
class Market_Environment(object):
"""
Definition: Market Environment
==============================
Market Environment refers to factors and forces that affect the ability to build and mainta... | gpl-3.0 |
edx/edx-platform | common/djangoapps/student/tasks.py | 4 | 2416 | """
This file contains celery tasks for sending email
"""
import logging
from celery.exceptions import MaxRetriesExceededError
from celery import shared_task
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.contrib.sites.mode... | agpl-3.0 |
coolbombom/CouchPotatoServer | libs/chardet/utf8prober.py | 216 | 2663 | ######################## 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 |
catinred2/obfsproxy | obfsproxy/common/transport_config.py | 12 | 2548 | # -*- coding: utf-8 -*-
"""
Provides a class which represents a pluggable transport's configuration.
"""
class TransportConfig( object ):
"""
This class embeds configuration options for pluggable transport modules.
The options are set by obfsproxy and then passed to the transport's class
constructor... | bsd-3-clause |
ctmcquilkin/cal-mgt | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # 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 |
jkoelker/investing | picloud/symbols/fetch.py | 1 | 15085 | #!/usr/bin/env python
import argparse
import collections
import datetime
import itertools
import random
import sys
import cloud
import MySQLdb
import parsedatetime as pdt
import requests
from lxml import etree
MIN_DELAY = 20
MAX_DELAY = 120
MAX_RETRIES = 3
MIN_RETRY_DELAY = MIN_DELAY * 2
MAX_RETRY_DELAY = min(900,... | mit |
sergiohgz/incubator-airflow | airflow/contrib/hooks/redis_hook.py | 11 | 3015 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
jungla/ICOM-fluidity-toolbox | Detectors/offline_advection/advect_particles_2Db.py | 1 | 4115 | import os, sys
import myfun
import numpy as np
import lagrangian_stats
import scipy.interpolate as interpolate
import csv
import matplotlib.pyplot as plt
import advect_functions
import fio
from intergrid import Intergrid
## READ archive (too many points... somehow)
# args: name, dayi, dayf, days
#label = 'm_25_2_512'... | gpl-2.0 |
job/aclhound | aclhound/cli.py | 1 | 17983 | #!/usr/bin/env python2.7
# Copyright (C) 2014-2015 Job Snijders <job@instituut.net>
#
# This file is part of ACLHound
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the... | bsd-2-clause |
renpytom/python-for-android | src/buildlib/jinja2.egg/jinja2/tests.py | 285 | 3313 | # -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from jinja2.runtime import Undefined
# nose, nothing here to test
__test__ = False
number_r... | lgpl-2.1 |
rmfitzpatrick/ansible | lib/ansible/modules/network/cloudengine/ce_acl_interface.py | 27 | 9087 | #!/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 distribut... | gpl-3.0 |
janmbuys/DeepDeepParser | scripts/find_bucket_sizes.py | 1 | 1426 | import sys
if __name__=='__main__':
lines1 = [sent.split() for sent in open(sys.argv[1], 'r').read().split('\n')[:-1]]
lines2 = [sent.split() for sent in open(sys.argv[2], 'r').read().split('\n')[:-1]]
assert len(lines1) == len(lines2)
max_length1 = 200
max_length2 = 400
lengths = [[0 for _ in xrange(max_l... | apache-2.0 |
cdepman/falcon_api | site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## 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... | mit |
Ledoux/ShareYourSystem | Pythonlogy/ShareYourSystem/Standards/Recorders/Brianer/draft/01_ExampleCell copy 3.py | 2 | 1719 |
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Specials.Simulaters import Populater,Brianer
#Definition
MyBrianer=Brianer.BrianerClass(
).update(
{
'StimulatingStepTimeFloat':0.1
}
).produce(
['E','I'],
Populater.PopulaterClass,
{
'PopulatingEquationStr':
'''
dv/dt = (ge+gi... | mit |
zhjunlang/kbengine | kbe/src/lib/python/Lib/encodings/cp855.py | 272 | 33850 | """ 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'):
... | lgpl-3.0 |
zitouni/gnuradio-3.6.1 | gr-digital/examples/ofdm/tunnel.py | 14 | 9230 | #!/usr/bin/env python
#
# Copyright 2005,2006,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 2, or (at you... | gpl-3.0 |
enthought/traitsbackendqt | enthought/traits/ui/qt4/constants.py | 1 | 1775 | #------------------------------------------------------------------------------
# Copyright (c) 2007, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
# However, when used with the GPL version of PyQt the additional terms described in ... | gpl-2.0 |
snim2mirror/openihm | src/openihm/control/openihmexportmanager1.py | 3 | 14926 | #!/usr/bin/env python
"""
This file is part of open-ihm.
open-ihm is free software: you can redistribute it and/or modify it
from datetime import date
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... | lgpl-3.0 |
gousiosg/attic | coding-puzzles/binary_search_tree.py | 1 | 2599 | #!/usr/bin/env python3
from typing import List
class Node:
def __init__(self, left: 'Node', right: 'Node', val):
self.left = left
self.right = right
self.val = val
def insert(self, val):
if val > self.val:
if self.right is None:
print(f"add {val} a... | mit |
Droid-Concepts/android_kernel_lge_f320k | 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 |
adamantike/salud-api | app/mod_profiles/resources/views/analysisFileView.py | 3 | 6535 | # -*- coding: utf-8 -*-
from flask import g
from flask_restful import Resource, marshal_with
from flask_restful_swagger import swagger
from app.mod_shared.models.auth import auth
from app.mod_shared.models.db import db
from app.mod_profiles.models import AnalysisFile
from app.mod_profiles.common.fields.analysisFileFi... | gpl-2.0 |
keepawayfromfire/firecoin | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
dendisuhubdy/tensorflow | tensorflow/contrib/slim/python/slim/model_analyzer.py | 166 | 3509 | # 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 |
dagwieers/ansible | lib/ansible/modules/network/avi/avi_alertscriptconfig.py | 31 | 3675 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# 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.txt)
#
ANSIB... | gpl-3.0 |
gannetson/sportschooldeopenlucht | apps/projects/tests/functional.py | 1 | 4414 | # -*- coding: utf-8 -*-
"""
Functional tests using Selenium.
See: ``docs/testing/selenium.rst`` for details.
"""
import time
from django.conf import settings
from django.utils.text import slugify
from django.utils.unittest.case import skipUnless
from ..models import Project, ProjectPhases
from .unittests import Proj... | bsd-3-clause |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/bugs/browser/tests/test_bugsubscription_views.py | 1 | 36609 | # Copyright 2010-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for BugSubscription views."""
__metaclass__ = type
from lazr.restful.interfaces import IWebServiceClientRequest
from simplejson import dumps
from storm.store import... | agpl-3.0 |
openstack/nova | nova/tests/functional/libvirt/test_pci_sriov_servers.py | 2 | 67477 | # Copyright (C) 2016 Red Hat, 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 |
tmcrosario/odoo-sicon | sicon/models/wizards.py | 1 | 5762 | # -*- coding: utf-8 -*-
from datetime import datetime
from re import search
from concession import Concession
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class AddEventWizard(models.TransientModel):
_name = 'sicon.add_event_wizard'
concession_id = fields.Many2one(
... | agpl-3.0 |
zandegran/django-timeStamp | timeStamps/tests/tests.py | 1 | 3332 |
"""
This is the test module.
This test module has all the test cass for timeStamps
.. seealso:: :class:`..models.TimeStamp`
"""
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import AnonymousUser, User
from django.conf import settings
from ..models import T... | mit |
mlinsenbard/481FinalProject | movieRecc.py | 1 | 8315 | from pyspark import SparkContext
from pyspark import SparkConf
# Initialize Spark context
conf = SparkConf()
sc = SparkContext()
# Turn on quiet(er) logging
def quiet_logs( s ):
logger = s._jvm.org.apache.log4j
logger.LogManager.getLogger("org"). setLevel( logger.Level.ERROR )
logger.LogManager.getLogger("akka... | mit |
maartenq/ansible | test/runner/lib/classification.py | 4 | 26608 | """Classify changes in Ansible code."""
from __future__ import absolute_import, print_function
import collections
import os
import re
import time
from lib.target import (
walk_module_targets,
walk_integration_targets,
walk_units_targets,
walk_compile_targets,
walk_sanity_targets,
load_integra... | gpl-3.0 |
iskandr/striate | striate/data.py | 1 | 14160 | from PIL import Image
from pycuda import gpuarray, driver
from striate.cuda_kernel import gpu_partial_copy_to, print_matrix
from os.path import basename
from striate import util
import Queue
import cPickle
import collections
import glob
import numpy as np
import os
import random
import re
import sys
import threading
im... | gpl-3.0 |
smallyear/linuxLearn | salt/salt/cloud/clouds/nova.py | 1 | 35988 | # -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the OpenStack
module for Salt Cloud, which... | apache-2.0 |
paolodedios/tensorflow | tensorflow/python/ops/collective_ops_xla_test.py | 10 | 3124 | # Copyright 2020 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 applicab... | apache-2.0 |
Dekken/tick | tick/simulation/features.py | 2 | 2316 | # License: BSD 3 clause
import numpy as np
from scipy.linalg.special_matrices import toeplitz
def features_normal_cov_uniform(n_samples: int = 200, n_features: int = 30,
dtype="float64"):
"""Normal features generator with uniform covariance
An example of features obtained as ... | bsd-3-clause |
adw0rd/lettuce | tests/integration/lib/Django-1.2.5/django/utils/datetime_safe.py | 496 | 2685 | # Python's datetime strftime doesn't handle dates before 1900.
# These classes override date and datetime to support the formatting of a date
# through its full "proleptic Gregorian" date range.
#
# Based on code submitted to comp.lang.python by Andrew Dalke
#
# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was... | gpl-3.0 |
Peter92/MouseTrack | mousetracks/utils/os/linux/xlib/__init__.py | 1 | 1208 | """This is part of the Mouse Tracks Python application.
Source: https://github.com/Peter92/MouseTracks
"""
#Linux functions that require Xlib
#Thanks to /u/Astrrum for helping, still needs a lot of work
from __future__ import absolute_import
from Xlib import display
from .pyxhook import HookManager
def get_resolut... | gpl-3.0 |
gtaylor/ansible | v2/ansible/plugins/action/pause.py | 57 | 5479 | # Copyright 2012, Tim Bielawa <tbielawa@redhat.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... | gpl-3.0 |
juliandev/SIFTER | src/scripts/sifter_extract.py | 2 | 21717 | #!/usr/bin/python
import _mysql as mysql
import _mysql_exceptions as mysql_exceptions
import MySQLdb.cursors
import os
import pickle
import numpy as np
import sys
import StringIO
from scipy.misc import comb
import getopt
import csv
import re
def usage():
print "\n---------------------------------------------------... | gpl-3.0 |
ntt-sic/neutron | neutron/tests/unit/linuxbridge/test_agent_scheduler.py | 28 | 1192 | # Copyright (c) 2013 OpenStack Foundation.
#
# 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... | apache-2.0 |
goulu/networkx | networkx/algorithms/bipartite/cluster.py | 83 | 7042 | #-*- coding: utf-8 -*-
# Copyright (C) 2011 by
# Jordi Torrents <jtorrents@milnou.net>
# Aric Hagberg <hagberg@lanl.gov>
# All rights reserved.
# BSD license.
import itertools
import networkx as nx
__author__ = """\n""".join(['Jordi Torrents <jtorrents@milnou.net>',
'Aric Hag... | bsd-3-clause |
ligature/ansible-modules-extras | cloud/amazon/s3_lifecycle.py | 27 | 15168 | #!/usr/bin/python
#
# 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 distributed in the hope that i... | gpl-3.0 |
ivanyu/rosalind | algorithmic_heights/cc/cc.py | 1 | 1808 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main(argv):
from cc_logic import cc
if len(argv) < 2:
print("Input file isn't specified. Using test values:")
print('n = 12')
n = 12
print('m = 13')
m = 13
print('Graph:')
graph = [[] for _ in range(n)]... | mit |
neoden/lagring | lagring/core.py | 1 | 5311 | # coding=utf-8
import os
import io
import shutil
import uuid
from .classproperty import classproperty
from .exceptions import StorageException
from .logger import log
class _AssetSource:
def __init__(self, src, extension=None):
self.src = src
self.extension = self._normalise_extension(extension)... | mit |
isandlaTech/cohorte-devtools | qualifier/deploy/cohorte-home/repo/sleekxmpp/plugins/xep_0313/stanza.py | 11 | 3682 | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permissio
"""
import datetime as dt
from sleekxmpp.jid import JID
from sleekxmpp.xmlstream import ElementBase, ET
from sleekxmpp.plugins impor... | apache-2.0 |
Simran-B/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/cgitb.py | 57 | 12125 | """More comprehensive traceback formatting for Python scripts.
To enable this module, do:
import cgitb; cgitb.enable()
at the top of your script. The optional arguments to enable() are:
display - if true, tracebacks are displayed in the web browser
logdir - if set, tracebacks are written to fi... | apache-2.0 |
iapearthbound/omap_tuna_jb | 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 |
OpenBMP/openbmp-mysql-consumer | cron_scripts/gen-asn-stats/gen-asn-stats.py | 1 | 23965 | #!/usr/bin/env python
"""
Copyright (c) 2013-2014 Cisco Systems, Inc. and others. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10... | epl-1.0 |
techtonik/numpy | tools/win32build/misc/x86analysis.py | 75 | 6150 | #! /usr/bin/env python
# Last Change: Sat Mar 28 02:00 AM 2009 J
# Try to identify instruction set used in binary (x86 only). This works by
# checking the assembly for instructions specific to sse, etc... Obviously,
# this won't work all the times (for example, if some instructions are used
# only after proper detecti... | bsd-3-clause |
BorgERP/borg-erp-6of3 | extra_apps/mgmtsystem61/mgmtsystem_hazard/mgmtsystem_hazard.py | 1 | 9274 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
pschmitt/home-assistant | homeassistant/components/random/sensor.py | 10 | 2450 | """Support for showing random numbers."""
import logging
from random import randrange
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_MAXIMUM,
CONF_MINIMUM,
CONF_NAME,
CONF_UNIT_OF_MEASUREMENT,
)
import homeassistant.helpers.c... | apache-2.0 |
jeyraof/python-social-auth | examples/flask_me_example/__init__.py | 57 | 1210 | import sys
from flask import Flask, g
from flask.ext import login
from flask.ext.mongoengine import MongoEngine
sys.path.append('../..')
from social.apps.flask_app.routes import social_auth
from social.apps.flask_app.me.models import init_social
from social.apps.flask_app.template_filters import backends
# App
app... | bsd-3-clause |
sfrenza/test-for-bot | venv/Lib/encodings/euc_kr.py | 816 | 1027 | #
# euc_kr.py: Python Unicode Codec for EUC_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_kr, codecs
import _multibytecodec as mbc
codec = _codecs_kr.getcodec('euc_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | mit |
chrisvire/aeneas | bin/aeneas_execute_job.py | 5 | 1894 | #!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... | agpl-3.0 |
NetDBNCKU/GAE-Conference-Web-App | dbindexer/tests.py | 16 | 11193 | from django.db import models
from django.test import TestCase
from .api import register_index
from .lookups import StandardLookup
from .resolver import resolver
from djangotoolbox.fields import ListField
from datetime import datetime
import re
class ForeignIndexed2(models.Model):
name_fi2 = models.CharField(max_le... | bsd-3-clause |
lsinfo/odoo | addons/base_iban/__init__.py | 447 | 1073 | # -*- 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... | agpl-3.0 |
aclifton/cpeg853-gem5 | tests/configs/realview-simple-atomic-dual.py | 61 | 2344 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/pip/_vendor/distlib/locators.py | 328 | 51013 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... | gpl-2.0 |
korealerts1/sentry | tests/sentry/api/endpoints/test_group_tagkey_details.py | 23 | 1487 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import GroupTagKey, GroupTagValue, TagKey, TagValue
from sentry.testutils import APITestCase
class GroupTagDetailsTest(APITestCase):
def test_simple(self):
group = self.create_group()
group.dat... | bsd-3-clause |
alsrgv/tensorflow | tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py | 3 | 10950 | # Copyright 2018 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 |
shsingh/ansible | lib/ansible/executor/powershell/module_manifest.py | 3 | 16046 | # (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import base64
import errno
import json
import os
import pkgutil
import random
import re
from distutils.versio... | gpl-3.0 |
apfeltee/clearsilver | cdbi/log.py | 9 | 1082 | #!/neo/opt/bin/python
# log.py
import sys, time
DEV = "development"
DEV_UPDATE = "update queries"
DEV_SELECT = "select queries"
DEV_REPORT = "report log"
LOGGING_STATUS = {
DEV : 1,
DEV_UPDATE : 0,
DEV_SELECT : 0,
DEV_REPORT : 0}
tstart = 0
def dlog(when,astr):
global LOGGING_STATUS
try:
... | bsd-2-clause |
yangming85/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/backends/tests.py | 27 | 12550 | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
import datetime
from django.core.management.color import no_style
from django.db import backend, connection, connections, DEFAULT_DB_ALIAS, IntegrityError
from django.db.backends.signals import connection_created
from django.db.backends.postgr... | gpl-3.0 |
Zhongqilong/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/commands/wheel.py | 328 | 7320 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import sys
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.log import logger
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import InstallRequirement, RequirementSet, parse_requirement... | lgpl-3.0 |
ejls/fuel | tests/test_converters.py | 4 | 26039 | from __future__ import print_function
import argparse
import gzip
import mock
import os
import shutil
import struct
import tarfile
import tempfile
import h5py
import numpy
import six
from numpy.testing import assert_equal, assert_raises
from PIL import Image
from scipy.io import savemat
from six.moves import range, zi... | mit |
ishay2b/tensorflow | tensorflow/contrib/tpu/profiler/pip_package/setup.py | 1 | 2096 | # 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 |
xrmx/xhtml2pdf | xhtml2pdf/pisa.py | 37 | 13504 | # -*- coding: utf-8 -*-
from xhtml2pdf.default import DEFAULT_CSS
from xhtml2pdf.document import pisaDocument
from xhtml2pdf.util import getFile
from xhtml2pdf.version import VERSION, VERSION_STR
import getopt
import glob
import logging
import os
import sys
import tempfile
import urllib2
import urlparse
# Copyright 20... | apache-2.0 |
dlazz/ansible | lib/ansible/plugins/cliconf/ios.py | 18 | 13869 | #
# (c) 2017 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 d... | gpl-3.0 |
hujiajie/pa-chromium | third_party/tlslite/tlslite/utils/codec.py | 361 | 2771 | """Classes for reading/writing binary data (such as TLS records)."""
from compat import *
class Writer:
def __init__(self, length=0):
#If length is zero, then this is just a "trial run" to determine length
self.index = 0
self.bytes = createByteArrayZeros(length)
def add(self, x, lengt... | bsd-3-clause |
Ernestyj/LeetCode | Python/python-qiyuangong/617_Merge_Two_Binary_Trees.py | 2 | 1169 | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def mergeTrees(self, t1, t2):
"""
:type t1: TreeNode
:type t2: TreeNode
:rtype: TreeNode
... | gpl-3.0 |
reiaaoyama/contrail-controller | src/config/svc-monitor/svc_monitor/tests/test_snat.py | 6 | 4254 | import mock
from mock import patch
import unittest
from vnc_api.vnc_api import *
from svc_monitor.instance_manager import NetworkNamespaceManager
from svc_monitor.config_db import *
import test_common_utils as test_utils
class SnatInstanceManager(unittest.TestCase):
def setUp(self):
InstanceIpSM._cassandra... | apache-2.0 |
ankurankan/scikit-learn | examples/decomposition/plot_kernel_pca.py | 353 | 2011 | """
==========
Kernel PCA
==========
This example shows that Kernel PCA is able to find a projection of the data
that makes data linearly separable.
"""
print(__doc__)
# Authors: Mathieu Blondel
# Andreas Mueller
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomp... | bsd-3-clause |
sidartaoliveira/ansible | lib/ansible/modules/network/cloudengine/ce_startup.py | 47 | 15451 | #!/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 distribut... | gpl-3.0 |
kozmikkick/flounder | 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 |
AnthonyBroadCrawford/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_memorizingfile.py | 496 | 4252 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
XayOn/python-irclib | ircbot.py | 87 | 13185 | # Copyright (C) 1999--2002 Joel Rosdahl
#
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This library is ... | lgpl-2.1 |
nparley/mylatitude | lib/libfuturize/fixes/fix_future_builtins.py | 62 | 2028 | """
For the ``future`` package.
Adds this import line::
from builtins import XYZ
for each of the functions XYZ that is used in the module.
Adds these imports after any other imports (in an initial block of them).
"""
from __future__ import unicode_literals
from lib2to3 import fixer_base
from lib2to3.pygram im... | mit |
hustodemon/spacewalk | backend/server/test/test_list_missing_source_packages.py | 2 | 1788 | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
tragiclifestories/django | tests/utils_tests/test_timesince.py | 293 | 6089 | from __future__ import unicode_literals
import datetime
import unittest
from django.test.utils import requires_tz_support
from django.utils import timezone
from django.utils.timesince import timesince, timeuntil
class TimesinceTests(unittest.TestCase):
def setUp(self):
self.t = datetime.datetime(2007, ... | bsd-3-clause |
lino-framework/welfare | lino_welfare/modlib/cbss/mixins.py | 1 | 23598 | # -*- coding: UTF-8 -*-
# Copyright 2011-2019 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
"""Model mixins for `lino_welfare.modlib.cbss`. """
from builtins import str
import os
import traceback
import datetime
import logging
import six
logger = logging.getLogger(__n... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.