repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
madjam/mxnet | refs/heads/master | example/bayesian-methods/data_loader.py | 26 | # 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... |
trondhindenes/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/na_ontap_net_routes.py | 9 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# 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'],
... |
dundeemt/SoCo | refs/heads/master | soco/config.py | 1 | # -*- coding: utf-8 -*-
"""Configuration variables.
These may be set by your code as follows::
from soco import config
...
config.VARIABLE = value
"""
from __future__ import unicode_literals
#: The class object to use when SoCo instances are created. Specify the actual
#: callable class object here, no... |
Comunitea/CMNT_00098_2017_JIM_addons | refs/heads/master | prices_export/models/export_prices.py | 1 | # -*- coding: utf-8 -*-
# © 2020 Comunitea - Kiko Sánchez <kiko@comunitea.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import fields, models, api, _
from datetime import datetime
import logging
_logger = logging.getLogger('--EXPORTACIÓN PRECIOS--')
class ExportPrices(models.Model):... |
xxsergzzxx/python-for-android | refs/heads/master | python-modules/twisted/twisted/words/im/tocsupport.py | 55 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""TOC (i.e. AIM) support for Instance Messenger."""
# System Imports
import string, re
from zope.interface import implements
# Twisted Imports
from twisted.words.protocols import toc
from twisted.words.im.locals import ONLINE, OFFLIN... |
anthonysandrin/kafka-utils | refs/heads/master | kafka_utils/kafka_consumer_manager/commands/offset_save.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
jeroenj/CouchPotatoServer | refs/heads/master | libs/xmpp/roster.py | 203 | ## roster.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
... |
mujiansu/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/AutoExpand.py | 227 | import string
import re
###$ event <<expand-word>>
###$ win <Alt-slash>
###$ unix <Alt-slash>
class AutoExpand:
menudefs = [
('edit', [
('E_xpand Word', '<<expand-word>>'),
]),
]
wordchars = string.ascii_letters + string.digits + "_"
def __init__(self, editwin):
... |
akretion/l10n-brazil | refs/heads/10.0 | l10n_br_crm/tests/test_crm_lead.py | 1 | # -*- coding: utf-8 -*-
# @ 2017 Akretion - www.akretion.com.br -
# Clément Mombereau <clement.mombereau@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class CrmLeadTest(TransactionCase):
"""Test basic operations on Lead"""
... |
TripleDogDare/RadioWCSpy | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 1009 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... |
the-zebulan/CodeWars | refs/heads/master | katas/kyu_6/which_are_in.py | 1 | # def in_array(array1, array2):
# array2 = ' '.join(array2)
# return sorted(set(a for a in array1 if a in array2))
def in_array(array1, array2):
result = set()
for a in array1:
for b in array2:
if a in b:
result.add(a)
break
return sorted(result)... |
ClaudioNahmad/Servicio-Social | refs/heads/master | Parametros/CosmoMC/prerrequisitos/plc-2.0/.waf-1.8.8-eab538dea2e33915d3770ff3f393b18b/waflib/Context.py | 1 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os,re,imp,sys
from waflib import Utils,Errors,Logs
import waflib.Node
HEXVERSION=0x1080800
WAFVERSION="1.8.8"
WAFREVISION="8ac4646d0966fe22f8ae8955c7e9b9d56ae8288e"
ABI=98
DBFILE='.wafpickle-%... |
CSC301H-Fall2013/JuakStore | refs/heads/master | site-packages/django/db/models/constants.py | 113 | """
Constants used across the ORM in general.
"""
# Separator used to split filter strings apart.
LOOKUP_SEP = '__'
|
rajsadho/django | refs/heads/master | django/contrib/gis/gdal/prototypes/ds.py | 349 | """
This module houses the ctypes function prototypes for OGR DataSource
related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*,
OGR_Fld_* routines are relevant here.
"""
from ctypes import POINTER, c_char_p, c_double, c_int, c_long, c_void_p
from django.contrib.gis.gdal.envelope import OGREnvelope
from djan... |
qiankunshe/sky_engine | refs/heads/master | build/win/use_ansi_codes.py | 64 | #!/usr/bin/env python
# Copyright (c) 2015 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.
"""Prints if the the terminal is likely to understand ANSI codes."""
import os
# Add more terminals here as needed.
print 'ANSICON... |
NeCTAR-RC/horizon | refs/heads/nectar/stein | openstack_dashboard/dashboards/admin/metadata_defs/views.py | 2 | # (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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... |
suutari/prequ | refs/heads/master | tests/test_ini_parser.py | 2 | from __future__ import unicode_literals
import textwrap
from io import StringIO
import pytest
from prequ.ini_parser import ParseError, bool_or_auto, parse_ini, text
def test_basics():
ini_content = StringIO(textwrap.dedent("""
[some-section]
b = yes
ba = auto
t = Hello World!
l =
va... |
ty221/fossasia-guard | refs/heads/master | AdminBot/__init__.py | 2 | from AdminbotMain import *
from LoggingMain import *
|
marckuz/django | refs/heads/master | django/contrib/gis/geos/prototypes/predicates.py | 339 | """
This module houses the GEOS ctypes prototype functions for the
unary and binary predicate operations on geometries.
"""
from ctypes import c_char, c_char_p, c_double
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
# #... |
iut-ibk/DynaMind-UrbanSim | refs/heads/master | 3rdparty/opus/src/biogeme/mnl_estimation.py | 2 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from NumPtr import getpointer
from numpy import where, zeros, float64, float32, array
from opus_core.estimation_procedure import EstimationProcedure
from opus_core.logger import logger
from opu... |
incaser/odoo-odoo | refs/heads/8.0 | addons/mail/mail_message.py | 141 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/helpers/py2only/docutils/transforms/__init__.py | 186 | # $Id: __init__.py 6433 2010-09-28 08:21:25Z milde $
# Authors: David Goodger <goodger@python.org>; Ueli Schlaepfer
# Copyright: This module has been placed in the public domain.
"""
This package contains modules for standard tree transforms available
to Docutils components. Tree transforms serve a variety of purposes... |
atul-bhouraskar/django | refs/heads/master | tests/m2o_recursive/tests.py | 419 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Category, Person
class ManyToOneRecursiveTests(TestCase):
def setUp(self):
self.r = Category(id=None, name='Root category', parent=None)
self.r.save()
self.c = Category(id=None, name='Child cate... |
jbwhit/coal-exploration | refs/heads/master | develop/2015-11-21-JBW-coal-predict.py | 1 |
# coding: utf-8
# # Make a prediction about the coal production
# In[3]:
get_ipython().magic(u'matplotlib inline')
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
sns.set();
# In[4]:
df = pd.read_csv("../data/cleaned_coalpublic2013.csv", index_col='MSHA ID')
df.head()... |
KublaikhanGeek/ShadowsocksFork | refs/heads/master | shadowsocks/crypto/rc4_md5.py | 1042 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... |
CamelBackNotation/CarnotKE | refs/heads/master | jyhton/Lib/test/test_jython_initializer.py | 11 | import os
import subprocess
import sys
import unittest
from test import test_support
WINDOWS = (os._name if test_support.is_jython else os.name) == 'nt'
class TestUsingInitializer(unittest.TestCase):
def test_syspath_initializer(self):
fn = test_support.findfile('check_for_initializer_in_syspath.py')
... |
jounex/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/conf/locale/el/formats.py | 118 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd E Y'
TIME_FORMAT = 'g:i:s A'
# ... |
apibitsco/rainforestapp-python | refs/heads/master | rainforest/apibits/__init__.py | 2 | # Version
from .version import VERSION
# Errors
from .errors import ApibitsError, ApiError, AuthenticationError, ConnectionError
# Wrapper around RestClient
from .requester import Requester
# Builders for creating ApiMethods.
from .api_method import ApiMethod
from .headers_builder import HeadersBuilder
from .params_... |
lucashmorais/x-Bench | refs/heads/master | mozmill-env/linux/python-lib/mercurial/context.py | 90 | # context.py - changeset and file context objects for mercurial
#
# Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from node import nullid, nullrev, short, hex, bin
from i18n im... |
wuhengzhi/chromium-crosswalk | refs/heads/master | third_party/typ/typ/tests/printer_test.py | 84 | # Copyright 2014 Dirk Pranke. 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... |
siosio/intellij-community | refs/heads/master | python/testData/completion/dictKeys.py | 83 | tasks = {key: "123"}
tasks[ke<caret>] |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/reportlab-3.2.0/src/reportlab/platypus/tables.py | 25 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/tables.py
__version__=''' $Id$ '''
__doc__="""
Tables are created by passing the constructor a tuple of column widths, a tuple of row heights... |
logicabrity/odes | refs/heads/master | docs/src/examples/doublependulum.py | 1 | # Authors: B. Malengier
"""
Example to show the use of stepwise solving, using the ida or the ddaspk
solver. It also shows how a class is used to hold the problem data.
This example shows how to solve the double pendulum in full coordinate space.
This results in a dae system.
The problem is easily stated: a first pen... |
Newsboy-VA/Newsboy-Core | refs/heads/master | client/user_io/__init__.py | 1 | from .speech_io import SpeechIO
from .text_io import TextIO
|
CongLi/avocado-vt | refs/heads/master | shared/scripts/wait_for_quit.py | 21 | while True:
in_put = raw_input("")
if in_put in ['exit', 'quit']:
print "Bye"
break
|
zasdfgbnm/tensorflow | refs/heads/master | tensorflow/python/summary/summary.py | 1 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
drencrom/yowsup | refs/heads/master | yowsup/structs/protocolentity.py | 67 | from .protocoltreenode import ProtocolTreeNode
import unittest, time
class ProtocolEntity(object):
__ID_GEN = 0
def __init__(self, tag):
self.tag = tag
def getTag(self):
return self.tag
def isType(self, typ):
return self.tag == typ
def _createProtocolTreeNode(self, attri... |
WhiteVell/Amber | refs/heads/master | node-v0.10.20/deps/v8/tools/test.py | 16 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... |
Jspsun/LEETCodePractice | refs/heads/master | Python/VerifyingAnAlienDictionary.py | 1 | class Solution(object):
def isAlienSorted(self, words, order):
m = {c: i for i, c in enumerate(order)}
words = [[m[c] for c in w] for w in words]
return all(w1 <= w2 for w1, w2 in zip(words, words[1:])) |
mechio/takana-sublime | refs/heads/master | takana.py | 5 | import sublime, sublime_plugin, time, os.path, json, threading, sys, socket, time
from threading import Thread
try:
import socketserver
except ImportError:
import SocketServer as socketserver
VERSION = "Takana plugin v0.4"
DEBUG = False
TAKANA_SERVER_PORT = 48628
st_ver = 3000 ... |
0k/odoo | refs/heads/master | addons/website_sale/models/__init__.py | 66 | import product
import sale_order
|
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/pilight/const.py | 23 | """Consts used by pilight."""
CONF_DIMLEVEL_MAX = "dimlevel_max"
CONF_DIMLEVEL_MIN = "dimlevel_min"
CONF_ECHO = "echo"
CONF_OFF = "off"
CONF_OFF_CODE = "off_code"
CONF_OFF_CODE_RECEIVE = "off_code_receive"
CONF_ON = "on"
CONF_ON_CODE = "on_code"
CONF_ON_CODE_RECEIVE = "on_code_receive"
CONF_SYSTEMCODE = "systemcode"
C... |
emakis/erpnext | refs/heads/develop | erpnext/setup/doctype/target_detail/__init__.py | 37694 | from __future__ import unicode_literals
|
cselis86/edx-platform | refs/heads/installer | cms/djangoapps/contentstore/features/signup.py | 111 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module
@step('I fill in the registration form$')
def i_fill_in_the_registration_form(step):
def fill_in_reg_form():
reg... |
dandan94/OpenGLTest | refs/heads/master | finalOpenGL/HelloGLFW/lib/boost_1_59_0/libs/python/test/test_pointer_adoption.py | 46 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from test_pointer_adoption_ext import *
>>> num_a_instances()
0
>>> a = create('dynamically allocated')
>>> num_a_instances()
... |
rbarlow/pulp | refs/heads/master | server/pulp/server/async/manage_workers.py | 1 | """
This module manages creation, deletion, starting, and stopping of the systemd unit files for Pulp's
Celery workers. It accepts one parameter, which must be start or stop.
"""
from glob import glob
import multiprocessing
import os
import subprocess
import sys
_ENVIRONMENT_FILE = os.path.join('/', 'etc', 'default',... |
arank/mxnet | refs/heads/master | python/mxnet/ndarray.py | 5 | # coding: utf-8
# pylint: disable= too-many-lines, redefined-builtin, protected-access
# pylint: disable=import-error, no-name-in-module, undefined-variable
"""NDArray API of MXNet."""
from __future__ import absolute_import
from __future__ import division
try:
from __builtin__ import slice as py_slice
except Import... |
freedomtan/tensorflow | refs/heads/master | tensorflow/lite/testing/op_tests/one_hot.py | 16 | # Copyright 2019 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... |
brokenjacobs/ansible | refs/heads/devel | lib/ansible/module_utils/k8s_common.py | 62 | #
# Copyright 2017 Red Hat | Ansible
#
# 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.
#
# ... |
flwh/KK_mt6589_iq451 | refs/heads/master | prebuilts/python/darwin-x86/2.7.5/lib/python2.7/test/test_cmd_line.py | 83 | # Tests invocation of the interpreter with various command line arguments
# All tests are executed with environment variables ignored
# See test_cmd_line_script.py for testing of script execution
import test.test_support
import sys
import unittest
from test.script_helper import (
assert_python_ok, assert_python_fa... |
sshnaidm/ru | refs/heads/master | script.torrent-tv.ru/menu.py | 2 | # Copyright (c) 2013 Torrent-TV.RU
# Writer (c) 2013, Welicobratov K.A., E-mail: 07pov23@gmail.com
import xbmcgui
import time
import xbmcaddon
import json
import defines
def LogToXBMC(text, type = 1):
ttext = ''
if type == 2:
ttext = 'ERROR:'
log = open(defines.ADDON_PATH + '/menuform.log', 'a... |
aperigault/ansible | refs/heads/devel | lib/ansible/playbook/attribute.py | 68 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
takeshineshiro/nova | refs/heads/master | nova/api/openstack/compute/cells.py | 3 | # Copyright 2011-2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, 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/lic... |
hbrunn/OpenUpgrade | refs/heads/master | addons/web/static/lib/py.js/doc/conf.py | 543 | # -*- coding: utf-8 -*-
#
# py.js documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 9 19:36:23 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... |
bcornwellmott/erpnext | refs/heads/develop | erpnext/patches/v8_1/allow_invoice_copy_to_edit_after_submit.py | 27 | import frappe
def execute():
inv_copy_options = "ORIGINAL FOR RECIPIENT\nDUPLICATE FOR TRANSPORTER\nDUPLICATE FOR SUPPLIER\nTRIPLICATE FOR SUPPLIER"
frappe.db.sql("""update `tabCustom Field` set allow_on_submit=1, options=%s
where fieldname='invoice_copy' and dt = 'Sales Invoice'
""", inv_copy_options)
frapp... |
adriank/ACR | refs/heads/master | ACR/plugins/__init__.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Asyncode Runtime - XML framework allowing developing internet
# applications without using programming languages.
# Copyright (C) 2008-2010 Adrian Kalbarczyk
# This program is free software: you can redistribute it and/or modify
# it under the terms of the version 3 of... |
m4rx9/rna-pdb-tools | refs/heads/master | rna_tools/tools/clarna_play/ClaRNAlib/gen-pdb.py | 2 | #!/usr/bin/env python
#
# Caution!
# this script requires Residues Dictionaries in gc-data/residues/
# (for example: gc-data/residues/1rna_rna.residues.json.gz)
#
# Example usage:
#
# - generate single doublet
# ./gen-pdb.py --doublet-id=157D:A10:B1 -o example-ww-cis.pdb --type=full
#
# - generate multiple doublets f... |
weidongxu84/info-gatherer | refs/heads/master | django/core/files/storage.py | 78 | import os
import errno
import urlparse
import itertools
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.core.files import locks, File
from django.core.files.move import file_move_safe
from django.utils.encoding impo... |
pedro-b/layer-switcher | refs/heads/master | pytmx/tmxloader3.py | 1 | """
Map loader for TMX Files
bitcraft (leif.theden at gmail.com)
v.7 -- for python 3.x
If you have any problems, please contact me via email.
Tested with Tiled 0.7.1 for Mac.
released under the LGPL v3
======================================================================
Design Goals:
Simple api
Memory eff... |
zsdonghao/tensorlayer | refs/heads/master | tensorlayer/models/__init__.py | 1 | #! /usr/bin/python
# -*- coding: utf-8 -*-
# """A collections of pre-defined well known models."""
from .vgg16 import VGG16
from .squeezenetv1 import SqueezeNetV1
from .mobilenetv1 import MobileNetV1
from .vgg19 import VGG19
|
kool79/intellij-community | refs/heads/master | python/testData/refactoring/move/globalStatementOnly/before/src/a.py | 79 | VAR = 42
def func():
global VAR |
woodpecker1/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/QueueStatusServer/model/warninglog.py | 122 | # Copyright (C) 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 ... |
rowanj/gitx | refs/heads/master | sign.py | 8 | #!/usr/bin/env python
# Original work by Rowan James at https://gist.github.com/rowanj/5475988
# This is free and unencumbered software released into the public domain.
# http://unlicense.org
import argparse
import subprocess
import os
import glob
import stat
def sign(target, key, verbose=0):
print('Signing ' +... |
prengifo/GuardabosquesUSB | refs/heads/master | GuardabosquesUSB/login/admin.py | 1 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from models import Estudiante
# Define an inline admin descriptor for Estudiante model
# which acts a bit like a singleton
class EstudianteInline(admin.StackedInline):
model = Estudiante
... |
mpatacchiola/deepgaze | refs/heads/master | examples/ex_corner_detection_video/ex_corner_detection.py | 1 | #!/usr/bin/env python
#The MIT License (MIT)
#Copyright (c) 2020 Massimiliano Patacchiola
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ... |
AriZuu/micropython | refs/heads/master | tests/basics/class_store_class.py | 39 | # Inspired by urlparse.py from CPython 3.3 stdlib
# There was a bug in MicroPython that under some conditions class stored
# in instance attribute later was returned "bound" as if it was a method,
# which caused class constructor to receive extra argument.
try:
from collections import namedtuple
except ImportError:... |
migonzalvar/youtube-dl | refs/heads/master | youtube_dl/extractor/tvc.py | 113 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
)
class TVCIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?tvc\.ru/video/iframe/id/(?P<id>\d+)'
_TEST = {
'url': 'http://www.tvc.ru/video/ifra... |
fishstamp82/moltools | refs/heads/master | moltools/test/pdbreader_tests/concaps_level2.py | 1 | #!/usr/bin/env python
import os, re, math, sys, argparse, subprocess, numpy, tarfile
from daltools import one, mol, dens, prop, lr
from daltools.util import full, blocked, subblocked, timing
from own import *
from operator import attrgetter
from applequistbreader import *
def setup():
""" Default arguments used fo... |
Pritam-Rakshit/Diffie-Hellman-Key-exchange-algorithm-implementation | refs/heads/master | DHKE_CLI.py | 1 | #!/usr/bin/python
import socket
from random import randint
import re
import random
#Diffie-Hellman key exchange initializer - client side
class DHE:
def __init__(self,root,prime,recv_key):
self.root=root
# print("Root: -->"+str(self.rp_val))
self.prime=prime
# print("Prime: -->"+str(self.root_prime[self.rp_val... |
guettli/django | refs/heads/master | tests/i18n/patterns/urls/path_unused.py | 452 | from django.conf.urls import url
from django.views.generic import TemplateView
view = TemplateView.as_view(template_name='dummy.html')
urlpatterns = [
url(r'^nl/foo/', view, name='not-translated'),
]
|
Natim/sentry | refs/heads/master | tests/sentry/web/frontend/test_auth_login.py | 10 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from exam import fixture
from sentry.testutils import TestCase
from sentry.models import User
# TODO(dcramer): need tests for SSO behavior and single org behavior
class AuthLoginTest(TestCase):
@fixture
def path(self):
... |
yangming85/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/conditional_processing/urls.py | 102 | from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
('^$', views.index),
('^last_modified/$', views.last_modified_view1),
('^last_modified2/$', views.last_modified_view2),
('^etag/$', views.etag_view1),
('^etag2/$', views.etag_view2),
)
|
resmo/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_dns_cache_resolver.py | 22 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... |
beermix/source | refs/heads/master | package/lean/luci-app-ssrserver-python/root/usr/share/ssr/shadowsocks/obfsplugin/plain.py | 2 | #!/usr/bin/env python3
#
# Copyright 2015-2015 breakwa11
#
# 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 l... |
chauhanmohit/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py | 122 | # 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... |
jrief/django-cms | refs/heads/master | cms/tests/check.py | 2 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import unittest
from djangocms_text_ckeditor.cms_plugins import TextPlugin
from django.template import TemplateSyntaxError, base
from django.test import TestCase
from cms.api import add_plugin
from cms.models.pluginmodel import CMSPlugin
from cms... |
zooba/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pythonwin/pywin/Demos/app/customprint.py | 7 | # A demo of an Application object that has some custom print functionality.
# If you desire, you can also run this from inside Pythonwin, in which
# case it will do the demo inside the Pythonwin environment.
# This sample was contributed by Roger Burnham.
from pywin.mfc import docview, dialog, afxres
from pywin.fram... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Source/Python/Lib/python27/plat-mac/findertools.py | 29 | """Utility routines depending on the finder,
a combination of code by Jack Jansen and erik@letterror.com.
Most events have been captured from
Lasso Capture AE and than translated to python code.
IMPORTANT
Note that the processes() function returns different values
depending on the OS version it is running on. On MacO... |
abhishekkrthakur/scikit-learn | refs/heads/master | examples/cluster/plot_dict_face_patches.py | 337 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... |
Beauhurst/django | refs/heads/master | django/db/backends/oracle/introspection.py | 9 | import warnings
import cx_Oracle
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.deprecation import RemovedInDjango21Warning
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type objects to Django Field types.
data_ty... |
Edraak/edx-platform | refs/heads/master | lms/djangoapps/discussion_api/render.py | 168 | """
Content rendering functionality
Note that this module is designed to imitate the front end behavior as
implemented in Markdown.Sanitizer.js.
"""
import re
import markdown
# These patterns could be more flexible about things like attributes and
# whitespace, but this is imitating Markdown.Sanitizer.js, so it uses... |
ondrokrc/gramps | refs/heads/master | gramps/webapp/grampsdb/view/__init__.py | 3 | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2012 Douglas S. Blank <doug.blank@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Lice... |
tchellomello/python-amcrest | refs/heads/master | src/amcrest/media.py | 1 | # -*- coding: utf-8 -*-
#
# 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, version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY... |
tdautc19841202/wechat-bot | refs/heads/master | plugins/oschina.py | 3 | #coding=utf-8
import requests
from xml.etree import ElementTree
from tornado.util import ObjectDict
__name__ = 'oschina'
def test(data, msg=None, bot=None):
if ('oschina' in data or '开源中国' in data) and '最新' in data and '新闻' in data:
return True
return False
def respond(data, msg=None, bot=None):
... |
Havate/havate-openstack | refs/heads/master | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py | 12 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay 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 ... |
ohmini/thaifoodapi | refs/heads/master | lib/django/utils/html_parser.py | 348 | import re
import sys
from django.utils import six
from django.utils.six.moves import html_parser as _html_parser
current_version = sys.version_info
use_workaround = current_version < (2, 7, 3)
try:
HTMLParseError = _html_parser.HTMLParseError
except AttributeError:
# create a dummy class for Python 3.5+ whe... |
planetarymike/IDL-Colorbars | refs/heads/master | IDL_py_test/029_Nature.py | 1 | from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
cm_data = [[0.411765, 0.964706, 0.917647],
[0.411765, 0.964706, 0.917647],
[0.411765, 0.964706, 0.917647],
[0.411765, 0.964706, 0.917647],
[0.411765, 0.964706, 0.917647],
[0.411765, 0.964706, 0.917647],
[0.411765, 0.964706, 0.917647],
[0.4... |
maxkferg/smart-city-model | refs/heads/master | modules/navigation/ddpg/__init__.py | 1 | from .ddpg import DDPG, REPLAY_START_SIZE |
eddyb/servo | refs/heads/master | tests/wpt/web-platform-tests/XMLHttpRequest/resources/access-control-basic-put-allow.py | 46 | def main(request, response):
if request.method == "OPTIONS":
response.headers.set("Content-Type", "text/plain")
response.headers.set("Access-Control-Allow-Credentials", "true")
response.headers.set("Access-Control-Allow-Methods", "PUT")
response.headers.set("Access-Control-Allow-Orig... |
javachengwc/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl/writer/excel.py | 61 | # file openpyxl/writer/excel.py
# Copyright (c) 2010 openpyxl
#
# 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, m... |
digitalocean/netbox | refs/heads/develop | netbox/extras/models/change_logging.py | 1 | from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.urls import reverse
from utilities.querysets import RestrictedQuerySet
from utilities.utils import serialize_o... |
felix-d/boto | refs/heads/develop | boto/file/key.py | 153 | # Copyright 2010 Google Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
#
# 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... |
dga4654dan/UTM-Demo | refs/heads/master | V_1_0_2_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/test/test_socketserver.py | 10 | # Test suite for SocketServer.py
import test_support
from test_support import verbose, verify, TESTFN, TestSkipped
test_support.requires('network')
from SocketServer import *
import socket
import select
import time
import threading
import os
NREQ = 3
DELAY = 0.5
class MyMixinHandler:
def handle(self):
t... |
retomerz/intellij-community | refs/heads/master | python/helpers/py3only/docutils/utils/math/latex2mathml.py | 46 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# :Id: $Id: latex2mathml.py 7668 2013-06-04 12:46:30Z milde $
# :Copyright: © 2010 Günter Milde.
# Based on rst2mathml.py from the latex_math sandbox project
# © 2005 Jens Jørgen Mortensen
# :License: Released under the terms of the `2-Clause BSD li... |
DanielAttia/namebench | refs/heads/master | nb_third_party/dns/rdtypes/IN/NSAP_PTR.py | 248 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
rjschwei/WALinuxAgent | refs/heads/master | tests/daemon/__init__.py | 46 | # Copyright 2018 Microsoft Corporation
#
# 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... |
cpselvis/zhihu-crawler | refs/heads/master | bloom_filter.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import mmh3
from bitarray import bitarray
"""
zhihu_crawler.bloom_filter
Implement a simple bloom filter with murmurhash algorithm.
Bloom filter is used to check wether an element exists in a collection, and it has a good performance in big data situation.
It may has positiv... |
sestrella/ansible | refs/heads/devel | lib/ansible/module_utils/network/vyos/vyos.py | 5 | # 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 complete wo... |
techdragon/django | refs/heads/master | tests/model_package/models/__init__.py | 580 | # Import all the models from subpackages
from .article import Article
from .publication import Publication
__all__ = ['Article', 'Publication']
|
liukaijv/XlsxWriter | refs/heads/master | xlsxwriter/test/comparison/test_outline04.py | 8 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.