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
attilahorvath/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/profiler_unittest.py
124
5111
# Copyright (C) 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
alexcritschristoph/CircMG
classify.py
4
5634
''' Alex Crits-Christoph License: GPL3 Classifies viral metagenomic contigs using a random forest classifier built on public datasets. ''' import sys import numpy import subprocess import os import cPickle as pickle from sklearn.ensemble import RandomForestClassifier from collections import defaultdict import os.path ...
gpl-2.0
mplewis/verilive-server
ivernetp/parsers.py
2
7394
from .ivl_structures import IvlModule, IvlPort from .ivl_elabs import IvlElabNetPartSelect, IvlElabPosedge, IvlElabLogic from .ivl_enums import IvlElabType, IvlPortType, IvlDataDirection from .utils import leading_spaces, is_local_finder, group_lines import re # Used to lookup enum types from strings ELAB_TYPE_LOOKUP...
mit
wolfdale/NSFW-ImageScanner
Test.py
1
1366
from PIL import Image THRESHOLD = 0.5 def main(): im=Image.open('Input_Image.jpg') ycbcr_image = Image.new('RGB', im.size, 'black') ycbcr=convert_to_ycbcr(im) ''' pix=ycbcr_image.load() for i in range(0, im.size[0]): for j in range(0, im.size[1]): ...
mit
dsajkl/123
common/djangoapps/student/migrations/0018_auto.py
188
10521
# -*- 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 index on 'CourseEnrollment', fields ['created'] db.create_index('student_courseenrollment', ['creat...
agpl-3.0
Adnn/django
tests/gis_tests/test_geoforms.py
292
14830
from unittest import skipUnless from django.contrib.gis import forms from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import GEOSGeometry from django.forms import ValidationError from django.test import SimpleTestCase, skipUnlessDBFeature from django.utils import six from django.utils.html imp...
bsd-3-clause
nightjean/Deep-Learning
tensorflow/python/ops/functional_ops.py
74
23664
# 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
tomhenderson/ns-3-dev-testing
bindings/python/ns3modulegen_core_customizations.py
41
18881
from __future__ import print_function import sys import re from pybindgen.typehandlers import base as typehandlers from pybindgen import ReturnValue, Parameter from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper from pybindgen.typehandlers.codesink import MemoryCodeSink from pybindgen.t...
gpl-2.0
hnoerdli/hussa
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
10366
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
mit
prisis/sublime-text-packages
Packages/anaconda_php/plugin/handlers_php/commands/php_cs_fixer.py
3
1841
# Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org> # This program is Free Software see LICENSE file for details import os import sys import logging import traceback import subprocess from commands.base import Command from process import spawn PIPE = subprocess.PIPE class PHPCSFixer(Command): "...
mit
Thraxis/SickRage
lib/sqlalchemy/testing/suite/test_sequence.py
76
3770
from .. import fixtures, config from ..config import requirements from ..assertions import eq_ from ... import testing from ... import Integer, String, Sequence, schema from ..schema import Table, Column class SequenceTest(fixtures.TablesTest): __requires__ = ('sequences',) __backend__ = True run_create...
gpl-3.0
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/amount_v30_rc1.py
1
3888
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
mit
mark-adams/django-socialregistration
socialregistration/contrib/facebook/client.py
8
1296
from django.conf import settings from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from socialregistration.clients.oauth import OAuth2 from socialregistration.settings import SESSION_KEY import json import facebook class Facebook(OAuth2): client_id = getattr(settings, 'FACEB...
mit
Tesla-Redux-Devices/hells-Core-N6
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
stopstalk/stopstalk-deployment
private/scripts/extras/backfill_problem_id.py
1
1859
""" Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk 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
lsqtongxin/django
tests/model_inheritance_regress/models.py
243
5863
from __future__ import unicode_literals import datetime from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) class Meta: ...
bsd-3-clause
rotofly/odoo
addons/bus/bus.py
325
7324
# -*- coding: utf-8 -*- import datetime import json import logging import select import threading import time import random import simplejson import openerp from openerp.osv import osv, fields from openerp.http import request from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT _logger = logging.getLogger(__...
agpl-3.0
gonzolino/heat
heat/rpc/listener_client.py
10
1473
# # 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
pombredanne/metamorphosys-desktop
metamorphosys/META/analysis_tools/PYTHON_RICARDO/output_closures/scripts/load_inventor.py
7
2996
# -*- coding: utf-8 -*- """ Created on Mon Aug 12 16:56:42 2013 @author: tgb """ from cStringIO import StringIO import re import numpy as np def read_iv_file(f_name): """ Return a list of parts from the inventor file called ``f_name``. Each entry in the part list is a tuple ``(x, ...
mit
Nextzero/hadoop-2.6.0-cdh5.4.3
hadoop-mapreduce1-project/src/contrib/cloud/src/test/py/teststorage.py
16
6086
# 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
pshen/ansible
lib/ansible/module_utils/facts/network/hurd.py
192
3142
# 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 in the hope that ...
gpl-3.0
kovacsbalu/ansible-modules-extras
cloud/centurylink/clc_loadbalancer.py
49
34308
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
gpl-3.0
practicalswift/bitcoin
contrib/devtools/circular-dependencies.py
29
3219
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import sys import re from typing import Dict, List, Set MAPPING = { 'core_read.cpp': 'core_io.cpp', ...
mit
florian-dacosta/OCB
openerp/addons/base/module/report/__init__.py
463
1089
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
detule/lge-linux-msm
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
lojaintegrada/pyboleto
pyboleto/pdf.py
1
30840
# -*- coding: utf-8 -*- """ pyboleto.pdf ~~~~~~~~~~~~ Classe Responsável por fazer o output do boleto em pdf usando Reportlab. :copyright: © 2011 - 2012 by Eduardo Cereto Carvalho :license: BSD, see LICENSE for more details. """ import os from reportlab.graphics.barcode.common import I2of5 from ...
bsd-3-clause
yantrabuddhi/opencog
opencog/python/spatiotemporal/temporal_events/composition/railway_framework.py
34
8054
from itertools import chain from spatiotemporal.temporal_events.composition.emperical_distribution import overlaps from spatiotemporal.temporal_events.util import Dijkstra from utility.functions import almost_equals __author__ = 'keyvan' EPSILON = 1e-12 class Wagon(object): def __init__(self, a, b): sel...
agpl-3.0
petesburgh/or-tools
examples/python/data/nonogram_regular/nonogram_p200.py
74
1810
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 applica...
apache-2.0
zvezdan/pip
src/pip/_vendor/urllib3/util/selectors.py
138
21147
# Backport of selectors.py from Python 3.5+ to support Python < 3.4 # Also has the behavior specified in PEP 475 which is to retry syscalls # in the case of an EINTR error. This module is required because selectors34 # does not follow this behavior and instead returns that no dile descriptor # events have occurred rath...
mit
Flowdalic/bitcoin
test/lint/check-doc.py
1
1931
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' This checks if all command line args are documented. Return value is 0 to indicate no error. Author:...
mit
skelton/amlogic_common_3050
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
Johnetordoff/osf.io
api/metaschemas/views.py
14
1446
from api.base.views import DeprecatedView from api.schemas import views from api.schemas.serializers import DeprecatedMetaSchemaSerializer, DeprecatedRegistrationMetaSchemaSerializer class DeprecatedRegistrationMetaSchemaList(DeprecatedView, views.RegistrationSchemaList): max_version = '2.8' view_category = '...
apache-2.0
kalessin/scrapy
scrapy/utils/project.py
142
2491
import os from six.moves import cPickle as pickle import warnings from importlib import import_module from os.path import join, dirname, abspath, isabs, exists from scrapy.utils.conf import closest_scrapy_cfg, get_config, init_env from scrapy.settings import Settings from scrapy.exceptions import NotConfigured ENVVA...
bsd-3-clause
robertbreker/sm
drivers/SRCommand.py
6
14472
#!/usr/bin/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 be u...
lgpl-2.1
don-github/edx-platform
common/lib/capa/capa/tests/test_hint_functionality.py
41
34139
# -*- coding: utf-8 -*- """ Tests of extended hints """ import unittest from ddt import ddt, data, unpack # With the use of ddt, some of the data expected_string cases below are naturally long stretches # of text text without whitespace. I think it's best to leave such lines intact # in the test code. Therefore: # ...
agpl-3.0
porduna/weblabdeusto
server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment1/experiment2/server_config.py
968
1526
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- weblab_xilinx_experiment_xilinx_device = 'FPGA' weblab_xilinx_experiment_port_number = 1 # This should be something like this: # import os as _os # xilinx_home = _os.getenv('XILINX_HOME') # if xilinx_home == None: # if _os.name == 'nt': # xilinx_home = r'C:...
bsd-2-clause
kartta-labs/noter-backend
noter_backend/main/migrations/0001_initial.py
1
2952
# Generated by Django 3.0.8 on 2020-08-13 19:20 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import main.models class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MOD...
apache-2.0
timothyclemans/checklistsforglass
checklistsforglass/views.py
1
13909
from django.shortcuts import render from django.shortcuts import render_to_response from django.db.models.loading import get_model from django.http import HttpResponse, HttpResponseRedirect from models import Checklist, ChecklistV2, ChecklistElement, Device, UnregisteredDevice, Data, AuditTrail from django.contrib.auth...
apache-2.0
koobonil/Boss2D
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/debug/wrappers/framework.py
13
29952
# 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...
mit
tdtrask/ansible
lib/ansible/plugins/action/ironware.py
10
3719
# # (c) 2016 Red Hat Inc. # # 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 d...
gpl-3.0
anthrotype/ctypes-binding-generator
cbind/passes/forward_decl.py
2
1277
# Copyright (C) 2013 Che-Liang Chiou. '''Scan syntax tree for forward declarations.''' from cbind.cindex import CursorKind from cbind.passes.util import traverse_postorder, strip_type import cbind.annotations as annotations def scan_forward_decl(syntax_tree): '''Scan syntax tree for forward declarations.''' ...
gpl-3.0
benschmaus/catapult
third_party/gsutil/third_party/boto/boto/ec2/buyreservation.py
152
3838
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
bsd-3-clause
lmcro/letsencrypt
letsencrypt/tests/client_test.py
2
20361
"""Tests for letsencrypt.client.""" import os import shutil import tempfile import unittest import OpenSSL import mock from acme import jose from letsencrypt import account from letsencrypt import errors from letsencrypt import le_util from letsencrypt.tests import test_util KEY = test_util.load_vector("rsa512_ke...
apache-2.0
chrisfilda/edx_platform
lms/djangoapps/course_wiki/plugins/markdownedx/mdx_circuit.py
158
2645
#!/usr/bin/env python ''' Image Circuit Extension for Python-Markdown ====================================== Any single line beginning with circuit-schematic: and followed by data (which should be json data, but this is not enforced at this level) will be displayed as a circuit schematic. This is simply an input elem...
agpl-3.0
aaronorosen/horizon-congress
openstack_dashboard/test/integration_tests/pages/changepasswordpage.py
13
2981
# 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
possel/pircel
pircel/protocol.py
1
15500
#!/usr/bin/env python3 # -*- coding: utf8 -*- """ pircel.protocol --------------- This module defines functions and objects for interacting with an IRC server including: - parsing IRC protocol messages received from the server - generating IRC protocol messages to be sent back to the server - a callback-ba...
bsd-3-clause
ZHAW-INES/rioxo-uClinux-dist
user/python/python-2.4.4/Lib/sunau.py
82
16515
"""Stuff to parse Sun and NeXT audio files. An audio file consists of a header followed by the data. The structure of the header is as follows. +---------------+ | magic word | +---------------+ | header size | +---------------+ | data size | +--------...
gpl-2.0
ezbake/ezbake-common-python
discovery/lib/ezbake/discovery.py
2
13534
#!/usr/bin/env python # Copyright (C) 2013-2014 Computer Sciences Corporation # # 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 # # ...
apache-2.0
NINAnor/QGIS
python/plugins/db_manager/dlg_query_builder.py
3
15563
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : March 2015 copyright : (C) 2015 Hugo Mercier / Oslandia email : hugo dot me...
gpl-2.0
Soovox/django-socialregistration
socialregistration/contrib/github/tests.py
10
1369
from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from socialregistration.contrib.github.models import GithubProfile from socialregistration.tests import TemplateTagTest, OAuth2Test import json import urllib class TestTemplateTag(TemplateTagTest, TestCase): ...
mit
saguziel/incubator-airflow
airflow/operators/bash_operator.py
29
3891
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
axelstram/deep-visualization-toolbox
keys.py
12
4628
# Define keys #class KeyPatten(object): # '''Define a pattern that will be matched against a keycode. # # A KeyPattern is used to determine which key was pressed in # OpenCV. This process is complicated by the fact that different # platforms define different key codes for each key. Further, on # som...
mit
levelrf/level_basestation
grc/gui/Block.py
5
6651
""" Copyright 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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...
gpl-3.0
laurmurclar/mitmproxy
test/mitmproxy/test_certs.py
1
6730
import os from mitmproxy import certs from mitmproxy.test import tutils # class TestDNTree: # def test_simple(self): # d = certs.DNTree() # d.add("foo.com", "foo") # d.add("bar.com", "bar") # assert d.get("foo.com") == "foo" # assert d.get("bar.com") == "bar" # asser...
mit
aifil/odoo
addons/project/tests/test_access_rights.py
45
8940
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.addons.project.tests.test_project_base import TestProjectBase from openerp.exceptions import AccessError from openerp.exceptions import except_orm from openerp.tools import mute_logger class TestPortalProj...
gpl-3.0
google/makani
analysis/checks/autocheck.py
1
5507
# Copyright 2020 Makani Technologies 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 to...
apache-2.0
google/makani
avionics/network/network_routes.py
1
3560
#!/usr/bin/python # Copyright 2020 Makani Technologies 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 applicabl...
apache-2.0
kisna72/django
django/db/backends/base/creation.py
147
10102
import sys import time from django.apps import apps from django.conf import settings from django.core import serializers from django.db import router from django.utils.six import StringIO from django.utils.six.moves import input # The prefix to put on the default database name when creating # the test database. TEST_...
bsd-3-clause
michaelrice/vBurgundy
vBurgundy/user/forms.py
1
1679
from flask_wtf import Form from wtforms import PasswordField, StringField from wtforms.validators import DataRequired, Email, EqualTo, Length from .models import User class RegisterForm(Form): """ Registration Form for new users. """ username = StringField('Username', valid...
apache-2.0
caphrim007/ansible
lib/ansible/utils/module_docs_fragments/ovirt_facts.py
33
3556
# -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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) ...
gpl-3.0
bugaevc/thefuck
tests/rules/test_dirty_untar.py
5
1795
import os import pytest import tarfile from thefuck.rules.dirty_untar import match, get_new_command, side_effect from tests.utils import Command @pytest.fixture def tar_error(tmpdir): def fixture(filename): path = os.path.join(str(tmpdir), filename) def reset(path): with tarfile.TarFi...
mit
gritlogic/incubator-airflow
setup.py
1
9028
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
ajdawson/iris
lib/iris/tests/integration/test_regrid_equivalence.py
6
10809
# (C) British Crown Copyright 2016, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any later ve...
gpl-3.0
cpennington/edx-platform
lms/djangoapps/grades/config/waffle.py
4
2419
""" This module contains various configuration settings via waffle switches for the Grades app. """ from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag, WaffleFlagNamespace, WaffleSwitchNamespace # Namespace WAFFLE_NAMESPACE = u'grades' # Switches ASSUME_ZERO_GRADE_IF_ABSENT = u'assume_zero_grade_if_a...
agpl-3.0
patcon/openPDS
openpds/accesscontrol/tests.py
3
2697
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase #from openpds.accesscontrol.models import FunfProbeGroupSetting, FunfProbeSetting from openpds.core.int...
mit
adusia/pox
tools/pox-pydoc.py
78
93651
#! /usr/bin/python2.7 # -*- coding: latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
apache-2.0
tylerjereddy/scipy
scipy/integrate/_quad_vec.py
12
20691
import sys import copy import heapq import collections import functools import numpy as np from scipy._lib._util import MapWrapper class LRUDict(collections.OrderedDict): def __init__(self, max_size): self.__max_size = max_size def __setitem__(self, key, value): existing_key = (key in self)...
bsd-3-clause
anthrotype/roboto
scripts/lib/fontbuild/convertCurves.py
7
3436
#! /usr/bin/env python # # Copyright 2015 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 requir...
apache-2.0
aasensio/pyAbundance
setup.py
1
1219
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext # This line only needed if building with NumPy in Cython file. from numpy import get_include from os import system # compile the fortran modules without linking fortran_mod_comp = 'make clean ; make' print...
mit
jsharkey13/isaac-selenium-testing
isaactest/tests/accept_cookies.py
1
2196
import time from ..utils.log import log, INFO, ERROR, PASS from ..utils.i_selenium import assert_tab from ..utils.i_selenium import wait_for_xpath_element, wait_for_invisible_xpath from ..tests import TestWithDependency from selenium.common.exceptions import TimeoutException, NoSuchElementException __all__ = ["accept_...
mit
sgagnon/lyman-tools
timeseries/extract_info/mvpa-goodruntype_filt.py
1
1176
import os.path as op smoothing = 'unsmoothed' regspace = 'epi' project = 'SST' design = 'navcond_byruntype.csv' func_exp = 'mvpa-resid_assigned' onset_exp = 'mvpa-goodruntype_filt' smoothing_fwhm = 0 standardize_feat = False standardize_roi = False percentsig_roi = False percentsig_roi_relbaseline = False tr = float(2...
bsd-2-clause
byt3bl33d3r/Veil-Evasion
modules/payloads/cs/meterpreter/rev_https.py
4
7221
""" Custom-written pure c# meterpreter/reverse_https stager. Uses basic variable renaming obfuscation. Module built by @harmj0y """ from modules.common import helpers from modules.common import encryption import random class Payload: def __init__(self): # required options self.description ...
gpl-3.0
sergeii/swat4stats.com
tracker/south_migrations/0004_add_ip_length_index.py
1
13644
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.execute('CREATE INDEX tracker_ip_length ON tracker_ip ((range_to - range_from)...
mit
sadleader/odoo
addons/account_check_writing/account_voucher.py
140
6284
# -*- 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
nesdis/djongo
tests/django_tests/tests/v21/tests/pagination/tests.py
2
16095
import unittest from datetime import datetime from django.core.paginator import ( EmptyPage, InvalidPage, PageNotAnInteger, Paginator, UnorderedObjectListWarning, ) from django.test import TestCase from .custom import ValidAdjacentNumsPaginator from .models import Article class PaginationTests(unittest.Test...
agpl-3.0
LICEF/edx-platform
common/djangoapps/track/migrations/0001_initial.py
189
2527
# -*- 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 'TrackingLog' db.create_table('track_trackinglog', ( ('id', self.gf('django.db.mo...
agpl-3.0
Abce/googlemock
scripts/gmock_doctor.py
48
24117
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
carlmw/oscar-wager
django/utils/termcolors.py
417
6885
""" termcolors.py """ color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white') foreground = dict([(color_names[x], '3%s' % x) for x in range(8)]) background = dict([(color_names[x], '4%s' % x) for x in range(8)]) RESET = '0' opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'rever...
bsd-3-clause
abo-abo/edx-platform
lms/djangoapps/instructor/tests/test_hint_manager.py
31
9180
import json from django.test.client import Client, RequestFactory from django.test.utils import override_settings from mock import patch, MagicMock from courseware.models import XModuleUserStateSummaryField from courseware.tests.factories import UserStateSummaryFactory from courseware.tests.modulestore_config import ...
agpl-3.0
louisdijkstra/chemical-youth
bin/scrape-users.py
1
5646
#!/usr/bin/env python from __future__ import print_function, division from optparse import OptionParser import os import sys # add the python directory sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))[:-3] + 'python') from WikipediaScraper import * __author__ = "Louis Dijkstra" usage = """%prog <title>...
mit
jneight/django-xadmin
tests/runtests.py
5
6424
#!/usr/bin/env python import os import shutil import sys import tempfile TEST_ROOT = os.path.realpath(os.path.dirname(__file__)) RUNTESTS_DIR = os.path.join(TEST_ROOT, 'xtests') sys.path.insert(0, os.path.join(TEST_ROOT, os.pardir)) sys.path.insert(0, RUNTESTS_DIR) TEST_TEMPLATE_DIR = 'templates' TEMP_DIR = tempfile...
bsd-3-clause
Nexenta/s3-tests
virtualenv/lib/python2.7/site-packages/boto/iam/connection.py
12
57215
# Copyright (c) 2010-2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010-2011, Eucalyptus Systems, Inc. # # 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, includin...
mit
qtumproject/qtum
test/functional/feature_reindex.py
32
1414
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test running bitcoind with -reindex and -reindex-chainstate options. - Start a single node and generat...
mit
rruebner/odoo
addons/hr_attendance/wizard/hr_attendance_error.py
377
2896
# -*- 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
dset0x/invenio
invenio/modules/oaiharvester/upgrades/oaiharvester_2014_09_09_initial.py
18
2477
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
PSJoshi/python_scripts
certificate-details.py
1
3377
#!/usr/bin/env python import subprocess import logging import os import sys from urlparse import urlparse """ # use of openssl for ssl certificate details psj@psj-desktop:~/Downloads/nmap-6.40$ openssl s_client -showcerts -connect google.com:443</dev/null Certificate validity: psj@psj-desktop:~/Downloads/nmap-6.40$ o...
apache-2.0
msmolens/VTK
ThirdParty/Twisted/twisted/web/test/test_static.py
28
56293
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.static}. """ import inspect import mimetypes import os import re import StringIO from zope.interface.verify import verifyObject from twisted.internet import abstract, interfaces from twisted.python.runtime import plat...
bsd-3-clause
lichengwu/python_tools
utils/cn/lichengwu/utils/utils/gc/G1LogUtil.py
1
7950
# coding=utf-8 __author__ = 'lichengwu' import datetime import re ''' Garbage First Log Analyse Util ''' class G1LogUtil: __path = '' # some regular expression pattern # like this '2012-12-19T10:25:19' __START_LINE_PATTERN = re.compile('^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:.*pause.*') # like th...
apache-2.0
lem9/weblate
weblate/trans/migrations/0022_auto_20150309_0932.py
15
1055
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('trans', '0021_auto_20150306_1605'), ] operations = [ migrations.AlterField( model_name='subproject', ...
gpl-3.0
grimoirelab/GrimoireELK
grimoire_elk/raw/confluence.py
1
2288
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2019 Bitergia # # 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 ...
gpl-3.0
kstaniek/csm
csmserver/horizon/package_lib.py
1
18303
# ============================================================================= # # Copyright (c) 2013, Cisco Systems # 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...
apache-2.0
moutai/scikit-learn
sklearn/cluster/affinity_propagation_.py
60
10688
"""Affinity Propagation clustering algorithm.""" # Author: Alexandre Gramfort alexandre.gramfort@inria.fr # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import as_float_array, check_array from ..utils.valid...
bsd-3-clause
gdubost1/shaderman
mako/exceptions.py
5
9031
# exceptions.py # Copyright (C) 2006, 2007 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """exception classes""" import traceback, sys, re class MakoException(Exception): pass class RuntimeExcept...
bsd-3-clause
apanju/GMIO_Odoo
addons/project/tests/test_project_flow.py
198
8762
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
DinoCow/airflow
chart/tests/test_basic_helm_chart.py
2
5185
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
kailIII/emaresa
trunk.cl/l10n_cl_partner_emaresa/l10n_cl_partner_emaresa.py
3
1991
# -*- coding: utf-8 -*- ############################################################################## # # Author: OpenDrive Ltda # Copyright (c) 2013 Opendrive Ltda # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # cons...
agpl-3.0
liyi193328/seq2seq
seq2seq/contrib/learn/dataframe/transforms/example_parser.py
26
2407
# 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
ian-garrett/meetMe
env/lib/python3.4/site-packages/setuptools/command/sdist.py
385
7079
from glob import glob from distutils import log import distutils.command.sdist as orig import os import sys from setuptools.compat import PY3 from setuptools.utils import cs_path_exists import pkg_resources READMES = 'README', 'README.rst', 'README.txt' _default_revctrl = list def walk_revctrl(dirname=''): """...
artistic-2.0
ridhoillyasa/jaikuengine
common/sms.py
34
10152
import logging import re from django.conf import settings from common import api from common import clean from common import exception from common import patterns from common import user from common import util from common.protocol import base from common.protocol import sms HELP_HUH = "Sorry, did not understand \"%...
apache-2.0
bsipocz/scikit-image
skimage/morphology/watershed.py
29
13277
"""watershed.py - watershed algorithm This module implements a watershed algorithm that apportions pixels into marked basins. The algorithm uses a priority queue to hold the pixels with the metric for the priority queue being pixel value, then the time of entry into the queue - this settles ties in favor of the closes...
bsd-3-clause