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 |
|---|---|---|---|---|---|
Thortoise/Super-Snake | Blender/animation_nodes-master/sockets/boolean.py | 1 | 2298 | import bpy
from bpy.props import *
from .. events import propertyChanged
from .. base_types.socket import AnimationNodeSocket
from .. utils.nodes import newNodeAtCursor, invokeTranslation
class BooleanSocket(bpy.types.NodeSocket, AnimationNodeSocket):
bl_idname = "an_BooleanSocket"
bl_label = "Boolean Socket"
... | gpl-3.0 |
ouwenjie03/GAN | utils.py | 1 | 2328 | # encoding: utf-8
"""
@author: donald, ouwj
@position: donald-elementary
@file: utils.py
@time: 2017/4/25 11:16
"""
from PIL import Image
from os.path import join
import numpy as np
def save_samples(dataset, np_imgs, img_path, cur_epoch, n_img):
if dataset == 'MNIST' or dataset == 'CELEBA':
save_samples... | mit |
wolfgar/xbmc | lib/libUPnP/Platinum/Build/Tools/Scripts/GenDocumentation.py | 263 | 2205 | #! /usr/bin/python
#############################################################
# This tool is used to generate the Platinum documentation #
#############################################################
import os
import sys
import subprocess
import shutil
import zipfile
import tarfile
#############################... | gpl-2.0 |
luistorresm/odoo | addons/payment_buckaroo/controllers/main.py | 325 | 1270 | # -*- coding: utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class BuckarooController(http.Controller):
_return_url = '/pa... | agpl-3.0 |
sysalexis/kbengine | kbe/src/lib/python/Tools/pybench/Unicode.py | 92 | 11110 | try:
unicode
except NameError:
raise ImportError
from pybench import Test
class ConcatUnicode(Test):
version = 2.0
operations = 10 * 5
rounds = 60000
def test(self):
# Make sure the strings are *not* interned
s = unicode(u''.join(map(str,range(100))))
t = unicode(u''... | lgpl-3.0 |
p4datasystems/CarnotKEdist | dist/Lib/distutils/command/clean.py | 251 | 2814 | """distutils.command.clean
Implements the Distutils 'clean' command."""
# contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils import log
class clean(Command):
desc... | apache-2.0 |
sestrella/ansible | test/units/modules/network/fortios/test_fortios_system_ipv6_neighbor_cache.py | 21 | 8449 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
kyoren/https-github.com-h2oai-h2o-3 | h2o-py/tests/testdir_jira/pyunit_hexdev_29_header.py | 1 | 1233 | ################################################################################
##
## Verifying that Python can support user-specified handling of the first line
## of the file as either headers (1), to-be-guessed (0), or data (-1).
##
################################################################################
im... | apache-2.0 |
bretlowery/snakr | lib/django/db/backends/mysql/features.py | 176 | 2682 | from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
from .base import Database
try:
import pytz
except ImportError:
pytz = None
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
update_can_self_select = False
... | bsd-3-clause |
yongtang/tensorflow | tensorflow/python/keras/mixed_precision/layer_correctness_test.py | 6 | 12113 | # 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 applica... | apache-2.0 |
michaelgira23/JEREMY | Skype4Py-master/Skype4Py/filetransfer.py | 21 | 3643 | """File transfers.
"""
__docformat__ = 'restructuredtext en'
import os
from utils import *
class FileTransfer(Cached):
"""Represents a file transfer.
"""
_ValidateHandle = int
def __repr__(self):
return Cached.__repr__(self, 'Id')
def _Alter(self, AlterName, Args=None):
return... | bsd-3-clause |
Crystalnix/serverauditor-sshconfig | tests/unit/core/storage/storage_test.py | 2 | 15229 | # -*- coding: utf-8 -*-
import tempfile
from six import integer_types
from mock import patch, Mock
from unittest import TestCase
from termius.core.models.terminal import (
Host, SshConfig, Identity, SshKey, Group
)
from termius.core.exceptions import DoesNotExistException
from termius.core.storage.strategies import... | bsd-3-clause |
arazmj/RouteFlow | pox/pox/topology/topology.py | 31 | 9688 | # Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | apache-2.0 |
jakobworldpeace/scikit-learn | examples/linear_model/plot_sgd_iris.py | 58 | 2202 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print(__doc__)
... | bsd-3-clause |
dlazz/ansible | lib/ansible/plugins/action/dellos10.py | 38 | 4091 | #
# (c) 2016 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 ve... | gpl-3.0 |
mcsosa121/cafa | cafaenv/lib/python2.7/site-packages/django/utils/six.py | 223 | 30628 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | mit |
terzeron/FeedMakerApplications | naver/capture_item_naverpost.py | 1 | 3798 | #!/usr/bin/env python
import sys
import re
import getopt
import json
from feed_maker_util import IO
def main():
url_prefix = "http://m.post.naver.com"
link = ""
title = ""
num_of_recent_feeds = 1000
optlist, args = getopt.getopt(sys.argv[1:], "n:")
for o, a in optlist:
if o == '-n':
... | gpl-2.0 |
cproc/seoul | executor/build_instructions.py | 3 | 27512 | #!/usr/bin/env python2
"""Check different patterns to get the encoding of an instruction and
generate optimized handler functions.
We use an compile+disassemble approach to extract the encoding from
the assembler.
"""
import sys, os, tempfile, re
def compile_and_disassemble(str, file, fdict):
if str not in fdict:... | gpl-2.0 |
doged/electrum-doged-i2p | lib/wallet.py | 6 | 68691 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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... | gpl-3.0 |
brett-patterson/pyface | pyface/tree/trait_list_node_type.py | 2 | 1569 | """ The node type for a trait list. """
# Enthought library imports.
from traits.api import Any, Str
# Local imports.
from node_type import NodeType
class TraitListNodeType(NodeType):
""" The node type for a trait list. """
#### 'TraitListNodeType' interface ########################################
#... | bsd-3-clause |
blighj/django | django/contrib/gis/gdal/__init__.py | 52 | 2169 | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-su... | bsd-3-clause |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/sklearn/preprocessing/imputation.py | 46 | 14294 | # Authors: Nicolas Tresegnie <nicolas.tresegnie@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
import numpy.ma as ma
from scipy import sparse
from scipy import stats
from ..base import BaseEstimator, TransformerMixin
from ..utils import check_array
from ..utils.fixes import astype
from ..utils... | mit |
acompa/leptoid | tests/test_deploy.py | 1 | 2218 | from unittest import TestCase
from mock import Mock
from subprocess import PIPE
import leptoid.deploy as deploy
from leptoid.service_queue import ServiceQueue
class TestDeploy(TestCase):
def test_build_kbs_command(self):
""" Test whether deploy._build_kbs_command() builds the KBS call
correctly.
"""
# Setti... | apache-2.0 |
leifos/treconomics | treconomics_project/survey/urls.py | 1 | 1089 | __author__ = 'mickeypash'
from django.conf.urls import patterns, url
from survey import views
urlpatterns = patterns('',
url(r'^demographicssurvey/(?P<country>[A-Z]{2})/$', views.view_demographics_survey),
(r'^searchefficacysurvey/$', views.view_search_efficacy_survey),
... | mit |
ckuethe/gnuradio | gr-digital/python/digital/qa_cma_equalizer.py | 57 | 1654 | #!/usr/bin/env python
#
# Copyright 2006,2007,2010,2011,2013 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, ... | gpl-3.0 |
unaizalakain/django | django/contrib/postgres/forms/array.py | 258 | 6743 | import copy
from django import forms
from django.contrib.postgres.validators import (
ArrayMaxLengthValidator, ArrayMinLengthValidator,
)
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.safestring import mark_safe
from django.utils.translation import string_concat,... | bsd-3-clause |
OpenTrons/opentrons-api | robot-server/robot_server/service/legacy/models/modules.py | 3 | 9607 | import typing
from pydantic import BaseModel, Field
class TemperatureModuleLiveData(BaseModel):
"""Temperature Module live data"""
currentTemp: float = \
Field(...,
description="The current temperature of the module")
targetTemp: typing.Optional[float] = \
Field(...,
... | apache-2.0 |
yun63/protobuf-2.6.1 | python/google/protobuf/text_format.py | 68 | 26977 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | bsd-3-clause |
fxtlabs/beansoup | beansoup/plugins/deposit_in_transit.py | 1 | 11736 | """Work in progress. It works, but needs documentation and some cleaning.
A plugin that automatically ties split deposit-in-transit transactions.
usage: beansoup.plugins.deposit_in_transit [--dit_component NAME]
[--auto_open] [--same_day_merge]
... | gpl-2.0 |
apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/sbs.py | 10 | 2150 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
js_to_json,
remove_end,
)
class SBSIE(InfoExtractor):
IE_DESC = 'sbs.com.au'
_VALID_URL = r'https?://(?:www\.)?sbs\.com\.au/ondemand/video/(?:single/)?(?P<id>[0-9]+)'
... | unlicense |
LoHChina/nova | nova/tests/unit/virt/xenapi/test_xenapi.py | 11 | 177052 | # Copyright (c) 2010 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 applicab... | apache-2.0 |
xeregin/rpc-openstack | maas/plugins/conntrack_count.py | 11 | 1757 | #!/usr/bin/env python
# Copyright 2015, Rackspace US, 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 applicabl... | apache-2.0 |
vikatory/kbengine | kbe/res/scripts/common/Lib/enum.py | 63 | 20351 | import sys
from collections import OrderedDict
from types import MappingProxyType, DynamicClassAttribute
__all__ = ['Enum', 'IntEnum', 'unique']
def _is_descriptor(obj):
"""Returns True if obj is a descriptor, False otherwise."""
return (
hasattr(obj, '__get__') or
hasattr(obj, '__set... | lgpl-3.0 |
oostende/dvbapp2-gui-egami | lib/python/Plugins/Extensions/TuxboxPlugins/plugin.py | 161 | 1201 | # must be fixed for the new plugin interface
from Tools.BoundFunction import boundFunction
from Tools.Directories import pathExists
from Plugins.Plugin import PluginDescriptor
from pluginrunner import PluginRunner
from os import listdir
TUXBOX_PLUGINS_PATH = "/usr/lib/tuxbox/plugins/"
def getPlugins():
pluginlist =... | gpl-2.0 |
danny88br/cjdns | node_build/dependencies/libuv/build/gyp/test/configurations/inheritance/gyptest-inheritance.py | 430 | 1047 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies build of an executable in three different configurations.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('configur... | gpl-3.0 |
x111ong/odoo | addons/event/__init__.py | 350 | 1039 | # -*- 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 |
dset0x/invenio-checker-old | invenio_checker/checkerext/reporters/workflows_reporter.py | 1 | 2171 | # -*- 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 |
kwailamchan/programming-languages | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/conf/locale/nl/formats.py | 329 | 3056 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '20 januari 2009'
TIME_FORMAT = 'H:i' ... | mit |
kuri65536/python-for-android | python-modules/twisted/twisted/web/test/test_vhost.py | 53 | 4012 | # Copyright (c) 2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.vhost}.
"""
from twisted.internet.defer import gatherResults
from twisted.trial.unittest import TestCase
from twisted.web.http import NOT_FOUND
from twisted.web.static import Data
from twisted.web.vhost import Nam... | apache-2.0 |
ygpark/iamroot-linux-arm10c | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
kalahbrown/HueBigSQL | desktop/core/src/desktop/lib/view_util.py | 38 | 2507 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
lielongxingkong/windchimes | swift/storage/expirer.py | 3 | 9806 | # Copyright (c) 2010-2012 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 agree... | apache-2.0 |
astronaut1712/taiga-back | taiga/export_import/tasks.py | 10 | 3387 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | agpl-3.0 |
he7d3r/revscoring | revscoring/__init__.py | 2 | 6186 | """
This library contains a set of facilities for constructing and applying
:class:`~revscoring.Model` s to MediaWiki revisions. This library
eases the training and testing of Machine Learning-based scoring
strategies.
* See the :ref:`API reference <api-reference>` for detailed information.
Key Features
------------
... | mit |
decabyte/vehicle_core | src/node_thruster_sim.py | 1 | 6640 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Ocean Systems Laboratory, Heriot-Watt University, UK.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follow... | bsd-3-clause |
sofiagarcia/astor-responsive | node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
urbaniak/rcssmin | _setup/py3/term/_term.py | 2 | 3656 | # -*- coding: ascii -*-
#
# Copyright 2007, 2008, 2009, 2010, 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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.or... | apache-2.0 |
qutebrowser/qutebrowser | qutebrowser/mainwindow/statusbar/textbase.py | 2 | 3025 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
zebus3d/Smoothable | __init__.py | 1 | 12163 | '''
Copyright (c) 2012 Jorge Hernandez - Melendez
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... | gpl-3.0 |
Sazzadmasud/Keystone_hash_token | keystone/common/sql/migrate_repo/versions/015_tenant_to_project.py | 4 | 7576 | # Copyright 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 ... | apache-2.0 |
dsolimando/Hot | hot-jython-modules/src/main/resources/test/test_isatty.py | 24 | 3093 | import test.test_support, unittest
import os, popen2, subprocess, sys
def test_isatty(label, thingy):
os_isatty = os.isatty(thingy.fileno())
thingy_isatty = thingy.isatty()
if 'in' in label: expected = stdin_isatty
elif 'out' in label: expected = stdout_isatty
elif 'err' in label: expected = stderr... | gpl-3.0 |
JulianEberius/SublimePythonIDE | server/lib/python3/rope/base/utils.py | 6 | 3748 | import warnings
from functools import partial
def saveit(func):
"""A decorator that caches the return value of a function"""
name = '_' + func.__name__
def _wrapper(self, *args, **kwds):
if not hasattr(self, name):
setattr(self, name, func(self, *args, **kwds))
return getattr(s... | gpl-2.0 |
feiwang3311/baseline | baselines/acktr/acktr_disc.py | 3 | 9513 | import os.path as osp
import time
import joblib
import numpy as np
import tensorflow as tf
from baselines import logger
from baselines.common import set_global_seeds, explained_variance
from baselines.acktr.utils import discount_with_dones
from baselines.acktr.utils import Scheduler, find_trainable_variables
from bas... | mit |
Cuuuurzel/KiPyCalc | sympy_old/utilities/memoization.py | 14 | 1354 | def recurrence_memo(initial):
"""
Memo decorator for sequences defined by recurrence
See usage examples e.g. in the specfun/combinatorial module
"""
cache = initial
def decorator(f):
def g(n):
L = len(cache)
if n <= L - 1:
return cache[n]
... | mit |
wilberforce/Espruino | scripts/pinutils.py | 3 | 8419 | #!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# 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 ... | mpl-2.0 |
akretion/odoo | addons/sale/models/sale.py | 1 | 91782 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from functools import partial
from itertools import groupby
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools.misc im... | agpl-3.0 |
Dandandan/wikiprogramming | jsrepl/build/extern/python/unclosured/lib/python2.7/lib2to3/pgen2/parse.py | 569 | 8053 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser engine for the grammar tables generated by pgen.
The grammar table must be loaded first.
See Parser/parser.c in the Python distribution for additional info on
how this parsing engine works.
... | mit |
pkimber/base | base/management/commands/revision_count.py | 1 | 1595 | # -*- encoding: utf-8 -*-
from django.core.management.base import BaseCommand
from django.apps import apps
# from reversion import revisions as reversion
from reversion.models import Version
from reversion.errors import RegistrationError
class Command(BaseCommand):
help = "Count reversion records for each mode... | apache-2.0 |
RogueProeliator/IndigoPlugin-TiVo-Network-Remote | TiVo Network Remote.indigoPlugin/Contents/Server Plugin/RPFramework/RPFrameworkUtils.py | 3 | 2567 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#/////////////////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////////////////
# RPFrameworkUtils by RogueProeliator <adam.d.ashe@gmail.com>
# Non-class utility function... | mit |
krintoxi/NoobSec-Toolkit | NoobSecToolkit /tools/inject/tamper/chardoubleencode.py | 10 | 1197 | #!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import string
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.LOW
def dependencies():
pass
def tamper(payload, **kwargs):
"""
Double url-encodes al... | gpl-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.7/Lib/poplib.py | 223 | 12388 | """A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
"""
# Author: David Ascher <david_ascher@brown.edu>
# [heavily stealing from nntplib.py]
# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3_SSL clas... | mit |
dmacvicar/spacewalk | client/tools/osad/src/osad_config.py | 2 | 4092 | #
# Copyright (c) 2008 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 copy of... | gpl-2.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/sklearn/manifold/spectral_embedding_.py | 3 | 21511 | """Spectral Embedding"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from scipy.linalg import eigh
from scipy.sparse.linalg import eigsh, lobpcg
from scipy.sparse.csgraph import conn... | mit |
mbauskar/erpnext | erpnext/utilities/user_progress_utils.py | 6 | 6297 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe, erpnext
import json
from frappe import _
from frappe.utils import flt
from erpnext.setup.doctype.setup_progress.setup_progress import update_domain_actions, get_domain_actions_... | gpl-3.0 |
agustinhenze/doit.debian | doit/doit_cmd.py | 2 | 5829 | """doit CLI (command line interface)"""
import os
import sys
import traceback
from collections import defaultdict
from configparser import ConfigParser
from .version import VERSION
from .plugin import PluginDict
from .exceptions import InvalidDodoFile, InvalidCommand, InvalidTask
from .cmdparse import CmdParseError
f... | mit |
prakritish/ansible | lib/ansible/plugins/lookup/dnstxt.py | 48 | 2101 | # (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 |
jnerin/ansible | lib/ansible/utils/module_docs_fragments/cnos.py | 25 | 3903 | # Copyright (C) 2017 Lenovo, 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.
#
# Ansi... | gpl-3.0 |
karthik-sethuraman/ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_photonic_media_owned_node_edge_point_augmentation2.py | 4 | 2864 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_photonic_media_media_channel_node_edge_point_spec import TapiPhotonicMediaMediaChannelNode... | apache-2.0 |
packetloop/dd-agent | checks/libs/vmware/basic_metrics.py | 28 | 3038 | BASIC_METRICS = {
'cpu.extra': {
's_type' : 'delta',
'unit' : 'millisecond',
'rollup' : 'summation',
'entity' : ['VirtualMachine']
},
'cpu.ready': {
's_type' : 'delta',
'unit' : 'millisecond',
'rollup' : 's... | bsd-3-clause |
gilt/GWC-Summer-2014 | scraper/saks.py | 1 | 4850 | #saks
from bs4 import BeautifulSoup
import urllib2
import sys
from urlparse import urljoin
#import lxml
sys.path.append("/Users/fcolombo/Documents/gilt");
import defaultparser
import crawler
#import html5lib
class SaksCrawler:
def getProductParser(self):
def findBrand(soup):
brandTag = soup.find('h1', class_... | apache-2.0 |
Endika/stock-logistics-transport | stock_shipment_management/model/shipment_plan.py | 4 | 11774 | # -*- coding: utf-8 -*-
#
#
# Authors: Joël Grand-Guillaume, Yannick Vaucher
# Copyright 2013-2015 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
# published by the Free Software Foundation, either ve... | agpl-3.0 |
ity/pants | contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_pyflakes.py | 16 | 1092 | # coding=utf-8
# Copyright 2016 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)
from pants_test.cont... | apache-2.0 |
kingtaurus/cs224d | assignment3/codebase_release/rnn_pytorch.py | 1 | 6742 | import sys
import os
import random
import numpy as np
import matplotlib.pyplot as plt
import math
import time
import itertools
import shutil
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn.utils import clip_grad_norm
import tree as tr
from utils i... | mit |
yannickcr/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/pbs.py | 6 | 2604 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
US_RATINGS,
)
class PBSIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://
(?:
# Direct video URL
video\.pbs\.org/(?:viralplayer|video)/(?P<id>[0-9]+)/? |
# Art... | gpl-3.0 |
mbauskar/omnitech-frappe | frappe/modules/patch_handler.py | 47 | 3015 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Execute Patch Files
To run directly
python lib/wnf.py patch patch1, patch2 etc
python lib/wnf.py patch -f patch1, patch2 etc
where patch1, patch2 is module name
"""
im... | mit |
KevinFasusi/supplychainpy | tests/test_bi.py | 1 | 3293 | from unittest import TestCase
from decimal import Decimal
import logging
import unittest
from supplychainpy import model_inventory
from supplychainpy._helpers._pickle_config import deserialise_config
from supplychainpy.bi._recommendation_state_machine import SkuMachine
from supplychainpy.bi._recommendations import ... | bsd-3-clause |
edx-solutions/edx-platform | cms/urls.py | 3 | 15069 | """
Urls of Studio.
"""
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib.admin import autodiscover as django_autodiscover
from django.utils.translation import ugettext_lazy as _
from edx_api_doc_tools import make_docs_urls
from ra... | agpl-3.0 |
WarrenWeckesser/scipy | scipy/linalg/flinalg.py | 21 | 1662 | #
# Author: Pearu Peterson, March 2002
#
__all__ = ['get_flinalg_funcs']
# The following ensures that possibly missing flavor (C or Fortran) is
# replaced with the available one. If none is available, exception
# is raised at the first attempt to use the resources.
try:
from . import _flinalg
except ImportError:
... | bsd-3-clause |
petrveprek/dudel | dudel.py | 1 | 18150 | #!python3
# Copyright (c) 2016 Petr Veprek
"""Duplicate Delete"""
import argparse, collections, colorama, datetime, enum, filecmp, os, string, sys, time, winshell
TITLE = "Duplicate Delete"
VERSION = "0.6"
VERBOSE = False
class Mode(enum.Enum): plain = 0; grouped = 1; gazillion = 2
MIN_WIDTH = 9+0+3 # intro + directo... | mit |
jctanner/ansible | test/units/cli/test_cli.py | 35 | 18570 | # (c) 2017, Adrian Likins <alikins@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 vers... | gpl-3.0 |
bowang/tensorflow | tensorflow/python/ops/spectral_ops_test_util.py | 90 | 1830 | # 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 |
thgcode/soundrts | soundrts/lib/nofloat.py | 1 | 7897 | """"use integers to make sure that any computer will give the same results"""
import math
import sys
from .log import warning
PRECISION = 1000
# tables used to make sure that every computer gives the same results
_COS_TABLE = (1000, 999, 999, 998, 997, 996, 994, 992, 990, 987, 984, 981, 978, 974, 970, 965, 961, 95... | bsd-3-clause |
ticklemepierce/osf.io | website/search/views.py | 17 | 10128 | # -*- coding: utf-8 -*-
import json
import time
import logging
import functools
import httplib as http
from urllib2 import unquote
import bleach
from flask import request
from modularodm import Q
from framework.auth.decorators import collect_auth
from framework.auth.decorators import must_be_logged_in
from website ... | apache-2.0 |
Vassy/odoo | addons/website_sale/models/sale_order.py | 9 | 9824 | # -*- coding: utf-8 -*-
import random
from openerp import SUPERUSER_ID
from openerp.osv import osv, orm, fields
from openerp.addons.web.http import request
class payment_transaction(orm.Model):
_inherit = 'payment.transaction'
_columns = {
# link with the sale order
'sale_order_id': fields.ma... | agpl-3.0 |
streamlink/streamlink | tests/plugins/test_rtpplay.py | 3 | 2883 | import unittest
import requests_mock
from streamlink import Streamlink
from streamlink.plugins.rtpplay import RTPPlay
from streamlink.stream import HLSStream
from tests.plugins import PluginCanHandleUrl
from tests.resources import text
class TestPluginCanHandleUrlRTPPlay(PluginCanHandleUrl):
__plugin__ = RTPPla... | bsd-2-clause |
wholebiome/aegea | aegea/packages/github3/structs.py | 3 | 5230 | # -*- coding: utf-8 -*-
from collections import Iterator
from .models import GitHubCore
from requests.compat import urlparse, urlencode
class GitHubIterator(GitHubCore, Iterator):
"""The :class:`GitHubIterator` class powers all of the iter_* methods."""
def __init__(self, count, url, cls, session, params=None... | apache-2.0 |
fevangelista/psi4 | psi4/driver/qcdb/textables.py | 7 | 18654 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
pjdufour/phoenix_pipeline | geolocation.py | 1 | 12714 | from __future__ import unicode_literals
from __future__ import print_function
import logging
import requests
import utilities
from bson.objectid import ObjectId
def query_cliff(sentence, host, port):
"""
Takes a sentence from a news article, passes it to the CLIFF geoloc... | mit |
hilljb/docker-jupyter | base-jupyter/resources/jupyter_notebook_config.py | 25 | 1205 | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from jupyter_core.paths import jupyter_data_dir
import subprocess
import os
import errno
import stat
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.port = 8888
c.NotebookApp.open_browser = False
# Generate a s... | bsd-3-clause |
jaaguilar/trading-with-python | cookbook/ib_logQuotes.py | 77 | 4901 | '''
Created on May 5, 2013
Copyright: Jev Kuznetsov
License: BSD
Program to log tick events to a file
example usage:
> python ib_logQuotes.py SPY,VXX,XLE
start with -v option to show all incoming events
'''
import argparse # command line argument parser
import datetime as dt # dat... | bsd-3-clause |
kobe25/gasistafelice | gasistafelice/rest/views/blocks/order_report.py | 3 | 10422 | from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from django.core import urlresolvers
from rest.views.blocks.base import ( BlockSSDataTables, ResourceBlockAction,
CREATE_PDF, CREATE_HTML, SENDME_PDF, SENDPROD_PDF,
VIEW_AS_HTML
)
from consts import CREATE, EDIT, EDIT_MULTIPLE, VIEW
... | agpl-3.0 |
nazo/ansible | lib/ansible/modules/cloud/atomic/atomic_host.py | 19 | 3095 | #!/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 |
ermaxw/sv | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
dims/nova | nova/virt/imagecache.py | 71 | 5586 | # Copyright 2013 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 |
petquimica/sitepet | gallery/migrations/0009_gallery.py | 2 | 1282 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-08-04 20:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('gallery', '0008_delete_gallery'),
]
operations = [
migr... | mpl-2.0 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/platform/gsutil/third_party/boto/tests/integration/swf/test_cert_verification.py | 126 | 1553 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# 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 withou... | apache-2.0 |
sunshinelover/chanlun | vn.lts/vnltstd/test/lts_data_type.py | 74 | 90892 | # encoding: UTF-8
defineDict = {}
typedefDict = {}
#//////////////////////////////////////////////////////////////////////
#@company shanghai liber information Technology Co.,Ltd
#@file SecurityFtdcUserApiDataType.h
#@brief 定义业务数据类型
#//////////////////////////////////////////////////////////////////////
#/////////... | mit |
bgris/ODL_bgris | lib/python3.5/site-packages/numpy/lib/tests/test_polynomial.py | 37 | 6488 | from __future__ import division, absolute_import, print_function
'''
>>> p = np.poly1d([1.,2,3])
>>> p
poly1d([ 1., 2., 3.])
>>> print(p)
2
1 x + 2 x + 3
>>> q = np.poly1d([3.,2,1])
>>> q
poly1d([ 3., 2., 1.])
>>> print(q)
2
3 x + 2 x + 1
>>> print(np.poly1d([1.89999+2j, -3j, -5.12345678, 2+1j]))
... | gpl-3.0 |
fubecka/f5-dashboard | flask/lib/python2.6/site-packages/pip/_vendor/html5lib/treebuilders/_base.py | 915 | 13711 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent for... | apache-2.0 |
imankulov/sentry | src/sentry/migrations/0112_auto__chg_field_option_value__chg_field_useroption_value__chg_field_pr.py | 36 | 23895 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
'sentry.accessgroup': {
'Meta':... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.