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
alvations/Sensible-SemEval
CWI-data/evaluate_system_original.py
2
1946
import sys import argparse def evaluateIdentifier(gold, pred): """ Performs an intrinsic evaluation of a Complex Word Identification approach. @param gold: A vector containing gold-standard labels. @param pred: A vector containing predicted labels. @return: Precision, Recall and F-1. """ #Initialize variable...
mit
lanyuwen/openthread
tools/harness-automation/cases_R140/router_5_3_4.py
18
1876
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread 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: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
chuan9/chromium-crosswalk
tools/perf/page_sets/key_idle_power_cases.py
6
2704
# Copyright 2015 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. from page_sets import android_screen_restoration_shared_state from telemetry.page import page as page_module from telemetry.page import shared_page_state fro...
bsd-3-clause
Thraxis/pymedusa
lib/unidecode/x00b.py
252
4132
data = ( '[?]', # 0x00 'N', # 0x01 'N', # 0x02 'H', # 0x03 '[?]', # 0x04 'a', # 0x05 'aa', # 0x06 'i', # 0x07 'ii', # 0x08 'u', # 0x09 'uu', # 0x0a 'R', # 0x0b 'L', # 0x0c '[?]', # 0x0d '[?]', # 0x0e 'e', # 0x0f 'ai', # 0x10 '[?]', # 0x11 '[?]', # 0x12 'o', # ...
gpl-3.0
xuru/pyvisdk
pyvisdk/do/vmfs_datastore_base_option.py
1
1045
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def VmfsDatastoreBaseOption(vim, *args, **kwargs): '''Base class that describes a VMFS da...
mit
stendarr/searchengine-imagescraper
bingscraperv3.py
1
2359
from bs4 import BeautifulSoup, SoupStrainer from html.parser import * import http.client import urllib.request from urllib.request import urlopen, Request #99 questions yes = ['y','ye','yes'] search_term = str(input('Bing Image Search: ')).replace(" ", "+") link_limit = int(input("Enter link limit (1-100): ")) sav...
mit
Whisper-Cao/802.15.4-revision
docs/doxygen/swig_doc.py
6
8675
# # Copyright 2010,2011 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 versi...
gpl-3.0
igordejanovic/textX
tests/functional/test_scoping/test_model_repository.py
1
4915
from __future__ import unicode_literals from os.path import dirname, abspath, join import textx.scoping.providers as scoping_providers from textx import metamodel_from_file from textx.scoping import is_file_included def test_inclusion_check_1(): """ Test to demonstrate how to check if a file is used by a mod...
mit
medspx/QGIS
python/plugins/processing/gui/wrappers_map_theme.py
30
1829
# -*- coding: utf-8 -*- """ *************************************************************************** wrappers_map_theme.py - Map theme widget wrappers --------------------- Date : August 2017 Copyright : (C) 2017 by OPENGIS.ch Email : mario@opengis.ch **...
gpl-2.0
appsembler/edx-platform
cms/djangoapps/contentstore/management/commands/delete_course.py
16
3568
from __future__ import print_function from six import text_type from django.core.management.base import BaseCommand, CommandError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from contentstore.utils import delete_course from xmodule.contentstore.django import contentstore from xm...
agpl-3.0
katstalk/android_external_chromium_org
third_party/re2/re2/make_unicode_groups.py
219
2849
#!/usr/bin/python # Copyright 2008 The RE2 Authors. All Rights Reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Generate C++ tables for Unicode Script and Category groups.""" import sys import unicode _header = """ // GENERATED BY make_unicode_groups...
bsd-3-clause
rchekaluk/cloudbiolinux
cloudbio/package/cpan.py
9
3266
"""Install perl packages using CPAN and cpanminus (cpanm). """ import os from fabric.api import cd, settings from cloudbio.flavor.config import get_config_file from cloudbio.fabutils import find_cmd from cloudbio.package.shared import _yaml_to_packages from cloudbio.custom import shared as cshared def install_packag...
mit
SimonSickle/android_kernel_htc_primou
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
cesargtz/YecoraOdoo
addons/l10n_bo/__init__.py
2120
1456
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
azumimuo/family-xbmc-addon
script.module.liveresolver/lib/liveresolver/resolvers/zoomtv.py
1
1639
# -*- coding: utf-8 -*- import re,urlparse,urllib from liveresolver.modules import client,decryptionUtils from liveresolver.modules.log_utils import log def resolve(url): try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0] headers = { 'referer': referer, ...
gpl-2.0
tarballs-are-good/sympy
sympy/physics/quantum/tests/test_matrixutils.py
2
3418
from sympy import Matrix, zeros, ones, Integer from sympy.physics.quantum.matrixutils import ( to_sympy, to_numpy, to_scipy_sparse, matrix_tensor_product, matrix_to_zero ) m = Matrix([[1,2],[3,4]]) def test_sympy_to_sympy(): assert to_sympy(m) == m def test_matrix_to_zero(): assert matrix_to_zero(...
bsd-3-clause
ah391/sc-python
datalook.py
1
1722
# coding: utf-8 import sys import numpy import matplotlib.pyplot def analyse(filename, outfile=None): """Load data and create plots. Subplots with placeholders, with set lables, layout tight """ data = numpy.loadtxt(fname=filename, delimiter=',') # Create a wide figure to hold the subplo...
mit
halfcrazy/sqlalchemy
test/orm/inheritance/test_basic.py
20
85967
import warnings from sqlalchemy.testing import eq_, assert_raises, assert_raises_message from sqlalchemy import * from sqlalchemy import exc as sa_exc, util, event from sqlalchemy.orm import * from sqlalchemy.orm.util import instance_str from sqlalchemy.orm import exc as orm_exc, attributes from sqlalchemy.testing.asse...
mit
albertomurillo/ansible
test/units/modules/network/netact/test_netact_cm_command.py
45
6140
""" netact_cm_command unit tests """ # -*- coding: utf-8 -*- # (c) 2017, Nokia # 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 ...
gpl-3.0
google-research/google-research
widget_caption/widget_caption_input.py
1
12750
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
jbedorf/tensorflow
tensorflow/python/platform/gfile.py
16
3104
# 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
dhenyjarasandy/scrapy
scrapy/settings/__init__.py
124
6388
import six import json import copy import warnings from collections import MutableMapping from importlib import import_module from scrapy.utils.deprecate import create_deprecated_class from scrapy.exceptions import ScrapyDeprecationWarning from . import default_settings SETTINGS_PRIORITIES = { 'default': 0, ...
bsd-3-clause
richardcs/ansible
lib/ansible/utils/listify.py
100
1497
# (c) 2014 Michael DeHaan, <michael@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
gpl-3.0
bmya/odoo_addons
smile_account_voucher_group/models/__init__.py
3
1087
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
kvar/ansible
contrib/inventory/vmware.py
37
18538
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' VMware Inventory Script ======================= Retrieve information about virtual machines from a vCenter server or standalone ESX host. When `group_by=false` (in the INI file), host systems are also returned in addition to VMs. This script will attempt to read conf...
gpl-3.0
trondeau/gnuradio-old
gr-filter/python/filter/design/fir_design.py
11
15888
# Copyright 2012 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. # # G...
gpl-3.0
wimmuskee/mangrove
mangrove_libs/common.py
1
3122
# -*- coding: utf-8 -*- """ This module contains common functions for the mangrove crawler. Wim Muskee, 2013-2018 wimmuskee@gmail.com License: GPL-3 """ def getConfig(configfile,section): import json with open(configfile, "r") as f: configdata = json.loads(f.read()) config = {} config.update(configdata["commo...
gpl-3.0
akd001/RPi
testRainbow.py
1
1361
import os, sys, subprocess, time from rainbowhatwrapper.handlers import * #CONSTANTS BUTTON_A_STATE = False BUTTON_B_STATE = False BUTTON_C_STATE = False def showUptime(): while True: test = subprocess.Popen(["uptime"], stdout=subprocess.PIPE) output = test.communicate()[0].split()[0].split(':') ...
mit
IntelLabs/numba
numba/tests/test_sort.py
7
33874
import copy import itertools import math import random import sys import numpy as np from numba.core.compiler import compile_isolated, Flags from numba import jit, njit from numba.core import types, utils, errors import unittest from numba import testing from numba.tests.support import TestCase, MemoryLeakMixin, tag ...
bsd-2-clause
FireballDWF/cloud-custodian
tools/c7n_salactus/setup.py
5
1310
# Copyright 2015-2017 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
trungnt13/scikit-learn
sklearn/decomposition/tests/test_dict_learning.py
47
8095
import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises ...
bsd-3-clause
SaschaMester/delicium
third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_dart_generator.py
1
17908
# 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. """Generates dart source files from a mojom.Module.""" import os import re import shutil import sys import mojom.generate.constant_resolver as resolver imp...
bsd-3-clause
thinkopensolutions/odoo-saas-tools
saas_server_backup_ftp/models/saas_server.py
1
2303
# -*- coding: utf-8 -*- import tempfile from odoo import api, models import logging _logger = logging.getLogger(__name__) try: import pysftp except ImportError: _logger.debug('saas_server_backup_ftp requires the python library pysftp which is not found on your installation') class SaasServerClient(models.Mode...
lgpl-3.0
uclouvain/osis
base/tests/utils/test_operator.py
1
2143
# ############################################################################ # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business i...
agpl-3.0
NewpTone/stacklab-nova
debian/tmp/usr/lib/python2.7/dist-packages/nova/tests/test_configdrive2.py
7
3462
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Michael Still and Canonical 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:...
apache-2.0
colognecoin/colognecoin
contrib/bitrpc/bitrpc.py
239
7836
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Ser...
mit
tortib/nzbToMedia
libs/requests/models.py
16
26200
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
gpl-3.0
j-carl/ansible
hacking/build_library/build_ansible/command_plugins/release_announcement.py
55
2905
# coding: utf-8 # Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import sys from collections import UserString from...
gpl-3.0
eugena/django
django/contrib/sessions/backends/signed_cookies.py
383
2895
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase from django.core import signing class SessionStore(SessionBase): def load(self): """ We load the data from the key itself instead of fetching from some external data store. Opposite of _get_sess...
bsd-3-clause
fubecka/f5-dashboard
flask/lib/python2.6/site-packages/dns/rdtypes/txtbase.py
100
2994
# Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 ...
apache-2.0
guschmue/tensorflow
tensorflow/python/kernel_tests/concatenate_dataset_op_test.py
42
5552
# 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
eneldoserrata/marcos_openerp
addons/product_container/product_container.py
1
1581
# -*- 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
bioinformatics-ua/montra
emif/questionnaire/migrations/0006_auto__chg_field_choice_value__chg_field_choice_text_en__chg_field_ques.py
2
12721
# -*- coding: utf-8 -*- # Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either vers...
gpl-3.0
cmdunkers/DeeperMind
PythonEnv/lib/python2.7/site-packages/scipy/weave/examples/fibonacci.py
100
3980
# Typical run: # C:\home\eric\wrk\scipy\weave\examples>python fibonacci.py # Recursively computing the first 30 fibonacci numbers: # speed in python: 4.31599998474 # speed in c: 0.0499999523163 # speed up: 86.32 # Looping to compute the first 30 fibonacci numbers: # speed in python: 0.000520999908447 # speed in c:...
bsd-3-clause
SGenheden/lammps
tools/moltemplate/src/postprocess_input_script.py
19
5958
#!/usr/bin/env python """ Reorder the integer arguments to the commands in a LAMMPS input file if these arguments violate LAMMPS order requirements. We have to do this because the moltemplate.sh script will automatically assign these integers in a way which may violate these restrictions and the user ...
gpl-2.0
marionleborgne/cloudbrain-websocket-server
src/cbws/server.py
2
12783
import pika import json import logging from collections import defaultdict from sockjs.tornado.conn import SockJSConnection from sockjs.tornado import SockJSRouter from tornado.ioloop import IOLoop from tornado.web import Application from uuid import uuid4 from cloudbrain.core.auth import CloudbrainAuth _LOGGER = l...
agpl-3.0
andrewyoung1991/scons
test/option/h.py
5
2083
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
mit
larsbutler/coveragepy
tests/helpers.py
2
1599
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Helpers for coverage.py tests.""" import subprocess def run_command(cmd): """Run a command in a sub-process. Returns the exit status code and the com...
apache-2.0
wskplho/sl4a
python/python-twitter/simplejson/decoder.py
135
12032
"""Implementation of JSONDecoder """ import re import sys import struct from simplejson.scanner import make_scanner try: from simplejson._speedups import scanstring as c_scanstring except ImportError: c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconst...
apache-2.0
BhallaLab/moose-examples
traub_2005/py/fig_a3.py
1
3700
# fig_a3.py --- # # Filename: fig_a3.py # Description: # Author: # Maintainer: # Created: Wed Jun 26 17:07:59 2013 (+0530) # Version: # Last-Updated: Sun Jun 25 15:09:46 2017 (-0400) # By: subha # Update #: 162 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # # Change log: #...
gpl-2.0
alsrgv/tensorflow
tensorflow/contrib/periodic_resample/__init__.py
56
1176
# ============================================================================= # 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 #...
apache-2.0
vanda/DigitalLabels
labels/management/commands/build.py
1
2432
import codecs import os from distutils.dir_util import copy_tree from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand from django.test.client import Client from django.template.defaultfilters import slugify from labels.models import DigitalLabel, Portal ...
bsd-3-clause
kpingul/shoppingWidget
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/ninja.py
372
89149
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common impo...
mit
finfish/scrapy
scrapy/spidermiddlewares/offsite.py
7
2563
""" Offsite Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import re import logging import warnings from scrapy import signals from scrapy.http import Request from scrapy.utils.httpobj import urlparse_cached logger = logging.getLogger(__name__) class OffsiteMiddleware(object): de...
bsd-3-clause
Theer108/invenio
invenio/utils/remote_debugger/__init__.py
5
10582
# This file is part of Invenio. # Copyright (C) 2011, 2013, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # ...
gpl-2.0
rodrigods/keystone
keystone/catalog/backends/sql.py
1
12218
# Copyright 2012 OpenStack Foundation # Copyright 2012 Canonical 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 b...
apache-2.0
GeorgePlukov/FloodWatch
XBee-2.2.3/xbee/tests/test_zigbee.py
27
9957
""" test_zigbee.py By Paul Malmsten, 2010 pmalmsten@gmail.com Tests the XBee ZB (ZigBee) implementation class for API compliance """ import unittest from xbee.zigbee import ZigBee class TestZigBee(unittest.TestCase): """ Tests ZigBee-specific features """ def setUp(self): self.zigbee = ZigBe...
mit
megamanfx/grit-i18n
grit/format/policy_templates/writers/android_policy_writer.py
17
3492
#!/usr/bin/env python # Copyright (c) 2015 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. from grit.format.policy_templates.writers import xml_formatted_writer from xml.dom import minidom from xml.sax import saxutils as ...
bsd-2-clause
lduarte1991/edx-platform
common/djangoapps/terrain/stubs/tests/test_youtube_stub.py
172
2639
""" Unit test for stub YouTube implementation. """ import unittest import requests from ..youtube import StubYouTubeService class StubYouTubeServiceTest(unittest.TestCase): def setUp(self): super(StubYouTubeServiceTest, self).setUp() self.server = StubYouTubeService() self.url = "http://...
agpl-3.0
gregoil/rotest
src/rotest/management/common/messages.py
1
6686
"""Holds the common resource management messages.""" from __future__ import absolute_import from abc import ABCMeta from basicstruct import BasicStruct import six def slots_extender(new_slots): """Extender decorator to add new slots to the wrapped class. Arguments: new_slots (tuple): new slots names...
mit
totalspectrum/binutils-propeller
gdb/testsuite/gdb.perf/lib/perftest/reporter.py
7
2912
# Copyright (C) 2013-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
nitzmahone/ansible
lib/ansible/module_utils/aws/waf.py
71
7415
# Copyright (c) 2017 Will Thames # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign the...
gpl-3.0
werbk/task-6.19
conftest.py
1
2403
import pytest import logging import json import jsonpickle import os.path import importlib from fixture.TestBase import BaseClass from fixture.variables import UserLogin fixture = None target = None @pytest.fixture def app(request): global fixture global target browser = request.config.getoption('--bro...
apache-2.0
gerrive/horizon
openstack_dashboard/test/test_data/heat_data.py
6
15719
# 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
Jumpscale/jumpscale6_core
apps/portalbase/wiki/Help/.macros/wiki/menuadmin_jdoc/1_menuadmin.py
2
1685
def main(j, args, params, tags, tasklet): params.merge(args) doc = params.doc tags = params.tags params.result = "" # spaces = sorted(j.core.portal.active.getSpaces()) # spacestxt="" # for item in spaces: # if item[0] != "_" and item.strip() != "" and item.find("space_system")==...
bsd-2-clause
anthonypdawson/LazyLibrarian
lazylibrarian/providers.py
1
4430
import time, threading, urllib, urllib2, re from xml.etree import ElementTree import lazylibrarian from lazylibrarian import logger, SimpleCache def NewzNab(book=None): HOST = lazylibrarian.NEWZNAB_HOST results = [] logger.info('Searching for %s.' % book['searchterm']) if lazylibrarian.EBOOK_TYP...
gpl-3.0
geodrinx/gearthview
ext-libs/twisted/internet/_utilspy3.py
4
1916
# -*- test-case-name: twisted.internet.test.test_utilspy3 -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Utility methods, ported to Python 3. """ from __future__ import division, absolute_import import sys, warnings from functools import wraps from twisted.python.compat import rerai...
gpl-3.0
maestro-hybrid-cloud/horizon
openstack_dashboard/dashboards/identity/domains/views.py
55
3604
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 requir...
apache-2.0
abhattad4/Digi-Menu
digimenu2/tests/foreign_object/tests.py
113
18071
import datetime from operator import attrgetter from django import forms from django.core.exceptions import FieldError from django.test import TestCase, skipUnlessDBFeature from django.utils import translation from .models import ( Article, ArticleIdea, ArticleTag, ArticleTranslation, Country, Friendship, Gro...
bsd-3-clause
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/v8/tools/testrunner/objects/testcase.py
5
4522
# 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...
gpl-3.0
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/_pytest/helpconfig.py
180
5120
""" version info, help messages, tracing configuration. """ import py import pytest import os, sys def pytest_addoption(parser): group = parser.getgroup('debugconfig') group.addoption('--version', action="store_true", help="display pytest lib version and import information.") group._addoption(...
mit
anu7495/airmozilla
airmozilla/manage/tests/test_helpers.py
5
2690
import datetime import time import jinja2 from nose.tools import ok_, eq_ from django.test import TestCase from airmozilla.main.models import Event from airmozilla.manage.helpers import ( almost_equal, event_status_to_css_label, format_message, formatduration, ) class TestAlmostEqual(TestCase): ...
bsd-3-clause
DigiThinkIT/stem
stem/response/authchallenge.py
5
1910
# Copyright 2012-2014, Damian Johnson and The Tor Project # See LICENSE for licensing information import binascii import stem.response import stem.socket import stem.util.str_tools import stem.util.tor_tools class AuthChallengeResponse(stem.response.ControlMessage): """ AUTHCHALLENGE query response. :var str...
lgpl-3.0
w1ll1am23/home-assistant
homeassistant/components/vesync/switch.py
5
3299
"""Support for VeSync switches.""" import logging from homeassistant.components.switch import SwitchEntity from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from .common import VeSyncDevice from .const import DOMAIN, VS_DISCOVERY, VS_DISPATCHERS, VS_SWITCHES...
apache-2.0
KaranToor/MA450
google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/apis/compute/alpha/compute_alpha_client.py
2
425195
"""Generated client library for compute version alpha.""" # NOTE: This file is autogenerated and should not be edited by hand. from apitools.base.py import base_api from googlecloudsdk.third_party.apis.compute.alpha import compute_alpha_messages as messages class ComputeAlpha(base_api.BaseApiClient): """Generated c...
apache-2.0
pgmillon/ansible
lib/ansible/modules/crypto/acme/acme_inspect.py
20
12317
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018 Felix Fontein (@felixfontein) # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
antamb/google-personal-assistant
src/actionbase.py
2
2216
# Copyright 2017 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
mffrench/fabric
bddtests/steps/docgen.py
5
13747
# Copyright IBM Corp. 2016 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 ag...
apache-2.0
martynovp/edx-platform
common/test/acceptance/tests/studio/test_studio_acid_xblock.py
130
6909
""" Acceptance tests for Studio related to the acid xblock. """ from bok_choy.web_app_test import WebAppTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.studio.overview import CourseOutlinePage from ...pages.xblock.acid import AcidView from ...fixtures.course import CourseFixture, XBlockFixtureDes...
agpl-3.0
rasata/ansible
lib/ansible/plugins/filter/core.py
10
9635
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
apark263/tensorflow
tensorflow/python/keras/optimizer_v2/ftrl_test.py
13
17873
# 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
muffinresearch/olympia
scripts/siege.py
24
2862
""" A script for generating siege files with a bunch of URL variations. """ import re import sys part_re = re.compile(r'\{([-\w]+)\}') AMO_LANGUAGES = ( 'af', 'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-US', 'es', 'eu', 'fa', 'fi', 'fr', 'ga-IE', 'he', 'hu', 'id', 'it', 'ja', 'ko', 'mn', 'nl', 'pl', 'pt-BR', ...
bsd-3-clause
fredericgermain/linux-sunxi
tools/perf/util/setup.py
989
1543
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
ritchiewilson/majormajor
tests/majormajor_tests/test_majormajor_helpers.py
1
1120
# MajorMajor - Collaborative Document Editing Library # Copyright (C) 2013 Ritchie Wilson # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
gpl-3.0
yilei0620/3D_Conditional_Gan
lib/data_utils.py
1
1596
import numpy as np from sklearn import utils as skutils from rng import np_rng, py_rng def center_crop(x, ph, pw=None): if pw is None: pw = ph h, w = x.shape[:2] j = int(round((h - ph)/2.)) i = int(round((w - pw)/2.)) return x[j:j+ph, i:i+pw] def patch(x, ph, pw=None): if pw is None: ...
mit
Changaco/oh-mainline
vendor/packages/scrapy/scrapy/utils/project.py
19
1474
from os.path import join, dirname, abspath, isabs, exists from os import makedirs, environ import warnings from scrapy.utils.conf import closest_scrapy_cfg, get_config from scrapy.utils.python import is_writable from scrapy.exceptions import NotConfigured DATADIR_CFG_SECTION = 'datadir' def inside_project(): scr...
agpl-3.0
Worldify/Worldify
worldify/config.py
1
1709
import os from ConfigParser import ConfigParser from .exceptions import WorldifyConfigException class WorldifyConfig(object): def __init__(self): self._config_path = os.path.expanduser("~/.worldify") self.conf = ConfigParser() self.conf.read(self._config_path) self._check_config_...
gpl-3.0
dkodnik/arp
addons/portal_project/tests/__init__.py
170
1124
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
agrista/odoo-saas
addons/base_geolocalize/models/res_partner.py
239
3743
# -*- 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
sogis/Quantum-GIS
python/ext-libs/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 '<', '<=', '=', '>', '>=', '-', '...
gpl-2.0
Softmotions/edx-platform
lms/djangoapps/survey/models.py
89
8631
""" Models to support Course Surveys feature """ import logging from lxml import etree from collections import OrderedDict from django.db import models from student.models import User from django.core.exceptions import ValidationError from model_utils.models import TimeStampedModel from survey.exceptions import Surv...
agpl-3.0
ebrelsford/v2v
vacant_to_vibrant/steward/migrations/0007_auto__add_field_stewardproject_external_id.py
1
10857
# -*- 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 'StewardProject.external_id' db.add_column(u'steward_stewardproject', 'external_id', ...
gpl-3.0
win0x86/Lab
mitm/libmproxy/proxy.py
1
24823
import sys, os, string, socket, time import shutil, tempfile, threading import SocketServer from OpenSSL import SSL from netlib import odict, tcp, http, wsgi, certutils, http_status, http_auth import utils, flow, version, platform, controller KILL = 0 class ProxyError(Exception): def __init__(self, code, msg, h...
gpl-3.0
yesbox/ansible
lib/ansible/cli/playbook.py
21
9325
#!/usr/bin/env python # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
gpl-3.0
dimagi/rapidsms-contrib-apps-dev
handlers/tests.py
1
1655
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from nose.tools import assert_equal from rapidsms.conf import settings from .utils import get_handlers def test_get_handlers(): # store current settings. _settings = ( settings.INSTALLED_APPS, settings.INSTALLED_HANDLERS, settings.E...
bsd-3-clause
martatolos/DemandAnalysis
visualizations.py
1
5518
# Plots import matplotlib.pyplot as plt import matplotlib import numpy as np import re import random def plot_several_countries(df, ylabel, title, country_list="", save=False, num="", xticks_hourly=False, kind='bar', linestyle='-', color='mbygcr', marker='o', linewidth=4.0, fontsize=16, legend=True): """ This...
gpl-2.0
MrSenko/Nitrate
tcms/testruns/urls/run_urls.py
1
1045
# -*- coding: utf-8 -*- from django.conf.urls import url, patterns from tcms.testruns.views import TestRunReportView from tcms.testruns.views import AddCasesToRunView urlpatterns = patterns( 'tcms.testruns.views', url(r'^new/$', 'new'), url(r'^(?P<run_id>\d+)/$', 'get'), url(r'^(?P<run_id>\d+)/clone/...
gpl-2.0
Shaps/ansible
test/units/module_utils/common/test_collections.py
39
5024
# -*- coding: utf-8 -*- # Copyright (c) 2018–2019, Sviatoslav Sydorenko <webknjaz@redhat.com> # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) """Test low-level utility functions from ``module_utils.common.collections``.""" from __future__ import absolute_impor...
gpl-3.0
gqwest-erp/server
openerp/addons/purchase_analytic_plans/__init__.py
441
1220
# -*- 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...
agpl-3.0
mxia/engine
build/android/gyp/create_java_binary_script.py
26
2379
#!/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. """Creates a simple script to run a java "binary". This creates a script that sets up the java command line for running a java jar. ...
bsd-3-clause