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 |
|---|---|---|---|---|---|
bfgeek/thermo-js | web-animations-js/test/update-testcases.py | 170 | 1754 | #!/usr/bin/python
import cStringIO as StringIO
from fnmatch import fnmatch
import difflib
import os
import sys
def get_name(filename):
return os.path.splitext(filename)[0]
def list_dir(dir_path, filter_func):
return sorted(filter(filter_func, os.listdir(dir_path)), key=get_name)
def main():
test_dir ... | apache-2.0 |
qvazzler/Flexget | flexget/plugins/cli/cli_config.py | 1 | 2081 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
import argparse
import functools
import logging
from flexget import options
from flexget.event import event
log = logging.getLogger('cli_c... | mit |
gregcarrart/shared-schedule | node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py | 604 | 1533 | #!/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.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | mit |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/conf/locale/de_CH/formats.py | 115 | 1445 | # -*- 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
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATE... | mit |
hpleva/pyemto | pyemto/free_energy/free_energy.py | 1 | 6674 | import numpy as np
from scipy.integrate import quad
# Define some universal constants
ry2ev = 13.605698066
#kb = 8.6173324E-5 #eV/K
kb = 8.6173324E-5/ry2ev #Ry/K
def interpolate_y(x,y,x0):
"""Linear interpolation to find arbitrary y0 for a given x0 in x vs. y data."""
#
# First we must between which ... | mit |
dai-dao/Grounded-Language-Learning-in-Pytorch | python/rl_agent/actor_critic.py | 1 | 7266 | import torch
import random
import numpy as np
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from collections import namedtuple
from utils import *
from model import Model
def _action(*entries):
return np.array(entries, dtype=np.intc)
class RL_Agent(object):
d... | gpl-2.0 |
dnacreative/jam-py | jam/lang/russian.py | 1 | 12187 | # -*- coding: utf-8 -*-
dictionary = \
{
'lang': u'ru',
#admin fields
'admin': u'Администратор',
'catalogs': u'Справочники',
'journals': u'Журналы',
'tables': u'Таблицы',... | bsd-3-clause |
TribeMedia/sky_engine | build/android/gyp/find_sun_tools_jar.py | 51 | 1610 | #!/usr/bin/env python
#
# Copyright 2014 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.
"""This finds the java distribution's tools.jar and copies it somewhere.
"""
import argparse
import os
import re
import shutil
impor... | bsd-3-clause |
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/rnn/test_rnn_nets_static.py | 2 | 17262 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
jal278/mazerobot-python | evolvability.py | 1 | 1046 | import mazepy
#a function to map a robot's behavior into a grid of niches
def map_into_grid(robot,grid_sz):
x=mazepy.feature_detector.endx(robot)
y=mazepy.feature_detector.endy(robot)
x_grid=int(x*(grid_sz-1))
y_grid=int(y*(grid_sz-1))
return (x_grid,y_grid)
#function to calculate evolvability via PLoS paper met... | mit |
gerryhd/diabot-assistant | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py | 2715 | 30098 | """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... | gpl-3.0 |
sherlocke/pywatson | pywatson/answer/synonym.py | 1 | 1338 | from pywatson.util.map_initializable import MapInitializable
class SynSetSynonym(MapInitializable):
def __init__(self, is_chosen, value, weight):
self.is_chosen = is_chosen
self.value = value
self.weight = weight
@classmethod
def from_mapping(cls, syn_mapping):
return cls(... | mit |
vsilent/smarty-bot | core/brain/check/my/sites/every/hour/reaction.py | 1 | 1818 | '''
Author:
Description:
'''
from core.broadcast import say, bang
from core.people.person import Profile, Session
from crontab import CronTab
from getpass import getuser
from core.config.settings import ROBOT_DIR
class Reaction:
"""class Reaction"""
response = ''
request = ''
def __str__(self):
... | mit |
pokemon4ik2008/py-airfoil | scons-local-2.2.0/SCons/Tool/fortran.py | 14 | 2084 | """SCons.Tool.fortran
Tool-specific initialization for a generic Posix f77/f90 Fortran compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 20... | gpl-3.0 |
BondAnthony/ansible | test/integration/targets/prepare_http_tests/library/httptester_kinit.py | 2 | 4368 | #!/usr/bin/python
# Copyright: (c) 2020, 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
DOCUMENTATION = r'''
---
module: httptester_kinit
short_description: Get Kerbero... | gpl-3.0 |
betamos/apitools | apitools/gen/client_generation_test.py | 7 | 2801 | #
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
waprin/google-cloud-python | gcloud/monitoring/metric.py | 3 | 11839 | # Copyright 2016 Google 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 by applicable law or agree... | apache-2.0 |
eentzel/myeventbot | gdata/tlslite/utils/OpenSSL_RSAKey.py | 359 | 5014 | """OpenSSL/M2Crypto RSA implementation."""
from cryptomath import *
from RSAKey import *
from Python_RSAKey import Python_RSAKey
#copied from M2Crypto.util.py, so when we load the local copy of m2
#we can still use it
def password_callback(v, prompt1='Enter private key passphrase:',
prompt... | mit |
UXE/local-edx | common/djangoapps/student/tests/test_login_registration_forms.py | 10 | 9233 | """Tests for the login and registration form rendering. """
import urllib
import unittest
from collections import OrderedDict
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
import ddt
from django.test.utils import override_settings
from xmodule.modulestore.tests.fac... | agpl-3.0 |
MetSystem/Xiaomi_Kernel_OpenSource | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
SurfasJones/icecream-info | icecream/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/escsm.py | 2930 | 7839 | ######################## 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 |
zhhwin/MiCore_kernel_aries | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
crosswalk-project/chromium-crosswalk-efl | tools/telemetry/telemetry/core/forwarders/android_forwarder.py | 25 | 18685 | # Copyright 2014 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.
import logging
import os
import re
import socket
import struct
import subprocess
from telemetry.core import forwarders
from telemetry.core import platform
f... | bsd-3-clause |
flavour/Turkey | modules/tests/volunteer/create_volunteer.py | 25 | 3808 | """ Sahana Eden Automated Test - HRM002 Create Volunteer
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 wit... | mit |
abdoosh00/edx-platform | common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py | 53 | 10819 | # -*- 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):
# Adding field 'UserProfile.country'
db.add_column('auth_userprofile', 'country',
self... | agpl-3.0 |
blowekamp/ITK | Modules/Filtering/AntiAlias/test/AntiAliasBinaryImageFilterTest.py | 19 | 2392 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
repotvsupertuga/repo | instal/service.autosubs/default.py | 10 | 5361 | #!/usr/bin/python
import os
import sys
import xbmc
import xbmcaddon
__addon__ = xbmcaddon.Addon()
__author__ = __addon__.getAddonInfo('author')
__scriptid__ = __addon__.getAddonInfo('id')
__scriptname__ = __addon__.getAddonInfo('name')
__cwd__ = __addon__.getAddonInfo('path')
__version__ = __addon__.getAddonInfo('ver... | gpl-2.0 |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/Facebook/Actions/News/Publishes/CreatePublication.py | 5 | 7520 | # -*- coding: utf-8 -*-
###############################################################################
#
# CreatePublication
# Creates an action that represents a user publishing a news article.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "... | gpl-2.0 |
cogeorg/black_rhino | examples/firesales_SA/networkx/algorithms/link_analysis/tests/test_hits.py | 79 | 2544 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
from nose.plugins.attrib import attr
import networkx
# Example from
# A. Langville and C. Meyer, "A survey of eigenvector methods of web
# information retrieval." http://citeseer.ist.psu.edu/713792.html
class TestHITS:
def setUp(self):
... | gpl-3.0 |
apache/bloodhound | trac/trac/util/presentation.py | 5 | 9992 | # -*- coding: utf-8 -*-
#
# Copyright (C)2006-2009 Edgewall Software
# Copyright (C) 2006 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.e... | apache-2.0 |
littlstar/chromium.src | media/tools/constrained_network_server/cns.py | 168 | 17314 | #!/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.
"""Constrained Network Server. Serves files with supplied network constraints.
The CNS exposes a web based API allowing network co... | bsd-3-clause |
alexandreleroux/mayavi | tvtk/tools/ivtk.py | 3 | 17743 | """ivtk - Interactive TVTK.
A utility module that makes VTK/TVTK easier to use from the Python
interpreter. For a standalone application simply run this file. To
use this under IPython (with -wthread) use the `viewer()` helper
function or use the `IVTK` class. The widget can also make use of the
tvtk pipeline brows... | bsd-3-clause |
cjcjameson/gpdb | src/test/tinc/ext/simplejson/decoder.py | 62 | 8840 | """
Implementation of JSONDecoder
"""
import re
from simplejson.scanner import Scanner, pattern
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
import struct
import sys
_BYTES = '7FF80000000000007FF0000000000000'.decode('hex')
if sys.byteorder != 'big':
_BYTES = _BYTES[:8... | apache-2.0 |
mpasternak/pyglet-fix-issue-552 | pyglet/libs/x11/xf86vmode.py | 46 | 13588 | '''Wrapper for Xxf86vm
Generated with:
tools/genwrappers.py xf86vmode
Do not modify this file.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xxf86vm')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64'):... | bsd-3-clause |
timeyyy/PyUpdater | pyupdater/vendor/PyInstaller/lib/altgraph/Graph.py | 12 | 20500 | """
altgraph.Graph - Base Graph class
=================================
..
#--Version 2.1
#--Bob Ippolito October, 2004
#--Version 2.0
#--Istvan Albert June, 2004
#--Version 1.0
#--Nathan Denny, May 27, 1999
"""
from altgraph import GraphError
from collections import deque
class Graph(object):
"""... | bsd-2-clause |
mzdaniel/oh-mainline | vendor/packages/django-extensions/django_extensions/management/commands/mail_debug.py | 44 | 1184 | from django.core.management.base import BaseCommand
import sys
import smtpd
import asyncore
class Command(BaseCommand):
help = "Starts a test mail server for development."
args = '[optional port number or ippaddr:port]'
requires_model_validation = False
def handle(self, addrport='', *args, **options... | agpl-3.0 |
ringo-framework/formbar | contrib/generate.py | 2 | 6516 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from formbar.config import Config, Field, parse
import sys
import argparse
log = logging.getLogger(name="formbar.contrib.generate")
def _get_config(config):
return Config(parse(config.read()))
def _get_fields(config):
fields = []
for en in co... | gpl-2.0 |
hdzierz/Kaka | experimentsearch/tables.py | 1 | 1214 | import django_tables2 as tables
from mongcore.models import *
from mongenotype.models import *
class ExperimentTable(tables.Table):
download_link = tables.TemplateColumn('<a class="dl_links" href="{{record.download_link}}">Download</a>')
data_source = tables.TemplateColumn('<a class="dslinks" href="{{record.da... | gpl-2.0 |
ageron/tensorflow | tensorflow/api_template.__init__.py | 4 | 4782 | # Copyright 2015 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 |
Unsettled/eve-wspace | evewspace/Alerts/method_base.py | 10 | 3164 | # Eve W-Space
# Copyright 2014 Andrew Austin and contributors
#
# 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 requi... | apache-2.0 |
axelniklasson/vasttrafik-api-wrapper | pytrafik/client.py | 1 | 4122 | import requests
import base64
import json
import time as time_module
TOKEN_URL = 'https://api.vasttrafik.se/token'
API_BASE_URL = 'https://api.vasttrafik.se/bin/rest.exe/v2'
CONSUMER_KEY = '<YOUR_CONSUMER_KEY>'
CONSUMER_SECRET = '<YOUR_CONSUMER_SECRET>'
def fetchToken(key, secret):
headers = {
'Content-Type': 'app... | mit |
mkalioby/AutoDeploy | webapp/autoDeploy/autodeploy/migrations/0002_auto_20150508_1941.py | 1 | 1227 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('autodeploy', '0001_initial'),
]
operations = [
migrations.AddField(
... | gpl-2.0 |
djeof-1/warzone2100 | tools/trac/plugins/ticketvalidemail/setup.py | 8 | 1077 | #!/usr/bin/env python
# vim: set et sts=4 sw=4 encoding=utf8:
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name = 'TicketValidEmail',
version = '0.2',
packages = [
'ticketvalidemail',
],
install_requires = ['trac>=0.11'],
extras_require = {
'TracSpamFilter': ['... | gpl-2.0 |
4455jkjh/repo | subcmds/abandon.py | 82 | 2090 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... | apache-2.0 |
nitzmahone/ansible | lib/ansible/modules/cloud/azure/azure_rm_publicipaddress_facts.py | 17 | 5576 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
mfrancka/around_world_notification | source/arround.py | 1 | 3222 | #!/usr/bin/env python3
import requests
from lxml import html
import json
from envelopes import Envelope, SMTP
import configparser
from datetime import datetime
import email.utils
class linksstorage:
def __init__(self, path):
self.path = path
self.read_links()
def add_links(self, new_links):
... | mit |
nilp0inter/data-is-fun | dataisfun/util/config.py | 1 | 2213 | #!/usr/bin/env python
#
# Copyright (C) 2011 Roberto A. Martinez Perez
#
# This file is part of data-is-fun.
#
# data-is-fun 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 t... | gpl-3.0 |
gangadhar-kadam/smrterpfrappe | frappe/website/utils.py | 4 | 2598 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, re
def scrub_relative_urls(html):
"""prepend a slash before a relative url"""
html = re.sub("""(src|href)[^\w'"]*['"](?!http|ftp|/|#|%|{)([^'" >]+)['"]""", '\... | mit |
itgb/linux-3.3.8 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
vvv1559/intellij-community | python/lib/Lib/site-packages/django/db/backends/sqlite3/creation.py | 230 | 3239 | import os
import sys
from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them as is so that
# schema inspection is mor... | apache-2.0 |
clovertrail/cloudinit-bis | tests/unittests/helpers.py | 1 | 9865 | from __future__ import print_function
import functools
import os
import shutil
import sys
import tempfile
import unittest
import mock
import six
import unittest2
try:
from contextlib import ExitStack
except ImportError:
from contextlib2 import ExitStack
from cloudinit import helpers as ch
from cloudinit imp... | gpl-3.0 |
zzcclp/spark | python/pyspark/mllib/tests/test_linalg.py | 15 | 27588 | #
# 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 |
joshmgross/slack-quote-bot | bot/event_handler.py | 1 | 5790 | import json
import logging
import re
import random
logger = logging.getLogger(__name__)
brothers = ['andrew', 'anna', 'austin','ayman','becca', 'dan','danielle','dabielle',\
'ethan', 'frank', 'fred', 'james', 'jasmit','josh','jordan','kaitlyn', 'karina', 'kate', 'niel', \
'marcus', 'nathan', 'noah', 'rachel', 'rohan... | mit |
qilicun/python | python2/PyMOTW-1.132/PyMOTW/shutil/shutil_copyfileobj.py | 1 | 1867 | #!/usr/bin/env python
#
# Copyright 2007 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and tha... | gpl-3.0 |
des-saravanan/resume | node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py | 1363 | 58344 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import gyp.xcode_ninja
import errno
import os
import sys
import posixpath
import re
import shutil
import... | mit |
nhenezi/kuma | vendor/packages/pyparsing/examples/dictExample.py | 16 | 1602 | #
# dictExample.py
#
# Illustration of using pyparsing's Dict class to process tabular data
#
# Copyright (c) 2003, Paul McGuire
#
from pyparsing import Literal, Word, Group, Dict, ZeroOrMore, alphas, nums, delimitedList
import pprint
testData = """
+-------+------+------+------+------+------+------+------... | mpl-2.0 |
Vector2000/bitcoin | qa/rpc-tests/getblocktemplate_longpoll.py | 133 | 3618 | #!/usr/bin/env python2
# Copyright (c) 2014 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 test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
def check_a... | mit |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py2/solnlib/packages/yamlpy3/serializer.py | 293 | 4165 |
__all__ = ['Serializer', 'SerializerError']
from .error import YAMLError
from .events import *
from .nodes import *
class SerializerError(YAMLError):
pass
class Serializer:
ANCHOR_TEMPLATE = 'id%03d'
def __init__(self, encoding=None,
explicit_start=None, explicit_end=None, version=None, ta... | isc |
ucloud/uai-sdk | examples/tensorflow/inference/text-classification-ch/code/rnn_model.py | 2 | 3480 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import tensorflow as tf
class TRNNConfig(object):
"""RNN配置参数"""
# 模型参数
embedding_dim = 64 # 词向量维度
seq_length = 600 # 序列长度
num_classes = 10 # 类别数
vocab_size = 5000 # 词汇表达小
num_layers= 2 # 隐藏层层数
hidden_dim = 1... | apache-2.0 |
Zerknechterer/pyload | module/plugins/hoster/UpstoreNet.py | 1 | 2481 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class UpstoreNet(SimpleHoster):
__name__ = "UpstoreNet"
__type__ = "hoster"
__version__ = "0.06"
__pattern__ = r'https?://(?:... | gpl-3.0 |
jimr/noterator | setup.py | 1 | 1485 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
# Skipping the first line reduces the heading level by 1
history = ''.join(history_file.readlines()[1:])
with open('req... | mit |
pymedusa/SickRage | ext/stevedore/tests/test_driver.py | 15 | 3234 | # 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
# distributed u... | gpl-3.0 |
LinuxChristian/home-assistant | homeassistant/components/climate/generic_thermostat.py | 4 | 10175 | """
Adds support for generic thermostat units.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.generic_thermostat/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components i... | apache-2.0 |
punker76/SmartAlarmClock | SmartAlarmClock/www/temboo/Library/Google/Gmail/GetUnreadMailWithLabel.py | 2 | 3789 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetUnreadMailWithLabel
# Allows you to access a read-only Gmail feed that contains a list of unread emails with the specified label.
#
# Python version 2.6
#
#####################################################... | mit |
JohnDenker/brython | www/src/Lib/unittest/util.py | 794 | 4157 | """Various utility functions."""
from collections import namedtuple, OrderedDict
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
... | bsd-3-clause |
daineseh/python_code | parser/sample/sample_parser.py | 1 | 3352 | import logging
from lex_tokens import LexToken
import ply.yacc as yacc
class Parser(object):
class ParserSyntaxError(Exception): pass
def __init__(self, debug=False):
if debug:
self._log = logging.getLogger('Parser')
else:
self._log = yacc.NullLogger()
self._... | mit |
gcielniak/yaml-cpp | test/gmock-1.7.0/gtest/scripts/pump.py | 2471 | 23673 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
ccccjason/my_osvr | vendor/vrpn/submodules/jsoncpp/devtools/tarball.py | 253 | 2071 | import os.path
import gzip
import tarfile
TARGZ_DEFAULT_COMPRESSION_LEVEL = 9
def make_tarball(tarball_path, sources, base_dir, prefix_dir=''):
"""Parameters:
tarball_path: output path of the .tar.gz file
sources: list of sources to include in the tarball, relative to the current directory
base_dir: i... | apache-2.0 |
ApuliaSoftware/odoo | addons/l10n_at/__openerp__.py | 430 | 1785 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
angryrancor/kivy | kivy/tests/test_uix_widget.py | 59 | 4118 | from kivy.tests.common import GraphicUnitTest
class UIXWidgetTestCase(GraphicUnitTest):
def test_default_widgets(self):
from kivy.uix.button import Button
from kivy.uix.slider import Slider
r = self.render
r(Button())
r(Slider())
def test_button_properties(self):
... | mit |
andrewyoung1991/abjad | abjad/tools/quantizationtools/test/test_quantizationtools_BeatwiseQSchemaItem___new__.py | 2 | 1357 | # -*- encoding: utf-8 -*-
import pytest
from abjad import *
def test_quantizationtools_BeatwiseQSchemaItem___new___01():
item = quantizationtools.BeatwiseQSchemaItem()
assert item.beatspan is None
assert item.search_tree is None
assert item.tempo is None
def test_quantizationtools_BeatwiseQSchemaI... | gpl-3.0 |
sopac/pacgeo | geonode/base/migrations/0012_data_migrate_region.py | 4 | 20264 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""Move the keywords_region field based on the COUNTRIES CHOICES to the new
regions field."""
for rb in orm.Re... | gpl-3.0 |
justin-ho/passwd-mng | pycrypto-2.6.1/pycrypto-2.6.1/lib/Crypto/Util/winrandom.py | 139 | 1196 | #
# Util/winrandom.py : Stub for Crypto.Random.OSRNG.winrandom
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is... | gpl-3.0 |
AndKe/MAVProxy | MAVProxy/modules/lib/multiproc_util.py | 4 | 8655 | '''Multiprocessing utilities
This module contains utilties for multiprocessing such as
custom pickle functions and class wrappers
'''
from MAVProxy.modules.lib import multiproc
import copyreg
import mmap
import platform
import struct
def pickle_struct(s):
'''Custom pickle function for struct.Struct'''
... | gpl-3.0 |
tdyas/pants | src/python/pants/build_graph/target_addressable.py | 2 | 4322 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
from pants.base.exceptions import TargetDefinitionException
from pants.build_graph.addressable import Addressable
class TargetAddressable(Addressable):
@classmethod
... | apache-2.0 |
beck/django | tests/admin_inlines/tests.py | 118 | 44045 | from __future__ import unicode_literals
import datetime
import warnings
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.auth.models import Permission, User
from... | bsd-3-clause |
edxzw/edx-platform | common/lib/xmodule/xmodule/tests/test_delay_between_attempts.py | 115 | 12476 | """
Tests the logic of problems with a delay between attempt submissions.
Note that this test file is based off of test_capa_module.py and as
such, uses the same CapaFactory problem setup to test the functionality
of the check_problem method of a capa module when the "delay between quiz
submissions" setting is set to ... | agpl-3.0 |
chrismeyersfsu/ansible | lib/ansible/modules/source_control/github_key.py | 39 | 7753 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
udaciouspeople/site | themes/tranquilpeak/.node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | 47697 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | mit |
MotorolaMobilityLLC/external-chromium_org | chrome/test/install_test/theme_updater.py | 30 | 3098 | # 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.
"""Update tests for themes."""
import os
import sys
_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(_DIRECTORY, os.... | bsd-3-clause |
riusksk/riufuzz | tools/coverage/run.py | 1 | 2931 | # By riusksk
# Create: 2016-12-15
# Update: 2016-12-27
import os
import sys
import platform
import getopt
from subprocess import call
idaPro = 'D:\\IDA 6.8\\idaq.exe'
codeCov = os.getcwd()+"\\GenCoverageInfo.py"
binDir = ""
bbDir = os.getcwd()+"\\BBFile"
sampleDir = ''
target = ''
nogen = 0
def help():
print "[Usa... | apache-2.0 |
FedeMPouzols/Savu | savu/test/jenkins/plugin_tests/reconstruction_tests/CGLS_astra_test.py | 3 | 1332 | # Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | gpl-3.0 |
hbristow/django-arxiv | arxiv/management/commands/compile_assets.py | 1 | 1668 | from django.core.management.base import BaseCommand, CommandError
from django.template import loader, Context
import os
import re
import subprocess
def read(filename):
"""Read the contents of a file into a string"""
with open(filename) as f:
return f.read()
class Command(BaseCommand):
"""Inline th... | bsd-3-clause |
aaschaer/globus-sdk-python | tests/framework/constants.py | 1 | 2275 | GO_EP1_ID = "ddb59aef-6d04-11e5-ba46-22000b92c6ec"
GO_EP2_ID = "ddb59af0-6d04-11e5-ba46-22000b92c6ec"
# TODO: stop using EP3 once EP1 and EP2 support symlinks
GO_EP3_ID = "4be6107f-634d-11e7-a979-22000bf2d287"
GO_S3_ID = "cf9bcaa5-6d04-11e5-ba46-22000b92c6ec"
GO_EP1_SERVER_ID = 207976
# ------ #
# tokens #
# ------ #
... | apache-2.0 |
bobwalker99/Pydev | plugins/org.python.pydev/pysrc/pydevd_attach_to_process/winappdbg/module.py | 102 | 70615 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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 ... | epl-1.0 |
lildadou/Flexget | flexget/plugins/input/inputs.py | 10 | 2669 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('inputs')
class PluginInputs(object):
"""
Allows the same input plugin to be configured multiple times in a task.
Example::
inputs:... | mit |
ezeeyahoo/android_kernel_motorola_msm8916 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
solent-eng/solent | solent/eng/orb.py | 2 | 16344 | #
# orb
#
# // overview
# The orb is special type of spin. It contains an in-process broadcast
# network of actors, each of which is called a cog. Cogs can communicate
# with one another by sending broadcasts.
#
# The orb is the main workhorse for the engine. It combines a nearcast
# (see below) and easily contains cog... | lgpl-3.0 |
MobinRanjbar/hue | desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euckrfreq.py | 3121 | 45978 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | apache-2.0 |
turbomanage/training-data-analyst | courses/machine_learning/asl/open_project/ASL_youtube8m_models/video_and_frame_using_datasets/trainer/task.py | 2 | 3721 | # Copyright 2017 Google 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 by applicable law or a... | apache-2.0 |
azhou-nicira/net-next | tools/perf/scripts/python/futex-contention.py | 1997 | 1508 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
astroumd/GradMap | 2014/01_Intro_and_Basics/temp1.py | 1 | 1189 | ### PYTHON BOOT CAMP EXAMPLE;
### created by Josh Bloom at UC Berkeley, 2012 (ucbpythonclass+bootcamp@gmail.com)
### all rights reserved 2012 (c)
### https://github.com/profjsb/python-bootcamp
# set some initial variables. Set the initial temperature low
faren = -1000
# we dont want this going on forever, let's ... | gpl-3.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/defusedxml/expatreader.py | 64 | 2307 | # defusedxml
#
# Copyright (c) 2013 by Christian Heimes <christian@python.org>
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.
"""Defused xml.sax.expatreader
"""
from __future__ import print_function, absolute_import
from xml.sax.expatreader import ExpatP... | agpl-3.0 |
arpitparmar5739/youtube-dl | youtube_dl/extractor/faz.py | 98 | 2435 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class FazIE(InfoExtractor):
IE_NAME = 'faz.net'
_VALID_URL = r'https?://(?:www\.)?faz\.net/(?:[^/]+/)*.*?-(?P<id>\d+)\.html'
_TESTS = [{
'url': 'http://www.faz.net/multimedia/videos/stockholm-chemie-nobel... | unlicense |
RandallDW/Aruba_plugin | plugins/org.python.pydev.jython/jysrc/pyedit_clear_templates_cache.py | 9 | 1582 |
if False:
from org.python.pydev.editor import PyEdit #@UnresolvedImport
cmd = 'command string'
editor = PyEdit
systemGlobals = {}
#--------------------------------------------------------------- REQUIRED LOCALS
#interface: String indicating which command will be executed
#As this script will be watchi... | epl-1.0 |
kingvuplus/EG-gui2 | tools/genmetaindex.py | 155 | 1104 | # usage: genmetaindex.py <xml-files> > index.xml
import sys, os
from xml.etree.ElementTree import ElementTree, Element
root = Element("index")
for file in sys.argv[1:]:
p = ElementTree()
p.parse(file)
package = Element("package")
package.set("details", os.path.basename(file))
# we need all prerequisites
pack... | gpl-2.0 |
Silight/ComicEnv | ComicEnv/lib/python3.2/site-packages/pip/utils/logging.py | 91 | 3186 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
try:
from pip._vendor import colorama
# Lots of different errors can come from this, incl... | mit |
abhishek-ch/hue | desktop/core/ext-py/thrift-0.9.1/src/protocol/TJSONProtocol.py | 72 | 14318 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
shuggiefisher/crowdstock | django/db/backends/sqlite3/base.py | 81 | 12211 | """
SQLite3 backend for django.
Python 2.4 requires pysqlite2 (http://pysqlite.org/).
Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the
standard library.
"""
import re
import sys
import datetime
from django.db import utils
from django.db.backends import *
from django.db.backends.signals i... | bsd-3-clause |
razvanphp/arangodb | 3rdParty/V8-3.31.74.1/third_party/python_26/Lib/idlelib/MultiCall.py | 49 | 17282 | """
MultiCall - a class which inherits its methods from a Tkinter widget (Text, for
example), but enables multiple calls of functions per virtual event - all
matching events will be called, not only the most specific one. This is done
by wrapping the event functions - event_add, event_delete and event_info.
MultiCall r... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.