code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
import glob json_files = glob.glob("tests/**/output/**/*.json", recursive=True) html_files = glob.glob("tests/**/output/**/*.html", recursive=True) html_list = "" for f_ in html_files: html_list += '\t<li><a href="{}">{}</li>\n'.format( f_[6:], f_.split(".")[-2], ) json_list = "" for f_ in js...
great-expectations/great_expectations
tests/build_index_page.py
Python
apache-2.0
628
#!/usr/bin/env python import telnetlib import time import socket import sys import getpass TELNET_PORT = 23 TELNET_TIMEOUT = 6 def send_command(remote_conn, cmd): ''' Initiate the Telnet Session ''' cmd = cmd.rstrip() remote_conn.write(cmd + '\n') time.sleep(1) return remote_conn.read_ver...
gahlberg/pynet_class_work
class2/ex2a_telnet.py
Python
apache-2.0
1,588
#!/usr/bin/env python from __future__ import unicode_literals '''Generate header file for nanopb from a ProtoBuf FileDescriptorSet.''' nanopb_version = "nanopb-0.3.9.2" import sys import re import codecs from functools import reduce try: # Add some dummy imports to keep packaging tools happy. import google,...
google/myelin-acorn-electron-hardware
third_party/nanopb/generator/nanopb_generator.py
Python
apache-2.0
70,423
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('base', '0003_auto_20151109_2002'), ] operations = [ migrations.AlterField( model_name='bodega', name...
harvyv/johnmay
base/migrations/0004_auto_20151223_1440.py
Python
apache-2.0
883
import os from copy import deepcopy bids_schema = { # BIDS identification bits 'modality': { 'type': 'string', 'required': True }, 'subject_id': { 'type': 'string', 'required': True }, 'session_id': {'type': 'string'}, 'run_id': {'type': 'string'}, 'acq_i...
poldracklab/mriqcwebapi
dockereve-master/eve-app/settings.py
Python
apache-2.0
15,268
#!/usr/bin/env python2 ''' Description: Author: Ronald van Haren, NLeSC (r.vanharen@esciencecenter.nl) Created: - Last Modified: - License: Apache 2.0 Notes: - ''' from lxml.html import parse import csv import urllib2 from lxml import html import numbers import json import os import ut...
rvanharen/SitC
knmi_getdata.py
Python
apache-2.0
5,962
# # 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 n...
wangyixiaohuihui/spark2-annotation
python/pyspark/ml/__init__.py
Python
apache-2.0
1,130
from django.db.models import Count from dcim.models import Device, Interface from extras.api.views import CustomFieldModelViewSet from utilities.api import FieldChoicesViewSet, ModelViewSet from utilities.utils import get_subquery from virtualization import filters from virtualization.models import Cluster, ClusterGro...
lampwins/netbox
netbox/virtualization/api/views.py
Python
apache-2.0
3,151
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('data', one_hot=True) mnist_train = mnist.train mnist_val = mnist.validation p = 28 * 28 n = 10 h1 = 300 func_act = tf.nn.sigmoid x_pl = tf.placeholder(dtype=tf.float32, shape=[None, p]) y_pl = tf.pl...
bm2-lab/MLClass
cgh_deep_learning/mnist_mlp.py
Python
apache-2.0
1,723
from ..remote import RemoteModel from infoblox_netmri.utils.utils import check_api_availability class DeviceObjectObjectRemote(RemoteModel): """ Network Objects cross usage | ``DeviceObjectObjectID:`` The internal NetMRI identifier of this usage relationship between network objects. | ``attribute ...
infobloxopen/infoblox-netmri
infoblox_netmri/api/remote/models/device_object_object_remote.py
Python
apache-2.0
3,242
# Copyright 2014 Isotoma 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
yaybu/touchdown
touchdown/aws/vpc/subnet.py
Python
apache-2.0
5,439
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
kayhayen/Nuitka
tests/syntax/ClassReturn.py
Python
apache-2.0
791
# Copyright 2021, Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
google-research/mint
mint/ctl/single_task_trainer.py
Python
apache-2.0
8,299
# -*- coding: utf-8 -*- from logging import getLogger from cornice.resource import resource, view from openprocurement.api.models import Complaint, STAND_STILL_TIME, get_now from openprocurement.api.utils import ( apply_patch, save_tender, add_next_award, error_handler, update_journal_handler_params...
selurvedu/openprocurement.api
src/openprocurement/api/views/award_complaint.py
Python
apache-2.0
6,347
#!/usr/bin/env python # For python 2.6-2.7 from __future__ import print_function from os.path import * import re # from parseBrackets import parseBrackets from parseDirectiveArgs import parseDirectiveArguments class MyError(Exception): def __init__(self, value): self.value = value def __str__(self)...
LungNoodle/lungsim
tests/pFUnit-3.2.9/bin/pFUnitParser.py
Python
apache-2.0
34,426
from django.template import RequestContext from django.shortcuts import render_to_response from django.db import connection from collections import OrderedDict from datetime import datetime import time import scipy.cluster.hierarchy as hcluster import numpy as np class ObsoletedTasksReport: def __init__(self): ...
PanDAWMS/panda-bigmon-core
core/reports/ObsoletedTasksReport.py
Python
apache-2.0
9,797
from django.db import models, migrations import uuid from django.contrib.auth.hashers import make_password PUBLIC_ID = 1 def apply_migration(apps, schema_editor): Group = apps.get_model('auth', 'Group') public_group = Group() public_group.name = "public" public_group.id = PUBLIC_ID public_group.sav...
kartta-labs/noter-backend
noter_backend/main/migrations/0003_create_public_group.py
Python
apache-2.0
664
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
google-business-communications/bm-bonjour-meal-django-starter-code
bonjourmeal-codelab/full-sample/bmcodelab/settings.py
Python
apache-2.0
5,084
# Copyright 2019 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
GoogleCloudPlatform/python-docs-samples
datastore/cloud-ndb/flask_app.py
Python
apache-2.0
1,175
class BulkInsert(object): """ Usage: user_insert = BulkInsert(session) address_insert = BulkInsert(session, dependencies=[user_insert]) for user in users: user_insert.add(user) from address in user_addresses: address_insert.add(address) addres...
deliveryhero/lymph-sqlalchemy
lymph/sqlalchemy/utils.py
Python
apache-2.0
878
#!/usr/bin/env python3 import http.cookiejar import json import re import requests import urllib.parse import http.server import webbrowser from datetime import datetime, timezone, timedelta import os.path from pprint import pprint PARSE_JSON = True # Taken from Gwent Client logs. These are the Gwent client client i...
jamieadkins95/Roach-backend
scripts/gogapi.py
Python
apache-2.0
10,416
import numpy as np try: from aurora.ndarray import gpu_op, ndarray except ImportError: pass class Node(object): """ Node object represents a node in the computational graph""" def __init__(self): """ New node will be created by Op objects __call__ method""" # list of inputs to this no...
upul/Aurora
aurora/autodiff/autodiff.py
Python
apache-2.0
21,346
# 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 u...
xhochy/arrow
python/pyarrow/tests/test_compute.py
Python
apache-2.0
34,188
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
alfasin/st2
st2common/tests/unit/test_rbac_resolvers.py
Python
apache-2.0
7,834
import re from ztag.annotation import Annotation from ztag.annotation import OperatingSystem from ztag import protocols import ztag.test class FtpCesarFtpd(Annotation): protocol = protocols.FTP subprotocol = protocols.FTP.BANNER port = None impl_re = re.compile("^220[- ]CesarFTP 0\.\d+", re.IGNORECAS...
zmap/ztag
ztag/annotations/FtpCesarFtpd.py
Python
apache-2.0
1,652
#!/usr/bin/env python """Test the file transfer mechanism.""" import hashlib import io import itertools import os import platform import struct import unittest from unittest import mock from absl import app from grr_response_core.lib import constants from grr_response_core.lib import utils from grr_response_core.lib...
google/grr
grr/server/grr_response_server/flows/general/transfer_test.py
Python
apache-2.0
49,622
# # stdlib # from typing import Any # from typing import Dict # from typing import Iterable # from typing import List # from typing import Tuple # # third party # import pytest # # syft absolute # from syft.core.smpc.store import CryptoStore # from syft.core.smpc.store import register_primitive_store_add # from syft....
OpenMined/PySyft
tests/integration/smpc/store/crypto_store_test.py
Python
apache-2.0
1,613
""" Django settings for pybr11_tutorial project. Generated by 'django-admin startproject' using Django 1.8.6. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Bu...
Rondineli/pybr11_tutorial
pybr11_tutorial/pybr11_tutorial/settings.py
Python
apache-2.0
2,688
import random def append_letter_or_number(): alphabet = ['a','b','c','d','e','f'] use_number = 0 use_letter = 1 letter_or_string = random.randrange(2) if letter_or_string == use_number: result = str(random.randrange(0,9)) elif letter_or_string == use_letter: next_character = ra...
ossem/member_database
nfc_lib.py
Python
apache-2.0
1,047
# 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
avionics/motor/monitors/motor_ina219.py
Python
apache-2.0
2,535
#!/usr/bin/env python3 """ Lazy 'tox' to quickly check if branch is up to PR standards. This is NOT a tox replacement, only a quick check during development. """ import os import asyncio import sys import re import shlex from collections import namedtuple try: from colorlog.escape_codes import escape_codes except...
fbradyirl/home-assistant
script/lazytox.py
Python
apache-2.0
7,111
""" Define the Python wrapper-functions which provide an interface to the C++ implementations. """ from .present import CPP_BINDINGS_PRESENT from .imager import cpp_image_visibilities, CppKernelFuncs
SKA-ScienceDataProcessor/FastImaging-Python
src/fastimgproto/bindings/__init__.py
Python
apache-2.0
200
from django.db import models from django.db import models from django.utils.translation import ugettext as _ # from django.core.urlresolvers import reverse_lazy, reverse from django.conf import settings from projects.models import Project, Customer class Report (models.Model): HIGHLIGHT = 'HL' LOWLIGHT =...
jjagielka/reporter
src/reports/models.py
Python
apache-2.0
2,148
# Copyright 2012-2015 The Meson development team # 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...
MathieuDuponchelle/meson
mesonbuild/mesonlib.py
Python
apache-2.0
42,764
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
google-research/language
language/labs/consistent_zero_shot_nmt/utils/common_utils.py
Python
apache-2.0
1,241
#!/usr/bin/env python """ Copyright 2016 ARC Centre of Excellence for Climate Systems Science author: Scott Wales <scott.wales@unimelb.edu.au> 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...
ScottWales/mosrs-setup
mosrs/setup.py
Python
apache-2.0
7,573
################################################################################ # 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...
clarkyzl/flink
flink-python/pyflink/table/tests/test_udtf.py
Python
apache-2.0
5,986
# Copyright 2012 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...
huntxu/neutron
neutron/agent/linux/interface.py
Python
apache-2.0
19,111
from distutils.core import setup setup( name = 'nicknester', version = '1.3.0', py_modules = ['nester'], author = 'htýthon', author_email = 'hfpython@headfirstlabs.com', url = 'http://www.headfirstlabs.com', description = 'A simple printer of nes...
leobarros/use_cabeca_python
nester/setup.py
Python
apache-2.0
341
import errno import os import unittest import mock from taskcat._common_utils import ( exit_with_code, fetch_ssm_parameter_value, get_s3_domain, make_dir, merge_dicts, name_from_stack_id, param_list_to_dict, pascal_to_snake, region_from_stack_id, s3_bucket_name_from_url, s3_...
aws-quickstart/taskcat
tests/test_common_utils.py
Python
apache-2.0
4,514
import random import numpy from graph_diff.nirvana_object_model.workflow import Workflow from .standard_workflow_generator import StandardWorkflowGenerator class ChainWorkflowGenerator(StandardWorkflowGenerator): """Generator for chained workflows""" def __init__(self): super().__init__() s...
alexander-bzikadze/graph_diff
graph_diff/nirvana_object_model/worflow_generator/chain_workflow_generator.py
Python
apache-2.0
3,332
#!/usr/bin/env python from __future__ import print_function import argparse import os import subprocess import sys from test_util import TestFailedError, run_command, \ serializeIncrParseMarkupFile def main(): parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, ...
jopamer/swift
utils/incrparse/incr_transfer_tree.py
Python
apache-2.0
3,699
import datetime import time from pandac.PandaModules import TextNode, Vec3, Vec4, PlaneNode, Plane, Point3 from toontown.pgui.DirectGui import DirectFrame, DirectLabel, DirectButton, DirectScrolledList, DGG from direct.directnotify import DirectNotifyGlobal from toontown.pgui import DirectGuiGlobals from toontown.toonb...
silly-wacky-3-town-toon/SOURCE-COD
toontown/parties/CalendarGuiDay.py
Python
apache-2.0
30,399
""" Sponge Knowledge Base Using unordered rules """ from java.util.concurrent.atomic import AtomicInteger from org.openksavi.sponge.examples import SameSourceJavaUnorderedRule from org.openksavi.sponge.core.library import Deduplication def onInit(): # Variables for assertions only sponge.setVariabl...
softelnet/sponge
sponge-jython/examples/script/py/unordered_rules.py
Python
apache-2.0
3,372
""" Django settings for librarymanagementsystem project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(B...
vinu76jsr/librarymanagementsystem
librarymanagementsystem/settings.py
Python
apache-2.0
3,254
# -*- 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-dialogflow
samples/generated_samples/dialogflow_v2_generated_conversation_datasets_delete_conversation_dataset_sync.py
Python
apache-2.0
1,640
#MenuTitle: Guides through All Selected Nodes # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Creates guides through all selected nodes. """ from Foundation import NSPoint import math thisFont = Glyphs.font # frontmost font selectedLayers = thisFont.selectedLayers...
mekkablue/Glyphs-Scripts
Guides/Guides through All Selected Nodes.py
Python
apache-2.0
2,786
# -*- coding: utf-8 -*- # Copyright 2020 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...
googleads/google-ads-python
google/ads/googleads/v9/services/services/campaign_simulation_service/transports/base.py
Python
apache-2.0
3,952
import codecs import os import re import setuptools from setuptools import find_packages, setup from setuptools.command.develop import develop from setuptools.command.install import install PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) REQUIREMENTS_FILE = os.path.join(PROJECT_ROOT, "requirements.txt") RE...
arviz-devs/arviz
setup.py
Python
apache-2.0
2,583
# Copyright 2020 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://apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
googlecodelabs/analyze_gsimg
alt/analyze_gsimg-newauth.py
Python
apache-2.0
7,125
#!/usr/bin/python from optparse import OptionParser import filecmp import json import of_daemon import of_node import of_util import os import subprocess import sys import tempfile import time of_util.check_python_version() parser = OptionParser() (opts, args, node_list) = of_util.parse_deploy_opts(parser) if opts.bl...
cmccabe/redfish
deploy/st_chunk_io.py
Python
apache-2.0
1,287
# Copyright 2012 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...
nttcom/eclcli
eclcli/orchestration/heatclient/v1/events.py
Python
apache-2.0
2,990
# Copyright 2017 The UAI-SDK 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 applicable...
ucloud/uai-sdk
uaitrain_tool/caffe/caffe_tool.py
Python
apache-2.0
3,505
from django.apps import AppConfig class AttachmentsConfig(AppConfig): verbose_name = 'Attachments'
iamsteadman/bambu-attachments
bambu_attachments/apps.py
Python
apache-2.0
104
import time import logging from typing import Callable, List, TypeVar, Text from psycopg2.extensions import cursor CursorObj = TypeVar('CursorObj', bound=cursor) from django.db import connection from zerver.models import UserProfile ''' NOTE! Be careful modifying this library, as it is used in a migration, and it...
amanharitsh123/zulip
zerver/lib/fix_unreads.py
Python
apache-2.0
6,949
p = dict( subject = 'EG009', #Fixation size (in degrees): fixation_size = 0.4, monitor='testMonitor', scanner=True, screen_number = 1, full_screen = True, radial_cyc = 10, angular_cyc = 15, angular_width=30, size = 60, #This just needs to be larger than the screen tempor...
arokem/bowties
params.py
Python
apache-2.0
464
""" Component that will help set the level of logging for components. For more details about this component, please refer to the documentation at https://home-assistant.io/components/logger/ """ import logging from collections import OrderedDict import voluptuous as vol import homeassistant.helpers.config_validation...
persandstrom/home-assistant
homeassistant/components/logger.py
Python
apache-2.0
3,869
# Copyright (c) 2015 Mirantis, 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 writin...
NaohiroTamura/python-ironicclient
ironicclient/tests/functional/test_help_msg.py
Python
apache-2.0
2,193
#!/usr/bin/env python from distutils.core import setup setup( name='fetcher', version='0.4', install_requires=['pycurl==7.19.0.2'], packages=['fetcher'])
vistarmedia/fetcher
setup.py
Python
apache-2.0
165
# -*- 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-recommendations-ai
google/cloud/recommendationengine_v1beta1/services/prediction_service/transports/grpc.py
Python
apache-2.0
11,847
""" 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 License ...
mwhooker/jones
jones/web.py
Python
apache-2.0
5,362
#!/usr/bin/env python # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
GoogleCloudPlatform/IoT-Icebreaker
appengine/pubsub-to-datastore/test_deploy.py
Python
apache-2.0
1,902
"""This example follows the simple text document Pipeline illustrated in the figures above. """ from pyspark.ml import Pipeline from pyspark.ml.classification import LogisticRegression from pyspark.ml.feature import HashingTF, Tokenizer # Prepare training documents from a list of (id, text, label) tuples. training = ...
xiligey/xiligey.github.io
code/2.py
Python
apache-2.0
1,442
# -*- coding: utf-8 -*- import os import base64 from random import choice def random_file_from_dir(relative_path): random_file = choice(os.listdir(os.path.join(os.getcwd(), relative_path))) return abs_path_to_file(os.path.join(relative_path, random_file)) def abs_path_to_file(relative_path): # print os.g...
alazanman/py_epg_tests
utils/file_util.py
Python
apache-2.0
535
# Copyright (c) 2014 Rackspace, 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 wr...
openstack/zaqar
zaqar/tests/functional/wsgi/v1_1/test_claims.py
Python
apache-2.0
9,025
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2020-03-07 23:48 from hanlp.metrics.parsing import conllx_eval from hanlp.datasets.parsing.ptb import PTB_SD330_DEV, PTB_SD330_TRAIN, PTB_SD330_TEST, PTB_TOKEN_MAPPING from hanlp.components.parsers.biaffine_parser_tf import BiaffineTransformerDependencyParserTF, \ St...
hankcs/HanLP
plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ptb_dep_sa_albert_topk.py
Python
apache-2.0
1,269
# Copyright 2017 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...
nolanliou/tensorflow
tensorflow/contrib/quantize/python/quantize.py
Python
apache-2.0
11,989
# 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 unde...
steveb/heat
heat/tests/engine/service/test_stack_resources.py
Python
apache-2.0
32,282
from distutils.core import setup setup( name='megad-mqtt-gw', version='0.3', description='Gateway between MQTT queue and MegaD devices (http://ab-log.ru)', author='rs', author_email='repalov@gmail.com', url='https://github.com/repalov/megad-mqtt-gw', license='Apache License', classifier...
repalov/megad-mqtt-gw
setup.py
Python
apache-2.0
1,025
# coding: utf-8 import os import sys import logging import webbrowser import socket import time import json import traceback import cv2 import tornado.ioloop import tornado.web import tornado.websocket from tornado.concurrent import run_on_executor from concurrent.futures import ThreadPoolExecutor # `pip install fu...
Andy-hpliu/AirtestX
atx/cmds/webide.py
Python
apache-2.0
7,985
from charms.reactive import Endpoint, when class TestAltProvides(Endpoint): invocations = [] @when('endpoint.{endpoint_name}.joined') def handle_joined(self): self.invocations.append('joined: {}'.format(self.endpoint_name)) @when('endpoint.{endpoint_name}.changed') def handle_changed(sel...
juju-solutions/charms.reactive
tests/data/reactive/relations/test-alt/provides.py
Python
apache-2.0
561
# Licensed to Hortonworks, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Hortonworks, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this f...
hortonworks/hortonworks-sandbox
tutorials/tutorials_app/views.py
Python
apache-2.0
3,659
#!/usr/bin/env python # # Copyright 2018 Analytics Zoo 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 appl...
intel-analytics/analytics-zoo
pyzoo/docs/doc-web.py
Python
apache-2.0
942
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
Dev-Cloud-Platform/Dev-Cloud
dev_cloud/cc1/src/ec2/helpers/query.py
Python
apache-2.0
3,363
__author__ = 'tom' from django.contrib import admin from core.models import Post, Project admin.site.register(Post) admin.site.register(Project)
probablytom/tomwallis.net
core/admin.py
Python
artistic-2.0
146
from .base import * class OpStash(object): cache = {} @classmethod def Add(cls, object): t = object.type cls.cache[t] = object @classmethod def Lookup(cls, type): return cls.cache[type] @classmethod def Define(cls, pt): cls.Add(pt) return pt class ...
arizvisa/syringe
template/image/pict/v1.py
Python
bsd-2-clause
1,778
from django import template from django.utils.safestring import mark_safe from django.template.base import Node register = template.Library() from tag_parser import template_tag from tag_parser.basetags import BaseNode @template_tag(register, 'asset') class JsCssAssetNode(BaseNode): """ Implement asset filte...
lsc20051426/cdn-asserts
cdn_assets/templatetags/cdn_assets.py
Python
bsd-2-clause
3,436
#!/usr/bin/env python import tensorflow as tf import edward as ed import numpy as np from numpy import array from numpy.linalg import norm from edward.models import Dirichlet, Multinomial, Gamma, Poisson sess = tf.Session() def build_toy_dataset(n, p, A, b): """ toy HMM with: n=number of timesteps,...
kyjohnso/mlbslice
hmm_sandbox.py
Python
bsd-2-clause
3,478
# -*- coding: utf-8 -*- import json import numpy as np import sys # Compare a set of computed solutions to best known solutions on the # same problems. # See src/vrptw_to_json.py, src/pdptw_to_json.py and # src/hvrp_to_json.py. CUSTOM_PRECISION = 1000 BENCH_DOUBLE_PRECISION = 100 CUSTOM_PRECISION_CLASSES = [ "sol...
VROOM-Project/vroom-scripts
benchmarks/compare_to_BKS.py
Python
bsd-2-clause
5,946
# vim: set fileencoding=utf-8 ts=4 sw=4 expandtab fdm=marker: """ Small wrapper around the python ConfigParser module. """ import ConfigParser CONFIG = ConfigParser.ConfigParser() DEFAULTS = { 'patterns': { 'path' : '(?P<artist>\w+) - (?P<year>\d+) - (?P<album>\w+)' } } def get_param(sec...
turbofish/mcverify
config.py
Python
bsd-2-clause
772
#!/usr/bin/python # -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Copyright (c) 2012 Michael Hull. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are m...
mikehulluk/morphforge
src/morphforgecontrib/simulation/channels/neuroml_via_neurounits/neuroml_via_neurounits_neuron.py
Python
bsd-2-clause
2,634
''' Created by auto_sdk on 2015.04.21 ''' from aliyun.api.base import RestApi class Ecs20140526DeleteSnapshotRequest(RestApi): def __init__(self,domain='ecs.aliyuncs.com',port=80): RestApi.__init__(self,domain, port) self.SnapshotId = None def getapiname(self): return 'ecs.aliyuncs.com.DeleteSnapshot...
wanghe4096/website
aliyun/api/rest/Ecs20140526DeleteSnapshotRequest.py
Python
bsd-2-clause
334
import bee from bee import * import dragonfly from dragonfly.commandhive import commandhive, commandapp from dragonfly.sys import exitactuator from dragonfly.io import display, commandsensor from dragonfly.std import variable, transistor, test from dragonfly.sys import on_next_tick from components.workers.chessprocesso...
agoose77/hivesystem
manual/chess/tut-worker-3d.py
Python
bsd-2-clause
2,088
""" Normal-Gamma density.""" import numpy as np from scipy.special import gammaln, psi class NormalGamma(object): """Normal-Gamma density. Attributes ---------- mu : numpy.ndarray Mean of the Gaussian density. kappa : float Factor of the precision matrix. alpha : float ...
OliverWalter/amdtk
amdtk/models/normal_gamma.py
Python
bsd-2-clause
2,962
import sys from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.db import IntegrityError, transaction from django.contrib.auth.models import User from annotate.models import * class Command(BaseCommand): def add_arguments(self, parser): parser.add_a...
aaalgo/owl
annotate/management/commands/import.py
Python
bsd-2-clause
1,100
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org # from ..excel_comparison_test import ExcelComparisonTest from ...workbook import Workbook class TestCompar...
jmcnamara/XlsxWriter
xlsxwriter/test/comparison/test_textbox38.py
Python
bsd-2-clause
1,661
"""professor => instructor Revision ID: 3fab9480c190 Revises: 31ded1f6ad6 Create Date: 2014-02-17 00:56:12.566690 """ # revision identifiers, used by Alembic. revision = '3fab9480c190' down_revision = '31ded1f6ad6' from alembic import op import sqlalchemy as sa metadata = sa.MetaData() role = sa.Table('Role', meta...
zstars/weblabdeusto
server/src/weblab/db/upgrade/regular/versions/3fab9480c190_professor_instructor.py
Python
bsd-2-clause
681
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) import copy from ..util import import_ from ._base import _NativeCodeBase, _NativeSysBase, _compile_kwargs pyodeint = import_('pyodeint') class NativeOdeintCode(_NativeCodeBase): wrapper_name = '_odeint_wrapper' def...
bjodah/pyodesys
pyodesys/native/odeint.py
Python
bsd-2-clause
713
# -*- coding: utf-8 -*- # Author: Florian Mayer <florian.mayer@bitsrc.org> from __future__ import absolute_import import shutil from tempfile import mkdtemp from datetime import datetime import pytest import os import glob import numpy as np from numpy.testing import assert_array_almost_equal, assert_allclose import...
Alex-Ian-Hamilton/sunpy
sunpy/spectra/tests/test_callisto.py
Python
bsd-2-clause
10,406
#!/usr/bin/env python from __future__ import print_function import argparse import os from falafel import findout_terminal_width from falafel import test_list from falafel.runners import FalafelTestRunner from falafel.loaders import FalafelTestLoader parser = argparse.ArgumentParser(description='custom test runner ...
thisch/python-falafel
examples/project1/testrunner.py
Python
bsd-2-clause
2,913
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ """ import logging import numpy as np from numpy import ma from cotede.qctests import QCCheckVar try: import pandas as pd PANDAS_AVAILABLE = True except ImportError: PANDAS_AVAILABLE = Fa...
castelao/CoTeDe
cotede/qctests/gradient.py
Python
bsd-3-clause
2,756
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 30, transform = "Quantization", sigma = 0.0, exog_count = 0, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_Quantization/trend_PolyTrend/cycle_30/ar_/test_artificial_1024_Quantization_PolyTrend_30__0.py
Python
bsd-3-clause
268
from django.conf.urls import * from django.conf import settings # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # django-flags for internationalization (r'^lang/', include('sampleproject.flags.urls')), # FOR DEBUG AND TES...
mikewolfli/django-goflow
sampleproject/urls.py
Python
bsd-3-clause
1,453
from django.test import TestCase from freezegun import freeze_time from unittest.mock import patch from testil import eq from corehq.util.soft_assert.core import SoftAssert from casexml.apps.case.exceptions import ReconciliationError from casexml.apps.case.xml.parser import CaseUpdateAction, KNOWN_PROPERTIES from core...
dimagi/commcare-hq
corehq/form_processor/tests/test_sql_update_strategy.py
Python
bsd-3-clause
8,947
""" subplot - Manage modern mode figure subplot configuration and selection. """ import contextlib from pygmt.clib import Session from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import ( build_arg_string, fmt_docstring, is_nonstr_iter, kwargs_to_strings, use_alias, ) @fmt_docstrin...
GenericMappingTools/gmt-python
pygmt/src/subplot.py
Python
bsd-3-clause
10,779
#!/usr/bin/env python """ EVENNIA SERVER LAUNCHER SCRIPT This is the start point for running Evennia. Sets the appropriate environmental variables and launches the server and portal through the evennia_runner. Run without arguments to get a menu. Run the script with the -h flag to see usage information. """ from __f...
ergodicbreak/evennia
evennia/server/evennia_launcher.py
Python
bsd-3-clause
44,636
# Enthought library imports from traits.api import HasTraits, Int, Bool from kiva.trait_defs.api import KivaFont from enable.colors import ColorTrait class TextFieldStyle(HasTraits): """ This class holds style settings for rendering an EnableTextField. fixme: See docstring on EnableBoxStyle """ #...
tommy-u/enable
enable/text_field_style.py
Python
bsd-3-clause
1,133
import warnings from django.core.urlresolvers import ResolverMatch from django.core.urlresolvers import ( RegexURLPattern as DjangoRegexURLPattern, RegexURLResolver ) from django.core.exceptions import ImproperlyConfigured from django.utils import six from django.utils.deprecation import RemovedInDjango20Warni...
aledista/django-view-timer
django_view_timer/urls.py
Python
bsd-3-clause
2,142
import datetime from django.db import models from django.conf import settings #server variables that needed to be stored in db class ServerVariable(models.Model): name = models.CharField(max_length=64, blank=True, null=True) value = models.TextField(blank=True, null=True) class Meta: app_l...
solarpermit/solarpermit
website/models/server.py
Python
bsd-3-clause
2,352
"""The WaveBlocks Project Function for stem-plotting functions of the type f:IxI -> C with abs(f) as z-value and phase(f) as color code. This function makes a three dimensional stem plot. @author: R. Bourquin @copyright: Copyright (C) 2012, 2014, 2016 R. Bourquin @license: Modified BSD License """ from numpy import ...
WaveBlocks/WaveBlocksND
WaveBlocksND/Plot/stemcf3d.py
Python
bsd-3-clause
1,964