code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
""" Test utilities. """ import base64 import json import urllib from requests_testadapter import TestAdapter, TestSession class RecordingAdapter(TestAdapter): """ Record the request that was handled by the adapter. """ request = None expected_auth_headers = None def set_basic_auth(self, usernam...
praekelt/go-cli
go_cli/tests/utils.py
Python
bsd-3-clause
3,376
# -*- coding: utf-8 -*- """ sphinx.ext.autosummary.generate ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Usable as a library or script to generate automatic RST source files for items referred to in autosummary:: directives. Each generated RST file contains a single auto*:: directive which extracts the doc...
bitcraft/pyglet
doc/ext_/autosummary/generate.py
Python
bsd-3-clause
17,464
import os import pytest import requests from keybar.client import TLS12SSLAdapter from keybar.tests.helpers import LiveServerTest from keybar.tests.factories.user import UserFactory from keybar.tests.factories.device import ( AuthorizedDeviceFactory, PRIVATE_KEY, PRIVATE_KEY2) from keybar.utils.http import Insecu...
keybar/keybar
src/keybar/tests/test_client.py
Python
bsd-3-clause
4,080
import os import AutoNetkit import AutoNetkit.config as config from pkg_resources import resource_filename import logging LOG = logging.getLogger("ANK") def test_plot(): inet = AutoNetkit.internet.Internet("multias") inet.compile() inet.plot() assert(os.path.exists(os.path.join(config.plot_dir, "summ...
sk2/ank_le
AutoNetkit/plotting/tests/test.py
Python
bsd-3-clause
592
import re from decimal import Decimal from django.conf import settings from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter from django.contrib.gi...
vsajip/django
django/contrib/gis/db/backends/postgis/operations.py
Python
bsd-3-clause
25,275
# -*- coding: utf-8 -*- """A/B Testing for Django django-lean allows you to perform split-test experiments on your users. In brief, this involves exposing 50% of your users to one implementation and 50% to another, then comparing the performance of these two groups with regards to certain metrics. """ from distutil...
funkotron/django-lean
setup.py
Python
bsd-3-clause
2,630
from django.conf import settings from django.core.exceptions import ValidationError from django.forms.fields import FileField from django.template.defaultfilters import filesizeformat from django.utils.translation import ugettext_lazy as _ class WagtailVideoField(FileField): def __init__(self, *args, **kwargs): ...
takeflight/wagtailvideos
wagtailvideos/fields.py
Python
bsd-3-clause
2,114
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from __future__ import unicode_literals from ..specialized import RobustStatisticsSegmenter def test_RobustStatisticsSegmenter_inputs(): input_map = dict(args=dict(argstr='%s', ), curvatureWeight=dict(argstr='--curvatureWeight %f', ), environ=d...
mick-d/nipype
nipype/interfaces/slicer/segmentation/tests/test_auto_RobustStatisticsSegmenter.py
Python
bsd-3-clause
1,555
#!/usr/bin/env python EMPTY_VALUES = (None, '', 'NoneType', False) UNIVERSAL = ('autocomplete', 'required') TEXT_SEARCH = ( 'dirname', 'list', 'maxlength', 'pattern', 'placeholder', 'readonly', 'size', 'spellcheck') EMAIL = ('multiple') SELECT = ('multiple', 'name', 'size') PASSWORD = ('maxlength', 'patt...
iamjstates/django-formsfive
formsfive/attributes.py
Python
bsd-3-clause
596
""" Common terminal messages used across Empire. Titles, agent displays, listener displays, etc. """ import os, sys, textwrap # Empire imports # from helpers import * # from lib.common.helpers import * from helpers import * ############################################################### # # Messages # ##########...
thebarbershopper/Empire
lib/common/messages.py
Python
bsd-3-clause
14,148
from django.conf import settings def get_server_loc(): if hasattr(settings, 'TASKFORCE_SERVER'): address, port = settings.TASKFORCE_SERVER.split(':') port = int(port) else: address = '127.0.0.1' port = 9000 return address, port def get_server_base_uri(): address, port =...
mallipeddi/django-taskforce
utils.py
Python
bsd-3-clause
381
from collections import deque from hiku.denormalize.graphql import DenormalizeGraphQL class DenormalizeEntityGraphQL(DenormalizeGraphQL): def __init__(self, graph, result, root_type_name): super().__init__(graph, result, root_type_name) self._type = deque([graph.__types__[root_type_name]])
vmagamedov/hiku
hiku/federation/denormalize.py
Python
bsd-3-clause
314
#/usr/bin/env python import codecs import os import sys from setuptools import setup, find_packages if 'publish' in sys.argv: os.system('python setup.py sdist upload') sys.exit() read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read() # Dynamically calculate the version based on galeria.VERSIO...
zokeber/django-galeria
setup.py
Python
bsd-3-clause
1,378
from __future__ import unicode_literals from unittest import skipIf from django.test import TestCase, override_settings from django.db import connection, connections from django.db.migrations.graph import NodeNotFoundError from django.db.migrations.loader import MigrationLoader, AmbiguityError from django.db.migratio...
oscaro/django
tests/migrations/test_loader.py
Python
bsd-3-clause
12,020
from .base import (ExtensionArray, # noqa ExtensionScalarOpsMixin) from .categorical import Categorical # noqa from .datetimes import DatetimeArrayMixin # noqa from .interval import IntervalArray # noqa from .period import PeriodArrayMixin # noqa from .timedeltas import TimedeltaArrayMixin # ...
kdebrab/pandas
pandas/core/arrays/__init__.py
Python
bsd-3-clause
325
""" Display class """ __author__ = """\n""".join(['Jeffrey Schmidt (jschmid1@binghamton.edu', 'Benjamin Bush (benjaminjamesbush@gmail.com)', 'Hiroki Sayama (sayama@binghamton.edu)']) __all__ = ['addInputValues','addExperimentalValues','addInputXValueList','addIn...
schmidtj/PyGNA
PyGNA/Display.py
Python
bsd-3-clause
15,679
from __future__ import absolute_import import argparse import logging import os.path from neckbeard.actions import up, view from neckbeard.configuration import ConfigurationManager from neckbeard.loader import NeckbeardLoader from neckbeard.output import configure_logging from neckbeard.resource_tracker import build_...
winhamwr/neckbeard
neckbeard/bin/neckbeard.py
Python
bsd-3-clause
5,380
from sklearn2sql_heroku.tests.regression import generic as reg_gen reg_gen.test_model("Ridge" , "freidman2" , "oracle")
antoinecarme/sklearn2sql_heroku
tests/regression/freidman2/ws_freidman2_Ridge_oracle_code_gen.py
Python
bsd-3-clause
122
# !/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, division import numpy as np import scipy.signal as sp import random import nix import matplotlib.pyplot as plt COLORS_BLUE_AND_RED = ( 'dodgerblue', 'red' ) COLORS_BLUE_GRADIENT = ( "#034980", "#055DA1", "#1B70E0", "#3786...
stoewer/nix-demo
utils/plotting.py
Python
bsd-3-clause
12,201
import datetime from django.test import override_settings, TestCase from django_twilio.models import Caller from mock import Mock, patch, PropertyMock from model_mommy import mommy from twilio.rest.exceptions import TwilioRestException from .mommy_recipes import caller_recipe, message_recipe, phone_number_recipe fro...
cfc603/django-twilio-sms-models
tests/test_models.py
Python
bsd-3-clause
25,815
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import partialdate.fields class Migration(migrations.Migration): dependencies = [ ('genealogio', '0023_auto_20160303_2105'), ] operations = [ migrations.AlterField( model...
ugoertz/django-familio
genealogio/migrations/0024_auto_20160316_2039.py
Python
bsd-3-clause
3,111
import numpy as np from ..objects import ServerDataSource try: import scipy import scipy.misc except ImportError as e: print(e) def source(**kwargs): kwargs['transform'] = {'resample':'heatmap'} kwargs['data'] = {'x': [0], 'y': [0], 'gl...
jakevdp/bokeh
bokeh/transforms/image_downsample.py
Python
bsd-3-clause
2,114
# stdlib from datetime import datetime import os.path import socket import ssl import time import re from urlparse import urlparse # 3rd party import tornado import requests # project from checks.network_checks import NetworkCheck, Status, EventType from config import _is_affirmative from util import headers as agent...
JohnLZeller/dd-agent
checks.d/http_check.py
Python
bsd-3-clause
11,850
class CharacterController(): def __init__(self): pass
mizahnyx/panda3dplanetgen
mecha01/character_controller.py
Python
bsd-3-clause
66
AUTHOR = 'Osmosoft' AUTHOR_EMAIL = 'tiddlyspace@osmosoft.com' NAME = 'tiddlywebplugins.tiddlyspace' DESCRIPTION = 'A discoursive social model for TiddlyWiki' VERSION = '1.0.76' # NB: duplicate of tiddlywebplugins.tiddlyspace.__init__ import os from setuptools import setup, find_packages setup( namespace_packag...
FND/tiddlyspace
setup.py
Python
bsd-3-clause
1,806
#!/usr/bin/env python """ Converts px4logs to csv. """ from __future__ import print_function import argparse import os import re import subprocess def run_sdlog_dump(file_path, sdlog2_path="sdlog2_dump.py"): """ Coverts a xp4log to a csv. """ file_out = re.sub('.px4log', '.csv', file_path) cmd =...
dronecrew/px4tools
px4tools/px42csv.py
Python
bsd-3-clause
1,574
# Parts of this file were derived from the setup.py file of scikit-image # scikit-image license can be found at # https://github.com/scikit-image/scikit-image/blob/master/LICENSE.txt from setuptools import setup, find_packages with open('requirements.txt') as f: INSTALL_REQUIRES = [l.strip() for l in f.readlines(...
fredo-editor/FreDo
setup.py
Python
bsd-3-clause
684
# Sumber: LMD/models.py from google.appengine.ext import db class Users(db.Model): username = db.StringProperty() passwd = db.StringProperty() email = db.StringProperty() fullname = db.StringProperty() address = db.TextProperty() phone = db.StringProperty() role = db.IntegerProperty(de...
rimbalinux/LMD3
user/models.py
Python
bsd-3-clause
383
from django.conf.urls.defaults import * urlpatterns = patterns('project.views', (r'^$', 'index'), (r'^new/$', 'new'), (r'^(?P<project_id>\d+)/$', 'detail'), (r'^(?P<project_id>\d+)/edit/$', 'edit'), (r'^(?P<project_id>\d+)/groups/', include('project.groups.urls')), (r'^(?P<project_id>\d+)/contacts/', include('pr...
tjsavage/tmrwmedia
project/urls.py
Python
bsd-3-clause
417
# This file was automatically generated by SWIG (http://www.swig.org). # Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info if _swig_python_version_info < (2, 7, 0): raise Runtime...
mfem/PyMFEM
mfem/_par/geom.py
Python
bsd-3-clause
22,071
from flask_factory import Factory create_app = Factory(__name__) create_app.step('.db:init_db')
Kroisse/flask-factory
tests/relative/web.py
Python
bsd-3-clause
97
import os import sys import pytest from os.path import join from sqlalchemy.exc import InvalidRequestError from textwrap import dedent from ...api import Gradebook from .. import run_nbgrader from .base import BaseTestApp class TestNbGraderAssign(BaseTestApp): def test_help(self): """Does the help disp...
EdwardJKim/nbgrader
nbgrader/tests/apps/test_nbgrader_assign.py
Python
bsd-3-clause
13,634
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
datalogics/scons
test/Rpcgen/RPCGEN.py
Python
mit
4,064
from pytest import raises from thespian.system.utilis import fmap class plain_obj(object): def __init__(self, sublist): self._sublist = sublist def vals(self): return self._sublist class fmap_obj(plain_obj): def fmap(self, f): return fmap_obj(fmap(f, self._sublist)) class TestFMap(obje...
godaddy/Thespian
thespian/system/test/test_fmap.py
Python
mit
2,297
import chainer from chainer.backends import cuda from chainer import distribution from chainer.functions.array import where from chainer.functions.math import exponential from chainer import utils class Pareto(distribution.Distribution): """Pareto Distribution. .. math:: f(x) = \\alpha x_m^{\\alpha}...
ktnyt/chainer
chainer/distributions/pareto.py
Python
mit
3,069
#!/usr/bin/python ## Input import argparse ## Display import matplotlib.pyplot as plt import matplotlib.animation as animation import pygame import time import threading ## Math import numpy as np ## Ros import rospy from tf import transformations as tf_trans ## Data Structures from collections import deque, OrderedDic...
ufieeehw/IEEE2016
ros/ieee2016_diagnostics_ported/src/xmega/visualize_imu_output.py
Python
mit
4,849
from __future__ import print_function from os.path import join, abspath modules = ['parkind.f90', 'parrrtm.f90', 'rrlw_cld.f90', 'rrlw_con.f90', 'rrlw_kg01.f90', 'rrlw_kg02.f90', 'rrlw_kg03.f90', 'rrlw_kg04.f90', 'rrlw_kg05.f90', ...
brian-rose/climlab
climlab/radiation/rrtm/_rrtmg_lw/setup.py
Python
mit
3,492
#!/usr/bin/env python # -*- coding: utf-8 -*- #****************************************************************************** # # download_modis_data.py # --------------------------------------------------------- # Download MODIS data # More: http://github.com/nextgis/dhi # # Usage: # download_modis_data.py [-h]...
nextgis/dhi
general/download_modis_data.py
Python
mit
6,762
import datetime from app.main.data_quality import default_data_quality_content_for_date_range def title(): return 'Robert Stobie Spectrograph' def content(): return default_data_quality_content_for_date_range(__package__, datetime.date.today() - dateti...
saltastro/salt-data-quality-site
app/main/pages/instrument/rss/straylight/__init__.py
Python
mit
422
import pytest @pytest.fixture def clipping_area_hsr_data(): return { "name": "HSR Polygon", "clipping_multi_polygon": { "type": "MultiPolygon", "coordinates": [ [[[47.223954659939984, 8.814822435379028], [47.22422061004465, 8.817118406295776], [47.2235065492...
geometalab/osmaxx
tests/clipping_area/conftest.py
Python
mit
499
from ferrox.lib.bbcode import * import ferrox.lib.helpers as h import ferrox.model #from base import h #from ferrox import model class User(TagBase): no_close = True def __init__(self): self.last_error = None pass def start(self, name, params): if not params: self.last...
hsuaz/ferrox
ferrox/lib/bbcode_for_fa.py
Python
mit
2,694
# -*- coding: utf-8 -*- # # Tax Calculator documentation build configuration file, created by # sphinx-quickstart on Mon Mar 9 17:06:10 2015. # # 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...
rkuchan/Tax-Calculator
docs/source/conf.py
Python
mit
11,210
# todo """ flp_nonlinear.py: soco approach to the capacitated facility location problem minimize the total (weighted) travel cost from n customers to a given set of facilities, with fixed costs and limited capacities; costs are nonlinear (square root of the total quantity serviced by a facility). Approach: use a sec...
mattmilten/PySCIPOpt
examples/unfinished/flp_nonlinear_soco.py
Python
mit
4,919
from django.apps import AppConfig class ImageViewConfig(AppConfig): name = 'voxel_globe.image_view' label = 'image_view'
ngageoint/voxel-globe
voxel_globe/image_view/apps.py
Python
mit
125
""" Sobol sequence generator. https://github.com/naught101/sobol_seq """ from .sobol_seq import i4_sobol_generate, i4_uniform, i4_sobol, i4_sobol_generate_std_normal from .sobol_seq import i4_bit_hi1, i4_bit_lo0, prime_ge __all__ = ["i4_sobol_generate", "i4_uniform", "i4_sobol", "i4_bit_hi1", "i4_...
naught101/sobol_seq
sobol_seq/__init__.py
Python
mit
374
#### 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/military/shared_military_rebel_field_hospital.iff" result.attribute...
obi-two/Rebelion
data/scripts/templates/object/building/military/shared_military_rebel_field_hospital.py
Python
mit
485
from __future__ import unicode_literals from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ImproperlyConfigured from django.http import Http404 from django.utils.translation import ugettext as _ from base import TemplateResponseMixin, ContextMixin, View class MultipleObjectM...
akulakov/mangotrac
proj_issues/mcbv/list.py
Python
mit
7,272
#### 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 = Tangible() result.template = "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk4.iff"...
obi-two/Rebelion
data/scripts/templates/object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk4.py
Python
mit
512
import time from mpfmc.tests.MpfMcTestCase import MpfMcTestCase class TestAssets(MpfMcTestCase): def get_machine_path(self): return 'tests/machine_files/assets_and_image' def get_config_file(self): return 'test_asset_loading.yaml' def test_machine_wide_asset_loading(self): # te...
missionpinball/mpf_mc
mpfmc/tests/test_Assets.py
Python
mit
13,153
#!/usr/bin/python # -*- coding:utf-8 -*- # Created Time: Fri Jul 17 00:58:20 2015 # Purpose: generate a bidirected graph # Mail: hewr2010@gmail.com __author__ = "Wayne Ho" import sys import random if __name__ == "__main__": if len(sys.argv) < 3: print("./%s [#vertices] [#edges]" % sys.argv[0]) exi...
manene/SAE_Sampling
spark/genGraph.py
Python
mit
715
from . import db class Role(db.Model): __tablename__ = 'roles' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(64), unique=True) users = db.relationship('User', backref='role', lazy='dynamic') def __repr__(self): return '<Role %s>' % self.name class User(db.Model...
mfwarren/FreeCoding
2014/12/fc_30/app/models.py
Python
mit
596
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
quickresolve/accel.ai
flask-aws/lib/python2.7/site-packages/ebcli/controllers/create.py
Python
mit
18,430
# -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe Technologies and contributors # License: MIT. See LICENSE import frappe from frappe.model.document import Document from frappe.utils import cint from frappe.model.naming import append_number_if_name_exists from frappe.modules.export_file import export_to_files from ...
frappe/frappe
frappe/desk/doctype/number_card/number_card.py
Python
mit
5,717
class PatroniException(Exception): """Parent class for all kind of exceptions related to selected distributed configuration store""" def __init__(self, value): self.value = value def __str__(self): """ >>> str(PatroniException('foo')) "'foo'" """ return rep...
pgexperts/patroni-compose
patroni/patroni/exceptions.py
Python
mit
547
# The MIT License (MIT) # # Copyright (c) 2014 Ian Good # # 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, ...
icgood/provoke
provoke/amqp.py
Python
mit
4,068
# coding: utf-8 from __future__ import absolute_import, unicode_literals from modeltranslation.translator import translator, TranslationOptions from .models import Document class DocumentTranslationOptions(TranslationOptions): fields = ('title', 'text') translator.register(Document, DocumentTranslationOptions)...
foobacca/django-multilingual-search
tests/testproject/translation.py
Python
mit
321
# coding: utf-8 """ Environmental Exposures API API for environmental exposure models for NIH Data Translator program OpenAPI spec version: 1.0.0 Contact: stealey@renci.org Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "L...
mjstealey/exposures-api
python-client/exposures_api/models/date_range.py
Python
mit
4,058
# -*- coding: utf-8 -*- """ Thread forms """ import os, hashlib from django.conf import settings from django import forms from django.utils.translation import ugettext_lazy as _ from django.core.files.storage import FileSystemStorage from project.manager_frontend.forms import CrispyFormMixin from project.utils.import...
sveetch/recalbox-manager
project/manager_frontend/forms/bios.py
Python
mit
3,935
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2015, Adrian Sampson. # # 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 t...
kelvinhammond/beets
beets/logging.py
Python
mit
4,354
# 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 ...
jkonecki/autorest
AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureResource/autorestresourceflatteningtestservice/models/resource_collection.py
Python
mit
1,526
import os import yaml import logging import collections def init_logging(): log = logging.getLogger(__name__) return log log = init_logging() class YamlConfig(collections.MutableMapping): """ A configuration object populated by parsing a yaml file, with optional default values. Note that m...
dmick/teuthology
teuthology/config.py
Python
mit
8,592
#### 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_dune_lizard.iff" result.attribute_template_id = 9 result.stfN...
anhstudios/swganh
data/scripts/templates/object/mobile/shared_dune_lizard.py
Python
mit
436
""" @file test_accel_bma222e.py """ ## # @addtogroup soletta sensor # @brief This is sensor test based on soletta app # @brief test sensor bma222e on Galileo/MinnowMax ## import os import time from oeqa.utils.helper import shell_cmd from oeqa.oetest import oeRuntimeTest from oeqa.runtime.sensor.EnvirSetup import Envir...
wanghongjuan/meta-iotqa-1
lib/oeqa/runtime/sensor/test_accel_bma222e.py
Python
mit
2,499
class Solution(object): def isAnagram(self, s, t): """ :type s: str :type t: str :rtype: bool """ return sorted(s) == sorted(t)
mengzhuo/my-leetcode-solution
valid-anagram.py
Python
mit
180
from __future__ import absolute_import, unicode_literals import sys if sys.version_info > (3,): from shutil import which else: from distutils.spawn import find_executable as which from virtualenv.activation import NushellActivator from virtualenv.info import IS_WIN def test_nushell(activation_tester_class...
pypa/virtualenv
tests/unit/activation/test_nushell.py
Python
mit
816
""" Script that trains Tensorflow Multitask models on UV dataset. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os import numpy as np import tempfile import shutil import deepchem as dc from UV_datasets import load_uv ###Load data### shard_siz...
joegomes/deepchem
examples/uv/UV_tf_singletask.py
Python
mit
3,308
import abc from hearthbreaker.tags.base import Selector, Player, Picker, Function, Amount, Condition import hearthbreaker.tags.condition class FriendlyPlayer(Player): def match(self, source, obj): return obj.player is source.player def get_players(self, target): return [target] def __to_...
bingshuika/hearthbreaker-new
hearthbreaker/tags/selector.py
Python
mit
16,247
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
lmazuel/azure-sdk-for-python
azure-eventgrid/azure/eventgrid/models/resource_write_failure_data.py
Python
mit
3,203
#!/usr/bin/python __VERSION__ = '0.1' __AUTHOR__ = 'Galkan' __DATE__ = '06.08.2014' """ it is derived from https://github.com/argp/nmapdb/blob/master/nmapdb.py """ try: import sys import xml.dom.minidom from xml.etree import ElementTree except ImportError,e: import sys sys.stdout.write("%s\n" %e)...
tdr130/sec
lib/xml_parser.py
Python
mit
4,735
from slimmer import * # slimmer.py has an __all__ variable
ergoithz/ithz
ithz/lib/slimmer/__init__.py
Python
mit
58
from __future__ import unicode_literals from django.apps import AppConfig class DownloadzConfig(AppConfig): name = 'downloadz'
Yeasayer/YoutubeVideoPage
ytdownload/apps.py
Python
mit
134
# test MicroPython-specific features of struct try: import ustruct as struct except: try: import struct except ImportError: import sys print("SKIP") sys.exit() class A(): pass # pack and unpack objects o = A() s = struct.pack("<O", o) o2 = struct.unpack("<O", s) print(...
mhoffma/micropython
tests/basics/struct_micropython.py
Python
mit
332
from .utils import Impl
comp-imaging/ProxImaL
proximal/utils/__init__.py
Python
mit
24
#!/usr/bin/env python __author__ = "bt3" from binary_search_tree import BST, Node def find_ancestor(path, low_item, high_item): while path: current_item = path[0] if current_item < low_item: try: path = path[2:] except: return current_item...
switchkiller/Python-and-Algorithms-and-Data-Structures
src/trees/check_ancestor.py
Python
mit
1,369
from DeepFried2.zoo.download import download as _download import numpy as _np from tarfile import open as _taropen try: # Py2 compatibility import cPickle as _pickle except ImportError: import pickle as _pickle def data(): fname = _download('http://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz') ...
elPistolero/DeepFried2
DeepFried2/datasets/cifar100.py
Python
mit
1,879
import sys import windrosebin for x in sys.argv: print x print type(sys.argv) windrosebin.allocate() windrosebin.check(sys.argv[1],sys.argv[2],len(sys.argv)) windrosebin.calc(sys.argv[1],sys.argv[3],len(sys.argv)) windrosebin.printLines()
jonguan/cmpe275-proj1-windrose
run_reduce.py
Python
mit
242
from __future__ import print_function # Time: O(n) # Space: O(1) # # Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. # # For example, # "A man, a plan, a canal: Panama" is a palindrome. # "race a car" is not a palindrome. # # Note: # Have you consider that ...
kamyu104/LeetCode
Python/valid-palindrome.py
Python
mit
994
from __future__ import absolute_import, unicode_literals import os from abc import ABCMeta, abstractmethod from six import add_metaclass @add_metaclass(ABCMeta) class Activator(object): """Generates an activate script for the virtual environment""" def __init__(self, options): """Create a new activ...
pypa/virtualenv
src/virtualenv/activation/activator.py
Python
mit
1,411
"""Summary """ from PyQt5.QtWidgets import QGraphicsRectItem from . import gridstyles as styles from .gridextras import PreXoverItemGroup, WEDGE_RECT from . import ( GridNucleicAcidPartItemT, GridVirtualHelixItemT ) _RADIUS = styles.GRID_HELIX_RADIUS class PreXoverManager(QGraphicsRectItem): """Summary ...
scholer/cadnano2.5
cadnano/views/gridview/prexovermanager.py
Python
mit
9,797
""" meerkat_api util functions """ from datetime import datetime from dateutil import parser import meerkat_abacus.util as abacus_util import numpy as np import meerkat_abacus.util.epi_week def series_to_json_dict(series): """ Takes pandas series and turns into a dict with string keys Args: seri...
who-emro/meerkat_api
meerkat_api/util/__init__.py
Python
mit
4,531
#!/usr/bin/python import re,os def compare_file(x,y): dr = re.compile(r"[\S]+?([0-9]+)[\S]+") orderx = -1 ordery = -1 m = dr.match(x) if m: orderx = int(m.group(1)) m = dr.match(y) if m: ordery = int(m.group(1)) if orderx == -1 or ordery== -1: return 0 if orderx>ordery: return 1 elif orderx==ordery: ...
thierry1985/project-1022
domains/driverlogshift/readsetting.py
Python
mit
965
# coding: utf-8 '''Common stuff, used in other modules''' from __future__ import print_function import re, os, fnmatch, sys, itertools import sublime from sublime import Region from os.path import isdir, join, basename try: # unavailable dependencies shall not break basic functionality import package_events exc...
aziz/SublimeFileBrowser
common.py
Python
mit
21,576
#### 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_diax.iff" result.attribute_template_id = 9 result.stf...
anhstudios/swganh
data/scripts/templates/object/mobile/shared_dressed_diax.py
Python
mit
426
from __future__ import absolute_import import os import numpy as np from emu.nnadapter import NNAdapter from keras.models import model_from_json, model_from_yaml, Model, Sequential from keras import applications from keras import backend from collections import OrderedDict from emu.docutil import doc_inherit imagene...
mlosch/nnadapter
emu/keras.py
Python
mit
8,953
"""Services implemented by the AWS provider.""" import ipaddress import logging import string import uuid from botocore.exceptions import ClientError import tenacity import cloudbridge.base.helpers as cb_helpers from cloudbridge.base.middleware import dispatch from cloudbridge.base.resources import ClientPagedResult...
gvlproject/libcloudbridge
cloudbridge/providers/aws/services.py
Python
mit
63,632
def digit_sum(x): return sum([ord(s) - ord('0') for s in str(x)]) if __name__ == "__main__": cnt = 0 ans = [] for i in range(2, 50): for j in range(2, 400): v = j ** i if digit_sum(v) == j: cnt += 1 ans.append(v) if cnt >= ...
EdisonAlgorithms/ProjectEuler
vol3/119.py
Python
mit
416
from django.middleware.csrf import rotate_token from prosodyauth.models import User, AnonymousUser from prosodyauth.prosody.backend import ProsodyBackend SESSION_KEY = '_prosodyauth_user_id' def login(request, user): try: user_id = request.session[SESSION_KEY] if user.pk != user_id: ...
Kromey/fbxnano
prosodyauth/utils.py
Python
mit
1,032
#!/usr/bin/env python import os import sys from pyingest.parsers.atel import ATelParser from pyingest.serializers.classic import Tagged rss_url = 'http://www.astronomerstelegram.org/?adsbiblio' parser = ATelParser() documents = parser.parse(rss_url, data_tag='item') outputfp = open('atel.tag', 'a') for d in document...
adsabs/adsabs-pyingest
examples/ex_atel.py
Python
mit
401
# Example for script that connects to PV, # writes a value, then disconnects from the PV. # # This is usually a bad idea. # It's better to have widgets connect to PVs, # 1) More efficient. Widget connects once on start, then remains connected. # Widget subscribes to PV updates instead of polling its value. # 2) Widg...
ESSICS/org.csstudio.display.builder
org.csstudio.display.builder.model/examples/script_util/write_any_pv.py
Python
epl-1.0
855
# Copyright (c) 2007, Simon Edwards <simon@simonzone.com> # Copyright (c) 2014, Raphael Kubo da Costa <rakuco@FreeBSD.org> # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. import PyQt4.QtCore import os import sys def get_defa...
melvyn-sopacua/kdelibs
cmake/modules/FindPyQt.py
Python
gpl-2.0
1,768
# Copyright (C) 2017 Apple 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 the f...
Debian/openjfx
modules/web/src/main/native/Tools/Scripts/webkitpy/tool/steps/checkpatchrelevance.py
Python
gpl-2.0
2,708
import re import weakref from buildbot import util class Properties(util.ComparableMixin): """ I represent a set of properties that can be interpolated into various strings in buildsteps. @ivar properties: dictionary mapping property values to tuples (value, source), where source is a string ...
kzys/buildbot
buildbot/process/properties.py
Python
gpl-2.0
5,112
# -*- coding: utf-8 -*- # # This file is part of CERN Document Server. # Copyright (C) 2015 CERN. # # Invenio 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 opti...
ludmilamarian/cds
cds/base/dojson/marc21/translations/default.py
Python
gpl-2.0
1,839
#!/usr/bin/env python # -*- coding: utf-8 -*- # # gaussFit.py # # Copyright 2014 Carlos "casep" Sepulveda <casep@alumnos.inf.utfsm.cl> # # 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; ...
creyesp/RF_Estimation
Clustering/helpers/gaussFitSTA/gaussFit.py
Python
gpl-2.0
2,992
"""Taking screenshots inside tests! If you want to take a screenshot inside your test, just do it like this: .. code-block:: python def test_my_test(take_screenshot): # do something take_screenshot("Particular name for the screenshot") # do something else """ import fauxfactory import py...
nachandr/cfme_tests
cfme/fixtures/screenshots.py
Python
gpl-2.0
1,470
# # Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/] # # This file is part of IGE - Outer Space. # # IGE - Outer Space 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 t...
mozts2005/OuterSpace
server/lib/ige/ospace/IPlayer.py
Python
gpl-2.0
43,445
import turtle t = turtle.Pen() def mystar(size, filled): if filled: t.begin_fill() for x in range(1,19): t.forward(size) if x % 2 == 0: t.left(175) else: t.left(225) if filled: t.end_fill() t.color(0.9, 0.75, 0) mystar(120, True) t.color(0,0,...
erikdejonge/python_for_kids
chapter11/star_function.py
Python
gpl-2.0
341
#!/usr/bin/env python import sys; sys.path[:0] = ["../.."] from pyx import * c = canvas.canvas() s = svgfile.svgfile_pt(100, 200, 'data/testsvg.svg', width_pt=450, parsed=True) c.insert(s) c.stroke(s.bbox().enlarged(-style.linewidth.normal.width/2).rect()) c.fill(path.circle_pt(105, 205, 5)) c.fill(path.circle_pt(10...
mjg/PyX-svn
test/functional/test_svgfile.py
Python
gpl-2.0
732
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
estnltk/suffix-lemmatizer
bootstrap.py
Python
gpl-2.0
7,459
# -*- coding: utf-8 -*- import fauxfactory import pytest from cfme.configure.configuration.region_settings import Category from cfme.rest.gen_data import categories as _categories from cfme.utils.rest import ( assert_response, delete_resources_from_collection, delete_resources_from_detail, ) from cfme.util...
lkhomenk/integration_tests
cfme/tests/configure/test_tag_category.py
Python
gpl-2.0
3,472