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
#!/usr/bin/env python """Tests for datastore cleaning cron flows.""" import re from grr.lib import aff4 from grr.lib import config_lib from grr.lib import data_store from grr.lib import flags from grr.lib import flow from grr.lib import hunts from grr.lib import rdfvalue from grr.lib import test_lib from grr.lib im...
pchaigno/grr
lib/flows/cron/data_retention_test.py
Python
apache-2.0
12,342
from dateutil.parser import parse class Entity(object): """ Entity object with helper functions and properties. """ @property def id(self): if not self.key: return None return self.key.id def _ensure_date(date): """ Checks that date is not a string. May also ...
ccutch/ccutch-blog
notebooks/_helpers.py
Python
apache-2.0
603
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
tensorflow/moonlight
moonlight/structure/barlines_test.py
Python
apache-2.0
5,147
# coding=utf-8 # Copyright 2021 The Reach ML Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
google-research/ibc
ibc/utils/strategy_policy.py
Python
apache-2.0
3,704
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
rahulunair/nova
nova/tests/functional/regressions/test_bug_1746483.py
Python
apache-2.0
4,393
# Copyright 2016 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...
HaebinShin/tensorflow
tensorflow/contrib/learn/python/learn/estimators/logistic_regressor.py
Python
apache-2.0
5,618
# Copyright 2010 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
rhyolight/nupic.son
app/soc/modules/seeder/logic/providers/date.py
Python
apache-2.0
11,319
# -*- coding: utf-8 -*- # # Copyright (c) 2017 Intel Corp. # """ ProvisionDeleteCommand """ from .. import Command, CommandResult from ...plugin import DeclarePlugin @DeclarePlugin('provisioner_delete', 100) class ProvisionerDeleteCommand(Command): """ Delete a device from the provisioner. """ def __...
intel-ctrlsys/actsys
actsys/control/commands/provisioner/provisioner_delete.py
Python
apache-2.0
1,450
# Copyright 2018-present Kensho Technologies, LLC. from decimal import Decimal from typing import Any, Dict, List, Tuple, TypeVar, Union from pyorient.orient import OrientDB from redisgraph.client import Graph import six from sqlalchemy.engine.base import Engine from ... import graphql_to_match, graphql_to_redisgraph...
kensho-technologies/graphql-compiler
graphql_compiler/tests/integration_tests/integration_test_helpers.py
Python
apache-2.0
7,250
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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.or...
FederatedAI/FATE
python/federatedml/util/classify_label_checker.py
Python
apache-2.0
3,017
# Copyright (c) 2015 IBM Corporation and others. # # 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...
Brunel-Visualization/Brunel
python/brunel/magics.py
Python
apache-2.0
4,059
# coding:utf-8 __author__ = 'sinlov' import local_properties def maximize(): browser = local_properties.init_chrome() # let browser max size browser.maximize_window() return browser def mobile_iphone_5(): browser = local_properties.init_chrome() browser.set_window_size(320, 568) return b...
sinlov/WebTestSeleniumPython
utils/chrome_webdriver.py
Python
apache-2.0
327
# 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...
raulanatol/awsebcli
ebcli/core/abstractcontroller.py
Python
apache-2.0
4,200
try: from unittest2 import TestCase from mock import Mock, patch except ImportError: from unittest import TestCase from mock import Mock, patch import datetime from botocore.exceptions import ClientError from dateutil.tz import tzutc from cfn_sphere.aws.cfn import CloudFormation from cfn_sphere.aws.c...
cfn-sphere/cfn-sphere
src/unittest/python/aws_tests/cfn_tests.py
Python
apache-2.0
32,501
#!/usr/bin/env python import os from setuptools import setup from beanstalkc import __version__ as src_version pkg_version = os.environ.get('BEANSTALKC_PKG_VERSION', src_version) setup( name='beanstalkc-timeout', version=pkg_version, py_modules=['beanstalkc_timeout'], author='Michael Schurter', ...
schmichael/beanstalkc-timeout
setup.py
Python
apache-2.0
1,123
from ray import workflow # TODO(ekl) should support something like runtime_env={"pip": ["whalesay"]} @workflow.step def hello(msg: str) -> None: print(msg) if __name__ == "__main__": workflow.init() hello.step("hello world").run()
ray-project/ray
python/ray/workflow/examples/comparisons/argo/hello_world_workflow.py
Python
apache-2.0
247
# -*- encoding:utf-8 -*- """ {{ project_name }} URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/{{ docs_version }}/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatt...
WilliamRen/django_admin_templates
project_name/urls.py
Python
apache-2.0
1,447
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
napalm-automation/napalm-yang
napalm_yang/models/openconfig/system/ntp/state/__init__.py
Python
apache-2.0
19,427
# Copyright 2020 Makani Technologies LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
google/makani
analysis/log_analysis/time_logs.py
Python
apache-2.0
23,795
# -*- coding: utf-8 -*- # # Copyright 2015 Simone Campagna # # 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...
simone-campagna/sheru
packages/sheru/users_config.py
Python
apache-2.0
885
# from . observation_model import Observation # from . insect_model import Insect # from . news_model import News
jessica-younker/I-Got-Bugs
api/Bugz/models/__init__.py
Python
apache-2.0
113
# Copyright 2015 OpenStack Foundation # 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 requ...
cisco-openstack/tempest
tempest/thirdparty/cisco/utils.py
Python
apache-2.0
3,683
from rest_framework.views import APIView from rest_framework.response import Response from rememerme.friends.rest.friends.forms import FriendsGetListForm, FriendsDeleteForm from rememerme.friends.rest.exceptions import BadRequestException from rest_framework.permissions import IsAuthenticated class FriendsListView(API...
rememerme/friends-api
rememerme/friends/rest/friends/views.py
Python
apache-2.0
1,352
from datetime import datetime import logging import os.path import re import uuid import weakref from dateutil import parser from django.core.exceptions import ObjectDoesNotExist from django.contrib.contenttypes.models import ContentType from django.utils.functional import cached_property from geoip2.models import City...
zentralopensource/zentral
zentral/core/events/base.py
Python
apache-2.0
18,396
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-vision
google/cloud/vision_v1p2beta1/types/geometry.py
Python
apache-2.0
2,735
# Domato - main generator script # ------------------------------- # # Written and maintained by Ivan Fratric <ifratric@google.com> # # 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 wi...
googleprojectzero/domato
canvas/generator.py
Python
apache-2.0
4,366
# Copyright (c) 2013 OpenStack Foundation # 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 ...
huntxu/neutron
neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py
Python
apache-2.0
65,564
# Copyright 2019 New Vector Ltd # # 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 writin...
matrix-org/synapse
tests/handlers/test_stats.py
Python
apache-2.0
19,293
# -*- coding: utf-8 -*- """ Create at 16/12/13 """ __author__ = 'TT' time_line = { '2016-02-12': '', }
ryanduan/single-dog
models/timeline.py
Python
apache-2.0
110
import numpy as np import torch import torch.nn.functional as F def look(vertices, eye, direction=[0, 1, 0], up=None): """ "Look" transformation of vertices. """ if (vertices.ndimension() != 3): raise ValueError('vertices Tensor should have 3 dimensions') device = vertices.device if ...
google/lasr
third_party/softras/soft_renderer/functional/look.py
Python
apache-2.0
1,643
############################################################################### ## ## Copyright (C) 2011-2014 Tavendo GmbH ## ## 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 ## ## h...
luhn/AutobahnPython
examples/twisted/wamp/work/deployment_options/client.py
Python
apache-2.0
4,224
#FLM: Print current Glyph kerning pairs # Description: # Print all Kerning Pairs for the selected glyph # To-do: # It only report main pairs, not fully expanded if the font uses classes # Credits: # Pablo Impallari # Clear Output windows from FL import * fl.output="" # Imports from robofab.world im...
impallari/Impallari-Fontlab-Macros
IMP Kerning/02 Print glyph kerns.py
Python
apache-2.0
883
from django.conf.urls import url from . import views import django.contrib.auth.views app_name = "accounts" urlpatterns = [ url(r'^login/$', views.user_login, name='login'), url(r'^logout/$', django.contrib.auth.views.logout_then_login, name='logout'), url(r'^password-change/$', views.change_password, nam...
liyao001/BioQueue
accounts/urls.py
Python
apache-2.0
402
# -*- coding: utf-8 -*- # Scrapy settings for scrapy_ project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/latest...
LAsbun/scrapy_practice
scrapy_practice/settings.py
Python
apache-2.0
3,363
#!/usr/bin/env python3 import numpy as np import pyboof as pb from pyboof.swing import visualize_matches # Load two images image0 = pb.load_single_band("../data/example/stitch/cave_01.jpg", np.uint8) image1 = pb.load_single_band("../data/example/stitch/cave_02.jpg", np.uint8) # Set up the SURF fast hessian feature ...
lessthanoptimal/PyBoof
examples/match_features.py
Python
apache-2.0
1,659
from flask import Blueprint # main = Blueprint('main', __name__, template_folder='pages') main = Blueprint('main', __name__) from . import views
Walk-ContryRoad/Lemon
lemon_master/app/main/__init__.py
Python
apache-2.0
150
import core from importlib import import_module from loremdb.util import OptionsParser import re class Table(core.Table): def __init__(self, *args, **kargs): super(Table, self).__init__(*args, **kargs) self.field_creator = FieldCreatorFromMysql() self.__fields = None def _create_inser...
alissonperez/loremdb
loremdb/database/mysql.py
Python
apache-2.0
7,864
#!/usr/bin/env python # # original code from # https://github.com/giampaolo/psutil/blob/master/examples/ # # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ A clone of 'netstat'. """ import socke...
ruo91/scouter
scouter.host/scouter/host/netstat.py
Python
apache-2.0
2,891
## # Copyright (c) 2008-2017 Apple 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 l...
macosforge/ccs-calendarserver
txdav/caldav/datastore/scheduling/imip/test/test_inbound.py
Python
apache-2.0
18,480
# 240. Search a 2D Matrix II # # Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: # # Integers in each row are sorted in ascending from left to right. # Integers in each column are sorted in ascending from top to bottom. # For example, # # Consider the...
gengwg/leetcode
240_search_2d_matrix_ii.py
Python
apache-2.0
1,854
from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.md'), encoding='utf-8') as ...
govro/ckanext-inventory
setup.py
Python
apache-2.0
3,590
#!/usr/bin/env python3 ''' A script for running worker processes Copyright 2012-2020 Codinuum Software Lab <https://codinuum.com> 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 ...
codinuum/cca
python/src/cca/ccautil/run_workers.py
Python
apache-2.0
5,394
from django.test import TestCase, Client from django.core.management import call_command from pricing.models import AWS from pricing.models import GCP import os import tempfile import shutil class ViewTest(TestCase): # small chunk of database fixtures = ['test_db.json'] def setUp(self): pass ...
johnmuth81/cloud-compare
tests/test_views.py
Python
apache-2.0
922
# Copyright 2016 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...
rew4332/tensorflow
tensorflow/tools/dist_test/python/census_widendeep.py
Python
apache-2.0
11,215
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-07 21:21 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True depen...
lamenezes/agendi
core/migrations/0001_initial.py
Python
apache-2.0
7,389
# 3rd-party modules from lxml.builder import E # module packages from jnpr.junos.cfg import Resource from jnpr.junos import jxml as JXML from jnpr.junos.cfg.srx.nat.nat_src_rule import NatSrcRule class NatSrcRuleSet(Resource): """ [edit security nat source rule-set <name>] """ PROPERTIES = [ ...
dgjnpr/py-junos-eznc
lib/jnpr/junos/cfg/srx/nat/nat_src_ruleset.py
Python
apache-2.0
3,030
#!/usr/bin/env python """ Copyright 2013 OpERA 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 agree...
ComputerNetworks-UFRGS/OpERA
python/app/ofdm_estimation/tsha_file.py
Python
apache-2.0
10,670
# -*- encoding: utf-8 -*- # # Copyright © 2012 eNovance <licensing@enovance.com> # # 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...
ruyang/ironic
ironic/common/service.py
Python
apache-2.0
2,084
# Copyright 2020 DeepMind Technologies Limited. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
deepmind/meltingpot
meltingpot/python/configs/substrates/running_with_scissors_in_the_matrix.py
Python
apache-2.0
20,186
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or '123456seven' SSL_DISABLE = False SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_RECORD_QUERIES = True MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 587 ...
Tuklab/tuklab101
config.py
Python
apache-2.0
3,339
# Copyright 2017 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 agreed to in writing, s...
felixbb/forseti-security
tests/scanner/audit/buckets_rules_engine_test.py
Python
apache-2.0
3,414
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
google-research/google-research
kws_streaming/layers/magnitude_rdft_test.py
Python
apache-2.0
1,709
# # 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 License, Version 2.0 # (the "License"); you may not us...
axbaretto/beam
sdks/python/apache_beam/transforms/validate_runner_xlang_test.py
Python
apache-2.0
11,502
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to extract type libraries.""" import argparse import logging import sys from dfvfs.helpers import volume_scanner as dfvfs_volume_scanner from winregrc import output_writers from winregrc import type_libraries from winregrc import volume_scanner def Main(): ...
libyal/winreg-kb
scripts/type_libraries.py
Python
apache-2.0
2,664
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-pubsub
samples/generated_samples/pubsub_v1_generated_schema_service_create_schema_sync.py
Python
apache-2.0
1,513
# Copyright 2014 - Rackspace Hosting # # 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...
ed-/solum
solum/uploaders/common.py
Python
apache-2.0
1,677
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
mbohlool/client-python
kubernetes/client/models/v1_pod_anti_affinity.py
Python
apache-2.0
7,865
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/ipv4_internal_reachability/prefixes/prefixes_/default_metric/__init__.py
Python
apache-2.0
12,242
# coding=utf-8 # Copyright 2021 The Ravens Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
google-research/ravens
ravens/models/conv_mlp.py
Python
apache-2.0
6,512
# Django settings for dd_auth project. import os from django.utils.translation import ugettext_lazy as _ APP_PATH = os.path.dirname(os.path.abspath(__file__)) DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'EN...
datadealer/dd_auth
dd_auth/settings.py
Python
artistic-2.0
9,438
"""Copyright 2008 Orbitz WorldWide 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, softw...
eberle1080/tesserae-ng
website/graphite/events/urls.py
Python
bsd-2-clause
771
from __future__ import absolute_import, print_function import random import numpy as np from .. import types from .templates import (ConcreteTemplate, AbstractTemplate, AttributeTemplate, CallableTemplate, Registry, signature, bound_function, make_callable_template) #...
gdementen/numba
numba/typing/listdecl.py
Python
bsd-2-clause
6,118
import os import unittest import sys import inmembrane import inmembrane.tests from inmembrane import helpers from inmembrane.plugins import lipop_scrape_web from inmembrane.tests.PluginTestBase import PluginTestBase class TestLipoP(PluginTestBase): _plugin_name = "lipop_scrape_web" def test_lipop_scrape_w...
boscoh/inmembrane
inmembrane/tests/test_lipop_scrape_web.py
Python
bsd-2-clause
1,131
""" A subpackage hosting Numba IR rewrite passes. """ from .registry import register_rewrite, rewrite_registry, Rewrite # Register various built-in rewrite passes from . import static_getitem, static_raise
pombredanne/numba
numba/rewrites/__init__.py
Python
bsd-2-clause
208
import os.path from PyQt4 import QtGui from Orange import data from Orange.data.table import Table from Orange.widgets import gui, widget from Orange.widgets.settings import Setting from Orange.data.io import FileFormats class OWSave(widget.OWWidget): name = "Save" description = "Saves data to a file." ...
qusp/orange3
Orange/widgets/data/owsave.py
Python
bsd-2-clause
3,167
# Copyright (c) 2012-2022, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** from . import AWSObject, AWSProperty, PropsDictType, Tags from .validators import boolean from .validators.ecr import policytypes class PublicRepo...
cloudtools/troposphere
troposphere/ecr.py
Python
bsd-2-clause
4,678
import unittest from awacs.aws import BaseARN, Principal class TestPrincipal(unittest.TestCase): def test_wildcard_principal(self): p = Principal("*") self.assertEqual(p.data, "*") with self.assertRaises(ValueError): p = Principal("*", "FAIL") def test_normal_principal(se...
cloudtools/awacs
tests/test_aws.py
Python
bsd-2-clause
1,653
#!/usr/bin/python import csv import json from distutils import dir_util from subprocess import call import random from sys import argv from sys import platform from collections import OrderedDict csvName = 'Public.csv' groupColumn = 'Institution' ordinals = [] excludes = [] if len(argv)>2: csvName = argv[1] ...
UTSDataArena/examples
parallel/builder/build.py
Python
bsd-2-clause
2,981
# -*- coding: utf-8 -*- """\ ======================= eudat.accounting.client ======================= Upload accounting records to an eudat accounting server """ from setuptools import setup, find_packages import os, sys version = '1.0.2.dev0' this_directory = os.path.abspath(os.path.dirname(__file__)) def read(*na...
EUDAT-DPMT/eudat.accounting.client
setup.py
Python
bsd-2-clause
1,950
from __future__ import unicode_literals import shutil import os HOME = os.path.join('pyupdater', 'vendor') junitxml = os.path.join(HOME, 'PyInstaller', 'lib', 'junitxml', 'tests') unittest2 = os.path.join(HOME, 'PyInstaller', 'lib', 'unittest2') items_to_remove = [junitxml, unittest2] def remove(x): if os.path...
timeyyy/PyUpdater
dev/fix_vendor.py
Python
bsd-2-clause
525
#!/usr/bin/env python import sys import login import radio import init import info import re import logging import playlist import localplaylist import HTMLParser import random import song from PyQt5.QtCore import QObject, QUrl from PyQt5.QtQuick import QQuickView from PyQt5 import QtCore, QtGui, QtWidgets, QtDBus fro...
HenryHu/xmradio
gui.py
Python
bsd-2-clause
26,426
# -*- coding: utf-8 -*- import logging from django.conf import settings from django.utils.hashcompat import md5_constructor from transifex.txcommon.tests import base class FormatsBaseTestCase(base.BaseTestCase): """Base class for tests on supported formats.""" def setUp(self): super(FormatsBaseTestCas...
rvanlaar/easy-transifex
src/transifex/transifex/resources/tests/lib/base.py
Python
bsd-2-clause
1,052
""" This is the actual vision program to be run on the pandaboard. Lots of code is copied directly from the other samples in "python vision stuff". There are 4 modes: -Autonomous (based on hotornot) -Bumper Tracking (based on pyballfinder) -Ball tracking (based on pyballfinder)...
FRC2914/aerial-assist
python vision stuff/Eye Of Sauron/CODE/eyeofsauron.py
Python
bsd-2-clause
7,437
# coding=utf-8 from __future__ import unicode_literals import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = False DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', 'TEST_CHARSET': 'utf8', } } test_db = os.environ.get('DB', 'sqlit...
hovel/pybbm
test/test_project/test_project/settings.py
Python
bsd-2-clause
2,578
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) tests_require = [ 'six==1.6.1', ] setup( name='django-restcms', versi...
osmfj/django-restcms
setup.py
Python
bsd-2-clause
1,520
import bisect import cv2 import glob import numpy as np import sys from ArgParser import parse_args from GPSReader import GPSReader from GPSTransforms import IMUTransforms, absoluteTransforms from LaneMarkingHelper import get_transforms, mk2_to_mk1, BackProjector from LidarTransforms import R_to_c_from_l, utc_from_gps...
sameeptandon/sail-car-log
process/LanesFrom2D.py
Python
bsd-2-clause
3,524
#!/usr/bin/env python2.7 import os.path import subprocess try: from setuptools import setup except ImportError: from distutils.core import setup from distutils.core import Command from distutils.command.build import build as orig_build_cmd class test_cmd(Command): description = 'run unit tests' use...
andrewdotn/vmreflect
setup.py
Python
bsd-2-clause
4,187
from pylab import * outdir = '_output' d = loadtxt(outdir + '/fort.FG1.valuemax') b = loadtxt(outdir + '/fort.FG1.aux1') topo = b[:,4] # for level 3 figure(401) clf()
ForestClaw/forestclaw
applications/geoclaw/chile2010/plotfg.py
Python
bsd-2-clause
170
# TODO: append GeoLoader package to python search path in omegalib: workaround import os.path, sys basePath = os.path.dirname(os.path.abspath(__file__)) # for current dir of file modulePath = os.path.dirname(basePath) # for GeoLoader packages - '/local/examples' sys.path.append(modulePath) from omega import setEventF...
UTSDataArena/examples
earth/LoadKML.py
Python
bsd-2-clause
1,342
import unittest from lxml.etree import Element from streamlink.exceptions import PluginError from streamlink.plugin.api import validate from streamlink.plugin.api.validate import xml_element from streamlink.utils.parse import parse_json, parse_qsd, parse_xml class TestUtilsParse(unittest.TestCase): def test_par...
bastimeyer/streamlink
tests/utils/test_parse.py
Python
bsd-2-clause
3,240
from django import template register = template.Library() @register.simple_tag def make_urn(item): from django.conf import settings agency = getattr(settings, 'ARISTOTLE_DDI_AGENCY', "example.com") if item.version: version = item.version else: version = "0.0.1" urn = 'urn:ddi:%s:%...
LegoStormtroopr/aristotle-ddi-utils
aristotle_ddi_utils/utils.py
Python
bsd-2-clause
1,141
from fabric import operations from fabric import tasks from fabric.api import run from fabric.api import sudo from fabric import context_managers class PuppetBootstrap(tasks.Task): u'''This installs puppet on a bare OS ''' name = u'puppet-bootstrap' def __init__(self, flavour=u'debian', *args, **kwargs): super(...
serverhorror/test-fabric
fabfile.py
Python
bsd-2-clause
2,476
from __future__ import (absolute_import, division, print_function, unicode_literals) from nose.plugins.attrib import attr from nose.tools import assert_raises, raises import numpy as np from numpy.random import RandomState from scipy.stats import norm from ..npc import (fisher, ...
qqqube/permute
permute/tests/test_npc.py
Python
bsd-2-clause
4,620
#!/usr/bin/env python """ @package ion.services.sa.observatory.test.test_platform_multilaunch @file ion/services/sa/observatory/test/test_platform_multilaunch.py @author Carlos Rueda @brief Test multiple startup-shutdown cycles in various platform topologies @see https://jira.oceanobservatories.org/tasks/bro...
ooici/coi-services
ion/services/sa/observatory/test/test_platform_multilaunch.py
Python
bsd-2-clause
6,919
import logging logger = logging.getLogger() logger.setLevel(logging.WARNING) #def pytest_ignore_collect(path, config): # print config.option
shiquanwang/numba
numba/tests/conftest.py
Python
bsd-2-clause
145
import urllib2 from bs4 import BeautifulSoup def get_server_details(server, port, mount): server = "http://%s:%s/status.xsl?mount=/%s" % (server, port, mount) print "Getting info for %s" % (server) try: response = urllib2.urlopen(server) html = response.read() if html: s...
fergalmoran/pyicequery
pyicequery.py
Python
bsd-2-clause
1,606
from invoke.tasks import task @task(aliases=('bar', 'otherbar')) def foo(): """ Foo the bar. """ pass @task def foo2(): """ Foo the bar: example code Added in 1.0 """ pass @task(default=True) def biz(): pass @task(help={'why': 'Motive', 'who': 'Who to punch'}) def pu...
ericholscher/invoke
tests/_support/decorator.py
Python
bsd-2-clause
630
""" Contains model unit tests. """ from django.test import TestCase from wagtail.wagtailadmin.edit_handlers import ObjectList from ..models import ( EmailLink, ExternalLink, Link ) class TestLink(TestCase): def test_edit_handler(self): self.assertTrue( isinstance(Link.edit_handle...
thenewguy/wagtailplus
wagtailplus/wagtaillinks/tests/test_models.py
Python
bsd-2-clause
1,615
import claripy import nose def test_fallback_abstraction(): bz = claripy.backends.z3 a = claripy.BVV(5, 32) b = claripy.BVS('x', 32, explicit_name=True) c = a+b d = 5+b e = b+5 f = b+b g = a+a nose.tools.assert_false(a.symbolic) nose.tools.assert_true(b.symbolic) nose.tool...
chubbymaggie/claripy
tests/test_fallback_abstraction.py
Python
bsd-2-clause
1,518
""" Idempotent API for managing PostgreSQL users and databases """ import os.path from fabtools.files import is_file from fabtools.postgres import * from fabtools.require.deb import package from fabtools.require.service import started def server(version='8.4'): """ Require a PostgreSQL server """ pac...
tasostasos/fabtools
fabtools/require/postgres.py
Python
bsd-2-clause
824
""" Drop-in replacement for ``django.conf.settings`` that provides a consistent access method for settings defined in applications, the project or Django itself. Settings can also be made editable via the admin. """ from __future__ import unicode_literals from future.builtins import bytes, str from functools import p...
Kniyl/mezzanine
mezzanine/conf/__init__.py
Python
bsd-2-clause
8,260
#!/usr/bin/env python import logging import nose import os import cle TEST_BASE = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.join('..', '..', 'binaries')) def test_exe(): exe = os.path.join(TEST_BASE, 'tests', 'x86', 'windows', 'TLS.exe') ld = ...
Ruide/angr-dev
cle/tests/test_pe.py
Python
bsd-2-clause
6,252
from __future__ import with_statement import sys import inspect from traceback import format_exception_only from attest import (Tests, Assert, assert_hook, TestFailure, COMPILES_AST, utils) import attest from . import _meta SOURCEFILE = inspect.getsourcefile(_meta) LINENO = 21 EXCEPTION = forma...
dag/attest
attest/tests/reporters.py
Python
bsd-2-clause
3,034
# Copyright 2008-2009 Owen Taylor # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import gtk import os from application import ap...
alexey4petrov/reinteract
lib/reinteract/save_file.py
Python
bsd-2-clause
2,653
# Load the custom app config default_app_config = 'tethys_datasets.apps.TethysDatasetsConfig'
CI-WATER/django-tethys_datasets
tethys_datasets/__init__.py
Python
bsd-2-clause
93
# This module used to create multi worker processes shipped with a manager # And it's only a framework which will manager the process create, quit, etc. # It'll be used in daemon. from __future__ import print_function, absolute_import __all__ = ['Worker', 'Manager', 'make_log'] __version__ = '0.1' import os import s...
wwfifi/uliweb
uliweb/utils/workers.py
Python
bsd-2-clause
8,794
import logging, sys logging.basicConfig() logger = logging.getLogger('pbs_bullet.watcher') try: from subprocess32 import check_output, call except: logger.error("pbs_bullet uses the check_output command, added in python 2.7.") sys.exit(1) from notify import Notifier class Watcher(object): def __init__...
greenape/pbs_bullet
pbsbullet/watcher.py
Python
bsd-2-clause
9,653
__author__ = 'Alek Ratzloff <alekratz@gmail.com>' from socket import socket class ThinClient: """ Python client used for doing stuff... Thinly """ def __init__(self, port, host="127.0.0.1", recv_size=1024): self.port = port self.host = host self.recv_size = recv_size s...
alekratz/pythinclient
pythinclient/client.py
Python
bsd-3-clause
2,352
from django.template import Library from django_countries.fields import Country register = Library() language_country_map = { 'nl': 'nl', 'en': 'gb', 'zh': 'cn', } @register.simple_tag(takes_context=False) def language_flag_url(language_code): language_code = language_code.lower() if language_code in langua...
mverleg/svsite
source/base/templatetags/language_flags.py
Python
bsd-3-clause
428
from solrcloudpy.connection import SolrConnection from solrcloudpy.collection import SolrCollection from solrcloudpy.parameters import SearchOptions import logging logging.basicConfig() __version__ = "3.0.3" __all__ = ['SolrCollection', 'SolrConnection', 'SearchOptions']
dfdeshom/solrcloudpy
solrcloudpy/__init__.py
Python
bsd-3-clause
273