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
# -*- coding: utf-8 -*- # # Copyright 2019 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...
tswast/google-cloud-python
websecurityscanner/google/cloud/websecurityscanner_v1alpha/__init__.py
Python
apache-2.0
1,460
from __future__ import absolute_import # Copyright (c) 2010-2014 openpyxl # Python stdlib imports import pytest from openpyxl.compat import zip # package imports from .. named_range import split_named_range, NamedRange, NamedValue from openpyxl.reader.workbook import read_named_ranges from openpyxl.exceptions impor...
Hitachi-Data-Systems/org-chart-builder
openpyxl/workbook/names/tests/test_named_range.py
Python
apache-2.0
8,342
import os from cloudify.decorators import operation @operation(resumable=True) def create(ctx): """Create test file with contents as defined by node properties.""" path = ctx.node.properties['path'] + '_' + ctx.instance.id content = ctx.node.properties['content'] ctx.logger.info('Creating {path} with...
cloudify-cosmo/cloudify-system-tests
cosmo_tester/resources/plugin/test_plugin/test_plugin/file.py
Python
apache-2.0
678
from operator import * a = -1 b = 5.0 c = 2 d = 6 print('a =', a) print('b =', b) print('c =', c) print('d =', d) print('\nPositive/Negative:') print('abs(a):', abs(a)) print('neg(a):', neg(a)) print('neg(b):', neg(b)) print('pos(a):', pos(a)) print('pos(b):', pos(b)) print('\nArithmetic:') print('add(a, b) :',...
jasonwee/asus-rt-n14uhp-mrtg
src/lesson_algorithms/operator_math.py
Python
apache-2.0
870
# -*- coding: utf-8 -*- """Provides agency object.""" from __future__ import absolute_import from .. import t1types from ..entity import Entity class Organization(Entity): """Organization entity.""" collection = 'organizations' resource = 'organization' _relations = { 'currency', 'sea...
MediaMath/t1-python
terminalone/models/organization.py
Python
apache-2.0
1,906
"""Config flow to configure the Elgato Key Light integration.""" import logging from typing import Any, Dict, Optional from elgato import Elgato, ElgatoError, Info import voluptuous as vol from homeassistant.config_entries import CONN_CLASS_LOCAL_POLL, ConfigFlow from homeassistant.const import CONF_HOST, CONF_PORT f...
leppa/home-assistant
homeassistant/components/elgato/config_flow.py
Python
apache-2.0
5,411
r''' Copyright 2014 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 by applicable law or agreed to i...
mkenne11/nogotofail-pii
nogotofail/mitm/util/httppii.py
Python
apache-2.0
3,080
# 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 agreed to in writing, ...
google-research/dice_rl
tests/run_env_test.py
Python
apache-2.0
1,097
# -*- 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...
palmer159/openstack-test
packstack/installer/utils/network.py
Python
apache-2.0
3,362
# -*- 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-aiplatform
samples/generated_samples/aiplatform_v1beta1_generated_pipeline_service_delete_training_pipeline_async.py
Python
apache-2.0
1,651
import time import threading from .test_utils import skip_unless_module from pulsar.client import amqp_exchange TEST_CONNECTION = "memory://test_amqp" @skip_unless_module("kombu") def test_amqp(): manager1_exchange = amqp_exchange.PulsarExchange(TEST_CONNECTION, "manager_test") manager3_exchange = amqp_exch...
ssorgatem/pulsar
test/amqp_test.py
Python
apache-2.0
1,850
from nanpy import (ArduinoApi, SerialManager) from time import sleep #Connect to Arduino. Automatically finds serial port. connection = SerialManager() a = ArduinoApi(connection=connection) sensor = 14 #AO on Arduino red = 6 green = 7 a.pinMode(sensor, a.INPUT) #Setup sensor a.pinMode(red, a.OUTPUT) ...
lcc755/WorkTerm1
3IfStatements/2Temp/Code/temp.py
Python
apache-2.0
951
# coding=utf-8 # Copyright 2020 The TF-Agents 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 la...
tensorflow/agents
tf_agents/utils/xla.py
Python
apache-2.0
3,895
# -*- coding: utf-8 -*- # # This file is part of python-statsd-client released under the Apache # License, Version 2.0. See the NOTICE for more information. import random from functools import wraps from socket import socket, AF_INET, SOCK_DGRAM import time import logging __version__ = '1.0.6' STATSD_HOST = 'localh...
gaelenh/python-statsd-client
statsd.py
Python
apache-2.0
6,239
# conda is distributed under the terms of the BSD 3-clause license. # Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause. """OS-agnostic, system-level binary package manager.""" from __future__ import absolute_import, division, print_function, unicode_literals import os from os.path import dirname impo...
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/__init__.py
Python
apache-2.0
3,599
# Copyright (c) 2010 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
kevin-zhaoshuai/zun
zun/scheduler/driver.py
Python
apache-2.0
1,764
# Copyright 2020 The TensorFlow Probability 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 o...
tensorflow/probability
tensorflow_probability/python/bijectors/sinh_test.py
Python
apache-2.0
2,831
# Copyright 2013 UNED # # 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...
OpenMOOC/moocng
moocng/portal/templatetags/gravatar.py
Python
apache-2.0
1,427
# Copyright 2013 Red Hat, 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 agre...
DirectXMan12/oslo.reports
oslo_reports/views/json/generic.py
Python
apache-2.0
2,288
#!/usr/bin/env python # encoding: 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 w...
sensisoft/insol
connection.py
Python
apache-2.0
7,986
import pytest from unit.applications.lang.python import TestApplicationPython class TestHTTPHeader(TestApplicationPython): prerequisites = {'modules': {'python': 'any'}} def test_http_header_value_leading_sp(self): self.load('custom_header') resp = self.get( headers={ ...
nginx/unit
test/test_http_header.py
Python
apache-2.0
13,498
import unittest import struct import twink def timeout_pause(func): def wrap(*args, **kwargs): try: return func(*args, **kwargs) except twink.sched.socket.timeout: return b"" return wrap class ChannelTestCase(unittest.TestCase): def test_pair1(self): a,b = twink.sched.socket.socketpair() ...
hkwi/twink
test/test_twink.py
Python
apache-2.0
8,327
"""Copyright 2011 The University of Michigan 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 writi...
jieyu/maple
test/idiom/predictor/hb_filter2.py
Python
apache-2.0
2,719
# Copyright 2016 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 by applicable law or a...
pongem/python-bot-project
spanner/cloud-client/quickstart_test.py
Python
apache-2.0
1,603
# -*- coding: utf-8 -*- # # Copyright (c) 2017 Intel Corp. # """ Diagnostics inband Plugin """ from ...plugin import DeclarePlugin from .. import CommandResult from .diagnostics_command import DiagnosticsCommand @DeclarePlugin('inband_diagnostics', 100) class DiagnosticsInBandCommand(DiagnosticsCommand): """Diagn...
intel-ctrlsys/actsys
actsys/control/commands/diagnostics/diagnostics_inband_command.py
Python
apache-2.0
832
from django.contrib import admin from django import forms from .models import * from django.contrib.auth.models import User class ProfileAdminForm(forms.ModelForm): class Meta: model = Profile fields = '__all__' class ProfileAdmin(admin.ModelAdmin): form = ProfileAdminForm admin.site.registe...
PDXCodeCoop/account
admin.py
Python
apache-2.0
374
from selenium import webdriver from helpers.mail import MailHelper from helpers.session import SessionHelper from helpers.navigation import NavigationHelper from helpers.project import ProjectHelper from helpers.james import JamesHelper from helpers.signup import SignupHelper from helpers.soap import SoapHelper clas...
dkorogodin/python_mantis
helpers/application.py
Python
apache-2.0
1,635
# -*- 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-api-gateway
samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_gateway_async.py
Python
apache-2.0
1,728
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. from .ipunittest import IronPythonTestCase, stdout_trapper, stderr_trapper, path_modifier, retryOnFailure, run_t...
IronLanguages/ironpython3
Src/IronPython/Lib/iptest/__init__.py
Python
apache-2.0
454
from termcolor import cprint from .system import get_system_info def setup(backend): # disable gpu if needed - must be as early as possible. if backend == 'tensorflow-cpu': import tensorflow as tf tf.config.set_visible_devices([], 'GPU') cprint('Tensoflow set to CPU', 'green') # s...
google-research/evoflow
benchmark/benchmark/setup.py
Python
apache-2.0
739
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ """A tiny Python program to check that Python is working. Try running this program from t...
amcw7777/python-exercises
hello.py
Python
apache-2.0
1,010
"""Simple runner for the prover. Iterate over the tasks sequentially. This runner can run the prover on a set of tasks without the overhead of starting a distributed job. """ from __future__ import absolute_import from __future__ import division # Import Type Annotations from __future__ import print_function import...
tensorflow/deepmath
deepmath/deephol/prover_runner.py
Python
apache-2.0
2,063
from django.conf.urls import url from . import views from . import ajax urlpatterns = [ url(r'^status/', ajax.status, name='status'), url(r'^$', views.index, name='index'), url(r'^set/(?P<id>\d+)/(?P<value>\d+)/$', ajax.set_execution_element, name='set_execution_element'), url(r'^set/(?P<value>\d+)/$',...
marians20/Aquarium
automation/urls.py
Python
apache-2.0
597
# Copyright 2018 The TensorFlow Probability 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 o...
tensorflow/probability
tensorflow_probability/python/internal/distribution_util.py
Python
apache-2.0
57,969
# Copyright 2022 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from sis_provisioner.management.commands import SISProvisionerCommand from sis_provisioner.models.term import Term class Command(SISProvisionerCommand): help = "Updates term override dates in Canvas." def handle(self, *ar...
uw-it-aca/canvas-sis-provisioner
sis_provisioner/management/commands/update_term_overrides.py
Python
apache-2.0
407
import urllib2 import staccato.protocols.interface as base from staccato.common import exceptions class HttpProtocol(base.BaseProtocolInterface): def __init__(self, service_config): self.conf = service_config def _validate_url(self, url_parts): pass def _parse_opts(self, opts): ...
buzztroll/staccato
staccato/protocols/http/__init__.py
Python
apache-2.0
2,280
import logging import time from mercury.common.exceptions import MercuryCritical, MercuryGeneralException from mercury.inventory.hooks import get_hooks_from_data, run_hooks log = logging.getLogger(__name__) class InventoryDBController(object): def __init__(self, collection): self.collection = collectio...
jr0d/mercury
src/mercury/inventory/db.py
Python
apache-2.0
4,916
# 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 by applicable law or a...
urandu/roboto
scripts/lib/fontbuild/Build.py
Python
apache-2.0
10,822
#!/usr/bin/env python # Licensed under the Apache License, Version 2.0 import argparse, cmath, math, os, time, colorsys, sys, random, signal import subprocess, multiprocessing import pygame from pygame.locals import * import pygame.draw, pygame.image import numpy as np import scipy.io.wavfile # for headless rendering...
TristanCacqueray/pyrender
utils.py
Python
apache-2.0
16,990
# # 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...
aosagie/spark
python/pyspark/sql/readwriter.py
Python
apache-2.0
56,250
# Copyright 2015 Ian Cordasco # # 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, sof...
dstufft/twine
twine/package.py
Python
apache-2.0
4,744
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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 ...
EricssonResearch/calvin-base
calvin/runtime/south/transports/calvinip/calvinip_transport.py
Python
apache-2.0
3,415
#!/usr/bin/env python3 # 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...
hanmy75/voice-recognizer
checkpoints/check_wifi.py
Python
apache-2.0
2,439
""" .. module: lemur.bases.export :platform: Unix :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson <kglisson@netflix.com> """ from lemur.plugins.base import Plugin class ExportPlugin(Plugin): """ This is the...
rpicard/lemur
lemur/plugins/bases/export.py
Python
apache-2.0
470
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the Google Chrome Preferences file event formatter.""" import unittest from plaso.formatters import chrome_preferences from tests.formatters import test_lib class ChromeExtensionInstallationEventFormatterTest( test_lib.EventFormatterTestCase): """Tests f...
dc3-plaso/plaso
tests/formatters/chrome_preferences.py
Python
apache-2.0
1,056
import ntpath import os import sys import unittest import warnings from test.support import TestFailed, FakePath from test import support, test_genericpath from tempfile import TemporaryFile try: import nt except ImportError: # Most tests can complete without the nt module, # but for those that require it...
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/test/test_ntpath.py
Python
apache-2.0
33,922
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
rsepassi/tensor2tensor
tensor2tensor/serving/query.py
Python
apache-2.0
3,923
#!/usr/bin/env 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 applic...
adviti/melange
app/soc/views/helper/requests.py
Python
apache-2.0
6,079
import synapse.lib.module as s_module class PolMod(s_module.CoreModule): @staticmethod def getBaseModels(): modl = { 'types': ( ('pol:country', {'subof': 'guid', 'doc': 'A GUID for a country'}), ('pol:iso2', {'subof': 'str', 'lower': 1, 'regex': '^[a-z0-9]{...
vivisect/synapse
synapse/models/geopol.py
Python
apache-2.0
1,760
import socket import struct import re import time # ncat -vc 'LD_LIBRARY_PATH=. ./vuln2' -kl 8888 # python exp2.py sc = socket.socket(socket.AF_INET, socket.SOCK_STREAM); sc.connect(('localhost', 8888)) def W(x): sc.send(x) def R(): return sc.recv(4096) def PI(x): return struct.pack('I', x) def UI(s): ret...
qazbnm456/Summer-training-in-NSYSU
static/slides/w5/src/exp2.py
Python
apache-2.0
1,112
""" Base class for Pipeline API unittests. """ from functools import wraps from unittest import TestCase from numpy import arange, prod from pandas import date_range, Int64Index, DataFrame from six import iteritems from zipline.finance.trading import TradingEnvironment from zipline.pipeline.engine import SimplePipel...
otmaneJai/Zipline
tests/pipeline/base.py
Python
apache-2.0
4,038
from __future__ import unicode_literals import datetime import django from django.test import TransactionTestCase from django.utils.timezone import now from job.configuration.results.job_results import JobResults from job.messages.completed_jobs import CompletedJob, CompletedJobs from job.models import Job from job....
ngageoint/scale
scale/job/test/messages/test_completed_jobs.py
Python
apache-2.0
7,279
# -*- 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...
googleapis/python-aiplatform
samples/generated_samples/aiplatform_generated_aiplatform_v1_metadata_service_list_contexts_async.py
Python
apache-2.0
1,543
# encoding = utf-8 class Context: def __init__(self): self.input="" self.output="" class AbstractExpression: def Interpret(self, context): pass class Expression(AbstractExpression): def Interpret(self, context): print("terminal interpret") class NonterminalExpression(Abst...
JiangKlijna/design-pattern
InterpreterPattern/Interpreter.py
Python
apache-2.0
637
"""Representation of Z-Wave sensors.""" from __future__ import annotations from collections.abc import Mapping from dataclasses import dataclass import logging from typing import cast import voluptuous as vol from zwave_js_server.client import Client as ZwaveClient from zwave_js_server.const import CommandClass, Conf...
Danielhiversen/home-assistant
homeassistant/components/zwave_js/sensor.py
Python
apache-2.0
17,188
#!/usr/bin/python #Hola import psutil import signal import sys import time from threading import Thread def interruptHandler(signal, frame): sys.exit(0) def dataNetwork(): netdata = psutil.net_io_counters() return netdata.packets_sent + netdata.packets_recv def dataNetworkHandler(): idDevice = "IoT1...
migueltlapa/TheIoTLearningInitiative
InternetOfThings101/main.py
Python
apache-2.0
742
# 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/capture_the_flag.py
Python
apache-2.0
26,609
import csv import numpy as np class Table(object): def __init__(self, headers): self.data = dict() self.rows = list() self.headers = map(lambda val: val.strip(), headers) self.index_data = dict() for header in self.headers: self.data[header] = list() ...
wallarelvo/Dodger
analysis/table.py
Python
apache-2.0
2,951
#!/usr/bin/env python # Copyright (c) 2003-2006 ActiveState Software Inc. # # The MIT License # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limita...
f304646673/PhpDebugger
src/pydbgpd.py
Python
apache-2.0
38,106
def constant(f): def fset(self, value): raise TypeError def fget(self): return f() return property(fget, fset)
mariomann/basc
basc/constant.py
Python
apache-2.0
141
from robot.parsing.model import TestCaseFile, TestDataDirectory, TestCase, UserKeyword from rules import TestSuiteRule, TestCaseRule class LintController(object): '''A class which recursively applies rules against a test suite and its tests and keywords To use this class, create an instance and then call che...
boakley/robotframework-workbench
rwb/lint/lint.py
Python
apache-2.0
1,606
from collections import defaultdict import logging import time import traceback class FlowRunner(object): """ A FlowRunner encapsulates logic related to claiming and ticking flows. """ def __init__(self, flow_record_client=None, flow_engine=None, task_ctx=None, tick_interval=120, max...
aspuru-guzik-group/mission_control
mc/runners/flow_runner/flow_runner.py
Python
apache-2.0
4,524
# Copyright 2012 Anton Beloglazov # # 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 wri...
fr34k8/openstack-neat
neat/locals/manager.py
Python
apache-2.0
17,670
# Copyright 2015 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...
annarev/tensorflow
tensorflow/python/framework/errors_impl.py
Python
apache-2.0
20,252
import time from selenium import webdriver driver = webdriver.Chrome() driver.get('http://localhost/Litecart/admin/login.php'); time.sleep(5) username = driver.find_element_by_name('username') username.send_keys('admin') password = driver.find_element_by_name('password') password.send_keys('admin') login = dri...
Rina81/Selenium1
Task3.py
Python
apache-2.0
398
import mock from nose.tools import * # flake8: noqa import pytest from addons.github.models import GithubFile from api.base.settings.defaults import API_BASE from api_tests import utils as test_utils from api_tests.preprints.filters.test_filters import PreprintsListFilteringMixin from api_tests.preprints.views.test_p...
TomBaxter/osf.io
api_tests/preprints/views/test_preprint_list.py
Python
apache-2.0
33,281
# 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...
changsimon/trove
trove/taskmanager/api.py
Python
apache-2.0
7,806
#!/usr/bin/env python # Copyright 2014 Cloudera, 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...
jtbirdsell/kudu-examples
clients/python/kudu/tests/test_kudu.py
Python
apache-2.0
10,848
# 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...
wooga/airflow
tests/models/test_xcom.py
Python
apache-2.0
1,984
# __author__ = 'Irina.Chegodaeva' import random import string import os.path import sys import getopt from model.group import Group import time import clr clr.AddReferenceByName('Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c') from Microsoft.Office.Inte...
IrishaCh/ironpython_traning
generator/group.py
Python
apache-2.0
1,476
# 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 agreed to in writing, s...
googleapis/python-automl
samples/snippets/language_entity_extraction_predict_test.py
Python
apache-2.0
1,546
from math import sqrt from problem_3.large_prime_factor import prime_factors def num_divisors(factors, number): #number = factor1^n1*factor2^n2*factor3^n3... #the number of ways we can choose a combination of factors will be the total number of divisors, this number is (n1+1)(n2+1)(n3+1)... exponents = [...
plilja/project-euler
problem_12/triangle_numbers.py
Python
apache-2.0
1,607
# auto-generated by map_feature_names FEATURE_NAMES = { 'Chebyshev Coefficients () [0]': ('chebyshev_coefficients', 0), 'Chebyshev Coefficients () [1]': ('chebyshev_coefficients', 1), 'Chebyshev Coefficients () [2]': ('chebyshev_coefficients', 2), 'Chebyshev Coefficients () [3]': ('cheb...
simleo/pydoop-features
pyfeatures/feature_names.py
Python
apache-2.0
264,255
import os.path import logging from . import rels as acdcRels from . import models from . import manuscript class Catalog(manuscript.Manuscript): def get_scanning_file(self, xml): (base, ext) = os.path.splitext(os.path.basename(xml)) for dir in self.imagedir: if os.path.exists(os.path...
acoburn/fedorapy-ingest
acdc/catalog.py
Python
apache-2.0
5,140
# -*- test-case-name: txweb2.test -*- ## # Copyright (c) 2009 Twisted Matrix Laboratories. # Copyright (c) 2010-2017 Apple Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the ...
macosforge/ccs-calendarserver
txweb2/__init__.py
Python
apache-2.0
1,726
# 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 # distribu...
quantumlib/OpenFermion
src/openfermion/ops/operators/symbolic_operator.py
Python
apache-2.0
26,184
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ma...
quattor/aquilon
lib/aquilon/worker/commands/add_metacluster_prefix.py
Python
apache-2.0
2,002
# Copyright 2014 Open Source Robotics Foundation, 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...
iwanders/catkin_tools
catkin_tools/commands/catkin.py
Python
apache-2.0
9,431
# 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 # d...
ge0rgi/cinder
cinder/objects/qos_specs.py
Python
apache-2.0
8,004
__author__ = 'Justin Walters <walters.justin01@gmail.com>' __license__ = 'BSD' __version__ = (0, 1, 0) from .resources import ModelResource
FFX01/django-restup
restup/__init__.py
Python
bsd-2-clause
142
# -*- coding: utf-8 -*- # captiveportal # ************* # # This test is a collection of tests to detect the presence of a # captive portal. Code is taken, in part, from the old ooni-probe, # which was written by Jacob Appelbaum and Arturo Filastò. # # This module performs multiple tests that match specific vendor capt...
0xPoly/ooni-probe
ooni/nettests/manipulation/captiveportal.py
Python
bsd-2-clause
26,101
#!/usr/bin/env python import sys import os project = 'Bit' copyright = '2012, Tres Walsh' version = '0.4' release = '0.4' html_theme = 'default' if os.environ.get('READTHEDOCS', None) else 'haiku' exclude_patterns = ['_build'] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' pygments_sty...
slurps-mad-rips/bit
docs/conf.py
Python
bsd-2-clause
392
#!/usr/bin/env python # -*- coding: utf-8 -*- def fetch(keyword): url, params = make_url(keyword) async with aiohttp.ClientSession() as session: async with session.get('https://api.github.com/events') as resp: print(resp.status) print(await resp.text()) def make_url(keyword='s...
sharkspeed/dororis
platforms/weixin/miniapp/miniapp_0_selfhost_server/server/fetch.py
Python
bsd-2-clause
570
#if customizations are required when doing a export of the jpackage code def main(j,jp): recipe=jp.getCodeMgmtRecipe() recipe.export()
Jumpscale/jumpscale6_core
lib/JumpScale/baselib/jpackages/templates/actions/code.export.py
Python
bsd-2-clause
147
# -*- coding: utf-8 -*- # # maillib documentation build configuration file, created by # sphinx-quickstart on Wed Oct 21 21:26:20 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
jkocherhans/maillib
docs/conf.py
Python
bsd-2-clause
6,305
from pytest import approx import pymap3d as pm lla0 = (42, -82, 200) aer0 = (33, 70, 1000) ELL = pm.Ellipsoid() A = ELL.semimajor_axis B = ELL.semiminor_axis def test_ecef_ned(): enu = pm.aer2enu(*aer0) ned = (enu[1], enu[0], -enu[2]) xyz = pm.aer2ecef(*aer0, *lla0) n, e, d = pm.ecef2ned(*xyz, *lla...
scienceopen/pymap3d
src/pymap3d/tests/test_ned.py
Python
bsd-2-clause
1,473
#!/usr/bin/env python # Support setuptools only, distutils has a divergent and more annoying API and # few folks will lack setuptools. from setuptools import setup, find_packages import sys # Version info -- read without importing _locals = {} with open('invoke/_version.py') as fp: exec(fp.read(), None, _locals) ...
pfmoore/invoke
setup.py
Python
bsd-2-clause
2,503
import os from django.conf import settings from django.core import signing from django.core.urlresolvers import reverse from django.db import models from django.template import loader from django.utils import timezone from polymorphic.models import PolymorphicModel from . import managers class Group(models.Model): ...
incuna/incuna-groups
groups/models.py
Python
bsd-2-clause
6,709
""" :Description: PasteScript Template to generate a GitHub hosted python package. Let you set the package name, a one line description, the Licence (support GPL, LGPL, AGPL and BSD - GPLv3 by default) and the author name, email and organisation variables:: paster create -t gh_package <project name> The result...
dinoboff/github-tools
src/github/tools/template.py
Python
bsd-2-clause
3,741
import json import os import sys import getopt import subprocess import re import copy import hashlib def getBranchName(directory): """Returns the name of the current git branch""" return subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"], cwd=directory).strip() def getRemotes(directory): ...
ScreamingUdder/isis_nexus_streamer
cmake/CoverallsGenerateGcov.py
Python
bsd-2-clause
5,933
# ***************************************************************************** # Copyright (c) 2020, Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of sou...
IntelLabs/hpat
sdc/utilities/utils.py
Python
bsd-2-clause
22,323
############################################################################### # # 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_chart_bar09.py
Python
bsd-2-clause
1,353
# -*- coding: utf-8 -*- ''' Главный класс сервера. ''' import sys from PySide import QtGui from .pakGui.modGui import clsGui from .pakControl.modControl import clsControl class clsTransServ(QtGui.QApplication): def __init__(self): print('clsTransServ.__init__()') super(clsTransServ, self).__init__...
prospero78/pyTrans
Server/pakTransServ/modTransServ.py
Python
bsd-2-clause
568
# Test data storage import bvp dbi = bvp.DBInterface() # Humans humans = dbi.query(type='Object', fname='Mixamo_Characters_Free_0.blend') ob1 = humans[3] cars = dbi.query(type='Object', semantic_category='auto') ob2 = cars[1] ob2.pos3D = [3, -1, 0] ob2.size3D = 6.0 # Grab an action actions = dbi.query(type='Action...
marklescroart/bvp
Tests/test_data_output.py
Python
bsd-2-clause
612
assertions = 0
dag/attest
attest/statistics.py
Python
bsd-2-clause
15
# Copyright (c) 2019, CNRS-LAAS # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the...
fire-rs-laas/fire-rs-saop
python/fire_rs/planning/lab_utility_map.py
Python
bsd-2-clause
7,493
from django.conf.urls import url from django.views.generic import TemplateView from .views import ArticleViewSet, RecommendedArticleViewSet urlpatterns = [ url(r'^$', TemplateView.as_view(template_name="index.html"), name='blog_index_page'), url(r'^articles/$', ArticleViewSet.as_view({'get': 'list'}), name=...
mevinbabuc/django-mango
articles/urls.py
Python
bsd-2-clause
832
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 각종 포맷의 코퍼스를 엑소브레인 코퍼스 포맷으로 변환하는 스크립트 __author__ = 'krikit (krikit@naver.com)' __copyright__ = 'No copyright. Just copyleft!' """ ########### # imports # ########### import argparse import codecs import json import logging import sys ############# # functions # ##...
ecarg/grace
bin/corpus_converter.py
Python
bsd-2-clause
3,937
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p from OpenGL.GL import glget EXTENSION_NAME = 'GL_ARB_texture_query_levels' def glInitTextureQueryLevelsARB(): '''Return boolean indicating whether this extension is available''' from OpenGL import extensions r...
frederica07/Dragon_Programming_Process
PyOpenGL-3.0.2/OpenGL/raw/GL/ARB/texture_query_levels.py
Python
bsd-2-clause
370
#!/usr/bin/env python # THIS SHEBANG IS REALLY REALLY IMPORTANT import rospy import time from std_msgs.msg import Int16MultiArray if __name__ == '__main__': try: rospy.init_node('simple_publisher') # Tell ros we are publishing to the robot topic pub = rospy.Publisher('/robot', Int16MultiAr...
kscottz/owi_arm
scripts/publish_to_a_topic.py
Python
bsd-2-clause
840