repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
LucasRoesler/django-encrypted-json
refs/heads/master
tests/test_app/migrations/0003_testmodel_partial_encrypt_w_default.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django_encrypted_json.fields class Migration(migrations.Migration): dependencies = [ ('test_app', '0002_testmodel_partial_encrypt'), ] operations = [ migrations.AddField( ...
kimimj/scrapy
refs/heads/master
scrapy/contrib/debug.py
144
import warnings from scrapy.exceptions import ScrapyDeprecationWarning warnings.warn("Module `scrapy.contrib.debug` is deprecated, " "use `scrapy.extensions.debug` instead", ScrapyDeprecationWarning, stacklevel=2) from scrapy.extensions.debug import *
iuliat/nova
refs/heads/master
nova/tests/unit/network/test_api.py
37
# Copyright 2012 Red Hat, 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...
czXiaoxi/oh-my-zsh
refs/heads/master
plugins/git-prompt/gitstatus.py
343
#!/usr/bin/env python # -*- coding: UTF-8 -*- from subprocess import Popen, PIPE import re # change those symbols to whatever you prefer symbols = { 'ahead of': '↑', 'behind': '↓', 'staged': '♦', 'changed': '‣', 'untracked': '…', 'clean': '⚡', 'unmerged': '≠', 'sha1': ':' } output, err...
maxim5/hyper-engine
refs/heads/master
hyperengine/spec/sugar.py
1
#! /usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'maxim' import math from scipy import stats from .nodes import * def wrap(node, transform): if transform is not None: return MergeNode(transform, node) return node def uniform(start=0.0, end=1.0, transform=None, name=None): node = UniformNode(st...
rogerscristo/BotFWD
refs/heads/master
env/lib/python3.6/site-packages/telegram/inline/inputcontactmessagecontent.py
1
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2017 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as publish...
adlnet/ADL_LRS
refs/heads/master
lrs/managers/AgentProfileManager.py
2
import json import datetime from django.core.files.base import ContentFile from django.core.exceptions import ValidationError from django.utils.timezone import utc from ..models import AgentProfile from ..exceptions import IDNotFoundError, ParamError from ..utils import etag class AgentProfileManager(): def __...
DISKonnectd/phantom_apps
refs/heads/master
sharepoint/dependencies/lxml/html/soupparser.py
8
"""External interface to the BeautifulSoup HTML parser. """ __all__ = ["fromstring", "parse", "convert_tree"] import re from lxml import etree, html try: from bs4 import ( BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableString, Declaration, Doctype) _DECLARATION_OR_DOCTYPE = (Dec...
puzan/ansible
refs/heads/devel
lib/ansible/modules/windows/win_tempfile.py
15
#!/usr/bin/python #coding: utf-8 -*- # (c) 2017 Dag Wieers <dag@wieers.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 # (...
mluo613/osf.io
refs/heads/develop
website/conferences/views.py
3
# -*- coding: utf-8 -*- import httplib import logging from django.db import transaction from django.utils import timezone from modularodm import Q from modularodm.exceptions import ModularOdmException from framework.auth import get_or_create_user from framework.exceptions import HTTPError from framework.flask import...
humanlongevity/luigi
refs/heads/master
luigi/mrrunner.py
65
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
schelleg/PYNQ
refs/heads/master
pynq/lib/logictools/tests/test_waveform.py
4
# Copyright (c) 2016, Xilinx, 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of con...
fxfitz/ansible
refs/heads/devel
lib/ansible/modules/network/netscaler/netscaler_cs_action.py
72
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
serviceagility/boto
refs/heads/develop
boto/glacier/job.py
153
# -*- 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...
GitHubFriction/pywinrm
refs/heads/master
winrm/tests/kerberos/test_cffi_full.py
4
import os from cffi import FFI ffi = FFI() ffi.cdef(""" // Original source could be found here: // https://github.com/krb5/krb5/blob/master/src/lib/gssapi/generic/gssapi.hin /* -*- mode: c; indent-tabs-mode: nil -*- */ /* * Copyright 1993 by OpenVision Technologies, Inc. * * Permission to use, copy, modify, distri...
fabiopereira/fabiopereirame_jekyll_mickey_blog
refs/heads/master
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_sln.py
1831
#!/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. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
glenn124f/treeherder
refs/heads/master
treeherder/perf/migrations/0009_refactor_perfalerts.py
3
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('model', '0008__add_best_fields_to_failureline'), ('perf', '0008_delete_perfalerts'), ] operations = [ migrations.Cre...
cloudera/hue
refs/heads/master
desktop/core/ext-py/django-openid-auth-0.14/django_openid_auth/management/commands/__init__.py
100
# django-openid-auth - OpenID integration for django.contrib.auth # # Copyright (C) 2009-2013 Canonical Ltd. # # 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 ...
neharejanjeva/techstitution
refs/heads/master
app/logs/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py
1776
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
wdaher/zulip
refs/heads/master
confirmation/util.py
126
# -*- coding: utf-8 -*- # Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com> __revision__ = '$Id: util.py 3 2008-11-18 07:33:52Z jarek.zgoda $' from django.conf import settings def get_status_field(app_label, model_name): model = '%s.%s' % (app_label, model_name) mapping = getattr(settings, 'STATUS_FI...
lduarte1991/edx-platform
refs/heads/master
common/djangoapps/student/tests/test_reset_password.py
4
""" Test the various password reset flows """ import json import re import unittest import ddt from django.conf import settings from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX from django.contrib.auth.models import User from django.contrib.auth.tokens import default_token_generator from django.core.ca...
jmartinezchaine/OpenERP
refs/heads/master
openerp/addons/project/wizard/project_task_reevaluate.py
9
# -*- 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...
egafford/sahara
refs/heads/master
sahara/plugins/cdh/abstractversionhandler.py
2
# Copyright (c) 2014 Mirantis, 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 wri...
BanBxda/Sense_4.3
refs/heads/master
tools/perf/scripts/python/sctop.py
11180
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
Johnzero/OE7
refs/heads/master
OE-debug文件/会计科目/l10n_br/__init__.py
430
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # # ...
holmes/intellij-community
refs/heads/master
python/testData/override/py3k_after.py
83
class A: def m(self): pass class B(A): def m(self): <selection>super().m()</selection>
alexlo03/ansible
refs/heads/devel
lib/ansible/modules/network/eos/eos_eapi.py
69
#!/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...
rleh/ocyco-server-python
refs/heads/develop
app/way_type_descriptions/models.py
1
from app import db class WayTypeDescriptions(db.Model): __tablename__ = 'way_type_descriptions' _local_id = db.Column('local_id', db.BigInteger, db.Sequence('way_type_description_local_id_seq'), primary_key=True, unique=True, autoincrement=True) id = db.Column('id', db.BigInteger...
JulienMcJay/eclock
refs/heads/master
windows/Python27/Lib/site-packages/docutils/io.py
104
# $Id: io.py 7596 2013-01-25 13:42:17Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ I/O classes provide a uniform API for low-level input and output. Subclasses exist for a variety of input/output mechanisms. """ __docformat__ = 'reStructured...
mojeto/django
refs/heads/master
tests/m2m_signals/tests.py
84
""" Testing signals emitted on changing m2m relations. """ from django.db import models from django.test import TestCase from .models import Car, Part, Person, SportsCar class ManyToManySignalsTest(TestCase): def m2m_changed_signal_receiver(self, signal, sender, **kwargs): message = { 'insta...
kantlove/flask-simple-page
refs/heads/master
Lib/site-packages/pip/_vendor/distlib/util.py
224
# # Copyright (C) 2012-2014 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import shutil import socket import...
frontibit/riestercoin
refs/heads/master
contrib/spendfrom/spendfrom.py
792
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
lpabon/qemu
refs/heads/master
scripts/analyse-9p-simpletrace.py
333
#!/usr/bin/env python # Pretty print 9p simpletrace log # Usage: ./analyse-9p-simpletrace <trace-events> <trace-pid> # # Author: Harsh Prateek Bora import os import simpletrace symbol_9p = { 6 : 'TLERROR', 7 : 'RLERROR', 8 : 'TSTATFS', 9 : 'RSTATFS', 12 : 'TLOPEN', 13 : 'RLOPEN', ...
beardypig/streamlink
refs/heads/master
tests/plugins/test_bigo.py
2
import unittest from streamlink.plugins.bigo import Bigo class TestPluginBigo(unittest.TestCase): def test_can_handle_url(self): should_match = [ "http://bigo.tv/00000000", "https://bigo.tv/00000000", "https://www.bigo.tv/00000000", "http://www.bigo.tv/0000...
CloudBoltSoftware/cloudbolt-forge
refs/heads/master
blueprints/aws_aurora_db_clusters/management/delete_snapshot.py
1
""" Delete snapshot action for AWS RDS DB snapshot. """ from resourcehandlers.aws.models import AWSHandler from common.methods import set_progress from infrastructure.models import CustomField, Environment import boto3 import time from django.db import IntegrityError def generate_options_for_snapshot(server=None, **kw...
ArcherSys/ArcherSys
refs/heads/master
Lib/site-packages/nbconvert/preprocessors/latex.py
26
"""Module that allows latex output notebooks to be conditioned before they are converted. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the fil...
maclandrol/profileNJ
refs/heads/master
profileNJ/TreeLib/__init__.py
1
from TreeClass import TreeClass import TreeUtils import ClusterUtils import SimulModel from memorize import memorize import params __all__ = ["TreeUtils", "ClusterUtils", "TreeClass", "memorize", "params", 'SimulModel']
alzeih/python-vodem-vodafone-K4607-Z
refs/heads/master
test/unit/api/test_ipv6_standby_dns_auto.py
1
import unittest from vodem.api import ipv6_standby_dns_auto class TestIpv6StandbyDnsAuto(unittest.TestCase): @classmethod def setUpClass(cls): cls.valid_response = { 'ipv6_standby_dns_auto': '', } def test_call(self): resp = ipv6_standby_dns_auto() self.asser...
ralph-mikera/Routeflow2
refs/heads/master
rflib/ipc/MongoIPC.py
6
import pymongo as mongo from rflib.defs import MONGO_ADDRESS, MONGO_DB_NAME import rflib.ipc.IPC as IPC FROM_FIELD = "from" TO_FIELD = "to" TYPE_FIELD = "type" READ_FIELD = "read" CONTENT_FIELD = "content" # 1 MB for the capped collection CC_SIZE = 1048576 def put_in_envelope(from_, to, msg): envelope = {} ...
aidan-/ansible-modules-extras
refs/heads/devel
packaging/os/pkgng.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, bleader # Written by bleader <bleader@ratonland.org> # Based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com> # that was based on pacman module written by Afterburn <http://github.com/afterburn> # that was based on apt module written by Matthew W...
alexdglover/shill-isms
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/constants.py
3007
######################## 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...
wwright2/dcim3-angstrom1
refs/heads/master
sources/openembedded-core/scripts/lib/wic/3rdparty/pykickstart/base.py
14
# # Chris Lumens <clumens@redhat.com> # # Copyright 2006, 2007, 2008 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 # ...
stevekuznetsov/ansible
refs/heads/devel
lib/ansible/modules/cloud/cloudstack/cs_vmsnapshot.py
48
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
open-homeautomation/home-assistant
refs/heads/dev
homeassistant/components/http/ban.py
2
"""Ban logic for HTTP component.""" import asyncio from collections import defaultdict from datetime import datetime from ipaddress import ip_address import logging from aiohttp.web_exceptions import HTTPForbidden, HTTPUnauthorized import voluptuous as vol from homeassistant.components import persistent_notification ...
jedie/bootstrap_env
refs/heads/master
bootstrap_env/boot_source/{{cookiecutter.project_name}}/{{cookiecutter.bootstrap_filename}}.py
1
#!/usr/bin/python3 """ {{cookiecutter.project_name}} bootstrap ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A interactive shell for booting the '{{cookiecutter.project_name}}' project. Note: - This file is "self contained". - It used **only** stuff from P...
pentestfail/TA-Github
refs/heads/master
bin/ta_github/solnlib/packages/requests/packages/urllib3/contrib/ntlmpool.py
199
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ from __future__ import absolute_import try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from nt...
neogi/machine-learning
refs/heads/master
classification/logistic_regression/logistic_regression_mle_sg.py
1
# Imports import string import numpy as np # Function to remove punctuations def remove_punctuation(text): """ Purpose: Remove all punctuations from a line of text Input : A line of text Output : Text without punctuations """ return string.translate(text, None, string.punctuation) # Function ...
Soya93/Extract-Refactoring
refs/heads/master
python/testData/folding/longStringsFolding.py
40
print(<fold text='"..."'>"This is " "really " "long string. " "It should be foldable"</fold>)
patilsangram/erpnext
refs/heads/develop
erpnext/patches/v4_0/fix_employee_user_id.py
119
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import get_fullname def execute(): for user_id in frappe.db.sql_list("""select distinct user_id from `tabEmployee` ...
arantebillywilson/python-snippets
refs/heads/master
microblog/flask/lib/python3.5/site-packages/whoosh/qparser/plugins.py
52
# Copyright 2011 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
mixxorz/wagtail
refs/heads/master
wagtail/images/formats.py
15
from django.utils.html import escape from django.utils.translation import ugettext_lazy as _ from wagtail.utils.apps import get_app_submodules from .shortcuts import get_rendition_or_not_found class Format: def __init__(self, name, label, classnames, filter_spec): self.name = name self.label = l...
asm666/sympy
refs/heads/master
examples/beginner/differentiation.py
106
#!/usr/bin/env python """Differentiation example Demonstrates some differentiation operations. """ import sympy from sympy import pprint def main(): a = sympy.Symbol('a') b = sympy.Symbol('b') e = (a + 2*b)**5 print("\nExpression : ") print() pprint(e) print("\n\nDifferentiating w.r.t....
str90/RK3188_tablet_kernel_sources
refs/heads/master
tools/perf/python/twatch.py
3213
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
alextruberg/custom_django
refs/heads/master
django/contrib/sitemaps/tests/test_http.py
109
from __future__ import unicode_literals import os from datetime import date from django.conf import settings from django.contrib.sitemaps import Sitemap, GenericSitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test.utils import override_settings ...
opennode/waldur-mastermind
refs/heads/develop
src/waldur_slurm/tests/test_association.py
1
from rest_framework import test from . import factories, fixtures class AssociationGetTest(test.APITransactionTestCase): def setUp(self) -> None: self.fixture = fixtures.SlurmFixture() self.association = self.fixture.association self.allocation = self.fixture.allocation self.clien...
fuselock/odoo
refs/heads/8.0
addons/l10n_bo/__openerp__.py
259
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
colemanja91/PyEloqua-Examples
refs/heads/master
venv/lib/python3.4/site-packages/pip/req/__init__.py
806
from __future__ import absolute_import from .req_install import InstallRequirement from .req_set import RequirementSet, Requirements from .req_file import parse_requirements __all__ = [ "RequirementSet", "Requirements", "InstallRequirement", "parse_requirements", ]
hyperspy/hyperspy
refs/heads/RELEASE_next_minor
hyperspy/drawing/_widgets/vertical_line.py
2
# -*- coding: utf-8 -*- # Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
Juniper/ceilometer
refs/heads/master
ceilometer/alarm/rpc.py
2
# # Copyright 2013 eNovance <licensing@enovance.com> # # Authors: Mehdi Abaakouk <mehdi.abaakouk@enovance.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/l...
s-macke/Kerasimo
refs/heads/master
models/mnist_acgan.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Train an Auxiliary Classifier Generative Adversarial Network (ACGAN) on the MNIST dataset. See https://arxiv.org/abs/1610.09585 for more details. You should start to see reasonable images after ~5 epochs, and good images by ~15 epochs. You should use a GPU, as the conv...
stefan-jonasson/home-assistant
refs/heads/dev
homeassistant/components/light/isy994.py
9
""" Support for ISY994 lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.isy994/ """ import logging from typing import Callable from homeassistant.components.light import ( Light, SUPPORT_BRIGHTNESS) import homeassistant.components.isy994...
smunaut/gnuradio
refs/heads/master
gnuradio-runtime/python/gnuradio/gru/gnuplot_freqz.py
59
#!/usr/bin/env python # # Copyright 2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
s0lst1c3/eaphammer
refs/heads/master
local/hostapd-eaphammer/wpaspy/test.py
2
#!/usr/bin/python # # Test script for wpaspy # Copyright (c) 2013, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import os import sys import time import wpaspy wpas_ctrl = '/var/run/wpa_supplicant' def wpas_connect(host=None, port=9877...
mancoast/CPythonPyc_test
refs/heads/master
cpython/213_test_pty.py
2
import pty, os, sys from test_support import verbose, TestFailed, TestSkipped TEST_STRING_1 = "I wish to buy a fish license.\n" TEST_STRING_2 = "For my pet fish, Eric.\n" if verbose: def debug(msg): print msg else: def debug(msg): pass # Marginal testing of pty suite. Cannot do extensive 'do ...
eviljeff/zamboni
refs/heads/master
mkt/ratings/validators.py
25
from django.core.exceptions import ValidationError def validate_rating(value): if value > 5 or value < 1 or not isinstance(value, (int, long)): raise ValidationError('Rating must be an integer between 1 and 5, ' 'inclusive')
airbnb/caravel
refs/heads/master
tests/base_tests.py
1
# 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...
jernsthausen/datesplitter
refs/heads/master
lib/python2.7/site-packages/setuptools/tests/test_integration.py
125
"""Run some integration tests. Try to install a few packages. """ import glob import os import sys import pytest from setuptools.command.easy_install import easy_install from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution from setuptools.compat import urlopen d...
bliti/django-nonrel-1.5
refs/heads/nonrel-1.5
tests/regressiontests/decorators/tests.py
48
import warnings from functools import wraps from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required, permission_required, user_passes_test from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed from django.middleware.clickjack...
codysk/BGmi
refs/heads/master
tests/test_cli.py
1
from unittest import mock from bgmi.lib.models import Bangumi, Filter, Followed from bgmi.main import main from bgmi.website.bangumi_moe import BangumiMoe def test_gen_nginx_conf(): main("gen nginx.conf --server-name _".split()) def test_cal_force_update(clean_bgmi): class MockWebsite(BangumiMoe): ...
catchmrbharath/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/echo_wsh.py
494
# 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...
defionscode/ansible
refs/heads/devel
lib/ansible/modules/network/aci/aci_epg_to_contract.py
15
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
kubeflow/kfp-tekton
refs/heads/master
backend/src/apiserver/visualization/types/table.py
2
# Copyright 2019 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, ...
tudennis/LeetCode---kamyu104-11-24-2015
refs/heads/master
Python/max-area-of-island.py
2
# Time: O(m * n) # Space: O(m * n), the max depth of dfs may be m * n # Given a non-empty 2D array grid of 0's and 1's, # an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) # You may assume all four edges of the grid are surrounded by water. # # Find the maximum area o...
MatthewWilkes/django
refs/heads/master
django/db/models/fields/related_lookups.py
287
from django.db.models.lookups import ( Exact, GreaterThan, GreaterThanOrEqual, In, LessThan, LessThanOrEqual, ) class MultiColSource(object): contains_aggregate = False def __init__(self, alias, targets, sources, field): self.targets, self.sources, self.field, self.alias = targets, sources, field...
sigma-random/scrapy
refs/heads/master
scrapy/utils/response.py
28
""" This module provides some useful functions for working with scrapy.http.Response objects """ import os import re import weakref import webbrowser import tempfile from twisted.web import http from twisted.web.http import RESPONSES from w3lib import html from scrapy.http import HtmlResponse, TextResponse from scra...
fxfitz/ansible
refs/heads/devel
lib/ansible/modules/cloud/ovirt/ovirt_vmpools.py
75
#!/usr/bin/python # -*- 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 #...
Mhynlo/SickRage
refs/heads/master
lib/unidecode/x1d7.py
248
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
bjornlevi/5thpower
refs/heads/master
afmaeli/env/lib/python3.6/site-packages/setuptools/command/py36compat.py
286
import os from glob import glob from distutils.util import convert_path from distutils.command import sdist from setuptools.extern.six.moves import filter class sdist_add_defaults: """ Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code ...
viewdy/phantomjs2
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py
122
# Copyright (C) 2010 Apple Inc. All rights reserved. # Copyright (C) 2011 Patrick Gansterer <paroga@paroga.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the abov...
dcowden/cadquery-freecad-module
refs/heads/master
CadQuery/Examples/Ex009_Polylines.py
1
#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part #Set up our Length, Height, Width, and thickness that will be used to define the locations that the polyline #is drawn to/thru (L, H, W, t) = (100.0, 20.0, 20.0, 1.0) #Define the locations that the polyline will ...
ehashman/oh-mainline
refs/heads/master
vendor/packages/docutils/test/functional/tests/_standalone_rst_defaults.py
18
# Keyword parameters passed to publish_file. reader_name = "standalone" parser_name = "rst" # Settings. settings_overrides['sectsubtitle_xform'] = 1 settings_overrides['syntax_highlight'] = 'none'
tracierenea/gnuradio
refs/heads/master
gr-vocoder/python/vocoder/__init__.py
57
# # Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # #...
roblad/sensmon
refs/heads/master
sensnode/decoders/gaz.py
1
#!/usr/bin/python2 # -*- coding: utf-8 -*- import time import datetime import inspect import simplejson as json import sys import os import cPickle as pickle def gaz(data): """Pomiar: - swiatła, - wlgotności - temperatury - ciśnienia - stanu baterii - napięcia beterii >> a = "OK 2 0 0 ...
ParticulateSolutions/django-sofortueberweisung
refs/heads/master
setup.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup import re import os import sys def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init__.py')).read() return re.match("__...
msshapira/yowsup
refs/heads/master
yowsup/layers/protocol_groups/protocolentities/iq_groups_list.py
20
from yowsup.common import YowConstants from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .iq_groups import GroupsIqProtocolEntity class ListGroupsIqProtocolEntity(GroupsIqProtocolEntity): ''' <iq id="{{id}}"" type="get" to="g.us" xmlns="w:g2"> <"{{participating | owning}}"></"{{participat...
idigbio-api-hackathon/LifemapperQgis
refs/heads/master
lifemapperTools/LmShared/LmCommon/common/lmAttObject.py
1
""" @summary: Module containing some base Lifemapper objects @author: CJ Grady @status: beta @version: 2.0 @license: gpl2 @copyright: Copyright (C) 2015, University of Kansas Center for Research Lifemapper Project, lifemapper [at] ku [dot] edu, Biodiversity Institute, 1345 Jayhawk Boule...
openstack/vitrage
refs/heads/master
vitrage/evaluator/template_functions/__init__.py
1
# Copyright 2019 - Nokia # # 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, sof...
int19h/PTVS
refs/heads/master
Python/Product/TestAdapter/testlauncher.py
3
# Python Tools for Visual Studio # Copyright(c) Microsoft 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 # # THI...
datakortet/django-cms
refs/heads/master
cms/migrations/0022_login_required_added.py
385
# -*- 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): # Dummy migration pass def backwards(self, orm): # Dummy migration pass models = { ...
unreal666/outwiker
refs/heads/master
src/outwiker/gui/editorfilesdroptarget.py
2
# -*- coding: utf-8 -*- import os.path import wx from outwiker.core.attachment import Attachment class EditorFilesDropTarget(wx.FileDropTarget): """ Base class to drag files to the editors """ def __init__(self, application, editor): wx.FileDropTarget.__init__(self) self._applicatio...
Valera1978/android_kernel_samsung_viennalte
refs/heads/cm14.0
scripts/tracing/draw_functrace.py
14679
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
insideyourgovernment/insideyourgovernment_api
refs/heads/master
crawlers/socrata_dataset_catalog.py
1
from joblib import Parallel, delayed import multiprocessing import traceback import requests num_cores = multiprocessing.cpu_count()*20 import rethinkdb as r import dateutil import dateutil.parser from pytz import timezone from datetime import date from datetime import datetime tz = timezone('America/Los_Angeles') ...
mlperf/training_results_v0.6
refs/heads/master
Google/benchmarks/transformer/implementations/tpu-v3-1024-transformer/dataset_preproc/data_generators/lm1b_imdb.py
7
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
orangeduck/PyAutoC
refs/heads/master
Python27/Lib/lib2to3/tests/data/py2_test_grammar.py
285
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. # NOTE: When you run this test as a script from the command line, you # get warnings about certain hex/oct constants. Since those are # issued by the parser, you can't suppress them by adding a # filterwarnings() call to this...
xenserver/xs-cim
refs/heads/master
test/pywbem-tests/MetricTests.py
1
#!/usr/bin/env python '''Copyright (C) 2008 Citrix Systems Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This...
CentreForResearchInAppliedLinguistics/clic
refs/heads/develop
clic/scripts/create_bookcountsjson.py
2
''' TO CREATE bookcounts.json Output format: # [ # ["dickens", # "All Dickens (15 novels)", [3835807, 1348611, 2487196]], # [ # [ # "BH", # "Bleak House", # [ # 354362, # 138453, # 21590...
XiaodunServerGroup/xiaodun-platform
refs/heads/master
lms/lib/xblock/field_data.py
63
""" :class:`~xblock.field_data.FieldData` subclasses used by the LMS """ from xblock.field_data import ReadOnlyFieldData, SplitFieldData from xblock.fields import Scope class LmsFieldData(SplitFieldData): """ A :class:`~xblock.field_data.FieldData` that reads all UserScope.ONE and UserScope.ALL fields fr...
jmuhlich/indra
refs/heads/master
indra/tests/test_statements.py
1
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import os from nose.tools import raises from indra.preassembler.hierarchy_manager import HierarchyManager from indra.preassembler.hierarchy_manager import hierarchies from indra.statements import * from indra.util im...
mixja/eap-sim-lab
refs/heads/master
lib/pyserial-2.7/build/lib/serial/serialutil.py
143
#! python # Python Serial Port Extension for Win32, Linux, BSD, Jython # see __init__.py # # (C) 2001-2010 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, see license.txt # compatibility for older Python < 2.6 try: bytes bytearray except (NameError, AttributeError): # ...
hilaskis/UAV_MissionPlanner
refs/heads/master
Lib/email/utils.py
114
# Copyright (C) 2001-2010 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Miscellaneous utilities.""" __all__ = [ 'collapse_rfc2231_value', 'decode_params', 'decode_rfc2231', 'encode_rfc2231', 'formataddr', 'formatdate', 'getaddresses', 'make_msgid'...