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
VitalPet/c2c-rd-addons
xml_export_data/wizard/wizard_export_data_via_xml.py
4
9231
# -*- coding: utf-8 -*- ############################################## # # Swing Entwicklung betrieblicher Informationssysteme GmbH # (<http://www.swing-system.com>) # Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH # all rights reserved # 09-MAY-2011 (GK) created # # WARNING: This program as such is intende...
agpl-3.0
Feaisil/codejam-and-co
codejam/2016/qualif/d.py
1
1906
#!/usr/bin/env python3 import sys,time, math cin=sys.stdin cerr=sys.stderr cout=sys.stdout def rl(cin): """readline and remove \n""" return cin.readline()[:-1] cin.rl=lambda:rl(cin) def rs(cin): return cin.rl().split() cin.rs=lambda:rs(cin) def ri(cin): return int(cin.rl()) cin.ri=lambda:ri(cin) def riv(cin): re...
mit
windyuuy/opera
chromium/src/third_party/mesa/src/src/mapi/glapi/gen/glX_doc.py
48
7744
#!/usr/bin/env python # (C) Copyright IBM Corporation 2004, 2005 # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # ...
bsd-3-clause
pdamodaran/yellowbrick
yellowbrick/features/rfecv.py
1
12860
# yellowbrick.features.rfecv # Visualize the number of features selected with recursive feature elimination # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Tue Apr 03 17:31:37 2018 -0400 # # ID: rfecv.py [] benjamin@bengfort.com $ """ Visualize the number of features selected using recursive feature ...
apache-2.0
grcanosa/code-playground
scrum/redminecsv/csvredmineparser.py
1
2665
#!/usr/bin/python3 import sprintstats as ST; import csv FINISHED_STATES = ["Pte Validacion","Corregida","Resuelta"] BLOCKED_STATES = ["Bloqueada"] SUPPORT_TYPES = ["Soporte"] def get_column_indexes(first_row): col_index = {} col_index["issue"] = 0; col_index["state"] = 1 col_index["type"] = 3 co...
mit
Integral-Technology-Solutions/ConfigNOW
Lib/atexit.py
5
1376
""" atexit.py - allow programmer to define multiple exit functions to be executed upon normal program termination. One public function, register, is defined. """ __all__ = ["register"] _exithandlers = [] def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in reverse order s...
mit
opencord/voltha
voltha/extensions/alarms/onu/onu_selftest_failure_alarm.py
1
2054
# Copyright 2018 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
vmindru/ansible
lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule.py
14
10300
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Darren Worrall <darren@iweb.co.uk> # (c) 2015, René Moser <mail@renemoser.net> # # 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 So...
gpl-3.0
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/site-packages/pip/_vendor/progress/helpers.py
24
2952
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE A...
gpl-3.0
sillygod/my-travel-in-learning-python
ufile_transfer/source_map.py
1
3796
"""SourceMap This records the position and condition of the pattern we want to search. With these, we can easily to update and revert the data. """ import sqlite3 from collections import namedtuple # ok, ... use sqlite.. I give using csv up. :( TYPE_DB = "db" TYPE_FILE = "file" class SourceMap: """SourceMap is ...
gpl-2.0
provaleks/o8
addons/base_import_module/tests/test_module/__openerp__.py
377
1290
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
thecrackofdawn/Peach2.3
Peach/Mutators/path.py
1
3542
# # Copyright (c) Michael Eddington # # 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, modify, merge, publish, d...
mit
ekansa/open-context-py
opencontext_py/apps/ocitems/predicatetree/models.py
2
4889
import uuid as GenUUID from django.conf import settings from datetime import datetime, date, time from django.db import models from opencontext_py.apps.ocitems.manifest.models import Manifest from opencontext_py.apps.ocitems.predicates.models import Predicate from opencontext_py.apps.ocitems.predicates.manage import Pr...
gpl-3.0
texttochange/vusion-backend
transports/mobivate_malawi/mobivate_http.py
1
5931
from urllib import urlencode, unquote from urlparse import parse_qs import re, sys, traceback from twisted.internet import defer from twisted.internet.defer import inlineCallbacks from twisted.internet.error import ConnectionRefusedError from twisted.web import http from twisted.web.resource import Resource from twist...
bsd-3-clause
flother/agate
agate/fixed.py
4
2107
#!/usr/bin/env python """ This module contains a generic parser for fixed-width files. It operates similar to Python's built-in CSV reader. """ from collections import OrderedDict, namedtuple import six Field = namedtuple('Field', ['name', 'start', 'length']) class Reader(six.Iterator): """ Reads a fixed...
mit
rjschwei/azure-sdk-for-python
azure-mgmt-logic/azure/mgmt/logic/models/integration_account.py
1
1815
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
owtf/owtf
owtf/utils/ip.py
1
2714
""" owtf.utils.ip ~~~~~~~~~~~~~ """ import logging import socket from ipaddr import IPAddress from owtf.config import config_handler from owtf.lib.exceptions import UnresolvableTargetException def get_ips_from_hostname(hostname): """Get IPs from the hostname :param hostname: Target hostname :type hostn...
bsd-3-clause
tyarkoni/transitions
transitions/extensions/nesting.py
2
49675
# -*- coding: utf-8 -*- from collections import OrderedDict, defaultdict import copy from functools import partial, reduce import inspect import logging from six import string_types from ..core import State, Machine, Transition, Event, listify, MachineError, Enum, EnumMeta, EventData _LOGGER = logging.getLogger(__na...
mit
RPGOne/scikit-learn
examples/mixture/plot_gmm.py
122
3265
""" ================================= Gaussian Mixture Model Ellipsoids ================================= Plot the confidence ellipsoids of a mixture of two Gaussians obtained with Expectation Maximisation (``GaussianMixture`` class) and Variational Inference (``BayesianGaussianMixture`` class models with a Dirichlet ...
bsd-3-clause
hrashk/sympy
sympy/stats/crv.py
4
14542
""" Continuous Random Variables Module See Also ======== sympy.stats.crv_types sympy.stats.rv sympy.stats.frv """ from __future__ import print_function, division from sympy.stats.rv import (RandomDomain, SingleDomain, ConditionalDomain, ProductDomain, PSpace, SinglePSpace, random_symbols, ProductPSpace, ...
bsd-3-clause
ojengwa/oh-mainline
vendor/packages/whoosh/benchmark/reuters.py
16
1239
import gzip, os.path from whoosh import analysis, fields, index, qparser, query from whoosh.support.bench import Bench, Spec from whoosh.util import now class Reuters(Spec): name = "reuters" filename = "reuters21578.txt.gz" main_field = "text" headline_text = "headline" def whoosh_schema(sel...
agpl-3.0
cohortfsllc/cohort-cocl2-sandbox
pnacl/driver/pnacl-dis.py
8
3164
#!/usr/bin/python # Copyright (c) 2012 The Native Client 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 sys import driver_tools from driver_env import env from driver_log import Log, DriverOpen, DriverClose import filetype EXT...
bsd-3-clause
crepererum/invenio
invenio/modules/ranker/testsuite/test_citation_searcher.py
13
2044
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2005, 2006, 2007, 2008, 2010, 2011, 2013 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 # Li...
gpl-2.0
wangg12/caffe
scripts/download_model_binary.py
7
2496
#!/usr/bin/env python import os import sys import time import yaml import urllib import hashlib import argparse required_keys = ['caffemodel', 'caffemodel_url', 'sha1'] def reporthook(count, block_size, total_size): """ From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/ """ glob...
bsd-2-clause
gengliangwang/spark
python/pyspark/mllib/tests/test_streaming_algorithms.py
22
17945
# # 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
CredoReference/edx-platform
common/djangoapps/entitlements/api/v1/tests/test_views.py
9
42027
import json import logging import unittest import uuid from datetime import datetime, timedelta from courseware.models import ( DynamicUpgradeDeadlineConfiguration ) from django.conf import settings from django.urls import reverse from django.utils.timezone import now from mock import patch from opaque_keys.edx.lo...
agpl-3.0
HousekeepLtd/django
tests/foreign_object/test_forms.py
379
1098
import datetime from django import forms from django.test import TestCase from .models import Article class FormsTests(TestCase): # ForeignObjects should not have any form fields, currently the user needs # to manually deal with the foreignobject relation. class ArticleForm(forms.ModelForm): cla...
bsd-3-clause
arun6582/django
tests/null_fk/models.py
106
1302
""" Regression tests for proper working of ForeignKey(null=True). """ from django.db import models class SystemDetails(models.Model): details = models.TextField() class SystemInfo(models.Model): system_details = models.ForeignKey(SystemDetails, models.CASCADE) system_name = models.CharField(max_length=...
bsd-3-clause
amrdraz/brython
www/src/Lib/test/test_xml_etree_c.py
25
2689
# xml.etree test for cElementTree import sys, struct from test import support from test.support import import_fresh_module import unittest cET = import_fresh_module('xml.etree.ElementTree', fresh=['_elementtree']) cET_alias = import_fresh_module('xml.etree.cElementTree', ...
bsd-3-clause
lecaoquochung/ddnb.django
django/contrib/flatpages/tests/test_views.py
40
5645
import os from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.flatpages.models import FlatPage from django.test import TestCase, override_settings @override_settings( LOGIN_URL='/accounts/login/', MIDDLEW...
bsd-3-clause
mlundblad/telepathy-gabble
tests/twisted/jingle/transport-info-parsing.py
1
2638
""" Test whether we parse the transport info with multiple contents correctly """ from gabbletest import exec_test from servicetest import ( make_channel_proxy, EventPattern, assertEquals, assertNotEquals ) from jingletest2 import * from config import VOIP_ENABLED if not VOIP_ENABLED: print "NOTE: built with...
lgpl-2.1
eammx/proyectosWeb
proyectoPython/env/lib/python3.6/site-packages/werkzeug/http.py
1
43107
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
mit
yokose-ks/edx-platform
lms/djangoapps/django_comment_client/tests/test_models.py
37
2233
import django_comment_common.models as models from django.test import TestCase class RoleClassTestCase(TestCase): def setUp(self): # For course ID, syntax edx/classname/classdate is important # because xmodel.course_module.id_to_location looks for a string to split self.course_id = "edX/t...
agpl-3.0
openrazer/openrazer
daemon/openrazer_daemon/dbus_services/dbus_methods/lanceheadte.py
3
15848
from openrazer_daemon.dbus_services import endpoint @endpoint('razer.device.lighting.logo', 'setLogoWave', in_sig='i') def set_logo_wave(self, direction): """ Set the wave effect on the device :param direction: (0|1) - down to up, (1|2) up to down :type direction: int """ self.logger.debug("D...
gpl-2.0
karyon/django
django/conf/locale/__init__.py
76
12167
# -*- encoding: utf-8 -*- from __future__ import unicode_literals """ LANG_INFO is a dictionary structure to provide meta information about languages. About name_local: capitalize it as if your language name was appearing inside a sentence in your language. The 'fallback' key can be used to specify a special fallback...
bsd-3-clause
lepistone/odoo
addons/stock_account/wizard/__init__.py
33
1077
# -*- 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
icereval/osf.io
addons/dataverse/serializer.py
32
3736
from addons.base.serializer import OAuthAddonSerializer from addons.dataverse import client from addons.dataverse.settings import DEFAULT_HOSTS from website.util import api_url_for, web_url_for class DataverseSerializer(OAuthAddonSerializer): addon_short_name = 'dataverse' REQUIRED_URLS = [] # Include ...
apache-2.0
yukoba/DeepLearningTutorials
code/cA.py
32
11872
"""This tutorial introduces Contractive auto-encoders (cA) using Theano. They are based on auto-encoders as the ones used in Bengio et al. 2007. An autoencoder takes an input x and first maps it to a hidden representation y = f_{\theta}(x) = s(Wx+b), parameterized by \theta={W,b}. The resulting latent representat...
bsd-3-clause
soerendip42/rdkit
rdkit/ML/Descriptors/UnitTestParser.py
4
1888
# # Copyright (C) 2001 greg Landrum # """ unit testing code for compound descriptors """ from __future__ import print_function import unittest import Parser from rdkit.six.moves import xrange class TestCase(unittest.TestCase): def setUp(self): print('\n%s: '%self.shortDescription(),end='') self.piec...
bsd-3-clause
jpajuelo/django-registration
registration/models.py
1
2445
""" Copyright (c) 2014, Jaime Pajuelo. All rights reserved. Code released under the BSD 2-Clause license. """ from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from django.utils.encoding import datetime f...
bsd-2-clause
QianBIG/odoo
addons/account_voucher/report/__init__.py
378
1083
# -*- 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
nrwahl2/ansible
lib/ansible/modules/web_infrastructure/rundeck_project.py
99
6314
#!/usr/bin/python # -*- coding: utf-8 -*- # Ansible module to manage rundeck projects # (c) 2017, Loic Blot <loic.blot@unix-experience.fr> # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org...
gpl-3.0
unhammer/hfst3
old_python/test/test_rules.py
1
1886
import libhfst types = [libhfst.TROPICAL_OPENFST_TYPE, libhfst.SFST_TYPE, libhfst.FOMA_TYPE] # Transducers which the rule transducers are compared with rule1 = libhfst.HfstTransducer(libhfst.TROPICAL_OPENFST_TYPE) rule2 = libhfst.HfstTransducer(libhfst.TROPICAL_OPENFST_TYPE) rule3 = libhfst.HfstTransducer(libhfst.T...
gpl-3.0
plumgrid/plumgrid-nova
nova/tests/fake_network.py
1
17515
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Rackspace # 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-...
apache-2.0
KevinScottt/kernel-nk1-negalite-lt02ltespr
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
saleemjaveds/https-github.com-openstack-nova
nova/tests/virt/xenapi/test_driver.py
2
3978
# Copyright (c) 2013 Rackspace Hosting # # 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
PeterDaveHello/eden
languages/ko.py
6
244171
# -*- coding: utf-8 -*- { "'Cancel' will indicate an asset log entry did not occur": "' 취소 ' 자산 로그 항목을 표시합니다 발생하지 않았습니다.", "A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location that has a boundary for the area.": "위치 이...
mit
proby/ansible-modules-core
files/acl.py
38
9767
#!/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
11craft/django-cms
cms/migrations/0026_finish_placeholder_migration.py
385
19523
# -*- 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): # Dummy migration pass def backwards(self, orm): # Dummy migration pass models = { ...
bsd-3-clause
jmmartinez84/yowsup
yowsup/layers/protocol_groups/protocolentities/notification_groups_add.py
61
1946
from .notification_groups import GroupsNotificationProtocolEntity from yowsup.structs import ProtocolTreeNode class AddGroupsNotificationProtocolEntity(GroupsNotificationProtocolEntity): ''' <notification participant="{{participant_jiid}}" t="{{TIMESTAMP}}" from="{{group_jid}}" type="w:gp2" id="{{id}}" notify="What...
gpl-3.0
nikhilraog/boto
boto/s3/tagging.py
236
1732
from boto import handler import xml.sax class Tag(object): def __init__(self, key=None, value=None): self.key = key self.value = value def startElement(self, name, attrs, connection): return None def endElement(self, name, value, connection): if name == 'Key': ...
mit
suiyuan2009/tensorflow
tensorflow/contrib/keras/python/keras/optimizers_test.py
17
4904
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
carlesfernandez/gnss-sdr
src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py
2
7765
#!/usr/bin/env python # # GNSS-SDR is a Global Navigation Satellite System software-defined receiver. # This file is part of GNSS-SDR. # # Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import print_function import os import re import...
gpl-3.0
tammela/PiE
src/src/ini.py
1
4202
'''Manipulate .ini files''' from configobj import ConfigObj import os def currentDir(): #get current directory _str = os.path.abspath(__file__) if _str[-1] == 'y': _dir = _str.replace("{}.py".format(__name__), "") else: _dir = _str.replace("{}.pyc".format(__name__), "") return _dir ...
gpl-2.0
mitchcapper/mythbox
resources/lib/twisted/twisted/python/test/test_components.py
60
21583
# Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for Twisted component architecture. """ from zope.interface import Interface, implements, Attribute from twisted.trial import unittest from twisted.python import components from twisted.python.components import proxyFor...
gpl-2.0
suqi/gym-sandbox
test_algos/A3C_TF/a_pg.py
1
10540
import multiprocessing import threading import tensorflow as tf import numpy as np import gym import os import shutil import matplotlib.pyplot as plt import gym_sandbox import multiprocessing import time GAME = 'police-killall-trigger-3dgrid-v0' OUTPUT_GRAPH = True LOG_DIR = './log' N_WORKERS = multiprocessing.cpu_cou...
mit
wuyuewen/libcloud
libcloud/common/hostvirtual.py
59
2508
# 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
alesaccoia/chew-broadcaster
install-utils/install/osx/package_util.py
24
3406
def cmd(cmd): import subprocess import shlex return subprocess.check_output(shlex.split(cmd)).rstrip('\r\n') def get_tag_info(tag): rev = cmd('git rev-parse {0}'.format(latest_tag)) anno = cmd('git cat-file -p {0}'.format(rev)) tag_info = [] for i, v in enumerate(anno.splitlines()): ...
gpl-2.0
rhndg/openedx
lms/djangoapps/bulk_email/migrations/0001_initial.py
182
6854
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseEmail' db.create_table('bulk_email_courseemail', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True...
agpl-3.0
nash-x/hws
neutron/plugins/mlnx/common/config.py
15
3244
# Copyright 2013 Mellanox Technologies, 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...
apache-2.0
asimshankar/tensorflow
tensorflow/python/kernel_tests/string_to_hash_bucket_op_test.py
36
4238
# 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
jonpiffle/ltag_parser
python/xtag_verbnet/propbank.py
1
4818
import nltk, os, pickle from collections import defaultdict from nltk.corpus.reader import CategorizedBracketParseCorpusReader, PropbankCorpusReader from nltk.corpus.util import LazyCorpusLoader from nltk.corpus import propbank from xtag_verbnet.vnet_constants import DATA_DIR class Propbank(object): """ Clas...
gpl-2.0
exic/spade2
spade/XMLCodec.py
1
12710
import xml.sax from xml.sax import handler from BasicFipaDateTime import * from AID import * from ReceivedObject import ReceivedObject import Envelope class XMLCodec(handler.ContentHandler): """ XML Parser """ def __init__(self): #self.parser = xmlreader.IncrementalParser() #self.parser.setCon...
lgpl-2.1
richardliaw/ray
python/ray/tests/test_component_failures_2.py
1
4994
import os import signal import sys import time import pytest import ray import ray.ray_constants as ray_constants from ray.cluster_utils import Cluster from ray.test_utils import RayTestTimeoutException, get_other_nodes SIGKILL = signal.SIGKILL if sys.platform != "win32" else signal.SIGTERM @pytest.fixture(params=...
apache-2.0
quarckster/cfme_tests
cfme/tests/services/test_catalog.py
2
1813
# -*- coding: utf-8 -*- import fauxfactory import pytest import cfme.tests.configure.test_access_control as tac from cfme.utils import error from cfme.utils.blockers import BZ from cfme import test_requirements from cfme.services.catalogs.catalog import Catalog from cfme.utils.update import update pytestmark = [test_...
gpl-2.0
vaginessa/Googy-Max3-Kernel
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
jastarex/DeepLearningCourseCodes
06_Object_detection/Object_Detection_Tensorflow_API_demo/object_detection/builders/box_predictor_builder.py
21
4989
# 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
Kings42/HelloWorld
Candidato.py
1
1364
# -*- coding: utf-8 -*- var = int (raw_input("Cuantos dias desea registrar?: ")) lista1 = [] lista2 = [] n=0 p=0 parar=True l=0 dato=0 info=0 dia=int bajando=False while len(lista1)!=var: n=n+1 print "---------------------------------------------------------" print "Dia", n while parar...
apache-2.0
alunarbeach/spark
examples/src/main/python/mllib/multi_label_metrics_example.py
158
2277
# # 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
walac/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/test_util.py
449
7538
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mpl-2.0
ludmilamarian/invenio
invenio/modules/deposit/testsuite/test_type_simplerecord.py
2
4271
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 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...
gpl-2.0
danobi/scripts
comic-dl/main.py
1
4041
#!/bin/env python3 import argparse import os import bs4 import requests BASE_URL = 'http://www.readcomics.tv/comic/' DEFAULT_DL_DIR = '.' HEADERS = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) \ AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 \ Safari/537.36'}...
gpl-3.0
miminus/youtube-dl
youtube_dl/extractor/defense.py
123
1240
from __future__ import unicode_literals from .common import InfoExtractor class DefenseGouvFrIE(InfoExtractor): IE_NAME = 'defense.gouv.fr' _VALID_URL = r'http://.*?\.defense\.gouv\.fr/layout/set/ligthboxvideo/base-de-medias/webtv/(?P<id>[^/?#]*)' _TEST = { 'url': 'http://www.defense.gouv.fr/lay...
unlicense
BRCDcomm/pynos
pynos/versions/ver_6/ver_6_0_1/yang/brocade_snmp.py
3
47015
#!/usr/bin/env python import xml.etree.ElementTree as ET class brocade_snmp(object): """Auto generated class. """ def __init__(self, **kwargs): self._callback = kwargs.pop('callback') def snmp_server_context_context_name(self, **kwargs): """Auto Generated Code """...
apache-2.0
storborg/pyramid_frontend
pyramid_frontend/tests/test_templating.py
1
4664
from __future__ import absolute_import, print_function, division import os.path from unittest import TestCase from mako.exceptions import TopLevelLookupException from mako.runtime import Context from mako.util import FastEncodingBuffer from ..templating.lookup import SuperTemplateLookup from .example import base, f...
mit
BhallaLab/moose-full
moose-core/python/moose/writekkit.py
2
17810
import sys import random from . import wildcardFind, element, loadModel, ChemCompt, exists, Annotator, Pool, ZombiePool,PoolBase,CplxEnzBase,Function,ZombieFunction import numpy as np #Todo : To be written # --Notes # --StimulusTable def writeKkit( modelpath, filename,sceneitems=None): global NA NA = 6.0221415...
gpl-2.0
VinceZK/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/applywatchlistlocal_unittest.py
128
2653
# Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
rest-of/the-deck
lambda/lib/python2.7/site-packages/botocore/vendored/requests/sessions.py
439
24250
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
mit
jchodera/cclib
test/method/methods.py
6
1429
# This file is part of cclib (http://cclib.github.io), a library for parsing # and interpreting the results of computational chemistry packages. # # Copyright (C) 2007-2014, the cclib development team # # The library is free software, distributed under the terms of # the GNU Lesser General Public version 2.1 or l...
lgpl-2.1
daranguiz/barbell-io
app/__init__.py
1
1448
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) import os from flask_login import LoginManager from flask_openid import OpenID from config import basedir, ADMINS, MAIL_SERVER, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD if not ap...
mit
gnowxilef/Wox
PythonHome/Lib/site-packages/requests/auth.py
331
6123
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import parse_dict_header ...
mit
todaychi/hue
desktop/core/ext-py/Django-1.6.10/tests/null_queries/tests.py
59
2936
from __future__ import absolute_import from django.test import TestCase from django.core.exceptions import FieldError from .models import Poll, Choice, OuterA, Inner, OuterB class NullQueriesTests(TestCase): def test_none_as_null(self): """ Regression test for the use of None as a query value. ...
apache-2.0
Ahmad31/Web_Flask_Cassandra
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py
713
2320
from __future__ import absolute_import import codecs from uuid import uuid4 from io import BytesIO from .packages import six from .packages.six import b from .fields import RequestField writer = codecs.lookup('utf-8')[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_b...
apache-2.0
RapidApplicationDevelopment/tensorflow
tensorflow/user_ops/invalid_op_test.py
146
1217
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
KlaasDeNys/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/escprober.py
2936
3187
######################## 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...
lgpl-2.1
meng-sun/hil
haas/ext/auth/database.py
4
5295
"""Auth plugin using usernames & passwords in the DB, with HTTP basic auth. Includes API calls for managing users. """ from haas import api, model, auth from haas.model import db from haas.auth import get_auth_backend from haas.rest import rest_call, local, ContextLogger from haas.errors import * from passlib.hash imp...
apache-2.0
ondra-novak/chromium.src
chrome/common/extensions/docs/server2/compiled_file_system_test.py
15
8517
#!/usr/bin/env python # Copyright 2013 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 functools import os from compiled_file_system import CompiledFileSystem from copy import deepcopy from environment import GetAp...
bsd-3-clause
dsbrown/FreeCAD
src/Mod/OpenSCAD/expandplacements.py
29
5960
#*************************************************************************** #* * #* Copyright (c) 2012 Sebastian Hoogen <github@sebastianhoogen.de> * #* * #* This pr...
lgpl-2.1
BaladiDogGames/baladidoggames.github.io
mingw/bin/lib/bdb.py
108
21084
"""Debugger basics""" import fnmatch import sys import os import types __all__ = ["BdbQuit","Bdb","Breakpoint"] class BdbQuit(Exception): """Exception to give up completely""" class Bdb: """Generic Python debugger base class. This class takes care of details of the trace facility; a derived class...
mit
jyhmiinlin/cineFSE
GeRaw/cinePPGVD.py
1
5395
import numpy import matplotlib.pyplot def regTSE(seq_trains,input_indx,VD_table): # if length(seq_trains(:)) ~= length(VD_table(:)) # error('Sizes of output_trains and VD_table are mismatched!') # end # print(seq_trains) N=numpy.size(seq_trains); # print(N) T=numpy.zeros((N,2)); tmp...
gpl-3.0
sparkslabs/kamaelia_
Sketches/MPS/Old/test/test_Selector.py
3
15258
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Ver...
apache-2.0
caesar2164/edx-platform
openedx/core/djangoapps/external_auth/tests/test_openid_provider.py
1
21198
#-*- encoding=utf-8 -*- ''' Created on Jan 18, 2013 @author: brian ''' import openid from openid.fetchers import HTTPFetcher, HTTPResponse from urlparse import parse_qs, urlparse from django.conf import settings from django.test import TestCase, LiveServerTestCase from django.core.cache import cache from django.test....
agpl-3.0
antiface/python-acoustics
acoustics/directivity.py
3
9350
""" Directivity =========== The directivity module provides tools to work with directivity. The following conventions are used within this module: * The inclination angle :math:`\\theta` has a range :math:`[0, \\pi]`. * The azimuth angle :math:`\\phi` has a range :math:`[0 , 2 \\pi]`. """ from __future__ import div...
bsd-3-clause
Timurdov/bionic
bionic/Lib/copy_reg.py
442
6800
"""Helper to provide extensibility for pickle/cPickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ from types import ClassType as _ClassType __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extens...
apache-2.0
sultanxda/sultan-kernel-celox
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
divegeek/keyczar
cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Options/PackageOption.py
19
2014
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # 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 limitati...
apache-2.0
evangs/pyriot
pyriot/api_classes.py
1
35215
# -*- coding: utf-8 -*- import utils class Summoner(object): """ id long Summoner ID. name string Summoner name. profileIconId int ID of the summoner icon associated with the summoner. revisionDate long Date summoner was last modified specifi...
mit
abantam/pmtud
utils.py
179
4188
#! /usr/bin/env python # These methods are used by test.py and waf to look for and read the # .ns3rc configuration file, which is used to specify the modules that # should be enabled import os import sys def get_list_from_file(file_path, list_name): '''Looks for a Python list called list_name in the file specifi...
gpl-2.0
mikebrevard/UnixAdministration
vagrant/etc/data/genData/venv/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/tarfile.py
1005
92627
#------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, free of charge, to any person # obtaining a copy ...
mit
eezee-it/addons-yelizariev
project_task_auto_staging/models.py
16
3669
# -*- coding: utf-8 -*- from openerp import models, fields, api import datetime import time from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from openerp.exceptions import ValidationError class project_project_auto_staging(models.Model): _inherit = 'project.project' allow_automove = fields.Boolean('A...
lgpl-3.0