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 |
|---|---|---|---|---|---|---|
'''
NetNS, network namespaces support
=================================
Pyroute2 provides basic network namespaces support. The core
class is `NetNS`.
Please be aware, that in order to run system calls the library
uses `ctypes` module. It can fail on platforms where SELinux
is enforced. If the Python interpreter, loa... | alexliyu/CDMSYSTEM | pyroute2/netns/nslink.py | Python | mit | 10,211 | 0 |
#!/usr/bin/env python3
# A simple script that connects to a server and displays block headers
import time
import asyncio
from electrum.network import Network
from electrum.util import print_msg, json_encode, create_and_start_event_loop, log_exceptions
# start network
loop, stopping_fut, loop_thread = create_and_sta... | neocogent/electrum | electrum/scripts/block_headers.py | Python | mit | 955 | 0.003141 |
# imports from python libraries
import os
import hashlib
import datetime
import json
from itertools import chain # Using from_iterable()
# imports from installed packages
from django.contrib.auth.models import User
from django.db import models
from django_mongokit import connection
from django_mongokit import get_d... | supriyasawant/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/models.py | Python | agpl-3.0 | 72,774 | 0.007379 |
# Copyright 2012 NEC Corporation. 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 ... | virtualopensystems/neutron | neutron/tests/unit/nec/test_db.py | Python | apache-2.0 | 7,264 | 0 |
# -*- coding: utf-8 -*-
r"""
.. _SoftiMAX:
SoftiMAX at MAX IV
------------------
The images below are produced by scripts in
``\examples\withRaycing\14_SoftiMAX``.
The beamline will have two branches:
- STXM (Scanning Transmission X-ray Microscopy) and
- CXI (Coherent X-ray Imaging),
see the scheme provided by K. T... | kklmn/xrt | examples/withRaycing/14_SoftiMAX/__init__.py | Python | mit | 16,930 | 0.002662 |
# -*- coding: utf-8 -*-
import requests
from datetime import datetime
from fplassist.models import Team_Info, Player_Info, Player_Basic_Stats, Player_Detailed_Stats, FPL_Config
def get_data(api_url):
api_response = requests.get(api_url)
try:
api_response.raise_for_status()
api_data = api_respon... | mdameenh/elysia | fplassist/update_database.py | Python | bsd-3-clause | 10,609 | 0.010651 |
# -*- coding: utf-8 -*-
#
# RADICAL-Pilot documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 3 21:55:42 2012.
#
# 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 file.
#... | JensTimmerman/radical.pilot | docs/source/conf.py | Python | mit | 12,807 | 0.006637 |
import _plotly_utils.basevalidators
class CliponaxisValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="cliponaxis", parent_name="funnel", **kwargs):
super(CliponaxisValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/funnel/_cliponaxis.py | Python | mit | 450 | 0.002222 |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## Copyright (C) 6WIND <olivier.matz@6wind.com>
## This program is published under a GPLv2 license
"""
SCTP (Stream Control Transmission Protocol).
"""
import struct
from... | mytliulei/Scapy | scapy/layers/sctp.py | Python | apache-2.0 | 17,954 | 0.011474 |
"""Module to debug python programs"""
import sys
import traceback
def getAllStacks():
code = []
for threadId, stack in sys._current_frames().iteritems():
code.append("\n# ThreadID: %s" % threadId)
for filename, lineno, name, line in traceback.extract_stack(stack):
code.append('File... | netixx/python-tools | tools/debugger.py | Python | apache-2.0 | 674 | 0.004451 |
from panda3d.core import TrueClock
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.showbase.PythonUtil import (
StdoutCapture, _installProfileCustomFuncs,_removeProfileCustomFuncs,
_getProfileResultFileInfo, _setProfileResultsFileInfo)
import __builtin__
import profile
import pstats
... | mgracer48/panda3d | direct/src/showbase/ProfileSession.py | Python | bsd-3-clause | 12,549 | 0.002789 |
'''
Mac OS X file chooser
---------------------
'''
from plyer.facades import FileChooser
from pyobjus import autoclass, objc_arr, objc_str
from pyobjus.dylib_manager import load_framework, INCLUDE
load_framework(INCLUDE.AppKit)
NSURL = autoclass('NSURL')
NSOpenPanel = autoclass('NSOpenPanel')
NSSavePanel = autoclass... | KeyWeeUsr/plyer | plyer/platforms/macosx/filechooser.py | Python | mit | 3,427 | 0 |
#!/usr/bin/python
################################################################################
##3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
## 10 20 30 40 50 60 70 80
##
## Info:
## Example of how to use libnotify correctl... | dkasak/notify-osd-customizable | examples/summary-body.py | Python | gpl-3.0 | 3,917 | 0.032678 |
# OpenSCAD gui init module
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *... | sanguinariojoe/FreeCAD | src/Mod/OpenSCAD/InitGui.py | Python | lgpl-2.1 | 5,293 | 0.013603 |
__all__ = [
'diff', 'dirs', 'flushfile', 'id',
'stats', 'sync'
]
| bkahlert/seqan-research | raw/workshop11/workshop2011-data-20110925/trunk/misc/seqan_instrumentation/py2exe/dist/classes/__init__.py | Python | mit | 81 | 0 |
# Copyright 2019 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, ... | google/struct2tensor | struct2tensor/prensor_value.py | Python | apache-2.0 | 9,379 | 0.00853 |
'''
Copyleft Oct 24, 2015 Arya Iranmehr, PhD Student, Bafna's Lab, UC San Diego, Email: airanmehr@gmail.com
'''
import pandas as pd
import pylab as plt
import matplotlib as mpl
from matplotlib.cm import *
import os,sys;home=os.path.expanduser('~') +'/'
mpl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern']... | airanmehr/bio | Scripts/TimeSeriesPaper/Plot/DirectvsRNN.py | Python | mit | 1,198 | 0.040902 |
from __future__ import print_function
###################################################################
# Copyright 2013-2017 All Rights Reserved
# Authors: The Paradrop Team
###################################################################
import sys
from paradrop.base import settings
from paradrop.lib.utils.pd_... | ParadropLabs/Paradrop | paradrop/daemon/paradrop/core/chute/chute_storage.py | Python | apache-2.0 | 3,342 | 0.001795 |
# Copyright 2014 Kylincloud
#
# 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 ... | xuweiliang/Codelibrary | openstack_dashboard/dashboards/admin/networks/agents/tables.py | Python | apache-2.0 | 3,868 | 0.001551 |
#!/usr/bin/env python
# encoding: utf-8
"""
Detuned waveguide bank.
"""
from pyo import *
import random
s = Server(sr=44100, nchnls=2, buffersize=512, duplex=0).boot()
src = SfPlayer("../snds/ounkmaster.aif", loop=True, mul=.1)
lf = Sine(freq=[random.uniform(.005, .015) for i in range(8)],
mul=[.02,.04,.0... | xyproto/gosignal | pyo/examples/effects/03_detuned_waveguides.py | Python | gpl-3.0 | 513 | 0.02729 |
from __future__ import unicode_literals, division, absolute_import
from urlparse import urlparse
import logging
from requests import RequestException
from flexget import plugin
from flexget.event import event
from flexget.entry import Entry
log = logging.getLogger('sonarr')
class Sonarr(object):
schema = {
... | xfouloux/Flexget | flexget/plugins/input/sonarr.py | Python | mit | 5,907 | 0.00237 |
from __future__ import print_function
import numpy
import time
import traceback
import colorsys
import random
class EffectLayer(object):
"""Abstract base class for one layer of an LED light effect. Layers operate on a shared framebuffer,
adding their own contribution to the buffer and possibly blending or o... | chillpop/RELAX-HARDER | effects/base.py | Python | mit | 10,042 | 0.004979 |
#!/usr/bin/python3
#
# Copyright (c) 2020 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import time
import subprocess
import mmap
# Log reader for the trace output buffer on a ADSP device.
#
# When run with no arguments, it will detect the device, dump the
# contents of the trace buffer... | nashif/zephyr | boards/xtensa/intel_adsp_cavs15/tools/adsplog.py | Python | apache-2.0 | 8,018 | 0.000499 |
from django.conf import settings
from django.contrib.auth import logout
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from django.views.generic.base import View, TemplateView
from socialregistration.clients.oauth import ... | vinco/django-socialregistration | socialregistration/views.py | Python | mit | 10,506 | 0.006663 |
from django.contrib import admin
from locker.models import Gif
class GifAdmin(admin.ModelAdmin):
pass
admin.site.register(Gif, GifAdmin)
| tiradoe/Giflocker | giflocker/locker/admin.py | Python | lgpl-3.0 | 143 | 0.013986 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.education.api import get_grade
# test_records = frappe.get_test_records('Assessment Result')
class TestAssessmentResult(uni... | indictranstech/erpnext | erpnext/education/doctype/assessment_result/test_assessment_result.py | Python | agpl-3.0 | 521 | 0.017274 |
# http://stats.stackexchange.com/questions/28904/how-to-cluster-lda-lsi-topics-generated-by-gensim
# coding:utf-8
import cPickle as pickle
import glob
import logging
import os
import scipy
import scipy.sparse
import string
import sys
import time
from collections import defaultdict
import gensim.matutils
import gensim... | mikedelong/aarhus | demos/clusters_from_topics.py | Python | apache-2.0 | 9,957 | 0.002913 |
"""
pygments.styles.abap
~~~~~~~~~~~~~~~~~~~~
ABAP workbench like style.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, ... | sonntagsgesicht/regtest | .aux/venv/lib/python3.9/site-packages/pygments/styles/abap.py | Python | apache-2.0 | 727 | 0 |
import matplotlib as mpl
#mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
from scipy.constants import c
import h5py
import sys
import warnings
warnings.simplefilter("ignore", UserWarning)
font = {'size': 18}
mpl.rc('font', **font)
def w2dbm(W, floor=-100):
"""This function converts a ... | ibegleris/Single-mode-FOPO | src/data_plotters_animators.py | Python | bsd-3-clause | 10,230 | 0.006549 |
# -*- coding: utf-8 -*-
# Scrapy settings for spider project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'spider'
SPIDER_MODULES = ['spider.spiders']
NEWSPID... | sanxiatianma/spider | src/spider/settings.py | Python | apache-2.0 | 483 | 0.004141 |
"""Copyright 2016 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 agreed to in ... | google/cloudprint_logocert | _log.py | Python | apache-2.0 | 3,118 | 0.003849 |
# -*- coding: utf-8 -*-
from contextlib import contextmanager
import pytest
from django.contrib.auth.models import AnonymousUser
from django.test.client import RequestFactory
from shuup.apps.provides import override_provides
from shuup.utils.excs import Problem
from shuup.xtheme import XTHEME_GLOBAL_VIEW_NAME
from sh... | hrayr-artunyan/shuup | shuup_tests/xtheme/test_editor_view.py | Python | agpl-3.0 | 6,457 | 0.002168 |
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Canonical
#
# Authors:
# Didier Roche <didrocks@ubuntu.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 the Free Software
# Foundation; version 3.
#
# This program is distrib... | yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/oneconf/paths.py | Python | mit | 3,861 | 0.000518 |
"""SCons.Tool.tar
Tool-specific initialization for tar.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of charge, to... | Uli1/mapnik | scons/scons-local-2.4.0/SCons/Tool/tar.py | Python | lgpl-2.1 | 2,503 | 0.006392 |
from Task import Task
import os.path
import yaml
import botocore
import name_constructor
import time
import sys
class DynamoTable(Task):
"""Create or remove a table by yaml definition file"""
known_params = {
'name': 'name of the table to be created or removed',
'source': 'full name of the file with the de... | Travelport-Czech/apila | tasks/DynamoTable.py | Python | mit | 6,621 | 0.014197 |
from nose.tools import eq_
from douglas.tests import PluginTest
from douglas.plugins import yeararchives
class Test_yeararchives(PluginTest):
def setUp(self):
PluginTest.setUp(self, yeararchives)
def tearDown(self):
PluginTest.tearDown(self)
def test_parse_path_info(self):
testd... | willkg/douglas | douglas/tests/test_yeararchives.py | Python | mit | 668 | 0 |
from datetime import datetime
from xmodule.modulestore import Location, namedtuple_to_son
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.inheritance import own_metadata
from xmodule.exceptions import InvalidVersionError
from xmodule.modulestore.mongo.base import MongoModuleStore
... | IITBinterns13/edx-platform-dev | common/lib/xmodule/xmodule/modulestore/mongo/draft.py | Python | agpl-3.0 | 9,889 | 0.002225 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | nortikin/sverchok | nodes/list_struct/shuffle.py | Python | gpl-3.0 | 3,555 | 0.001125 |
"""
core/api/serializers.py is the module for core model api data serializers
"""
#import core django module
from django.contrib.auth.models import User, Permission
#import external modules
from rest_framework import serializers
#import project modules
from core.models import (Product, ProductCategory, UnitOfMea... | eHealthAfrica/LMIS | LMIS/core/api/serializers.py | Python | gpl-2.0 | 3,856 | 0.001815 |
import http.client
from github3 import GitHubError
import github3.exceptions
from cumulusci.core.exceptions import GithubApiNotFoundError
from cumulusci.core.utils import process_bool_arg
from cumulusci.tasks.github.base import BaseGithubTask
class MergeBranch(BaseGithubTask):
task_docs = """
Merges the mos... | SalesforceFoundation/CumulusCI | cumulusci/tasks/github/merge.py | Python | bsd-3-clause | 11,772 | 0.003058 |
# This file is part of FNPDjango, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See README.md for more information.
#
from django.conf import settings
from django.test import TestCase
class UtilsSettingsTestCase(TestCase):
def test_lazy_ugettext_lazy(self):
self.asser... | fnp/fnpdjango | tests/tests/test_utils_settings.py | Python | agpl-3.0 | 398 | 0.005038 |
#!/usr/bin/env python3
# Copyright 2022 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... | chronicle/api-samples-python | feeds/create_azure_ad_context_feed.py | Python | apache-2.0 | 4,356 | 0.008494 |
#
# 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... | openstack/cloudkitty | cloudkitty/db/sqlalchemy/alembic/versions/464e951dc3b8_initial_migration.py | Python | apache-2.0 | 1,314 | 0 |
import pytest
from pontoon.test import factories
@pytest.fixture
def admin():
"""Admin - a superuser"""
return factories.UserFactory.create(username="admin", is_superuser=True,)
@pytest.fixture
def client_superuser(client, admin):
"""Provides a client with a logged in superuser. """
client.force_lo... | jotes/pontoon | pontoon/test/fixtures/base.py | Python | bsd-3-clause | 3,576 | 0.000559 |
import copy
from ereuse_devicehub.resources.device.schema import Device
from ereuse_devicehub.resources.device.settings import DeviceSubSettings
class Mobile(Device):
imei = {
'type': 'string',
'unique': True
}
meid = {
'type': 'string',
'unique': True
}
type = {
... | eReuse/DeviceHub | ereuse_devicehub/resources/device/mobile/settings.py | Python | agpl-3.0 | 722 | 0 |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# 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... | badock/nova | nova/db/discovery/api.py | Python | apache-2.0 | 232,570 | 0.001303 |
"""LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
import cStringIO as StringIO
import struct
import header
class piemos_field_cmd(object):
__slots__ = ["header", "isFlash", "isStart", "isLeft", "rfid_uid"]
def __init__(self):
self.header = None
s... | pioneers/topgear | python/forseti2/piemos_field_cmd.py | Python | apache-2.0 | 2,272 | 0.007042 |
#!/usr/bin/env python
from constants import CARTESIAN_COORDS
import colorsys
import sys
class Pattern(object):
center_x, center_y = 0, 0
i = 0
def next_frame(self):
self.i += 1
def get_color(self, x, y):
d = (x ** 2 + y ** 2) ** 0.5
d *= 0.1 # scale the bands
d -= 0.02... | godlygeek/LightRender | simple_rainbow.py | Python | mit | 807 | 0.006196 |
"""SCons.Script.SConscript
This module defines the Python API provided to SConscript and SConstruct
files.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), ... | Uli1/mapnik | scons/scons-local-2.4.0/SCons/Script/SConscript.py | Python | lgpl-2.1 | 24,468 | 0.002738 |
import os
import re
import cx_Oracle
import collections
import datetime
earContentionCode = [2200,2210,2220,3140,3150,4130,4210,4700,4920,5000,5010,5710,6850]
#Primary query, Look for all claims/contentions where the participant has at least one contention with an ear-related contention code.
#Organize them based fir... | VHAINNOVATIONS/BCDS | Model/scripts/ear_validation/python/aggregateContention.py | Python | apache-2.0 | 9,448 | 0.037786 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Explode.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*******************************... | slarosa/QGIS | python/plugins/sextante/algs/Explode.py | Python | gpl-2.0 | 3,641 | 0.006042 |
"""
Settings for Appsembler on CMS in Production.
"""
import sentry_sdk
from openedx.core.djangoapps.appsembler.settings.settings import production_common
def plugin_settings(settings):
"""
Appsembler CMS overrides for both production AND devstack.
Make sure those are compatible for devstack via defens... | appsembler/edx-platform | openedx/core/djangoapps/appsembler/settings/settings/production_cms.py | Python | agpl-3.0 | 1,171 | 0.003416 |
from test import support
from test.support import bigaddrspacetest, MAX_Py_ssize_t
import unittest
import operator
import sys
class StrTest(unittest.TestCase):
@bigaddrspacetest
def test_concat(self):
s1 = 'x' * MAX_Py_ssize_t
self.assertRaises(OverflowError, operator.add, s1, '?')
@big... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/test/test_bigaddrspace.py | Python | mit | 1,284 | 0.003894 |
#Copyright (c) 2011-2012 Litle & Co.
#
#Permission is hereby granted, free of charge, to any person
#obtaining a copy of this software and associated documentation
#files (the "Software"), to deal in the Software without
#restriction, including without limitation the rights to use,
#copy, modify, merge, publish, distri... | Rediker-Software/litle-sdk-for-python | litleSdkPythonTest/functional/TestAuth.py | Python | mit | 7,012 | 0.011266 |
import unittest
from probe import SearchApi, CompanyApi
class TestProbeAPI(unittest.TestCase):
def test_search_company_loanzen(self):
api = SearchApi()
companies = api.companies_get('1.1', filters='{"nameStartsWith": "loanzen"}')
#print type(companies.data), companies.data.companies
... | loanzen/probe-py | probe/tests.py | Python | mit | 1,727 | 0.006369 |
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**GUI Keywords Dialog.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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; ei... | ingenieroariel/inasafe | safe_qgis/keywords_dialog.py | Python | gpl-3.0 | 24,200 | 0.000579 |
#------------------------------------------------------------------------------
# Copyright (c) 2007, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD license.
# However, when used with the GPL version of PyQt the additional terms described in ... | geggo/pyface | pyface/ui/qt4/python_editor.py | Python | bsd-3-clause | 6,248 | 0.004001 |
# -*- coding: utf-8 -*-
###############################################################################
#
# UpdateWalk
# Updates an existing walk action.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exc... | jordanemedlock/psychtruths | temboo/core/Library/Facebook/Actions/Fitness/Walks/UpdateWalk.py | Python | apache-2.0 | 4,891 | 0.005316 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 12, transform = "Quantization", sigma = 0.0, exog_count = 0, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Quantization/trend_PolyTrend/cycle_12/ar_12/test_artificial_32_Quantization_PolyTrend_12_12_0.py | Python | bsd-3-clause | 267 | 0.086142 |
# encoding: utf-8
"""Tests for traitlets.traitlets."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
#
# Adapted from enthought.traits, Copyright (c) Enthought, Inc.,
# also under the terms of the Modified BSD License.
import pickle
import re
import sys
from ._w... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/traitlets/tests/test_traitlets.py | Python | bsd-2-clause | 66,467 | 0.005793 |
import os
import functools
import codecs
import pickle
from . import utils
class Memozo(object):
def __init__(self, path='./'):
self.base_path = path
memozo_file = os.path.join(self.base_path, utils.MEMOZO_FILE_NAME)
if not os.path.exists(memozo_file):
with codecs.open(memoz... | sotetsuk/memozo | memozo/memozo.py | Python | mit | 5,664 | 0.002119 |
from .evaluate import Evaluator
from .dataset import GraphPropPredDataset
try:
from .dataset_pyg import PygGraphPropPredDataset
except ImportError:
pass
try:
from .dataset_dgl import DglGraphPropPredDataset
from .dataset_dgl import collate_dgl
except (ImportError, OSError):
pass
| snap-stanford/ogb | ogb/graphproppred/__init__.py | Python | mit | 302 | 0 |
# -*- encoding: utf-8 -*-
import csv
from allauth.socialaccount.models import SocialToken
from django.core.management.base import BaseCommand
from apps.filters.filter import get_api
import os
from django.conf import settings
from yaml import load
from apps.filters.models import Collection, Entry, Category
class Co... | WarmongeR1/feedly-filter | apps/filters/management/commands/load_data.py | Python | mit | 1,534 | 0.001304 |
#-----------------------------------------------------------------
# pycparser: cdecl.py
#
# Example of the CDECL tool using pycparser. CDECL "explains" C type
# declarations in plain English.
#
# The AST generated by pycparser from the given declaration is traversed
# recursively to build the explanation. Note that th... | CtheSky/pycparser | examples/cdecl.py | Python | bsd-3-clause | 6,339 | 0.001893 |
# Copyright (C) 2011, 2012 Abhijit Mahabal
#
# 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 is distribu... | amahabal/PySeqsee | farg/core/exceptions.py | Python | gpl-3.0 | 2,834 | 0.008116 |
# 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... | openstack/smaug | karbor/services/operationengine/engine/triggers/timetrigger/__init__.py | Python | apache-2.0 | 1,625 | 0 |
"""Module will classes related to PV row geometries"""
import numpy as np
from pvfactors.config import COLOR_DIC
from pvfactors.geometry.base import \
BaseSide, _coords_from_center_tilt_length, PVSegment
from shapely.geometry import GeometryCollection, LineString
from pvfactors.geometry.timeseries import \
TsS... | SunPower/pvfactors | pvfactors/geometry/pvrow.py | Python | bsd-3-clause | 31,109 | 0 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | manasapte/pants | tests/python/pants_test/backend/jvm/tasks/jvm_binary_task_test_base.py | Python | apache-2.0 | 3,154 | 0.006658 |
"""Graphical example illustrating improvement of convergence of KMeans
when cluster centers are initialized by KMeans++ algorithm.
In this example, 4 vertices of a rectangle are chosen: (0,0) (0,100) (10,0) (10,100).
There are 500 points normally distributed about each vertex.
Therefore, the ideal cluster centers f... | abhiatgithub/shogun-toolbox | examples/undocumented/python_modular/graphical/cluster_kpp.py | Python | gpl-3.0 | 1,891 | 0.050238 |
from __main__ import settings
import logging
import datetime
import os
from pythonjsonlogger import jsonlogger
# if we wanna log disnake stuff https://docs.disnake.dev/en/latest/logging.html?highlight=logger
# we can also get the root logger, which will give us a ton of info for all the libraries we have
if not os.pa... | mdiller/MangoByte | cogs/utils/logger.py | Python | mit | 962 | 0.025988 |
# Copyright: 2013, Grigoriy Petukhov
# Author: Grigoriy Petukhov (http://lorien.name)
# License: BSD
from __future__ import absolute_import
#import email
import logging
#import urllib
#try:
#from cStringIO import StringIO
#except ImportError:
#from io import BytesIO as StringIO
#import threading
import random
#... | boooka/GeoPowerOff | venv/lib/python2.7/site-packages/grab/transport/kit.py | Python | apache-2.0 | 4,620 | 0.009307 |
__version__ = '0.1.0'
__description__ = 'Gantt charts!'
| thomasleese/gantt-charts | ganttcharts/__init__.py | Python | mit | 56 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from getpass import getuser
import json
from os import environ
from pipes import quote
from socket import gethostname
from time import time
from .exceptions import NodeLockedException
from .utils import cached_property, temp... | timbuchwaldt/bundlewrap | bundlewrap/lock.py | Python | gpl-3.0 | 8,144 | 0.002456 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from .base import TestExecutor
class ProcessTestExecutor(TestExecutor):
def __init__(self, *args, **kwargs):
... | indykish/servo | tests/wpt/harness/wptrunner/executors/process.py | Python | mpl-2.0 | 701 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('training', '... | akademikbilisim/ab-kurs-kayit | abkayit/training/migrations/0005_auto_20160627_1414.py | Python | gpl-3.0 | 1,403 | 0.002851 |
from .patch import post_load
| OCA/server-tools | module_change_auto_install/__init__.py | Python | agpl-3.0 | 29 | 0 |
SPIDER_MODULES = ['censible_links.spiders']
DEFAULT_ITEM_CLASS = 'censible_links.items.Page'
| pmart123/censible_links | censible_links/settings.py | Python | bsd-3-clause | 93 | 0 |
'''
Tests for student activation and login
'''
import json
import unittest
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from django.... | devs1991/test_edx_docmode | common/djangoapps/student/tests/test_login.py | Python | agpl-3.0 | 26,838 | 0.002757 |
try:
import simplejson
except ImportError:
import json as simplejson
from .meta import DocumentMeta, BaseDocumentSession
json_objects = []
class JSONDocument(object):
"""
JSON Document base class
"""
__metaclass__ = DocumentMeta
def __init__(self, **kwargs):
json_objects.appe... | bossiernesto/onyx | persistance/documents/json_doc.py | Python | bsd-3-clause | 703 | 0.004267 |
# Copyright (c) 2014, Canon 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... | teamfx/openjfx-9-dev-rt | modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py | Python | gpl-2.0 | 9,422 | 0.003927 |
"""
File: logmessages.py
Author: Fernando Crespo Gravalos (cees.project.official@gmail.com)
Date: 2014/06/16
"""
##############
# LOG MESSAGES
##############
## GENERAL ##
DB_ERROR = 'Database error. Check database log file.'
STORE_NOT_FOUND = 'Could not find store in cees database.'
TOKEN_NOT_FOUND = 'Could not fin... | fcgravalos/CEES-API-v1.0 | logmessages.py | Python | apache-2.0 | 1,055 | 0.006635 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Hervé Cauwelier <herve@itaapy.com>
# Romain Gauthier <romain@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it and/or m... | kiniou/blender-smooth-slides | tools/lpod/scripts/lpod-style.py | Python | gpl-3.0 | 3,854 | 0.003374 |
import random
import unittest
from hearthbreaker.cards.spells.neutral import TheCoin
from tests.agents.testing_agents import OneCardPlayingAgent, MinionAttackingAgent, CardTestingAgent, \
PlayAndAttackAgent
from tests.testing_utils import generate_game_for
from hearthbreaker.cards import *
from hearthbreaker.const... | kingoflolz/hearthbreaker | tests/card_tests/shaman_tests.py | Python | mit | 30,173 | 0.002453 |
#
# 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
# ... | cwolferh/heat-scratch | heat/tests/openstack/manila/test_share.py | Python | apache-2.0 | 9,631 | 0 |
#!/usr/bin/env python3
"""Server for multithreaded (asynchronous) chat application."""
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
def accept_incoming_connections():
"""Sets up handling for incoming clients."""
while True:
client, client_address = SERVER.accept() # c... | horstjens/ThePythonGameBook | en/python/battleship/chat_server.py | Python | gpl-3.0 | 3,173 | 0.007249 |
# -*- coding: utf-8 -*-
"""
The following examples are used to demonstrate how to get/record
analytics
The method signatures are:
Pushbots.get_analytics()
and
Pushbots.record_analytics(platform=None, data=None)
In which you must specify either platform or data.
"""
from pushbots import Pushbots
def example_get_an... | tchar/pushbots | pushbots/examples/analytics.py | Python | mit | 1,805 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 So... | ddurieux/alignak | alignak/eventhandler.py | Python | agpl-3.0 | 6,318 | 0.002375 |
'''
Audio tests
===========
'''
import unittest
import os
SAMPLE_FILE = os.path.join(os.path.dirname(__file__), 'sample1.ogg')
SAMPLE_LENGTH = 1.402
SAMPLE_LENGTH_MIN = SAMPLE_LENGTH * 0.99
SAMPLE_LENGTH_MAX = SAMPLE_LENGTH * 1.01
class AudioTestCase(unittest.TestCase):
def get_sound(self):
import os
... | JulienMcJay/eclock | windows/kivy/kivy/tests/test_audio.py | Python | gpl-2.0 | 1,707 | 0.000586 |
#!/usr/bin/python3
"""Script to determine the Pywikibot version (tag, revision and date).
.. versionchanged:: 7.0
version script was moved to the framework scripts folder
"""
#
# (C) Pywikibot team, 2007-2021
#
# Distributed under the terms of the MIT license.
#
import codecs
import os
import sys
import pywikibot
... | wikimedia/pywikibot-core | pywikibot/scripts/version.py | Python | mit | 3,279 | 0 |
# Copyright (C) 2014 Adam Schubert <adam.schubert@sg1-game.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 by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | Salamek/DwaPython | tests/UserTest.py | Python | gpl-3.0 | 4,776 | 0.012772 |
from Models.Submission import Submission
from Core.Database import Database
from Core.Scorer import Score
from sqlalchemy import func, desc
class Ranking():
@staticmethod
def get_all():
session = Database.session()
scores = session.query(Score).order_by(desc(Score.score)).all()
retur... | brnomendes/grader-edx | Core/Ranking.py | Python | mit | 564 | 0.003546 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# name: settings.py
# author: Harold Bradley III
# email: harold@bradleystudio.net
# created on: 01/23/2016
#
# description: The settings file for ww
#
from __future__ import absolute_import, print_function
import os
import ti... | hbradleyiii/ww | ww/settings.py | Python | mit | 2,079 | 0.005772 |
#!/usr/bin/env python
"""
fileaction.py 'display' '*.ps' '*.jpg' '*.gif'
creates a GUI with a list of all PostScript, JPEG, and GIF files in
the directory tree with the current working directory as root.
Clicking on one of the filenames in the list launches the display
program, which displays the image file.
As ano... | sniemi/SamPy | sandbox/src1/TCSE3-3rd-examples/src/tools/fileaction.py | Python | bsd-2-clause | 3,008 | 0.006981 |
plot = variance.plot(norm='log', vmin=.5, cmap='plasma')
ax = plot.gca()
ax.grid()
ax.set_xlim(20, 1500)
ax.set_ylim(1e-24, 1e-20)
ax.set_xlabel('Frequency [Hz]')
ax.set_ylabel(r'[strain/\rtHz]')
ax.set_title('LIGO-Livingston sensitivity variance')
plot.show() | gwpy/gwpy.github.io | docs/v0.5/examples/frequencyseries/variance-3.py | Python | gpl-3.0 | 260 | 0.003846 |
def extractXiaoyuusTranslations(item):
"""
Xiaoyuu's Translations
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
return False
| fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractXiaoyuusTranslations.py | Python | bsd-3-clause | 244 | 0.028689 |
# Copyright (c) 2011 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... | nikste/visualizationDemo | zeppelin-web/node/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py | Python | apache-2.0 | 3,325 | 0.002105 |
# Symantec BackupExec
# CVE-2007-6016,CVE-2007-6017
import logging
log = logging.getLogger("Thug")
def Set_DOWText0(self, val):
self.__dict__['_DOWText0'] = val
if len(val) > 255:
log.ThugLogging.log_exploit_event(self._window.url,
"Symantec BackupExec Acti... | fedelemantuano/thug | thug/ActiveX/modules/SymantecBackupExec.py | Python | gpl-2.0 | 2,143 | 0.0056 |
"""
**********
Edge Lists
**********
Read and write NetworkX graphs as edge lists.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)\nDan Schult (dschult@colgate.edu)"""
# Copyright (C) 2004-2008 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
#... | emreg00/biana | biana/ext/networkx/readwrite/edgelist.py | Python | gpl-3.0 | 5,622 | 0.011028 |
school_scores = [
[2.2, 1032, 1253, 188, 0],
[1.9, 671, 1622, 418, 12],
[2.1, 3854, 7193, 1184, 16],
[2.2, 457, 437, 57, 0],
[1.8, 25546, 84659, 18839, 240],
[2.2, 2736, 4312, 732, 12],
[2.1, 2646, 17108, 4338, 105],
[1.8, 956, 2718, 731, 19],
[1.8, 316, 1493, 643, 13],
[1.8, 154... | WmHHooper/aima-python | submissions/Flanagin/myKMeans.py | Python | mit | 54,288 | 0.000037 |
from synergine.synergy.event.Action import Action
from tests.src.event.LonelinessSuicideEvent import LonelinessSuicideEvent
from tests.src.event.TooMuchBeansAction import TooMuchBeansAction
class LonelinessSuicideAction(Action):
_listen = LonelinessSuicideEvent
_depend = [TooMuchBeansAction]
def run(sel... | buxx/synergine | tests/src/event/LonelinessSuicideAction.py | Python | apache-2.0 | 402 | 0.002488 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.