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
aam-at/tensorflow
tensorflow/python/tpu/tpu_embedding_v2_utils_test.py
4
4650
# Copyright 2020 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
coala-analyzer/coala-bears
tests/natural_language/AlexBearTest.py
2
1787
import unittest from unittest.mock import patch from bears.natural_language.AlexBear import AlexBear from coalib.testing.BearTestHelper import generate_skip_decorator from coalib.testing.LocalBearTestHelper import verify_local_bear good_file = 'Their network looks good.' bad_file = 'His network looks good.' AlexBe...
agpl-3.0
tombtc/dashman
lib/pycoin/tests/key_test.py
13
5187
#!/usr/bin/env python import unittest from pycoin.key import Key from pycoin.serialize import h2b class KeyTest(unittest.TestCase): def test_translation(self): def do_test(exp_hex, wif, c_wif, public_pair_sec, c_public_pair_sec, address_b58, c_address_b58): secret_exponent = int(exp_hex, 16...
mit
ajohnson23/depot_tools
third_party/boto/file/connection.py
111
1480
# Copyright 2010 Google 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, including # without limitation the rights to use, copy, modify, merge, publish, dis- # trib...
bsd-3-clause
legalese/legalese-compiler
L4/pyL4/test/test_interpreter.py
2
14323
from datetime import timedelta from itertools import chain from logging import warning from typing import Sequence, Tuple, Optional from src.hard_correctness_checks.normal_forms import eliminate_ifthenelse, eliminate_local_vars from src.constants_and_defined_types import * from src.interpreter.interpreter_runner impor...
apache-2.0
Nashenas88/servo
tests/wpt/css-tests/tools/html5lib/html5lib/sanitizer.py
423
16428
from __future__ import absolute_import, division, unicode_literals import re from xml.sax.saxutils import escape, unescape from .tokenizer import HTMLTokenizer from .constants import tokenTypes class HTMLSanitizerMixin(object): """ sanitization of XHTML+MathML+SVG and of inline style attributes.""" accepta...
mpl-2.0
macs03/demo-cms
cms/lib/python2.7/site-packages/django/contrib/admin/validation.py
108
23236
from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist from django.forms.models import BaseModelForm, BaseModelFormSet, _get_foreign_key from django.contrib.admin.util import get_fields_from_path, NotRelationField """ Does basic ModelA...
mit
impromptuartist/impromptuartist.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/filters/__init__.py
196
11499
# -*- coding: utf-8 -*- """ pygments.filters ~~~~~~~~~~~~~~~~ Module containing filter lookup functions and default filters. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.token import String, Comment, Ke...
mit
sunny-wyb/xen-4.1.2
tools/tests/utests/run_all_tests.py
42
1310
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
shastah/spacewalk
client/rhel/rhn-client-tools/test/testutils.py
11
9431
#!/usr/bin/python import os,sys import getopt import shutil import glob DBPATH="/tmp/testdb" DBCACHEPATH="/tmp/testdbcaches/" UP2DATE_COMMAND="up2date --justdb --dbpath $DBPATH" DATAPATH="/tmp/datadir" TOPDIR="../" DBDIR="%s/testdbs" % "/usr/src/rhn/test/up2date/depsolve/" PKGDIR="%s/testpackages" % "/usr/src/rhn/te...
gpl-2.0
handroissuazo/tensorflow
tensorflow/contrib/tfprof/python/tools/tfprof/tfprof_logger.py
48
5809
# 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
IanHarvey/minicrypt
python-models/bntestvectors.py
1
7774
import random, os class TestVector: @staticmethod def toWords(val, nWords): assert( val >= 0 ) assert( val < (1 << (nWords*32)) ) return [ (val >> (i*32)) & 0xFFFFFFFF for i in range(nWords) ] @staticmethod def toC(val, nWords): return "{ {" + (",".join(["0x%08X" % w f...
unlicense
Mazecreator/tensorflow
tensorflow/contrib/seq2seq/python/ops/decoder.py
30
11351
# 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
erikdejonge/youtube-dl
youtube_dl/extractor/cbs.py
11
4680
from __future__ import unicode_literals from .theplatform import ThePlatformFeedIE from ..utils import ( ExtractorError, int_or_none, find_xpath_attr, xpath_element, xpath_text, update_url_query, ) class CBSBaseIE(ThePlatformFeedIE): def _parse_smil_subtitles(self, smil, namespace=None, s...
unlicense
CapOM/ChromiumGStreamerBackend
third_party/tlslite/tlslite/utils/asn1parser.py
206
1191
# Author: Trevor Perrin # Patch from Google adding getChildBytes() # # See the LICENSE file for legal information regarding use of this file. """Class for parsing ASN.1""" from .compat import * from .codec import * #Takes a byte array which has a DER TLV field at its head class ASN1Parser(object): def __init__(se...
bsd-3-clause
Averroes/statsmodels
statsmodels/examples/tsa/try_ar.py
33
2566
# -*- coding: utf-8 -*- """ Created on Thu Oct 21 21:45:24 2010 Author: josef-pktd """ from __future__ import print_function import numpy as np from scipy import signal def armaloop(arcoefs, macoefs, x): '''get arma recursion in simple loop for simplicity assumes that ma polynomial is not longer than the ar...
bsd-3-clause
nitzmahone/ansible
test/units/cli/test_cli.py
16
18742
# (c) 2017, Adrian Likins <alikins@redhat.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 vers...
gpl-3.0
Servir-Mekong/SurfaceWaterTool
lib/google/protobuf/type_pb2.py
3
25244
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/type.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from ...
gpl-3.0
UnderSn0w/picasso-graphic
tools/gyp/tools/pretty_vcproj.py
2637
9586
#!/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. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
bsd-3-clause
quantumlib/OpenFermion
src/openfermion/ops/representations/diagonal_coulomb_hamiltonian.py
1
2720
# 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 # distribu...
apache-2.0
zhouzhenghui/python-for-android
python-build/python-libs/gdata/src/gdata/alt/app_engine.py
136
3386
#!/usr/bin/python # # Copyright (C) 2009 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 ...
apache-2.0
V11/volcano
server/sqlmap/lib/takeover/udf.py
1
14350
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import os from lib.core.agent import agent from lib.core.common import checkFile from lib.core.common import dataToStdout from lib.core.common import Backend from lib.core.co...
mit
pearsonlab/nipype
examples/fmri_spm.py
10
16330
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ ============== fMRI: SPM, FSL ============== The fmri_spm.py integrates several interfaces to perform a first and second level analysis on a two-subject data set. The tutorial ca...
bsd-3-clause
fevxie/odoo
addons/hr_expense/report/hr_expense_report.py
287
5652
# -*- 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
stoewer/python-odml
odml/format.py
2
2237
import odml """ A module providing general format information and mappings of xml-attributes to their python class equivalents """ class Format(object): _map = {} _rev_map = None def map(self, name): """maps an odml name to a python name""" return self._map.get(name, name) def revmap(...
bsd-3-clause
kbidarkar/robottelo
tests/foreman/api/test_puppetmodule.py
3
4656
"""Unit tests for the ``katello/api/v2/puppet_modules`` paths. :Requirement: Puppetmodule :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: API :TestType: Functional :CaseImportance: High :Upstream: No """ from nailgun import entities from robottelo.constants import PUPPET_MODULE_NTP_PUPPETLABS f...
gpl-3.0
OSVR/libfunctionality
vendor/gtest-1.7.0/xcode/Scripts/versiongenerate.py
3088
4536
#!/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...
apache-2.0
opencivicdata/python-opencivicdata
opencivicdata/elections/migrations/0007_auto_20171022_0234.py
2
6133
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-10-22 02:34 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [("elections", "0006_auto_20171005_2029")] operations = [ mi...
bsd-3-clause
Dexhub/MTX
src/arch/x86/isa/insts/general_purpose/string/compare_strings.py
91
3952
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware imp...
bsd-3-clause
NL66278/odoo
addons/l10n_in_hr_payroll/__init__.py
430
1117
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
antonve/s4-project-mooc
common/test/acceptance/tests/studio/test_studio_settings_details.py
4
7386
""" Acceptance tests for Studio's Settings Details pages """ from unittest import skip from .base_studio_test import StudioCourseTest from ...fixtures.course import CourseFixture from ...pages.studio.settings import SettingsPage from ...pages.studio.overview import CourseOutlinePage from ...tests.studio.base_studio_te...
agpl-3.0
jvkops/django
django/template/backends/jinja2.py
350
3342
# Since this package contains a "django" module, this is required on Python 2. from __future__ import absolute_import import sys import jinja2 from django.conf import settings from django.template import TemplateDoesNotExist, TemplateSyntaxError from django.utils import six from django.utils.module_loading import im...
bsd-3-clause
c2corg/v6_api
c2corg_api/views/topo_map.py
1
2899
from c2corg_api.models.cache_version import update_cache_version_for_map from c2corg_api.models.document import UpdateType from c2corg_api.models.topo_map import ( TopoMap, schema_topo_map, schema_update_topo_map, MAP_TYPE) from c2corg_api.models.topo_map_association import update_map from c2corg_api.views.document...
agpl-3.0
jfsantos/maracas
maracas/dataset.py
1
5220
from __future__ import print_function, division, absolute_import import os, itertools from tqdm import tqdm from glob import glob import numpy as np from maracas.utils import wavread, wavwrite, recursive_glob from maracas import add_noise, add_reverb class Dataset(object): '''Defines a corrupted speech dataset. ...
mit
dslomov/intellij-community
plugins/hg4idea/testData/bin/mercurial/sslutil.py
91
6644
# sslutil.py - SSL handling for mercurial # # Copyright 2005, 2006, 2007, 2008 Matt Mackall <mpm@selenic.com> # Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br> # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General...
apache-2.0
linebp/pandas
pandas/tests/test_errors.py
9
1147
# -*- coding: utf-8 -*- import pytest from warnings import catch_warnings import pandas # noqa import pandas as pd @pytest.mark.parametrize( "exc", ['UnsupportedFunctionCall', 'UnsortedIndexError', 'OutOfBoundsDatetime', 'ParserError', 'PerformanceWarning', 'DtypeWarning', 'E...
bsd-3-clause
fisele/slimta-abusix
test/test_slimta_util_dnsbl.py
1
4536
import unittest2 as unittest from mox3.mox import MoxTestBase from pycares.errno import ARES_ENOTFOUND from slimta.util.dns import DNSResolver, DNSError from slimta.util.dnsbl import DnsBlocklist, DnsBlocklistGroup, check_dnsbl from slimta.smtp.reply import Reply class FakeRdata(object): def __init__(self, tex...
mit
GruesomeWolf/Slippery_Sloth
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
jcnelson/syndicate
build/chroot/package_info.deb.py
4
3963
#!/usr/bin/python import sys import os from collections import namedtuple class PackageInfo( object ): def __init__(self, **kw): for (k, v) in kw.items(): setattr(self, k, v) BASE_DIR = "/root/syndicate" BUILD_ROOT = "/root/syndicate/syndicate" PACKAGE_ROOT = "/root/syndicate" BUILD_FLAGS = "devel=...
apache-2.0
ojengwa/oh-mainline
vendor/packages/python-social-auth/social/exceptions.py
65
3143
class SocialAuthBaseException(ValueError): """Base class for pipeline exceptions.""" pass class WrongBackend(SocialAuthBaseException): def __init__(self, backend_name): self.backend_name = backend_name def __str__(self): return 'Incorrect authentication service "{0}"'.format( ...
agpl-3.0
spiceqa/virt-test
qemu/tests/timerdevice_tscsync_change_host_clksource.py
3
4578
import logging import os import re from autotest.client.shared import error from autotest.client import utils from virttest import data_dir @error.context_aware def run_timerdevice_tscsync_change_host_clksource(test, params, env): """ Timer device check TSC synchronity after change host clocksource: 1) C...
gpl-2.0
prakritish/ansible
lib/ansible/modules/network/avi/avi_api_session.py
52
8087
#!/usr/bin/python """ # Created on Aug 12, 2016 # # @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 # # module_check: not supported # # 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 publ...
gpl-3.0
galactics/beyond
beyond/propagators/base.py
2
4956
from abc import ABCMeta, abstractmethod from datetime import timedelta from ..dates import Date from .listeners import Speaker class Propagator(metaclass=ABCMeta): """Base class for propagators""" orbit = None def __repr__(self): return "<{} at {}>".format(self.__class__.__name__, hex(id(self))...
mit
2947721120/or-tools
examples/python/langford.py
2
3162
# 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 applicable ...
apache-2.0
TeamEOS/external_chromium_org_third_party_WebKit
Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py
675
11294
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
andresriancho/boto
boto/glacier/job.py
15
7025
# -*- coding: utf-8 -*- # Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/ # # 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 th...
mit
srikantbmandal/ansible
lib/ansible/modules/database/proxysql/proxysql_scheduler.py
58
15108
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
tizianasellitto/servo
components/style/properties/data.py
6
9501
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import re PHYSICAL_SIDES = ["top", "left", "bottom", "right"] LOGICAL_SIDES = ["block-start", "block-end", "inline-star...
mpl-2.0
jmaher/treeherder
treeherder/perf/migrations/0036_cascade_perf_datum_deletion.py
2
1225
# Generated by Django 3.0.8 on 2020-12-11 14:42 from django.db import migrations MULTICOMMIT_CONSTRAINT_SYMBOL = 'perf_multicommitdatu_perf_datum_id_c2d7eb14_fk_performan' class Migration(migrations.Migration): dependencies = [ ('perf', '0035_fix_deprecated_nullboolean_field'), ] operations = ...
mpl-2.0
gurneyalex/odoo
addons/stock/tests/test_packing.py
4
40160
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests import Form, tagged from odoo.tests.common import SavepointCase from odoo.tools import float_round from odoo.exceptions import UserError @tagged('post_install', '-at_install') class TestPacking(Savepoin...
agpl-3.0
ClearCorp/account-consolidation
account_consolidation/company.py
3
2044
# -* coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2011-2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
agpl-3.0
wandersonwhcr/googletest
test/gtest_output_test.py
496
12051
#!/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
dlebauer/plantcv
scripts/dev/vis_tv_z3500_L2_e82.py
1
5162
#!/usr/bin/python import sys, traceback import cv2 import numpy as np import argparse import string import plantcv as pcv ### Parse command-line arguments def options(): parser = argparse.ArgumentParser(description="Imaging processing with opencv") parser.add_argument("-i", "--image", help="Input image file.", req...
gpl-2.0
Hybridmax/G92XF_Mystery_Kernel
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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. # # This program i...
gpl-2.0
mindnervestech/mnrp
addons/resource/faces/resource.py
433
25890
#@+leo-ver=4 #@+node:@file resource.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free softwa...
agpl-3.0
cappert/specto
spectlib/gtkconfig.py
2
18402
# -*- coding: utf-8 -*- # Specto , Unobtrusive event notifier # # gtkutil.py # # See the AUTHORS file for copyright ownership information # 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; ...
gpl-2.0
jacquesqiao/Paddle
python/paddle/fluid/transpiler/__init__.py
1
1033
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
brokenjacobs/ansible
lib/ansible/modules/network/nxos/nxos_udld_interface.py
57
9049
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
JohannesBuchner/doit
doit/tools.py
2
10082
"""extra goodies to be used in dodo files""" import os import time as time_module import datetime import json import hashlib import operator import subprocess from . import exceptions from .action import CmdAction, PythonAction from .task import result_dep # imported for backward compatibility result_dep # pyflakes ...
mit
Jgarcia-IAS/SAT
openerp/addons-extra/hr_expense/report/__init__.py
380
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
gdimitris/ChessPuzzlerBackend
Virtual_Environment/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py
482
2055
""" urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' __license__ = 'MIT' __version__ = '1.10.4' from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import en...
mit
z0by/django
tests/template_tests/syntax_tests/test_if_equal.py
368
9892
from django.test import SimpleTestCase from ..utils import setup class IfEqualTagTests(SimpleTestCase): @setup({'ifequal01': '{% ifequal a b %}yes{% endifequal %}'}) def test_ifequal01(self): output = self.engine.render_to_string('ifequal01', {'a': 1, 'b': 2}) self.assertEqual(output, '') ...
bsd-3-clause
TheDirtyCalvinist/spacewalk
tools/reflection_generator/java_class_component.py
7
1494
#!/usr/bin/env python # Copyright (c) 2014 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class Field: """Python class represents static field of a java class""" def __init__(self, field_type, name, value, doc): sel...
bsd-3-clause
traveloka/ansible
lib/ansible/modules/system/sysctl.py
3
13166
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, David "DaviXX" CHANIAL <david.chanial@gmail.com> # (c) 2014, James Tanner <tanner.jc@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 ...
gpl-3.0
fp7-ofelia/pypelib
example/main.py
1
2720
import os import sys import time import exceptions import time import logging sys.path.append("../src/pypelib/") ''' @author: msune, lbergesio,cbermudo,omoya Simple example to emulate Server/client side interaction ''' from pypelib.RuleTable import RuleTable from MyPolicyEngine import MyPolicyEngi...
lgpl-3.0
dani0805/django_workflow
simple_approval/graph.py
1
8875
from enum import Enum from django.db.models import Max, Q import django_workflow.graph from django_workflow.graph import Graph from django_workflow.models import State, Transition, Workflow class NodeType(str, Enum): APPROVED = "approved" APPROVAL = "approval" JUNCTION = "junction" START = "start" ...
bsd-3-clause
spandanb/horizon
openstack_dashboard/dashboards/admin/roles/views.py
3
2594
# 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
mapr/hue
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/dumpscript.py
35
29484
# -*- coding: UTF-8 -*- """ Title: Dumpscript management command Project: Hardytools (queryset-refactor version) Author: Will Hardy (http://willhardy.com.au) Date: June 2008 Usage: python manage.py dumpscript appname > scripts/scriptname.py $Revision: 217 $ Description: Generates a Py...
apache-2.0
ask/bundle
bundle/setup.py
1
2360
from __future__ import absolute_import from distutils import log from distutils.command.upload import upload as _upload from pkg_resources import iter_entry_points class BundleCommand(_upload): user_options = _upload.user_options + [ # - from 'register' ("strict", None, "Will stop if th...
bsd-3-clause
SkRobo/Eurobot-2017
old year/RESET-master/CommunicationWithRobot/localisation2.py
2
9722
# Monte Carlo Localisation import prob_motion_model as pmm #import hokuyo import random import numpy as np import matplotlib.pyplot as plt import time import socket import copy import ttest import math from serial.tools import list_ports import serialWrapper import packetBuilder import packetParser import traceback #...
mit
candy7393/VTK
ThirdParty/Twisted/twisted/conch/telnet.py
42
38207
# -*- test-case-name: twisted.conch.test.test_telnet -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Telnet protocol implementation. @author: Jean-Paul Calderone """ import struct from zope.interface import implements from twisted.internet import protocol, interfaces as iinternet, d...
bsd-3-clause
google/fuzzbench
docker/benchmark-builder/checkout_commit.py
1
3431
# Copyright 2020 Google 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 in writing, softw...
apache-2.0
Designist/audacity
lib-src/lv2/sratom/waflib/ConfigSet.py
266
3763
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import copy,re,os from waflib import Logs,Utils re_imp=re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$',re.M) class ConfigSet(object): __slots__=('table','parent') def __init__(self,...
gpl-2.0
Passtechsoft/TPEAlpGen
blender/scons/scons-local/SCons/Tool/bcc32.py
7
2935
"""SCons.Tool.bcc32 XXX """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rig...
gpl-3.0
activitycentral/statistics-consolidation
stats_consolidation/rrd_files.py
1
6925
import os import sys import logging import rrdtool from datetime import datetime log = logging.getLogger("stats-consolidation") class RRD: hdr_item = 0 ds_item = 1 data_item = 2 DS = {'active': 0, 'buddies': 0, 'instances': 0, 'new': 0, 'resumed': 0, 'uptime': 0} def __init__(self, path, name, ...
gpl-3.0
georgemarshall/django-cryptography
tests/fields/test_migrations_normal_to_encrypted/0002_rename_fields.py
1
1959
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('fields', '0001_initial'), ] operations = [ migrations.RenameField( model_name='encryptedcharmodel', old_name...
bsd-3-clause
datenbetrieb/odoo
addons/hr_timesheet/__openerp__.py
257
2310
# -*- 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
wa1tnr/ainsuSPI
0-Distribution.d/circuitpython-master/stmhal/boards/STM32F4DISC/staccel.py
35
3342
""" Driver for accelerometer on STM32F4 Discover board. Sets accelerometer range at +-2g. Returns list containing X,Y,Z axis acceleration values in 'g' units (9.8m/s^2). See: STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.h STM32Cube_FW_F4_V1.1.0/Drivers/BSP/Components/lis302dl/lis302dl.c ...
mit
B-MOOC/edx-platform
common/lib/xmodule/xmodule/fields.py
144
8932
import time import logging import re from xblock.fields import JSONField import datetime import dateutil.parser from pytz import UTC log = logging.getLogger(__name__) class Date(JSONField): ''' Date fields know how to parse and produce json (iso) compatible formats. Converts to tz aware datetimes. ''' ...
agpl-3.0
Endika/OpenUpgrade
addons/base_vat/__openerp__.py
262
2897
# -*- 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
fernand/scipy
scipy/constants/__init__.py
24
11995
""" ================================== Constants (:mod:`scipy.constants`) ================================== .. currentmodule:: scipy.constants Physical and mathematical constants and units. Mathematical constants ====================== ================ ============================================================...
bsd-3-clause
pioneers/forseti
goal_vis.py
1
7754
#!/usr/bin/env python2.7 import wx import random import threading import time import lcm import argparse import json from Forseti import * class GoalVis(wx.Frame): def __init__(self, parent, id, title, lcm, field_table): wx.Frame.__init__(self, parent, id, title, size=(180, 380)) self.board = Bo...
apache-2.0
hsiun/yoyo
ufile/python/test_ufile/test_downloadfile.py
1
4188
# -*- coding: utf-8 -*- import unittest from ucloud.ufile import downloadufile from ucloud.logger import logger, set_log_file from ucloud.ufile.config import BLOCKSIZE, get_default public_key = '' #添加自己的账户公钥 private_key = '' #添加自己的账户私钥 public_bucket = '' #公共空间名称 private_bucket = '' #私有空间名称 wrong_public_key = 'dfajl...
apache-2.0
ChiliCoin/ChiliCoin
contrib/devtools/check-doc.py
1
1729
#!/usr/bin/env python # Copyright (c) 2015 The ChiliCoin 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: @Ma...
mit
x111ong/odoo
addons/l10n_cl/__openerp__.py
260
1679
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
wroersma/volatility
volatility/plugins/gui/windows.py
4
4862
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the F...
gpl-2.0
lasting-yang/shadowsocks
shadowsocks/cryptor.py
16
7135
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # 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 la...
apache-2.0
Regss/plugin.audio.polskie.stacje
default.py
1
1796
# -*- coding: utf-8 -*- import xbmc import xbmcgui import xbmcplugin import xbmcaddon import os import sys import re import urllib import urllib2 import cookielib __addon__ = xbmcaddon.Addon() __addon_id__ = __addon__.getAddonInfo('id') __addonname__ = __addon__.getAddonInfo('name') __icon__ ...
gpl-3.0
ksmit799/Toontown-Source
toontown/coghq/LawbotOfficeBoilerRoom_Battle00.py
5
11837
from toontown.coghq.SpecImports import * GlobalEntities = {1000: {'type': 'levelMgr', 'name': 'LevelMgr', 'comment': '', 'parentEntId': 0, 'cogLevel': 0, 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone8a', 'wantDoors': 1}, 1001: {'typ...
mit
klusark/android_external_chromium_org
build/util/lib/common/util.py
208
3815
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generic utilities for all python scripts.""" import atexit import httplib import os import signal import stat import subprocess import sys import tempfil...
bsd-3-clause
cogmission/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/__init__.py
69
28184
""" This is an object-orient plotting library. A procedural interface is provided by the companion pylab module, which may be imported directly, e.g:: from pylab import * or using ipython:: ipython -pylab For the most part, direct use of the object-oriented library is encouraged when programming rather tha...
agpl-3.0
captainpete/rethinkdb
test/rql_test/connections/http_support/werkzeug/urls.py
146
33150
# -*- coding: utf-8 -*- """ werkzeug.urls ~~~~~~~~~~~~~ This module implements various URL related functions. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re from werkzeug._compat import text_type, PY2, to_unicode,...
agpl-3.0
campbe13/openhatch
vendor/packages/gdata/src/gdata/webmastertools/data.py
126
5504
#!/usr/bin/python # # Copyright (C) 2009 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 ...
agpl-3.0
lordappsec/ooni-probe
ooni/nettests/blocking/http_requests.py
4
5201
# -*- encoding: utf-8 -*- # # :authors: Arturo Filastò # :licence: see LICENSE import random from twisted.python import usage, failure from ooni.utils import log from ooni.utils.net import userAgents from ooni.templates import httpt from ooni.errors import failureToString class UsageOptions(usage.Options): optP...
bsd-2-clause
ndp-systemes/odoo-addons
product_putaway_dispatch/__openerp__.py
2
1998
# -*- coding: utf8 -*- # # Copyright (C) 2014 NDP Systèmes (<http://www.ndp-systemes.fr>). # # 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 Free Software Foundation, either version 3 of the # License,...
agpl-3.0
davidyezsetz/kuma
kuma/wiki/migrations/0018_clean_documenttags.py
5
17300
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from django.db.models import F from taggit.models import TaggedItem class Migration(DataMigration): def forwards(self, orm): """ At some point we created some tags with identi...
mpl-2.0
shanzi/myicons
revisions/mixins.py
3
3595
from iconpacks.models import Pack from iconcollections.models import Collection, CollectionIcon from .models import Revision def get_field_names(model): fields = model._meta.fields return [field.name for field in fields] class RevisionMixin: fields = [] exclude = [] relations = [] def seri...
bsd-2-clause
bgxavier/neutron
neutron/tests/unit/agent/linux/test_ip_link_support.py
23
7095
# Copyright 2014 Mellanox Technologies, Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
tcwicklund/django
tests/foreign_object/models/article.py
87
3084
from django.db import models from django.db.models.fields.related import ForwardManyToOneDescriptor from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import get_language class ArticleTranslationDescriptor(ForwardManyToOneDescriptor): """ The set of articletranslation ...
bsd-3-clause
jreback/pandas
pandas/tests/io/test_sql.py
1
106269
"""SQL io tests The SQL tests are broken down in different classes: - `PandasSQLTest`: base class with common methods for all test classes - Tests for the public API (only tests with sqlite3) - `_TestSQLApi` base class - `TestSQLApi`: test the public API with sqlalchemy engine - `TestSQLiteFallbackApi`: t...
bsd-3-clause