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 |
|---|---|---|---|---|---|
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..preprocess import TCorrelate
def test_TCorrelate_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedef... | mick-d/nipype | nipype/interfaces/afni/tests/test_auto_TCorrelate.py | Python | bsd-3-clause | 1,367 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
import logging
logger = logging.getLogger('magiccontent.default_auth')
def naive_can_edit(request):
logger.warning(
('naive_can_edit method has been used, please provide a '
'GALLERY_PAGE_IS_... | DjenieLabs/django-magic-gallery | magicgallery/default_auth.py | Python | bsd-3-clause | 471 |
from __future__ import absolute_import
from sentry.identity.vsts import VSTSIdentityProvider
from sentry.integrations.exceptions import IntegrationError
from sentry.integrations.vsts import VstsIntegration, VstsIntegrationProvider
from sentry.models import (
Integration, IntegrationExternalProject, OrganizationIn... | ifduyue/sentry | tests/sentry/integrations/vsts/test_integration.py | Python | bsd-3-clause | 12,757 |
"""A way to read and write structs to a binary file, with fast access
Licensed under the 3-clause BSD License:
Copyright (c) 2011-2014, Neeraj Kumar (neerajkumar.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following condit... | neeraj-kumar/nkpylib | structfile.py | Python | bsd-3-clause | 4,103 |
import platform
from . import meta
from . import parser
from . import tools
from . import exc
Log = tools.minimal_logger(__name__)
def get_parser(**kw):
"""
Detect the proper parser class, and return it instantiated.
Optional Arguments:
parser
The parser class to use instead of dete... | bendikro/python-ifcfg | ifcfg/__init__.py | Python | bsd-3-clause | 1,934 |
from numpy.testing import assert_allclose, assert_equal
from . import plt
from .. import utils
def test_path_data():
circle = plt.Circle((0, 0), 1)
vertices, codes = utils.SVG_path(circle.get_path())
assert_allclose(vertices.shape, (25, 2))
assert_equal(codes, ['M', 'C', 'C', 'C', 'C', 'C', 'C', 'C',... | mpld3/mplexporter | mplexporter/tests/test_utils.py | Python | bsd-3-clause | 1,024 |
# Copyright (c) 2015, Lars Tingelstad
# All rights reserved.
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# l... | tingelst/pyversor | pyversor/c3d/directions.py | Python | bsd-3-clause | 1,721 |
#!/usr/bin/python
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""
Responsible for generating the testing decoders based on
parsed table representations.
"""
# This file generates testing ... | nacl-webkit/native_client | src/trusted/validator_arm/dgen_test_output.py | Python | bsd-3-clause | 40,246 |
from django.conf.urls import patterns, url
from .views import MediaLibraryAPIView, MediaLibraryItemView, AddShelfRelationAPIView
urlpatterns = patterns('',
url(r'^(?P<type>(audio|video|image))/$', MediaLibraryAPIView.as_view(), name='medialibrary'),
url(r'^(?P<pk>\d+)/$', MediaLibraryItemView.as_view(), name='... | pulilab/django-medialibrary | medialibrary/urls.py | Python | bsd-3-clause | 450 |
#!/usr/bin/env python
"""
This script is a trick to setup a fake Django environment, since this reusable
app will be developed and tested outside any specifiv Django project.
Via ``settings.configure`` you will be able to set all necessary settings
for your app and run the tests as if you were calling ``./manage.py tes... | uhuramedia/django-portlet | portlet/tests/runtests.py | Python | bsd-3-clause | 2,032 |
try:
from django.conf.urls import *
except ImportError: # django < 1.4
from django.conf.urls.defaults import *
from .views import EventDetail, EventList, EventCreate, EventCreateJSON, EventDelete, EventUpdate
urlpatterns = patterns("events.views",
url(r"^$", EventList.as_view(template... | goldhand/onegreek | onegreek/events/urls.py | Python | bsd-3-clause | 1,273 |
from copy import copy
import datetime
import time
import urllib2
from nose.tools import assert_equals
from nose.plugins.skip import SkipTest
from autoscalebot import TOO_LOW, JUST_RIGHT, TOO_HIGH
from autoscalebot.conf import AutoscaleSettings
from autoscalebot.models import HerokuAutoscaler
class TestSettings(Autosc... | wieden-kennedy/autoscalebot | autoscalebot/tests.py | Python | bsd-3-clause | 21,789 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 on 2017-03-22.
# 2017, SMART Health IT.
import io
import json
import os
import unittest
from . import guidanceresponse
from .fhirdate import FHIRDate
class GuidanceResponseTests(unittest.TestCase):
def instantiate_from(self, fi... | all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/models/guidanceresponse_tests.py | Python | bsd-3-clause | 1,811 |
from distutils.core import setup
import os
import glob
setup(
name = 'pyspecfit',
url = 'http://justincely.github.io',
version = '0.0.1',
description = 'interact with IRAF task specfit I/O products',
author = 'Justin Ely',
author_email = 'ely@stsci.edu',
keywords = ['astronomy'],
classi... | justincely/pyspecfit | setup.py | Python | bsd-3-clause | 731 |
from django.conf import settings
from .locals import get_cid
DEFAULT_CID_SQL_COMMENT_TEMPLATE = 'cid: {cid}'
class CidCursorWrapper:
"""
A cursor wrapper that attempts to add a cid comment to each query
"""
def __init__(self, cursor):
self.cursor = cursor
def __getattr__(self, attr):
... | snowball-one/cid | cid/cursor.py | Python | bsd-3-clause | 1,697 |
# -*-coding:Utf-8 -*
# Copyright (c) 2013 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | stormi/tsunami | src/secondaires/navigation/equipage/volontes/relacher_rames.py | Python | bsd-3-clause | 3,392 |
#!/usr/bin/env python
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | vsco/grpc | tools/run_tests/run_tests.py | Python | bsd-3-clause | 56,812 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from sentry.utils.query import RangeQuerySetWrapperWithProgressBar
DEFAULT_SAVED_SEARCHES = [
{
'name': 'Unresolved Issues',
'query': ... | mvaled/sentry | src/sentry/south_migrations/0458_global_searches_data_migration.py | Python | bsd-3-clause | 120,420 |
# pylint: disable-msg=W0401,W0511,W0611,W0612,W0614,R0201,E1102
"""Tests suite for MaskedArray & subclassing.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
"""
from __future__ import division, absolute_import, print_function
__author__ = "Pierre GF Gerard-Marchant"
import warnings
import pickle
i... | pyparallel/numpy | numpy/ma/tests/test_core.py | Python | bsd-3-clause | 161,025 |
import torch
import pickle
import logging
from .baseclasses import ScalarMonitor
from .meta import Regurgitate
class Saver(ScalarMonitor):
def __init__(self, save_monitor, model_file, settings_file, **kwargs):
self.saved = False
self.save_monitor = save_monitor
self.model_file = model_file
... | isaachenrion/jets | src/monitors/saver.py | Python | bsd-3-clause | 985 |
from distutils.core import setup
import toolkit_library
from toolkit_library import inspector
def read_modules():
result = ''
package = inspector.PackageInspector(toolkit_library)
for module in package.get_all_modules():
exec('from toolkit_library import {0}'.format(module))
result... | tylerlong/toolkit_library | setup.py | Python | bsd-3-clause | 1,418 |
"""
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... | sonnyhu/scikit-learn | sklearn/tree/tree.py | Python | bsd-3-clause | 41,818 |
#!/usr/bin/env python3
#
# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Adds the code parts to a resource APK."""
import argparse
import logging
import os
import shutil
import sys
import tempfile
... | youtube/cobalt | build/android/gyp/apkbuilder.py | Python | bsd-3-clause | 22,278 |
import urllib.request, urllib.parse, urllib.error
from oauth2 import Request as OAuthRequest, SignatureMethod_HMAC_SHA1
try:
import json as simplejson
except ImportError:
try:
import simplejson
except ImportError:
from django.utils import simplejson
from social_auth.backends import Consum... | limdauto/django-social-auth | social_auth/backends/contrib/rdio.py | Python | bsd-3-clause | 4,358 |
import csv
import time
from datetime import timedelta
from django.shortcuts import render, redirect
from django.http import Http404, HttpResponse, HttpResponseForbidden, JsonResponse
from django.conf import settings
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
f... | fallen/Pytition | pytition/petition/views.py | Python | bsd-3-clause | 64,345 |
real = complex(1, 1).real
imag = complex(1, 1).imag
print(real, imag)
| balarsen/Scrabble | scrabble/test.py | Python | bsd-3-clause | 72 |
# -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. All Rights Reserved.
#
# 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 u... | endlessm/chromium-browser | third_party/catapult/third_party/gsutil/gslib/tests/test_help.py | Python | bsd-3-clause | 3,599 |
try: import cPickle as pickle
except: import pickle
from gem.evaluation import metrics
from gem.utils import evaluation_util, graph_util
import networkx as nx
import numpy as np
def evaluateStaticGraphReconstruction(digraph, graph_embedding,
X_stat, node_l=None, file_suffix=None,... | palash1992/GEM | gem/evaluation/evaluate_graph_reconstruction.py | Python | bsd-3-clause | 3,704 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-11 22:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateM... | andrijan/csgostats | cs-stats/stats/migrations/0001_initial.py | Python | bsd-3-clause | 3,104 |
import numpy as np
import theano
import theano.tensor as T
class GradientOptimizer:
def __init__(self, lr):
self.lr = lr
def __call__(self, cost, params):
pass
@property
def learningRate(self):
return self.lr
@learningRate.setter
def learningRate(self, i):
se... | aissehust/sesame-paste-noodle | mlbase/gradient_optimizer.py | Python | bsd-3-clause | 3,630 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
"""
import numpy as np
from numpy import ma
def bin_spike(x, l):
"""
l is the number of points used for comparison, thus l=2 means that each
point will be compared only against t... | castelao/CoTeDe | cotede/qctests/bin_spike.py | Python | bsd-3-clause | 2,677 |
from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import bytes, dict, object, range, map, input, str
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
import rfpipe, rfpipe.candidates
import pytest
from astropy import tim... | realfastvla/rfpipe | tests/test_sim.py | Python | bsd-3-clause | 7,548 |
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from django.utils.translation import ugettex... | dimagi/commcare-hq | corehq/apps/reports/standard/users/reports.py | Python | bsd-3-clause | 10,221 |
import threading
import numpy as np
def ros_ensure_valid_name(name):
return name.replace('-','_')
def lineseg_box(xmin, ymin, xmax, ymax):
return [ [xmin,ymin,xmin,ymax],
[xmin,ymax,xmax,ymax],
[xmax,ymax,xmax,ymin],
[xmax,ymin,xmin,ymin],
]
def lineseg_circle(x,y,... | motmot/fview | motmot/fview/utils.py | Python | bsd-3-clause | 1,929 |
# c: 14.04.2008, r: 14.04.2008
import numpy as nm
from sfepy import data_dir
filename_mesh = data_dir + '/meshes/2d/square_unit_tri.mesh'
def get_pars(ts, coors, mode=None, region=None, ig=None, extra_arg=None):
if mode == 'special':
if extra_arg == 'hello!':
ic = 0
else:
... | olivierverdier/sfepy | tests/test_functions.py | Python | bsd-3-clause | 4,539 |
# -*- coding: utf-8 -*-
__version__ = '0.5.0'
request_post_identifier = 'current_aldryn_blog_entry'
| aldryn/aldryn-blog | aldryn_blog/__init__.py | Python | bsd-3-clause | 100 |
# -*- coding: utf-8 -*-
"""Helper utilities and decorators."""
from flask import flash, render_template, current_app
def flash_errors(form, category="warning"):
"""Flash all errors for a form."""
for field, errors in form.errors.items():
for error in errors:
flash("{0} - {1}"
... | wdm0006/myflaskapp | myflaskapp/utils.py | Python | bsd-3-clause | 777 |
# Copyright (c) 2010 ActiveState Software Inc. All rights reserved.
"""
pypm.common.util
~~~~~~~~~~~~~~~~
Assorted utility code
"""
import os
from os import path as P
import sys
import re
from contextlib import contextmanager
import logging
import time
import textwrap
from datetime import datetime
f... | igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/site-packages/pypm/common/util.py | Python | mit | 7,802 |
"""
Read in the output from the trace-inputlocator script and create a GraphViz file.
Pass as input the path to the yaml output of the trace-inputlocator script via config file.
The output is written to the trace-inputlocator location.
WHY? because the trace-inputlocator only has the GraphViz output of the last call ... | architecture-building-systems/CEAforArcGIS | bin/create_trace_graphviz.py | Python | mit | 1,081 |
from gmusicapi import Mobileclient
import getpass
class GpmSession(object):
# Private Variables
# Public Variables
api = None
logged_in = False
songs = None
playlists = None
# Constructor with optionally passed credentials
# Omit credentials if you want to handle login, include for pr... | sethraymond/JukeBot | src/libs/GooglePlayMusicController.py | Python | mit | 2,096 |
"""
Sql support for multilingual models
"""
| ziima/django-multilingual-ds9 | multilingual/models/sql/__init__.py | Python | mit | 44 |
# coding=utf8
import sublime
from .Base import Base
from ...utils import Debug
from ...utils.uiutils import get_prefix
class Outline(Base):
regions = {}
ts_view = None
def __init__(self, t3sviews):
super(Outline, self).__init__('Typescript : Outline View', t3sviews)
# SET TEXT
def set_... | Phaiax/ArcticTypescript | lib/display/views/Outline.py | Python | mit | 3,505 |
#-*- coding: utf-8 -*-
from PIL import Image, ImageChops, ImageDraw
from django.contrib.auth.models import User
from filer.models.foldermodels import Folder
from filer.models.clipboardmodels import Clipboard, ClipboardItem
def create_superuser():
superuser = User.objects.create_superuser('admin',
... | croepha/django-filer | filer/tests/helpers.py | Python | mit | 1,697 |
# -*- coding:utf-8 -*-
#
# Import OBJ files
#
# External dependencies
import os
import numpy as np
import MeshToolkit as mtk
# Import a mesh from a OBJ / SMF file
def ReadObj( filename ) :
# Initialisation
vertices = []
faces = []
normals = []
colors = []
texcoords = []
material = ""
# Read each line in the ... | microy/PyMeshToolkit | MeshToolkit/File/Obj.py | Python | mit | 1,285 |
#!/usr/bin/env python3
import sys
MOD = 123 # type: int
YES = "yes" # type: str
NO = "NO" # type: str
def solve(N: int, M: int, H: "List[List[str]]", A: "List[int]", B: "List[float]", Q: int, X: "List[int]"):
print(N, M)
assert len(H) == N - 1
for i in range(N - 1):
assert len(H[i]) == M - 2
... | kyuridenamida/atcoder-tools | tests/resources/test_codegen/test_default_code_generators_and_templates/python/expected_echo_generated_code.py | Python | mit | 1,316 |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - fullsearch action
This is the backend of the search form. Search pages and print results.
@copyright: 2001 by Juergen Hermann <jh@web.de>
@license: GNU GPL, see COPYING for details.
"""
import re, time
from MoinMoin.Page import Page
from MoinMoi... | Glottotopia/aagd | moin/local/moin/build/lib.linux-x86_64-2.6/MoinMoin/action/fullsearch.py | Python | mit | 10,979 |
import unittest
from tests.test_basic import BaseTestCase
from datetime import timedelta, datetime, tzinfo
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return timedelta(0)
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return timedelta(0)
class UtilTestCase(... | EricSchles/python-route53 | tests/test_util.py | Python | mit | 916 |
from .tornadoconnection import TornadoLDAPConnection
| Noirello/bonsai | src/bonsai/tornado/__init__.py | Python | mit | 53 |
# -*- encoding: utf-8 -*-
from __future__ import print_function, unicode_literals, division, absolute_import
from enocean.protocol.eep import EEP
eep = EEP()
# profiles = eep.
def test_first_range():
offset = -40
values = range(0x01, 0x0C)
for i in range(len(values)):
minimum = float(i * 10 + off... | kipe/enocean | enocean/protocol/tests/test_temperature_sensors.py | Python | mit | 1,616 |
def powers_of_two(limit):
value = 1
while value < limit:
yield value
value += value
# Use the generator
for i in powers_of_two(70):
print(i)
# Explore the mechanism
g = powers_of_two(100)
assert str(type(powers_of_two)) == "<class 'function'>"
assert str(type(g)) == "<class 'generator'>"
a... | rtoal/ple | python/powers_of_two.py | Python | mit | 409 |
from core.himesis import Himesis, HimesisPostConditionPattern
import cPickle as pickle
from uuid import UUID
class HReconnectMatchElementsRHS(HimesisPostConditionPattern):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HReconnectMatchElementsRHS.
"""
... | levilucio/SyVOLT | GM2AUTOSAR_MM/merge_inter_layer_rules/Himesis/HReconnectMatchElementsRHS.py | Python | mit | 6,605 |
# 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.
#---------------------------------------------------------------------... | lmazuel/azure-sdk-for-python | azure-mgmt-containerregistry/tests/test_mgmt_containerregistry_2017_03_01.py | Python | mit | 4,129 |
"""
Absorption chillers
"""
import cea.config
import cea.inputlocator
import pandas as pd
import numpy as np
from math import log, ceil
import sympy
from cea.constants import HEAT_CAPACITY_OF_WATER_JPERKGK
from cea.analysis.costs.equations import calc_capex_annualized, calc_opex_annualized
__author__ = "Shanshan Hsieh... | architecture-building-systems/CEAforArcGIS | cea/technologies/chiller_absorption.py | Python | mit | 20,692 |
"""
Copyright (c) 2013 Timon Wong
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, distribute, sub... | Lyleo/OmniMarkupPreviewer | OmniMarkupLib/Renderers/base_renderer.py | Python | mit | 4,974 |
"""
Test that no StopIteration is raised inside a generator
"""
# pylint: disable=missing-docstring,invalid-name,import-error, try-except-raise, wrong-import-position,not-callable,raise-missing-from
import asyncio
class RebornStopIteration(StopIteration):
"""
A class inheriting from StopIteration exception
... | ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/s/stop_iteration_inside_generator.py | Python | mit | 3,242 |
import _plotly_utils.basevalidators
class RangebreaksValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="rangebreaks", parent_name="layout.xaxis", **kwargs):
super(RangebreaksValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | plotly/python-api | packages/python/plotly/plotly/validators/layout/xaxis/_rangebreaks.py | Python | mit | 3,243 |
import unittest
import numpy as np
from bsym import ColourOperation, Configuration
from unittest.mock import patch
class ColourOperationTestCase( unittest.TestCase ):
"""Tests for colour operation methods"""
def test_symmetry_operation_is_initialised_from_a_matrix( self ):
matrix = np.array( [ [ 1, 0 ... | bjmorgan/bsym | tests/unit_tests/test_colour_operation.py | Python | mit | 3,191 |
#### 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_wpn_heavy_blaster.iff"
result.attribute_... | obi-two/Rebelion | data/scripts/templates/object/tangible/ship/crafted/weapon/shared_wpn_heavy_blaster.py | Python | mit | 474 |
from .humannum import (
K,
M,
G,
T,
P,
E,
Z,
Y,
humannum,
parsenum,
parseint,
value_to_unit,
unit_to_value,
)
__all__ = [
'K',
'M',
'G',
'T',
'P',
'E',
'Z',
'Y',
'humannum',
'parsenum',
'parseint',
'value_to_unit',
... | sejust/pykit | humannum/__init__.py | Python | mit | 341 |
import datetime
from django.contrib import admin
from django.db.models import Q
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from models import Invoice, InvoiceItem
class InvoiceItemInline(admin.TabularInline):
fieldsets = (
(
None,
... | Mercy-Nekesa/sokoapp | sokoapp/invoicing/admin.py | Python | mit | 3,672 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-11-14 21:43
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('recipe', '0010_auto_20171114_1443'),
]
operations = [
migrations.RemoveField(
... | RyanNoelk/OpenEats | api/v1/recipe/migrations/0011_auto_20171114_1543.py | Python | mit | 466 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
__author__ = 'Anubhav Jain'
__copyright__ = 'Copyright 2014, The Materials Project'
__version__ = '0.1'
__maintainer__ = 'Anubhav Jain'
__email__ = 'ajain@lbl.gov'
__date__ = 'Oct 03, 2014'
| fraricci/pymatgen | pymatgen/analysis/cost/__init__.py | Python | mit | 300 |
# -*- coding: utf-8 -*-
#
# agile-analytics documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 17 13:58:53 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fil... | cmheisel/agile-analytics | docs/conf.py | Python | mit | 9,780 |
#### 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/deed/event_perk/shared_fed_dub_2x10_honorguard_deed.iff"
result.att... | anhstudios/swganh | data/scripts/templates/object/tangible/deed/event_perk/shared_fed_dub_2x10_honorguard_deed.py | Python | mit | 491 |
#### 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/container/drum/shared_pob_ship_loot_box.iff"
result.attribute_templ... | anhstudios/swganh | data/scripts/templates/object/tangible/container/drum/shared_pob_ship_loot_box.py | Python | mit | 468 |
#!/usr/bin/env python
import TransferErrors as TE
import cPickle as pickle
with open('stuck.pkl','rb') as pklfile:
stuck = pickle.load(pklfile)
TE.makeBasicTable(stuck,TE.workdir+'html/table.html',TE.webdir+'table.html')
TE.makeCSV(stuck,TE.webdir+'data.csv')
for basis in [-6,-5,-4,-3,-1,1,2]:
TE.makeJson(stuck... | sidnarayanan/TransferErrors | bin/write.py | Python | mit | 382 |
#### 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 = Static()
result.template = "object/static/naboo/shared_waterfall_naboo_falls_01.iff"
result.attribute_template_id... | anhstudios/swganh | data/scripts/templates/object/static/naboo/shared_waterfall_naboo_falls_01.py | Python | mit | 450 |
# created by Chirath R, chirath.02@gmail.com
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from workshop.views import WorkshopRegistrationListView, WorkshopDetailView, WorkshopRegistrationUpdateView, \
WorkshopRegisterFormVi... | amfoss/fosswebsite | workshop/urls.py | Python | mit | 2,168 |
# Globals for the directions
# Change the values as you see fit
EAST = None
NORTH = None
WEST = None
SOUTH = None
class Robot:
def __init__(self, direction=NORTH, x_pos=0, y_pos=0):
pass
| jmluy/xpython | exercises/practice/robot-simulator/robot_simulator.py | Python | mit | 201 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-12-09 01:08
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("hordak", "0005_account_currencies")]
operations = [
migrations.RunSQL(
"""
... | adamcharnock/django-hordak | hordak/migrations/0006_auto_20161209_0108.py | Python | mit | 1,488 |
# -*- coding: utf-8 -*-
from thriftpy.protocol import TJSONProtocol
from thriftpy.thrift import TPayload, TType
from thriftpy.transport import TMemoryBuffer
from thriftpy._compat import u
import thriftpy.protocol.json as proto
class TItem(TPayload):
thrift_spec = {
1: (TType.I32, "id"),
2: (TTyp... | maralla/thriftpy | tests/test_json_protocol.py | Python | mit | 2,543 |
# 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 acc... | LockScreen/Backend | venv/lib/python2.7/site-packages/awscli/customizations/cloudsearchdomain.py | Python | mit | 1,074 |
from http import HTTPStatus
from typing import Callable
from typing import Dict
from typing import List
from typing import Union
import demistomock as demisto
import requests
from CommonServerPython import *
from CommonServerUserPython import *
from intezer_sdk import consts
from intezer_sdk.analysis import Analysis
f... | demisto/content | Packs/Intezer/Integrations/IntezerV2/IntezerV2.py | Python | mit | 16,706 |
from schema import *
| ckan/ckanext-issues | ckanext/issues/logic/schema/__init__.py | Python | mit | 21 |
# -*- coding: utf-8 -*-
"""Test CLR field support."""
import System
import pytest
from Python.Test import FieldTest
def test_public_instance_field():
"""Test public instance fields."""
ob = FieldTest()
assert ob.PublicField == 0
ob.PublicField = 1
assert ob.PublicField == 1
with pytest.rai... | AlexCatarino/pythonnet | tests/test_field.py | Python | mit | 8,719 |
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py | Python | mit | 1,829 |
#!/usr/bin/env python
# ======================================================================
import pangloss
import sys,getopt,cPickle,numpy
import scipy.stats as stats
# ======================================================================
def Calibrate(argv):
"""
NAME
Calibrate.py
PURPOSE... | enoordeh/Pangloss | Calibrate.py | Python | gpl-2.0 | 10,551 |
from pulp.bindings import auth, consumer, consumer_groups, repo_groups, repository
from pulp.bindings.actions import ActionsAPI
from pulp.bindings.content import OrphanContentAPI, ContentSourceAPI, ContentCatalogAPI
from pulp.bindings.event_listeners import EventListenerAPI
from pulp.bindings.server_info import ServerI... | rbramwell/pulp | bindings/pulp/bindings/bindings.py | Python | gpl-2.0 | 3,641 |
import re
WHITE_LIST = {
'names': {
'eno': {},
'evo': {},
'ii': {},
'li': {'alias': 'Ii'},
'utö': {},
'usa': {}
},
'patterns': [
{
'find': re.compile('([A-ZÄÖa-zäö-]*)(mlk)'),
'replace': r'\1 mlk'
}
]
} | Learning-from-our-past/Kaira | names/location_name_white_list.py | Python | gpl-2.0 | 260 |
#
# exception.py - general exception formatting and saving
#
# Copyright (C) 2000-2013 Red Hat, Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of ... | maxamillion/anaconda | pyanaconda/exception.py | Python | gpl-2.0 | 14,461 |
#
# Copyright 2015-2020 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | nirs/vdsm | tests/passwords_test.py | Python | gpl-2.0 | 6,754 |
from ij import IJ
from ij.gui import NonBlockingGenericDialog
from ij import WindowManager
from ij.gui import WaitForUserDialog
from ij import ImageStack
from ij import ImagePlus
theImage = IJ.getImage()
sourceImages = []
if theImage.getNChannels() == 1:
IJ.run("8-bit")
sourceImages.append(theImage)
else:
sourceIm... | stalepig/deep-mucosal-imaging | dmi_0.3/Isolate_stack_ROI2.py | Python | gpl-2.0 | 2,120 |
# 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.
"""Add data_migration table
Revision ID: 2e171e6198e6
Revises: 15d3fad... | jtoppins/beaker | Server/bkr/server/alembic/versions/2e171e6198e6_add_data_migration_table.py | Python | gpl-2.0 | 863 |
#!/usr/bin/env python
# Dependencies.py - discover, read, and write dependencies file for make.
# The format like the output from "g++ -MM" which produces a
# list of header (.h) files used by source files (.cxx).
# As a module, provides
# FindPathToHeader(header, includePath) -> path
# FindHeadersInFile(filePath... | apmckinlay/csuneido | vs2019scintilla/scripts/Dependencies.py | Python | gpl-2.0 | 5,533 |
# -*- coding: utf-8 -*-
#
# This file is part of HEPData.
# Copyright (C) 2016 CERN.
#
# HEPData 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... | HEPData/hepdata3 | tests/hepdata_test.py | Python | gpl-2.0 | 1,117 |
#!/bin/env python
import sys
import os
args = sys.argv[1:]
files = args[0:-1]
newdir = args[-1]
for file in files:
cmd = "svn mv %s %s/" % (file,newdir)
print cmd
os.system(cmd)
| chryswoods/Sire | corelib/build/svnmvall.py | Python | gpl-2.0 | 200 |
#!/usr/bin/env python
#############################################################
# ubi_reader/ubi_io
# (c) 2013 Jason Pruitt (jrspruitt@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Founda... | Dima73/pli-openmultibootmanager | src/ubi_reader/ubi_io/__init__.py | Python | gpl-2.0 | 5,452 |
# Copyright (c) 2011 Nick Hurley <hurley at todesschaf dot org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,... | todesschaf/pgl | pgl.py | Python | gpl-2.0 | 4,786 |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
try:
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
except ImportError:
has_xml=False
ContentHandler=object
else:
has_xml=True
import os,sys
f... | oli-kester/advanced-av-examples | amp-osc-lv2/.waf-1.8.5-3556be08f33a5066528395b11fed89fa/waflib/Tools/qt5.py | Python | gpl-2.0 | 14,329 |
# Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.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; either version 2 of th... | chen0031/rekall | rekall-core/rekall/plugins/tools/json_test.py | Python | gpl-2.0 | 6,226 |
# -*- Mode: python; coding:utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2012 David Strauss <david@davidstrauss.net>
# Copyright 2012 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
# Copyright 2012 Marti Raudsepp <marti@juffo.org>
#
# systemd is free software; you can redist... | hach-que/systemd-packaged | src/python-systemd/journal.py | Python | gpl-2.0 | 20,444 |
# -*- test-case-name: twisted.test.test_newcred -*-
from twisted.internet import defer
from twisted.python import components, failure
from twisted.cred import error, credentials
class ICredentialsChecker(components.Interface):
"""I check sub-interfaces of ICredentials.
@cvar credentialInterfaces: A list of s... | fxia22/ASM_xf | PythonD/site_python/twisted/cred/checkers.py | Python | gpl-2.0 | 2,547 |
## update-hue-ini.py
##
## This script will extract the appropriate IBM Analytics for Apache Hadoop credentials from the VCAP_SERVICES
## environment variable inside a running container. It will add the username and password to the hue.ini file
## so that the hue application has access to a specific instance
import s... | vmanoria/bluemix-hue-filebrowser | update-hue-ini.py | Python | gpl-2.0 | 1,829 |
#!/usr/bin/python
"""
Program that parses standard format results,
compute and check regression bug.
:copyright: Red Hat 2011-2012
:author: Amos Kong <akong@redhat.com>
"""
import os
import sys
import re
import commands
import warnings
import ConfigParser
import MySQLdb
def exec_sql(cmd, conf="../../global_config.i... | will-Do/avocado-vt | scripts/regression.py | Python | gpl-2.0 | 20,876 |
import unittest, tempfile, sys, os.path
datadir = os.environ.get('APPORT_DATA_DIR', '/usr/share/apport')
sys.path.insert(0, os.path.join(datadir, 'general-hooks'))
import parse_segv
# Default global registers, maps, and disassembly for testing
regs = '''eax 0xffffffff -1
ecx 0xbfc6af40 -10774... | rickysarraf/apport | test/test_parse_segv.py | Python | gpl-2.0 | 24,951 |
from boxbranding import getBoxType, getBrandOEM
from Components.About import about
class HardwareInfo:
device_name = None
device_version = None
def __init__(self):
if HardwareInfo.device_name is not None:
# print "using cached result"
return
HardwareInfo.device_name = "unknown"
try:
file = open("/pr... | BlackHole/enigma2-1 | lib/python/Tools/HardwareInfo.py | Python | gpl-2.0 | 1,714 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import datetime
import re
from pandas.compat import (zip, range, lrange, StringIO)
from pandas import (DataFrame, Series, Index, date_range, compat,
Timestamp)
import pandas as pd
from numpy import nan
import numpy as np... | pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pandas/tests/frame/test_replace.py | Python | gpl-2.0 | 42,783 |
# PopGen 1.1 is A Synthetic Population Generator for Advanced
# Microsimulation Models of Travel Demand
# Copyright (C) 2009, Arizona State University
# See PopGen/License
DEFAULT_PERSON_PUMS2000_QUERIES = [ "alter table person_pums add column agep bigint",
"alter table person_pu... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/synthesizer/gui/default_census_cat_transforms.py | Python | gpl-2.0 | 42,838 |
# -*- coding: utf-8 -*-
#
# test_errors.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | hakonsbm/nest-simulator | pynest/nest/tests/test_errors.py | Python | gpl-2.0 | 2,240 |
# 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 |