repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
gushie/gushpibot
refs/heads/master
component.py
1
class Component(object): def __init__(self): pass def cleanup(self): pass def check(self): pass def update_menu(self, menu): pass class EventHandler(object): def __init__(self): self.handlers = [] def add(self, func): self.handlers.append(fun...
Zeromixis/ZexGameEngine
refs/heads/master
External/freetype/src/tools/cordic.py
555
# compute arctangent table for CORDIC computations in fttrigon.c import sys, math #units = 64*65536.0 # don't change !! units = 180 * 2**16 scale = units/math.pi shrink = 1.0 comma = "" print "" print "table of arctan( 1/2^n ) for PI = " + repr(units/65536.0) + " units" for n in range(1,32): x = 0.5**n ...
mariansoban/ardupilot
refs/heads/Copter-4.0.x-sobi-phl-8m
Tools/autotest/build-with-disabled-features.py
5
#!/usr/bin/env python from __future__ import print_function ''' Build ArduPilot with various build-time options enabled or disabled Usage is straight forward; invoke this script from the root directory of an ArduPilot checkout: pbarker@bluebottle:~/rc/ardupilot(build-with-disabled-features)$ ./Tools/autotest/build-...
sofiabravo103/virtualfarmacy-api
refs/heads/master
tests/queries/views/test_queries_actions.py
1
import random import pytest import json from django.urls import reverse from rest_framework import status from queries.models import Query from queries.serializers import QuerySerializer from tests.factories import QueryFactory, random_keyword_set @pytest.mark.django_db def test_create_query(client): '''Ensure we ...
danilito19/django
refs/heads/master
tests/staticfiles_tests/__init__.py
12133432
camillemonchicourt/Geotrek
refs/heads/master
geotrek/authent/fixtures/__init__.py
12133432
zvolsky/muzika
refs/heads/master
languages/my.py
151
# coding: utf8 { '!langcode!': 'my', '!langname!': 'Malay', '%d days ago': '%d hari yang lalu', '%d hours ago': '%d jam yang lalu', '%d minutes ago': '%d minit yang lalu', '%d months ago': '%d bulan yang lalu', '%d seconds ago': '%d saat yang lalu', '%d seconds from now': '%d saat dari sekarang', '%d weeks ago': '%d mi...
m4droid/Restriccion-API
refs/heads/master
tests/test_models_base_report.py
2
from .base_tests import BaseTestCase from restriccion.models.base_report import BaseReport class TestModelsRestriction(BaseTestCase): @classmethod def setUpClass(cls): super(TestModelsRestriction, cls).setUpClass() cls.base_report = BaseReport() def test_get_mongo_collection_not_impleme...
bongo-project/bongo
refs/heads/master
src/libs/python/bongo/external/simpletal/simpleTAL.py
1
""" simpleTAL Interpreter Copyright (c) 2005 Colin Stewart (http://www.owlfish.com/) 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...
mzdaniel/oh-mainline
refs/heads/master
vendor/packages/south/south/migration/migrators.py
15
from copy import copy from cStringIO import StringIO import datetime import inspect import sys import traceback from django.core.management import call_command from django.core.management.commands import loaddata from django.db import models import south.db from south import exceptions from south.db import DEFAULT_DB...
harterj/moose
refs/heads/devel
modules/navier_stokes/test/tests/ins/mms/pspg/generate_forcing_functions.py
21
#* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgpl-2.1.html # Note that...
sdgdsffdsfff/redis-ctl
refs/heads/master
utils.py
2
import redistrib.command import file_ipc def masters_detail(host, port): node_details = file_ipc.read_details()['nodes'] result = [] masters, myself = redistrib.command.list_masters(host, port) for n in masters: r = {'host': n.host, 'port': n.port} try: r['slots_count'] = ...
bartholomewbischoff/Sp-Sk
refs/heads/master
node_modules/closure-util/.deps/library/87f29481f1e57fbba986e2304ac80d4173f94c9c/closure/bin/build/depswriter.py
76
#!/usr/bin/env python # # Copyright 2009 The Closure Library 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 ...
stewnorriss/LibCloud
refs/heads/master
libcloud/test/storage/test_google_storage.py
28
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
DOV-Vlaanderen/pydov
refs/heads/master
tests/test_search_sondering.py
1
"""Module grouping tests for the sondering search module.""" import datetime import pandas as pd from owslib.fes import PropertyIsEqualTo from pydov.search.sondering import SonderingSearch from pydov.types.sondering import Sondering from tests.abstract import AbstractTestSearch location_md_metadata = 'tests/data/typ...
matplo/rootutils
refs/heads/master
python/2.7/THnSparseWrapper.py
1
''' Created on Jan 8, 2015 Wrapper class around a ROOT THnSparse adding the functionality of cut and project in one step, making the handling of THnSparses a lot more handy for users. @author: markus ''' from copy import copy,deepcopy from numpy import array as nparray class AxisFormat(object): ''' Definiti...
laslabs/odoo
refs/heads/9.0
setup/win32/win32_service.py
362
# -*- coding: utf-8 -*- import servicemanager import win32api import win32process import win32service import win32serviceutil import subprocess import sys from os.path import dirname, join, split execfile(join(dirname(__file__), '..', 'server', 'openerp', 'release.py')) class OdooService(win32serviceutil.ServiceF...
godfreyy/scrapy
refs/heads/master
tests/test_webclient.py
112
""" from twisted.internet import defer Tests borrowed from the twisted.web.client tests. """ import os from six.moves.urllib.parse import urlparse from twisted.trial import unittest from twisted.web import server, static, error, util from twisted.internet import reactor, defer from twisted.test.proto_helpers import St...
Victor-Haefner/polyvr
refs/heads/master
extras/python/udpsend.py
2
import socket msg = "Hello, World!" sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.sendto(msg, ('141.3.150.20', 6060))
FactoryBoy/factory_boy
refs/heads/master
tests/test_regression.py
1
# Copyright: See the LICENSE file. """Regression tests related to issues found with the project""" import datetime import typing as T import unittest import factory # Example objects # =============== class Author(T.NamedTuple): fullname: str pseudonym: T.Optional[str] = None class Book(T.NamedTuple): ...
citrix-openstack-build/horizon
refs/heads/master
openstack_dashboard/dashboards/admin/instances/tables.py
5
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # Copyright 2012 Nebula, 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://ww...
StevenVanAcker/mitmproxy
refs/heads/master
test/mitmproxy/data/addonscripts/load_error.py
10
def load(_): raise ValueError()
Jackeriss/Typora-Blog
refs/heads/master
app/util/handler_util.py
1
import functools import orjson import os import asyncio import tornado import aiotask_context from schema import Schema, SchemaError from app.util import error_util from app.util.config_util import config from app.config import constant class BasicHandler(tornado.web.RequestHandler): def __init__(self, applicat...
foreni-packages/golismero
refs/heads/master
thirdparty_libs/geopy/distance.py
51
from math import atan, tan, sin, cos, pi, sqrt, atan2, acos, asin from geopy.units import radians from geopy import units, util from geopy.point import Point # Average great-circle radius in kilometers, from Wikipedia. # Using a sphere with this radius results in an error of up to about 0.5%. EARTH_RADIUS = 6372.795 ...
Yas3r/Empire
refs/heads/master
lib/modules/management/enable_rdp.py
22
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Enable-RDP', 'Author': ['@harmj0y'], 'Description': ("Enables RDP on the remote machine and adds a firewall exception."), 'Background' : False, ...
wuhengzhi/chromium-crosswalk
refs/heads/master
chrome/test/ispy/common/ispy_utils.py
88
# 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. """Internal utilities for managing I-Spy test results in Google Cloud Storage. See the ispy.ispy_api module for the external API. """ import collections im...
dmilith/SublimeText3-dmilith
refs/heads/master
Packages/pygments/all/pygments/lexers/_php_builtins.py
48
# -*- coding: utf-8 -*- """ pygments.lexers._php_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file loads the function names and their modules from the php webpage and generates itself. Do not alter the MODULES dict by hand! WARNING: the generation transfers quite much data over your ...
SambaDemon/python_vantiv
refs/heads/master
vantiv/request/model/merchant.py
2
from ..schemas import Schema, fields from ..utilities import frozen class MerchantSchema(Schema): Name = fields.String() AmexMid = fields.String() DiscoverConveyedMid = fields.String() URL = fields.String() CustomerServiceNumber = fields.String() HardCodedBillingDescriptor = fields.String() ...
AutorestCI/azure-sdk-for-python
refs/heads/master
azure-mgmt-servicebus/azure/mgmt/servicebus/models/sb_subscription.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
HuaweiSwitch/ansible
refs/heads/devel
lib/ansible/modules/network/lenovo/cnos_save.py
59
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, 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 # ...
moylop260/odoo-dev
refs/heads/master
addons/project_mrp/__openerp__.py
31
# -*- 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...
graphite-server/graphite-web
refs/heads/master
webapp/graphite/__init__.py
161
# Two wrongs don't make a right, but three lefts do.
Intel-Corporation/tensorflow
refs/heads/master
tensorflow/contrib/summary/summary.py
23
# 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...
stuntman723/rap-analyzer
refs/heads/master
rap_analyzer/lib/python2.7/site-packages/dj_static.py
13
# -*- coding: utf-8 -*- import static from django.conf import settings from django.core.handlers.wsgi import WSGIHandler from django.contrib.staticfiles.handlers import StaticFilesHandler as DebugHandler try: from urllib.parse import urlparse except ImportError: # Python 2 from urlparse import urlparse f...
inclement/kivy
refs/heads/master
examples/frameworks/twisted/echo_client_app.py
13
# install_twisted_rector must be called before importing the reactor from __future__ import unicode_literals from kivy.support import install_twisted_reactor install_twisted_reactor() # A Simple Client that send messages to the Echo Server from twisted.internet import reactor, protocol class EchoClient(protocol.Pr...
MattDevo/edk2
refs/heads/master
AppPkg/Applications/Python/Python-2.7.2/Lib/wave.py
53
"""Stuff to parse WAVE files. Usage. Reading WAVE files: f = wave.open(file, 'r') where file is either the name of a file or an open file pointer. The open file pointer must have methods read(), seek(), and close(). When the setpos() and rewind() methods are not used, the seek() method is not necessar...
kcompher/BuildingMachineLearningSystemsWithPython
refs/heads/master
ch07/figure1.py
4
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import numpy as np from sklearn.datasets import load_boston import pylab as plt from mpltools import st...
raags/ansible-modules-core
refs/heads/devel
test/unit/cloud/openstack/test_os_server.py
85
import mock import pytest import yaml import inspect import collections from cloud.openstack import os_server class AnsibleFail(Exception): pass class AnsibleExit(Exception): pass def params_from_doc(func): '''This function extracts the docstring from the specified function, parses it as a YAML d...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/graph_objs/candlestick/__init__.py
2
import sys if sys.version_info < (3, 7): from ._decreasing import Decreasing from ._hoverlabel import Hoverlabel from ._increasing import Increasing from ._line import Line from ._stream import Stream from . import decreasing from . import hoverlabel from . import increasing else: f...
cforth/CryptoApp
refs/heads/master
ImgLook.py
1
import io import os import logging import tkinter as tk import tkinter.ttk as ttk import tkinter.filedialog as filedialog import tkinter.messagebox as tkmessagebox import libs.CFCrypto as CFCrypto import libs.CFCryptoX as CFCryptoX from libs.CFCanvas import CFCanvas from libs.Util import set_combobox_item from libs.Uti...
xuegang/gpdb
refs/heads/master
src/test/tinc/tincrepo/mpp/gpdb/lib/models/nic_failure/__init__.py
9
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at ...
pwoodworth/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/staticfiles/views.py
71
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import mimetypes import os import posixpath import re import stat import urllib from email.Utils import parsedate_tz, mktime_tz from django.conf import settings from djan...
savanu/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executormarionette.py
1
import os import socket import threading import traceback import urlparse import uuid errors = None marionette = None pytestrunner = None here = os.path.join(os.path.split(__file__)[0]) from .base import (ExecutorException, Protocol, RefTestExecutor, RefTestIm...
vladmm/intellij-community
refs/heads/master
python/testData/testRunner/env/unit/another_file_for_pattern.py
79
__author__ = 'Ilya.Kazakevich' from unittest import TestCase class UTests(TestCase): def testByPattern(self): pass def testByPattern2(self): pass
tedsunnyday/SE-Server
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py
316
# urllib3/response.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging import zlib import io from .exceptions import DecodeError from .packages.six ...
cloudpassage/cloudpassage-halo-python-sdk
refs/heads/master
cloudpassage/http_helper.py
1
"""HttpHelper class. Primary-level object, facilitates GET / POST / PUT / DELETE requests against API. """ from .exceptions import CloudPassageValidation from .utility import Utility as utility # This is for Python 3 compatibility try: from urllib.parse import urlsplit except ImportError: from urlparse import...
adityahase/frappe
refs/heads/develop
frappe/custom/doctype/package_publish_tool/__init__.py
12133432
Jobava/bedrock
refs/heads/master
bedrock/mozorg/management/commands/__init__.py
12133432
franosincic/edx-platform
refs/heads/master
lms/djangoapps/debug/__init__.py
12133432
nju520/django
refs/heads/master
tests/middleware/__init__.py
12133432
mbayon/TFG-MachineLearning
refs/heads/master
vbig/lib/python2.7/site-packages/numpy/core/tests/test_dtype.py
11
from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.core.test_rational import rational from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, dec ) def assert_dtype_equal(a, b): assert_equal(a, b) assert_equa...
eliksir/mailmojo-python-sdk
refs/heads/master
test/test_newsletter_send_test.py
1
# coding: utf-8 """ MailMojo API v1 of the MailMojo API # noqa: E501 OpenAPI spec version: 1.1.0 Contact: hjelp@mailmojo.no Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import mailmojo_sdk from mailmojo_sdk.models...
vitan/hue
refs/heads/master
desktop/core/ext-py/Paste-1.7.2/paste/evalexception/__init__.py
78
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ An exception handler for interactive debugging """ from paste.evalexception.middleware import EvalException
ralphwort/chef-repo
refs/heads/master
build/pyparsing/examples/searchparser.py
5
"""Search query parser version 2006-03-09 This search query parser uses the excellent Pyparsing module (http://pyparsing.sourceforge.net/) to parse search queries by users. It handles: * 'and', 'or' and implicit 'and' operators; * parentheses; * quoted strings; * wildcards at the end of a search term (he...
Cyberjusticelab/JusticeAI
refs/heads/master
src/ml_service/feature_extraction/post_processing/regex/regex_tagger_test.py
1
# -*- coding: utf-8 -*- import unittest import re import os from util.constant import Path from feature_extraction.post_processing.regex.regex_tagger import TagPrecedents class RegexTaggerTest(unittest.TestCase): def setUp(self): self.precedent_tagger = TagPrecedents() self.precedent_tagger.regexe...
vnsofthe/odoo-dev
refs/heads/master
addons/mass_mailing/models/res_config.py
385
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class MassMailingConfiguration(osv.TransientModel): _name = 'marketing.config.settings' _inherit = 'marketing.config.settings' _columns = { 'group_mass_mailing_campaign': fields.boolean( 'Manage Mass Mailing using Campaign',...
andfoy/margffoy-tuay-server
refs/heads/master
env/lib/python2.7/site-packages/future-0.14.3-py2.7.egg/future/moves/tkinter/font.py
118
from __future__ import absolute_import from future.utils import PY3 if PY3: from tkinter.font import * else: try: from tkFont import * except ImportError: raise ImportError('The tkFont module is missing. Does your Py2 ' 'installation include tkinter?')
ujfjhz/storm
refs/heads/master
dev-tools/release_notes.py
20
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Lice...
maraujop/django-crispy-forms
refs/heads/main
crispy_forms/tests/test_dynamic_api.py
2
import pytest from django import forms from crispy_forms.bootstrap import AppendedText from crispy_forms.exceptions import DynamicError from crispy_forms.helper import FormHelper, FormHelpersException from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, MultiField from crispy_forms.tests.forms import S...
tperol/ConvNetQuake
refs/heads/master
bin/preprocess/create_dataset_events.py
1
#!/usr/bin/env python # ------------------------------------------------------------------- # File Name : create_dataset_events.py # Creation Date : 05-12-2016 # Last Modified : Fri Jan 6 15:04:54 2017 # Author: Thibaut Perol <tperol@g.harvard.edu> # ------------------------------------------------------------------- ...
leorochael/odoo
refs/heads/8.0
addons/hr_attendance/wizard/hr_attendance_error.py
377
# -*- 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...
Pythonify/awesome
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py
1785
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
aparo/django-nonrel
refs/heads/master
django/db/backends/creation.py
11
import sys import time from django.conf import settings from django.core.management import call_command # The prefix to put on the default database name when creating # the test database. TEST_DATABASE_PREFIX = 'test_' class BaseDatabaseCreation(object): """ This class encapsulates all backend-specific diffe...
gxx/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/localflavor/ie.py
89
from django.contrib.localflavor.ie.forms import IECountySelect from utils import LocalFlavorTestCase class IELocalFlavorTests(LocalFlavorTestCase): def test_IECountySelect(self): f = IECountySelect() out = u'''<select name="counties"> <option value="antrim">Antrim</option> <option value="armagh">...
vriera/micropython
refs/heads/master
tests/basics/fun_annotations.py
118
def foo(x: int, y: list) -> dict: return {x: y} print(foo(1, [2, 3]))
sander76/home-assistant
refs/heads/dev
tests/components/automation/__init__.py
104
"""The tests for Automation."""
kirill-korolev/slack-banner
refs/heads/master
hello/migrations/0001_initial.py
42
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-27 21:54 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Greetin...
mcrowson/django
refs/heads/master
django/utils/checksums.py
310
""" Common checksum routines. """ __all__ = ['luhn'] import warnings from django.utils import six from django.utils.deprecation import RemovedInDjango110Warning warnings.warn( "django.utils.checksums will be removed in Django 1.10. The " "luhn() function is now included in django-localflavor 1.1+.", Rem...
joerideturck/gcloud-python-bigtable
refs/heads/master
gcloud_bigtable/happybase/batch.py
1
# 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 a...
trentm/node-gyp
refs/heads/master
gyp/test/mac/gyptest-missing-cfbundlesignature.py
298
#!/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 that an Info.plist with CFBundleSignature works. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp...
Acimaz/Google_Apple_Financial_Reporter
refs/heads/master
lib/third_party/oauth2client/client.py
8
#!/usr/bin/env python # Copyright 2014 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...
Maccimo/intellij-community
refs/heads/master
python/testData/inspections/PyClassHasNoInitInspection/unresolvedParent.py
83
__author__ = 'ktisha' class B(ABC): def foo(self): self.b = 1
Nolski/olympia
refs/heads/master
apps/users/utils.py
15
import base64 from functools import partial import hashlib import hmac import time import uuid from django.conf import settings from django.db.models import Q import commonware.log from users.models import UserProfile, BlacklistedName log = commonware.log.getLogger('z.users') class EmailResetCode(): @classme...
fmacias64/keras
refs/heads/master
tests/manual/check_model_utils.py
77
from __future__ import absolute_import from __future__ import print_function from keras.models import Sequential, Graph from keras.layers.core import Layer, Activation, Dense, Flatten, Reshape, Merge from keras.layers.convolutional import Convolution2D, MaxPooling2D import keras.utils.layer_utils as layer_utils print(...
andris210296/andris-projeto
refs/heads/master
backend/venv/test/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.py
287
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll if windll is not None: winterm = WinTerm() def is_a_tty(stream): return hasattr(s...
Mrs-X/Darknet
refs/heads/master
contrib/zmq/zmq_sub.py
69
#!/usr/bin/env python import array import binascii import zmq import struct port = 28332 zmqContext = zmq.Context() zmqSubSocket = zmqContext.socket(zmq.SUB) zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashblock") zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashtx") zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashtxlock") zm...
RapidApplicationDevelopment/tensorflow
refs/heads/master
tensorflow/tools/quantization/quantize_graph.py
6
# 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...
akeym/cyder
refs/heads/master
cyder/api/v1/endpoints/dns/soa/api.py
4
from rest_framework import serializers from cyder.api.v1.endpoints.api import CommonAPINestedAVSerializer from cyder.api.v1.endpoints.dns import api from cyder.cydns.soa.models import SOA, SOAAV class SOAAVSerializer(serializers.ModelSerializer): id = serializers.Field(source='id') entity = serializers.Hyper...
mmilaprat/policycompass-services
refs/heads/master
apps/ratingsmanager/models.py
2
from django.db import models from django.core.validators import RegexValidator, MinValueValidator, \ MaxValueValidator import logging log = logging.getLogger(__name__) class Rating(models.Model): identifier = models.CharField(max_length=255, unique=True) votes_counter = models.PositiveIntegerFi...
wtpayne/hiai
refs/heads/master
a3_src/h20_capability/runtime/mil/spec/spec_simulator.py
1
# -*- coding: utf-8 -*- """ Unit tests for the runtime.mil.simulator module. --- type: python_module validation_level: v00_minimum protection: k00_public copyright: "Copyright 2016 High Integrity Artificial Intelligence Systems" license: "Licensed under the Apache License, Version 2.0 (the Lice...
HeraldStudio/HeraldAppApi
refs/heads/master
mod/huodong/upload.py
1
# -*- coding: utf-8 -*- __author__ = 'LiangJ' import tornado.web import hashlib import json,io from ..Basehandler import BaseHandler from ..databases.tables import ActivCommitUser,Activity from sqlalchemy.orm.exc import NoResultFound from PIL import Image import traceback class UploadException(RuntimeEr...
shaunstanislaus/nomad
refs/heads/master
client/driver/test-resources/docker/main.py
50
import signal import time # Setup handler for sigterm so we can exit when docker stop is called. def term(signum, stack_Frame): exit(1) signal.signal(signal.SIGTERM, term) print ("Starting") max = 3 for i in range(max): time.sleep(1) print("Heartbeat {0}/{1}".format(i + 1, max)) print("Exiting")
MilyMilo/sci-organizer
refs/heads/master
accounts/tests.py
24123
from django.test import TestCase # Create your tests here.
MacHu-GWU/uszipcode-project
refs/heads/master
uszipcode/pkg/sqlalchemy_mate/pkg/prettytable/cli.py
1
from __future__ import print_function import argparse import sys from .factory import from_csv from ._compact import StringIO def main(): text_in = sys.stdin.read() if text_in: print(from_csv(StringIO.StringIO(text_in))) return parser = argparse.ArgumentParser(description='A simple Pytho...
pfnet/chainer
refs/heads/master
tests/chainer_tests/optimizer_hooks_tests/test_gradient_hard_clipping.py
6
import unittest import numpy as np from chainer import optimizer_hooks from chainer import optimizers from chainer import testing import utils _backend_params = [ # NumPy {}, {'use_ideep': 'always'}, # CuPy {'use_cuda': True, 'cuda_device': 0}, {'use_cuda': True, 'cuda_device': 1}, # Ch...
songyi199111/sentry
refs/heads/master
src/sentry/web/frontend/__init__.py
40
""" sentry.web.frontend ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import
saurabh6790/omnitech-libs
refs/heads/master
webnotes/utils/email_lib/smtp.py
10
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Sends email via outgoing server specified in "Control Panel" Allows easy adding of Attachments of "File" objects """ import webnotes from webnotes import conf from webno...
Mozhuowen/brython
refs/heads/master
www/src/Lib/test/encoded_modules/__init__.py
179
# -*- encoding: utf-8 -*- # This is a package that contains a number of modules that are used to # test import from the source files that have different encodings. # This file (the __init__ module of the package), is encoded in utf-8 # and contains a list of strings from various unicode planes that are # encoded diffe...
nickanderson/ansible
refs/heads/devel
lib/ansible/runner/connection_plugins/winrm.py
8
# (c) 2014, Chris Church <chris@ninemoreminutes.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 lat...
wfn/stem
refs/heads/master
test/unit/response/control_line.py
7
""" Unit tests for the stem.response.ControlLine class. """ import unittest import stem.response # response made by having 'DataDirectory /tmp/my data\"dir/' in the torrc PROTOCOLINFO_RESPONSE = ( 'PROTOCOLINFO 1', 'AUTH METHODS=COOKIE COOKIEFILE="/tmp/my data\\\\\\"dir//control_auth_cookie"', 'VERSION Tor="0....
theo-l/django
refs/heads/master
tests/migrations/test_migrations_conflict/0002_conflicting_second.py
145
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("migrations", "0001_initial")] operations = [ migrations.CreateModel( "Something", [ ("id", models.AutoField(primary_key=True)), ], ) ]
henaras/horizon
refs/heads/master
openstack_dashboard/dashboards/project/network_topology/ports/tables.py
73
# Copyright 2013 NTT Innovation Institute 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 applic...
JioCloud/swift
refs/heads/master
swift/proxy/controllers/__init__.py
5
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
derDavidT/sympy
refs/heads/master
sympy/concrete/summations.py
8
from __future__ import print_function, division from sympy.concrete.expr_with_limits import AddWithLimits from sympy.concrete.expr_with_intlimits import ExprWithIntLimits from sympy.core.function import Derivative from sympy.core.relational import Eq from sympy.core.singleton import S from sympy.core.symbol import Dum...
jakirkham/ilastik
refs/heads/master
ilastik/applets/thresholdMasking/__init__.py
4
############################################################################### # 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 # mod...
telefonicaid/selenium
refs/heads/master
py/test/selenium/webdriver/common/opacity_tests.py
15
#!/usr/bin/python # Copyright 2008-2012 WebDriver committers # Copyright 2008-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...
ar45/django
refs/heads/master
tests/generic_views/test_detail.py
284
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.test import TestCase, override_settings from django.test.client import RequestFactory from django.views.generic.base import View from django.views.gen...
ocefpaf/paegan
refs/heads/master
tests/test_asainterpolate.py
3
import math import unittest import numpy as np from paegan.utils.asainterpolate import GenInterpolator, CfGeoInterpolator, create_grid class CfInterpolator(unittest.TestCase): def test_interpolator_2d(self): lonbounds = [-70, -60] latbounds = [40, 50] nx, ny = 50, 50 lon, lat = crea...
kayarre/Tools
refs/heads/master
vtk/transform_vtu_dsa2vwi.py
1
import vtk import h5py """ read the transform from slicer and apply it to a surface mesh """ file_path1 = "/raid/home/ksansom/caseFiles/mri/VWI_proj/case1/fluent_dsa/vtk_out/calc_test_node_stats.vtu" file_path2 = "/raid/home/ksansom/caseFiles/mri/VWI_proj/case1/fluent_dsa/vtk_out/calc_test_node.vtu" file_path3 = ...
OpusVL/odoo
refs/heads/master
addons/procurement_jit/procurement_jit.py
4
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...