repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
zooming-tan/MyTemplateWebsite
refs/heads/master
config/settings/production.py
1
# -*- coding: utf-8 -*- ''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis on Heroku ''' from __future__ import absolute_import, unicode_literals from boto.s3.connection import OrdinaryCallingFormat from django.utils...
pongem/python-bot-project
refs/heads/master
appengine/standard/botapp/env/lib/python2.7/site-packages/django/db/models/fields/related.py
33
from __future__ import unicode_literals import warnings from functools import partial from django import forms from django.apps import apps from django.core import checks, exceptions from django.db import connection, router from django.db.backends import utils from django.db.models import Q from django.db.models.dele...
liuenyan/django-blog
refs/heads/master
blog/admin.py
1
from django.contrib import admin from blog.models import Post, Comment, Tag, Category, Link # Register your models here. class PostAdmin(admin.ModelAdmin): readonly_fields = ('body_html',) admin.site.register(Post, PostAdmin) admin.site.register(Comment) admin.site.register(Tag) admin.site.register(Category) adm...
HopeFOAM/HopeFOAM
refs/heads/master
ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/Twisted/twisted/conch/_version.py
19
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # This is an auto-generated file. Do not edit it. """ Provides Twisted version information. """ from twisted.python import versions version = versions.Version('twisted.conch', 14, 0, 0)
deprofundis/deprofundis
refs/heads/master
models/dbn.py
1
from models.rbm import RBM from utils import utils from models.optimizer import SGD from models.distribution import Distribution import numpy as np import copy as copy import plotting import time class Layer(object): """ Implement a single layer for a deep belief network """ def __init__(self,rbm, l...
johniek/meteor-rock
refs/heads/master
examples/javascript_rockstar.py
14
from RockStar import RockStar js_code = "println('Hello world')" rock_it_bro = RockStar(days=400, file_name='helloWorld.js', code=js_code) rock_it_bro.make_me_a_rockstar()
zhukaixy/kbengine
refs/heads/master
kbe/src/lib/python/Lib/encodings/cp865.py
272
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.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'): ...
home-assistant/home-assistant
refs/heads/dev
tests/components/deconz/conftest.py
5
"""deconz conftest.""" from __future__ import annotations from unittest.mock import patch import pytest from tests.components.light.conftest import mock_light_profiles # noqa: F401 @pytest.fixture(autouse=True) def mock_deconz_websocket(): """No real websocket allowed.""" with patch("pydeconz.gateway.WSCl...
ywcui1990/nupic.research
refs/heads/master
htmresearch/regions/ApicalTMSequenceRegion.py
3
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2017, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
naemono/pyrax
refs/heads/master
samples/cloud_dns/list_records.py
13
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, 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.ap...
dasuimao/U-BOOT-Tiny4412
refs/heads/master
tools/binman/etype/u_boot_dtb.py
7
# Copyright (c) 2016 Google, Inc # Written by Simon Glass <[email protected]> # # SPDX-License-Identifier: GPL-2.0+ # # Entry-type module for U-Boot device tree # from entry import Entry from blob import Entry_blob class Entry_u_boot_dtb(Entry_blob): def __init__(self, image, etype, node): Entry_blob....
goodwinnk/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/core/mail/message.py
87
import mimetypes import os import random import time from email import Charset, Encoders from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase from email.Header import Header from email.Utils import formatdate, getaddresses, formataddr from django.conf im...
miaecle/deepchem
refs/heads/master
contrib/DiabeticRetinopathy/run.py
5
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Sep 10 06:12:11 2018 @author: zqwu """ import deepchem as dc import numpy as np import pandas as pd import os import logging from model import DRModel, DRAccuracy, ConfusionMatrix, QuadWeightedKappa from data import load_images_DR train, valid, test =...
RGreinacher/bachelor-thesis
refs/heads/master
Apps/Auswertung/tests/test_comparison.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # import python libs import sys sys.path.append('../') # import project libs from compare_annotations import compare_annotations_in_sentences test_cases =[ { 'reference': [{'annotation': {'label': 'PER', 'length': 2}, 'term': 'Wolfgang'}, {'term': 'Schwetz...
sudheesh001/oh-mainline
refs/heads/master
vendor/packages/docutils/docutils/languages/__init__.py
170
# $Id: __init__.py 7648 2013-04-18 07:36:22Z milde $ # Author: David Goodger <[email protected]> # Copyright: This module has been placed in the public domain. # Internationalization details are documented in # <http://docutils.sf.net/docs/howto/i18n.html>. """ This package contains modules for language-dependent fe...
njantrania/osf.io
refs/heads/develop
tests/test_notifications.py
8
import collections import datetime import mock import pytz from babel import dates, Locale from schema import Schema, And, Use, Or from modularodm import Q from modularodm.exceptions import NoResultsFound from nose.tools import * # noqa PEP8 asserts from framework.auth import Auth from framework.auth.core import Use...
fxtentacle/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/qt.py
113
# Copyright (C) 2010 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 ...
AlvinRenNo1/clife
refs/heads/master
app/main/forms.py
9
from flask_wtf import Form from wtforms import StringField, SubmitField from wtforms.validators import Required class NameForm(Form): name = StringField('What is your name?', validators=[Required()]) submit = SubmitField('Submit')
ojengwa/oh-mainline
refs/heads/master
vendor/packages/Django/django/db/backends/postgresql_psycopg2/version.py
331
""" Extracts the version of the PostgreSQL server. """ import re # This reg-exp is intentionally fairly flexible here. # Needs to be able to handle stuff like: # PostgreSQL 8.3.6 # EnterpriseDB 8.3 # PostgreSQL 8.3 beta4 # PostgreSQL 8.4beta1 VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?') def _parse_...
lancezlin/ml_template_py
refs/heads/master
lib/python2.7/site-packages/numpy/core/tests/test_abc.py
168
from __future__ import division, absolute_import, print_function from numpy.testing import TestCase, assert_, run_module_suite import numbers from numpy.core.numerictypes import sctypes class ABC(TestCase): def test_floats(self): for t in sctypes['float']: assert_(isinstance(t(), numbers.Real...
yangzhongj/vitess
refs/heads/master
test/schema.py
8
#!/usr/bin/env python import logging import unittest import os import environment import utils import tablet shard_0_master = tablet.Tablet() shard_0_replica1 = tablet.Tablet() shard_0_replica2 = tablet.Tablet() shard_0_rdonly = tablet.Tablet() shard_0_backup = tablet.Tablet() shard_1_master = tablet.Tablet() shard_...
lukeiwanski/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/kernel_tests/bijectors/matrix_inverse_tril_test.py
9
# 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...
zhichao-li/BigDL
refs/heads/master
dl/src/main/python/test/__init__.py
16
# # Licensed to Intel Corporation under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # Intel Corporation licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this fi...
beblount/Steer-Clear-Backend-Web
refs/heads/web
env/Lib/site-packages/nose/ext/__init__.py
108
""" External or vendor files """
MusculoskeletalAtlasProject/mapclient
refs/heads/develop
src/mapclientplugins/dictserializerstep/__init__.py
2
""" MAP Client Plugin """ __version__ = '0.1.0' __author__ = 'Hugh Sorby' __stepname__ = 'Dict Serializer' # import class that derives itself from the step mountpoint. from mapclientplugins.dictserializerstep import step from . import resources_rc
beetbox/beets
refs/heads/master
test/testall.py
6
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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...
xrg/django-static-gitified
refs/heads/master
tests/regressiontests/localflavor/gb/tests.py
34
from django.contrib.localflavor.gb.forms import GBPostcodeField from django.test import SimpleTestCase class GBLocalFlavorTests(SimpleTestCase): def test_GBPostcodeField(self): error_invalid = [u'Enter a valid postcode.'] valid = { 'BT32 4PX': 'BT32 4PX', 'GIR 0AA': 'GIR 0...
vineet-rh/incubator-airflow
refs/heads/master
airflow/contrib/example_dags/example_emr_job_flow_manual_steps.py
17
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
martynovp/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/tests/test_poll.py
227
# -*- coding: utf-8 -*- """Test for Poll Xmodule functional logic.""" from xmodule.poll_module import PollDescriptor from . import LogicTest class PollModuleTest(LogicTest): """Logic tests for Poll Xmodule.""" descriptor_class = PollDescriptor raw_field_data = { 'poll_answers': {'Yes': 1, 'Dont_kn...
klonage/nlt-gcs
refs/heads/master
Lib/site-packages/numpy/core/tests/test_shape_base.py
54
from numpy.testing import * from numpy.core import array, atleast_1d, atleast_2d, atleast_3d, vstack, \ hstack, newaxis class TestAtleast1d(TestCase): def test_0D_array(self): a = array(1); b = array(2); res=map(atleast_1d,[a,b]) desired = [array([1]),array([2])] assert_arra...
kiran/bart-sign
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py
197
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
TechSquareInc/hours
refs/heads/master
app.py
1
#!/usr/bin/env python """ Bottle Python webapp for recording hours worked ; Version 1.4 TODO: [done] doc this whole file [?] finish working on recorder module git flow feature finish docs git flow feature start date-nav (add forward/backward buttons for navigating through dates) git flow release ... update...
jskeet/google-api-dotnet-client
refs/heads/master
ClientGenerator/src/googleapis/codegen/template_helpers_test.py
1
#!/usr/bin/python2.7 # Copyright 2011 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 requi...
sonnyhu/scipy
refs/heads/master
scipy/special/orthogonal.py
57
""" A collection of functions to find the weights and abscissas for Gaussian Quadrature. These calculations are done by finding the eigenvalues of a tridiagonal matrix whose entries are dependent on the coefficients in the recursion formula for the orthogonal polynomials with the corresponding weighting function over ...
razvanphp/arangodb
refs/heads/devel
3rdParty/V8-3.31.74.1/third_party/python_26/Lib/test/test_ioctl.py
58
import unittest from test.test_support import TestSkipped, run_unittest import os, struct try: import fcntl, termios except ImportError: raise TestSkipped("No fcntl or termios module") if not hasattr(termios,'TIOCGPGRP'): raise TestSkipped("termios module doesn't have TIOCGPGRP") try: tty = open("/dev/...
tshrjn/courses
refs/heads/master
cs/udacity/cs101-intro-cs/code/review-problems/triangle.py
4
# Question 2. Triangular Numbers # The triangular numbers are the numbers 1, 3, 6, 10, 15, 21, ... # They are calculated as follows. # 1 # 1 + 2 = 3 # 1 + 2 + 3 = 6 # 1 + 2 + 3 + 4 = 10 # 1 + 2 + 3 + 4 + 5 = 15 # Write a procedure, triangular, that takes as its input a positive # integer n and returns the nth trian...
brianwoo/django-tutorial
refs/heads/master
build/Django/tests/admin_scripts/complex_app/models/bar.py
580
from django.db import models class Bar(models.Model): name = models.CharField(max_length=5) class Meta: app_label = 'complex_app'
slisson/intellij-community
refs/heads/master
python/testData/refactoring/inlinelocal/operatorPrecedence/subtraction.after.py
79
(10 - 2)[::-5] (10 - 2)[5] (10 - 2)(5) (10 - 2).foo -(10 - 2) +(10 - 2) ~(10 - 2) 5 ** (10 - 2) (10 - 2) ** 5 5 * (10 - 2) (10 - 2) * 5 5 / (10 - 2) (10 - 2) / 5 5 // (10 - 2) (10 - 2) // 5 5 + 10 - 2 10 - 2 + 5 10 - 2 - 5 5 - (10 - 2) 5 >> 10 - 2 10 - 2 << 5 5 & 10 - 2 10 - 2 & 5 5 ^ 10 - 2 10 - 2 ^ 5 5 | 1...
adrewasa/asavim
refs/heads/master
ultisnips/test_all.py
20
#!/usr/bin/env python # encoding: utf-8 # # To execute this test requires two terminals, one for running Vim and one # for executing the test script. Both terminals should have their current # working directories set to this directory (the one containing this # test_all.py script). # # In one terminal, launch a tmux se...
chusiang/git-repo
refs/heads/master
subcmds/init.py
48
# # Copyright (C) 2008 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Sendoushi/servo
refs/heads/master
tests/wpt/css-tests/tools/pywebsocket/src/example/echo_noext_wsh.py
465
# Copyright 2013, 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...
graingert/pip
refs/heads/develop
pip/status_codes.py
1002
from __future__ import absolute_import SUCCESS = 0 ERROR = 1 UNKNOWN_ERROR = 2 VIRTUALENV_NOT_FOUND = 3 PREVIOUS_BUILD_DIR_ERROR = 4 NO_MATCHES_FOUND = 23
puzan/ansible
refs/heads/devel
lib/ansible/modules/network/iosxr/iosxr_config.py
4
#!/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...
ewerybody/a2
refs/heads/master
ui/a2mod.py
1
""" All about a2 modules. Modules in a2 always come in packages aka "module sources". These are collections of 1 or more modules. """ import os import sys import shutil import a2ahk import a2path import a2core import a2ctrl import a2ctrl.icons import a2util log = a2core.get_logger(__name__) CONFIG_FILENAME = 'a2modu...
ayarshabeer/wagtail
refs/heads/master
wagtail/contrib/wagtailapi/urls.py
13
from __future__ import absolute_import from django.conf.urls import url, include from .endpoints import PagesAPIEndpoint, ImagesAPIEndpoint, DocumentsAPIEndpoint v1 = [ url(r'^pages/', include(PagesAPIEndpoint.get_urlpatterns(), namespace='pages')), url(r'^images/', include(ImagesAPIEndpoint.get_urlpatterns...
Tearund/stories
refs/heads/master
node_modules/node-sass/node_modules/node-gyp/gyp/setup.py
2462
#!/usr/bin/env python # Copyright (c) 2009 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. from setuptools import setup setup( name='gyp', version='0.1', description='Generate Your Projects', author='Chromium Authors', a...
boomsbloom/dtm-fmri
refs/heads/master
DTM/for_gensim/lib/python2.7/site-packages/sklearn/ensemble/gradient_boosting.py
8
"""Gradient Boosted Regression Trees This module contains methods for fitting gradient boosted regression trees for both classification and regression. The module structure is the following: - The ``BaseGradientBoosting`` base class implements a common ``fit`` method for all the estimators in the module. Regressio...
chalasr/Flask-P2P
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
2039
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
mikebrevard/UnixAdministration
refs/heads/master
deliverables/Extra Credit/etc/data/genData/venv/lib/python3.4/site-packages/forgery_py/forgery/internet.py
14
# -*- coding: utf-8 -*- # Copyright (C) 2012 by Tomasz Wójcik <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rig...
apanju/GMIO_Odoo
refs/heads/8.0
openerp/addons/test_documentation_examples/__openerp__.py
344
# -*- coding: utf-8 -*- { 'name': "Documentation examples test", 'description': """ Contains pieces of code to be used as technical documentation examples (via the ``literalinclude`` directive) in situations where they can be syntax-checked and tested. """, 'author': "Odoo", 'website': ...
DADco/convalesense-web
refs/heads/master
convalesense/exercise/migrations/0011_auto_20170127_0925.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-27 09:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('exercise', '0010_exercise_steps'), ] operations = [ migrations.AlterModelOp...
TinkerersGuild/kinect4
refs/heads/master
src/flaskserver/app/__init__.py
1
from flask import Flask app = Flask(__name__) stuff = list() from app import routes
jhawkesworth/ansible-modules-extras
refs/heads/devel
identity/ipa/ipa_sudocmdgroup.py
10
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
duramato/CouchPotatoServer
refs/heads/develop
libs/unrar2/rar_exceptions.py
153
# Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy...
kkouer/PcGcs
refs/heads/master
Lib/decimal.py
41
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module is currently Py2.3 compatibl...
piiswrong/mxnet
refs/heads/master
example/neural-style/find_mxnet.py
52
# 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...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/cognitiveservices/azure-cognitiveservices-vision-face/azure/cognitiveservices/vision/face/models/__init__.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 ...
siosio/intellij-community
refs/heads/master
python/testData/resolve/OverloadsAndNoImplementationInImportedModule.py
29
from OverloadsAndNoImplementationInImportedModuleDep import foo foo("abc") <ref>
segment-boneyard/npm
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
68
#!/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. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
nthall/pip
refs/heads/develop
pip/_vendor/requests/packages/chardet/sjisprober.py
1776
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
lisitsyn/shogun
refs/heads/develop
examples/undocumented/python/classifier_multiclassmachine.py
4
#!/usr/bin/env python from tools.multiclass_shared import prepare_data [traindat, label_traindat, testdat, label_testdat] = prepare_data() parameter_list = [[traindat,testdat,label_traindat,2.1,1,1e-5],[traindat,testdat,label_traindat,2.2,1,1e-5]] def classifier_multiclassmachine (fm_train_real=traindat,fm_test_real...
yland/coala
refs/heads/master
coalib/collecting/Collectors.py
8
import functools import os import pkg_resources from coalib.bears.BEAR_KIND import BEAR_KIND from coalib.collecting.Importers import iimport_objects from coalib.misc.Decorators import yield_once from coalib.output.printers.LOG_LEVEL import LOG_LEVEL from coalib.parsing.Globbing import fnmatch, iglob def _get_kind(be...
gigglesninja/senior-design
refs/heads/master
MissionPlanner/Lib/tokenize.py
122
"""Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line of input (or "" for EOF). It generates 5-tuples with these members: the token type (see token.py) ...
Nicotine-Plus/nicotine-plus
refs/heads/master
pynicotine/upnp/ssdp.py
1
# MIT License # # Copyright (C) 2020-2021 Nicotine+ Team # Copyright (c) 2019 Dave Mulford # # 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 ...
atagar/ReviewBoard
refs/heads/master
reviewboard/reviews/views.py
1
import logging import time from datetime import datetime from django.conf import settings from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from django.db.models import Q from django.http import HttpResponse, HttpResponseRedirect, Http...
SlimSaber/android_external_chromium
refs/heads/kk4.4
chrome/common/extensions/docs/examples/apps/hello-python/main.py
70
#!/usr/bin/python # Copyright (c) 2010 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. from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from google...
grib0ed0v/hse-cv-course-2017
refs/heads/master
1. Emotion Recognition/recognizer/emotionrecognizer.py
1
import cv2 import numpy as np class EmotionRecognizer: def __init__(self): self.scale_size = (224, 224) self.emotions = ['Angry', 'Disgust', 'Fear', 'Happy', 'Neutral', 'Sad', 'Surprise'] # list with emotion labels net_model_file = "./resources/deploy.txt" net_pretrained = "./res...
brian-yang/mozillians
refs/heads/master
vendor-local/lib/python/unidecode/x0a1.py
253
data = ( 'dit', # 0x00 'dix', # 0x01 'di', # 0x02 'dip', # 0x03 'diex', # 0x04 'die', # 0x05 'diep', # 0x06 'dat', # 0x07 'dax', # 0x08 'da', # 0x09 'dap', # 0x0a 'duox', # 0x0b 'duo', # 0x0c 'dot', # 0x0d 'dox', # 0x0e 'do', # 0x0f 'dop', # 0x10 'dex', # 0x11 'de',...
cybercercher/crits
refs/heads/master
crits/core/user.py
10
#------------- # Some sections of the code below have been copied from # MongoEngine. # # https://github.com/MongoEngine/mongoengine # # Copyright (c) 2009 See AUTHORS # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"...
mcdeoliveira/rcpy
refs/heads/master
test/test_encoder.py
1
import pytest import time import rcpy.encoder as encoder def test1(): N = 5 # set to 10 encoder.set(1, 10) assert encoder.get(1) == 10 encoder.set(2, 10) assert encoder.get(2) == 10 encoder.set(3, 10) assert encoder.get(3) == 10 encoder.set(4, 10) assert e...
KNMI/VERCE
refs/heads/master
verce-hpc-pe/src/networkx/drawing/tests/test_layout.py
32
"""Unit tests for layout functions.""" import sys from nose import SkipTest from nose.tools import assert_equal import networkx as nx class TestLayout(object): numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test @classmethod def setupClass(cls): global numpy try: ...
demarle/VTK
refs/heads/master
Examples/Infovis/Python/databases.py
5
#!/usr/bin/env python from vtk import * import os.path data_dir = "../../../../VTKData/Data/Infovis/SQLite/" if not os.path.exists(data_dir): data_dir = "../../../../../VTKData/Data/Infovis/SQLite/" if not os.path.exists(data_dir): data_dir = "../../../../../../VTKData/Data/Infovis/SQLite/" sqlite_file = data_dir ...
dlangille/librenms
refs/heads/master
services-wrapper.py
2
#! /usr/bin/env python3 """ services-wrapper A small tool which wraps around check-services.php and tries to guide the services process with a more modern approach with a Queue and workers. Based on the original version of poller-wrapper.py by Job Snijders Author: Neil Lathwo...
centwave/jg82ksgvqkuan
refs/heads/master
django/conf/locale/mk/formats.py
251
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j. F Y. H:i' YEAR_MONTH_F...
patilsangram/erpnext
refs/heads/develop
erpnext/stock/doctype/material_request_item/material_request_item.py
16
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from erpnext.controllers.print_settings import print_settings_for_item_table from frap...
petemounce/ansible
refs/heads/devel
lib/ansible/module_utils/ce.py
21
# # This code is part of Ansible, but is an independent component. # # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complet...
abe-winter/pg13-py
refs/heads/master
pg13/__init__.py
1
"module" from . import misc, pg # don't import pgmock and stubredis -- they're only useful for test mode or nonstandard env (i.e. stubredis on windows)
kblin/supybot-gsoc
refs/heads/stable
plugins/Seen/config.py
15
### # Copyright (c) 2005, Jeremiah Fincher # 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 conditi...
Alpacah/FreqAnalysis
refs/heads/master
Tests/fainale01.py
1
from tkinter import * from tkinter import filedialog from math import * import os import time def drawFamily(char, data): chart.delete(ALL) family = data['chars'][char] colors = [] totalValue = family[0] startAngle = 0 if int(totalValue * 100) < 1: value = "< 1%" else:...
adamgreen/mbed
refs/heads/master
tools/build_everything.py
47
#! /usr/bin/env python """ mbed SDK Copyright (c) 2011-2013 ARM Limited 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...
dekoza/django-getpaid
refs/heads/master
getpaid/backends/payu/management/__init__.py
55
__author__ = 'cypreess'
tankle/HMMSegment
refs/heads/master
test.py
1
# -*- coding: utf-8 -*- __author__ = 'tan' import HMM content = "这并不是一种最好的处理技术,因为这有可能低估或高估真实概率,更加科学的方法是使用复杂一点的Good—Turing技术,这项技术的原始版本是图灵当年和他的助手Good在破解德国密码机时发明的。" seg = HMM.HMMSegment() # seg.init_model(trainfile="test",load=True) print(seg.segment_sentences(content))
ssharpjr/taskbuster-boilerplate
refs/heads/master
taskbuster/test.py
5
# -*- coding: utf-8 -*- from django.test import TestCase from django.core.urlresolvers import reverse from django.utils.translation import activate class TestHomePage(TestCase): def test_uses_index_template(self): activate('en') response = self.client.get(reverse("home")) self.assertTempl...
robinro/ansible-modules-extras
refs/heads/devel
cloud/cloudstack/cs_iso.py
44
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <[email protected]> # # 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...
prune998/ansible
refs/heads/devel
test/units/playbook/test_attribute.py
219
# (c) 2015, Marius Gedminas <[email protected]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
sander76/home-assistant
refs/heads/dev
homeassistant/components/tensorflow/image_processing.py
2
"""Support for performing TensorFlow classification on images.""" import io import logging import os import sys import time from PIL import Image, ImageDraw, UnidentifiedImageError import numpy as np import tensorflow as tf # pylint: disable=import-error import voluptuous as vol from homeassistant.components.image_p...
termie/openstack-dashboard
refs/heads/master
django-openstack/src/django_openstack/dash/views/images.py
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
leayousoufov/laravel-a-love-story
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
1284
# Copyright (c) 2013 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. import collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp imp...
figo-connect/schwifty
refs/heads/master
schwifty/common.py
1
from functools import total_ordering import re _clean_regex = re.compile(r'\s+') @total_ordering class Base(object): def __init__(self, code): self._code = clean(code) def __str__(self): return self.compact def __repr__(self): return '<{0}={1!s}>'.format(self.__class__.__name_...
minhphung171093/OpenERP_V7
refs/heads/master
openerp/addons/document_ftp/ftpserver/__init__.py
55
# -*- 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...
val-iisc/sketch-parse
refs/heads/master
valsketch/valsketch/forms.py
1
from flask_wtf import FlaskForm, RecaptchaField from wtforms import StringField, PasswordField, BooleanField from wtforms.validators import DataRequired, Email, Length, EqualTo from valsketch.models import User class SigninForm(FlaskForm): email = StringField(label="Email Address", id='inputEmail', validators=[Em...
Dexhub/MTX
refs/heads/master
src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py
91
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bhattmansi/Implementation-of-CARED-in-ns3
refs/heads/master
src/wimax/bindings/modulegen__gcc_LP64.py
5
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)) ...
tarunz/Django-Bookmarks
refs/heads/master
django_bookmarks/settings.py
1
""" Django settings for django_bookmarks project. Generated by 'django-admin startproject' using Django 1.8.5. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # B...
PowerShellEmpire/Empire
refs/heads/master
lib/modules/powershell/recon/find_fruit.py
10
import base64 from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Find-Fruit', 'Author': ['@424f424f'], 'Description': ("Searches a network range for potentially vulnerable web services."), 'Backgr...
olitheolix/qtmacs
refs/heads/master
qtmacs/applets/bash.py
1
# Copyright 2012, Oliver Nagy <[email protected]> # # This file is part of Qtmacs. # # Qtmacs 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...
caiocsalvador/whats_the_craic
refs/heads/master
lib/python3.4/site-packages/django/db/backends/postgresql/creation.py
121
import sys from django.db.backends.base.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): def sql_table_creation_suffix(self): test_settings = self.connection.settings_dict['TEST'] assert test_settings['COLLATION'] is None, ( "PostgreSQL does not supp...
chhsiao90/cheat-ext
refs/heads/master
cheat_ext/exceptions.py
1
class CheatExtException(Exception): pass
stephane-caron/icra-2015
refs/heads/master
dmotions/hrp4/topp/wrench_cons.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 Stephane Caron <[email protected]> # # This file is part of icra-2015. # # This code 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 Foundat...
tsauerwein/c2cgeoportal
refs/heads/master
c2cgeoportal/scaffolds/update/CONST_alembic/env.py
2
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python...