repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
kiddinn/plaso
tests/parsers/winreg_plugins/typedurls.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the MSIE typed URLs Windows Registry plugin.""" import unittest from plaso.parsers.winreg_plugins import typedurls from tests.parsers.winreg_plugins import test_lib class MsieTypedURLsPluginTest(test_lib.RegistryPluginTestCase): """Tests for the MSIE ty...
google/empirical_calibration
empirical_calibration/core_test.py
# Copyright 2019 The Empirical Calibration 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
tensorflow/datasets
tensorflow_datasets/text/wordnet_test.py
# coding=utf-8 # Copyright 2022 The TensorFlow Datasets 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...
richrd/bx
comps.py
# -*- coding: utf-8 -*- """ Bot Components Provides virtual windows, users, events etc. for the bot. """ import os import sys import time import string # import traceback # Symbian S60 specific compatibility s60 = False if sys.platform == "symbian_s60": s60 = True sys.path.append("e:\\python") sys.path....
ahmadassaf/zulip
zerver/decorator.py
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth import REDIRECT_FIELD_NAME from django.views.decorators.csrf import csrf_exempt from django.http import QueryDict, HttpResponseNotAllowed, HttpRe...
Intel-Corporation/tensorflow
tensorflow/python/ops/linalg/linear_operator_toeplitz.py
# Copyright 2019 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...
kkdang/synapsePythonClient
tests/integration/test_multipart_upload.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import filecmp import os, random, sys, traceback from io import open import synapseclient import synapseclient.utils as utils from synapseclient....
lebedov/pyorient
pyorient/serializations.py
import sys import time from datetime import date, datetime from decimal import Decimal from .otypes import OrientRecordLink, OrientRecord, OrientBinaryObject from .exceptions import PyOrientBadMethodCallException class OrientSerializationBinary(object): def __init__(self): self.className = None se...
hammerlab/cohorts
test/test_count.py
# Copyright (c) 2016. Mount Sinai School of Medicine # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
redshodan/codepunks
tests/testconfig.py
import argparse import configparser from codepunks.config import (Config, INISource, XMLSource, JSONSource, YAMLSource, ArgParserSource) ARGS1 = argparse.Namespace() ARGS1.apkey1 = "apval1" ARGS1.apkey2 = "apval2" ARGS1.apkey3 = "apval3" def testEmptyCfg(): Config() def testINISo...
bryndivey/ohmanizer
electronics/migrations/0011_auto_20141120_2136.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('electronics', '0010_auto_20141120_0704'), ] operations = [ migrations.CreateModel( name='Order',...
lefnire/tensorforce
examples/openai_gym_async.py
# Copyright 2017 reinforce.io. 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...
eubr-bigsea/tahiti
tahiti/workflow_permission_api.py
# -*- coding: utf-8 -*-} import logging import os import uuid import requests from flask import request, current_app, g from flask_babel import gettext from flask_restful import Resource from sqlalchemy import or_ from sqlalchemy.orm import joinedload from sqlalchemy.sql.elements import and_ from marshmallow.exceptio...
analysiscenter/dataset
batchflow/models/tf/fcn.py
""" Shelhamer E. et al "`Fully Convolutional Networks for Semantic Segmentation <https://arxiv.org/abs/1605.06211>`_" """ import tensorflow as tf from . import TFModel, VGG16 from .layers import conv_block class FCN(TFModel): """ Base Fully convolutional network (FCN) """ @classmethod def default_config(...
Hybrid-Cloud/badam
patches_tool/aws_patch/aws_deps/libcloud/test/dns/test_google.py
# 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 ...
our-city-app/oca-backend
src/shop/handlers.py
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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...
awislowski/elasticsearch
dev-tools/create_bwc_index.py
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
jessicalucci/TaskManagement
taskflow/persistence/backends/sqlalchemy/models.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! Inc. All Rights Reserved. # Copyright (C) 2013 Rackspace Hosting Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
noslenfa/tdjangorest
uw/lib/python2.7/site-packages/IPython/lib/display.py
"""Various display related classes. Authors : MinRK, gregcaporaso, dannystaple """ from os.path import exists, isfile, splitext, abspath, join, isdir from os import walk, sep class IFrame(object): """ Generic class to embed an iframe in an IPython notebook """ iframe = """ <iframe ...
cybertron/tripleo-auto-abandon
doc/source/conf.py
# -*- coding: utf-8 -*- # 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...
Samsung/ADBI
arch/arm/tests/blx_reg_a1.py
import random from test import * from branch import * def test(rm, fn): name = 'test_blx_reg_a1_%s' % tn() cleanup = asm_wrap(name, 'r0') print ' adr %s, %s' % (rm, fn) if fn.startswith('thumb'): print ' orr %s, #1' % (rm) print '%s_tinsn:' % name print ' blx %s' % (rm) c...
our-city-app/oca-backend
src/rogerthat/bizz/features.py
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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...
jdgwartney/tsi
cleanup.py
import json import pycurl from requests.auth import HTTPDigestAuth import os #------------------------------------------------------- # define function to subit requests #------------------------------------------------------- def submitRequest( url ): headers = ['Expect:', 'Content-Type: application...
google/earthengine-community
samples/python/apidocs/ee_dictionary_aside.py
# Copyright 2021 The Google Earth Engine Community 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
jamslevy/gsoc
tests/svn_helper_test.py
#!/usr/bin/python2.5 # # Copyright 2008 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...
QISKit/qiskit-sdk-py
qiskit/transpiler/fencedobjs.py
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
googleapis/python-assured-workloads
samples/generated_samples/assuredworkloads_v1_generated_assured_workloads_service_create_workload_async.py
# -*- 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...
hpe-storage/python-hpedockerplugin
source/hpedockerplugin/i18n.py
# Copyright 2014 IBM Corp. # # 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...
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/vta/python/vta/testing/simulator.py
# 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...
JioCloud/oslo-incubator
openstack/common/lockutils.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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.apac...
FinancialSentimentAnalysis-team/Finanical-annual-reports-analysis-code
wangyi/wk1/self testing/excel_diff.py
# coding: utf-8 # In[1]: import xlrd import xlwt import os def read_excel(path): wbk=xlrd.open_workbook(path) sheet_annual=wbk.sheet_by_name('Annual') sheet_interim=wbk.sheet_by_name('Interim') ncols_annual=sheet_annual.ncols data_annual=[] for col in range(ncols_annual): data_...
GoogleCloudPlatform/magic-modules
mmv1/provider/ansible/test_gcp_session.py
# -*- coding: utf-8 -*- # (c) 2019, Google Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
forj-oss/docs
conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Forj documentation build configuration file, created by # sphinx-quickstart on Wed Feb 19 14:00:10 2014. # # 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 # autog...
fbradyirl/home-assistant
homeassistant/components/zha/core/const.py
"""All constants related to the ZHA component.""" import enum import logging from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER from homeassistant.components.fan import DOMAIN as FAN from homeassistant.components.light...
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/tests/python/relay/test_op_level5.py
# 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...
hanlind/nova
nova/tests/functional/api/client.py
# Copyright (c) 2011 Justin Santa Barbara # # 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...
rwightman/pytorch-image-models
tests/test_optim.py
""" Optimzier Tests These tests were adapted from PyTorch' optimizer tests. """ import math import pytest import functools from copy import deepcopy import torch from torch.testing._internal.common_utils import TestCase from torch.autograd import Variable from timm.scheduler import PlateauLRScheduler from timm.opti...
Beomi/irkshop
goods/migrations/0012_auto_20170907_1720.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-07 08:20 from __future__ import unicode_literals import ckeditor.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('goods', '0011_order_uuid'), ] ...
Orange-OpenSource/cf-php-build-pack
extensions/appdynamics/extension.py
# 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 use ...
datastax/python-driver
tests/integration/standard/test_udts.py
# Copyright DataStax, 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, softwa...
maigimenez/cracking
chapter_01/src/answer_07.py
def rotate_matrix(m): if not m: return [] rows = len(m) # cols = len(m[0]) # rotated_matrix = [[0]*cols for _ in range(rows)] # for i in range(rows): # for j in range(cols): # rotated_matrix[j][rows-i-1] = m[i][j] # return rotated_matrix # Inline for i in ra...
mistercrunch/airflow
tests/conftest.py
# 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...
Kitware/cumulus
cumulus/ansible/tasks/providers/__init__.py
############################################################################### # Copyright 2016 Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
trevor/calendarserver
txdav/carddav/datastore/test/__init__.py
# -*- test-case-name: txdav.carddav.datastore.test -*- ## # Copyright (c) 2010-2014 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/l...
jijeshmohan/webdriver-rb
firefox/src/py/firefox_profile.py
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 requ...
malongge/selenium-pom
tests/test_index_page.py
import time import pytest from pages.index_page import IndexPage from .base import BaseTest class TestIndexPage(BaseTest): @pytest.fixture(autouse=True) def _go_to_index_page(self, request, base_url, selenium, login): _, pg = login # self.home_pg = pg index_pg = IndexPag...
jimgoo/zipline-fork
zipline/examples/olmar.py
import numpy as np from datetime import datetime import pytz from zipline.algorithm import TradingAlgorithm #from zipline.utils.factory import load_from_yahoo from pulley.zp.data.loader import load_bars_from_yahoo from zipline.finance import commission #STOCKS = ['AMD', 'CERN', 'COST', 'DELL', 'GPS', 'INTC', 'MMM'] S...
HydrelioxGitHub/home-assistant
homeassistant/components/scene/__init__.py
"""Allow users to set and activate scenes.""" import asyncio import importlib import logging import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_ON) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassi...
glugmpstme/dotjot
Adarna/Adarna/urls.py
"""Adarna URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
NicWayand/xray
xarray/core/ops.py
from functools import partial import contextlib import inspect import operator import warnings import numpy as np import pandas as pd from . import npcompat from .pycompat import PY3, dask_array_type from .nputils import nanfirst, nanlast, array_eq, array_ne try: import bottleneck as bn has_bottleneck = Tru...
liosha2007/temporary-groupdocs-python3-sdk
groupdocs/models/SignatureFormResourcesResponse.py
#!/usr/bin/env python """ Copyright 2012 GroupDocs. 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...
rhyolight/nupic.son
app/soc/modules/gci/views/readonly_template.py
# Copyright 2012 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...
rca/issuebranch
src/webapp/webapp/settings.py
""" Django settings for webapp project. Generated by 'django-admin startproject' using Django 1.11.7. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os ...
bigmlcom/python
bigml/tests/test_44_compare_predictions.py
# -*- coding: utf-8 -*- # # Copyright 2015-2022 BigML # # 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 ...
rylans/typeguess
setup.py
#!/usr/bin/env python from codecs import open from setuptools import setup, find_packages def read(f): return open(f, encoding='utf-8').read() setup(name='typeguess', version='0.0.2', description='Data type guesser', long_description=read('README.rst'), author='Rylan Santinon', aut...
whiteclover/Medoly
medoly/config/hocon.py
#!/usr/bin/env python # # Copyright 2016 Medoly # # 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 agr...
pombredanne/jkarn-pub-test
udfs/python/coffee.py
from pig_util import outputSchema COFFEE_SNOB_PHRASES = set((\ 'espresso', 'cappucino', 'macchiato', 'latte', 'cortado', 'pour over', 'barista', 'flat white', 'siphon pot', 'woodneck', 'french press', 'arabica', 'chemex', 'frothed', 'la marzocco', 'mazzer', 'la pavoni', 'nespresso', 'rancilio silvia', 'h...
stackforge/tricircle
tricircle/tests/unit/network/test_central_trunk_plugin.py
# Copyright 2015 Huawei Technologies Co., Ltd. # 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 # # Unl...
s34rching/python_classes
tests/test_contact_data.py
import re import random def test_contact_data_from_home_page(app): r_index = random.randrange(len(app.contact.get_contact_list())) data_from_home_page = app.contact.get_contact_list()[r_index] data_from_edit_page = app.contact.get_contact_info_from_edit_page(r_index) assert data_from_home_page.firstna...
google/uncertainty-baselines
experimental/single_model_uncertainty/flags.py
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines 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 ap...
huggingface/transformers
tests/transfo_xl/test_tokenization_transfo_xl.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 requir...
dpnishant/appmon
database/__init__.py
### # Copyright (c) 2016 Nishant Das Patnaik. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
binoculars/osf.io
osf/models/mixins.py
import pytz from django.apps import apps from django.contrib.auth.models import Group from django.core.exceptions import ObjectDoesNotExist from django.db import models, transaction from django.utils import timezone from django.utils.functional import cached_property from guardian.shortcuts import assign_perm from gua...
gsi-upm/SmartSim
smartbody/data/examples/Tutorials/7_FacialAnimationSpeech.py
print "|--------------------------------------------|" print "| Starting Tutorial 7 |" print "|--------------------------------------------|" print 'media path = ' + scene.getMediaPath() # Add asset paths assetManager = scene.getAssetManager() assetManager.addAssetPath('motion', 'ChrBrad') ...
citrix-openstack-build/python-cinderclient
cinderclient/tests/v2/fakes.py
# Copyright (c) 2013 OpenStack Foundation # # 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 ...
Makeystreet/makeystreet
woot/apps/catalog/migrations/0100_auto__add_field_space_kind__add_field_space_logo__add_field_space_lati.py
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Space.kind' db.add_column(u'catalog_space', 'kind', ...
theanalyst/cinder
cinder/openstack/common/db/sqlalchemy/test_migrations.py
# Copyright 2010-2011 OpenStack Foundation # Copyright 2012-2013 IBM Corp. # 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/li...
stackforge/monasca-log-api
monasca_log_api/conf/role_middleware.py
# Copyright 2017 FUJITSU 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 writ...
lemonad/jaikuengine
common/test/api.py
# Copyright 2009 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, ...
fy0/my-leetcode
990.Satisfiability Of Equality Equations/main.py
class Solution: def translateNum(self, num: int) -> int: if num < 10: return 1 table = {} for i in range(26): table[str(i)] = chr(ord('a') + i) num_str = str(num) arr = [] def solve(eated, s, last): if not s: arr....
RedHatInsights/insights-core
insights/parsers/tests/test_max_uid.py
import doctest import pytest from insights.parsers import max_uid, ParseException, SkipException from insights.parsers.max_uid import MaxUID from insights.tests import context_wrap def test_max_uid(): with pytest.raises(SkipException): MaxUID(context_wrap("")) with pytest.raises(ParseException): ...
gorcz/security_monkey
security_monkey/watchers/iam/iam_user.py
# Copyright 2014 Netflix, 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...
lukereding/mateChoiceTracking
low_light_tracker.py
import numpy as np import cv2, csv, os, re, sys, time, argparse, datetime ''' started 25 August 2015 31 August 2015: modifying script so that it queries frames from a video taken with ffmpeg 10 Nov 2015 modifying for use in low light LCD tank (filters over the four flourescent light) assumes there are four 'parts'...
Richert/BrainNetworks
CMC/config/AdEx_net.py
from pyrates.utility import grid_search_annarchy, plot_timeseries from ANNarchy import Projection, Population, TimedArray, setup, Network, Monitor, Uniform, Normal, \ EIF_cond_exp_isfa_ista from pyrates.utility import pyrates_from_annarchy import matplotlib.pyplot as plt import numpy as np # parameters ###########...
persandstrom/home-assistant
homeassistant/components/device_tracker/xiaomi_miio.py
""" Support for Xiaomi Mi WiFi Repeater 2. For more details about this platform, please refer to the documentation https://home-assistant.io/components/device_tracker.xiaomi_miio/ """ import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.device_tra...
thenenadx/forseti-security
google/cloud/security/common/gcp_api/bigquery.py
# 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...
gmontamat/pyaw-reporting
awreporting/awreporting.py
#!/usr/bin/env python # Copyright 2021 - Gustavo Montamat # # 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 applicabl...
swiftstack/swift
swift/common/middleware/s3api/s3request.py
# Copyright (c) 2014 OpenStack Foundation. # # 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...
Blimeo/Java
out/production/matthew/Contests/CodeForces/pset6/President's Office.py
inp = input().split() n = int(inp[0]) m = int(inp[1]) c = inp[2] k = [] for i in range(n): k.append(list(input())) lt = (-1, -1) rt = (-1, -1) for i in range(n): for j in range(m): if k[i][j] == c: rt = (i, j) if lt[0] < 0: lt = (i, j) ans = set() for i in range(lt[0], rt[0] + 1): for j in range(lt[...
tommyip/zulip
tools/lib/test_script.py
from typing import Optional, Tuple import os import sys from distutils.version import LooseVersion from version import PROVISION_VERSION from scripts.lib.zulip_tools import get_dev_uuid_var_path def get_major_version(v): # type: (str) -> int return int(v.split('.')[0]) def get_version_file(): # type: () ...
deepmind/acme
acme/utils/loggers/base.py
# Copyright 2018 DeepMind Technologies Limited. 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 ...
enovance/hardware
hardware/bios_hp.py
# Copyright (C) 2019 Criteo # # 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, ...
fbradyirl/home-assistant
homeassistant/util/aiohttp.py
"""Utilities to help with aiohttp.""" import json from urllib.parse import parse_qsl from typing import Any, Dict, Optional from multidict import CIMultiDict, MultiDict class MockRequest: """Mock an aiohttp request.""" def __init__( self, content: bytes, method: str = "GET", ...
openweave/openweave-core
src/test-apps/happy/tests/service/wdmNext/test_weave_wdm_next_service_mutual_subscribe_08.py
#!/usr/bin/env python3 # # Copyright (c) 2016-2017 Nest Labs, 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/lic...
heiths/allura
Allura/allura/lib/helpers.py
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apach...
openstack/rally
tests/unit/plugins/task/sla/test_iteration_time.py
# Copyright 2014: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
luzheqi1987/nova-annotation
nova/tests/unit/integrated/v3/test_user_data.py
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
alexpilotti/python-keystoneclient
keystoneclient/middleware/s3_token.py
# Copyright 2012 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011,2012 Akira YOSHIYAMA <akirayoshiyama@gmail.com> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "Lic...
janezhango/BigDataMachineLearning
py/testdir_release/c5/test_c5_KMeans_sphere_26GB.py
import unittest, time, sys, random, math, json sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_kmeans, h2o_hosts, h2o_import as h2i, h2o_common import socket print "Assumes you ran ../build_for_clone.py in this directory" print "Using h2o-nodes.json. Also the sandbox dir" DO_KMEANS = True # assumes ...
dcrankshaw/clipper
integration-tests/deploy_xgboost_models.py
import os import sys if sys.version_info >= (3, 0): sys.exit(0) import requests import json import numpy as np import time import logging import xgboost as xgb cur_dir = os.path.dirname(os.path.abspath(__file__)) from test_utils import (create_docker_connection, BenchmarkException, headers, ...
trhongbinwang/data_science_journey
deep_learning/keras/keras_as_tf_api.py
# -*- coding: utf-8 -*- """ Created on Fri Mar 17 10:48:09 2017 keras as tf api always use as an tf api In this case, we use Keras only as a syntactical shortcut to generate an op that maps some tensor(s) input to some tensor(s) output, and that's it. @author: hongbin """ import tensorflow as tf from keras import...
jkozerski/meteo
meteo_lcd/update_meteo.py
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # Author: # Janusz Kozerski (https://github.com/jkozerski) # install: # pip install python-dateutil # # for diagrams install: # sudo python -m pip --no-cache-dir install -U matplotlib # # for database install: # sqlite3 (apt-get install sqlite3) # # # or for other diag...
aio-libs/aiohttp_session
aiohttp_session/memcached_storage.py
import json import uuid from time import time from typing import Any, Callable, Optional import aiomcache from aiohttp import web from . import AbstractStorage, Session class MemcachedStorage(AbstractStorage): """Memcached storage""" def __init__( # type: ignore[no-any-unimported] # TODO: aiomcache ...
hipnusleo/laserjet
resource/pypi/paramiko-2.1.1/paramiko/kex_group1.py
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License,...
hfp/tensorflow-xsmm
tensorflow/contrib/distributions/python/ops/bijectors/reshape.py
# 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...
andrei4ka/fuel-web-redhat
fuel_agent_ci/fuel_agent_ci/tests/test_configdrive.py
# Copyright 2014 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 writing...
baallezx/rsp
devtest/q3/3.py
def create_graph(contents): """ if you are given a -1 then it does not point to anything. """ d = {} for i in xrange(len(contents)): d[i] = int(contents[i]) return d def _cycle(graph, key, stack, stacks): # print graph, key, stack if ( key , graph[key] ) in stack: # you have found a cycle stacks.append(sta...
thiblahute/meson
run_project_tests.py
#!/usr/bin/env python3 # Copyright 2012-2016 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...
google-research/google-research
smu/parser/smu_atomic_input_verifier.py
# 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...
iEngage/python-sdk
iengage_client/models/user.py
# coding: utf-8 """ Stakeholder engagement API This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers. OpenAPI spec version: 1.0 Generated by: https://github.com/swagger...