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
from commander.Commander import Commander from commander.Terminal import Completer
teran/commander
commander/__init__.py
Python
gpl-2.0
83
from .db import db
plepe/pgmapcss
pgmapcss/db/overpass/__init__.py
Python
agpl-3.0
19
import unittest import numpy as np import yaml from pythainlp.benchmarks import word_tokenization with open("./tests/data/sentences.yml", "r", encoding="utf8") as stream: TEST_DATA = yaml.safe_load(stream) class TestBenchmarksPackage(unittest.TestCase): def test_preprocessing(self): self.assertIsNot...
PyThaiNLP/pythainlp
tests/test_benchmarks.py
Python
apache-2.0
2,931
import fibo fibo.fib(1000) print fibo.fib2(100) print fibo.__name__ fib = fibo.fib fib(500)
janusnic/21v-python
unit_06/testfibo.py
Python
mit
93
# 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 may ...
Azure/azure-sdk-for-python
sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/datab/_configuration.py
Python
mit
3,261
""" Miscellaneous utility code for VAR estimation """ import numpy as np import scipy.stats as stats import scipy.linalg as L import scipy.linalg.decomp as decomp import statsmodels.tsa.tsatools as tsa from scipy.linalg import cholesky #------------------------------------------------------------------------------- ...
yarikoptic/pystatsmodels
statsmodels/tsa/vector_ar/util.py
Python
bsd-3-clause
6,347
# # Copyright (c) 2012, Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, version 3 only. # # This program is distributed in the hope that it will be useful, # but WITHOUT A...
Monofraps/glove
scripts/lib/pybars/__init__.py
Python
apache-2.0
1,681
#!/usr/bin/python2.5 # # Copyright 2008 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 ...
dinomite/uaParser
uaParser/test/test_user_agent_parser.py
Python
apache-2.0
6,889
#!/usr/bin/env python # -*- encoding: utf-8 -*- # 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...
mycFelix/heron
heron/shell/src/python/handlers/filestatshandler.py
Python
apache-2.0
2,385
# this is a virtual module that is entirely implemented server side DOCUMENTATION = ''' --- module: raw short_description: Executes a low-down and dirty SSH command options: free_form: description: - the raw module takes a free form command to run required: true executable: description: - c...
pahaz/ansible-modules-core
commands/raw.py
Python
gpl-3.0
1,817
#!/usr/bin/env python # Convert to and from CoNLL-U format. import os import sys import codecs from conllu import conllu def argparser(): import argparse parser = argparse.ArgumentParser(description="Convert CoNLL-U data.") parser.add_argument('-o', '--output', metavar='DIR', default=None, ...
spyysalo/conllu.py
convert.py
Python
mit
1,897
# Copyright (C) 2015-2022 by the RBniCS authors # # This file is part of RBniCS. # # SPDX-License-Identifier: LGPL-3.0-or-later from rbnics.backends.abstract import FunctionsList as AbstractFunctionsList from rbnics.backends.abstract import ProperOrthogonalDecomposition as AbstractProperOrthogonalDecomposition from rb...
mathLab/RBniCS
rbnics/backends/online/numpy/proper_orthogonal_decomposition.py
Python
lgpl-3.0
1,710
import json import unittest from unittest.mock import patch, Mock, MagicMock from botocore.exceptions import ClientError from datetime import datetime from batch_transform.src import batch_transform from common import _utils from . import test_utils # TODO : Errors out if model_name doesn't contain '-' # fix model_...
kubeflow/kfp-tekton-backend
components/aws/sagemaker/tests/unit_tests/tests/test_batch_transform.py
Python
apache-2.0
1,166
###PYTHON############# #Purpose : Build a DB of mutations found in the MS-tryspin/chemotrypsin digests #Author : Aditya Ambati #date : May 26 2017 #update : version 1 #####import libraries from itertools import chain import pandas as pd import numpy as np %matplotlib import re from Bio import Entrez from Bio import Se...
adiamb/BYONIC-readout-analysis
Byonic_analysis.py
Python
gpl-3.0
17,581
import datetime from sqlalchemy import create_engine, Column, Date, DateTime, Float, ForeignKey, Integer, String from sqlalchemy.dialects.mysql import TIMESTAMP from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relation, relationship Base = declarative_base() class CityModel(Base): _...
boxofgoobers/rv-rest-api
models.py
Python
mit
3,071
""" Signal Handlers for External User Ids to be created and maintainer """ from logging import getLogger from django.db.models.signals import post_save from django.dispatch import receiver from openedx.core.djangoapps.catalog.utils import get_programs from .models import ExternalId, ExternalIdType LOGGER = getLogg...
edx/edx-platform
openedx/core/djangoapps/external_user_ids/signals.py
Python
agpl-3.0
2,154
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test compact blocks (BIP 152). Version 1 compact blocks are pre-segwit (txids) Version 2 compact block...
r8921039/bitcoin
test/functional/p2p_compactblocks.py
Python
mit
44,206
from . import connection from . import chat_room from . import utils import datetime class StandardRoom(chat_room.ChatRoom): """ A room with basic utilities already implemented as instructed by https://github.com/jedevc/botrulez """ def __init__(self, roomname, password=None, attempts=None): ...
ArkaneMoose/EuPy
euphoria/standard_room.py
Python
mit
1,415
from __future__ import unicode_literals, division, absolute_import import logging import re from itertools import chain from flexget import plugin from flexget.entry import Entry from flexget.event import event from flexget.utils.cached_input import cached from flexget.utils.soup import get_soup log = logging.getLogg...
ZefQ/Flexget
flexget/plugins/input/myepisodes_list.py
Python
mit
3,239
## ## This file is part of qpOASES. ## ## qpOASES -- An Implementation of the Online Active Set Strategy. ## Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka, ## Christian Kirches et al. All rights reserved. ## ## qpOASES is free software; you can redistribute it and/or ## modify it under the terms of ...
airballking/qpOASES
interfaces/python/examples/example1b.py
Python
lgpl-2.1
2,304
#!/usr/bin/env python # # Copyright 2007 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 o...
SRabbelier/Melange
thirdparty/google_appengine/google/appengine/api/user_service_pb.py
Python
apache-2.0
42,563
#!/usr/bin/env python3 import sys import requests from html.parser import HTMLParser from html.entities import name2codepoint s1 = 'abc' class MyHTMLParser(HTMLParser): def __init__(self): self.href_list = [] super().__init__() def handle_starttag(self, tag, attrs): print("Start tag...
jingwangian/tutorial
python/html/html_st.py
Python
gpl-3.0
1,496
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Buron # Copyright 2015, TODAY Clouder SASU # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License with Attribution # ...
nicolas-petit/clouder
clouder_runner_openshift/__init__.py
Python
gpl-3.0
983
from zope import component from zope import interface from zope.interface.interfaces import IObjectEvent from zope import location from sparc.configuration.container import ISparcPyContainerConfiguredApplication #EVENTS class ISnippetAvailableForSecretsSniffEvent(IObjectEvent): """An object providing ISnippet is r...
CrowdStrike/mellon
mellon/interfaces.py
Python
mit
4,243
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
dudymas/python-openstacksdk
openstack/tests/functional/compute/v2/test_image.py
Python
apache-2.0
1,884
#! /usr/bin/python """ test_frame.py Paul Malmsten, 2010 pmalmsten@gmail.com Tests frame module for proper behavior """ import unittest from xbee.frame import APIFrame from xbee.python2to3 import byteToInt, intToByte class TestAPIFrameGeneration(unittest.TestCase): """ XBee class must be able to create a va...
nioinnovation/python-xbee
xbee/tests/test_frame.py
Python
mit
3,016
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('globenocturneapp', '0016_auto_20150701_1624'), ] operations = [ migrations.AlterField( model_name='worldcountry'...
qliu/globe_nocturne
globenocturne/globenocturneapp/migrations/0017_auto_20150701_1624.py
Python
gpl-2.0
506
#python import k3d import testing document = k3d.new_document() source = k3d.plugin.create("PolyTorus", document) triangles = k3d.plugin.create("TriangulateFaces", document) triangles.mesh_selection = k3d.select_all() k3d.property.connect(document, source.get_property("output_mesh"), triangles.get_property("input_m...
K-3D/k3d
tests/mesh/mesh.modifier.PGPRemesh.py
Python
gpl-2.0
949
#!/usr/bin/env python3 ''' An example of three labels packed into three separate PanedWindow areas with values set for the width of handle and sash. ''' import tkinter class PanedWindow(tkinter.Tk): def __init__(self): tkinter.Tk.__init__(self) self.title("Label") panedwindow = tkinter.P...
steeleyuk/python-tkinter-examples
panedwindow.py
Python
cc0-1.0
866
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('spirit_topic', '0004_update_last_commenter'), ] operations = [ migrations.AddField( ...
alesdotio/Spirit
spirit/topic/migrations/0005_topic_reindex_at.py
Python
mit
491
# # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Pychart 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 option) any # later version. # # Pychart is dis...
cecep-edu/refactory
requirements/PyChart-1.39/demos/linetest.py
Python
gpl-3.0
1,970
# Copyright 2017 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 a...
pklfz/fold
tensorflow_fold/util/proto_test.py
Python
apache-2.0
5,810
#!/usr/bin/env python from enum import Enum class OTULabelStyleEnum(Enum): OTT_ID = 0 CURRENT_LABEL = 1 # OTT_NAME, if mapped or ORIGINAL_LABEL ORIGINAL_LABEL = 2 OTT_NAME = 3 OTT_UNIQNAME = 4 CURRENT_LABEL_OTT_ID = 5 # concatenates {c}_{i}.format(c=CURRENT_LABEL, i=OTT_ID)
mtholder/peyotl
peyotl/phylo/entities.py
Python
bsd-2-clause
303
from gwcconfig.GeoWebCacheServer import GeoWebCacheServer try: from config import * except ImportError: print("Failed to load settings") def main(): server = GeoWebCacheServer(GWC_REST_API_URL,GWC_REST_API_USERNAME,GWC_REST_API_PASSWORD) test_layer = server.get_layer(LAYER_NAME) test_layer.fetch()...
ndufrane/gwcconfig
tests/main.py
Python
mit
546
from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Column, Row from django.conf import settings from django.contrib.auth.models import User from django.contrib import admin from django.contrib.admin.widgets import ForeignKeyRawIdWidget from django.urls import reverse from djan...
WikipediaLibrary/TWLight
TWLight/users/forms.py
Python
mit
9,325
import errno import sys import os from ansible.utils.display import Display from ansible.utils.color import stringc from ansible.utils.singleton import Singleton from .utils import get_ansible_task_log_path class UnSingleton(Singleton): def __init__(cls, name, bases, dct): type.__init__(cls, name, bases...
skyoo/jumpserver
apps/ops/ansible/display.py
Python
gpl-2.0
1,809
import multiprocessing import subprocess def create_cpu_load(sleep=30): """ create some artificial cpu load to heat stuff up """ procs = [] # Create cpu load for core in range(multiprocessing.cpu_count()): procs.append(subprocess.Popen(['sha256sum','/dev/random'])) # Give some h...
daveol/Fedora-Test-Laptop
tests/utils/cpu.py
Python
mit
424
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
caisq/tensorflow
tensorflow/python/estimator/canned/boosted_trees.py
Python
apache-2.0
44,604
__docformat__ = "numpy" def unique(ar, return_index=False, return_inverse=False, return_counts=False): """ Find the unique elements of an array. Returns the sorted unique elements of an array. There are two optional outputs in addition to the unique elements: the indices of the input array that gi...
jwren/intellij-community
python/testData/inspections/PyNumpyType/ReturnTuple.py
Python
apache-2.0
1,733
"""Set testing/stable dates for all old updates. Revision ID: 3dbed75df3fe Revises: 13cfca635b99 Create Date: 2015-09-03 14:06:11.762119 """ # revision identifiers, used by Alembic. revision = '3dbed75df3fe' down_revision = '13cfca635b99' import transaction from alembic import op from bodhi.models import Update, ...
remicollet/bodhi
alembic/versions/3dbed75df3fe_set_testing_stable_dates_for_all_old_.py
Python
gpl-2.0
1,608
"""This pipeline is intended to make the classification of MRSI modality features.""" from __future__ import division import os import numpy as np from sklearn.externals import joblib from sklearn.preprocessing import label_binarize from sklearn.ensemble import RandomForestClassifier from protoclass.data_management ...
I2Cvb/mp-mri-prostate
pipeline/feature-classification/exp-3/balancing/pipeline_classifier_mrsi_spectra.py
Python
mit
5,823
# -*- coding: utf-8 -*- from numpy import logical_not as not_, logical_or as or_ from numpy.core.defchararray import startswith from openfisca_france.model.base import * # noqa analysis:ignore class coloc(Variable): column = BoolCol entity_class = Individus label = u"Vie en colocation" class lo...
benjello/openfisca-france
openfisca_france/model/caracteristiques_socio_demographiques/logement.py
Python
agpl-3.0
4,749
#!/usr/bin/env python # -*- coding: utf8 -*- # Natural Language Toolkit: Toolbox data file parser # # Copyright (C) 2001-2006 University of Pennsylvania # Author: Greg Aumann <greg_aumann@sil.org> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT """module for reading Toolbox data files """ from...
hectormartinez/rougexstem
taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/toolbox/data.py
Python
apache-2.0
12,543
from django.views.generic import DetailView from .items import Item class ItemDetailView(DetailView): context_object_name = 'item' template_name = 'item-detail.html' def get_object(self): return Item(self.kwargs['pk'])
wowref/wowref.com
wowref/wotlk/views.py
Python
mit
243
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:11235") else: access = Se...
Jacklord1/franko
contrib/bitrpc/bitrpc.py
Python
mit
7,837
from django.conf import settings SHOW_PREVIEW = getattr(settings, 'PAGEDOWN_SHOW_PREVIEW', True) WIDGET_TEMPLATE = getattr(settings, 'PAGEDOWN_WIDGET_TEMPLATE', 'pagedown/widgets/default.html') WIDGET_CSS = getattr(settings, 'PAGEDOWN_WIDGET_CSS', ('pagedown/demo/browser/demo.css', )) EXTENSIONS = getattr(settings, '...
ministryofjustice/django-pagedown
pagedown/settings.py
Python
bsd-3-clause
345
from __future__ import unicode_literals from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils import six from django.utils.functional import cached_property fro...
guettli/django
django/db/migrations/operations/models.py
Python
bsd-3-clause
33,007
# (c) 2015, Ansible Inc, # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
Yannig/ansible
lib/ansible/plugins/action/net_base.py
Python
gpl-3.0
7,262
import numpy as np import pytest from mathpy.numerical.roots import newtonraph, bisection, secant class TestRoots: @staticmethod def _test_func1(x): return x ** 2 - 10 @staticmethod def _test_func2(x): return x ** 3 - 2 * x - 5 @staticmethod def _test_func3(x...
aschleg/mathpy
mathpy/numerical/tests/test_roots.py
Python
mit
1,494
#!/usr/bin/python # -*- coding: utf-8 -*- import re import os import imp from environment import * from mas import * from parser_agent import * class Project(Mas): def __init__(self, maspy): project_maspy = open(maspy, 'r'); self.__load(os.path.dirname(project_maspy.name), project_maspy.read()) ...
andrellsantos/agentspeak-py
agentspeak-py/project.py
Python
gpl-3.0
2,773
from django.contrib import admin from forum.models import Forum, Thread, Post, Subscription class ForumAdmin(admin.ModelAdmin): list_display = ('title', '_parents_repr') list_filter = ('groups',) ordering = ['ordering', 'parent', 'title'] prepopulated_fields = {"slug": ("title",)} class SubscriptionAd...
farstarinc/django-forum
forum/admin.py
Python
bsd-3-clause
1,022
# Copyright (c) 2008-2015, Michael J. Silbersack # 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 c...
gvnn3/tcpdiff
compare.py
Python
bsd-2-clause
2,044
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
nicobustillos/odoo
openerp/osv/fields.py
Python
agpl-3.0
70,819
from .document import Document, Track templates = { 'Development': [ dict(name='Qwer', key='q', group='one'), dict(name='Wert', key='w', group='two'), dict(name='Erty', key='e', group='three'), dict(name='Asdf', key='a', group='one'), dict(name='Sdfg', key='s', group='two...
mikeboers/ScoreBee
scorebee/templates.py
Python
bsd-3-clause
3,567
# This script is used to create data file (expected.txt) # which is used to compare the output from TensorFlowSharp optimizer tests. import tensorflow as tf # Training data train_x =[ 3.3, 4.4, 5.5, 6.71, 6.93, 4.168, 9.779, 6.182, 7.59, 2.167, 7.042, 10.791, 5.313, 7.997, 5.654, 9.27, 3.1 ] train_y = [ 1...
migueldeicaza/TensorFlowSharp
tests/TensorFlowSharp.Tests.CSharp/TestData/Momentum/optimizer_lr_test.py
Python
mit
1,293
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
twiest/openshift-tools
openshift/installer/vendored/openshift-ansible-3.7.42-1/roles/lib_openshift/library/oc_volume.py
Python
apache-2.0
70,312
""" Sending pastries generated from the oven to the shop. """ from PyBake import * from PyBake.logger import * from importlib import import_module import textwrap import zipfile import requests # Note: This function could run concurrently. def uploadPastry(menu, pastry, server, *, force): """ Uploads a pastry t...
lab132/PyBake
PyBake/depot.py
Python
mit
2,338
############################################################################# # Copyright Kitware 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/licen...
DigitalSlideArchive/large_image
sources/pil/large_image_source_pil/__init__.py
Python
apache-2.0
6,995
version_info = (0, 6, 16) __version__ = version = '.'.join(map(str, version_info)) __project__ = PROJECT = 'django-summernote' __author__ = AUTHOR = "Park Hyunwoo <ez.amiryo@gmail.com>" default_app_config = 'django_summernote.apps.DjangoSummernoteConfig'
WQuanfeng/django-summernote
django_summernote/__init__.py
Python
mit
258
# -*- coding: utf-8 -*- from pysignfe.xml_sped import * from .ConsultarSituacaoLoteRps import ListaMensagemRetorno from .Rps import IdentificacaoPrestador, IdentificacaoRps from .Nfse import CompNfse import os DIRNAME = os.path.dirname(__file__) class ConsultarLoteRpsEnvio(XMLNFe): def _...
thiagopena/PySIGNFe
pysignfe/nfse/bhiss/v10/ConsultarLoteRps.py
Python
lgpl-2.1
2,448
from __future__ import print_function import ttfw_idf EXPECT_TIMEOUT = 20 @ttfw_idf.idf_example_test(env_tag='Example_I2C_CCS811_SENSOR') def test_i2ctools_example(env, extra_data): # Get device under test, flash and start example. "i2ctool" must be defined in EnvConfig dut = env.get_dut('i2ctools', 'exampl...
espressif/esp-idf
examples/peripherals/i2c/i2c_tools/example_test.py
Python
apache-2.0
1,274
#!/usr/bin/env python def configuration(parent_package='',top_path=None): import numpy from numpy.distutils.misc_util import Configuration config = Configuration('solvers', parent_package, top_path) config.add_scripts(['nlpy_trunk.py', 'nlpy_lbfgs.py', ...
dpo/nlpy
nlpy/optimize/solvers/setup.py
Python
gpl-3.0
671
from django.contrib.auth.models import Group class GroupManager: def __init__(self): pass @staticmethod def get_joinable_groups(): return Group.objects.select_related('authgroup').exclude(authgroup__internal=True) @staticmethod def get_group_leaders_groups(user): return G...
Kaezon/allianceauth
allianceauth/groupmanagement/managers.py
Python
gpl-2.0
1,934
#!/usr/bin/python # Copyright (c) 2009 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. import errno import filecmp import os.path import re import tempfile import sys def ExceptionAppend(e, msg): """Append a message to the given...
nawawi/wkhtmltopdf
webkit/Source/ThirdParty/gyp/pylib/gyp/common.py
Python
lgpl-3.0
12,381
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # # This file is part of Medusa. # # Medusa 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...
pymedusa/SickRage
medusa/sbdatetime.py
Python
gpl-3.0
8,651
import struct from boofuzz.primitives.bit_field import BitField class DWord(BitField): """The 4 byte sized bit field primitive. :type name: str, optional :param name: Name, for referencing later. Names should always be provided, but if not, a default name will be given, defaults to None :ty...
jtpereyda/boofuzz
boofuzz/primitives/dword.py
Python
gpl-2.0
1,697
# missileKineticDmgBonusStandard # # Used by: # Implants named like: Zainou 'Snapshot' Light Missiles LM (6 of 6) type = "passive" def handler(fit, container, context): fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Light Missiles"), "kineticDamage", cont...
Ebag333/Pyfa
eos/effects/missilekineticdmgbonusstandard.py
Python
gpl-3.0
372
# Copyright 2015 Red Hat, 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...
redhat-openstack/ironic
ironic/drivers/modules/wol.py
Python
apache-2.0
6,842
# -*- coding: utf-8 -*- try: import __builtin__ except ImportError: import builtins as __builtin__ #Python 3.0 from copy import copy import os.path from cfmt import fmt import codecs ### Default set of dmsl extensions def css(s, _locals): s = s.splitlines() n = s[0] s = s[1:] return [u'%link[...
dskinner/damsel-python
dmsl/_sandbox.py
Python
mit
2,807
# -*- 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 'MessageRecord' db.create_table(u'nuntium_messagerecord', ( (u'id', self.gf('djan...
TEDICpy/write-it
nuntium/migrations/0007_auto__add_messagerecord.py
Python
gpl-3.0
5,320
from simtk.openmm.app import * from simtk.openmm import * from simtk.unit import * from sys import stdout from dcdreporter import DCDReporter import numpy as np def OPLS_LJ(system): forces = {system.getForce(index).__class__.__name__: system.getForce( index) for index in range(system.getNumForces())} n...
leelasd/LigParGenTools
PLIQ_OPENMM.py
Python
mit
3,116
############################################## # File Name: module6.py # Version: 1.0 # Team No.: 22 # Team Name: # Date: 11 Nov 15 ############################################## import RPi.GPIO as GPIO import time print 'Programming the PiBot...' GPIO.setmode(GPIO.BOARD) GPIO.setup(7, GPIO.OUT) GPIO.setup(11, GPIO...
konini-school/pibot22
module6.py
Python
gpl-2.0
867
from __future__ import division from pandas import Interval import pytest import pandas.util.testing as tm @pytest.fixture def interval(): return Interval(0, 1) class TestInterval(object): def test_properties(self, interval): assert interval.closed == 'right' assert interval.left == 0 ...
NixaSoftware/CVis
venv/lib/python2.7/site-packages/pandas/tests/scalar/test_interval.py
Python
apache-2.0
4,026
# This will work out how far you are from the number 6. def six_toast(num): rem = 6 - num return abs(rem) # Pos to neg def six_toast(num): return abs(num-6) # a less efficient way to solve it: def six_toast(num): if num >= 6: t = num-6 return t else: return num ...
Matt-Stammers/Python-Foundations
Simple Functions/Anchored_Number.py
Python
gpl-3.0
324
from gym.spaces import Space from typing import Optional from ray.rllib.utils.exploration.gaussian_noise import GaussianNoise from ray.rllib.utils.schedules import ConstantSchedule class PerWorkerGaussianNoise(GaussianNoise): """A per-worker Gaussian noise class for distributed algorithms. Sets the `scale` ...
richardliaw/ray
rllib/utils/exploration/per_worker_gaussian_noise.py
Python
apache-2.0
1,807
from ..cw_model import CWModel class Source(CWModel): def __init__(self, json_dict=None): self.id = None # (Integer) self.name = None # *(String(50)) self.defaultFlag = None # (Boolean) self._info = None # (Metadata) self.enteredBy = None # (String) ...
joshuamsmith/ConnectPyse
service/source.py
Python
mit
441
from sipRequest import SIPRequest class UnknownSIPRequest(SIPRequest): pass
bobjects/BobStack
bobstack/sipmessaging/unknownSIPRequest.py
Python
apache-2.0
82
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Doriancoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mining RPCs - getmininginfo - getblocktemplate proposal mode - submitblock""" import copy fro...
doriancoins/doriancoin
test/functional/mining_basic.py
Python
mit
5,591
""" Copyright 2016 Brocade Communications Systems, 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 t...
brocade/pynos
pynos/versions/ver_7/ver_7_1_0/system.py
Python
apache-2.0
3,459
from .schedule import Schedule from .schedule import ScheduleScorer from .schedule_generator import find_schedules
rosshamish/classtime
classtime/brain/scheduling/__init__.py
Python
mit
116
#!/usr/bin/env python3.7 # -*- coding: utf-8 -*- # callirhoe - high quality calendar rendering # Copyright (C) 2012-2015 George M. Tzoumas # 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 Fo...
geotz/callirhoe
callirhoe.py
Python
gpl-3.0
12,413
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington and Kai Nagel # See opus_core/LICENSE import os import opus_matsim.sustain_city.tests as test_dir from opus_core.tests import opus_unittest from opus_core.store.csv_storage import csv_storage from urbansim.datasets.travel_dat...
christianurich/VIBe2UrbanSim
3rdparty/opus/src/opus_matsim/sustain_city/tests/matsim_coupeling/matrix_test.py
Python
gpl-2.0
3,343
""" Common tests shared by test_str, test_unicode, test_userstring and test_string. """ import operator import unittest, string, sys, struct from test import support from collections import UserList class Sequence: def __init__(self, seq='wxyz'): self.seq = seq def __len__(self): return len(self.seq) def ...
wdv4758h/ZipPy
lib-python/3/test/string_tests.py
Python
bsd-3-clause
61,662
# -------------------------------------------------------- # TensorFlow for Dragon # Copyright(c) 2017 SeetaTech # Written by Ting Pan # -------------------------------------------------------- __all__ = ['equal'] import dragon.ops as ops def equal(a, b, name=None): return ops.Equal([a, b])
neopenx/Dragon
Dragon/python/dragon/vm/tensorflow/ops/control_flow_ops.py
Python
bsd-2-clause
300
# # (C) Copyright 2005,2007 Hewlett-Packard Development Company, L.P. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2 of the # License. # # This program is distribut...
openlmi/openlmi-doc
doc/python/pywbem/twisted_client.py
Python
gpl-2.0
22,547
# Copyright (C) 2003-2005 Peter J. Verveer # # 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 the following d...
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/scipy/ndimage/filters.py
Python
gpl-3.0
49,136
from .indices import Index, registry from .helpers import query, parse, index, model_indices, multisearch from .utils import autodiscover from . import exceptions default_app_config = 'springy.apps.SpringyAppConfig'
marcinn/springy
springy/__init__.py
Python
bsd-2-clause
218
#this is a utility script designed to provide function interfaces for converting values from stmp into scaled numbers for drawing. This involves normalizing and changing values from scipy.stats import norm from numpy import linspace #fit a single distribution given the attribute name and idx dicts #deprecated, but g...
AshleyLab/stmpVisualization2.0
stmpVisualization-master/drawing_functions.py
Python
mit
1,664
# !/usr/bin/python import sys import os import warnings import unittest2 # silences Python's complaints about imports warnings.filterwarnings('ignore', category=UserWarning) USAGE = """ Path to your sdk must be the first argument. To run type: $ apptest.py path/to/your/appengine/installation Remember to set enviro...
Eforcers/inbox-cleaner
src/apptest.py
Python
mit
1,313
class MissingReferenceFlank(Exception): pass class InconsistentAlignment(Exception): pass class Unstrandable(Exception): pass class FlanksTooShort(Exception): pass
23andMe/stranding
stranding/exceptions.py
Python
mit
186
# Copyright 2016 Hewlett Packard Enterprise Development, LP. # # 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 req...
HewlettPackard/python-proliant-sdk
examples/Rest/ex33_set_bios_service.py
Python
apache-2.0
1,873
# -*- coding: utf-8 -*- """ babel.messages.catalog ~~~~~~~~~~~~~~~~~~~~~~ Data structures for message catalogs. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ import re import time from cgi import parse_header from datetime import datetime, time as time_...
srisankethu/babel
babel/messages/catalog.py
Python
bsd-3-clause
31,052
#Standard libraries import from thread import * #Local import import tcp_server device_repository = [ {'type': 'new emax', 'dictionary' : [['Current I1', 2000, 2, 0], ['Current I2', 2002, 2, 0], ['Current I3', 2004, 2, 0], ['Current Ne', 2006, 2, 0]]}, {'type': 'emax2', ...
MarcoStucchi/ModbusTCP-Client-Server
device/device.py
Python
mit
2,774
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-21 15:12 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('base', '0006_auto_20160620_0207'), ] operations = [ migrations.AddField( ...
pulkitpahwa/smart-image-coordinates
smarter/base/migrations/0007_auto_20160621_1512.py
Python
mit
999
from __future__ import division __all__ = ['Categorical', 'CategoricalAndConcentration', 'Multinomial', 'MultinomialAndConcentration', 'GammaCompoundDirichlet', 'CRP'] import numpy as np from warnings import warn import scipy.stats as stats import scipy.special as special from pybasicbayes.abstractions imp...
fivejjs/pybasicbayes
pybasicbayes/distributions/multinomial.py
Python
mit
17,040
u""" Fixer for (metaclass=X) -> __metaclass__ = X Some semantics (see PEP 3115) may be altered in the translation.""" from lib2to3 import fixer_base from lib2to3.fixer_util import Name, syms, Node, Leaf, Newline, find_root from lib2to3.pygram import token from libfuturize.fixer_util import indentation, suitify # from ...
hughperkins/kgsgo-dataset-preprocessor
thirdparty/future/src/libpasteurize/fixes/fix_metaclass.py
Python
mpl-2.0
3,268
# Copyright 2014: Mirantis 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 b...
pandeyop/rally
rally/benchmark/context/base.py
Python
apache-2.0
5,019
import os import sys from setuptools import setup, find_packages, Command class RunTests(Command): description = "Run the django test suite from the test_project dir." user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): ...
StefanKjartansson/Django-Server-Conf
setup.py
Python
bsd-2-clause
1,597
# -*- coding: utf-8 -*- ################################################################ ### common functions for data structures, file name manipulation, etc. ################################################################ from __future__ import print_function import os import os.path import re import sys import sy...
tmbdev/ocropy
ocrolib/common.py
Python
apache-2.0
30,368
"""Add verification table Revision ID: 90ac01a2df Revises: df61cfff356e Create Date: 2016-04-16 17:28:20.778467 """ # revision identifiers, used by Alembic. revision = '90ac01a2df' down_revision = 'df61cfff356e' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sqlalchemy.di...
Floens/uchan
migrations/versions/90ac01a2df_add_verification_table.py
Python
mit
1,083