repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
cryspy-team/cryspy | refs/heads/master | cryspy/hash.py | 2 | import numpy as np
floatlist = []
hashlist = []
ufloatlist = []
ufloathashlist = []
delta = 1e-5
def floathash(number):
global floatlist
global hashlist
for i in range(len(floatlist)):
if np.abs(number - floatlist[i]) < delta:
return hashlist[i]
h = hash(number)
if len(float... |
Dicatoro/YACLWiN | refs/heads/master | modules/left.py | 2 | def resolve(args, frame):
if not args:
duration = 1
elif len(args) == 1:
duration = args[0]
if type(duration) != int:
raise TypeError("Wrong type argument")
else:
raise Exception("Wrong number of arguments")
result = '_y_spt_afterframes {} "+moveleft"\n'.format(frame)
result += '_y_spt_afterframes {}... |
ibinti/intellij-community | refs/heads/master | python/helpers/pydev/stubs/_django_manager_body.py | 102 | # This is a dummy for code-completion purposes.
def __unicode__(self):
"""
Return "app_label.model_label.manager_name".
"""
def _copy_to_model(self, model):
"""
Makes a copy of the manager and assigns it to 'model', which should be
a child of the existing model (used when inheriting a manager... |
Friday21/python_show_me_the_code | refs/heads/master | partrita/0001/make_code.py | 38 | # -*- coding: utf-8 -*-
"""
Created on Mon May 11 16:04:59 2015
@author: partrita
"""
from random import Random
def codeGenerator(number, codeLength = 15):
print '**** Code Generator ****'
codeFile = open('codes.txt', 'w')
if number <= 0:
return 'invalid number of codes'
else:
chars =... |
mit-ll/python-keylime | refs/heads/master | keylime/crypto.py | 1 | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import base64
import hmac
import hashlib
import os
import secrets
# Crypto implementation using python cryptography package
from cryptography import exceptions
from cryptography import x509
import cryptography.hazmat.pri... |
kalxas/pycsw | refs/heads/master | pycsw/plugins/repository/odc/__init__.py | 72 | # -*- coding: utf-8 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the ... |
shaistaansari/django | refs/heads/master | django/contrib/gis/db/backends/utils.py | 612 | """
A collection of utility routines and classes used by the spatial
backends.
"""
class SpatialOperator(object):
"""
Class encapsulating the behavior specific to a GIS operation (used by lookups).
"""
sql_template = None
def __init__(self, op=None, func=None):
self.op = op
self.f... |
sudheesh001/mediadrop | refs/heads/master | mediacore/forms/admin/categories.py | 14 | from mediadrop.forms.admin.categories import *
|
SiLab-Bonn/fe65_p2 | refs/heads/master | tests/test_sr.py | 1 | #
# ------------------------------------------------------------
# Copyright (c) All rights reserved
# SiLab, Institute of Physics, University of Bonn
# ------------------------------------------------------------
#
import unittest
import os
from basil.utils.sim.utils import cocotb_compile_and_run, cocotb_compile_clea... |
PKRoma/poedit | refs/heads/master | deps/boost/tools/build/src/util/__init__.py | 26 |
import bjam
import re
import types
from itertools import groupby
def safe_isinstance(value, types=None, class_names=None):
"""To prevent circular imports, this extends isinstance()
by checking also if `value` has a particular class name (or inherits from a
particular class name). This check is safe in t... |
eResearchSA/dcaas | refs/heads/master | all-in-one/srv/salt/_modules/collector.py | 2 | # -*- coding: utf-8 -*-
import time
import re
def _readfile(filename):
with open(filename) as f:
content = f.readlines()
return content
def collect_load_avg():
lines=_readfile("/proc/loadavg")
variables=lines[0].split(" ")
return {"tag": "load", "timestamp": int(time.time()), "1m": variab... |
kingland/go-v8 | refs/heads/master | v8-3.28/test/mjsunit/testcfg.py | 58 | # Copyright 2008 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
# notice, this list of conditi... |
ChanChiChoi/scikit-learn | refs/heads/master | sklearn/metrics/tests/test_pairwise.py | 105 | import numpy as np
from numpy import linalg
from scipy.sparse import dok_matrix, csr_matrix, issparse
from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing impo... |
susansls/zulip | refs/heads/master | zerver/migrations/0004_userprofile_left_side_userlist.py | 167 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('zerver', '0003_custom_indexes'),
]
operations = [
migrations.AddField(
model_name='userprofile',
nam... |
Electroscholars/P.E.E.R.S | refs/heads/master | MainWindowArrowTest/youtube_dl/extractor/flickr.py | 31 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unescapeHTML,
)
class FlickrIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.|secure\.)?flickr\.com/photos/(?P<uploader_id>[\w\-_@]+)/(?P<id>\d+).*'
_TEST = {
'url': 'h... |
openstack/magnum | refs/heads/master | magnum/db/sqlalchemy/alembic/versions/049f81f6f584_remove_ssh_authorized_key_from_baymodel.py | 2 | # Copyright 2016 Huawei Technologies Co.,LTD.
#
# 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... |
biddyweb/websockets | refs/heads/master | websockets/test_uri.py | 20 | import unittest
from .exceptions import InvalidURI
from .uri import *
VALID_URIS = [
('ws://localhost/', (False, 'localhost', 80, '/')),
('wss://localhost/', (True, 'localhost', 443, '/')),
('ws://localhost/path?query', (False, 'localhost', 80, '/path?query')),
('WS://LOCALHOST/PATH?QUERY', (False, '... |
urda/mrbutler-web | refs/heads/master | web/core/settings/base.py | 2 | """
Copyright 2017 Peter Urda
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
dis... |
tensorflow/tensorflow | refs/heads/master | tensorflow/python/tpu/feature_column_v2_test.py | 13 | # 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... |
jamesblunt/edx-platform | refs/heads/master | lms/djangoapps/commerce/api/v1/tests/test_serializers.py | 109 | """ Commerce API v1 serializer tests. """
from django.test import TestCase
from commerce.api.v1.serializers import serializers, validate_course_id
class CourseValidatorTests(TestCase):
""" Tests for Course Validator method. """
def test_validate_course_id_with_non_existent_course(self):
""" Verify a... |
wkrzemien/DIRAC | refs/heads/integration | Core/Workflow/test/ModulesSamples.py | 4 | from __future__ import print_function
from DIRAC.Core.Workflow.Parameter import *
from DIRAC.Core.Workflow.Module import *
from DIRAC.Core.Workflow.Step import *
from DIRAC.Core.Workflow.Workflow import *
bodyTestApp = """class TestAppModule:
def __init__(self):
pass
def initialize(self,name,version,... |
DomenicPuzio/incubator-metron | refs/heads/master | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/0.3.0/package/scripts/indexing_master.py | 1 | """
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 this ... |
dragonfi/snowfall | refs/heads/master | pyglet-1.1.4/doc/html/programming_guide/hello_world.py | 7 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... |
rickerc/neutron_audit | refs/heads/cis-havana-staging | neutron/db/migration/alembic_migrations/versions/32b517556ec9_remove_tunnelip_mode.py | 20 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# 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... |
gangadhar-kadam/hrerp | refs/heads/develop | erpnext/contacts/doctype/__init__.py | 12133432 | |
voxmedia/thumbor | refs/heads/master | tests/engines/__init__.py | 12133432 | |
soldag/home-assistant | refs/heads/dev | homeassistant/components/rfxtrx/__init__.py | 2 | """Support for RFXtrx devices."""
import asyncio
import binascii
from collections import OrderedDict
import copy
import logging
import RFXtrx as rfxtrxmod
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
fro... |
raffaele-forte/climber | refs/heads/master | Exscript/util/__init__.py | 7 | # Copyright (C) 2007-2010 Samuel Abels.
#
# 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,
# but WITHOUT ANY WARRANT... |
tectronics/pychess | refs/heads/master | lib/pychess/System/WinRsvg.py | 23 | from ctypes import *
l=CDLL('librsvg-2-2.dll')
g=CDLL('libgobject-2.0-0.dll')
g.g_type_init()
class Props():
def __init__(self, dimension):
self.width, self.height = dimension
class rsvgHandle():
class RsvgDimensionData(Structure):
_fields_ = [("width", c_int),
("heig... |
stonegithubs/odoo | refs/heads/8.0 | addons/board/__openerp__.py | 261 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
alphafoobar/intellij-community | refs/heads/master | python/testData/completion/oldStyleClassAttributes.after.py | 83 | class C:
pass
c = C()
c.__class__
|
jiangzhuo/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_codecencodings_jp.py | 88 | #
# test_codecencodings_jp.py
# Codec encoding tests for Japanese encodings.
#
from test import support
from test import multibytecodec_support
import unittest
class Test_CP932(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'cp932'
tstring = multibytecodec_support.load_teststring('shift_jis... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.4/tests/modeltests/custom_columns/models.py | 34 | """
17. Custom column/table names
If your database column name is different than your model attribute, use the
``db_column`` parameter. Note that you'll use the field's name, not its column
name, in API usage.
If your database table name is different than your model name, use the
``db_table`` Meta attribute. This has... |
davidharrigan/django | refs/heads/master | django/contrib/postgres/validators.py | 458 | import copy
from django.core.exceptions import ValidationError
from django.core.validators import (
MaxLengthValidator, MaxValueValidator, MinLengthValidator,
MinValueValidator,
)
from django.utils.deconstruct import deconstructible
from django.utils.translation import ugettext_lazy as _, ungettext_lazy
clas... |
pigeonflight/strider-plone | refs/heads/master | docker/appengine/lib/django-1.3/tests/regressiontests/views/tests/generic/simple.py | 51 | # coding: utf-8
from django.test import TestCase
class RedirectToTest(TestCase):
def test_redirect_to_returns_permanent_redirect(self):
"simple.redirect_to returns a permanent redirect (301) by default"
response = self.client.get('/views/simple/redirect_to/')
self.assertEqual(response.stat... |
lancezlin/ml_template_py | refs/heads/master | lib/python2.7/site-packages/pandas/tests/__init__.py | 12133432 | |
wildlifecoin/wild | refs/heads/master | contrib/wallettools/walletunlock.py | 40 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:5888")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
|
dersphere/script.demo | refs/heads/master | resources/lib/demo.py | 1 | import sys
import xbmcgui
getLocalizedString = sys.modules['__main__'].getLocalizedString
class GUI(xbmcgui.WindowXMLDialog):
def __init__(self, *args, **kwargs):
xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
def onInit(self):
self.action_exitkeys_id = [10, 13]
... |
rayNymous/nupic | refs/heads/master | examples/opf/experiments/multistep/base/description.py | 31 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
huang4fstudio/django | refs/heads/master | tests/admin_registration/models.py | 584 | """
Tests for various ways of registering models with the admin site.
"""
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
class Traveler(Person):
pass
class Location(models.Model):
class Meta:
abstract = True
class Place(Location):
name =... |
krishnazure/Flask | refs/heads/master | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py | 2993 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
yohanko88/gem5-DC | refs/heads/master | tests/long/se/20.parser/test.py | 56 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... |
xiaoxiamii/scikit-learn | refs/heads/master | doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py | 254 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... |
mtougeron/python-openstacksdk | refs/heads/master | openstack/block_store/v2/_proxy.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
# distributed under t... |
OpenTreeOfLife/phylesystem-api | refs/heads/master | ws-tests/get_study.py | 1 | #!/usr/bin/env python
import sys, os, json
from opentreetesting import config, get_obj_from_http
DOMAIN = config('host', 'apihost')
for study_id in sys.argv[1:]:
SUBMIT_URI = DOMAIN + '/phylesystem/v1/study/' + study_id
data = {'output_nexml2json':'1.2'}
x = get_obj_from_http(SUBMIT_URI,
... |
askeing/servo | refs/heads/master | tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-request-no-freshness-headers-script.py | 38 | def main(request, response):
headers = []
# Sets an ETag header to check the cache revalidation behavior.
headers.append(("ETag", "abc123"))
headers.append(("Content-Type", "text/javascript"))
return headers, "/* empty script */"
|
ksrajkumar/openerp-6.1 | refs/heads/master | openerp/addons/product_margin/__openerp__.py | 9 | # -*- 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... |
Ziqi-Li/bknqgis | refs/heads/master | bokeh/bokeh/models/filters.py | 1 | from __future__ import absolute_import
import inspect
from textwrap import dedent
from types import FunctionType
from ..core.properties import Bool, Dict, Either, Instance, Int, Seq, String
from ..model import Model
from ..util.dependencies import import_required
from ..util.compiler import nodejs_compile, Compilatio... |
openhatch/new-mini-tasks | refs/heads/master | vendor/packages/Django/tests/regressiontests/localflavor/generic/__init__.py | 12133432 | |
mykonosbiennale/mykonosbiennale.github.io | refs/heads/master | mykonosbiennale/__init__.py | 12133432 | |
EricCline/CEM_inc | refs/heads/master | env/lib/python2.7/site-packages/IPython/config/profile/__init__.py | 12133432 | |
chrisfranzen/django | refs/heads/master | tests/regressiontests/utils/os_utils.py | 108 | import os
from django.utils import unittest
from django.utils._os import safe_join
class SafeJoinTests(unittest.TestCase):
def test_base_path_ends_with_sep(self):
drive, path = os.path.splitdrive(safe_join("/abc/", "abc"))
self.assertEqual(
path,
"{0}abc{0}abc".format(os.p... |
ActionAdam/osmc | refs/heads/master | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.skinshortcuts/default.py | 6 | # coding=utf-8
import os, sys
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, urllib, xbmcvfs
import xml.etree.ElementTree as xmltree
import cPickle as pickle
import cProfile
import pstats
import random
import time
from time import gmtime, strftime
from datetime import datetime
from traceback import print_exc
if sys.vers... |
raphaelrpl/portal | refs/heads/master | backend/appengine/routes/signup.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from config.template_middleware import TemplateResponse
from gaecookie.decorator import no_csrf
from gaepermission.decorator import login_not_required
from routes.login.home import prepare_login_services
from tekton import router
from tekt... |
shortdudey123/gbot | refs/heads/master | src/bot.py | 1 | #!/usr/bin/env python
# =============================================================================
# file = bot.py
# description = IRC bot
# author = GR <https://github.com/shortdudey123>
# create_date = 2014-07-09
# mod_date = 2014-07-13
# version = 0.1
# usage = called as a class
# notes =
# python_ver = 2.7.6
# =... |
jason406/MissionPlanner | refs/heads/master | ExtLibs/Mavlink/pymavlink/generator/lib/genxmlif/xmliftest.py | 79 | from .. import genxmlif
from ..genxmlif.xmlifODict import odict
xmlIf = genxmlif.chooseXmlIf(genxmlif.XMLIF_ELEMENTTREE)
xmlTree = xmlIf.createXmlTree(None, "testTree", {"rootAttr1":"RootAttr1"})
xmlRootNode = xmlTree.getRootNode()
myDict = odict( (("childTag1","123"), ("childTag2","123")) )
xmlRootNode.appendC... |
yland/mailman3 | refs/heads/develop | src/mailman/rules/approved.py | 7 | # Copyright (C) 2007-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... |
ProvidencePlan/Profiles | refs/heads/dev | communityprofiles/profiles/oldmigrations/0055_auto__add_flatvalue.py | 2 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'FlatValue'
db.create_table(u'profiles_flatvalue', (
(u'id', self.gf('django.db... |
goerz/tmuxpair | refs/heads/develop | tmuxpair.py | 1 | #!/usr/bin/env python
"""Command line script for setting up a temporary tmux session for pair
programming"""
# Copyright (C) 2016 Michael Goerz. See LICENSE for terms of use.
import logging
import sys
import os
import shutil
import contextlib
import signal
import subprocess as sp
from collections import OrderedDict
fr... |
suhe/odoo | refs/heads/master | addons/l10n_multilang/__openerp__.py | 18 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Multi Language Chart of Accounts',
'version': '1.1',
'category': 'Localization',
'description': """
* Multi language support for Chart of Accounts, Taxes, Tax Codes, Journals,
Account... |
npiganeau/odoo | refs/heads/master | addons/account/wizard/account_report_common_journal.py | 385 | # -*- 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... |
AndreasAntener/mavlink | refs/heads/master | pymavlink/generator/mavgen_java.py | 1 | #!/usr/bin/env python
'''
parse a MAVLink protocol XML file and generate a Java implementation
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
import sys, textwrap, os, time
import mavparse, mavtemplate
t = mavtemplate.MAVTemplate()
def generate_version_h(directory, ... |
BiryukovVA/ignite | refs/heads/master | modules/platforms/python/pyignite/datatypes/__init__.py | 11 | # 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 ... |
bratsche/Neutron-Drive | refs/heads/master | neutron-drive/django/conf/locale/zh_TW/formats.py | 1293 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
# DATE_FORMAT =
# TIME_FORMAT =
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
# MONTH_DA... |
viaembedded/vab1000-kernel-bsp | refs/heads/master | scripts/rt-tester/rt-tester.py | 11005 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# 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.
#
import os
import sys
import getopt
import sh... |
AmrThabet/CouchPotatoServer | refs/heads/master | couchpotato/core/media/movie/providers/userscript/filmstarts.py | 15 | from bs4 import BeautifulSoup
from couchpotato.core.media._base.providers.userscript.base import UserscriptBase
autoload = 'Filmstarts'
class Filmstarts(UserscriptBase):
includes = ['*://www.filmstarts.de/kritiken/*']
def getMovie(self, url):
try:
data = self.getUrl(url)
except:
return
html = Be... |
sneh1234/musicblocks | refs/heads/master | plugins/update_all_rtp.py | 36 | # -*- coding: utf-8 -*-
import sys
sys.path.insert(1, '..')
from pluginify import pluginify
import os
files = os.listdir('.')
for f in files:
if not os.path.exists(f) or not f.endswith('.rtp'):
continue
with open(f) as fr:
data = fr.read()
fr.close()
del fr
fr = open(f[:-... |
faarwa/EngSocP5 | refs/heads/master | zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Conftest.py | 118 | """SCons.Conftest
Autoconf-like configuration support; low level implementation of tests.
"""
#
# Copyright (c) 2003 Stichting NLnet Labs
# Copyright (c) 2001, 2002, 2003 Steven Knight
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation file... |
mshafiq9/django | refs/heads/master | tests/middleware/extra_urls.py | 487 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^customurlconf/noslash$', views.empty_view),
url(r'^customurlconf/slash/$', views.empty_view),
url(r'^customurlconf/needsquoting#/$', views.empty_view),
]
|
cidles/wordbyword | refs/heads/master | src/yaml/scanner.py | 2 |
# Scanner produces tokens of the following types:
# STREAM-START
# STREAM-END
# DIRECTIVE(name, value)
# DOCUMENT-START
# DOCUMENT-END
# BLOCK-SEQUENCE-START
# BLOCK-MAPPING-START
# BLOCK-END
# FLOW-SEQUENCE-START
# FLOW-MAPPING-START
# FLOW-SEQUENCE-END
# FLOW-MAPPING-END
# BLOCK-ENTRY
# FLOW-ENTRY
# KEY
# VALUE
# AL... |
notriddle/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/tests/browsers/__init__.py | 12133432 | |
petecummings/django | refs/heads/master | tests/migrations/test_migrations_unmigdep/__init__.py | 12133432 | |
jaijuneja/PyTLDR | refs/heads/master | pytldr/__init__.py | 12133432 | |
clumsy/intellij-community | refs/heads/master | python/testData/refactoring/move/oldStyleRelativeImport/after/src/pkg/__init__.py | 12133432 | |
aleaxit/pysolper | refs/heads/master | permit/lib/dist/werkzeug/debug/repr.py | 24 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... |
OpenMOOC/moocng | refs/heads/master | moocng/courses/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2013 UNED
#
# 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... |
cloudfoundry/php-buildpack-legacy | refs/heads/master | builds/runtimes/python-2.7.6/lib/python2.7/test/test_codecmaps_hk.py | 150 | #!/usr/bin/env python
#
# test_codecmaps_hk.py
# Codec mapping tests for HongKong encodings
#
from test import test_support
from test import test_multibytecodec_support
import unittest
class TestBig5HKSCSMap(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'big... |
jasondunsmore/heat | refs/heads/master | heat/tests/openstack/barbican/test_order.py | 2 | #
# 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
# ... |
MonicaHsu/truvaluation | refs/heads/master | venv/lib/python2.7/types.py | 304 | """Define names for all type symbols known in the standard interpreter.
Types that are part of optional modules (e.g. array) are not listed.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check... |
volk3/CS736 | refs/heads/master | tools/perf/python/twatch.py | 1565 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
iConsole/Console-OS_kernel_common | refs/heads/kernel-4.0 | tools/perf/python/twatch.py | 1565 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
ChawalitK/odoo | refs/heads/master | openerp/cli/__init__.py | 58 | import logging
import sys
import os
import openerp
from command import Command, main
import deploy
import scaffold
import server
import shell
import start
|
jonashaag/django-nonrel-nohistory | refs/heads/master | django/core/serializers/pyyaml.py | 204 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
from StringIO import StringIO
import decimal
import yaml
from django.db import models
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as... |
nijel/weblate | refs/heads/main | weblate/screenshots/migrations/0001_squashed_0006_remove_screenshot_sources.py | 2 | # Generated by Django 3.0.5 on 2020-04-16 11:26
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
import weblate.screenshots.fields
class Migration(migrations.Migration):
replaces = [
("screenshots", "0001_squashed_00... |
dd00/commandergenius | refs/heads/dd00 | project/jni/python/src/Lib/plat-aix4/IN.py | 81 | # Generated by h2py from /usr/include/netinet/in.h
# Included from net/nh.h
# Included from sys/machine.h
LITTLE_ENDIAN = 1234
BIG_ENDIAN = 4321
PDP_ENDIAN = 3412
BYTE_ORDER = BIG_ENDIAN
DEFAULT_GPR = 0xDEADBEEF
MSR_EE = 0x8000
MSR_PR = 0x4000
MSR_FP = 0x2000
MSR_ME = 0x1000
MSR_FE = 0x0800
MSR_FE0 = 0x0800
MSR_SE = ... |
simzacks/jjb | refs/heads/master | tests/duplicates/__init__.py | 12133432 | |
liuxiaoliang/L | refs/heads/master | math/optimize/__init__.py | 12133432 | |
xinwu/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/metering/forms.py | 48 | # Copyright 2014 OpenStack Foundation
#
# 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 ... |
jordanbettis/chipy-mentorship | refs/heads/master | chipyprj/chipyapp/admin.py | 1 | from django.contrib import admin
from chipyapp.models import Module, Area, Complex, LOB, Penetration, ActiveUnit
admin.site.register(Module)
admin.site.register(Area)
admin.site.register(Complex)
admin.site.register(LOB)
admin.site.register(Penetration)
admin.site.register(ActiveUnit)
|
smnitro555/ESWegarden | refs/heads/master | raspibot/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py | 320 | # coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... |
festivalhopper/music-transcription | refs/heads/master | scripts/fileformat/test_write_gp5.py | 1 | # sample of how to use the write_gp5 method from gp5_writer.py
from music_transcription.fileformat.guitar_pro.gp5_writer import write_gp5
from music_transcription.fileformat.guitar_pro.utils import *
# numerator, denominator, repeat_open, repeat_close, repeat_alt, marker_name, marker_color,
# major_key, minor_key, do... |
the9ull/OpenBazaar-Server | refs/heads/master | market/network.py | 2 | __author__ = 'chris'
import time
import json
import os.path
import nacl.signing
import nacl.hash
import nacl.encoding
import nacl.utils
import gnupg
from nacl.public import PrivateKey, PublicKey, Box
from dht import node
from twisted.internet import defer, reactor, task
from market.protocol import MarketProtocol
from ... |
amenonsen/ansible | refs/heads/devel | test/integration/targets/ansiballz_python/library/custom_module.py | 66 | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ..module_utils.basic import AnsibleModule # pylint: disable=relative-beyond-top-level
from ..module_utils.custom_util import forty_two # pylint: disable=relative-beyond-top-level
def main():
module = A... |
repotvsupertuga/repo | refs/heads/master | plugin.video.specto/resources/lib/sources/alluc_mv_tv.py | 20 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... |
hkchenhongyi/django | refs/heads/master | tests/properties/__init__.py | 12133432 | |
slyphon/pants | refs/heads/master | src/python/pants/engine/exp/legacy/__init__.py | 12133432 | |
broferek/ansible | refs/heads/devel | lib/ansible/module_utils/network/nxos/config/lacp/__init__.py | 12133432 | |
charbeljc/OCB | refs/heads/8.0 | addons/l10n_lu/scripts/tax2csv.py | 257 | from collections import OrderedDict
import csv
import xlrd
def _e(s):
if type(s) is unicode:
return s.encode('utf8')
elif s is None:
return ''
else:
return str(s)
def _is_true(s):
return s not in ('F', 'False', 0, '', None, False)
class LuxTaxGenerator:
def __init__(s... |
ingokegel/intellij-community | refs/heads/master | python/testData/formatter/specialSlice_after.py | 79 | a[b1, :]
|
prutseltje/ansible | refs/heads/devel | lib/ansible/modules/windows/win_acl_inheritance.py | 24 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# 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 = {'met... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.