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 |
|---|---|---|---|---|---|
katsikas/gnuradio | gnuradio-core/src/python/gnuradio/gru/__init__.py | 18 | 1281 | #
# Copyright 2005 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)
# any later version.
#
#... | gpl-3.0 |
SomethingExplosive/android_external_chromium_org | chrome/test/pyautolib/fetch_prebuilt_pyauto.py | 67 | 8213 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Fetch prebuilt binaries to run PyAuto.
Sets up Chrome and PyAuto binaries using prebuilt binaries from the
continuous build arc... | bsd-3-clause |
TamsuiCM11/android_kernel_sony_msm7x27a | scripts/gcc-wrapper.py | 501 | 3410 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, 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 a... | gpl-2.0 |
seann1/portfolio5 | .meteor/dev_bundle/python/Lib/encodings/cp1026.py | 593 | 13369 | """ Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.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,inp... | gpl-2.0 |
biodrone/plex-desk | desk/flask/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py | 1004 | 9544 | # The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
import time
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
# urllib3
_Default = object()
def current... | mit |
emc2foundation/einsteinium | contrib/macdeploy/custom_dsstore.py | 1 | 3778 | #!/usr/bin/env python
# Copyright (c) 2013-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | mit |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/resources/types/domain_category.py | 1 | 3952 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
saada/ansible | v1/ansible/runner/action_plugins/script.py | 106 | 5700 | # (c) 2012, Michael DeHaan <michael.dehaan@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 lat... | gpl-3.0 |
nullishzero/Portage | pym/_emerge/EbuildExecuter.py | 10 | 2592 | # Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.EbuildPhase import EbuildPhase
from _emerge.TaskSequence import TaskSequence
from _emerge.CompositeTask import CompositeTask
import portage
from portage import os
from portage.eapi import eapi_has_sr... | gpl-2.0 |
matmutant/sl4a | python/src/Lib/plat-irix6/SV.py | 132 | 3331 | from warnings import warnpy3k
warnpy3k("the SV module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
NTSC_XMAX = 640
NTSC_YMAX = 480
PAL_XMAX = 768
PAL_YMAX = 576
BLANKING_BUFFER_SIZE = 2
MAX_SOURCES = 2
# mode parameter for Bind calls
IN_OFF = 0 # No Video
IN_OVER = 1 ... | apache-2.0 |
spawnedc/MeCanBlog | dbindexer/lookups.py | 1 | 8808 | from django.db import models
from djangotoolbox.fields import ListField
from copy import deepcopy
import re
regex = type(re.compile(''))
class LookupDoesNotExist(Exception):
pass
class LookupBase(type):
def __new__(cls, name, bases, attrs):
new_cls = type.__new__(cls, name, bases, attrs)
if ... | bsd-3-clause |
vjmac15/Lyilis | lib/youtube_dl/extractor/pinkbike.py | 62 | 3446 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
remove_end,
remove_start,
str_to_int,
unified_strdate,
)
class PinkbikeIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www\.)?pinkbike\.com/video/|es\.pinkb... | gpl-3.0 |
googleads/google-ads-python | google/ads/googleads/v8/services/types/geo_target_constant_service.py | 1 | 5566 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
prospwro/odoo | addons/sale_margin/__openerp__.py | 261 | 1592 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
novirael/os-simulation | memory/simulation.py | 1 | 1520 | from copy import copy
from random import randint
from memory import (
FirstInFirstOutAlgorithm,
TheOptimalAlgorithm,
LastRecentlyUsedAlgorithm,
ApproximalLastRecentlyUsedAlgorithm,
RandomAlgorithm
)
PAGE_SIZE = 100
FRAMES = 10
NUM_REQUESTS = 1000
def test(page_size, frames_size, num_requests, d... | mit |
lekum/ansible-modules-extras | web_infrastructure/deploy_helper.py | 45 | 20086 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Jasper N. Brouwer <jasper@nerdsweide.nl>
# (c) 2014, Ramon de la Fuente <ramon@delafuente.nl>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... | gpl-3.0 |
joelddiaz/openshift-tools | scripts/monitoring/cron-send-etcd-status.py | 12 | 5801 | #!/usr/bin/env python
'''
Command to send status of etcd to zabbix
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#This is not a module, but pylint thinks it is. This is a command.
#pylint: disable=invalid-name
#If we break the few lines it will be harder to read in this case
#pylint: disable=line-too-long
import ar... | apache-2.0 |
frank10704/DF_GCS_W | MissionPlanner-master/Lib/wsgiref/headers.py | 59 | 6048 | """Manage HTTP Response Headers
Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
"""
from types import ListType, TupleType
# Regular expression that matches `special' character... | gpl-3.0 |
copejon/kubernetes | examples/cluster-dns/images/frontend/client.py | 504 | 1207 | #!/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 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_7_0/issue_list_broker.py | 16 | 73668 | from ..broker import Broker
class IssueListBroker(Broker):
controller = "issue_lists"
def show(self, **kwargs):
"""Shows the details for the specified issue list.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` Tr... | apache-2.0 |
michaelgallacher/intellij-community | python/helpers/pydev/pydev_ipython/qt_loaders.py | 12 | 7146 | """
This module contains factory functions that attempt
to return Qt submodules from the various python Qt bindings.
It also protects against double-importing Qt with different
bindings, which is unstable and likely to crash
This is used primarily by qt and qt_for_kernel, and shouldn't
be accessed directly from the o... | apache-2.0 |
bkendzior/scipy | scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py | 41 | 29594 | from __future__ import division, print_function, absolute_import
__usage__ = """
To run tests locally:
python tests/test_arpack.py [-l<int>] [-v<int>]
"""
import warnings
import threading
import numpy as np
from numpy.testing import assert_allclose, \
assert_array_almost_equal_nulp, run_module_suite, \
... | bsd-3-clause |
sajeeshcs/nested_quota_final | nova/tests/unit/fake_processutils.py | 8 | 3490 | # Copyright (c) 2011 Citrix Systems, 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 ... | apache-2.0 |
dkalashnik/tempest | tempest/scenario/test_encrypted_cinder_volumes.py | 23 | 3119 | # Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
mattsep/TDSE | src/animate.py | 1 | 1444 | import scipy as sp
import matplotlib.pyplot as plt
import matplotlib.animation as animation
# animation of the probability density of the wavefunction over the course
# of time
def probabilityDensity(x, t, V, psi):
# convert to the probability density
Nt = len(t)
rho = sp.real(sp.conjugate(psi)*psi)
... | gpl-3.0 |
rhg/Qwibber | gwibber/microblog/util/const.py | 2 | 7816 | import xdg.BaseDirectory
from os.path import join, isdir, realpath
from os import mkdir, environ
CACHE_DIR = realpath(join(xdg.BaseDirectory.xdg_cache_home, "gwibber"))
if not isdir(CACHE_DIR):
mkdir(CACHE_DIR)
from os import environ
if environ.has_key("FB_APP_KEY"):
FB_APP_KEY = environ["FB_APP_KEY"]
else:
FB_... | gpl-2.0 |
ticklemepierce/osf.io | api_tests/nodes/views/test_node_children_list.py | 1 | 22121 | # -*- coding: utf-8 -*-
from nose.tools import * # flake8: noqa
from framework.auth.core import Auth
from website.models import Node, NodeLog
from website.util import permissions
from website.util.sanitize import strip_html
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase, fake
fr... | apache-2.0 |
vinilios/synnefo | snf-cyclades-app/synnefo/api/tests/versions.py | 9 | 1869 | # Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-3.0 |
ujjwal96/mitmproxy | pathod/language/websockets.py | 4 | 5608 | import random
import string
import typing # noqa
import pyparsing as pp
import mitmproxy.net.websockets
from mitmproxy.utils import strutils
from . import base, generators, actions, message
NESTED_LEADER = b"pathod!"
class WF(base.CaselessLiteral):
TOK = "wf"
class OpCode(base.IntField):
names: typing.D... | mit |
liumengjun/django-static-precompiler | static_precompiler/templatetags/base.py | 1 | 1478 | import inspect
try:
# Django>=1.9
from django.template import library
except ImportError:
# Django<1.9
from django.template import base as library
def container_tag(register, name=None):
def dec(func):
params, varargs, varkw, defaults = inspect.getargspec(func)
params = params[1:... | mit |
UWIT-IAM/uw-restclients | restclients/library/mylibinfo.py | 3 | 2517 | """
This is the interface for interacting with the UW Libraries Web Service.
"""
from datetime import datetime
import logging
import json
from restclients.models.library import MyLibAccount
from restclients.dao import MyLibInfo_DAO
from restclients.exceptions import DataFailureException
from restclients.util.timer imp... | apache-2.0 |
JustinSGray/Kona | src/kona/linalg/matrices/preconds/nested.py | 1 | 1272 | from kona.linalg.matrices.common import IdentityMatrix
from kona.linalg.matrices.hessian import ReducedKKTMatrix
class NestedKKTPreconditioner(ReducedKKTMatrix):
"""
This object preconditions the KKT system by doing approximate solutions
of the 2nd order adjoints using the PDE preconditioner.
The appr... | lgpl-3.0 |
Sheep-wolf/Everest_Main_Branch | DLLSocket/server_controller.py | 19 | 1530 | import subprocess
import socket
import urlparse
UDP_IP="127.0.0.1"
UDP_PORT=8019
sock = socket.socket( socket.AF_INET, # Internet
socket.SOCK_DGRAM ) # UDP
sock.bind( (UDP_IP,UDP_PORT) )
last_ticker_state = None
def handle_message(data, addr):
global last_ticker_state
params = urlpars... | agpl-3.0 |
skirpichev/omg | diofant/tests/integrals/test_rde.py | 2 | 9467 | """Most of these tests come from the examples in Bronstein's book."""
import pytest
from diofant import I, Poly, Rational, oo, symbols
from diofant.abc import k, n, t, x, z
from diofant.integrals.rde import (bound_degree, cancel_exp, cancel_primitive,
no_cancel_equal, normal_denom, ... | bsd-3-clause |
skycucumber/restful | python/venv/lib/python2.7/site-packages/sqlalchemy/sql/base.py | 21 | 21476 | # sql/base.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Foundational utilities common to many sql modules.
"""
from .. import util, exc
im... | gpl-2.0 |
harisibrahimkv/django | tests/generic_relations/tests.py | 28 | 31297 | from django import forms
from django.contrib.contenttypes.forms import generic_inlineformset_factory
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db import IntegrityError, models
from django.db.models import Q
from django.test import SimpleTestCase... | bsd-3-clause |
DeepSOIC/Lattice | latticeBaseFeature.py | 1 | 11471 | #***************************************************************************
#* *
#* Copyright (c) 2015 - Victor Titov (DeepSOIC) *
#* <vv.titov@gmail.com> *
#* ... | lgpl-2.1 |
TheTimmy/spack | var/spack/repos/builtin/packages/parallel-netcdf/package.py | 3 | 2919 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
andydandy74/ClockworkForDynamo | nodes/1.x/python/Element.SubComponents.py | 4 | 1112 | import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
items = UnwrapElement(IN[0])
def GetSubComponents(item):
# FamilyInstances
if hasattr(item, "GetSubComponentIds"):
return [item.Document.GetElement(x) for x in ... | mit |
jgoppert/pymola | test/xml_test.py | 1 | 4050 | #!/usr/bin/env python
"""
Test XML backend
"""
import os
import sys
import time
import unittest
import pymoca.parser as mo_parser
from pymoca.backends.xml import analysis, generator, sim_scipy
from pymoca.backends.xml import parser as xml_parser
# get matplotlib from analysis, since logic for plotting
# without displa... | bsd-3-clause |
DataDog/python-openid | admin/gettlds.py | 126 | 1061 | """
Fetch the current TLD list from the IANA Web site, parse it, and print
an expression suitable for direct insertion into each library's trust
root validation module
Usage:
python gettlds.py (php|python|ruby)
Then cut-n-paste.
"""
import urllib2
import sys
langs = {
'php': (r"'/\.(",
"'", "|", ... | apache-2.0 |
intel-ctrlsys/actsys | actsys/control/diagnostics/mock_diagnostics/mock_diagnostics.py | 1 | 6050 | #
#Copyright (c) 2017 Intel Corp.
#
"""
Interface for all diagnostic tests plugins.
"""
from control.console_log.mock_console_log.ipmi_mock import MockConsoleLog
from control.diagnostics.diagnostics import Diagnostics
from control.plugin import DeclarePlugin
@DeclarePlugin('mock', 100)
class MockDiagnostics(Diagnos... | apache-2.0 |
ryfeus/lambda-packs | Tensorflow_OpenCV_Nightly/source/tensorflow/python/ops/distributions/multinomial.py | 25 | 11069 | # 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... | mit |
FATruden/boto | boto/ec2/attributes.py | 182 | 2710 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
michaelgallacher/intellij-community | python/helpers/py3only/docutils/parsers/rst/tableparser.py | 44 | 21026 | # $Id: tableparser.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This module defines table parser classes,which parse plaintext-graphic tables
and produce a well-formed data structure suitable for building a CALS tab... | apache-2.0 |
thypon/android_kernel_samsung_tuna | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
spbguru/repo1 | examples/prediction/experiments/confidenceTest/firstOrder/description.py | 17 | 2599 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
trankmichael/scipy | scipy/signal/waveforms.py | 64 | 14818 | # Author: Travis Oliphant
# 2003
#
# Feb. 2010: Updated by Warren Weckesser:
# Rewrote much of chirp()
# Added sweep_poly()
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
exp, cos, sin, polyval, po... | bsd-3-clause |
yangming85/lettuce | tests/integration/lib/Django-1.2.5/tests/modeltests/aggregation/models.py | 139 | 1181 | # coding: utf-8
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __unicode__(self):
return self.name
class Publisher(models.Model):
name = models.CharField... | gpl-3.0 |
kobejean/tensorflow | tensorflow/python/client/device_lib_test.py | 49 | 1746 | # 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 |
marshalys/simple-rtmp-server | trunk/research/api-server/server.py | 6 | 15659 | #!/usr/bin/python
'''
The MIT License (MIT)
Copyright (c) 2013-2014 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, cop... | mit |
victorkeophila/alien4cloud-cloudify3-provider | src/test/resources/outputs/blueprints/amazon/tomcat/wrapper/Tomcat/tosca.interfaces.node.lifecycle.Standard/create/artifacts/tomcat-war-types/scripts/_a4c_tomcat_install.py | 6 | 14972 |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify impo... | apache-2.0 |
qgis/QGIS | tests/src/python/test_qgsopacitywidget.py | 45 | 1458 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsOpacityWidget
.. 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 |
Stan1989/volatility | volatility/plugins/linux/slab_info.py | 44 | 6851 | # Volatility
#
# This file is part of Volatility.
#
# Volatility 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.
#
# Volatility is dist... | gpl-2.0 |
PyCon/pycon | symposion/proposals/migrations/0012_auto_20180921_1053.py | 1 | 1034 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('proposals', '0011_proposal_created_updated'),
]
operations = [
migrations.AlterField(
model_name='proposalbase',... | bsd-3-clause |
archf/ansible | lib/ansible/compat/__init__.py | 241 | 1087 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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 |
trachelr/mne-python | examples/preprocessing/plot_find_ecg_artifacts.py | 19 | 1304 | """
==================
Find ECG artifacts
==================
Locate QRS component of ECG.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
print(_... | bsd-3-clause |
level09/hogar | hogar/ResponseHandler.py | 2 | 10290 | # The MIT License (MIT)
#
# Copyright (c) 2015 Leon Jacobs
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | mit |
kumar303/olympia | services/utils.py | 2 | 3642 | import logging
import logging.config
import os
import posixpath
import re
import sys
import MySQLdb as mysql
import sqlalchemy.pool as pool
from six.moves.urllib.parse import urlencode
from services.settings import settings
import olympia.core.logger
# Ugh. But this avoids any olympia models or django imports at a... | bsd-3-clause |
5StevenWu/Coursepy | L05/表达式的yield的用途.py | 1 | 1842 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#此为最终结果 已经可以查找到有关键字的文件
'''
grep -rl 'python' /root
'''
import os
def init(func):
def wrapper(*args,**kwargs):
res = func(*args,**kwargs)
next(res)
return res
return wrapper
@init #生成器调用装饰器
def search(target):
'''取出所有文件路径'''
#更改为生成器... | apache-2.0 |
anthonydillon/horizon | openstack_dashboard/contrib/sahara/test/helpers.py | 25 | 1346 | #
# 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 |
tqtran7/horizon | openstack_dashboard/dashboards/admin/routers/tests.py | 25 | 7265 | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | apache-2.0 |
glogiotatidis/bedrock | bedrock/mozorg/tests/test_models.py | 3 | 4006 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.core.cache import cache
from django.db.utils import DatabaseError
from django.db.mod... | mpl-2.0 |
ibmsoe/tensorflow | tensorflow/python/summary/summary.py | 20 | 12508 | # 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 |
caseymorrisus/electron-test | resources/app/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/xcodeproj_file.py | 505 | 118664 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... | mit |
Azure/azure-linux-extensions | VMEncryption/main/oscrypto/ubuntu_1404/encryptstates/EncryptBlockDeviceState.py | 3 | 4482 | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# 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
#
# U... | apache-2.0 |
asi1024/Othbot | main.py | 1 | 3481 | #!/usr/local/bin/python
import Image
import autopy
import os
import time
startX, spanX, startY, spanY = 30, 150, 130, 40
pX, pY = 180, 225
size, span = 30, 56
boxs = size ** 2
starts = spanX * spanY
# draw
def draw_start(im):
for i in range(spanY):
for j in range(spanX):
im.putpixel ((startX... | mit |
MichaelNedzelsky/intellij-community | python/lib/Lib/optparse.py | 88 | 60532 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
"""
__version__ = "1.5.3"
__all__ = ['Option',
'SUPPRE... | apache-2.0 |
kdyq007/cmdb-api | lib/ci.py | 1 | 27854 | # -*- coding:utf-8 -*-
import uuid
import time
import datetime
import json
from flask import current_app
from flask import abort
from sqlalchemy import or_
from extensions import db
from extensions import rd
from models.ci import CI
from models.ci_relation import CIRelation
from models.ci_type import CITypeAttribu... | gpl-2.0 |
dgjustice/ansible | lib/ansible/modules/windows/win_reboot.py | 25 | 2850 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/mne-python-0.10/mne/fixes.py | 1 | 29568 | """Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fixe is no longer needed.
# XXX : copied from scikit-learn
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael... | bsd-3-clause |
samfoo/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/origin_check_wsh.py | 499 | 1916 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
polyaxon/polyaxon | core/polyaxon/tracking/contrib/ignite.py | 1 | 1104 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | apache-2.0 |
janocat/odoo | addons/website_blog/models/website_blog.py | 239 | 10994 | # -*- coding: utf-8 -*-
from datetime import datetime
import difflib
import lxml
import random
from openerp import tools
from openerp import SUPERUSER_ID
from openerp.addons.website.models.website import slug
from openerp.osv import osv, fields
from openerp.tools.translate import _
class Blog(osv.Model):
_name ... | agpl-3.0 |
sysopfb/Malware_Scripts | wannacry/decode_dll.py | 1 | 1118 | #For decoded t.wnry file from sample: ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa
from Crypto.Cipher import PKCS1_v1_5
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES
from Crypto import Random
from Crypto.Hash import SHA
import sys
import struct
import binascii
import hashlib
def d... | mit |
AndroidAddict92/android_kernel_lge_w5 | scripts/gcc-wrapper.py | 1276 | 3382 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
xyuanmu/XX-Net | python3.8.2/Lib/cffi/vengine_gen.py | 24 | 26676 | #
# DEPRECATED: implementation for ffi.verify()
#
import sys, os
import types
from . import model
from .error import VerificationError
class VGenericEngine(object):
_class_key = 'g'
_gen_python_module = False
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
... | bsd-2-clause |
40223137/cdag7test37 | static/Brython3.1.0-20150301-090019/Lib/test/support.py | 603 | 68067 | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
import contextlib
import errno
import functools
import gc
import socket
import sys
import os
import platform
import shutil
import warnings
import unittes... | gpl-3.0 |
ericzolf/ansible | lib/ansible/plugins/action/set_stats.py | 122 | 2903 | # Copyright 2016 Ansible (RedHat, 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.
#
#... | gpl-3.0 |
BenjaminEHowe/library-api | library_api/implementations/enterprise.py | 1 | 15276 | import re
import requests
from ..library import NotAuthenticatedError
class library:
def __init__(self, url):
""" Initialises the library. """
self.session = requests.Session()
self.authenticated = False;
return
def login(self, userid, password):
""" Authe... | mit |
hvanhovell/spark | python/pyspark/streaming/dstream.py | 20 | 27735 | #
# 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 us... | apache-2.0 |
sahilshekhawat/pydy | pydy/viz/shapes.py | 4 | 19419 | #!/usr/bin/env python
__all__ = ['Cube',
'Cylinder',
'Cone',
'Sphere',
'Circle',
'Plane',
'Tetrahedron',
'Octahedron',
'Icosahedron',
'Torus',
'TorusKnot',
'Tube']
import numpy as np
# This is a ... | bsd-3-clause |
kyoshino/bedrock | bedrock/releasenotes/tests/test_models.py | 1 | 6304 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from itertools import chain
from django.core.cache import caches
from django.test.utils import override_settings
from ... | mpl-2.0 |
comiconomenclaturist/libretime | python_apps/airtime_analyzer/tests/cuepoint_analyzer_tests.py | 2 | 2583 | from nose.tools import *
from airtime_analyzer.cuepoint_analyzer import CuePointAnalyzer
def check_default_metadata(metadata):
''' Check that the values extract by Silan/CuePointAnalyzer on our test audio files match what we expect.
:param metadata: a metadata dictionary
:return: Nothing
'''
# We g... | agpl-3.0 |
moonbeamxp/ns-3 | src/point-to-point-layout/bindings/modulegen__gcc_ILP32.py | 24 | 494961 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
Workday/OpenFrame | third_party/libxml/src/regressions.py | 360 | 12439 | #!/usr/bin/python -u
import glob, os, string, sys, thread, time
# import difflib
import libxml2
###
#
# This is a "Work in Progress" attempt at a python script to run the
# various regression tests. The rationale for this is that it should be
# possible to run this on most major platforms, including those (such as
# ... | bsd-3-clause |
jirikuncar/invenio-groups | docs/_ext/ultramock.py | 4 | 2629 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 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 |
sunlianqiang/kbengine | kbe/src/lib/python/Lib/test/test_concurrent_futures.py | 84 | 23828 | import test.support
# Skip tests if _multiprocessing wasn't built.
test.support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test.support.import_module('multiprocessing.synchronize')
# import threading after _multiprocessing to raise a more revelant error
# message: "No module n... | lgpl-3.0 |
Jackysonglanlan/devops | IDEs/sublime/shared-pkgs/Packages/python-markdown/st3/markdown/treeprocessors.py | 5 | 14571 | from __future__ import unicode_literals
from __future__ import absolute_import
from . import util
from . import odict
from . import inlinepatterns
def build_treeprocessors(md_instance, **kwargs):
""" Build the default treeprocessors for Markdown. """
treeprocessors = odict.OrderedDict()
treeprocessors["in... | mit |
h4r5h1t/django-hauthy | django/core/cache/backends/locmem.py | 586 | 4287 | "Thread-safe in-memory cache backend."
import time
from contextlib import contextmanager
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils.synch import RWLock
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
# Global in-memor... | bsd-3-clause |
wakatime/sublime-wakatime | packages/wakatime/packages/py27/cryptography/hazmat/primitives/serialization/ssh.py | 13 | 4381 | # 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
import base64
import struct
import six
from cryptography import utils
f... | bsd-3-clause |
acktie/Acktie-Mobile-Passbook-Scanner-Example | plugins/ti.alloy/plugin.py | 1729 | 5251 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
tbadgu/Barcamp-Bangalore-Android-App | gcm_flask/werkzeug/testsuite/internal.py | 76 | 2904 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Internal tests.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from datetime import datetime
from warnings import filterwarnings, resetwarnings
from werkz... | apache-2.0 |
adam900710/btrfs-progs | libbtrfsutil/python/setup.py | 1 | 2883 | #!/usr/bin/env python3
# Copyright (C) 2018 Facebook
#
# This file is part of libbtrfsutil.
#
# libbtrfsutil 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 yo... | gpl-2.0 |
rexshihaoren/scikit-learn | examples/linear_model/plot_ransac.py | 250 | 1673 | """
===========================================
Robust linear model estimation using RANSAC
===========================================
In this example we see how to robustly fit a linear model to faulty data using
the RANSAC algorithm.
"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn import ... | bsd-3-clause |
benh/twesos | third_party/gtest-1.5.0/scripts/fuse_gtest_files.py | 314 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
asmeurer/urllib3 | urllib3/request.py | 83 | 5557 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... | mit |
jiangwei1221/django-virtualenv-demo | env/lib/python2.7/site-packages/django/contrib/auth/admin.py | 29 | 7950 | from django.db import transaction
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.options import IS_POPUP_VAR
from django.contrib.auth.forms import (UserCreationForm, UserChangeForm,
AdminPasswordChangeForm)
from django.contrib.auth.models import User, Group
from django.c... | unlicense |
c0d3x42/P8000-Kernel | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
pozetroninc/micropython | tests/extmod/vfs_fat_ramdisklarge.py | 2 | 1659 | # test making a FAT filesystem on a very large block device
try:
import uos
except ImportError:
print("SKIP")
raise SystemExit
try:
uos.VfsFat
except AttributeError:
print("SKIP")
raise SystemExit
class RAMBDevSparse:
SEC_SIZE = 512
def __init__(self, blocks):
self.blocks =... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.