code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="legendgroup", parent_name="streamtube", **kwargs):
super(LegendgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | plotly/python-api | packages/python/plotly/plotly/validators/streamtube/_legendgroup.py | Python | mit | 457 |
# -*- coding: utf-8 -*-
# This is a part of qoss @ http://github.com/KenjiTakahashi/qoss/
# Karol "Kenji Takahashi" Wozniak (C) 2011
#
# 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 vers... | KenjiTakahashi/qoss | middleendv2.py | Python | gpl-3.0 | 8,570 |
import calendar
import dateutil.parser
import datetime
import time
import numpy as np
try:
import netCDF4
except ImportError:
pass
class IonDate(datetime.date):
"""
Factory class to generate (tz unaware) datetime objects from various input formats
"""
def __new__(cls, *args):
if len(ar... | scionrep/scioncc | src/ion/util/time_utils.py | Python | bsd-2-clause | 866 |
class A:
def __init__(self):
self.y = None
self.x = 1
def foo(self):
a = self.y
| dahlstrom-g/intellij-community | python/testData/quickFixes/PyAddFieldQuickFixTest/addFieldFromMethod_after.py | Python | apache-2.0 | 97 |
# tile-generator
#
# Copyright (c) 2015-Present Pivotal Software, 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
#... | cf-platform-eng/tile-generator | ci/deployment-tests/app4_deploymenttest.py | Python | apache-2.0 | 3,382 |
import logging
from functools import partial
import math
import json
from django.http import HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods
from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.http... | DNFcode/edx-platform | cms/djangoapps/contentstore/views/assets.py | Python | agpl-3.0 | 11,616 |
from setuptools import setup
setup(name='PubNubPython27', version='1.0',
description='OpenShift Python-2.7 Community Cartridge based application',
author='Doron Sherman', author_email='doron@pubnub.com',
url='http://www.python.org/sigs/distutils-sig/',
# Uncomment one or more lines below in t... | pubnub/pubnub-openshift-quickstart | setup.py | Python | mit | 603 |
from PyQt4.QtCore import pyqtSignal
from PyQt4.QtGui import QWidget
from configmanager.editorwidgets.checkwidget import CheckboxWidgetConfig
from configmanager.editorwidgets.datewidget import DateWidgetConfig
from configmanager.editorwidgets.imagewidget import ImageWidgetConfig
from configmanager.editorwidgets.textwid... | HeatherHillers/RoamMac | src/configmanager/editorwidgets/__init__.py | Python | gpl-2.0 | 1,068 |
import bs4
import urllib2
import json
base = "https://papers.nips.cc/book/advances-in-neural-information-processing-systems"
baseno = 13
baseye = 2000
for offset in range(16):
no = str(baseno + offset)
year = str(baseye + offset)
url = "-".join([base, no, year])
soup = bs4.BeautifulSoup(urllib2.urlo... | mzmttks/prml | samples/lda/getdata.py | Python | mit | 671 |
# pylint: disable=no-self-use,invalid-name
import numpy
from flaky import flaky
from keras.layers import Input
from keras.models import Model
from deep_qa.layers import ComplexConcat
class TestComplexConcatLayer:
def test_call_works_on_simple_input(self):
input_shape = (3, 4, 5, 7)
input_1 = Inpu... | DeNeutoy/deep_qa | tests/layers/complex_concat_test.py | Python | apache-2.0 | 2,626 |
# -*- coding: utf-8 -*-
"""The event tag index."""
class EventTagIndex(object):
"""Event tag index.
The event tag index is used to map event tags to events.
It is necessary for the ZIP storage files since previously
stored event tags cannot be altered.
"""
def __init__(self):
"""Initializes an even... | Onager/plaso | plaso/storage/event_tag_index.py | Python | apache-2.0 | 1,620 |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: david@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
import datetime
import json
import sys
import time
from flask import current_ap... | vladan-m/ggrc-core | src/ggrc/utils.py | Python | apache-2.0 | 3,658 |
# -*- coding: utf-8 -*-
from scout.commands import cli
from scout.server.extensions import store
def test_view_aliases(mock_app):
"""Test CLI that shows all alias symbols and how they map to ids"""
runner = mock_app.test_cli_runner()
assert runner
# Test CLI with no parameters
result = runner.i... | Clinical-Genomics/scout | tests/commands/view/test_view_aliases_cmd.py | Python | bsd-3-clause | 1,236 |
"""
SublimeInfo Sublime Plugin.
Show info about the system and the current Sublime Text instance.
```
//////////////////////////////////
// Info Commands
//////////////////////////////////
{
"caption": "Sublime Info",
"command": "sublime_info"
},
```
Licensed under MIT
Copyright (... | facelessuser/SublimeRandomCrap | sublime_info.py | Python | mit | 2,894 |
#!/usr/bin/env python
#
# Seccomp Library test program
#
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
# Author: Tom Hromatka <tom.hromatka@oracle.com>
#
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Pu... | seccomp/libseccomp | tests/53-sim-binary_tree.py | Python | lgpl-2.1 | 3,729 |
"""
WSGI config for qpasacix project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "qpasacix.settings")
from django.core... | christianmtr/qpasacix | qpasacix/wsgi.py | Python | gpl-2.0 | 391 |
# Python imports
# Django imports
from django.conf import settings
from django.dispatch import Signal
# Third part imports
# Project imports
# ------ Email------ #
EMAIL_CONFIRMATION = getattr(settings, 'PROFILE_EMAIL_CONFIRMATION', True)
REQUIRED_FIELDS = getattr(settings, 'PROFILE_REQUIRED_FIELDS', ['email'])
e... | sololuz/cibb-web | app/users/config.py | Python | bsd-3-clause | 655 |
#assert.py
a = int(input("请输入整数a:"))
b = int(input("请输入整数b:"))
assert b != 0, '除数不能为0'
c = a / b
print(a, '/', b, '=', c)
| GH1995/tools | archives/Python_江老师给的代码/chapter03/assert.py | Python | gpl-3.0 | 156 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (C) 2011-2014 German Aerospace Center DLR
(Deutsches Zentrum fuer Luft- und Raumfahrt e.V.),
Institute of System Dynamics and Control
and BAUSCH-GALL GmbH, Munich
All rights reserved.
This file is licensed under the "BSD New" license
(see also http://openso... | PySimulator/PySimulator | PySimulator/Plugins/SimulationResult/Mtsf/MtsfFmi.py | Python | lgpl-3.0 | 15,300 |
#!/usr/bin/env python
# encoding: utf-8
from django.db import models
class Person(models.Model):
name = models.CharField(default="")
age = models.IntegerField(default=0)
| MrLYC/test_django_template | test_template/model.py | Python | mit | 181 |
import os
from functools import partial
from twisted.application import strports
from twisted.application.service import IServiceMaker
from twisted.internet import reactor
from twisted.internet.protocol import Factory
from twisted.plugin import IPlugin
from twisted.protocols.amp import AMP
from twisted.python import u... | fusionapp/documint | twisted/plugins/documint_service.py | Python | mit | 1,942 |
# -*- coding: 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 'MultipleChoiceQuestion.content_type'
db.add_column(u'exam_multiplechoicequestion', 'content_... | kevincwebb/conceptum | conceptum/exam/migrations/0002_auto__add_field_multiplechoicequestion_content_type__add_field_multipl.py | Python | bsd-3-clause | 6,123 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20151014_1042'),
]
operations = [
migrations.AlterField(
model_name='citation',
na... | ubiquitypress/articlemetrics | src/core/migrations/0009_auto_20151023_1316.py | Python | gpl-2.0 | 780 |
"""A set of functions for dealing with the toolbar buttons
The main CFME toolbar is accessed by using the Root and Sub titles of the buttons.
Usage:
tb = web_ui.toolbar
tb.select('Configuration', 'Add a New Host')
"""
import cfme.fixtures.pytest_selenium as sel
from selenium.webdriver.common.by import By
fr... | thom-at-redhat/cfme_tests | cfme/web_ui/toolbar.py | Python | gpl-2.0 | 7,066 |
# Copyright 2015 Daniel Neve
#
# 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, ... | DanForever/TimeSync | GAE/tvshowtime/config/checkin.py | Python | apache-2.0 | 1,770 |
from couchdbkit.ext.django.schema import *
from corehq.apps.sms.models import SMSLog
PROFILE_A = "A"
PROFILE_B = "B"
PROFILE_C = "C"
PROFILE_D = "D"
PROFILE_E = "E"
PROFILE_F = "F"
PROFILE_G = "G"
PROFILE_H = "H"
PROFILES = [PROFILE_A, PROFILE_B, PROFILE_C, PROFILE_D, PROFILE_E, PROFILE_F, PROFILE_G, PROFILE_H]
PROFIL... | gmimano/commcaretest | custom/fri/models.py | Python | bsd-3-clause | 1,551 |
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import urls as djangoauth_urls
from search import views as search_views
from blog import views as blog_views
from wagtail.wagtai... | philba/myblog | myblog/urls.py | Python | mit | 1,474 |
import sys
import time
from django.core.cache import cache
from django.test import TestCase
from binding_test.models import Product
from ..binding import CacheArray, CacheDict
from ._binding import TestBinding
class CacheDictTestCase(TestCase):
def testPatternSpeed(self):
a = CacheDict("a")
b ... | freakypie/django-binding | binding/tests/test_binding.py | Python | bsd-2-clause | 7,549 |
#most of this is from gevent-websocket example!
# its a dirty proof of concept to demonstrate result streaming to a client via websocket
import traceback
from json import dumps, loads
import time
import ConfigParser
from kyoto_cabinet_stringstore import *
import index_manager as im
import query_engine
import logging
... | yannick/tygrstore | sparql.py | Python | agpl-3.0 | 4,822 |
#!/usr/bin/python
#-*-coding:utf-8-*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from urllib2 import urlopen
import json,datetime
from ics import Calendar, Event
import Config
class Holiday(Calendar):
"""
generate Chinese Holiday
"""
_FREEDAY="休息日"
_WORKDAY="工作日"
def __init__(sel... | zifeiwoo/icalics | icalics.py | Python | apache-2.0 | 6,045 |
import logging
from flask.ext.sqlalchemy import SQLAlchemy
# no app object passed! Instead we use use db.init_app in the factory.
db = SQLAlchemy()
fh = logging.FileHandler('dbmodels.log')
fh.setLevel(logging.DEBUG)
logger = logging.getLogger('db.engine')
logger.setLevel(logging.DEBUG)
logger.addHandler(fh)
class ... | hashimmm/iiifoo | dbmodels.py | Python | mit | 2,761 |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# 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 agr... | idaholab/civet | ci/tests/test_DebugViews.py | Python | apache-2.0 | 4,223 |
#!/usr/bin/env python
# coding: utf-8
## Copyright (C) 2009-2012 Assem Chelli <assem.ch [at] gmail.com>
## This program 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... | saifmahamood/alfanous | src/alfanous-import/initial_importing.py | Python | agpl-3.0 | 23,520 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (C) USC Information Sciences Institute
# Author: Vladimir M. Zaytsev <zaytsev@usc.edu>
# URL: <http://nlg.isi.edu/>
# For more information, see README.md
# For license information, see LICENSE
import sys
import logging
import argparse
from mokujin.query import Domain... | zaycev/mokujin | findmetaphors.py | Python | apache-2.0 | 1,317 |
#!/usr/bin/env python
import sklearn.neural_network
import sklearn.svm
import sklearn.discriminant_analysis
import numpy as np
import time
import os
from hepstore.core.utility import *
from hepstore.core.statistic.distribution import *
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import c... | PeterSchichtel/hepstore | hepstore/core/school/books/classification/qda.py | Python | gpl-3.0 | 1,659 |
# Copyright 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | SVilgelm/CloudFerry | cloudferry/actions/prechecks/check_users.py | Python | apache-2.0 | 2,389 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... | andysim/psi4 | psi4/driver/procrouting/proc_table.py | Python | gpl-2.0 | 10,293 |
from util import print_error
import traceback, sys
from util import *
from i18n import _
plugins = []
def init_plugins(config):
import imp, pkgutil, __builtin__, os
global plugins
if __builtin__.use_local_modules:
fp, pathname, description = imp.find_module('plugins')
plugin_names = [nam... | mazaclub/tate | lib/plugins.py | Python | gpl-3.0 | 2,908 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime, timedelta
from multiprocessing.pool import ThreadPool
import logging
import os
import sys
from compat import atomic
from compat import import_module
from django.utils import timezone
from django.utils.encoding import python... | TeamAADGT/CMPUT404-project-socialdistribution | background_task/tasks.py | Python | apache-2.0 | 10,003 |
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.utils.decorators import method_decorator
class LoginRequiredMixin(object):
@method_decorator(login_required)
def dispatch(self, *args, **kwargs):
return super(LoginRequiredMixin, self).dispatch(*args... | wlonk/are_there_spiders | are_there_spiders/phobias/mixins.py | Python | mit | 994 |
import urllib # urlencode function
import urllib2 # urlopen function (better than urllib version)
import json
import ast
import time
from pprint import pprint
WUNDERGROUND_API_KEY = "3ec21efc1c37b8b2"
WUNDERGROUND_BASE_URL = "http://api.wunderground.com/api/"+WUNDERGROUND_API_KEY
MBTA_API_KEY = "KE_VanziA0OQ_r_sV6... | hubwayPredict/main | old_mbtaPredict/mbtaPredict.py | Python | mit | 5,187 |
# -*- coding: 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 'Profile'
db.create_table('profile_profile', (
('user', self.gf('django.db.models... | rhertzog/librement | src/librement/profile/migrations/0001_initial.py | Python | agpl-3.0 | 6,475 |
"""empty message
Revision ID: 4ccfe9c1b8fa
Revises: 1391ee426d4
Create Date: 2014-12-23 12:56:44.406087
"""
# revision identifiers, used by Alembic.
revision = '4ccfe9c1b8fa'
down_revision = '1391ee426d4'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | marinamarina/sure-thing | migrations/versions/4ccfe9c1b8fa_.py | Python | gpl-3.0 | 1,149 |
# -*- coding: utf-8 -*-
#
# The Linux Kernel documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 12 13:51:46 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fi... | eva-oss/linux | Documentation/conf.py | Python | gpl-2.0 | 18,880 |
'''
Core functions, classes for batch compute service.
Including a simple api implementation of batch compute service, core
exceptions for batch compute.
'''
__all__ = [
"Api", "Clienterror", "FieldError", "ValidationError",
]
from .api import Api
from .exceptions import (
ClientError, FieldError, Validatio... | luzhijun/Optimization | cma-es/batchcompute_python_sdk/src/batchcompute/core/__init__.py | Python | apache-2.0 | 330 |
'''
Copyright 2014, Institute e-Austria, Timisoara, Romania
http://www.ieat.ro/
Developers:
* Silviu Panica, silviu.panica@e-uvt.ro
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://w... | ieat/mosaic-artifact-repository | runtime/lib/__init__.py | Python | apache-2.0 | 3,117 |
# Copyright (c) 2016-2017 Shafeen Tejani. Released under GPLv3.
import tensorflow as tf
WEIGHTS_INIT_STDEV = .1
def net(image):
image = image / 255.0
conv1 = _conv_layer(image, 32, 9, 1)
conv2 = _conv_layer(conv1, 64, 3, 2)
conv3 = _conv_layer(conv2, 128, 3, 2)
resid1 = _residual_block(conv3, 3)
... | shivsundram/superresolution | transform.py | Python | gpl-3.0 | 4,550 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | flgiordano/netcash | +/google-cloud-sdk/lib/googlecloudsdk/api_lib/dataflow/dataflow_util.py | Python | bsd-3-clause | 1,095 |
# Copyright (C) 2012 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | danakj/chromium | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py | Python | bsd-3-clause | 15,744 |
import datetime
import io
import boto3
import mock
import pytest
import requests
import testfixtures
from botocore.exceptions import ClientError
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import boto3 as boto3_hooks
DYNAMODB_ENDPOINT_URL = 'http://localhost:4569'
S3_ENDPOINT_URL... | uber-common/opentracing-python-instrumentation | tests/opentracing_instrumentation/test_boto3.py | Python | mit | 6,158 |
# -*- coding: utf-8 -*-
"""
Region - descendant class of BaseRegion.
"""
import datetime
import os
import time
from common_exceptions import FailExit, FindFailed
from Location import Location
from BaseRegion import BaseRegion, logger, DELAY_BETWEEN_CV_ATTEMPT
from Match import Match
from Pattern im... | pikuli-project/pikuli | pikuli/Region.py | Python | mit | 15,836 |
#!/usr/bin/python
# service_supplier_relations.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (service_supplier_relations.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as ... | vesellov/bitdust.devel | services/service_supplier_relations.py | Python | agpl-3.0 | 3,964 |
# Copyright (c) PagerDuty.
# See LICENSE for details.
import json
import unittest
import os.path
import requests_mock
from pypd import Incident, Alert
def get_object_by_id(data, search_id):
return list(filter(lambda s: s['id'] == search_id, data))[0]
def get_data(data_type, mock_object):
return {data_type... | PagerDuty/pagerduty-api-python-client | test/unit/models/alert.py | Python | mit | 6,965 |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'BIOMD0000000143.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... | biomodels/BIOMD0000000143 | BIOMD0000000143/model.py | Python | cc0-1.0 | 427 |
#-*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program 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, eith... | yvaucher/hr | __unported__/hr_report_payroll_net/__openerp__.py | Python | agpl-3.0 | 1,430 |
# -*- coding: utf-8 -*-
"""The base Controller API."""
from tg import TGController, tmpl_context
from tg.render import render
from tg import request
from tg.i18n import ugettext as _, ungettext
import wiki20.model as model
__all__ = ['BaseController']
class BaseController(TGController):
"""
Base class for ... | txdywy/wiki20 | wiki20/lib/base.py | Python | gpl-2.0 | 856 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.common import Backend
from lib.core.common import dataToStdout
from lib.core.common import getSQLSnippet
from lib.core.common import isStackingAvailab... | goofwear/raspberry_pwn | src/pentest/sqlmap/plugins/generic/custom.py | Python | gpl-3.0 | 3,805 |
import json
import xmltodict as xml
# the xml file is available at http://www.mta.info/status/serviceStatus.txt
s = open("code/status.xml").read()
# we convert it to a dictionary
d = xml.xmltodict(s)
# and then dump the subway section into a JSON file to visualise
json.dump(d['subway'][0]['line'], open("../viz/data/se... | SparkFreedom/DataDive | getting_started_with_d3/cleaning_code/service_status.py | Python | mit | 344 |
'''
<license>
CSPLN_MaryKeelerEdition; Manages images to which notes can be added.
Copyright (C) 2015, Thomas Kercheval
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... | SpaceKatt/CSPLN | scripts/view_change.py | Python | gpl-3.0 | 4,071 |
# Copyright (C) 2012 JoseMi "h0rm1" Holguin (@j0sm1)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program ... | neoz/zer0m0n | signatures/create_process.py | Python | gpl-3.0 | 1,188 |
from django.core.management.base import NoArgsCommand
from app_metrics.models import MetricItem
from app_metrics.backends.mixpanel import metric
from app_metrics.utils import get_backend
class Command(NoArgsCommand):
help = "Move MetricItems from the db backend to MixPanel"
requires_model_validation = True
... | frankwiles/django-app-metrics | app_metrics/management/commands/move_to_mixpanel.py | Python | bsd-3-clause | 928 |
#coding=utf-8
from basic import login, BasicCtrl
class LeaveCtrl(BasicCtrl):
@login
def get(self):
self.render('leave.html')
@login
def post(self):
self.del_current_sess()
self.redirect('/')
| finron/luokr.com | www.luokr.com/app/ctrls/leave.py | Python | bsd-3-clause | 234 |
# Copyright (C) 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | javier-ruiz-b/docker-rasppi-images | raspberry-google-home/env/lib/python3.7/site-packages/google_auth_oauthlib/tool/__main__.py | Python | apache-2.0 | 4,257 |
# Copyright (c) 2020 PaddlePaddle 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 appli... | luotao1/Paddle | python/paddle/fluid/tests/unittests/ir/inference/test_trt_affine_channel_op.py | Python | apache-2.0 | 5,167 |
#!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | alxgu/ansible | lib/ansible/modules/network/onyx/onyx_l2_interface.py | Python | gpl-3.0 | 10,952 |
import os
from stve.script import StveTestCase
from runner import TestStveTestRunner as TSTR
from nose.tools import with_setup, raises, ok_, eq_
class TestBrowserTestRuner(TSTR):
@with_setup(TSTR.setup, TSTR.teardown)
def test_library_execute_browser_success_01(self):
self.base_library_execute_success... | TE-ToshiakiTanaka/stvex | test/test_browser.py | Python | mit | 914 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... | pacoqueen/ginn | ginn/formularios/resultados_titulo.py | Python | gpl-2.0 | 15,429 |
#!/usr/bin/env python
"""
Runs checkTransformationIntegrity from ValidateOutputDataAgent on selected Tranformation
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
__RCSID__ = "$Id$"
import sys
from DIRAC.Core.Utilities.DIRACScript import DIRACScript a... | ic-hep/DIRAC | src/DIRAC/TransformationSystem/scripts/dirac_transformation_verify_outputdata.py | Python | gpl-3.0 | 1,147 |
#!/usr/bin/env python
"""
This file contains the sample code for XXX. Search for the string CONTENT to
skip directly to it.
Executing this file will begin an enhanced interactive Python session. You
can step through each slide of sample code and explore the results. If your
explorations hose the environment, just ... | dcolish/Presentations | pdxpython/sliderepl.py | Python | bsd-3-clause | 13,115 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class WebcrawlItem(scrapy.Item):
url = scrapy.Field()
body = scrapy.Field()
visit_id = scrapy.Field()
visit_status = scrapy.Field()
| zseder/webcorpus | scrapy/webcrawl/webcrawl/items.py | Python | gpl-3.0 | 316 |
from scrapy import cmdline
import os
class Crawler:
## get input ##
filename = "results.json"
def prepare(self):
## delete only if file exists ##
if os.path.exists(self.filename):
os.remove(self.filename)
else:
print("Sorry, I can not remove %s file." % sel... | trujunzhang/djzhang-targets | cwemail/cwemail/main.py | Python | mit | 668 |
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2009 John Iacona
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your optio... | dardevelin/rhythmbox-shuffle | .pc/CVE-2012-3355.patch/plugins/context/AlbumTab.py | Python | gpl-2.0 | 10,933 |
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
import os
import requests
from beer_search_v2.models import Brewery, UntappdStyle, Country, AlcoholCategory, ContainerType, Product
from collections import OrderedDict
def get_main_display():
"""
Returns a list of dictionari... | Ernir/bjorleitin | beer_search_v2/utils.py | Python | mit | 9,732 |
import numpy as np
from .experiments import run_experiments
from ..plots import colors
from .. import __version__
from . import models
from . import methods
from . import metrics
import sklearn
import io
import base64
import os
try:
import matplotlib.pyplot as pl
import matplotlib
except ImportError:
pass
... | slundberg/shap | shap/benchmark/plots.py | Python | mit | 23,807 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 5, transform = "Difference", sigma = 0.0, exog_count = 0, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Difference/trend_MovingMedian/cycle_5/ar_12/test_artificial_1024_Difference_MovingMedian_5_12_0.py | Python | bsd-3-clause | 269 |
#!/usr/bin/env python
""" echo module
"""
import time
from multiprocessing import Process, Queue
from Queue import Empty
from yapsy.IPlugin import IPlugin
class echo(IPlugin):
def activate(self, events, qIrc):
super(echo, self).activate()
self.events = events
self.irc = qIrc
... | bear/babble | babble/plugins/echo.py | Python | bsd-3-clause | 1,258 |
"""
Descriptive HTTP status codes, for code readability.
See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
And RFC 6585 - http://tools.ietf.org/html/rfc6585
"""
def is_informational(code):
return code >= 100 and code <= 199
def is_success(code):
return code >= 200 and code <= 299
def is... | Cinemair/cinemair-server | cinemair/common/status.py | Python | mit | 1,938 |
'''Label
=====
.. image:: images/label.png
:align: right
The :class:`Label` widget is for rendering text. It supports ascii and unicode
strings::
# hello world text
l = Label(text='Hello world')
# unicode text; can only display glyphs that are available in the font
l = Label(text=u'Hello world '... | akshayaurora/kivy | kivy/uix/label.py | Python | mit | 38,005 |
# -*- coding: utf-8 -*-
import os
import glob
import codecs
import importlib
from sphinx.util.console import bold
from sphinx.ext.autodoc import Documenter
from . import analyzers
class AnySrcDocumenter(Documenter):
"""
Specialized Documenter subclass for any source files
"""
objtype = 'anysrc'
... | Lemma1/MAC-POSTS | doc_builder/sphinx-contrib/autoanysrc/sphinxcontrib/autoanysrc.py | Python | mit | 3,715 |
# Copyright 2021 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the foll... | grpc/grpc-ios | native_src/third_party/googletest/googletest/test/googletest-global-environment-unittest.py | Python | apache-2.0 | 5,243 |
#!/usr/bin/env python
# Copyright (c) 2015, Scott D. Peckham
#------------------------------------------------------
# S.D. Peckham
# July 9, 2015
#
# Tool to extract the object part of every CSDMS Standard
# Variable Name and generate a list of objects that
# includes those as well as all parent objects.
#
# Example... | mprinc/McMap | src/scripts/CSN_Archive2/check_object_names.py | Python | mit | 4,683 |
"""Thumbnail column in highlight can now be nullable
Revision ID: 155eda5d09d
Revises: 30380ad5731
Create Date: 2015-12-20 02:55:58.365130
"""
# revision identifiers, used by Alembic.
revision = '155eda5d09d'
down_revision = '30380ad5731'
branch_labels = None
depends_on = None
from alembic import op
import sqlalche... | gigglearrows/anniesbot | alembic/versions/155eda5d09d_thumbnail_column_in_highlight_can_now_.py | Python | mit | 903 |
#!/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
"License");... | keedio/keedio-stacks | KEEDIO/1.3/services/SPACEWALK/package/scripts/spacewalk_handler.py | Python | apache-2.0 | 1,383 |
from pycp2k.inputsection import InputSection
from ._each190 import _each190
from ._cubes2 import _cubes2
class _wannier_states1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Add_last = None
self.Common_iteration_levels = None
... | SINGROUP/pycp2k | pycp2k/classes/_wannier_states1.py | Python | lgpl-3.0 | 925 |
# 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 ... | StackPointCloud/libcloud | libcloud/storage/drivers/azure_blobs.py | Python | apache-2.0 | 36,234 |
""" Fixtures don't go here; see util/base.py and friends. """
# fixtures that are available by default
from tests.util.base import config, db, log, absolute_path
def pytest_generate_tests(metafunc):
if 'db' in metafunc.fixturenames:
dumpfile = absolute_path(config()['BASE_DUMP'])
savedb = False
... | rmasters/inbox | tests/imap/conftest.py | Python | agpl-3.0 | 535 |
from django.contrib.auth.models import User
from django.db import models
from django.db.models import signals
from cyder.core.cyuser import backends
from cyder.core.ctnr.models import Ctnr
class UserProfile(models.Model):
user = models.OneToOneField(User)
default_ctnr = models.ForeignKey(Ctnr, default=2)
... | ngokevin/cyder | cyder/core/cyuser/models.py | Python | bsd-3-clause | 730 |
try:
import trace
except ImportError:
pass
else:
trace._warn = lambda *args: None # workaround for http://bugs.python.org/issue17143 (PY-8706)
import os
from _pydevd_bundle.pydevd_comm import CMD_SIGNATURE_CALL_TRACE, NetCommand
from _pydevd_bundle import pydevd_xml
from _pydevd_bundle.pydevd_constants ... | paplorinc/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_signature.py | Python | apache-2.0 | 7,129 |
# week12.py
print("week12.py")
| s40523127/2017springwcm_g4 | course/week12.py | Python | agpl-3.0 | 32 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_py3.py | Python | mit | 4,917 |
# ESP8266 Project setup utility
# https://github.com/esp8266-setup/esp8266-setup
#
# Copyright (C) 2017 Johannes Schriewer <hallo@dunkelstern.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... | esp8266-setup/esp8266-setup | esp8266_setup/__init__.py | Python | gpl-2.0 | 785 |
import logging
import os
import ray
import time
from enum import Enum
from ray.actor import ActorHandle
from ray.streaming.generated import remote_call_pb2
from ray.streaming.runtime.command\
import WorkerCommitReport, WorkerRollbackRequest
logger = logging.getLogger(__name__)
class CallResult:
"""
Call... | richardliaw/ray | streaming/python/runtime/remote_call.py | Python | apache-2.0 | 3,046 |
#! /usr/bin/env python
"""
File: MovieDetailsPanel.py
Author: Revolt
--------------------------
Desc:
This file contains the definition and implementation of the panel
containing details about a multimedia object
--------------------------
Copyright (C) 2010 Revolt
This program is free software: you can... | AlexJF/MHDD-Organizer | gui/panels/MovieDetailsPanel.py | Python | gpl-3.0 | 9,231 |
#!/usr/bin/env python3
import re
from .codes import codes
class Emoji:
def __init__(self, const):
if len(const) == 1:
self.__fromUnicode(const)
elif const[0] == ":":
self.__fromAlias(const)
else:
self.__fromEscape(const)
self.aliases = codes[self.escape]
self.alias = self.alia... | KoffeinFlummi/pymoji | pymoji/__init__.py | Python | mit | 1,701 |
# This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | eliasdesousa/indico | indico/modules/events/registration/views.py | Python | gpl-3.0 | 3,108 |
#!/usr/bin/env python
# CEF/Chromium Build
# ==================
# We have a slightly modified build of CEF/Chromium for a few things:
#
# * A GPL-compatible build of ffmpeg (for h.264/etc support)
#
# * The ability to place build artifacts in an organization that makes sense for
# this project.
#
# As such, we need... | nevir/plexability | extern/chromium/sync.py | Python | gpl-2.0 | 2,587 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of ALTcointip.
ALTcointip 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) ... | vindimy/altcointip | src/ctb/ctb_stats.py | Python | gpl-2.0 | 10,820 |
# Copyright 2018 Google LLC
#
# 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, s... | googleworkspace/python-samples | calendar/quickstart/quickstart.py | Python | apache-2.0 | 2,977 |
# encoding: utf-8
# module samba.dcerpc.srvsvc
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/srvsvc.so
# by generator 1.135
""" srvsvc DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
class NetSrvInfo599(__talloc.Object):
# no doc
def __init__(self, *args, **kwargs): # real si... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/srvsvc/NetSrvInfo599.py | Python | gpl-2.0 | 6,394 |
from __future__ import division
import bokeh
import bokeh.plotting
from bokeh.models.sources import ColumnDataSource
from numpy import (append, arange, argsort, flipud, inf, linspace, log10,
logspace, partition, searchsorted)
from scipy.special import betaincinv
from ._colors import get_colors
from... | glimix/limix-genetics | limix_genetics/_qqplot.py | Python | mit | 4,618 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.