text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
from pycp2k.inputsection import InputSection
from ._each174 import _each174
class _diis_info3(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Add_last = None
self.Common_iteration_levels = None
self.Filename = None
... | SINGROUP/pycp2k | pycp2k/classes/_diis_info3.py | Python | lgpl-3.0 | 668 | 0.002994 |
# 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
# d... | sdpp/python-keystoneclient | keystoneclient/tests/unit/v2_0/test_tenants.py | Python | apache-2.0 | 13,149 | 0 |
"""
# TOP2049 Open Source programming suite
#
# Microchip8_18_common - basic file for 8bit PIC18 MCU
#
# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#... | mbuesch/toprammer | libtoprammer/chips/microchip8/microchip8_18_common.py | Python | gpl-2.0 | 13,142 | 0.035915 |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
import sys
# Define required packages.
requires = []
# Assume spidev is required on non-windows & non-mac platforms (i.e. linux).
if sys.platform != 'win32' and sys.platform != 'darwin':
requires.append('spidev')
set... | WxOutside/software | telemetry/sensors/weatherPiArduino/Adafruit_Python_GPIO/setup.py | Python | unlicense | 846 | 0.035461 |
class LSA(object):
def __init__(self,input_path,output_path):
super(LSA,self).__init__()
self.input_path = input_path
self.output_path = output_path
self.hpfx = 'k, bins: [' | scottdaniel/LatentStrainAnalysis | LSA/LSA.py | Python | mit | 182 | 0.049451 |
#!/usr/bin/env python
import os
import uuid
import cgi
import hashlib
import webapp2 as webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp import util
from google.appengine.ext import db
from google.appengine.api import users
import datetime
from calendar import timegm
import time
... | 040medien/furnaceathome | furnace.py | Python | gpl-2.0 | 9,961 | 0.012449 |
from __future__ import print_function, absolute_import
import weakref
class PDroneCreator(object):
def __init__(self, mainwindow, clipboard, title="drones"):
self._mainwindow = mainwindow
self._clipboard = clipboard
self._subwin = mainwindow.newSubWindow(title)
from . import PTree... | agoose77/hivesystem | hiveguilib/PGui/PDroneCreator.py | Python | bsd-2-clause | 807 | 0 |
# -*- coding:UTF-8 -*-
""" pyBox Modbus"""
# !/usr/bin/python
# Python: 3.5.2
# Platform: Windows/ARMv7
# Author: Heyn
# Program: Modbus RTU & TCP
# History: 2017/02/14 V1.0.0 [Heyn]
# 2017/03/08 V1.0.1 [Heyn] Send return string.
# 2017/04/07 V1.0.2 [Heyn] Redesign PBoxModbus class functions.
... | Heyn2016/Python | ApalisT30/Pbox/proto/PBoxModbus.py | Python | gpl-3.0 | 4,314 | 0.001159 |
"""XKNX version."""
__version__ = "0.19.2.dev"
| XKNX/xknx | xknx/__version__.py | Python | mit | 48 | 0 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.actionscript
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for ActionScript and MXML.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, using,... | prashanthr/wakatime | wakatime/packages/pygments_py3/pygments/lexers/actionscript.py | Python | bsd-3-clause | 11,179 | 0.004652 |
from basetest import *
from zfs_autobackup.LogStub import LogStub
from zfs_autobackup.ExecuteNode import ExecuteError
class TestZfsNode(unittest2.TestCase):
def setUp(self):
prepare_zpools()
# return super().setUp()
def test_consistent_snapshot(self):
logger = LogStub()
descr... | psy0rz/zfs_autobackup | tests/test_zfsnode.py | Python | gpl-3.0 | 8,088 | 0.003709 |
import time # about 60 s
def countBinOnes(x):
cnt = 0
while x != 0:
cnt += 1
x &= x - 1
return cnt
def isSpecialSumSet(A):
N = ( 1 << len(A) ) - 1
subset = N * [None]
for i in range(1, N):
subset[i] = 0
for j in range(len(A)):
if (i >> j) & 1 == 1:
... | wandering007/ProjectEuler | src/103.py | Python | apache-2.0 | 1,733 | 0.018465 |
from django.db.models import CharField, Value as V
from django.db.models.functions import Coalesce, Length, Upper
from django.test import TestCase
from django.test.utils import register_lookup
from .models import Author
class UpperBilateral(Upper):
bilateral = True
class FunctionTests(TestCase):
def test_... | nesdis/djongo | tests/django_tests/tests/v22/tests/db_functions/tests.py | Python | agpl-3.0 | 2,439 | 0.00082 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_tatooine_desert_demons_camp_medium.iff"
result.attribute... | anhstudios/swganh | data/scripts/templates/object/building/poi/shared_tatooine_desert_demons_camp_medium.py | Python | mit | 465 | 0.047312 |
import unittest
from webtest import TestApp
import test_helper
class ErrorsControllerTests(unittest.TestCase):
def test_error_404(self):
app = TestApp(test_helper.get_app())
assert app.get('/error/404').status == '200 OK'
def test_error_500(self):
app = TestApp(test_helper.get_app()... | Rolinh/pydeo | pydeo/test/functional/errors_controller_test.py | Python | bsd-3-clause | 378 | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# 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 L... | iwm911/plaso | plaso/__init__.py | Python | apache-2.0 | 934 | 0.003212 |
import datetime
import logging
from unittest.mock import patch
from django.test import TestCase
from django.test.utils import override_settings
from konfera import models
from payments import utils
from payments.models import ProcessedTransaction
def make_payment(new_data):
data = {
'date': datetime.dat... | kapucko/django-konfera | payments/tests.py | Python | mit | 7,832 | 0.001404 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Event CRM Sale',
'version': '1.0',
'category': 'Marketing/Events',
'website': 'https://www.odoo.com/page/events',
'description': "Add information of sale order linked to the registration fo... | ddico/odoo | addons/event_crm_sale/__manifest__.py | Python | agpl-3.0 | 511 | 0.001957 |
import mock
from pdcupdater.tests.handler_tests import BaseHandlerTest, mock_pdc
import pdcupdater.services
import pdcupdater.handlers.retirement
from pdcupdater.handlers.retirement import RetireComponentHandler
class TestRetiredComponents(BaseHandlerTest):
handler_path = 'pdcupdater.handlers.retirement:RetireCo... | fedora-infra/pdc-updater | pdcupdater/tests/handler_tests/test_retirement.py | Python | lgpl-2.1 | 11,525 | 0.000347 |
dictionary = {"GEEKS", "FOR", "QUIZ", "GO"}
N, M = 3, 3
board = [['G','I','Z'],
['U','E','K'],
['Q','S','E']]
class Graph:
class Vertex:
def __int__(self, v):
self.val = v
self.adj = []
def findWords(board=board):
def search(node, word, visited):
if node not in visited:
visited.appen... | carlb15/Python | boggle.py | Python | mit | 785 | 0.049682 |
# -*- encoding:utf-8 -*-
from flask import Flask
app = Flask(__name__)
@app.route('/config')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8080)
| SimonXming/Lab | backend/app.py | Python | mit | 207 | 0.009662 |
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
APP = ['aggregate.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
| mtnman38/Aggregate | aggForFoundation/setup.py | Python | gpl-2.0 | 311 | 0 |
class NamespaceAlreadyRegistered(Exception):
pass
class NoParentFound(Exception):
pass
| rsalmaso/django-cms | menus/exceptions.py | Python | bsd-3-clause | 97 | 0 |
#!/usr/bin/python
# Landsat 8 TOA reflactance and brightness temparature calculation
# Author Riazuddin Kawsar
# email: r.kawsar@spatial-business-integration
# date: 30th july 2015
# Landsat 8 bands
#---------------------------------------------------------
#Band 1 - Coastal aerosol 0.43 - 0.45 30
#Band 2 - Blue ... | neel9102/eo_tools | image_processing/Landsat/reflectance_landsat_8_multiple_release.py | Python | gpl-3.0 | 13,296 | 0.019179 |
import cProfile
import unittest
import pstats
if __name__ == '__main__':
suite = unittest.TestLoader().discover('.')
def runtests():
# set verbosity to 2 to see each test
unittest.TextTestRunner(verbosity=1, buffer=True).run(suite)
cProfile.run(
'runtests()', filename='test_cprof... | wanqizhu/mtg-python-engine | test.py | Python | mit | 466 | 0.006438 |
'''
Analysis plugin for supporting WorkspaceEmulators during analysis pass.
Finds and connects Switch Cases, most specifically from Microsoft.
'''
import envi
import envi.archs.i386 as e_i386
import vivisect
import vivisect.analysis.generic.codeblocks as vagc
def analyzeJmp(amod, emu, op, starteip):
'''
Top ... | imjonsnooow/vivisect | vivisect/analysis/generic/switchcase.py | Python | apache-2.0 | 5,920 | 0.010473 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
# IMPORTANT: only import safe functions as this module will be included in jinja environment
import frappe
import operator
import re, urllib, datetime, math
import babel.dates
fr... | anandpdoshi/frappe | frappe/utils/data.py | Python | mit | 21,230 | 0.03024 |
import pytest
import os
def test_launch (launch):
serve = '../../atila/example/serve.py'
if not os.path.isfile (serve):
return
with launch (serve) as engine:
for i in range (2):
resp = engine.axios.get ('/apis/rest-api{}'.format (i == 1 and 2 or ''))
assert resp.sta... | hansroh/skitai | tests/level4/test_late_respond.py | Python | mit | 675 | 0.020741 |
# This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | lmacken/moksha | moksha/config/environment.py | Python | apache-2.0 | 779 | 0.002567 |
# -*- coding: utf-8 -*-
import logging
import threading
from midas.compat import HTTPError
from midas.compat import Queue
from midas.crunchbase_company import CompanyList
import midas.scripts
class FetchCrunchbaseCompanies(midas.scripts.MDCommand):
"""
Crawl the companies information from crunchbase.com an... | fuzzy-id/midas | midas/scripts/fetch_crunchbase_companies.py | Python | bsd-3-clause | 2,306 | 0.001301 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_weaponsmith_trainer_02.iff"
result.attribute_template_... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_weaponsmith_trainer_02.py | Python | mit | 455 | 0.046154 |
import ddt
from mock import patch
from nose.tools import raises
from django.db import DatabaseError
from django.test.utils import override_settings
from openassessment.assessment.models import PeerWorkflow, StudentTrainingWorkflow
from openassessment.test_utils import CacheResetTest
import openassessment.workflow.api... | Stanford-Online/edx-ora2 | openassessment/workflow/test/test_api.py | Python | agpl-3.0 | 21,103 | 0.002275 |
patch_size = 1 | KGPML/Hyperspectral | patch_size.py | Python | gpl-3.0 | 14 | 0.071429 |
from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from .views import *
urlpatterns = [
# Listado
url(r'^evaluacion-lista/', login_required(evaluacion_list), name='listar_evaluacion'),
# Evaluacion paso a paso
url(r'^generar/step1/$', login_required(evaluacion_ste... | Mansilla1/Sistema-SEC | apps/evaluacion/urls.py | Python | apache-2.0 | 2,293 | 0.024422 |
## \file
## \ingroup tutorial_tdataframe
## \notebook -nodraw
## This tutorial shows how to express the concept of ranges when working with the TDataFrame.
## \macro_code
##
## \date March 2017
## \author Danilo Piparo
import ROOT
fill_tree_code = '''
void fill_tree(const char *filename, const char *treeName)
{
TF... | bbockelm/root | tutorials/dataframe/tdf006_ranges.py | Python | lgpl-2.1 | 2,283 | 0.004818 |
from __future__ import absolute_import
from django.db import models
from django.test import TestCase
from .models import Author, Book
signal_output = []
def pre_save_test(signal, sender, instance, **kwargs):
signal_output.append('pre_save signal, %s' % instance)
if kwargs.get('raw'):
signal_output.... | LethusTI/supportcenter | vendor/django/tests/regressiontests/signals_regress/tests.py | Python | gpl-3.0 | 3,724 | 0.003222 |
# Copyright © 2019 Red Hat, Inc.
#
# This file is part of Bodhi.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# T... | Conan-Kudo/bodhi | bodhi/tests/server/consumers/test_automatic_updates.py | Python | gpl-2.0 | 18,330 | 0.00131 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | qrohlf/cf-client | lib/cfclient/utils/mux/__init__.py | Python | gpl-2.0 | 7,589 | 0.00448 |
import types
import functools
import unittest
from .agent import Config, Agent
# XXX bring into compliance with python 2.7 unittest api
class AssertRaisesContextManager(object):
def __init__(self, expected):
self.expected = expected
def __enter__(self):
return self
def __exit__(se... | p/webracer | webracer/testcase.py | Python | bsd-2-clause | 4,545 | 0.007261 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ObservationTools documentation build configuration file, created by
# sphinx-quickstart on Sun Apr 30 14:32:48 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in ... | iastro-pt/ObservationTools | docs/source/conf.py | Python | mit | 5,035 | 0.001192 |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("capture", ["capture.pyx"])]
)
| hirolovesbeer/sekiwake | src/setup.py | Python | mit | 223 | 0.017937 |
# -*- coding:utf-8 -*-
"""
# Author: Pegasus Wang (pegasuswang@qq.com, http://ningning.today)
# Created Time : Fri Feb 20 21:38:57 2015
# File Name: wechatService.py
# Description:
# :copyright: (c) 2015 by Pegasus Wang.
# :license: MIT, see LICENSE for more details.
"""
import json
import time
import urllib
import ... | PegasusWang/WeiPython | wechat/wechatService.py | Python | mit | 4,478 | 0.001638 |
from .app import App as _App
class UserApp(_App):
'''
An object based on the relationship between a user and an app. A subclass of :class:`steamfront.app.App`.
This will not contain any of the attributes for :class:`steamfront.app.App` until :meth unlazify: has been called.
Should not be called manua... | 4Kaylum/Steamfront | steamfront/userapp.py | Python | mit | 1,396 | 0.006447 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Julien Veyssier
#
# This file is part of weboob.
#
# weboob 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 License, or
# (at yo... | laurent-george/weboob | modules/cic/browser.py | Python | agpl-3.0 | 8,378 | 0.003703 |
# -*- coding: utf-8 -*-
"""
聚类和EM算法
~~~~~~~~~~~~~~~~
聚类
:copyright: (c) 2016 by the huaxz1986.
:license: lgpl-3.0, see LICENSE for more details.
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_blobs
# from .agglomerative_clustering impor... | huaxz1986/git_book | chapters/Cluster_EM/cluster.py | Python | gpl-3.0 | 3,182 | 0.021348 |
# Copyright 2014 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 ... | CSCI1200Course/csci1200OnlineCourse | modules/dashboard/utils.py | Python | apache-2.0 | 2,730 | 0 |
# -*- coding: utf-8 -*-
def social_blblbl(entity, argument):
return True
#- Fine Funzione -
| Onirik79/aaritmud | src/socials/social_blblbl.py | Python | gpl-2.0 | 97 | 0.010309 |
from __future__ import unicode_literals
import importlib
import os
import sys
from django.apps import apps
from django.utils import datetime_safe, six
from django.utils.six.moves import input
from .loader import MIGRATIONS_MODULE_NAME
class MigrationQuestioner(object):
"""
Gives the autodetector responses ... | domenicosolazzo/practice-django | venv/lib/python2.7/site-packages/django/db/migrations/questioner.py | Python | mit | 6,265 | 0.001915 |
TEST_DEFAULT = 'defvalue'
| scorphus/scrapy | tests/test_settings/default_settings.py | Python | bsd-3-clause | 27 | 0 |
import json
from typing import TYPE_CHECKING, Optional
from boxsdk.util.text_enum import TextEnum
from boxsdk.exception import BoxAPIException
from .base_object import BaseObject
if TYPE_CHECKING:
from boxsdk.object.user import User
from boxsdk.object.terms_of_service_user_status import TermsOfServiceUserStat... | box/box-python-sdk | boxsdk/object/terms_of_service.py | Python | apache-2.0 | 3,849 | 0.002078 |
"""
WSGI config for myproject 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.8/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
from django.co... | Perkville/django-tastypie | docs/code/myproject/wsgi.py | Python | bsd-3-clause | 409 | 0.002445 |
from django.db import models
from django.db.models.signals import post_save
from django.db.utils import DatabaseError
from django.dispatch import receiver
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _, ugettext
STANDARD_EMAIL = "anonymous@readthedocs.org"
class Us... | ojii/readthedocs.org | readthedocs/core/models.py | Python | mit | 1,768 | 0.002828 |
# -*- coding: utf-8 -*-
import pytest
from .utils import last_activity
@pytest.mark.usefixtures('versioning_manager', 'table_creator')
class TestActivityCreationWithColumnExclusion(object):
@pytest.fixture
def audit_trigger_creator(self, session, user_class):
session.execute(
'''SELECT au... | kvesteri/postgresql-audit | tests/test_sql_files.py | Python | bsd-2-clause | 1,919 | 0 |
"""HTTP server classes.
Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see
SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST,
and CGIHTTPRequestHandler for CGI scripts.
It does, however, optionally implement HTTP/1.1 persistent connections,
as of version 0.3.
Notes on CGIHTT... | xyuanmu/XX-Net | python3.8.2/Lib/http/server.py | Python | bsd-2-clause | 47,254 | 0.000614 |
# Copyright (c) 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 or agreed to... | KoreaCloudObjectStorage/swift3 | swift3/subresource.py | Python | apache-2.0 | 16,885 | 0 |
import unittest
from scrapers.journalscrapers import ElsevierScraper
class TestElsevierScraper(unittest.TestCase):
def setUp(self):
self.instance = ElsevierScraper("../data/elsevier/2016-uncleaned.csv")
def test_strip_chars(self):
for row in self.instance.get_entries():
print row... | PatrickSpieker/pricesleuth | tests/TestElsevierScraper.py | Python | mit | 321 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Marcus Müller.
#
# This 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, or (at your option)
# any later version.
#
# This s... | greenoaktree/measurement_toolbox | gr-mtb/python/qa_task_frontend.py | Python | gpl-3.0 | 2,935 | 0.008862 |
# ITERATING DICTIONARY
d = {'x':1, 'y':2, 'z':3}
for key in d:
print key, 'corresponds to', d[key]
| laurey/py | py/iterating.dic.py | Python | gpl-2.0 | 103 | 0.029126 |
#!/usr/bin/python
#
# \file 0_setup.py
# \brief Setup rbank
# \date 2009-03-10-22-43-GMT
# \author Jan Boon (Kaetemi)
# Python port of game data build pipeline.
# Setup rbank
#
# NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
# Copyright (C) 2010 Winch Gate Property Limited
#
# This program is free soft... | osgcc/ryzom | nel/tools/build_gamedata/processes/rbank/0_setup.py | Python | agpl-3.0 | 2,998 | 0.004336 |
from jupyter_workflow.data import get_fremont_data
import pandas as pd
def test_fremont_data():
data = get_fremont_data()
assert all(data.columns == ['West','East','Total'])
assert isinstance(data.index,pd.DatetimeIndex)
| irenalanc/JupyterPythonPals | jupyter_workflow/tests/test_data.py | Python | mit | 234 | 0.021368 |
# -*- coding: utf-8 -*-
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db import migrations
def clear_message_sent_by_message_type_values(apps, schema_editor):
# type: (StateApps, DatabaseSchemaEditor) -> None
UserCoun... | christi3k/zulip | analytics/migrations/0010_clear_messages_sent_values.py | Python | apache-2.0 | 1,174 | 0.001704 |
class Config:
STREAMING_JOB_NAME = "streaming.job.name"
STREAMING_OP_NAME = "streaming.op_name"
TASK_JOB_ID = "streaming.task_job_id"
STREAMING_WORKER_NAME = "streaming.worker_name"
# channel
CHANNEL_TYPE = "channel_type"
MEMORY_CHANNEL = "memory_channel"
NATIVE_CHANNEL = "native_channel... | stephanie-wang/ray | streaming/python/config.py | Python | apache-2.0 | 859 | 0 |
# """All things dealing strictly with the GUI."""
##
# Copyright 2013 Chad Spratt
# 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
#
... | chadspratt/AveryDB | gui.py | Python | apache-2.0 | 16,903 | 0.000592 |
#!/usr/bin/env python
import logging # http://docs.python.org/2/howto/logging.html#logging-basic-tutorial
import pysftp # https://code.google.com/p/pysftp/
from configobj import ConfigObj # http://www.voidspace.org.uk/python/configobj.html
import os
import sys
import time
import curses
import Image
import ImageTk
impo... | jvilaplana/PiMotionGallery | pmg.py | Python | gpl-3.0 | 8,027 | 0.007849 |
import praw
import urllib.request
import json
import requests
import requests.auth
import os.path
import re
from imgurpython import ImgurClient
from bs4 import BeautifulSoup
imgur_gif_regex = re.compile("https?:\/\/i\.imgur\.com\/[a-z0-9]+.gif")
def gyazo_link_parser(link):
"""
Parses Gyazo links into their ... | arrivance/gyazo-to-imgur | src/utility.py | Python | mit | 3,148 | 0.014295 |
from L500analysis.derived_fields.derived_fields import *
from L500analysis.derived_fields.derived_field_functions import *
from L500analysis.derived_fields.collections.peak_height.derived_field_functions \
import *
from L500analysis.derived_fields.derived_field_tools.non_thermal_temperature \
import calculate_T... | cavestruz/L500analysis | derived_fields/collections/temperature/derived_field_functions.py | Python | mit | 5,126 | 0.013461 |
import os.path
import gwt
from ...weights import W
from warnings import warn
__author__ = "Myunghwa Hwang <mhwang4@gmail.com>"
__all__ = ["DatIO"]
class DatIO(gwt.GwtIO):
"""
Opens, reads, and writes file objects in DAT format.
Spatial weights objects in DAT format are used in
Dr. LeSage's MatLab Ec... | sjsrey/pysal_core | pysal_core/io/IOHandlers/dat.py | Python | bsd-3-clause | 3,059 | 0.000327 |
#encoding:utf-8
__authors__ = ['"Wei Keke" <keke.wei@cs2c.com.cn>']
__version__ = "V0.1"
'''
# ChangeLog:
#---------------------------------------------------------------------------------
# Version Date Desc Author
#----------------------------------------------------... | faylau/oVirt3.3WebAPITest | src/TestData/Template/ITC070202_GetTemplateDiskInfo.py | Python | apache-2.0 | 1,439 | 0.004892 |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | onshape-public/onshape-clients | python/onshape_client/oas/models/callback.py | Python | mit | 4,774 | 0 |
#
# This is minimal MicroPython variant of run-tests script, which uses
# .exp files as generated by run-tests --write-exp. It is useful to run
# testsuite on systems which have neither CPython3 nor unix shell.
# This script is intended to be run by the same interpreter executable
# which is to be tested, so should use... | infinnovation/micropython | tests/run-tests-exp.py | Python | mit | 2,697 | 0.002225 |
from django.contrib import admin
from Weather.models import *
from Weather.util import updateForecast
def update_forecast(modeladmin, request, queryset):
for forecast in queryset:
updateForecast(forecast)
update_forecast.short_description = "Force forecast update from NWS"
class forecastAdmin(admin.Mod... | sschultz/FHSU-GSCI-Weather | Weather/admin.py | Python | mit | 524 | 0.003817 |
"""
Settings for reputation changes that apply to
user in response to various actions by the same
users or others
"""
from askbot.conf.settings_wrapper import settings
from askbot.conf.super_groups import REP_AND_BADGES
from askbot.deps.livesettings import ConfigurationGroup, IntegerValue
from django.utils.translation... | stianrh/askbot-nordic | askbot/conf/badges.py | Python | gpl-3.0 | 5,005 | 0.002198 |
from python_kemptech_api import *
# Specify the LoadMaster connection credentials here:
loadmaster_ip = ""
username = ""
password = ""
vs_ip_1 = ""
vs_ip_2 = ""
rs_ip_1 = ""
rs_ip_2 = ""
vs_port = ""
rs_port = ""
class RealServerPool(object):
healthcheck_parameters = [
"checktype",
"checkport",
... | KEMPtechnologies/python-kemptech-api | examples/real_server_pooling.py | Python | apache-2.0 | 4,377 | 0.000914 |
#
# Copyright (C) 2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | atodorov/anaconda | tests/nosetests/pyanaconda_tests/module_disk_select_test.py | Python | gpl-2.0 | 5,967 | 0.00067 |
import json
import os
#This helper class allows to access members of the configuration
#as c.attr1.attr2.attr3 instead of c[attr1][attr2][attr3]
class DictToAttr( object ):
def __init__( self, dictionary ):
self.dict = dict( dictionary )
def __getattr__(self, attr):
... | giacomov/pyggop | pyggop/config/Configuration.py | Python | mit | 2,359 | 0.038152 |
# LICENSE: GPLv2, see attached License
# Author: Joerg Jungermann
def get_mac():
from network import WLAN
from ubinascii import hexlify
return hexlify(WLAN().config('mac'),'-').decode()
def sleep(sec, deepsleep = False):
import time
if deepsleep:
import machine
rtc = machine.RTC()
... | j0ju/iot-carbon-esp | modules/iotesp.py | Python | gpl-2.0 | 651 | 0.006144 |
###############################################################################
# Name: nsistags.py #
# Purpose: Generate Tags for Nullsoft Installer Scripts #
# Author: Cody Precord <cprecord@editra.org> #
... | garrettcap/Bulletproof-Backup | wx/tools/Editra/plugins/codebrowser/codebrowser/gentag/nsistags.py | Python | gpl-2.0 | 3,752 | 0.001866 |
from collections import defaultdict
from itertools import chain
from operator import itemgetter
import re
from django.core.serializers.json import DjangoJSONEncoder
from django.db import connection
from django.db.models import Count, Max, F
from django.db.models.query import QuerySet
from django.contrib.auth.models im... | archlinux/archweb | packages/utils.py | Python | gpl-2.0 | 16,261 | 0.000553 |
from sys import version_info
from functools import reduce
from operator import mul
from flask_babel import gettext
if version_info[0] == 3:
unicode = str
keywords = ('min',
'max',
'avg',
'sum',
'prod')
# required answerer function
# can return a list of results (... | asciimoo/searx | searx/answerers/statistics/answerer.py | Python | agpl-3.0 | 1,243 | 0.001609 |
# Rekall Memory Forensics
# Copyright (C) 2007,2008 Volatile Systems
# Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org>
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | rainaashutosh/MyTestRekall | rekall-core/rekall/plugins/windows/gui/windowstations.py | Python | gpl-2.0 | 5,615 | 0.000534 |
# Authors: Eric Larson <larson.eric.d@gmail.com>
# Sheraz Khan <sheraz@khansheraz.com>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from ..filter import next_fast_len
from ..source_estimate import _BaseSourceEstimate
from ..utils import verbose, _check_c... | Eric89GXL/mne-python | mne/connectivity/envelope.py | Python | bsd-3-clause | 6,631 | 0 |
from pattern import Pattern
import itertools
import random
import colorsys
import time
class EqPattern(Pattern):
def __init__(self, meter_color=(255,100,50), background_color=(0,50,255)):
self.meter_r = meter_color[0]
self.meter_g = meter_color[1]
self.meter_b = meter_color[2]
self... | TheGentlemanOctopus/thegentlemanoctopus | octopus_code/core/octopus/patterns/eqPattern.py | Python | gpl-3.0 | 2,854 | 0.004905 |
def get_avatar(backend, strategy, details, response, user=None, *args, **kwargs):
url = None
if backend.name == 'facebook':
url = "http://graph.facebook.com/%s/picture?type=small"%response['id']
if url:
user.avatar = url
user.save()
| AlexandroPQC/sara-ani | Saranani/apps/users/pipelines.py | Python | gpl-3.0 | 270 | 0.007407 |
from couchdbkit import ResourceNotFound
from toggle.models import Toggle
from toggle.shortcuts import update_toggle_cache, parse_toggle
def move_toggles(from_toggle_id, to_toggle_id):
"""
Moves all enabled items from one toggle to another.
"""
try:
from_toggle = Toggle.get(from_toggle_id)
... | qedsoftware/commcare-hq | corehq/apps/toggle_ui/migration_helpers.py | Python | bsd-3-clause | 868 | 0 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Szymon Biliński
#
# 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
#
# Un... | sbilinski/coffea | coffea/java/tests/test_java_scanner.py | Python | apache-2.0 | 8,818 | 0.0093 |
# Copyright (c) 2018 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 app... | luotao1/Paddle | python/paddle/fluid/tests/unittests/test_math_op_patch_var_base.py | Python | apache-2.0 | 24,962 | 0.0002 |
# 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 the... | swiftstack/kinetic-swift | test_kinetic_swift/test_diskfile.py | Python | apache-2.0 | 13,975 | 0 |
from PythonQt import QtGui, QtCore
from uic.uiparser import UIParser
from uic.Loader.qobjectcreator import LoaderCreatorPolicy
class DynamicUILoader(UIParser):
def __init__(self):
UIParser.__init__(self, QtCore, QtGui, LoaderCreatorPolicy())
def createToplevelWidget(self, classname, widgetname):
... | ximion/Clementine-LibDanceTag | data/pythonlibs/uic/Loader/loader.py | Python | gpl-3.0 | 849 | 0.004711 |
#!/usr/bin/env python
#
# Bzip2
#
# Bzip2 packages and versions
#
# Author P G Jones - 2014-08-15 <p.g.jones@qmul.ac.uk> : New file.
####################################################################################################
import nusoft.package.conditional as conditional_package
import os
class Bzip2(condit... | pgjones/nusoft | packages/nusoft/bzip2.py | Python | mit | 2,422 | 0.009083 |
#!/usr/bin/python
import feedparser
import wget
import sqlite3
import time
RssUrlList = ['http://postitforward.tumblr.com/rss','http://for-war3-blog-blog.tumblr.com/rss']
sleep=3600/len(RssUrlList)
def mkdir(path):
import os
path=path.strip()
path=path.rstrip("\\")
isExists=os.path.exists(path)
... | yanyuechuixue/tumblr2onedriver | Main.py | Python | gpl-3.0 | 2,513 | 0.018305 |
import requests
import json
import sqlite3
import time
#searching the api key of velib
key_file = open('jcdecaux.key','r')
api_key = key_file.readline().rstrip('\n')
key_file.close()
startime = time.time()
url = 'https://api.jcdecaux.com/vls/v1/stations?contract=Paris&apiKey=' + api_key
response = requests.get(url... | Gokender/velib | dataParsing.py | Python | mit | 1,135 | 0.009692 |
import pytest
from proposals.models import AdditionalSpeaker, TalkProposal, TutorialProposal
@pytest.fixture
def talk_proposal(user):
proposal = TalkProposal.objects.create(
id=42,
submitter=user,
title='Beyond the Style Guides<br>',
)
return proposal
@pytest.fixture
def cancell... | uranusjr/pycontw2016 | src/proposals/tests/conftest.py | Python | mit | 1,232 | 0 |
#!/usr/bin/env python
"""Execute the tests for the samcat program.
The golden test outputs are generated by the script generate_outputs.sh.
You have to give the root paths to the source and the binaries as arguments to
the program. These are the paths to the directory that contains the 'projects'
directory.
Usage: ... | rrahn/gdf_tools | include/seqan/apps/samcat/tests/run_tests.py | Python | gpl-3.0 | 3,112 | 0.001285 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | maoy/zknova | nova/image/s3.py | Python | apache-2.0 | 16,517 | 0.000848 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.6.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x06\x92\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x64\x0... | President3D/Quality-SPC | src/InResources_rc.py | Python | gpl-3.0 | 124,824 | 0.00004 |
#
# Copyright 2011 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | edwardbadboy/vdsm-ubuntu | vdsm/supervdsm.py | Python | gpl-2.0 | 3,064 | 0.000326 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of kryptomime, a Python module for email kryptography.
# Copyright © 2013,2014 Thomas Tanner <tanner@gmx.net>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published ... | ttanner/kryptomime | setup.py | Python | lgpl-3.0 | 3,207 | 0.005926 |
# coding:utf-8
'''
8b d8 88
Y8, ,8P ,d 88
Y8, ,8P 88 88
"8aa8" ,adPPYba, 88 88 MM88MMM 88,dPPYba,
`88' a8" "8a 88 88 88 88P' "8a
88 8b d8 88 88 88 88 88
88 "8... | YouthBread/CEVE-KB | kb.py | Python | gpl-2.0 | 26,992 | 0.000664 |
#!/usr/bin/true
#
# download.py - part of autospec
# Copyright (C) 2018 Intel Corporation
#
# 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)... | clearlinux/autospec | autospec/download.py | Python | gpl-3.0 | 2,543 | 0 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
from autopilot.matchers import Eventually
from testtools.matchers import Equals
from bmicalc import tests
class MainViewTestCase(tests.BaseTestCase):
"""Tests for the mainview"""
def setUp(self):
super(MainViewTestCase, self)... | avi-software/bmicalc | app/tests/autopilot/weightcalc/tests/test_main.py | Python | gpl-3.0 | 671 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.