repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
serverdensity/sdbot
refs/heads/master
limbo/server.py
16
class LimboServer(object): def __init__(self, slack, config, hooks, db): self.slack = slack self.config = config self.hooks = hooks self.db = db def query(self, sql, *params): c = self.db.cursor() c.execute(sql, params) rows = c.fetchall() c.close...
oandrew/home-assistant
refs/heads/dev
homeassistant/components/notify/twilio_sms.py
11
""" Twilio SMS platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.twilio_sms/ """ import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.notify import...
glennmatthews/cot
refs/heads/master
versioneer.py
77
# Version: 0.17 """The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, and pypy * [![Latest Version] (http...
iychoi/syndicate-core
refs/heads/master
tests/gateways/syndicate-write-trunc-samehandle-read-repl.py
2
#!/usr/bin/env python """ Copyright 2016 The Trustees of Princeton University 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 Unle...
shownomercy/django
refs/heads/master
django/contrib/gis/admin/__init__.py
59
from django.contrib.admin import ( HORIZONTAL, VERTICAL, AdminSite, ModelAdmin, StackedInline, TabularInline, autodiscover, site, ) from django.contrib.gis.admin.options import GeoModelAdmin, OSMGeoAdmin from django.contrib.gis.admin.widgets import OpenLayersWidget __all__ = [ 'autodiscover', 'site', 'Admi...
amyvmiwei/miwei_temp
refs/heads/master
src/cc/HyperPython/tests/reader.py
5
import sys import time import libHyperPython from hypertable.thriftclient import * from hyperthrift.gen.ttypes import * try: client = ThriftClient("localhost", 15867) print "SerializedCellsReader example" namespace = client.namespace_open("test") client.hql_query(namespace, "drop table if exists thrift_test")...
ClearCorp-dev/odoo
refs/heads/8.0
openerp/addons/test_converter/tests/test_html.py
66
# -*- encoding: utf-8 -*- import json import os import datetime from lxml import etree from openerp.tests import common from openerp.tools import html_escape as e from openerp.addons.base.ir import ir_qweb directory = os.path.dirname(__file__) class TestExport(common.TransactionCase): _model = None def set...
zhjunlang/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/seq_tests.py
104
""" Tests common to tuple, list and UserList.UserList """ import unittest import sys import pickle # Various iterables # This is used for checking the constructor (here and in test_deque.py) def iterfunc(seqn): 'Regular generator' for i in seqn: yield i class Sequence: 'Sequence using __getitem__...
linpingchuan/misc
refs/heads/master
python/ml/wechat/ch1/Perceptron.py
1
# # coding=utf-8 # # class Perceptron: # def __init__(self,input_num,activator): # self.activator=activator # self.weights=[0.0 for _ in range(input_num)] # self.bias=0.0 # # def train(self,input_vecs,labels,iteration,rate): # for i in range(iteration): # self._one_it...
Jackeagle/CAF-Kernel
refs/heads/kk_3.5_rb1.21
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...
rs2/pandas
refs/heads/master
pandas/core/sorting.py
1
""" miscellaneous sorting / groupby utilities """ from collections import defaultdict from typing import ( TYPE_CHECKING, Callable, DefaultDict, Iterable, List, Optional, Tuple, Union, ) import numpy as np from pandas._libs import algos, hashtable, lib from pandas._libs.hashtable impor...
Snowlinux/snowupdate
refs/heads/master
janitor/plugincore/tests/data/alpha_plugin.py
1
# Copyright (C) 2008-2012 Canonical, Ltd. # -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4; 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 3 of the License. ...
sabbour/azure-quickstart-templates
refs/heads/master
splunk-on-ubuntu/scripts/dobackup.py
119
#!/usr/bin/env python3 #      The MIT License (MIT) # #      Copyright (c) 2016 Microsoft. 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 restr...
splunk/splunk-webframework
refs/heads/master
contrib/django/django/templatetags/static.py
114
try: from urllib.parse import urljoin except ImportError: # Python 2 from urlparse import urljoin from django import template from django.template.base import Node from django.utils.encoding import iri_to_uri register = template.Library() class PrefixNode(template.Node): def __repr__(self): ...
naveenvprakash/portia
refs/heads/master
slybot/slybot/validation/schema.py
13
"""Simple validation of specifications passed to slybot""" from __future__ import absolute_import from os.path import dirname, join import json import rfc3987 from urlparse import urlparse, parse_qsl from urllib import urlencode from urllib2 import unquote from jsonschema import (Draft3Validator, RefResolver, FormatC...
KhronosGroup/COLLADA-CTS
refs/heads/master
StandardDataSets/collada/library_controllers/controller/skin/skin_2_influence/skin_2_influence.py
2
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ...
SebastianoF/bruker2nifti
refs/heads/master
bruker2nifti/cli/__init__.py
1
__all__ = ["bruker2nii", "bruker2nii_scan"]
wengyanqing/incubator-hawq
refs/heads/master
tools/bin/gppylib/operations/dump_analyzedb.py
12
# 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...
msmolens/VTK
refs/heads/slicer-v6.3.0-2015-07-21-426987d
ThirdParty/Twisted/twisted/words/protocols/jabber/sasl_mechanisms.py
33
# -*- test-case-name: twisted.words.test.test_jabbersaslmechanisms -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Protocol agnostic implementations of SASL authentication mechanisms. """ import binascii, random, time, os from hashlib import md5 from zope.interface import Interface,...
storm-computers/odoo
refs/heads/9.0
openerp/addons/base/tests/test_base.py
20
import unittest import openerp.tests.common as common from openerp.exceptions import ValidationError class test_base(common.TransactionCase): def setUp(self): super(test_base,self).setUp() self.res_partner = self.registry('res.partner') self.res_users = self.registry('res.users') ...
VRaviTheja/SDN-policy
refs/heads/master
testing/testing_2_version.py
2
#!/usr/bin/python import pytricia import reading_file_to_dict import sys import pprint import csv import p_trie with open("new_table99", "w"): pass f_new=open("new_table99","w+") def creating_dict(): device_values = reading_file_to_dict.csv_dict_list(sys.argv[1]) # Calls the csv_dict_list function, pass...
Phuehvk/gyp
refs/heads/master
test/win/gyptest-link-nodefaultlib.py
344
#!/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. """ Make sure nodefaultlib setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.Test...
tswast/google-cloud-python
refs/heads/master
securitycenter/google/cloud/securitycenter_v1beta1/proto/security_marks_pb2_grpc.py
573
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc
wberrier/meson
refs/heads/master
mesonbuild/dependencies/misc.py
1
# Copyright 2013-2017 The Meson development team # 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 agre...
RomanZWang/osf.io
refs/heads/develop
api/base/authentication/backends.py
47
from framework.auth.core import get_user, User # https://docs.djangoproject.com/en/1.8/topics/auth/customizing/ class ODMBackend(object): def authenticate(self, username=None, password=None): return get_user(username=username, password=password) or None def get_user(self, user_id): return Use...
koparasy/gemfi
refs/heads/master
src/mem/ruby/system/RubySystem.py
15
# Copyright (c) 2009 Advanced Micro Devices, 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...
sahiljain/catapult
refs/heads/master
third_party/google-endpoints/libfuturize/fixes/fix_unicode_literals_import.py
63
""" Adds this import: from __future__ import unicode_literals """ from lib2to3 import fixer_base from libfuturize.fixer_util import future_import class FixUnicodeLiteralsImport(fixer_base.BaseFix): BM_compatible = True PATTERN = "file_input" run_order = 9 def transform(self, node, results)...
nwiizo/workspace_2017
refs/heads/master
keras_ex/example/reuters_mlp.py
2
'''Trains and evaluate a simple MLP on the Reuters newswire topic classification task. ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import reuters from keras.models import Sequential from keras.layers import Dense, Dropout, Activation fro...
TRESCLOUD/odoo
refs/heads/Integracion&ControlDeCalidad
addons/product_margin/__init__.py
444
# -*- 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...
baryon5/mercury
refs/heads/master
voting/migrations/0014_auto_20160517_1709.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-17 21:09 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('voting', '0013_auto_20141003_0022'), ] operations =...
tpn/tpn
refs/heads/master
lib/tpn/invariant.py
1
#=============================================================================== # Imports #=============================================================================== import os import re import inspect import datetime import linecache import itertools from .util import ( endswith, ) from os.path import ( ...
ua-snap/downscale
refs/heads/master
snap_scripts/downscaling_v2/copy_files_common_tem_directory_atlas_scratch.py
1
def copy_file( in_fn, out_fn ): try: dirname = os.path.dirname( out_fn ) if not os.path.exists( dirname ): _ = os.makedirs( dirname ) except: pass return shutil.copy( in_fn, out_fn ) def run( x ): return copy_file( *x ) if __name__ == '__main__': import os, glob, shutil import multiprocessing as mp ...
ABaldwinHunter/django-clone
refs/heads/master
django/test/runner.py
60
import collections import ctypes import itertools import logging import multiprocessing import os import pickle import textwrap import unittest from importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import DEFAULT_DB_ALIAS, connection...
pu6ki/elsyser
refs/heads/master
exams/filters.py
1
from rest_framework import filters from students.permissions import IsTeacher class ExamsFilterBackend(filters.BaseFilterBackend): def filter_queryset(self, request, queryset, view): if IsTeacher().has_permission(request, self): return queryset.filter(subject=request.user.teacher.subject) ...
Landver/netmon
refs/heads/master
apps/core/admin.py
13848
from django.contrib import admin # Register your models here.
TheTypoMaster/chromium-crosswalk
refs/heads/master
third_party/tlslite/tlslite/sessioncache.py
111
# Authors: # Trevor Perrin # Martin von Loewis - python 3 port # # See the LICENSE file for legal information regarding use of this file. """Class for caching TLS sessions.""" import threading import time class SessionCache(object): """This class is used by the server to cache TLS sessions. Caching ses...
tareqalayan/ansible
refs/heads/devel
contrib/inventory/openstack_inventory.py
7
#!/usr/bin/env python # Copyright (c) 2012, Marco Vito Moscaritolo <marco@agavee.com> # Copyright (c) 2013, Jesse Keating <jesse.keating@rackspace.com> # Copyright (c) 2015, Hewlett-Packard Development Company, L.P. # Copyright (c) 2016, Rackspace Australia # # This module is free software: you can redistribute it and...
gencer/sentry
refs/heads/master
src/sentry/api/endpoints/organization_integration_details.py
1
from __future__ import absolute_import from sentry import features from sentry.api.bases.organization import ( OrganizationEndpoint, OrganizationIntegrationsPermission ) from sentry.api.serializers import serialize from sentry.models import Integration, OrganizationIntegration class OrganizationIntegrationDetail...
andrewleech/SickRage
refs/heads/master
lib/feedparser/namespaces/admin.py
43
# Support for the administrative elements extension # Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided th...
Maximilian-Reuter/SickRage
refs/heads/master
sickbeard/failedProcessor.py
3
# Author: Tyler Fenby <tylerfenby@gmail.com> # URL: https://sickrage.tv # Git: https://github.com/SiCKRAGETV/SickRage.git # # This file is part of SickRage. # # SickRage 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 Fou...
chdecultot/frappe
refs/heads/develop
frappe/patches/v8_0/update_global_search_table.py
16
import frappe def execute(): if not 'published' in frappe.db.get_db_table_columns('__global_search'): frappe.db.sql('''alter table __global_search add column `title` varchar(140)''') frappe.db.sql('''alter table __global_search add column `route` varchar(140)''') frappe.db.sql('''alter table __global_se...
ice9js/servo
refs/heads/master
tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py
154
def main(request, response): headers = [("Content-Type", "text/javascript")] body = "test1_token = \"script executed\";" return 404, headers, body
aakashrana1995/svnit-tnp
refs/heads/master
tnp/company/migrations/0003_auto_20170204_1135.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-04 06:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('company', '0002_auto_20170204_0017'), ] operations = [ migrations.RemoveFie...
TieWei/nova
refs/heads/enhanced/havana
tools/xenserver/stress_test.py
149
""" This script concurrently builds and migrates instances. This can be useful when troubleshooting race-conditions in virt-layer code. Expects: novarc to be sourced in the environment Helper Script for Xen Dom0: # cat /tmp/destroy_cache_vdis #!/bin/bash xe vdi-list | grep "Glance Image" -C1 | grep ...
rtindru/django
refs/heads/master
tests/migrations/test_autodetector.py
33
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import AbstractBaseUser from django.db import connection, models from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.graph import MigrationGraph from django.db.migrations.loader import Migr...
tongxindao/shiyanlou
refs/heads/master
shiyanlou_cs214-ca51b72ef6/mysite/west/migrations/0002_contact_tag.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-07 09:39 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('west', '0001_initial'), ] operations = [ m...
wenn/python_koans
refs/heads/master
python2/koans/jims.py
127
#!/usr/bin/env python # -*- coding: utf-8 -*- class Dog(object): def identify(self): return "jims dog"
weidnem/IntroPython2016
refs/heads/master
Solutions/Session03/slicing_lab.py
3
#!/usr/bin/env python3 """ The version done in class """ def swap(seq): return seq[-1:]+seq[1:-1]+seq[:1] assert swap('something') == 'gomethins' assert swap(tuple(range(10))) == (9, 1, 2, 3, 4, 5, 6, 7, 8, 0) def rem(seq): return seq[::2] assert rem('a word') == 'awr' def rem4(seq): return seq[4:...
dchad/malware-detection
refs/heads/master
vs/generate_pe_header_tokens.py
1
# generate-pe-header-tokens.py # # Parse a bunch of PE Header dump files generated by objdump and # extract keywords such section names, import DLLs and functions. # These tokens will be used for feature extraction from the # PE/COFF headers. # # Inputs : list of PE Header files. # Temp file name for token cou...
hurricup/intellij-community
refs/heads/master
python/testData/inspections/AugmentAssignmentWithContext_after.py
83
class A: x = 3 a = A() a.x += 1
agry/NGECore2
refs/heads/master
scripts/object/tangible/wearables/armor/bone/armor_bone_s01_bracer_r.py
85615
import sys def setup(core, object): return
zachf714/android_kernel_asus_tf101-3.x
refs/heads/tegra-tf101-3.1.x
tools/perf/util/setup.py
560
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
TabindaAshraf/google-diff-match-patch
refs/heads/master
python2/__init__.py
636
from .diff_match_patch import diff_match_patch, patch_obj
52ai/django-ccsds
refs/heads/master
django/contrib/gis/db/backends/oracle/operations.py
307
""" This module contains the spatial lookup types, and the `get_geo_where_clause` routine for Oracle Spatial. Please note that WKT support is broken on the XE version, and thus this backend will not work on such platforms. Specifically, XE lacks support for an internal JVM, and Java libraries are required to use...
RL-LDV-TUM/RobotAPI
refs/heads/master
vrep/vrep.py
1
# This file is part of the REMOTE API # # Copyright 2006-2014 Coppelia Robotics GmbH. All rights reserved. # marc@coppeliarobotics.com # www.coppeliarobotics.com # # The REMOTE API is licensed under the terms of GNU GPL: # # ------------------------------------------------------------------- # The REMOTE API is free so...
ChanderG/scikit-learn
refs/heads/master
examples/cluster/plot_mean_shift.py
351
""" ============================================= A demo of the mean-shift clustering algorithm ============================================= Reference: Dorin Comaniciu and Peter Meer, "Mean Shift: A robust approach toward feature space analysis". IEEE Transactions on Pattern Analysis and Machine Intelligence. 2002. ...
Nesiehr/osf.io
refs/heads/develop
scripts/migration/migrate_dashboard_collection_to_bookmarks.py
28
import logging import sys from framework.mongo import database from framework.transactions.context import TokuTransaction from website.app import init_app from scripts import utils as script_utils logger = logging.getLogger(__name__) def migrate(): logger.info('migrating folders to collections and dashboards to...
Nic30/hwtLib
refs/heads/master
hwtLib/amba/axi_comp/cache/addrTypeConfig.py
1
from typing import Tuple from hwt.code import Concat from hwt.hdl.types.bits import Bits from hwt.math import log2ceil from hwt.synthesizer.param import Param from hwt.synthesizer.rtlLevel.rtlSignal import RtlSignal from hwt.synthesizer.unit import Unit from pyMathBitPrecise.bit_utils import mask class CacheAddrType...
dataxu/ansible
refs/heads/dx-stable-2.5
lib/ansible/utils/unsafe_proxy.py
72
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 # -------------------------------------------- # # 1. This LICENSE AGREEMENT is between the Python Software Foundation # ("PSF"), and the Individual or Organization ("Licensee") accessing and # otherwise using this software ("Python") in source or binary form and # its ass...
tianx/mysql-5.6
refs/heads/webscalesql-5.6.27.75
xtrabackup/test/python/testtools/compat.py
42
# Copyright (c) 2008-2011 testtools developers. See LICENSE for details. """Compatibility support for python 2 and 3.""" __metaclass__ = type __all__ = [ '_b', '_u', 'advance_iterator', 'str_is_unicode', 'StringIO', 'BytesIO', 'unicode_output_stream', ] import codecs import linecache ...
jpshort/odoo
refs/heads/8.0
comunity_modules/project_gtd/__openerp__.py
8
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
masterofnix/securealumnicoin3
refs/heads/master
contrib/testgen/gen_base58_test_vectors.py
1064
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
pbraunstein/trackercise
refs/heads/master
app/brain/user_management/change_password_result.py
1
class ChangePasswordResult(object): PASSWORD_CHANGE_SUCCESSFUL = 0 NEW_PASSWORDS_DO_NOT_MATCH = 1 CURRENT_PASSWORD_INCORRECT = 2
MounirMesselmeni/django
refs/heads/master
tests/gis_tests/gdal_tests/test_raster.py
11
""" gdalinfo tests/gis_tests/data/rasters/raster.tif: Driver: GTiff/GeoTIFF Files: tests/gis_tests/data/rasters/raster.tif Size is 163, 174 Coordinate System is: PROJCS["NAD83 / Florida GDL Albers", GEOGCS["NAD83", DATUM["North_American_Datum_1983", SPHEROID["GRS 1980",6378137,298.2572221010002...
AustereCuriosity/astropy
refs/heads/master
astropy/coordinates/tests/test_atc_replacements.py
4
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # TEST_UNICODE_LITERALS from __future__ import (absolute_import, division, print_function, unicode_literals) """Test replacements for ERFA functions atciqz and aticq.""" from itertools import product from...
Samsung/TizenRT
refs/heads/master
external/protobuf/python/google/protobuf/internal/api_implementation.py
19
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
aabadie/scikit-learn
refs/heads/master
sklearn/gaussian_process/__init__.py
93
# -*- coding: utf-8 -*- # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # License: BSD 3 clause """ The :mod:`sklearn.gaussian_process` module implements Gaussian Process based regression and c...
mationic/pyload
refs/heads/stable
module/plugins/hoster/SpeedyshareCom.py
9
# -*- coding: utf-8 -*- # # Test links: # http://speedy.sh/ep2qY/Zapp-Brannigan.jpg import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SpeedyshareCom(SimpleHoster): __name__ = "SpeedyshareCom" __type__ = "hoster" __version__ = "0.06" __status__ = "te...
adityabyreddy/opensas
refs/heads/master
assessment/models.py
792
from __future__ import unicode_literals from django.db import models # Create your models here.
hfp/tensorflow-xsmm
refs/heads/master
tensorflow/contrib/cudnn_rnn/python/kernel_tests/cudnn_rnn_ops_benchmark.py
43
# 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...
w495/python-video-shot-detector
refs/heads/master
shot_detector/filters/sliding_window/min_std_mean_swfilter.py
1
# -*- coding: utf8 -*- """ This is part of shot detector. Produced by w495 at 2017.05.04 04:18:27 """ from __future__ import absolute_import, division, print_function import logging from .base_stat_swfilter import BaseStatSWFilter class MinStdMeanSWFilter(BaseStatSWFilter): """ TODO: not implem...
xbianonpi/Sick-Beard-TPB
refs/heads/ThePirateBay
lib/hachoir_parser/video/flv.py
90
""" FLV video parser. Documentation: - FLV File format: http://osflash.org/flv - libavformat from ffmpeg project - flashticle: Python project to read Flash (SWF and FLV with AMF metadata) http://undefined.org/python/#flashticle Author: Victor Stinner Creation date: 4 november 2006 """ from lib.hachoir_parser ...
Orav/kbengine
refs/heads/master
kbe/tools/server/pycommon/Watcher.py
1
# -*- coding: utf-8 -*- import traceback from . import Define, ServerApp, MessageStream CONSOLE_COMMANDCB_MSGID = 65500 CONSOLE_LOG_MSGID = 65501 CONSOLE_WATCHERCB_MSGID = 65502 CONSOLE_PROFILECB_MSGID = 65503 # watcher数据类型定义 WATCHER_VALUE_TYPE_UNKNOWN = 0 WATCHER_VALUE_TYPE_UINT8 ...
esse-io/zen-common
refs/heads/master
oslo-modules/oslo_service/periodic_task.py
3
# # 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 # ...
AnhellO/DAS_Sistemas
refs/heads/development
Ago-Dic-2017/Enrique Castillo/Ordinario/test/Lib/site-packages/setuptools/archive_util.py
320
"""Utilities for extracting common archive formats""" import zipfile import tarfile import os import shutil import posixpath import contextlib from distutils.errors import DistutilsError from pkg_resources import ensure_directory, ContextualZipFile __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile"...
SravanthiSinha/edx-platform
refs/heads/master
common/djangoapps/third_party_auth/tasks.py
81
# -*- coding: utf-8 -*- """ Code to manage fetching and storing the metadata of IdPs. """ #pylint: disable=no-member from celery.task import task # pylint: disable=import-error,no-name-in-module import datetime import dateutil.parser import logging from lxml import etree import requests from onelogin.saml2.utils impor...
brijeshkesariya/odoo
refs/heads/8.0
openerp/addons/test_workflow/models.py
337
# -*- coding: utf-8 -*- import openerp.osv.orm class m(openerp.osv.orm.Model): """ A model for which we will define a workflow (see data.xml). """ _name = 'test.workflow.model' def print_(self, cr, uid, ids, s, context=None): print ' Running activity `%s` for record %s' % (s, ids) return ...
flip111/portia
refs/heads/master
slyd/slyd/bot.py
1
""" Bot resource Defines bot/fetch endpoint, e.g.: curl -d '{"request": {"url": "http://scrapinghub.com/"}}' http://localhost:9001/bot/fetch The "request" is an object whose fields match the parameters of a Scrapy request: http://doc.scrapy.org/en/latest/topics/request-response.html#scrapy.http.Request Retur...
JimCircadian/ansible
refs/heads/devel
test/units/modules/network/netscaler/test_netscaler_nitro_request.py
57
# Copyright (c) 2017 Citrix Systems # # 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. # # ...
kiwicopple/MyMDb
refs/heads/master
venv/Lib/site-packages/docutils/languages/gl.py
149
# -*- coding: utf-8 -*- # Author: David Goodger # Contact: goodger@users.sourceforge.net # Revision: $Revision: 2224 $ # Date: $Date: 2004-06-05 21:40:46 +0200 (Sat, 05 Jun 2004) $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, pleas...
anarcoder/google_explorer
refs/heads/beta_version
plugins/pl_filter.py
1
""" Class used to run the exploit filters in the result file """ import os import sys PATH = os.path.join(os.sep, os.getcwd() + '/' + 'plugins') class Plugins(): def __init__(self, filters): self.filters = filters self.exploits = self.validate_plugins() self.run_filter() def validat...
cigroup-ol/metaopt
refs/heads/develop
examples/showcase/svm_gridsearch_global_timeout.py
1
# -*- coding: utf-8 -*- """ Optimizing the parameters of a SVM applied to the Iris data set =============================================================== The parameters are optimized with grid search. Optimization stops after a global timeout of 10 seconds. """ # Future from __future__ import absolute_import, divis...
melissaihrig/namebench
refs/heads/master
libnamebench/nameserver.py
173
#!/usr/bin/env python # Copyright 2009 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...
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
refs/heads/master
orcid_api/apis/member_apiv20_api.py
1
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import sys import os ...
gwtw/py-data-structures
refs/heads/master
test/binary_heap_size_test.py
1
import unittest import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'datastructure')) import binary_heap class BinaryHeapSizeTest(unittest.TestCase): def test_return_size_of_heap(self): heap = binary_heap.BinaryHeap() self.assertEqual(heap.size(), 0) heap.insert(1) ...
Andrey-Pavlov/phantomjs
refs/heads/master
src/breakpad/src/tools/gyp/test/hello/gyptest-default.py
150
#!/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 the default build target. """ import TestGyp test = TestGyp.TestGy...
xkcd1253/SocialNetworkforTwo
refs/heads/master
flask/lib/python2.7/site-packages/migrate/changeset/schema.py
60
""" Schema module providing common schema operations. """ import warnings from UserDict import DictMixin import sqlalchemy from sqlalchemy.schema import ForeignKeyConstraint from sqlalchemy.schema import UniqueConstraint from migrate.exceptions import * from migrate.changeset import SQLA_07 from migrate.changese...
denverfoundation/storybase
refs/heads/develop
apps/storybase/search/signals.py
1
from django.db.models import signals from django.db.models.loading import get_model from haystack.exceptions import NotHandled from haystack.signals import RealtimeSignalProcessor as HaystackRealtimeSignalProcessor class RealtimeSignalProcessor(HaystackRealtimeSignalProcessor): """ Custom Haystack signal pro...
aESeguridad/GERE
refs/heads/master
venv/local/lib/python2.7/encodings/koi8_u.py
593
""" Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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_table) def decode(self,input,errors='stri...
rg3915/django-experience
refs/heads/master
djexperience/company/apps.py
6
from django.apps import AppConfig class CompanyConfig(AppConfig): name = 'company'
keithroe/vtkoptix
refs/heads/master
ThirdParty/Twisted/twisted/internet/fdesc.py
62
# -*- test-case-name: twisted.test.test_fdesc -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Utility functions for dealing with POSIX file descriptors. """ import os import errno try: import fcntl except ImportError: fcntl = None # twisted imports from twisted.internet.main ...
louisdcoulombe/ssh-monitor
refs/heads/master
task_parser.py
1
import unittest import logging import yaml from os import listdir, path from os.path import join, basename logging.basicConfig(level=logging.INFO) logger = logging.getLogger('ssh-monitor') class Task: def __init__(self, key): self.id = key self.host = '' self.user = '' self.task...
dennisobrien/bokeh
refs/heads/master
bokeh/sampledata/__init__.py
5
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
hmoco/osf.io
refs/heads/develop
scripts/consistency/fix_is_claimed.py
55
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to migrate nodes with invalid categories.""" import sys import logging from modularodm import Q from website.app import init_app from website.models import User from scripts import utils as script_utils logger = logging.getLogger('fix_is_claimed') def main(d...
nikron/bridge
refs/heads/master
upb/registers.py
1
from upb import UPBSetRegisters, UPBGetRegisters, mdid NID = (0x00, 1) UID = (0x01, 1) NPW = (0x02, 2) UPBOP = (0x03, 1) UPBVER = (0x05, 1) MID = (0x06, 2) PID = (0x07, 2) FWVER = (0x08, 2) SERNUM = (0x0C, 4) SETUP = (0x00, 16) NNAME = (0x10, 16) RNAME = (0x20, 16) DNAME = (0x30, 16) class RegisterDescription(): ...
Edraak/edraak-platform
refs/heads/master
openedx/core/djangoapps/credit/views.py
12
""" Views for the credit Django app. """ from __future__ import unicode_literals import datetime import logging import pytz from django.conf import settings from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from edx_rest_framework_extensions.authentication impor...
germasch/libmrc
refs/heads/master
mhd/tests/t009_ot_mhdcc/plot.py
1
#!/usr/bin/env python import matplotlib matplotlib.use("Agg") import viscid from viscid.plot import mpl steps = range(0, 101, 10) flds = ['divB', 'rr', 'bx', 'by', 'bz', 'vx', 'vy', 'vz', 'pp', 'jz'] flds = ['rr'] plot_kwargs = dict(cmap='hot') f = viscid.load_file("run.3d.xdmf") for step in steps: print("Plo...
edx/django-rest-framework
refs/heads/master
rest_framework/utils/humanize_datetime.py
144
""" Helper functions that convert strftime formats into more readable representations. """ from rest_framework import ISO_8601 def datetime_formats(formats): format = ', '.join(formats).replace( ISO_8601, 'YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]' ) return humanize_strptime(format) ...
jadami10/crossbarexamples
refs/heads/master
containers/failures/router/failure5/myapp.py
20
from twisted.logger import Logger from autobahn.twisted.wamp import ApplicationSession class MySession(ApplicationSession): log = Logger() def __init__(self, config): self.log.info("MySession.__init__()") ApplicationSession.__init__(self, config) def onJoin(self, details): self.l...
GordonGaoNY/py_rrfm_re
refs/heads/master
server/api/dashboard_api.py
2
from flask_restful import Api, Resource, reqparse from flask import Blueprint, json, jsonify from services.dashboard_service import * from configurations.env_configs import * from api import check_token dashboard_api = Api(Blueprint('dashboard_api', __name__)) @dashboard_api.resource("/month-count") class MonthCount...