repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
slinderman/pyhsmm_spiketrains | refs/heads/master | experiments/make_figure8.py | 1 | """
Plot true and inferred place fields for the hippocampal data
"""
import os
import cPickle
import gzip
from collections import namedtuple
import numpy as np
from scipy.io import loadmat
import matplotlib
matplotlib.rcParams.update({'font.sans-serif' : 'Helvetica',
'axes.labelsize': 9,
... |
codacy/python-codacy-coverage | refs/heads/master | tests/tests.py | 1 | import json
import os
import unittest
import codacy.reporter
HERE = os.path.abspath(os.path.dirname(__file__))
def _file_location(*args):
return os.path.join(HERE, *args)
class ReporterTests(unittest.TestCase):
def compare_parse_result(self, generated, expected_filename):
def file_get_contents(fil... |
api0cradle/Empire | refs/heads/master | lib/modules/python/persistence/multi/crontab.py | 2 | class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Persistence with crontab',
# list of one or more authors for the m... |
1tush/sentry | refs/heads/master | src/sentry/api/serializers/models/project.py | 15 | from __future__ import absolute_import
from sentry.api.serializers import Serializer, register
from sentry.models import OrganizationMemberType, Project, Team
@register(Project)
class ProjectSerializer(Serializer):
def get_attrs(self, item_list, user):
organization = item_list[0].team.organization
... |
erikrose/pip | refs/heads/develop | pip/_vendor/requests/packages/urllib3/util/response.py | 928 | def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
"""
try:
# Check via the official file-like-object way.
return obj.closed
except AttributeError:
pass
try:
# Check if the object... |
hehongliang/tensorflow | refs/heads/master | tensorflow/contrib/estimator/python/estimator/replicate_model_fn.py | 19 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
blrm/openshift-tools | refs/heads/stg | openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_utils/test/test_load_and_handle_cert.py | 78 | '''
Unit tests for the load_and_handle_cert method
'''
import datetime
import os
import sys
import pytest
MODULE_PATH = os.path.realpath(os.path.join(__file__, os.pardir, os.pardir, 'library'))
sys.path.insert(1, MODULE_PATH)
# pylint: disable=import-error,wrong-import-position,missing-docstring
# pylint: disable=i... |
Charlotte-Morgan/inasafe | refs/heads/develop | safe/gui/tools/test/test_options_dialog.py | 6 | # coding=utf-8
"""Test InaSAFE Options Dialog."""
import unittest
import logging
from safe.definitions.constants import INASAFE_TEST
from safe.definitions.default_settings import inasafe_default_settings
from safe.definitions.messages import disclaimer
from safe.gui.tools.options_dialog import OptionsDialog
from safe... |
lancekrogers/music-network | refs/heads/master | cleff/profiles/migrations/0018_auto_20150808_1917.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('profiles', '0017_auto_20150808_0615'),
]
operations = [
migrations.RemoveField(
model_name='comrade',
... |
CSF-JH/crossbarexamples | refs/heads/master | sharedregs/python/backend.py | 9 | ###############################################################################
##
## Copyright (C) 2015, Tavendo GmbH and/or collaborators. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
... |
40223101/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/atexit.py | 743 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... |
QijunPan/ansible | refs/heads/devel | test/units/mock/generator.py | 97 | # Copyright 2016 Toshio Kuratomi <tkuratomi@ansible.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) any ... |
spisneha25/django | refs/heads/master | tests/aggregation_regress/tests.py | 66 | from __future__ import unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
F, Q, Avg, Coun... |
craig5/salt-essentials-utils | refs/heads/master | example-data/extend-2/5-runner/runner/monitor.py | 3 | #!/usr/bin/env python
import salt.client
def procs(num_procs_raw):
'''
Show any minions that are above a certain number of processes.
'''
master_client = salt.client.LocalClient()
num_procs = int(num_procs_raw)
all_procs = master_client.cmd('*', 'cmd.run', ['ps -e | wc -l'])
for minion in... |
hpcuantwerpen/easybuild-framework | refs/heads/develop | test/framework/sandbox/easybuild/easyblocks/generic/__init__.py | 197 | __path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
antoan2/incubator-mxnet | refs/heads/master | python/mxnet/contrib/tensorboard.py | 34 | # 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... |
gshivani/ansible-modules-extras | refs/heads/devel | database/mysql/mysql_replication.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage mysql replication
(c) 2013, Balazs Pocze <banyek@gawker.com>
Certain parts are taken from Mark Theunissen's mysqldb module
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU... |
camptocamp/odoo | refs/heads/master | addons/resource/tests/test_resource.py | 243 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
spulec/moto | refs/heads/master | moto/ec2/responses/vpn_connections.py | 2 | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.ec2.utils import filters_from_querystring
class VPNConnections(BaseResponse):
def create_vpn_connection(self):
type = self._get_param("Type")
cgw_id = self._get_param("CustomerGatewayId")
vgw_id ... |
gojira/tensorflow | refs/heads/master | tensorflow/contrib/signal/python/ops/util_ops.py | 71 | # 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... |
xsynergy510x/android_external_chromium_org | refs/heads/cm-12.1 | tools/lsan/PRESUBMIT.py | 32 | # Copyright 2013 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.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""
import re
def Che... |
ESOedX/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/admin.py | 2 | """
Pages object for the Django's /admin/ views.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL
class ChangeUserAdminPage(PageObject):
"""
Change user page in Django's admin.
"""
def __init__(self, browser,... |
boland1992/seissuite_iran | refs/heads/master | build/lib/seissuite/ant/pscrosscorr (copy).py | 2 | #!/usr/bin/env python
"""
Module that contains classes holding cross-correlations and related
processing, such as frequency-time analysis (FTAN) to measure
dispersion curves.
"""
from seissuite.ant import pserrors, psstation, psutils, pstomo
import obspy.signal
import obspy.xseed
import obspy.signal.cros... |
unho/pootle | refs/heads/master | pootle/middleware/cache.py | 8 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from django.utils.cache import add_never_cac... |
chrislacy/digitalashes.com | refs/heads/master | src/main.py | 1 | '''
Copyright 2014 Chris Lacy.
Licensed under the MIT License.
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software
distributed under t... |
sk2/autonetkit | refs/heads/master | autonetkit/workflow/__init__.py | 12133432 | |
yunwkh/_sample_ | refs/heads/master | sample/helpers.py | 12133432 | |
itsMagondu/oscar | refs/heads/master | apps/photo/migrations/__init__.py | 12133432 | |
tectronics/smap-data | refs/heads/master | python/smap/drivers/acmex2/__init__.py | 12133432 | |
sushramesh/lwc | refs/heads/master | lib/python2.7/site-packages/django/conf/locale/uk/__init__.py | 12133432 | |
lygics/spaCy | refs/heads/master | bin/ner_tag.py | 3 | import codecs
import plac
from spacy.en import English
def main(text_loc):
with codecs.open(text_loc, 'r', 'utf8') as file_:
text = file_.read()
NLU = English()
for paragraph in text.split('\n\n'):
tokens = NLU(paragraph)
ent_starts = {}
ent_ends = {}
for span in ... |
pbs/django-cms | refs/heads/support/2.3.x | cms/plugins/inherit/forms.py | 1 | from cms.models import Page
from cms.plugins.inherit.models import InheritPagePlaceholder
from django import forms
from django.forms.models import ModelForm
from django.forms.utils import ErrorList
from django.utils.translation import ugettext_lazy as _
class InheritForm(ModelForm):
from_page = forms.ModelChoiceFi... |
coreynicholson/youtube-dl | refs/heads/master | youtube_dl/extractor/lovehomeporn.py | 93 | from __future__ import unicode_literals
import re
from .nuevo import NuevoBaseIE
class LoveHomePornIE(NuevoBaseIE):
_VALID_URL = r'https?://(?:www\.)?lovehomeporn\.com/video/(?P<id>\d+)(?:/(?P<display_id>[^/?#&]+))?'
_TEST = {
'url': 'http://lovehomeporn.com/video/48483/stunning-busty-brunette-girlf... |
apple/llvm-project | refs/heads/llvm.org/main | cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_declare_file/precompiled_binary_different_dir/lit.local.cfg.py | 12 | config.suffixes = ['.dex']
|
ouhouhsami/django-imapauth | refs/heads/master | imapauth/backends.py | 1 | from imaplib import IMAP4_SSL
from django.contrib.auth.models import User
from imapauth.settings import IMAPAUTH_HOST
class IMAPBackend(object):
# Create an authentication method
# This is called by the standard Django login procedure
# ! authentificated user with this system will not be able to
# lo... |
ergodicbreak/evennia | refs/heads/master | evennia/contrib/tutorial_world/__init__.py | 6 | # -*- coding: utf-8 -*-
"""
This package holds the demo game of Evennia.
"""
from __future__ import absolute_import
from . import mob, objects, rooms
|
idalin/calibre-web | refs/heads/master | cps/oauth.py | 3 | # -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 jim3ma
#
# 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... |
seem-sky/kbengine | refs/heads/master | kbe/src/lib/python/Lib/multiprocessing/managers.py | 85 | #
# Module providing the `SyncManager` class for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]
#
# Imports
#
import sys
import threading
import ar... |
krieger-od/nwjs_chromium.src | refs/heads/master | third_party/tlslite/tlslite/utils/python_rsakey.py | 60 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Pure-Python RSA implementation."""
from .cryptomath import *
from .asn1parser import ASN1Parser
from .rsakey import *
from .pem import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=... |
Adnn/django | refs/heads/master | django/utils/deconstruct.py | 502 | from importlib import import_module
from django.utils.version import get_docs_version
def deconstructible(*args, **kwargs):
"""
Class decorator that allow the decorated class to be serialized
by the migrations subsystem.
Accepts an optional kwarg `path` to specify the import path.
"""
path =... |
Kryz/sentry | refs/heads/master | tests/sentry/management/commands/test_cleanup.py | 23 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.core.management import call_command
from sentry.models import Event, Group, GroupTagValue, TagValue, TagKey
from sentry.testutils import TestCase
ALL_MODELS = (Event, Group, GroupTagValue, TagValue, TagKey)
class SentryCleanupTest(TestCase... |
ROB-Seismology/oq-hazardlib | refs/heads/rob-hazardlib | openquake/hazardlib/gsim/bindi_2014.py | 1 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
pwong-mapr/private-hue | refs/heads/HUE-1096-abe | apps/beeswax/src/beeswax/migrations/0008_auto__add_field_queryhistory_query_type.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 field 'QueryHistory.query_type'
db.add_column('beeswax_queryhistory', 'query_type', self.gf('django.db.mo... |
w1ll1am23/home-assistant | refs/heads/dev | homeassistant/components/swiss_hydrological_data/sensor.py | 3 | """Support for hydrological data from the Fed. Office for the Environment."""
from datetime import timedelta
import logging
from swisshydrodata import SwissHydroData
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import ATTR_ATTRIBUTION, CON... |
sunxi/linux-3.14 | 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... |
hehongliang/tensorflow | refs/heads/master | tensorflow/contrib/keras/api/keras/losses/__init__.py | 31 | # 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... |
tqtran7/horizon | refs/heads/master | openstack_dashboard/dashboards/project/images/__init__.py | 12133432 | |
nomadcube/scikit-learn | refs/heads/master | examples/svm/plot_svm_nonlinear.py | 268 | """
==============
Non-linear SVM
==============
Perform binary classification using non-linear SVC
with RBF kernel. The target to predict is a XOR of the
inputs.
The color map illustrates the decision function learned by the SVC.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn imp... |
ddki/my_study_project | refs/heads/master | language/python/frameworks/flask/venv/lib/python2.7/site-packages/setuptools/dep_util.py | 316 | from distutils.dep_util import newer_group
# yes, this is was almost entirely copy-pasted from
# 'newer_pairwise()', this is just another convenience
# function.
def newer_pairwise_group(sources_groups, targets):
"""Walk both arguments in parallel, testing if each source group is newer
than its corresponding t... |
josepedro/acidentes_em_rodovias_refatoracao | refs/heads/master | acidentes_em_rodovias/app/tests/tests_interface/interface_suite.py | 2 | from tests_acidentes_rodovias_periodo import *
from tests_acidentes_rodovias_regiao import *
def suite_tests_interface():
suite1 = unittest.TestLoader().loadTestsFromTestCase(AcidentesRodoviasRegiaoTestCase)
suite2 = unittest.TestLoader().loadTestsFromTestCase(AcidentesRodoviasPeriodoTestCase)
alltests = u... |
dcbdmb/example-code | refs/heads/master | 07-closure-deco/clockdeco_param_demo2.py | 8 | import time
from clockdeco_param import clock
@clock('{name}({args}) dt={elapsed:0.3f}s')
def snooze(seconds):
time.sleep(seconds)
for i in range(3):
snooze(.123)
|
home-assistant/home-assistant | refs/heads/dev | homeassistant/components/rituals_perfume_genie/const.py | 2 | """Constants for the Rituals Perfume Genie integration."""
DOMAIN = "rituals_perfume_genie"
COORDINATORS = "coordinators"
DEVICES = "devices"
ACCOUNT_HASH = "account_hash"
ATTRIBUTES = "attributes"
HUBLOT = "hublot"
ID = "id"
SENSORS = "sensors"
|
endolith/numpy | refs/heads/master | numpy/distutils/command/sdist.py | 17 | import sys
if 'setuptools' in sys.modules:
from setuptools.command.sdist import sdist as old_sdist
else:
from distutils.command.sdist import sdist as old_sdist
from numpy.distutils.misc_util import get_data_files
class sdist(old_sdist):
def add_defaults (self):
old_sdist.add_defaults(self)
... |
matbu/ansible-modules-extras | refs/heads/devel | packaging/os/__init__.py | 12133432 | |
pylixm/sae-django-demo | refs/heads/master | django1.7-sae/site-packages/django/views/generic/detail.py | 68 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, ContextMixin, View
class SingleObjectMixin(Conte... |
exxeleron/qPython | refs/heads/master | tests/qreader_test.py | 1 | #
# Copyright (c) 2011-2014 Exxeleron GmbH
#
# 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... |
AdamRTomkins/libSpineML2NK | refs/heads/master | libSpineML2NK/examples/tests/test_run.py | 2 | #from neurokernel.LPU.LPU import LPU
import neurokernel.mpi_relaunch
from libSpineML2NK import nk_executable
e = nk_executable.Executable('experiment0.xml')
e.execute()
print "Done"
|
rahushen/ansible | refs/heads/devel | lib/ansible/executor/process/worker.py | 88 | # (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... |
andylolz/UK-Polling-Stations | refs/heads/master | polling_stations/apps/data_collection/management/commands/import_lewisham.py | 1 | """
Import Lewisham
"""
from django.contrib.gis.geos import Point
from data_collection.management.commands import BaseAddressCsvImporter
from data_finder.helpers import geocode, geocode_point_only, PostcodeError
from addressbase.models import Address
class Command(BaseAddressCsvImporter):
"""
Imports the Po... |
alanconway/qpid-proton | refs/heads/master | python/examples/recurring_timer_tornado.py | 14 | #!/usr/bin/env python
#
# 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
# "... |
jeffschulte/protein | refs/heads/master | pyplots/plot-ave-arrow.py | 2 | from __future__ import division
import numpy as np
import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import sys
import time
import file_loader as load
import math
import re
f_shape = sys.argv[1]
f_param1 = sys.argv[2]
f_param2 = sys.argv[3]
f_param3 = sys.argv[4]
f_param4 = sys.argv[5]... |
isnowfy/pydown | refs/heads/master | pygments/lexers/_luabuiltins.py | 26 | # -*- coding: utf-8 -*-
"""
pygments.lexers._luabuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names and modules of lua functions
It is able to re-generate itself, but for adding new functions you
probably have to add some callbacks (see function module_callbacks).
Do not edit th... |
gimite/personfinder | refs/heads/master | app/vendors/unidecode/x022.py | 165 | data = (
'[?]', # 0x00
'[?]', # 0x01
'[?]', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'[?]', # 0x05
'[?]', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'-', ... |
DrMarcII/selenium | refs/heads/master | py/selenium/webdriver/phantomjs/__init__.py | 2454 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
geographika/mappyfile | refs/heads/master | docs/examples/grammar.py | 1 | import os
from lark import Lark
from lark.tree import pydot__tree_to_png
GVIZ_PATH = r"C:\Program Files (x86)\Graphviz2.38\bin"
def graphviz_setup():
os.environ['PATH'] = GVIZ_PATH + ';' + os.environ['PATH']
def main(s, out_fn):
graphviz_setup()
project_root = os.path.normpath(os.path.join(os.path.dirn... |
cancan101/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/dataframe/transforms/difference.py | 90 | # 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... |
RawEvan/sharephotos | refs/heads/master | site-packages/appconf/__init__.py | 11 | from __future__ import absolute_import
from .base import AppConf # noqa
__version__ = "1.0.1"
|
sinomiko/project | refs/heads/master | IdeaProjects/crap/tuchong.py | 1 | #-*- encoding: utf-8 -*-
'''''
Created on 2015-7-30
@author: Miko
'''
import urllib.request
import urllib,re,sys,os,time
import uuid
#获取二级页面url
def findUrl2(html):
# https://aisimu.tuchong.com/15583275/?rqt_id=
print(html)
#re1 = r'https://aisimu.tuchong.com/\d+/\?rqt_id='
re1 = 'https://aisimu.tuchong.... |
BehavioralInsightsTeam/edx-platform | refs/heads/release-bit | common/djangoapps/student/migrations/0003_auto_20160516_0938.py | 13 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.utils.timezone
import model_utils.fields
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... |
donSchoe/p2pool-n | refs/heads/master | SOAPpy/Types.py | 289 | from __future__ import nested_scopes
"""
################################################################################
# Copyright (c) 2003, Pfizer
# Copyright (c) 2001, Cayce Ullman.
# Copyright (c) 2001, Brian Matthews.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or withou... |
pomahtuk/py-cooking | refs/heads/master | pycooking/proj_settings/locals.py | 1 | # Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
|
msebire/intellij-community | refs/heads/master | python/testData/highlighting/argumentList.py | 83 | def comp_args(a=2, (b, c)=(3, 4)):
return a, b, c
|
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/nspkg/azure-storage-nspkg/azure/storage/__init__.py | 197 | __path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
keithroe/vtkoptix | refs/heads/master | Examples/Infovis/Python/kcore.py | 27 | #!/usr/bin/env python
from vtk import *
# generate a random graph
source = vtkRandomGraphSource()
source.SetNumberOfVertices(15000)
source.SetAllowSelfLoops(False)
source.SetEdgeProbability(0.003)
source.SetUseEdgeProbability(True)
source.AllowParallelEdgesOff()
# compute the kcore levels for every vertex in the gra... |
RitwikGupta/pattern | refs/heads/master | pattern/server/__init__.py | 21 | #### PATTERN | SERVER ##############################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2014 University of Antwerp, Belgium
# Copyright (c) 2014 St. Lucas University College of Art & Design, Antwerp.
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICEN... |
seraphln/wheel | refs/heads/master | wheel/ext/__init__.py | 1 | # coding=utf8
#
from flask_mail import Mail
from wheel.core.db import db
from wheel.core.cache import cache
from wheel.core.admin import configure_admin
from . import (generic, babel, blueprints, error_handlers, context_processors,
template_filters, before_request, views, themes, fixtures,
... |
t-wissmann/qutebrowser | refs/heads/master | tests/end2end/features/test_qutescheme_bdd.py | 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
Udala/docforever | refs/heads/master | pycoin/ecdsa/secp256k1.py | 32 | from .ellipticcurve import CurveFp, Point
# Certicom secp256-k1
_a = 0x0000000000000000000000000000000000000000000000000000000000000000
_b = 0x0000000000000000000000000000000000000000000000000000000000000007
_p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
_Gx = 0x79be667ef9dcbbac55a06295ce87... |
rust-lang/gyp | refs/heads/master | test/copies/gyptest-updir.py | 169 | #!/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.
"""
Verifies file copies where the destination is one level above an expansion that
yields a make variable.
"""
import TestGyp
# The Andro... |
ingokegel/intellij-community | refs/heads/master | python/testData/inspections/GoogleDocStringRemovePositionalVararg.py | 53 | def f():
"""
Args:
*ar<caret>gs:
""" |
saurabh6790/frappe | refs/heads/develop | frappe/desk/form/load.py | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json
import frappe.utils
import frappe.share
import frappe.defaults
import frappe.desk.form.meta
from frappe.model.utils.user_settings import get_user_settings
from... |
andaag/scikit-learn | refs/heads/master | examples/cluster/plot_color_quantization.py | 297 | # -*- coding: utf-8 -*-
"""
==================================
Color Quantization using K-Means
==================================
Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace
(China), reducing the number of colors required to show the image from 96,615
unique colors to 64, while pre... |
laffra/pava | refs/heads/master | pava/implementation/natives/java/awt/Font.py | 55 | def add_native_methods(clazz):
def initIDs____(a0):
raise NotImplementedError()
clazz.initIDs____ = staticmethod(initIDs____)
|
itsjeyd/edx-platform | refs/heads/master | openedx/core/djangoapps/bookmarks/signals.py | 64 | """
Signals for bookmarks.
"""
from importlib import import_module
from django.dispatch.dispatcher import receiver
from xmodule.modulestore.django import SignalHandler
@receiver(SignalHandler.course_published)
def trigger_update_xblocks_cache_task(sender, course_key, **kwargs): # pylint: disable=invalid-name,unuse... |
agoose77/hivesystem | refs/heads/master | sparta/assessors/all_.py | 1 | import libcontext, bee
from bee.segments import *
class all_(bee.worker):
"""The all assessor returns True if all of its inputs are True"""
outp = output("pull", "bool")
inp1 = antenna("pull", "bool")
inp2 = antenna("pull", "bool")
inp3 = antenna("pull", "bool")
inp4 = antenna("pull", "bool"... |
tensorflow/tpu | refs/heads/master | models/experimental/show_and_tell/train.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... |
extremewaysback/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex_multi_apps/app1/4_auto.py | 385 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app1", "3_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
AnalogJ/lexicon | refs/heads/master | lexicon/tests/providers/test_sakuracloud.py | 1 | """Integration tests for SakuraCloud"""
from unittest import TestCase
import pytest
from lexicon.tests.providers.integration_tests import IntegrationTestsV1
# Hook into testing framework by inheriting unittest.TestCase and reuse
# the tests which *each and every* implementation of the interface must
# pass, by inhe... |
benchoufi/PRJ-medtec_sigproc | refs/heads/master | echopen-leaderboard/bootcamp/feeds/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
ventrixcode/yowsup | refs/heads/pr/2 | yowsup/layers/protocol_groups/__init__.py | 70 | from .layer import YowGroupsProtocolLayer
|
gridsim/gridsim | refs/heads/master | demo/thermostat.py | 1 | from gridsim.unit import units
from gridsim.util import Position
from gridsim.simulation import Simulator
from gridsim.recorder import PlotRecorder
from gridsim.thermal.element import TimeSeriesThermalProcess
from gridsim.thermal.core import ThermalProcess, ThermalCoupling
from gridsim.electrical.core import AbstractEl... |
weiliu89/pyvision | refs/heads/master | experiments/toymarginals.py | 3 | from vision import *
from vision.alearn import marginals
from vision import visualize, model
from vision.toymaker import *
import os
import multiprocessing
import logging
import random
import ImageColor
import pylab
import pickle
logging.basicConfig(level = logging.INFO)
g = Geppetto((720,480))
b = Rectangle((400, 1... |
franklingu/leetcode-solutions | refs/heads/master | questions/group-shifted-strings/Solution.py | 1 | """
None
"""
class Solution:
def groupStrings(self, strings: List[str]) -> List[List[str]]:
track = {}
for s in strings:
diffs = []
for i, c in enumerate(s):
if i == 0:
continue
diffs.append((ord(c) - ord(s[i - 1]) + 26) ... |
gregbdunn/aws-ec2rescue-linux | refs/heads/develop | lib/boto3/resources/response.py | 11 | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
GeorgeZhukov/taskmanager | refs/heads/master | taskmanager/tasks/models.py | 1 | from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from datetime import date
# Create your models here.
@python_2_unicode_compatible
class Project(models.Model):
name = mo... |
timduru/platform-external-chromium_org | refs/heads/katkiss-4.4 | build/android/avd.py | 35 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""Launches Android Virtual Devices with a set configuration for testing Chrome.
The script will launch a specified number of Andr... |
utitankaspk/SPKCAM | refs/heads/master | src/Spkcam.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2015 Daniel Fernandez (daniel@spkautomatizacion.com), Saul Pilatowsky (saul@spkautomatizacion.com)
#
# 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 ... |
nhomar/odoo | refs/heads/8.0 | addons/crm_profiling/crm_profiling.py | 333 | # -*- 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... |
MarkWh1te/xueqiu_predict | refs/heads/master | python3_env/lib/python3.4/site-packages/setuptools/command/install_scripts.py | 454 | from distutils import log
import distutils.command.install_scripts as orig
import os
import sys
from pkg_resources import Distribution, PathMetadata, ensure_directory
class install_scripts(orig.install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def initialize_options(self):
... |
gautam1858/tensorflow | refs/heads/master | tensorflow/contrib/kafka/python/ops/kafka_dataset_ops.py | 4 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.