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
marc-white/ads
ads/sandbox.py
4
1473
""" Sandbox environment that wraps relevant classes so that they receive mock responses rather than contact the live API """ import re from ads import search from .search import SearchQuery as _SearchQuery, Article as _Article from .metrics import MetricsQuery as _MetricsQuery from .export import ExportQuery as _Expo...
mit
a-veitch/grpc
src/python/grpcio/grpc/beta/_connectivity_channel.py
34
6379
# Copyright 2015, 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
Hackplayers/Empire-mod-Hackplayers
lib/modules/python/privesc/windows/get_gpppasswords.py
14
5327
class Module: def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Get Group Policy Preferences', # list of one or more authors for t...
bsd-3-clause
baskoopmans/djcommon
djcommon/fields.py
1
6036
# encoding: utf-8 import hashlib from django import forms from django.db import models from django.db.models.fields import CharField from django.utils.text import capfirst class HashField(models.CharField): description = ('HashField is related to some other field in a model and' 'stores its ...
bsd-3-clause
Kubuxu/cjdns
node_build/dependencies/libuv/build/gyp/test/actions-multiple/gyptest-all.py
345
2115
#!/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 two actions can be attached to the same input files. """ import sys import TestGyp test = TestGyp.TestGyp() test.run_gyp('a...
gpl-3.0
pymedusa/Medusa
ext/tvdbapiv2/__init__.py
3
2551
# coding=utf-8 from __future__ import absolute_import, unicode_literals # import models into sdk package from .models.token import Token from .models.auth import Auth from .models.not_found import NotFound from .models.not_authorized import NotAuthorized from .models.conflict import Conflict from .models.filter_keys ...
gpl-3.0
jjmachan/activityPointsApp
activitypoints/lib/python3.5/site-packages/django/db/models/sql/datastructures.py
62
5684
""" Useful auxiliary data structures for query construction. Not useful outside the SQL domain. """ # for backwards-compatibility in Django 1.11 from django.core.exceptions import EmptyResultSet # NOQA: F401 from django.db.models.sql.constants import INNER, LOUTER class MultiJoin(Exception): """ Used by join...
mit
maciekcc/tensorflow
tensorflow/contrib/text/python/ops/skip_gram_ops.py
25
20284
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
ruiliLaMeilleure/11ad-backhaul
src/fd-net-device/bindings/modulegen__gcc_ILP32.py
8
312298
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
dbremner/bite-project
deps/mrtaskman/server/mapreduce/input_readers.py
17
70094
#!/usr/bin/env python # # Copyright 2010 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 o...
apache-2.0
PulsePod/evepod
lib/python2.7/site-packages/newrelic-2.12.0.10/newrelic/common/system_info.py
2
6218
"""This module implements functions for querying properties of the operating system or for the specific process the code is running in. """ import os import sys import multiprocessing import re try: import resource except ImportError: pass def cpu_count(): """Returns the number of CPUs in the system. ...
apache-2.0
Bashar/django
django/core/cache/backends/db.py
80
8853
"Database cache backend." import base64 from datetime import datetime try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT from django.db import connections, transacti...
bsd-3-clause
drpngx/tensorflow
tensorflow/python/client/session_test.py
3
76015
# 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
MackZxh/OCA-Choice
partner-contact/partner_contact_job_position/__openerp__.py
9
1066
# -*- coding: utf-8 -*- # Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> # Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) # Antonio Espinosa <antonioea@antiun.com> # © 2015 ...
lgpl-3.0
linovia/django-rest-framework
tests/test_model_serializer.py
1
43162
""" The `ModelSerializer` and `HyperlinkedModelSerializer` classes are essentially shortcuts for automatically creating serializers based on a given model class. These tests deal with ensuring that we correctly map the model fields onto an appropriate set of serializer fields for each case. """ from __future__ import ...
bsd-2-clause
starrybeam/samba
third_party/dnspython/dns/rdtypes/ANY/CNAME.py
101
1091
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
renaelectronics/linuxcnc
tests/trajectory-planner/circular-arcs/linuxcnc_control.py
22
5422
#!/usr/bin/env python '''Copied from m61-test''' import linuxcnc import os from time import sleep # this is how long we wait for linuxcnc to do our bidding class LinuxcncError(Exception): pass # def __init__(self, value): # self.value = value # def __str__(self): # return repr(self.value) c...
gpl-2.0
Intel-Corporation/tensorflow
tensorflow/contrib/nn/python/ops/sampling_ops.py
27
14994
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
WangDequan/kaggle-ndsb
configurations/bagging_17_cr4_ds.py
6
7849
import numpy as np import theano import theano.tensor as T import lasagne as nn import data import load import nn_plankton import dihedral import dihedral_fast import tmp_dnn import tta validation_split_path = "splits/bagging_split_17.pkl" patch_sizes = [(95, 95), (47, 47)] augmentation_params = { 'zoom_ran...
mit
matesszabo/Movie-information
Examples/with_nfo/The.Hobbit.The.Desolation.of.Smaug.2013.CUSTOM.HUN.NTSC.DVDR-MWT/imdb/locale/msgfmt.py
142
6529
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- """Generate binary message catalog from textual translation description. This program converts a textual Uniforum-style message catalog (.po file) into a binary GNU catalog (.mo file). This is essentially the same function as the GNU msgfmt program, however, it is a ...
gpl-2.0
opengeogroep/inasafe
extras/data_audit_wrapper.py
10
1692
"""Wrapper around data_audit. This wrapper is specific to InaSAFE. This wrapper will run data_audit.py Specify what extensions, directories and files should be ignored by the data_audit process. These will generally be specific to each software project. """ from data_audit import IP_verified as IP_engine # Ignore...
gpl-3.0
OpenEdgeComputing/elijah-provisioning
test/app-client/batch_files/cloudlet_client.py
2
18539
#!/usr/bin/env python # # Cloudlet Infrastructure for Mobile Computing # # Author: Kiryong Ha <krha@cmu.edu> # # Copyright (C) 2011-2013 Carnegie Mellon University # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ob...
apache-2.0
ilastikdev/ilastik
ilastik/applets/dataSelection/dataSelectionSerializer.py
1
25923
############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # mo...
gpl-3.0
rchicoli/samba
python/samba/netcmd/dns.py
2
48618
# DNS management tool # # Copyright (C) Amitay Isaacs 2011-2012 # # 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. # # Th...
gpl-3.0
kriwil/django-filer
filer/south_migrations/0002_rename_file_field.py
22
9155
# -*- 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): # rename the file field db.rename_column('filer_file', 'file_field', '_file') ...
bsd-3-clause
hguemar/cinder
cinder/volume/drivers/ibm/gpfs.py
1
42616
# Copyright IBM Corp. 2013 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 agr...
apache-2.0
barnsnake351/neutron
neutron/tests/unit/agent/linux/test_ip_lib.py
3
49793
# Copyright 2012 OpenStack Foundation # 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 requ...
apache-2.0
jart/tensorflow
tensorflow/compiler/tests/qr_op_test.py
5
4564
# Copyright 2018 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
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/telnetlib.py
108
21808
r"""TELNET client class. Based on RFC 854: TELNET Protocol Specification, by J. Postel and J. Reynolds Example: >>> from telnetlib import Telnet >>> tn = Telnet('www.python.org', 79) # connect to finger port >>> tn.write('guido\r\n') >>> print tn.read_all() Login Name TTY Idle When ...
gpl-2.0
yohanboniface/memopol-core
memopol/mps/migrations/0001_initial.py
2
17902
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Function' db.create_table('mps_function', ( ('type', self.gf('django.db.models.fields.CharField')(max_length=255)), ...
agpl-3.0
mengxn/tensorflow
tensorflow/contrib/training/python/training/batch_sequences_with_states_test.py
75
23282
# 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
aestheticblasphemy/aestheticBlasphemy
pl_messages/migrations/0001_initial.py
1
4096
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-07-24 12:02 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_US...
gpl-3.0
yeleman/uninond
uninond/models/FloodEvents.py
1
9551
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import logging import datetime from py3compat import implements_to_string from django.utils.translation import ugettext_lazy as _ f...
mit
flyher/pymo
symbian/PythonForS60_1.9.6/module-repo/standard-modules/encodings/cp775.py
593
34732
""" Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
mit
apple/llvm-project
lldb/test/API/commands/trace/TestTraceStartStop.py
4
6010
import lldb from intelpt_testcase import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil from lldbsuite.test.decorators import * class TestTraceStartStop(TraceIntelPTTestCaseBase): mydir = TestBase.compute_mydir(__file__) def expectGenericHelpMessageForStartCommand(self): ...
apache-2.0
dharmabumstead/ansible
lib/ansible/modules/network/nxos/nxos_igmp.py
81
4827
#!/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
aclifton/cpeg853-gem5
src/dev/alpha/Tsunami.py
23
5474
# Copyright (c) 2005-2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
radipiz/YN-Recorder
ynrecord.py
1
3429
#!/usr/bin/env python3 import argparse import logging import os from lib import yn def main(): args = parse_args() if yn.URLBASE in args.start: # record more proceed_url(args.start) else: proceed_user(args.start, live_yes=args.yes, only_live=args.onlylive) def proceed_user(usern...
gpl-2.0
derekjchow/models
official/resnet/keras/keras_cifar_main.py
1
7184
# Copyright 2018 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
dc3-plaso/plaso
tests/cli/tools.py
1
10156
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the CLI tools classes.""" import argparse import io import locale import sys import unittest from plaso.cli import tools from plaso.lib import errors from tests.cli import test_lib class CLIToolTest(test_lib.CLIToolTestCase): """Tests for the CLI tool base c...
apache-2.0
SOKP/external_chromium_org
tools/cygprofile/symbolize.py
43
8785
#!/usr/bin/python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Symbolize log file produced by cypgofile instrumentation. Given a log file and the binary being profiled (e.g. executable, shared libra...
bsd-3-clause
afrancis13/bungiesearch
setup.py
1
1554
# -*- coding: utf-8 -*- import sys from os.path import join, dirname from setuptools import setup, find_packages VERSION = (1, 1, 0) __version__ = VERSION __versionstr__ = '.'.join(map(str, VERSION)) long_description = 'Should have been loaded from README.md.' with open(join(dirname(__file__), 'README.md')) as f: ...
bsd-3-clause
mani2012/SplitQsub
splitqsub/split_qsub.py
1
3629
#!/usr/bin/env python # Author: Solaiappan Manimaran # Splits a commands file into multiple qsub files #usage information: split_qsub.py -h # SplitQsub 1.0 - Python program that given a set of commands in one file, # will split it in to multiple qsub files, # which can then be submitted to...
gpl-2.0
rhinstaller/pykickstart
tests/commands/deviceprobe.py
3
1771
# Andy Lindeberg <alindebe@redhat.com> # # Copyright 2009 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # will be use...
gpl-2.0
JWDebelius/scikit-bio
skbio/format/sequences/__init__.py
2
1054
r""" Format biological sequences (:mod:`skbio.format.sequences`) =========================================================== .. currentmodule:: skbio.format.sequences This module provides functions for writing sequence files in a variety of different formats, the available formatters are listed below. Functions ----...
bsd-3-clause
abel-von/commons
src/python/twitter/common/dirutil/chroot.py
14
6425
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
andychase/reparse
doc/source/conf.py
1
7993
# -*- coding: utf-8 -*- # # Reparse documentation build configuration file, created by # sphinx-quickstart on Mon Aug 12 16:05:44 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
mit
Zyell/home-assistant
homeassistant/components/sensor/torque.py
5
3109
""" Support for the Torque OBD application. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.torque/ """ import re from homeassistant.const import HTTP_OK from homeassistant.helpers.entity import Entity DOMAIN = 'torque' DEPENDENCIES = ['http'] S...
mit
noroutine/ansible
lib/ansible/modules/remote_management/foreman/katello.py
56
16541
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Eric D Helms <ericdhelms@gmail.com> # 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...
gpl-3.0
mika76/Wox
PythonHome/Lib/site-packages/requests/packages/chardet/universaldetector.py
744
6831
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
venmo/ansible
lib/ansible/playbook/handler.py
237
1957
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
yoshw/oh-my-zsh
plugins/git-prompt/gitstatus.py
492
2648
#!/usr/bin/env python from __future__ import print_function import sys import re import shlex from subprocess import Popen, PIPE, check_output def get_tagname_or_hash(): """return tagname if exists else hash""" cmd = 'git log -1 --format="%h%d"' output = check_output(shlex.split(cmd)).decode('utf-8').str...
mit
kit-tm/Labs
03_SDN/pox/tools/reindent-pox.py
80
10490
#! /usr/bin/env python # Released to the public domain, by Tim Peters, 03 October 2000. """reindent [-d][-r][-v] [ path ... ] -d (--dryrun) Dry run. Analyze, but don't make any changes to, files. -r (--recurse) Recurse. Search for all .py files in subdirectories too. -n (--nobackup) No backup. Does not make a...
bsd-2-clause
dhp-denero/LibrERP
account_due_list/__init__.py
2
1099
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) # Copyright (C) 2014 Didotech SRL # # This program is free software...
agpl-3.0
jfpla/odoo
addons/account_budget/wizard/account_budget_report.py
375
2067
# -*- 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
atul-bhouraskar/django
tests/template_tests/filter_tests/test_time.py
326
1812
from datetime import time from django.template.defaultfilters import time as time_filter from django.test import SimpleTestCase from django.utils import timezone from ..utils import setup from .timezone_utils import TimezoneTestCase class TimeTests(TimezoneTestCase): """ #20693: Timezone support for the tim...
bsd-3-clause
iulian787/spack
var/spack/repos/builtin/packages/quicksilver/package.py
3
2055
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Quicksilver(MakefilePackage): """Quicksilver is a proxy application that represents some e...
lgpl-2.1
gooofy/zamia-ai
tests/bench_compile.py
3
1605
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017 Guenter Bartsch, Heiko Schaefer # # 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/LICEN...
apache-2.0
Tayamarn/socorro
socorro/scripts/__init__.py
1
2322
import argparse class WrappedTextHelpFormatter(argparse.HelpFormatter): """Subclass that wraps description and epilog text taking paragraphs into account""" def _fill_text(self, text, width, indent): """Wraps text like HelpFormatter, but doesn't squash lines This makes it easier to do lists ...
mpl-2.0
AltSchool/django
tests/files/tests.py
277
11286
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gzip import os import struct import tempfile import unittest from io import BytesIO, StringIO from django.core.files import File from django.core.files.base import ContentFile from django.core.files.move import file_move_safe from django.core.file...
bsd-3-clause
victorlapin/kernel_lge_bullhead-NG
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
CalmYak/N1-Kernel-Source-4.2
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
IRI-Research/django
tests/view_tests/tests/test_debug.py
3
33138
# -*- coding: utf-8 -*- # This coding header is significant for tests, as the debug view is parsing # files to search for such a header to decode the source file content from __future__ import unicode_literals import importlib import inspect import os import re import shutil import sys from tempfile import NamedTempor...
bsd-3-clause
davidzchen/jsonnet
case_studies/micromanage/packer.py
6
4791
# 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 required by applicable law or ag...
apache-2.0
abhattad4/Digi-Menu
build/lib.linux-x86_64-2.7/django/db/backends/sqlite3/schema.py
61
11377
import codecs import copy from decimal import Decimal from django.apps.registry import Apps from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.utils import six class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_delete_table = "DROP TABLE %(table)s" sql_create_inline_fk = ...
bsd-3-clause
indictranstech/reciphergroup-erpnext
erpnext/config/learn.py
17
4369
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("General"), "items": [ { "type": "help", "label": _("Navigating"), "youtube_id": "YDoI2DF4Lmc" }, { "type": "help", "label": _("Setup Wizard"), "youtube_id": "oIOf_zCFWK...
agpl-3.0
ecoal95/servo
tests/wpt/web-platform-tests/webdriver/tests/find_element/user_prompts.py
24
3954
# META: timeout=long import pytest from tests.support.asserts import ( assert_error, assert_same_element, assert_success, assert_dialog_handled, ) from tests.support.inline import inline def find_element(session, using, value): return session.transport.send( "POST", "session/{session_id}...
mpl-2.0
szeged/servo
tests/wpt/web-platform-tests/tools/third_party/py/py/_xmlgen.py
90
8364
""" module for generating and serializing xml and html structures by using simple python objects. (c) holger krekel, holger at merlinux eu. 2009 """ import sys, re if sys.version_info >= (3,0): def u(s): return s def unicode(x, errors=None): if hasattr(x, '__unicode__'): return x._...
mpl-2.0
GeosoftInc/gxpy
geosoft/gxapi/GXDBWRITE.py
1
11130
### extends 'class_empty.py' ### block ClassImports # NOTICE: Do not edit anything here, it is generated code from . import gxapi_cy from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref from .GXDB import GXDB from .GXVA import GXVA from .GXVV import GXVV ### endblock ClassImports ### block Header # NOTIC...
bsd-2-clause
nirmeshk/oh-mainline
vendor/packages/scrapy/scrapy/utils/request.py
25
3547
""" This module provides some useful functions for working with scrapy.http.Request objects """ import hashlib import weakref from urlparse import urlunparse from twisted.internet.defer import Deferred from w3lib.http import basic_auth_header from scrapy.utils.url import canonicalize_url from scrapy.utils.httpobj im...
agpl-3.0
apache/incubator-airflow
airflow/providers/databricks/operators/databricks.py
5
22258
# # 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...
apache-2.0
dimagol/trex-core
scripts/external_libs/pyzmq-14.5.0/python2/intel/ucs4/64bit/zmq/backend/cffi/message.py
41
1407
"""Dummy Frame object""" # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. from ._cffi import ffi, C import zmq from zmq.utils.strtypes import unicode try: view = memoryview except NameError: view = buffer _content = lambda x: x.tobytes() if type(x) == memoryview e...
apache-2.0
hpcloud-mon/tempest
tempest/api/compute/admin/test_flavors_access_negative.py
4
6877
# Copyright 2013 IBM Corporation # 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 ...
apache-2.0
zifeo/nest-simulator
pynest/examples/brunel_alpha_nest.py
9
11722
# -*- coding: utf-8 -*- # # brunel_alpha_nest.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 Licen...
gpl-2.0
yasoob/youtube-dl-GUI
youtube_dl/extractor/dbtv.py
14
1955
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class DBTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?dagbladet\.no/video/(?:(?:embed|(?P<display_id>[^/]+))/)?(?P<id>[0-9A-Za-z_-]{11}|[a-zA-Z0-9]{8})' _TESTS = [{ 'url': 'https://www.dagbla...
mit
haoyuchen1992/osf.io
website/archiver/model.py
38
5944
import datetime from modularodm import fields from framework.mongo import ObjectId from framework.mongo import StoredObject from website.archiver import ( ARCHIVER_INITIATED, ARCHIVER_SUCCESS, ARCHIVER_FAILURE, ARCHIVER_FAILURE_STATUSES ) from website.addons.base import StorageAddonBase from website...
apache-2.0
Laisky/ramjet
ramjet/utils/__init__.py
1
3895
import binascii import datetime import logging import multiprocessing import os import pickle import random import re import string import sys from logging.handlers import RotatingFileHandler as RFHandler import pytz from kipp.options import opt from kipp.utils import setup_logger from ramjet.engines import thread_exe...
mit
alexallah/django
django/core/mail/backends/base.py
129
1660
"""Base email backend class.""" class BaseEmailBackend: """ Base class for email backend implementations. Subclasses must at least overwrite send_messages(). open() and close() can be called indirectly by using a backend object as a context manager: with backend as connection: ...
bsd-3-clause
ThinkboxSoftware/Deadline
Custom/events/Zabbix/API/requests/packages/urllib3/util/ssl_.py
1
4364
from binascii import hexlify, unhexlify from hashlib import md5, sha1 from ..exceptions import SSLError try: # Test for SSL features SSLContext = None HAS_SNI = False import ssl from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23 from ssl import SSLContext # Modern SSL? fr...
apache-2.0
ayoubg/gem5-graphics
gem5/util/batch/batch.py
90
7895
# Copyright (c) 2006 The Regents of The University of Michigan # 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
Distrotech/intellij-community
python/lib/Lib/dummy_thread.py
86
4494
"""Drop-in replacement for the thread module. Meant to be used as a brain-dead substitute so that threaded code does not need to be rewritten for when the thread module is not present. Suggested usage is:: try: import thread except ImportError: import dummy_thread as thread """ __author__ = ...
apache-2.0
huzq/scikit-learn
sklearn/tests/test_random_projection.py
9
13850
import functools from typing import List, Any import numpy as np import scipy.sparse as sp import pytest from sklearn.metrics import euclidean_distances from sklearn.random_projection import johnson_lindenstrauss_min_dim from sklearn.random_projection import _gaussian_random_matrix from sklearn.random_projection im...
bsd-3-clause
USStateDept/FPA_Core
openspending/model/metadataorg.py
2
5152
from datetime import datetime from sqlalchemy.orm import reconstructor, relationship, backref from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.types import Integer, Unicode, Boolean, DateTime from sqlalchemy import BigInteger from sqlalchemy.sql.expression import false, or_ from sqlalchemy.ext.associati...
agpl-3.0
mateor/pants
tests/python/pants_test/tasks/test_bootstrap_jvm_tools_integration.py
20
1582
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.util.cont...
apache-2.0
appapantula/scikit-learn
examples/neural_networks/plot_rbm_logistic_classification.py
258
4609
""" ============================================================== Restricted Boltzmann Machine features for digit classification ============================================================== For greyscale image data where pixel values can be interpreted as degrees of blackness on a white background, like handwritten...
bsd-3-clause
pombreda/syzygy
third_party/numpy/files/numpy/ma/tests/test_extras.py
76
33410
# pylint: disable-msg=W0611, W0612, W0511 """Tests suite for MaskedArray. Adapted from the original test_ma by Pierre Gerard-Marchant :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: test_extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ __author__ = "Pierre GF Gerard-Marchant ($...
apache-2.0
gavioto/rietveld
codereview/patiencediff.py
28
3535
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
wolfier/incubator-airflow
tests/api/client/test_local_client.py
5
5659
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
sunqb/oa_qian
flask/Lib/site-packages/setuptools/command/build_py.py
19
9595
from glob import glob from distutils.util import convert_path import distutils.command.build_py as orig import os import fnmatch import textwrap import io import distutils.errors import itertools from setuptools.extern import six from setuptools.extern.six.moves import map, filter, filterfalse try: from setuptool...
apache-2.0
darktears/chromium-crosswalk
tools/telemetry/third_party/modulegraph/modulegraph_tests/testpkg-edgedata/script.py
23
1384
import toplevel_existing import toplevel_nonexisting class MyClass: import toplevel_class_existing import toplevel_class_nonexisting if a == b: import toplevel_conditional_existing import toplevel_conditional_nonexisting try: import toplevel_conditional_import_existing import top...
bsd-3-clause
mr-c/tools-iuc
data_managers/data_manager_snpeff/data_manager/data_manager_snpEff_databases.py
1
3095
#!/usr/bin/env python import sys import os import re import tempfile import subprocess import fileinput import shutil import optparse import urllib2 from ftplib import FTP import tarfile from galaxy.util.json import from_json_string, to_json_string def stop_err(msg): sys.stderr.write(msg) sys.exit(1) def fe...
mit
jiangzhuo/kbengine
kbe/src/lib/python/Lib/_bootlocale.py
168
1301
"""A minimal subset of the locale module used at interpreter startup (imported by the _io module), in order to reduce startup time. Don't import directly from third-party code; use the `locale` module instead! """ import sys import _locale if sys.platform.startswith("win"): def getpreferredencoding(do_setlocale=...
lgpl-3.0
oasiswork/odoo
addons/account/wizard/account_report_partner_ledger.py
378
3538
# -*- 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
timhuanggithub/MyPOX
pox/info/debug_deadlock.py
46
1606
# Copyright 2012 James McCauley # # 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 writi...
apache-2.0
selective-inference/selective-inference
doc/learning_examples/HIV/stability_CV_6000.py
3
3166
import functools import numpy as np from scipy.stats import norm as ndist import regreg.api as rr # load in the X matrix from selection.tests.instance import HIV_NRTI X_full = HIV_NRTI(datafile="NRTI_DATA.txt", standardize=False)[0] from selection.learning.utils import full_model_inference, liu_inference, pivot_pl...
bsd-3-clause
eg-zhang/h2o-2
py/testdir_single_jvm/test_exec2_quantile_bin_defeat.py
9
3584
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i, h2o_cmd import h2o_print as h2p, h2o_summ # quantile lists of 10, 100) exprList = [] QUANTILE = 0.25 print "stress the 1000 fixed binning based on (max-min)/1000" a = [ -1...
apache-2.0
evanthebouncy/nnhmm
radar_lstm/draw.py
6
2538
import numpy as np import matplotlib.pylab as plt import multiprocessing as mp from matplotlib import figure # m = [[0.0, 1.47, 2.43, 3.44, 1.08, 2.83, 1.08, 2.13, 2.11, 3.7], [1.47, 0.0, 1.5, 2.39, 2.11, 2.4, 2.11, 1.1, 1.1, 3.21], [2.43, 1.5, 0.0, 1.22, 2.69, 1.33, 3.39, 2.15, 2.12, 1.87], [3.44, 2.39, 1.22, 0....
mit
kavi112/google-python-exercises
hello.py
1
1071
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ """A tiny Python program to check that Python is working. Try running this program from t...
apache-2.0
Accelerite/cinder
cinder/tests/api/contrib/test_extended_snapshot_attributes.py
3
3658
# Copyright 2012 OpenStack Foundation # 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 requ...
apache-2.0
schapman1974/tinymongo
setup.py
1
2500
import io import os from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand def read(*names, **kwargs): """Read a file.""" return io.open( os.path.join(os.path.dirname(__file__), *names), encoding=kwargs.get('encoding', 'utf8') ).read() def pars...
mit