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
AragurDEV/yowsup
yowsup/layers/protocol_media/protocolentities/message_media.py
1
7427
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from yowsup.layers.protocol_messages.protocolentities import MessageProtocolEntity class MediaMessageProtocolEntity(MessageProtocolEntity): ''' <message t="{{TIME_STAMP}}" from="{{CONTACT_JID}}" offline="{{OFFLINE}}" type="text" id="{{MESSAGE_I...
gpl-3.0
betoesquivel/PLYpractice
env/lib/python2.7/site-packages/setuptools/tests/test_markerlib.py
148
2057
import os import pytest class TestMarkerlib: @pytest.mark.importorskip('ast') def test_markers(self): from _markerlib import interpret, default_environment, compile os_name = os.name assert interpret("") assert interpret("os.name != 'buuuu'") assert interpret("os_n...
mit
overtherain/scriptfile
software/googleAppEngine/lib/django_1_3/django/contrib/gis/sitemaps/views.py
250
4342
from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import get_current_site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.contrib.gis.db.models.fields import GeometryField from django.db import...
mit
liminspace/fabdeb
fabdeb/redis.py
1
2716
import re from fabric.context_managers import cd from fabric.contrib.console import confirm from fabric.contrib.files import sed, append from fabric.decorators import task from fabric.operations import sudo, prompt from fabdeb.os import check_sudo from fabdeb.os import check_os from fabdeb.tools import print_green, pri...
mit
kstrauser/ansible
v1/ansible/utils/vault.py
112
18771
# (c) 2014, James Tanner <tanner.jc@gmail.com> # # 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 i...
gpl-3.0
nZac/keg
keg_apps/web/views/routing.py
1
5243
from __future__ import absolute_import from __future__ import unicode_literals import flask from flask import request from keg.web import BaseView as KegBaseView, route, rule blueprint = flask.Blueprint('routing', __name__) class BaseView(KegBaseView): blueprint = blueprint class VerbRouting(BaseView): ""...
bsd-3-clause
pschmitt/home-assistant
tests/components/broadlink/test_init.py
5
3385
"""The tests for the broadlink component.""" from base64 import b64decode from datetime import timedelta import pytest from homeassistant.components.broadlink import async_setup_service, data_packet from homeassistant.components.broadlink.const import DOMAIN, SERVICE_LEARN, SERVICE_SEND from homeassistant.components....
apache-2.0
noamsu/djangodash2012
djangodash/urls.py
1
1606
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() import settings urlpatterns = patterns('', # Examples: url(r'^$', 'djangodash.views.home', name='home'), url(r'^login$', 'djangodash.views.login', n...
mit
bowlofstew/zulip
zerver/filters.py
124
1058
from __future__ import absolute_import from django.views.debug import SafeExceptionReporterFilter from django.http import build_request_repr class ZulipExceptionReporterFilter(SafeExceptionReporterFilter): def get_post_parameters(self, request): filtered_post = SafeExceptionReporterFilter.get_post_paramet...
apache-2.0
Endika/bank-statement-reconcile
account_statement_no_invoice_import/__openerp__.py
14
1530
# -*- coding: utf-8 -*- ############################################################################### # # module for OpenERP # Copyright (C) 2013-TODAY Akretion <http://www.akretion.com>. # @author Sébastien BEAU <sebastien.beau@akretion.com> # # This program is free software: you can redistribute it and/or m...
agpl-3.0
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/OpenGL/raw/GL/APPLE/object_purgeable.py
3
2117
'''OpenGL extension APPLE.object_purgeable Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_APPLE_object_purgeable' _DEPRECATED = False GL_BUFFE...
mit
eckucukoglu/arm-linux-gnueabihf
arm-linux-gnueabihf/libc/usr/lib/python2.7/test/test_long.py
45
37275
import unittest import sys import random import math from test import test_int, test_support # Used for lazy formatting of failure messages class Frm(object): def __init__(self, format, *args): self.format = format self.args = args def __str__(self): return self.format % self.args #...
gpl-2.0
gentledevil/ansible
lib/ansible/utils/vars.py
5
3090
# (c) 2012-2014, 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) an...
gpl-3.0
davidcusatis/horizon
openstack_dashboard/test/integration_tests/tests/test_projects.py
6
1680
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
ytsarev/rally
rally/benchmark/scenarios/keystone/basic.py
1
1916
# Copyright 2013: Mirantis 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 b...
apache-2.0
tensorflow/tensorflow
tensorflow/python/ops/ragged/ragged_segment_ids_to_row_splits_op_test.py
14
2924
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Lib/textwrap.py
50
15642
"""Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> import string, re __all__ = ['TextWrapper', 'wrap', 'fill', 'dedent'] # Hardcode the recognized whitespace characters to the US-ASCII # whites...
apache-2.0
SteveXiSong/UW-Madison-ECE757-S15-MulticastSnooping
src/base/vnc/Vnc.py
66
2503
# Copyright (c) 2010 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
citrix-openstack-build/ironic
ironic/openstack/common/fixture/mockpatch.py
25
1571
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "Li...
apache-2.0
westinedu/newertrends
django/contrib/localflavor/se/forms.py
311
5623
# -*- coding: utf-8 -*- """ Swedish specific Form helpers """ import re from django import forms from django.utils.translation import ugettext_lazy as _ from django.core.validators import EMPTY_VALUES from django.contrib.localflavor.se.utils import (id_number_checksum, validate_id_birthday, format_personal_id_numbe...
bsd-3-clause
tfmorris/dedupe
tests/exampleIO.py
2
1162
import csv import re import dedupe.core def preProcess(column) : column = re.sub(' +', ' ', column) column = re.sub('\n', ' ', column) column = column.strip().strip('"').strip("'").lower() if not column : column = None return column def print_csv(input_file, output_file, header, clustered_dupes) : or...
mit
davilla/meatgrinder
tools/EventClients/examples/python/example_button2.py
228
2074
#!/usr/bin/python # This is a simple example showing how you can send a key press event # to XBMC in a non-queued fashion to achieve a button pressed down # event i.e. a key press that repeats. # The repeat interval is currently hard coded in XBMC but that might # change in the future. # NOTE: Read the comments in '...
gpl-2.0
zdw/xos
xos/synchronizers/base/SyncInstanceUsingAnsible.py
2
9848
import hashlib import os import socket import sys import base64 import time from django.db.models import F, Q from xos.config import Config from synchronizers.base.syncstep import SyncStep from synchronizers.base.ansible import run_template_ssh from core.models import Service, Slice, ControllerSlice, ControllerUser fro...
apache-2.0
typemytype/Mechanic
Mechanic.roboFontExt/lib/site-packages/requests/packages/urllib3/__init__.py
62
2855
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager imp...
mit
sssllliang/silverberry
lib/setuptools/dist.py
41
37614
__all__ = ['Distribution'] import re import os import warnings import numbers import distutils.log import distutils.core import distutils.cmd import distutils.dist from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, DistutilsSetupError) from distutils.util import rfc822_escape import six f...
apache-2.0
dakcarto/QGIS
python/plugins/processing/gui/BatchPanel.py
9
10420
# -*- coding: utf-8 -*- """ *************************************************************************** BatchPanel.py --------------------- Date : November 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *************...
gpl-2.0
jalavik/invenio
invenio/base/setuptools/__init__.py
21
1323
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 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
40323226/26
users/a/g8/ag8_40323131_task1.py
9
20490
# 各組分別在各自的 .py 程式中建立應用程式 (第1步/總共3步) from flask import Blueprint, render_template, make_response # 利用 Blueprint建立 ag1, 並且 url 前綴為 /ag1, 並設定 template 存放目錄 ag8_40323131 = Blueprint('ag8_40323131', __name__, url_prefix='/ag8_40323131', template_folder='templates') @ag8_40323131.route('/task1_31') def task1_31(): o...
agpl-3.0
mspark93/VTK
Filters/Extraction/Testing/Python/ExtractTensors.py
20
2970
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # create tensor ellipsoids # Create the RenderWindow, Renderer and interactive renderer # ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.v...
bsd-3-clause
dduan/django-sophie
setup.py
1
1268
import os from distutils.core import setup import sophie readme = open(os.path.join(os.path.dirname(__file__), 'README.rst')) ver = sophie.get_version() setup( name = 'django-sophie', packages = [ 'sophie', ], package_data = { 'sophie': [ 'sophie/templates/*', 'sophie/tes...
bsd-3-clause
eayunstack/rally
tests/functional/test_cli_show.py
22
1508
# Copyright 2013: Mirantis 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 b...
apache-2.0
redcurrant/redcurrant
rules-motor/lib/python/pymotor/mod_general.py
1
1208
"""General Module It contains a set of generic methods for various data types.""" import time import os def do_it_between(start_time = 0, end_time = 0): """Set up an execution time table start_time -> format hhmm end_time -> format hhmm example: do_it_between(0700, 2300) This will set up an execution time table...
lgpl-3.0
kwentz10/Photosynthesis_Optimization_Modeling
Photosynthesis_Model.py
1
40072
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sat Nov 26 16:37:08 2016 In this code I solve for assimilation by three approaches. All three approaches use a combination of Ohm's Law and Ball-Berry's Model of stomatal conductances. The first photo model solves for Assimilation without factoring in bo...
mit
manuzhang/incubator-beam
sdks/python/apache_beam/transforms/ptransform_test.py
9
78585
# # 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
sdague/home-assistant
homeassistant/components/axis/__init__.py
6
1703
"""Support for Axis devices.""" import logging from homeassistant.const import CONF_DEVICE, EVENT_HOMEASSISTANT_STOP from .const import DOMAIN as AXIS_DOMAIN from .device import AxisNetworkDevice _LOGGER = logging.getLogger(__name__) async def async_setup(hass, config): """Old way to set up Axis devices.""" ...
apache-2.0
hbrunn/openupgradelib
openupgradelib/openupgrade.py
1
43114
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2011-2013 Therp BV (<http://therp.nl>) # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
chandranaik/Aligning-of-PIE-with-rfc8033-in-ns3
src/visualizer/visualizer/plugins/interface_statistics.py
12
8043
import gtk import ns.core import ns.network from visualizer.base import InformationWindow NODE_STATISTICS_MEMORY = 10 ## StatisticsCollector class class StatisticsCollector(object): """ Collects interface statistics for all nodes. """ ## @var node_statistics # node statistics ## @var visuali...
gpl-2.0
40223249-1/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/os.py
635
35582
r"""OS routines for Mac, NT, or Posix depending on what system we're on. This exports: - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix', 'nt', 'os2' or 'ce'. - os.curdir is a string representing the current directory ('.' or...
agpl-3.0
moandcompany/luigi
test/decorator_test.py
36
9830
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
nguyentu1602/googletest
test/gtest_test_utils.py
674
10826
#!/usr/bin/env python # # Copyright 2006, 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
anish/buildbot
www/wsgi_dashboards/buildbot_wsgi_dashboards/__init__.py
6
1615
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
adelina-t/neutron
neutron/db/migration/alembic_migrations/nec_init_ops.py
32
4361
# Copyright 2014 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
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive2/structured/solutions/serving/application/lib/werkzeug/security.py
11
8106
# -*- coding: utf-8 -*- """ werkzeug.security ~~~~~~~~~~~~~~~~~ Security related helpers such as secure password hashing tools. :copyright: 2007 Pallets :license: BSD-3-Clause """ import codecs import hashlib import hmac import os import posixpath from random import SystemRandom from struct import...
apache-2.0
coolsgupta/machine_learning_nanodegree
Deep_Learning/CNN/CIFAR_10 mini project/cifar10_mlp.py
1
1894
import keras from keras.datasets import cifar10 # load the pre-shuffled train and test data (x_train,y_train),(x_test,y_test) = cifar10.load_data() # rescale [0,255] --> [0,1] x_train = x_train.astype('float32')/255 x_test = x_test.astype('float32')/255 from keras.utils import np_utils import numpy as np #one-hot en...
mit
ElenaBadWolf/for_homework1
test_addgroup.py
1
1280
# -*- coding: utf-8 -*- from model.group import Group def test_test_addgroup(app, json_groups): group = json_groups app.session.login(username="admin",password="secret") app.open_home_page_group() old_groups = app.group.get_group_list() app.group.init_creation() app.gr...
apache-2.0
ethancaballero/neural-engineers-first-attempt
load_d2c_data/segtok/tokenizer.py
1
15681
#!/usr/bin/env python """ Regex-based word tokenizers. Note that small/full/half-width character variants are *not* covered. If a text were to contains such characters, normalize it first. """ from __future__ import absolute_import, unicode_literals import codecs try: from html import unescape except ImportError: ...
mit
gVallverdu/pymatgen
pymatgen/electronic_structure/tests/test_core.py
4
5554
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import unittest from pymatgen.core import Lattice from pymatgen.electronic_structure.core import Orbital, Spin, Magmom import numpy as np class SpinTest(unittest.TestCase): def test_init(self): ...
mit
tracierenea/gnuradio
docs/doxygen/doxyxml/doxyindex.py
47
8818
# # Copyright 2010 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
roger-zhao/ardupilot-3.5-dev
mk/PX4/Tools/genmsg/test/test_genmsg_gentools.py
215
9526
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, 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...
gpl-3.0
s1n4/Taeniurus
lib/irc.py
1
8043
#!/usr/bin/env python #Project: Taeniurus https://github.com/s1n4/Taeniurus #IRC module import ConfigParser import re import socket import time class IRC: table = { 'P': 'PRIVMSG', 'N': 'NOTICE', 'K': 'KICK', 'J': 'JOIN', 'I': 'INVITE'} def __init__(self): con...
gpl-3.0
xzh86/scikit-learn
examples/manifold/plot_swissroll.py
330
1446
""" =================================== Swiss Roll reduction with LLE =================================== An illustration of Swiss Roll reduction with locally linear embedding """ # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # License: BSD 3 clause (C) INRIA 2011 print(__doc__) import matplotlib.pyplot...
bsd-3-clause
Netflix/security_monkey
migrations/versions/7c54b06e227b_.py
1
10546
"""Detect and remove duplicate items in the database. Revision ID: 7c54b06e227b Revises: 11f081cf54e2 Create Date: 2018-04-30 12:31:47.748649 """ # revision identifiers, used by Alembic. import datetime revision = '7c54b06e227b' down_revision = '11f081cf54e2' from alembic import op from sqlalchemy import Column, B...
apache-2.0
deepmind/deepmind-research
gated_linear_networks/examples/bernoulli_mnist.py
1
5769
# Lint as: python3 # Copyright 2020 DeepMind Technologies Limited. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
SIFTeam/enigma2
lib/python/Components/Renderer/PositionGauge.py
33
1901
from Renderer import Renderer from enigma import ePositionGauge class PositionGauge(Renderer): def __init__(self): Renderer.__init__(self) self.__position = 0 self.__seek_position = 0 self.__length = 0 self.__seek_enable = 0 self.__cutlist = [ ] GUI_WIDGET = ePositionGauge def postWidgetCreate(self,...
gpl-2.0
indeedops/dd-agent
checks.d/dns_check.py
4
3118
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import time # 3p import dns.resolver # project from checks import AgentCheck from util import Platform # These imports are necessary because otherwise dynamic type # resolution will fail on windows wi...
bsd-3-clause
spektom/incubator-airflow
airflow/contrib/sensors/gcs_sensor.py
5
3286
# # 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...
apache-2.0
skyoo/jumpserver
apps/settings/migrations/0001_initial.py
5
1299
# Generated by Django 2.1.7 on 2019-02-26 03:11 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('common', '0006_auto_20190304_1515'), ] state_operations = [ migrations.CreateModel( name='Setting', ...
gpl-2.0
pztrick/django-allauth
allauth/socialaccount/providers/draugiem/provider.py
4
1784
from django.urls import reverse from django.utils.http import urlencode from allauth.socialaccount.providers.base import Provider, ProviderAccount class DraugiemAccount(ProviderAccount): def get_avatar_url(self): ret = None pic_small_url = self.account.extra_data.get('img') pic_icon_url ...
mit
thicklizard/komodo_ville
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
aioue/ansible
hacking/report.py
46
6657
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """A tool to aggregate data about Ansible source and testing into a sqlite DB for reporting.""" from __future__ import (absolute_import, print_function) import argparse import os import requests import sqlite3 import sys DATABASE_PATH = os.path.expanduser('~/.ansible/rep...
gpl-3.0
gennaios/alfred-gnosis
src/workflow/update.py
1
12328
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2014 Fabio Niephaus <fabio.niephaus@gmail.com>, # Dean Jackson <deanishe@deanishe.net> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2014-08-16 # """Self-updating from GitHub. .. versionadded:: 1.9 .. note:: This module is n...
mit
jrha/aquilon
lib/python2.6/aquilon/worker/formats/dns_environment.py
2
1239
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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...
apache-2.0
YeDeheng/twitter_nlp
python/pos_tag/cluster_sim.py
10
4240
import math import os import sys # NEED REPO LOCATION BASE_DIR = 'twitter_nlp.jar' if os.environ.has_key('TWITTER_NLP'): BASE_DIR = os.environ['TWITTER_NLP'] sys.path.append('%s/python' % (BASE_DIR)) # DON'T SET CLUSTER_FP = os.path.join(BASE_DIR, 'data/brown_clusters/60K_clusters.txt') SEED_POS_DIR = os.path.j...
gpl-3.0
saltastro/FP_utils
radialProfile.py
1
1882
import numpy as np import numpy.ma as ma def azimuthalAverage(image, center=None, maskval=0): """ calculate the azimuthally averaged radial profile. image - 2D image center - [x,y] pixel coordinates used as the center. the default is None which then uses the center of the image (includin...
bsd-3-clause
victorbergelin/scikit-learn
sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py
221
5517
""" Testing for the gradient boosting loss functions and initial estimators. """ import numpy as np from numpy.testing import assert_array_equal from numpy.testing import assert_almost_equal from numpy.testing import assert_equal from nose.tools import assert_raises from sklearn.utils import check_random_state from ...
bsd-3-clause
BigDataforYou/movie_recommendation_workshop_1
big_data_4_you_demo_1/venv/lib/python2.7/site-packages/numpy/random/info.py
128
5199
""" ======================== Random Number Generation ======================== ==================== ========================================================= Utility functions ============================================================================== random_sample Uniformly distributed floats over ``[0, 1)`...
mit
ajose01/rethinkdb
external/v8_3.30.33.16/tools/testrunner/objects/__init__.py
651
1571
# Copyright 2012 the V8 project authors. 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 conditi...
agpl-3.0
apache/libcloud
libcloud/test/compute/test_brightbox.py
18
15764
# 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 use ...
apache-2.0
voodka/ghostbakup
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_clbuiltins.py
370
14015
# -*- coding: utf-8 -*- """ pygments.lexers._clbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ANSI Common Lisp builtins. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTIN_FUNCTIONS = [ # 638 functions '<', '<=', '=', '>', '>=', '-', '...
mit
Xekyo/bitcoin
test/functional/importprunedfunds.py
5
4571
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the importprunedfunds and removeprunedfunds RPCs.""" from test_framework.test_framework import Bit...
mit
vrenaville/OCB
addons/hr_holidays/__init__.py
442
1094
# -*- 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
bdaroz/the-blue-alliance
tests/test_event_team_status_helper.py
5
56266
import unittest2 from appengine_fixture_loader.loader import load_fixture from google.appengine.ext import testbed from google.appengine.ext import ndb from helpers.event_simulator import EventSimulator from helpers.event_team_status_helper import EventTeamStatusHelper from models.event import Event from models.event...
mit
xiangel/hue
desktop/core/ext-py/kerberos-1.1.1/pysrc/kerberos.py
39
8912
## # Copyright (c) 2006-2009 Apple 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 l...
apache-2.0
strk/mapnik
scons/scons-local-2.2.0/SCons/Tool/packaging/targz.py
14
1834
"""SCons.Tool.Packaging.targz The targz SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Softwa...
lgpl-2.1
adamlincoln/Bookie
scripts/admin/timing.py
9
1886
#!/bin/env python """Process request times from nginx access lines The access log has been tweaked to add a request time to the end of the line This doesn't take into account any network traffic back to the user, so only server side request time. We want to grab the top 10 urls and see what's the longest stuff goin...
agpl-3.0
kalahbrown/HueBigSQL
desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml/__init__.py
112
9273
from error import * from tokens import * from events import * from nodes import * from loader import * from dumper import * __version__ = '3.09' try: from cyaml import * __with_libyaml__ = True except ImportError: __with_libyaml__ = False def scan(stream, Loader=Loader): """ Scan a YAML stream...
apache-2.0
CraigHarris/gpdb
gpMgmt/bin/gpgenfsmap.py
21
8809
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2011. All Rights Reserved. ''' gpgenfsmap.py Generates a mapping of Servers, Filesystems, GPDB Filespaces and Storage Pools Options: -h, -?, --help Print this usage. -p --port Port to use to connect to DB. Defaults to $PGPORT -u --usernam...
apache-2.0
GeoODK/formhub
odk_logger/tests/test_publish_xls.py
7
3689
import os import sys import codecs from django.core.management import call_command from django.core.management.base import CommandError from main.tests.test_base import MainTestCase from odk_logger.models.xform import XForm from utils.logger_tools import report_exception class TestPublishXLS(MainTestCase): def ...
bsd-2-clause
zo7/deconvfaces
faces/model.py
1
3779
""" faces/model.py Methods to build FaceGen models. """ from keras import backend as K from keras.layers import BatchNormalization, Convolution2D, Dense, LeakyReLU, \ Input, MaxPooling2D, merge, Reshape, UpSampling2D from keras.models import Model from .instance import Emotion, NUM_YALE_POSES def build_mo...
mit
pombredanne/click-utils
tests/test_help.py
2
1920
# -*- coding: utf-8 -*- import click import click_utils def test_help_env(runner): @click.command() def cli(option_a, option_b, option_c, option_d): click.echo(option_a) click.echo(option_b) click.echo(option_c) click.echo(option_d) option = click_utils.help.EnvHelpOpti...
bsd-3-clause
syrrim/werkzeug
examples/couchy/views.py
44
1999
from werkzeug.utils import redirect from werkzeug.exceptions import NotFound from couchy.utils import render_template, expose, \ validate_url, url_for, Pagination from couchy.models import URL @expose('/') def new(request): error = url = '' if request.method == 'POST': url = request.form.get('url...
bsd-3-clause
adaur/SickRage
lib/unrar2/__init__.py
44
7353
# Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov # # 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...
gpl-3.0
poryfly/scikit-learn
examples/ensemble/plot_gradient_boosting_regularization.py
355
2843
""" ================================ Gradient Boosting regularization ================================ Illustration of the effect of different regularization strategies for Gradient Boosting. The example is taken from Hastie et al 2009. The loss function used is binomial deviance. Regularization via shrinkage (``lear...
bsd-3-clause
HazyResearch/metal
metal/contrib/visualization/analysis.py
1
4929
import matplotlib.pyplot as plt import numpy as np import scipy.sparse as sparse from metal.utils import convert_labels ############################################################ # Label Matrix Plotting ############################################################ def view_label_matrix(L, colorbar=True): """Di...
apache-2.0
rvianello/rdkit
Code/GraphMol/MolChemicalFeatures/Wrap/testChemicalFeatures.py
4
5912
from rdkit import DataStructs from rdkit import RDConfig from rdkit import Chem from rdkit.Chem import ChemicalFeatures, rdDistGeom from rdkit import Geometry import unittest, os def lstFeq(l1, l2, tol=1.e-4): if (len(list(l1)) != len(list(l2))): return 0 for i in range(len(list(l1))): if not feq(l1[i], l...
bsd-3-clause
AloneRoad/Inforlearn
.google_appengine/lib/django/django/db/models/fields/generic.py
32
10271
""" Classes allowing "generic" relations through ContentType and object-id fields. """ from django import oldforms from django.core.exceptions import ObjectDoesNotExist from django.db import backend from django.db.models import signals from django.db.models.fields.related import RelatedField, Field, ManyToManyRel from...
apache-2.0
alexandreblin/python-can-monitor
tests/test_canmonitor.py
1
1332
"""Tests for canmonitor.py""" from os import path import unittest from canmonitor import canmonitor TEST_DATA_DIR = path.abspath(path.join(path.dirname(__file__), 'data')) class CanmonitorTestCase(unittest.TestCase): """Test case for canmonitor.py.""" def test_format_data_ascii(self): # ASCII ch...
mit
blade-af3/android_kernel_zte_P731A20
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
PeterWangIntel/blink-crosswalk
Source/devtools/scripts/compile_frontend.py
6
19777
#!/usr/bin/env python # Copyright (c) 2012 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
heiko-r/paparazzi
find_confs.py
53
1155
#!/usr/bin/env python from __future__ import print_function import os from fnmatch import fnmatch def find_conf_files(pprz_home, conf_dir, exclude_backups=True): conf_files = [] pattern = "*conf[._-]*xml" backup_pattern = "*conf[._-]*xml.20[0-9][0-9]-[01][0-9]-[0-3][0-9]_*" excludes = ["conf/%gconf.x...
gpl-2.0
popazerty/openhdf-enigma2
lib/python/Screens/SoftwareUpdate.py
3
18126
import Components.Task from Screens.ChoiceBox import ChoiceBox from Screens.MessageBox import MessageBox from Screens.Screen import Screen from Screens.Standby import TryQuitMainloop from Components.About import about from Components.ActionMap import ActionMap from Components.Button import Button from Components.config...
gpl-2.0
hecchi777/S3-SlaacSecuritySolution
impacket-0.9.11/impacket/testcases/dot11/test-FrameManagement.py
6
8684
#!/usr/bin/env python # sorry, this is very ugly, but I'm in python 2.5 import sys sys.path.insert(0,"../..") from dot11 import Dot11, Dot11Types, Dot11ManagementFrame,Dot11ManagementBeacon from ImpactDecoder import RadioTapDecoder from binascii import hexlify import unittest class TestDot11ManagementBeaconFrames(un...
apache-2.0
mabotech/maboss.py
libs/mabolab/mabolab/utils/printer_connection.py
1
3517
# -*- coding: utf-8 -*- #register_printer import os import win32netcon import win32wnet import win32api from win32wnet import NETRESOURCE import logging import logging.config import time from utils import open_cmd, get_token import static from configuration import PrinterConfiguration logger = logging.g...
mit
xxtbg/vboxweb
VBoxWebConfig.py
8
3450
class VBoxWebConfig: # See languages folder for more language options language = 'en_us' # Default host/ip to use for console #consoleHost = '192.168.1.40' # Disable "preview" box #noPreview = True # Default preview box update interval in seconds #previewUpdateInterval = 30 # Preview b...
mit
sid-kap/pants
tests/python/pants_test/backend/project_info/tasks/test_ide_gen.py
9
4988
# coding=utf-8 # Copyright 2014 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.backend.j...
apache-2.0
attakei/ansible
contrib/inventory/fleet.py
160
3073
#!/usr/bin/env python """ fleetctl base external inventory script. Automatically finds the IPs of the booted coreos instances and returns it under the host group 'coreos' """ # Copyright (C) 2014 Andrew Rothstein <andrew.rothstein at gmail.com> # # This program is free software: you can redistribute it and/or modify ...
gpl-3.0
jasag/Phytoliths-recognition-system
code/imgaug/tests/check_performance.py
1
15175
""" Tests to measure the performance of each augmenter. Run these checks from the project directory (i.e. parent directory) via python check_performance.py """ from __future__ import print_function, division #import sys #import os #sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import imgaug as ia...
bsd-3-clause
lsinfo/odoo
addons/l10n_fr_hr_payroll/report/fiche_paye.py
303
3203
#!/usr/bin/env python #-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it...
agpl-3.0
hashbrowncipher/vault
vendor/github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py
1138
3876
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
mpl-2.0
hakatashi/youtube-dl
youtube_dl/extractor/la7.py
16
2279
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( js_to_json, smuggle_url, ) class LA7IE(InfoExtractor): IE_NAME = 'la7.it' _VALID_URL = r'''(?x)(https?://)?(?: (?:www\.)?la7\.it/([^/]+)/(?:rivedila7|video)/| tg\.la7\.it/re...
unlicense