repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
jsalva/crux
refs/heads/master
crux/emberjs/ember_apps/crux/node_modules/ember-cli/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
thaJeztah/compose
refs/heads/master
tests/unit/container_test.py
1
import docker from .. import mock from .. import unittest from ..helpers import BUSYBOX_IMAGE_WITH_TAG from compose.const import LABEL_ONE_OFF from compose.const import LABEL_SLUG from compose.container import Container from compose.container import get_container_name class ContainerTest(unittest.TestCase): def...
rs2/bokeh
refs/heads/master
examples/models/file/trail.py
6
# -*- coding: utf-8 -*- from __future__ import print_function from math import sin, cos, atan2, sqrt, radians import numpy as np import scipy.ndimage as im from bokeh.document import Document from bokeh.embed import file_html from bokeh.resources import INLINE from bokeh.util.browser import view from bokeh.models....
imrehg/labhardware
refs/heads/master
projects/tempmon/ourgui.py
24
import wx def openFile(type="*"): ''' Simple application to present a file-selection dialog filepath = openFile(type="*") input parameter ---------------- type: file extension to filter by default. E.g.: type="py" to select Python source files output parameter ------...
fossevents/fossevents.in
refs/heads/master
fossevents/users/forms.py
2
# -*- coding: utf-8 -*- from django import forms from .models import User class UserForm(forms.ModelForm): class Meta: # Set this form to use the User model. model = User # Constrain the UserForm to just these fields. fields = ("first_name", "last_name")
zhanghenry/stocks
refs/heads/master
tests/logging_tests/tests.py
13
# -*- coding:utf-8 -*- from __future__ import unicode_literals import logging import warnings from admin_scripts.tests import AdminScriptTestCase from django.core import mail from django.core.files.temp import NamedTemporaryFile from django.test import RequestFactory, TestCase, override_settings from django.test.uti...
anish/buildbot
refs/heads/master
master/buildbot/test/unit/test_www_auth.py
6
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
dycodedev/taiga-back
refs/heads/master
taiga/projects/votes/services.py
1
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014 Anler Hernández <hello@anler.me> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
a8ksh4/solar
refs/heads/master
Rev-2/Solar.py
1
#!/usr/bin/python ''' Created on Oct 23, 2013 @author: drnorris ''' from Quad import * import sys, os MYNAME=sys.argv[0] MYPATH=os.path.realpath(__file__) MYDIR=os.path.dirname(os.path.abspath(__file__)) MYCWD=os.getcwd() #print "sys.argv[0] is: " + MYNAME #print "os.path.realpath(__file__) is: " + MYPATH #print "o...
wraiden/spacewalk
refs/heads/master
backend/server/test/test_leak3.py
10
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
vinutah/projects
refs/heads/master
ml/pde/fd1d_heat_explicit.py
1
#!/usr/bin/env python def save_training_data(dep_var, feature_1, feature_2, feature_3, mode): path = './data/training/' filename = path + str(mode) + '_train.svm' with open(filename,'a') as f: line = str(dep_var) line += ' 1:' + str(feature_1) line += ' 2:' + str(feature...
sminki/android_kernel_sony_u8500
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
tensorflow/probability
refs/heads/main
tensorflow_probability/python/layers/distribution_layer_test.py
1
# Copyright 2018 The TensorFlow Probability 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 law o...
nju520/flask
refs/heads/master
flask/exthook.py
142
# -*- coding: utf-8 -*- """ flask.exthook ~~~~~~~~~~~~~ Redirect imports for extensions. This module basically makes it possible for us to transition from flaskext.foo to flask_foo without having to force all extensions to upgrade at the same time. When a user does ``from flask.ext.foo import...
ocadotechnology/boto
refs/heads/develop
boto/cloudsearch2/document.py
136
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 r...
gratipay/gratipay.com
refs/heads/master
gratipay/models/exchange_route.py
1
from __future__ import absolute_import, division, print_function, unicode_literals import braintree from postgres.orm import Model class ExchangeRoute(Model): typname = "exchange_routes" def __eq__(self, other): if not isinstance(other, ExchangeRoute): return False return self.i...
kylerbrown/bark
refs/heads/master
bark/io/rhd/get_bytes_per_data_block.py
2
#! /bin/env python # # Michael Gibson 23 April 2015 def get_bytes_per_data_block(header): """Calculates the number of bytes in each 60-sample datablock.""" # Each data block contains 60 amplifier samples. bytes_per_block = 60 * 4 # timestamp data bytes_per_block = bytes_per_block + 60 * 2 ...
fhaoquan/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/_markupbase.py
891
"""Shared support for scanning document type declarations in HTML and XHTML. This module is used as a foundation for the html.parser module. It has no documented public API and should not be used directly. """ import re _declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match _declstringlit_match = re.com...
pengli09/Paddle
refs/heads/develop
python/paddle/utils/image_multiproc.py
4
import os, sys import numpy as np from PIL import Image from cStringIO import StringIO import multiprocessing import functools import itertools from paddle.utils.image_util import * from paddle.trainer.config_parser import logger try: import cv2 except ImportError: logger.warning("OpenCV2 is not installed, us...
asteven/dpkt
refs/heads/master
dpkt/ip6.py
17
# $Id$ """Internet Protocol, version 6.""" import dpkt class IP6(dpkt.Packet): __hdr__ = ( ('v_fc_flow', 'I', 0x60000000L), ('plen', 'H', 0), # payload length (not including header) ('nxt', 'B', 0), # next header protocol ('hlim', 'B', 0), # hop limit ('src', '16s', ''), ...
bgris/ODL_bgris
refs/heads/master
lib/python3.5/site-packages/networkx/algorithms/flow/tests/test_maxflow.py
43
# -*- coding: utf-8 -*- """Maximum flow algorithms test suite. """ from nose.tools import * import networkx as nx from networkx.algorithms.flow import build_flow_dict, build_residual_network from networkx.algorithms.flow import edmonds_karp, preflow_push, shortest_augmenting_path flow_funcs = [edmonds_karp, preflow_p...
MenZil/kuma
refs/heads/master
vendor/packages/translate/storage/mozilla_lang.py
23
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008, 2011 Zuza Software Foundation # # This file is part of translate. # # translate 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 ...
intelie/pycollector
refs/heads/master
src/third/SimpleCV/Features/BlobMaker.py
2
from SimpleCV.base import * class BlobMaker: """ Blob maker encapsulates all of the contour extraction process and data, so it can be used inside the image class, or extended and used outside the image class. The general idea is that the blob maker provides the utilites that one would use for blob...
okwow123/djangol2
refs/heads/master
example/env/lib/python2.7/site-packages/requests/packages/urllib3/fields.py
288
from __future__ import absolute_import import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. ...
A-deLuna/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/origin_check_wsh.py
499
# Copyright 2009, 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...
zanderle/django
refs/heads/master
django/contrib/gis/db/models/sql/__init__.py
476
from django.contrib.gis.db.models.sql.conversion import ( AreaField, DistanceField, GeomField, GMLField, ) __all__ = [ 'AreaField', 'DistanceField', 'GeomField', 'GMLField' ]
indrajitr/ansible
refs/heads/devel
test/support/windows-integration/plugins/modules/win_whoami.py
68
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
wojciechtanski/robotframework
refs/heads/master
utest/utils/test_robotpath.py
21
import unittest import os import os.path from robot.utils import abspath, normpath, get_link_path, WINDOWS from robot.utils.robotpath import CASE_INSENSITIVE_FILESYSTEM from robot.utils.asserts import assert_equal, assert_true class TestAbspathNormpath(unittest.TestCase): def test_abspath(self): for inp...
eywalker/attorch
refs/heads/master
attorch/optimizers.py
2
import math import torch from torch import optim class ActiveSGD(optim.SGD): def __init__(self, params, lr, momentum=0, dampening=0, weight_decay=0, nesterov=False): params = list(params) assert not isinstance( params[0], dict), 'Only a single param group is supported'...
DanCech/graphite-web
refs/heads/master
contrib/memcache_whisper.py
3
#!/usr/bin/env python # Copyright 2008 Orbitz WorldWide # # 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 ...
sztanko/hadoop-common
refs/heads/HADOOP-3628
src/contrib/hod/hodlib/RingMaster/idleJobTracker.py
182
#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 thi...
spktklr/kansalaisrajoite
refs/heads/master
python/user.py
1
# coding=utf-8 import hmac import json from bottle import Bottle, HTTPError, request, template from sqlalchemy.orm.exc import NoResultFound import bcrypt from utils import jsonplugin, gen_pw_reset_payload, send_email import auth import model import config import utils app = Bottle() app.install(model.plugin) app.in...
mrquim/repository.mrquim
refs/heads/master
plugin.video.castaway/resources/lib/resolvers/onedrive.py
4
from resources.lib.modules import client from resources.lib.modules.log_utils import log import re,urllib,urlparse,base64 def resolve(url): try: encoded = 'u!' + base64.b64encode(b'%s'%url).rstrip('=').replace('/','_').replace('+','-') url = 'http://api.onedrive.com/v1.0/shares/' + encoded + '/root' result = cl...
DaYeSquad/worktilerwdemo
refs/heads/master
model-builder/skr_cpp_builder/__init__.py
6
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2016 - Frank Lin
socrocket/trap-gen
refs/heads/master
cxx_writer/tests/testSimpleDecls.py
1
################################################################################ # # _/_/_/_/_/ _/_/_/ _/ _/_/_/ # _/ _/ _/ _/_/ _/ _/ # _/ _/ _/ _/ _/ _/ _/ # _/ _/_/_/ _/_/_/_/ _/_/_/ # _/ _/ _/ _/ _/ _/ # ...
havard024/prego
refs/heads/master
crm/lib/python2.7/site-packages/django/utils/hashcompat.py
124
""" The md5 and sha modules are deprecated since Python 2.5, replaced by the hashlib module containing both hash algorithms. Here, we provide a common interface to the md5 and sha constructors, depending on system version. """ import warnings warnings.warn("django.utils.hashcompat is deprecated; use hashlib instead", ...
PhilHarnish/forge
refs/heads/master
spec/puzzle/examples/mim/p1_2_spec.py
1
import astor from data import warehouse from puzzle.examples.mim import p1_2 from puzzle.problems import logic_problem from puzzle.puzzlepedia import prod_config from spec.mamba import * with _description('p1_2'): with before.all: warehouse.save() prod_config.init() self.puzzle = p1_2.get() with afte...
DreamerKing/LightweightHtmlWidgets
refs/heads/master
publish-rc/v1.0/files/Ipy.Lib/encodings/mbcs.py
860
""" Python 'mbcs' Codec for Windows Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py, which was written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ # Import them explicitly to cause an ImportError # on non-Windows systems from codecs import mbcs...
iksteen/aiohttp
refs/heads/master
tests/test_web.py
6
import asyncio import unittest from unittest import mock from aiohttp import web, log from aiohttp.multidict import CIMultiDict from aiohttp.protocol import HttpVersion11, RawRequestMessage class TestWeb(unittest.TestCase): def setUp(self): self.loop = asyncio.new_event_loop() asyncio.set_event_...
turtleloveshoes/kitsune
refs/heads/master
kitsune/forums/tests/test_notifications.py
13
from django.contrib import admin from django.contrib.admin.options import ModelAdmin from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core import mail from django.test.client import RequestFactory import mock from nose.tools import eq_ from kitsune.forums.events imp...
ntuecon/server
refs/heads/master
pyenv/Lib/site-packages/django/contrib/auth/handlers/modwsgi.py
537
from django import db from django.contrib import auth from django.utils.encoding import force_bytes def check_password(environ, username, password): """ Authenticates against Django's auth database mod_wsgi docs specify None, True, False as return value depending on whether the user exists and authen...
J861449197/edx-platform
refs/heads/master
common/djangoapps/django_locale/middleware.py
81
# TODO: This file is imported from the stable Django 1.8 branch. Remove this file # and re-import this middleware from Django once the codebase is upgraded. [PLAT-671] # pylint: disable=invalid-name, missing-docstring "This is the locale selecting middleware that will look at accept headers" from django.conf import se...
dutchiexl/constructiv
refs/heads/master
node_modules/node-gyp/gyp/gyptest.py
1752
#!/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. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner(obje...
BBN-Q/pyqgl2
refs/heads/master
test/code/qft.py
1
from qgl2.qgl2 import qgl2decl, qgl2main, qreg, QRegister from qgl2.qgl1 import Id, X90, Y90, X, Y, Ztheta, MEAS, CNOT from math import pi @qgl2decl def hadamard(q:qreg): Y90(q) X(q) @qgl2decl def CZ_k(c:qreg, t:qreg, k): theta = 2 * pi / 2**k Ztheta(t, angle=theta/2) CNOT(c, t) Ztheta(t, ang...
ar7z1/ansible
refs/heads/devel
lib/ansible/modules/identity/ipa/ipa_dnszone.py
67
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Fran Fitzpatrick (francis.x.fitzpatrick@gmail.com) # Borrowed heavily from other work by Abhijeet Kasurde (akasurde@redhat.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_i...
openstack/python-muranoclient
refs/heads/master
muranoclient/tests/unit/osc/v1/test_environment.py
1
# 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 # d...
kenshay/ImageScripter
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/traitlets/config/manager.py
13
"""Manager to read and modify config data in JSON files. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import errno import io import json import os from six import PY3 from traitlets.config import LoggingConfigurable from traitlets.traitlets import Unicode d...
nicoddemus/backtrader
refs/heads/master
tests/test_ind_pgo.py
4
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
ghchinoy/tensorflow
refs/heads/master
tensorflow/contrib/framework/python/ops/checkpoint_ops.py
76
# 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...
ppizarror/Hero-of-Antair
refs/heads/master
data/images/pil/Image.py
1
# # The Python Imaging Library. # $Id$ # # the Image class wrapper # # partial release history: # 1995-09-09 fl Created # 1996-03-11 fl PIL release 0.0 (proof of concept) # 1996-04-30 fl PIL release 0.1b1 # 1999-07-28 fl PIL release 1.0 final # 2000-06-07 fl PIL release 1.1 # 2000-10-20 fl PIL release 1.1.1...
hzruandd/AutobahnPython
refs/heads/master
examples/twisted/websocket/multiproto/client.py
13
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
cryptobanana/ansible
refs/heads/devel
lib/ansible/modules/cloud/cloudstack/cs_iso.py
49
#!/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...
xiandiancloud/ji
refs/heads/master
lms/djangoapps/django_comment_client/permissions.py
19
""" Module for checking permissions with the comment_client backend """ import logging from types import NoneType from django.core import cache from opaque_keys.edx.keys import CourseKey CACHE = cache.get_cache('default') CACHE_LIFESPAN = 60 def cached_has_permission(user, permission, course_id=None): """ C...
tatsuhirosatou/p2p-app-backend
refs/heads/master
p2p_tests.py
1
#!/usr/bin/python import unittest import p2p import requests import base64 import json import code import random unittest.TestLoader.sortTestMethodsUsing = lambda _, x, y: random.choice([1,-1]) class P2PTests(unittest.TestCase): def setUp(self): p2p.app.config['TESTING'] = True self....
andymckay/addons-server
refs/heads/master
src/olympia/editors/tests/test_helpers.py
2
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from django.core import mail from django.core.files.storage import default_storage as storage import pytest from mock import Mock, patch from pyquery import PyQuery as pq from olympia import amo from olympia.amo.tests import TestCase from olympia.addon...
eezee-it/account-invoicing
refs/heads/8.0
account_invoice_triple_discount/models/__init__.py
12
# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import account_invoice
alviproject/alvi
refs/heads/master
alvi/config/django_settings.py
1
import os import alvi PROJECT_BASE_DIR = os.path.dirname(alvi.__file__) BASE_DIR = os.path.dirname(PROJECT_BASE_DIR) #TODO add warning about secret key and debug SECRET_KEY = 'hn+-d5ox)bdr)a6+yn6+m3wazw0n2=6mi#cc839sb@=rs9=2%y' DEBUG = True TEMPLATE_DEBUG = DEBUG ALLOWED_HOSTS = ['localhost'] INSTALLED_APPS = ( ...
ABaldwinHunter/django-clone
refs/heads/master
tests/admin_ordering/tests.py
52
from __future__ import unicode_literals from django.contrib import admin from django.contrib.admin.options import ModelAdmin from django.contrib.auth.models import User from django.test import RequestFactory, TestCase from .models import ( Band, DynOrderingBandAdmin, Song, SongInlineDefaultOrdering, SongInlin...
ndebuhr/thermo-state-solver
refs/heads/master
thermo-env/lib/python3.5/site-packages/pip/__main__.py
834
from __future__ import absolute_import import os import sys # If we are running from a wheel, add the wheel to sys.path # This allows the usage python pip-*.whl/pip install pip-*.whl if __package__ == '': # __file__ is pip-*.whl/pip/__main__.py # first dirname call strips of '/__main__.py', second strips off ...
mwgit00/pox
refs/heads/master
test_util.py
1
import unittest import time import poxutil as fu class TestUtil(unittest.TestCase): def test_timer1_basic(self): # create a 1-second timer # update and see if it expires timer = fu.PolledTimer() timer.start(1) time.sleep(0.5) f, t = timer.update() self.a...
kylon/pacman-fakeroot
refs/heads/upstream
test/pacman/tests/upgrade046.py
11
self.description = "File relocation between two packages (reverse order, --force)" lp1 = pmpkg("dummy") lp1.files = ["bin/dummy"] lp2 = pmpkg("foobar") lp2.files = ["bin/foobar", "usr/share/file"] for p in lp1, lp2: self.addpkg2db("local", p) p1 = pmpkg("dummy") p1.files = ["bin/dummy", "u...
pdebuyl/numpy
refs/heads/master
numpy/doc/ufuncs.py
17
""" =================== Universal Functions =================== Ufuncs are, generally speaking, mathematical functions or operations that are applied element-by-element to the contents of an array. That is, the result in each output array element only depends on the value in the corresponding input array (or arrays) a...
cmtm/networkx
refs/heads/master
networkx/linalg/tests/test_laplacian.py
21
from nose import SkipTest import networkx as nx from networkx.generators.degree_seq import havel_hakimi_graph class TestLaplacian(object): numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test @classmethod def setupClass(cls): global numpy global scipy global ass...
isabernardes/Heriga
refs/heads/master
Herigaenv/lib/python2.7/site-packages/django/contrib/sites/migrations/0002_alter_domain_unique.py
379
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.sites.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.AlterField( model_name='...
cloudera/recordservice
refs/heads/master
testdata/bin/generate-schema-statements.py
1
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # This script generates the "CREATE TABLE", "INSERT", and "LOAD" statements for loading # test data and writes them to create-*-generated.sql and # load-*-generated.sql. These files are then executed by hive or impala, depending # on their ...
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
refs/heads/master
python-packages/mne-python-0.10/tutorials/plot_raw_objects.py
15
""" .. _tut_raw_objects The :class:`Raw <mne.io.RawFIF>` data structure: continuous data ================================================================ """ from __future__ import print_function import mne import os.path as op from matplotlib import pyplot as plt ###################################################...
ghchinoy/tensorflow
refs/heads/master
tensorflow/python/debug/lib/common.py
78
# 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...
15Dkatz/pants
refs/heads/master
tests/python/pants_test/java/test_nailgun_protocol.py
15
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import socket import...
orchidinfosys/odoo
refs/heads/master
addons/auth_signup/models/res_users.py
2
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from ast import literal_eval from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.tools.misc import ustr from odoo.addons.base.ir.ir_mail_server import MailDeliveryException from odo...
wilvk/ansible
refs/heads/devel
lib/ansible/modules/network/aci/aci_l3out_route_tag_policy.py
5
#!/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'], ...
d33tah/npyscreen
refs/heads/master
npyscreen/util_viewhelp.py
15
import textwrap def view_help(message, title="Message", form_color="STANDOUT", scroll_exit=False, autowrap=False): from . import fmForm from . import wgmultiline F = fmForm.Form(name=title, color=form_color) mlw = F.add(wgmultiline.Pager, scroll_exit=True, autowrap=autowrap) mlw_width = mlw.width-...
tensorflow/tensorflow
refs/heads/master
tensorflow/python/keras/saving/model_config.py
5
# 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...
campbellr/click-plugins
refs/heads/master
example/PrintItBold/printit_bold/__init__.py
4
""" A CLI plugin for `PrintIt` that adds bold text. """
orgito/ansible
refs/heads/devel
test/integration/targets/vault/test-vault-client.py
139
#!/usr/bin/env python # -*- coding: utf-8 -*- ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} import argparse import sys # TODO: could read these from the files I suppose... secrets = {'vault-password': 'test-vault-password', ...
UManPychron/pychron
refs/heads/develop
pychron/image/rpi_camera.py
2
# =============================================================================== # Copyright 2016 Jake Ross # # 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...
hankcs/HanLP
refs/heads/master
hanlp/utils/lang/ja/__init__.py
1
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2021-05-13 13:24
kinap/scapy
refs/heads/master
scapy/base_classes.py
1
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license """ Generators and packet meta classes. """ ############### ## Generators ## ################ import re,random,socket i...
fitzgen/servo
refs/heads/master
tests/wpt/css-tests/tools/__init__.py
138
from . import localpaths as _localpaths
4eek/edx-platform
refs/heads/master
cms/djangoapps/contentstore/views/tests/test_transcripts.py
121
"""Tests for items views.""" import copy import json import os import tempfile import textwrap from uuid import uuid4 from mock import patch from django.core.urlresolvers import reverse from django.test.utils import override_settings from django.conf import settings from contentstore.tests.utils import CourseTestCas...
gsd-ufal/Juliabox
refs/heads/master
engine/src/juliabox/api/api_queue.py
8
__author__ = 'tan' import time import zmq from datetime import timedelta from zmq.devices.basedevice import ThreadDevice from juliabox.db import JBoxAPISpec from juliabox.jbox_util import LoggerMixin from juliabox.cloud import Compute class APIQueue(LoggerMixin): BUFFER_SZ = 20 QUEUES = dict() QLEN_WT = ...
Mhynlo/SickRage
refs/heads/master
lib/pyasn1/codec/cer/decoder.py
261
# CER decoder from pyasn1.type import univ from pyasn1.codec.ber import decoder from pyasn1.compat.octets import oct2int from pyasn1 import error class BooleanDecoder(decoder.AbstractSimpleDecoder): protoComponent = univ.Boolean(0) def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length, ...
miracle2k/stgit
refs/heads/master
stgit/commands/sink.py
1
__copyright__ = """ Copyright (C) 2007, Yann Dirson <ydirson@altern.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, bu...
pedrobaeza/OpenUpgrade
refs/heads/8.0
openerp/addons/base/tests/test_mail_examples.py
302
#!/usr/bin/env python # -*- coding: utf-8 -*- MISC_HTML_SOURCE = """ <font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font> <div style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; font-size: 12px; fo...
ibmsoe/ImpalaPPC
refs/heads/Impala2.6-main
shell/ext-py/sqlparse-0.1.14/tests/test_functions.py
45
''' Created on 13/02/2012 @author: piranna ''' from unittest import main, TestCase from sqlparse.filters import IncludeStatement, Tokens2Unicode from sqlparse.lexer import tokenize import sys sys.path.insert(0, '..') from sqlparse.filters import compact from sqlparse.functions import getcolumns, getlimit, IsType ...
KousikaGanesh/purchaseandInventory
refs/heads/master
openerp/addons/point_of_sale/wizard/__init__.py
61
# -*- 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...
jonchang/CloudForest
refs/heads/master
build/rpy2/rpy/robjects/tests/__init__.py
3
import unittest import testRObject import testVector import testArray import testDataFrame import testFormula import testFunction import testEnvironment import testRobjects import testMethods import testPackages import testHelp import testLanguage # wrap this nicely so a warning is issued if no numpy present import t...
vetalypp/e2openplugin-CrossEPG
refs/heads/master
scripts/lib/__init__.py
3
# empty file
mayank-johri/LearnSeleniumUsingPython
refs/heads/master
Section 2 - Advance Python/Chapter S2.06 - Web Development/code/flask/jinja_variable.py
2
""".""" from flask import Flask, render_template app = Flask(__name__) @app.route('/') def రేమకు_స్వాగతం(): """swagatham in telugu language.""" return render_template('jinja_variable.html', welcome="రేమకు స్వాగతం" ) if __name__ == '__main__': app.run()
wakermahmud/sync-engine
refs/heads/master
tests/api/test_files.py
1
# -*- coding: utf-8 -*- import os import md5 import json from datetime import datetime import pytest FILENAMES = ['muir.jpg', 'LetMeSendYouEmail.wav', 'piece-jointe.jpg', 'andra-moi-ennepe.txt'] @pytest.fixture def draft(db, default_account): return { 'subject': 'Draft test at {}'.format(...
maxamillion/ansible
refs/heads/devel
test/units/module_utils/facts/network/test_fc_wwn.py
14
# -*- coding: utf-8 -*- # Copyright (c) 2019 Ansible Project # 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 from ansible.module_utils.facts.network import fc_wwn from units.compat.mock i...
darjeeling/django
refs/heads/master
django/db/backends/sqlite3/introspection.py
9
import re import warnings from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.db.models.indexes import Index from django.utils.deprecation import RemovedInDjango21Warning field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$') def get_...
abhattad4/Digi-Menu
refs/heads/master
digimenu2/tests/force_insert_update/models.py
581
""" Tests for forcing insert and update queries (instead of Django's normal automatic behavior). """ from django.db import models class Counter(models.Model): name = models.CharField(max_length=10) value = models.IntegerField() class InheritedCounter(Counter): tag = models.CharField(max_length=10) cla...
lvchaqiu/meizu-mx-kernel
refs/heads/master
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
Fokko/incubator-airflow
refs/heads/master
airflow/contrib/operators/emr_add_steps_operator.py
1
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
doctormo/gtkme
refs/heads/master
setup.py
1
#!/usr/bin/env python # # Copyright (C) 2010 Martin Owens # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This pro...
stinos/micropython
refs/heads/master
tests/basics/builtin_exec.py
23
# test builtin exec try: exec except NameError: print("SKIP") raise SystemExit print(exec("def foo(): return 42")) print(foo()) d = {} exec("def bar(): return 84", d) print(d["bar"]()) # passing None/dict as args to globals/locals foo = 11 exec('print(foo)') exec('print(foo)', None) exec('print(foo)', {...
catapult-project/catapult
refs/heads/master
third_party/gsutil/third_party/pyu2f/pyu2f/convenience/customauthenticator.py
7
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
azatoth/scons
refs/heads/master
src/engine/SCons/Tool/f90.py
6
"""engine.SCons.Tool.f90 Tool-specific initialization for the generic Posix f90 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of c...
kspviswa/personfinder
refs/heads/master
tools/babel/messages/pofile.py
54
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists of v...
sgraham/nope
refs/heads/master
tools/gyp/test/hello/gyptest-target.py
351
#!/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. """ Verifies simplest-possible build of a "Hello, world!" program using an explicit build target of 'hello'. """ import TestGyp test = Tes...