repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
adobe-flash/avmplus
gtest/gtest-1.6.0/test/gtest_test_utils.py
397
10437
#!/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...
mpl-2.0
WilsonWangTHU/neural_graph_evolution
graph_util/structure_mapper.py
1
7819
#!/usr/bin/env python2 # ----------------------------------------------------------------------------- # @author: # Tingwu Wang, Jun 23rd, 2017 # ----------------------------------------------------------------------------- import init_path from util import logger from . import mujoco_parser import numpy as n...
mit
Hexxeh/libpebble
pebble.py
2
5610
#!/usr/bin/env python import argparse import logging import sys import pebble.PblAnalytics as PblAnalytics # Catch any missing python dependencies so we can send an event to analytics try: import pebble as libpebble from pebble.PblProjectCreator import (PblProjectCreator, ...
mit
djangorussia/django-1.3-branch
django/contrib/localflavor/ar/forms.py
309
3903
# -*- coding: utf-8 -*- """ AR-specific Form helpers. """ from django.forms import ValidationError from django.core.validators import EMPTY_VALUES from django.forms.fields import RegexField, CharField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ class...
bsd-3-clause
vitordeatorreao/amproj
amproj/datasets/dataset.py
1
3520
"""Base class for a memory representation of any dataset""" class Dataset: """Represents a dataset read to memory""" def __init__(self, feature_names=[]): """Initializes a new instance of Dataset Parameters ---------- feature_names : list<str>, optional List of na...
gpl-2.0
yuanzhao/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/walsender/test_negative.py
12
5278
#!/usr/bin/env python """ Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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...
apache-2.0
Drooids/odoo
openerp/addons/base/tests/test_orm.py
149
18110
from collections import defaultdict from openerp.tools import mute_logger from openerp.tests import common UID = common.ADMIN_USER_ID class TestORM(common.TransactionCase): """ test special behaviors of ORM CRUD functions TODO: use real Exceptions types instead of Exception """ def setUp(self):...
agpl-3.0
E3V3A/libqmi
build-aux/qmi-codegen/VariableSequence.py
4
7537
#!/usr/bin/env python # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2 of the License, or ...
gpl-2.0
jhaus/pinax
pinax/apps/signup_codes/tests/test_invite_user.py
5
4347
import datetime import os from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase from django.utils.hashcompat import sha_constructor import signup_codes from signup_codes.models import SignupCode class InviteUserTes...
mit
hezuoguang/ZGVL
WLServer/site-packages/django/templatetags/i18n.py
114
17255
from __future__ import unicode_literals import re import sys from django.conf import settings from django.template import (Node, Variable, TemplateSyntaxError, TokenParser, Library, TOKEN_TEXT, TOKEN_VAR) from django.template.base import render_value_in_context from django.template.defaulttags import token_kwargs ...
apache-2.0
biodrone/plex-desk
desk/flask/lib/python3.4/site-packages/werkzeug/wsgi.py
147
37837
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import sys import posixpath import mimetypes from itert...
mit
mrquim/repository.mrquim
script.xbmcbackup/resources/lib/dropbox/session.py
4
1770
import pkg_resources import os import ssl import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.poolmanager import PoolManager API_DOMAIN = os.environ.get('DROPBOX_API_DOMAIN', os.environ.get('DROPBOX_DOMAIN', '.dropboxapi.com')) WEB_DOMAIN = os.environ.get('DROPBOX_WEB_DOMAIN'...
gpl-2.0
yrchen/configuration
util/vpc-tools/vpc-tools.py
57
7153
"""VPC Tools. Usage: vpc-tools.py ssh-config (vpc <vpc_id> | stack-name <stack_name>) [(identity-file <identity_file>)] user <user> [(config-file <config_file>)] [(strict-host-check <strict_host_check>)] [(jump-box <jump_box>)] vpc-tools.py (-h --help) vpc-tools.py (-v --version) Options: -h --help ...
agpl-3.0
routeflow/AutomaticConfigurationRouteFlow
pox/pox.py
22
1362
#!/bin/sh - # Copyright 2011-2012 James McCauley # # This file is part of POX. # # POX is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
apache-2.0
hdinsight/hue
desktop/core/ext-py/simplejson/simplejson/__init__.py
448
12463
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
apache-2.0
back-to/streamlink
tests/plugins/test_artetv.py
7
2132
import unittest from streamlink.plugins.artetv import ArteTV class TestPluginArteTV(unittest.TestCase): def test_can_handle_url(self): # should match # new url self.assertTrue(ArteTV.can_handle_url("http://www.arte.tv/fr/direct/")) self.assertTrue(ArteTV.can_handle_url("http://www...
bsd-2-clause
elettronicagf/kernel-am335x
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
kevinmel2000/brython
www/src/Lib/test/unittests/test_code_module.py
32
2478
"Test InteractiveConsole and InteractiveInterpreter from code module" import sys import unittest from contextlib import ExitStack from unittest import mock from test import support code = support.import_module('code') class TestInteractiveConsole(unittest.TestCase): def setUp(self): self.console = code....
bsd-3-clause
commtrack/commtrack-core
apps/commtrack_calendar/controller.py
2
5041
import eventCalBase from resources.models import * import calendar class CalendarController(object): """Controller object for calendar""" def __init__(self, day=1,q=0): """owner - owner of this calendar, day - day to shown""" calendar.setfirstweekday(calendar.SUNDAY) self.area = q ...
bsd-3-clause
lmorchard/badger
apps/socialconnect/views.py
1
12314
import urllib, urllib2 import cgi import os from django.conf import settings from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth import login, authenticate, REDIRECT_FIELD_NAME from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext ...
bsd-3-clause
napalm-automation/napalm
test/ios/TestIOSDriver.py
1
6582
# Copyright 2015 Spotify AB. All rights reserved. # # The contents of this file are licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
bottompawn/kbengine
kbe/res/scripts/common/Lib/test/test_syslog.py
84
1227
from test import support syslog = support.import_module("syslog") #skip if not supported import unittest # XXX(nnorwitz): This test sucks. I don't know of a platform independent way # to verify that the messages were really logged. # The only purpose of this test is to verify the code doesn't crash or leak. class T...
lgpl-3.0
sudosurootdev/external_chromium_org
build/android/pylib/utils/flakiness_dashboard_results_uploader.py
37
6629
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Uploads the results to the flakiness dashboard server.""" # pylint: disable=E1002,R0201 import logging import os import shutil import tempfile import...
bsd-3-clause
tao12345666333/tornado-zh
tornado/test/concurrent_test.py
122
13390
#!/usr/bin/env python # # Copyright 2012 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
mit
emulbreh/vacuous
vacuous/backends/dulwich/tasks.py
1
1530
from StringIO import StringIO from celery.task import Task from celery.task.sets import TaskSet, subtask from dulwich.protocol import ReceivableProtocol from dulwich.server import ReceivePackHandler from vacuous.backends import load_backend from vacuous.backends.dulwich.utils import WebBackend from vacuous.tasks imp...
mit
vrenaville/partner-contact
base_location_geonames_import/__init__.py
35
1071
# -*- encoding: utf-8 -*- ############################################################################## # # Base Location Geonames Import module for OpenERP # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: y...
agpl-3.0
ltilve/ChromiumGStreamerBackend
tools/telemetry/third_party/webpagereplay/third_party/dns/rdtypes/ANY/GPOS.py
248
5304
# Copyright (C) 2003-2007, 2009, 2010 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 ...
bsd-3-clause
lecaoquochung/ddnb.django
tests/admin_inlines/tests.py
10
41676
from __future__ import unicode_literals from django.contrib.admin import TabularInline, ModelAdmin from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.contrib.admin.helpers import InlineAdminForm from django.contrib.auth.models import User, Permission from django.contrib.contenttypes.mode...
bsd-3-clause
nextml/NEXT
next/assistant/target_unpacker.py
2
4922
import zipfile import io import os from joblib import Parallel, delayed from StringIO import StringIO import base64 import random import sys import json from collections import OrderedDict if __name__ == "__main__": sys.path.append('../..') import next.utils as utils import next.assistant.s3 as s3 def zipfile_t...
apache-2.0
h3biomed/ansible
lib/ansible/modules/storage/netapp/na_ontap_quotas.py
4
12796
#!/usr/bin/python # (c) 2018-2019, NetApp, Inc # 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', 'status': ['preview'],...
gpl-3.0
thaim/ansible
lib/ansible/modules/cloud/vmware/vmware_dvswitch_lacp.py
23
18111
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de> # # 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 = { 'met...
mit
hashimmm/iiifoo
testutils/manifest_validator.py
1
3963
from testutils.presentation_api.implementations.manifest_factory.loader import \ ManifestReader from iiifoo_utils import image_id_from_canvas_id def validate(manifestjson, logger=None): """Validate a given manifest json object.""" mr = ManifestReader(manifestjson) try: r = mr.read() js...
mit
p0psicles/SickRage
sickbeard/notifiers/telegram.py
2
6550
# coding=utf-8 # Author: Marvin Pinto <me@marvinp.ca> # Author: Dennis Lutter <lad1337@gmail.com> # Author: Aaron Bieber <deftly@gmail.com> # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pu...
gpl-3.0
arush0311/scrapy
tests/test_utils_spider.py
147
1056
import unittest from scrapy.http import Request from scrapy.item import BaseItem from scrapy.utils.spider import iterate_spider_output, iter_spider_classes from scrapy.spiders import CrawlSpider class MyBaseSpider(CrawlSpider): pass # abstract spider class MySpider1(MyBaseSpider): name = 'myspider1' class ...
bsd-3-clause
gingergeeks/pyslurm
examples/stats.py
2
1513
#!/usr/bin/env python """ Display Slurm statistics """ from __future__ import print_function import pyslurm def display(stats_dict): """Format output""" if stats_dict: print("{0:*^80}".format(" Slurm Controller Statistics ")) for key, value in stats_dict.items(): if key in ["bf_wh...
gpl-2.0
rgeleta/odoo
addons/marketing_campaign/report/__init__.py
441
1071
# -*- 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
radicalbit/ambari
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
1
23158
#!/usr/bin/env python """ 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");...
apache-2.0
sve-odoo/odoo
addons/account/account_move_line.py
12
72229
# -*- 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
seanchen/taiga-back
taiga/users/serializers.py
1
5786
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
agpl-3.0
hilaskis/UAV_MissionPlanner
Lib/site-packages/numpy/f2py/capi_maps.py
51
29016
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" """ Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED...
gpl-2.0
iongchun/p2pool
p2pool/util/logging.py
287
2995
import codecs import datetime import os import sys from twisted.python import log class EncodeReplacerPipe(object): def __init__(self, inner_file): self.inner_file = inner_file self.softspace = 0 def write(self, data): if isinstance(data, unicode): try: data...
gpl-3.0
JS-Wang/ONL
components/all/vendor-config/onl/src/python/onl/platform/current.py
9
1523
#!/usr/bin/python ############################################################ # <bsn.cl fy=2013 v=onl> # # Copyright 2013, 2014 Big Switch Networks, Inc. # # Licensed under the Eclipse Public License, Version 1.0 (the # "License"); you may not use this file except in compliance # with the License. You ...
epl-1.0
varuntiwari27/rally
tests/unit/deployment/serverprovider/providers/test_cobbler.py
9
4099
# 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
abhijeet9920/python_project
develop/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py
360
10664
from __future__ import absolute_import import time import logging from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, ) from ..packages import six log = logging.getLogger(__name__) class Retry(object): """ Retry configuration. ...
mit
t0mk/ansible
test/runner/lib/delegation.py
5
11279
"""Delegate test execution to another environment.""" from __future__ import absolute_import, print_function import os import sys import time import lib.pytar import lib.thread from lib.executor import ( SUPPORTED_PYTHON_VERSIONS, IntegrationConfig, SubprocessError, ShellConfig, SanityConfig, ...
gpl-3.0
nitzmahone/ansible
lib/ansible/plugins/connection/network_cli.py
5
22625
# (c) 2016 Red Hat Inc. # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ --- author: Ansible Networking Team connection: network_cli short_...
gpl-3.0
ocadotechnology/boto
boto/opsworks/layer1.py
132
129869
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
mit
FireBladeNooT/Medusa_1_6
medusa/notifiers/plex.py
1
10632
# coding=utf-8 # Author: Dustyn Gibson <miigotu@gmail.com> # # This file is part of Medusa. # # Medusa 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) a...
gpl-3.0
jakobharlan/avango
attic/avango-osg/python/avango/osg/viewer/__init__.py
6
1633
# -*- Mode:Python -*- ########################################################################## # # # This file is part of AVANGO. # # ...
lgpl-3.0
bousmalis/models
syntaxnet/dragnn/python/sentence_io_test.py
12
2856
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
MarketGarden/CardPublisher
cardpublisher/views/abstractviews.py
1
2758
# -*- coding: cp1252 -*- from PyQt4 import QtCore, QtGui import os import os.path models = None class AbstractFormView: """gère le cycle de vie de sauvegarde d'un formulaire""" def __init__(self): self.saved = True self.saveAction.clicked.connect(self.doSave) def closeEvent(sel...
gpl-3.0
ferabra/edx-platform
lms/djangoapps/shoppingcart/migrations/0008_auto__add_coupons__add_couponredemption__chg_field_certificateitem_cou.py
114
14159
# -*- 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 model 'Coupons' db.create_table('shoppingcart_coupons', ( ('id', self.gf('django.db.mod...
agpl-3.0
davidzchen/tensorflow
tensorflow/python/training/adagrad.py
21
5161
# 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
QualiSystems/shellfoundry
shellfoundry/commands/extend_command.py
1
6915
#!/usr/bin/python # -*- coding: utf-8 -*- import os import re import shutil import click from shellfoundry.exceptions import VersionRequestException from shellfoundry.utilities.config_reader import CloudShellConfigReader, Configuration from shellfoundry.utilities.constants import ( METADATA_AUTHOR_FIELD, TEM...
apache-2.0
rougier/dana
examples/oja.py
1
3086
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright INRIA # Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr) # # DANA is a computing framework for the simulation of distributed, # asynchronous, numerical and adaptive models...
bsd-3-clause
seann1/portfolio5
.meteor/dev_bundle/python/Lib/fpformat.py
322
4699
"""General floating point formatting functions. Functions: fix(x, digits_behind) sci(x, digits_behind) Each takes a number or a string and a number of digits as arguments. Parameters: x: number to be formatted; or a string resembling a number digits_behind: number of digits behind the decimal point """ f...
gpl-2.0
libsvm/libsvm
python/svmutil.py
64
8695
#!/usr/bin/env python import os import sys from svm import * from svm import __all__ as svm_all __all__ = ['evaluations', 'svm_load_model', 'svm_predict', 'svm_read_problem', 'svm_save_model', 'svm_train'] + svm_all sys.path = [os.path.dirname(os.path.abspath(__file__))] + sys.path def svm_read_problem(...
bsd-3-clause
yuifan/pexus4_external_chromium
testing/gtest/scripts/upload_gtest.py
1963
2851
#!/usr/bin/env python # # Copyright 2009, 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
ar4s/django
tests/generic_views/models.py
111
1276
from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Artist(models.Model): name = models.CharField(max_length=100) class Meta: ordering = ['name'] verbose_name = 'professional...
bsd-3-clause
agry/NGECore2
scripts/mobiles/dantooine/mokk_hunter.py
2
1711
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
lgpl-3.0
snnn/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/models/hard_decisions_to_data_then_nn.py
189
2852
# 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
alexlo03/ansible
lib/ansible/modules/windows/win_hostname.py
27
1270
#!/usr/bin/python # -*- coding: utf-8 -*- # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name # Copyright: (c) 2018, Ripon Banik (@riponbanik) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version'...
gpl-3.0
alxgu/ansible
lib/ansible/modules/network/fortios/fortios_system_accprofile.py
21
28235
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
ideascube/pibox-installer
kiwix-hotspot/backend/util.py
1
15466
# -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu import os import re import sys import time import shlex import signal import ctypes import tempfile import threading import subprocess import data from util import CLILogger # windows-only flags to prevent sleep on executing thread WINDOWS_SLEEP_FLAGS = { ...
gpl-3.0
Brett777/Predict-Churn
model_management/datascience_framework.py
1
8515
import os import io import sys import dill import copy from datetime import datetime from .evaluator import Evaluator from .utils import ( post_to_platform, get_current_notebook, strip_output, get_current_notebook, mkdir_p, ) class DataScienceFramework(object): def __init__( self, ...
mit
Ultimaker/Cura
tests/PrinterOutput/Models/TestPrinterConfigurationModel.py
3
1417
from unittest.mock import MagicMock import pytest from cura.PrinterOutput.Models.PrinterConfigurationModel import PrinterConfigurationModel from cura.PrinterOutput.Models.ExtruderConfigurationModel import ExtruderConfigurationModel test_validate_data_get_set = [ {"attribute": "extruderConfigurations", "value":...
lgpl-3.0
SebWouters/CheMPS2
PyCheMPS2/tests/test12.py
1
3497
# # CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry # Copyright (C) 2013-2018 Sebastian Wouters # # 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 ...
gpl-2.0
kevinastone/sentry
tests/sentry/api/endpoints/test_organization_member_team_details.py
23
8731
from __future__ import absolute_import from django.core import mail from django.core.urlresolvers import reverse from sentry.models import ( Organization, OrganizationAccessRequest, OrganizationMemberTeam, OrganizationMemberType ) from sentry.testutils import APITestCase class CreateOrganizationMemberTeamTe...
bsd-3-clause
jinjiaho/project57
forms.py
1
3372
from flask_wtf import FlaskForm from flask_wtf.file import FileField, FileAllowed, FileRequired from wtforms import StringField, PasswordField, SubmitField, RadioField, validators, IntegerField, SelectField, BooleanField,DecimalField from wtforms.validators import DataRequired, Email, Length from flaskext.mysql import ...
mit
catapult-project/catapult
third_party/google-endpoints/setuptools/command/install.py
529
4683
from distutils.errors import DistutilsArgError import inspect import glob import warnings import platform import distutils.command.install as orig import setuptools # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://github.com/pypa/setuptools/issues/199/ _install = orig.in...
bsd-3-clause
vovanbo/django-oscar
tests/integration/catalogue/reviews/model_tests.py
35
4527
from django.test import TestCase from django.core.exceptions import ValidationError from oscar.core.compat import get_user_model from oscar.apps.catalogue.reviews import models from oscar.test.factories import create_product from oscar.test.factories import UserFactory User = get_user_model() class TestAnAnonymousR...
bsd-3-clause
Wangyao14cyy/ucore_lab
related_info/ostep/ostep13-vsfs.py
54
17070
#! /usr/bin/env python import random from optparse import OptionParser DEBUG = False def dprint(str): if DEBUG: print str printOps = True printState = True printFinal = True class bitmap: def __init__(self, size): self.size = size self.bmap = [] for num in range(s...
gpl-2.0
kristohr/pybayenv2
pybayenv/compute_average_bf.py
1
4066
#!/usr/bin/python import sys, string, re, os, commands, time, math #from scipy import stats #import scipy as sp import numpy as np #import matplotlib as mpl #from matplotlib import pyplot as plt class SNP: def __init__(self, name, num_env, t): self.name = name self.num_env = [F...
bsd-3-clause
cloudera/hue
desktop/core/ext-py/cx_Oracle-6.4.1/test/Connection.py
2
16807
#------------------------------------------------------------------------------ # Copyright 2016, 2017, Oracle and/or its affiliates. All rights reserved. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # # Portions Copyright 2001-2007, Computronix (Canada) Ltd., Edmonton, Alberta, # Canada. Al...
apache-2.0
NewpTone/stacklab-nova
nova/tests/test_volume.py
6
36376
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
SunguckLee/MariaDB-PageCompression
storage/tokudb/mysql-test/tokudb/t/change_column_bin_rename.py
56
1565
#!/usr/bin/env python import sys def gen_test(n): print "CREATE TABLE t (a BINARY(%d));" % (n) for v in [ 'hi', 'there', 'people' ]: print "INSERT INTO t VALUES ('%s');" % (v) for i in range(2,256): if i != n: # if i < n: print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" ...
gpl-2.0
Sing-Li/go-buildpack
builds/runtimes/python-2.7.6/lib/python2.7/lib2to3/pgen2/driver.py
212
5164
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Modifications: # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Parser driver. This provides a high-level interface to parse a file into a synta...
mit
FHannes/intellij-community
python/testData/inspections/PyTypeCheckerInspection/GenericUserFunctions.py
7
1064
def test(): def f1(xs): """ :type xs: collections.Iterable of T """ return iter(xs).next() def f2(x, xs, z): """ :type x: T :type xs: list of T :type z: U """ return x in xs def id(x): """ :type x: T :r...
apache-2.0
gdg-garage/knihovna-db
knihovna-server/third_party/gflags/tests/gflags_helpxml_test.py
139
20061
#!/usr/bin/env python # Copyright (c) 2009, 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 l...
mit
garverp/gnuradio
docs/sphinx/hieroglyph/hieroglyph.py
72
12634
from __future__ import print_function import re from errors import HieroglyphError from nodes import (Node, Raises, Except, Note, Warning, Returns, Arg, ensure_terminal_blank) __author__ = 'Robert Smallshire' def parse_hieroglyph_text(lines): '''Parse text in hieroglyph format and return a re...
gpl-3.0
Kubuxu/cjdns
node_build/dependencies/libuv/build/gyp/test/actions/gyptest-all.py
47
3692
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies simple actions when using an explicit build target of 'all'. """ import glob import os import TestGyp test = TestGyp.TestGyp(...
gpl-3.0
thenakliman/nirikshak
nirikshak/post_task/console.py
1
2103
# Copyright 2017 <thenakliman@gmail.com> # # 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...
apache-2.0
BobBall/sm
drivers/FileSR.py
2
36921
#!/usr/bin/env python # # Copyright (C) Citrix Systems Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; version 2.1 only. # # This program is distributed in the hope that it will ...
lgpl-2.1
GustavoRD78/78Kernel-MOB31E.Z1.3657
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
direvus/ansible
lib/ansible/modules/windows/win_domain_membership.py
52
3115
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'core'} DOCUMENTATI...
gpl-3.0
mbernasocchi/QGIS
tests/src/python/test_qgspoint.py
29
3554
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsPoint. .. note:: 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 2 of the License, or (at your option) any later version. """ __author...
gpl-2.0
haxoza/django
django/db/migrations/migration.py
326
8023
from __future__ import unicode_literals from django.db.transaction import atomic from django.utils.encoding import python_2_unicode_compatible from .exceptions import IrreversibleError @python_2_unicode_compatible class Migration(object): """ The base class for all migrations. Migration files will impo...
bsd-3-clause
inspirehep/invenio
modules/bibformat/lib/elements/bfe_comments.py
29
2365
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 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 ## Licens...
gpl-2.0
hkupty/python-mode
pymode/libs3/rope/base/history.py
115
8654
from rope.base import exceptions, change, taskhandle class History(object): """A class that holds project history""" def __init__(self, project, maxundos=None): self.project = project self._undo_list = [] self._redo_list = [] self._maxundos = maxundos self._load_histor...
lgpl-3.0
karthik-sethuraman/ONFOpenTransport
RI/flask_server/tapi_server/models/tapi_common_capacity.py
4
2955
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from tapi_server.models.base_model_ import Model from tapi_server.models.tapi_common_bandwidth_profile import TapiCommonBandwidthProfile # noqa: F401,E501 from tapi_se...
apache-2.0
kobejean/tensorflow
tensorflow/python/kernel_tests/pool_test.py
24
14407
# 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
anilmuthineni/tensorflow
tensorflow/python/layers/utils_test.py
29
2461
# 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
liyitest/rr
openstack_dashboard/dashboards/project/volumes/snapshots/forms.py
72
1841
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
matematik7/STM
tests/test_parser.py
1
6119
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # ---------------------------------------------------------------- # tests/test_parser.py # # Test input arguments parser # ---------------------------------------------------------------- # copyright (c) 2015 - Domen Ipavec # Distributed under The MIT License, see LICENS...
mit
Clinical-Genomics/housekeeper
tests/test_date.py
1
2661
"""Tests for date parsing module""" import datetime import pytest from housekeeper.date import get_date, match_date def test_match_date_dash(): """Test to match common string formated date""" # GIVEN a datestring separated by '-' date_str = "2015-05-10" # WHEN checking if it is a valid datestring ...
mit
mbauskar/omnitech-demo-frappe
frappe/build.py
6
5414
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from frappe.utils.minify import JavascriptMinify """ Build the `public` folders and setup languages """ import os, frappe, json, shutil, re # from cssmin import cssmin app_pat...
mit
WesleyyC/Novels-Punctuation
pdfminer/pdfminer/layout.py
7
21586
#!/usr/bin/env python from .utils import INF from .utils import Plane from .utils import get_bound from .utils import uniq from .utils import csort from .utils import fsplit from .utils import bbox2str from .utils import matrix2str from .utils import apply_matrix_pt ## IndexAssigner ## class IndexAssigner(object): ...
mit
mabdi/zaproxy
python/api/src/zapv2/pnh.py
16
3031
# Zed Attack Proxy (ZAP) and its related class files. # # ZAP is an HTTP/HTTPS proxy for assessing web application security. # # Copyright 2015 the ZAP development team # # 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...
apache-2.0
ContinuumIO/numpy
numpy/ma/tests/test_regression.py
35
2602
from __future__ import division, absolute_import, print_function import warnings import numpy as np from numpy.testing import (assert_, TestCase, assert_array_equal, assert_allclose, run_module_suite, suppress_warnings) from numpy.compat import sixu rlevel = 1 ...
bsd-3-clause
ciudadanointeligente/write-it
nuntium/user_section/views.py
1
24845
import requests from django.contrib.auth.decorators import login_required from subdomains.utils import reverse from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404 from django.utils.decorators import method_decorator from django.views.generic import TemplateView, CreateView, Det...
gpl-3.0