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
#------------------------------------------------------------------------------- # Copyright 2017 Cognizant Technology Solutions # # 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:...
CognizantOneDevOps/Insights
PlatformAgents/com/cognizant/devops/platformagents/agents/alm/hp/HpAlmAgent3.py
Python
apache-2.0
11,216
import pandas as pd from sklearn import linear_model import matplotlib.pyplot as plt df = pd.read_fwf('brain_body.txt') x_values = df[['Brain']] y_values = df[['Body']] #train model on data body_reg = linear_model.LinearRegression() body_reg.fit(x_values, y_values) # visualise results plt.scatter(x_values, y_value...
morphean/deep-learning
linear-regression/linear-regression.py
Python
apache-2.0
380
import os import logging import tarfile import shutil import ConfigParser import tempfile from skybase import config as sky_cfg from skybase.skytask import SkyTask from skybase import skytask from skybase.actions import pack as pack_actions from skybase.skytask import pack from skybase.actions import sky_boto as sky_b...
lithiumtech/skybase.io
skybase/skytask/pack/submit.py
Python
apache-2.0
11,301
# -*- 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_v2beta1_generated_entity_types_delete_entity_type_sync.py
Python
apache-2.0
1,440
from setuptools import setup, find_packages import os version = '2.3.14' requires = [ 'setuptools', 'openprocurement.api>=2.3', 'openprocurement.tender.openua', ] test_requires = requires + [ 'webtest', 'python-coveralls', ] docs_requires = requires + [ 'sphinxcontrib-httpdomain', ] entry_p...
ivanromakh/openprocurement.tender.limited
setup.py
Python
apache-2.0
1,687
__author__ = 'tsungyi' from __future__ import print_function import numpy as np import datetime import time from collections import defaultdict import mask import copy class COCOeval: # Interface for evaluating detection on the Microsoft COCO dataset. # # The usage for CocoEval is as follows: # cocoG...
rishita/mxnet
example/rcnn/rcnn/pycocotools/cocoeval.py
Python
apache-2.0
19,780
import sys import json def test_parameter(name, value): assert value is not None print("Tested parameter '{0}' is {1}".format(name, value)) if __name__ == '__main__': with open("{0}/input.json".format(sys.argv[1]), 'r') as fh: data = json.load(fh) parameters = data.get('kwargs', {}) exp...
cloudify-cosmo/cloudify-manager
tests/integration_tests/resources/dsl/scripts/workflows/test_deployment_id_parameters.py
Python
apache-2.0
664
""" Base classes for forms and fields """ import logging from collections import OrderedDict from flask import Markup, request from . import validate from . import exceptions from . import formtype from . import styles from .env import env __author__ = 'Stephen Brown (Little Fish Solutions LTD)' log = logging.get...
stevelittlefish/easyforms
easyforms/form.py
Python
apache-2.0
35,700
#! /usr/bin/python3 # -*- coding: utf-8 -*- import getopt import sys import time import datetime import subprocess connection_name = "Подключение по локальной сети" #netsh interface set interface "Подключение по локальной сети" admin=DISABLED #команда включения интернета CONNECTION_ON = 'netsh interface set interface ...
skiliks/internet-connection-breaker
icb.py
Python
apache-2.0
4,180
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-09-20 03:40 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('partner', '0015_auto_20170912_0844'), ] operations = ...
unicef/un-partner-portal
backend/unpp_api/apps/partner/migrations/0016_auto_20170920_0340.py
Python
apache-2.0
4,330
''' Created on 12.4.2017 @author: Markus.Walden ''' from data.finance.LoadDataYahoo import LoadDataFromSQL, StocksStatistics from data.finance.addins.mlToFinance1 import LinkQuandl from data.finance.addins.neuralNetTestModified import NeuralNetForward, plotSleepStudy, generateSampleData import matplotlib.p...
markus-antero/Stock
data/finance/addins/main.py
Python
apache-2.0
8,181
# -*- coding: utf-8 -*- from model.contact import Contact from random import randrange def test_modify_some_contact(app, db, check_ui): random_value = str(app.get_random_int()) if app.contact.count() == 0: app.contact.add(Contact(first_name="First Contact")) # old_contacts = app.contact.get_contac...
SmotritelTerve/python_training
test/test_modify_contact.py
Python
apache-2.0
2,179
""" Copyright 2015-2018 Jacob M. Graving <jgraving@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
jgraving/pinpoint
pinpoint/utils.py
Python
apache-2.0
33,939
# Copyright 2006 James Tauber and contributors # Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # 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/...
anandology/pyjamas
library/gwt/ui/UIObject.py
Python
apache-2.0
10,085
import re from .models import User class BaseControl(object): def parseRequest(post): return True def get_errors(self): return self.m_errors def get_values(self): return self.m_values def clean(self): pass #do nothing return True def validate(self): # do nothing return True def register(sel...
amitdhiman000/dais
user/control.py
Python
apache-2.0
2,830
# # 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...
RyanSkraba/beam
sdks/python/apache_beam/runners/dataflow/test_dataflow_runner.py
Python
apache-2.0
4,039
""""Argo Workflow for testing notebook-server-jupyter-scipy OCI image""" from kubeflow.kubeflow.ci import workflow_utils from kubeflow.testing import argo_build_util class Builder(workflow_utils.ArgoTestBuilder): def __init__(self, name=None, namespace=None, bucket=None, test_target_name=None, **...
kubeflow/kubeflow
py/kubeflow/kubeflow/ci/notebook_servers/notebook_server_jupyter_scipy_tests.py
Python
apache-2.0
1,826
import datetime import time from django.utils.timezone import utc from django.core.servers.basehttp import FileWrapper from django.http import HttpResponse from django import forms, http import signal import shutil from uuid import uuid4 import ntpath import json import glob import os from StringIO import StringIO fr...
markusmichel/Tworpus-Client
session/views.py
Python
apache-2.0
9,915
from synapse.tests.common import * import synapse.lib.fifo as s_fifo class FifoTest(SynTest): def test_fifo_nack_past(self): with self.getTestDir() as dirn: conf = { 'dir': dirn, 'file:maxsize': 1024, 'window:max': 4, 'window:mi...
vivisect/synapse
synapse/tests/test_lib_fifo.py
Python
apache-2.0
9,331
# -*- coding: utf-8 -*- import functools import urlparse import logging import re import pytz from dirtyfields import DirtyFieldsMixin from include import IncludeManager from django.db import models from django.db.models import Q from django.utils import timezone from django.contrib.contenttypes.fields import GenericR...
pattisdr/osf.io
osf/models/preprint.py
Python
apache-2.0
40,401
#! /usr/bin/env python # coding=utf-8 # Copyright (c) 2019 Uber Technologies, 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 # # Unles...
uber/ludwig
ludwig/data/dataset/pandas.py
Python
apache-2.0
3,028
#!/usr/bin/env python # Copyright (c) 2017-2021 F5 Networks, 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 appl...
f5devcentral/f5-cccl
f5_cccl/resource/ltm/profile/test/test_profile.py
Python
apache-2.0
1,931
import pytest from threddsclient import read_xml def test_birdhouse_root(): xml = """ <catalog xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0" xmlns:xlink="http://www.w3.org/1999/xlink" name="THREDDS Server Default Catalog" version="1.0.1"> # noqa <service name="all" serviceType...
bird-house/threddsclient
tests/test_birdhouse_sample.py
Python
apache-2.0
2,985
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
GoogleCloudPlatform/django-cloud-deploy
django_cloud_deploy/tests/unit/skeleton/source_generator_test.py
Python
apache-2.0
34,033
# Copyright 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...
citrix-openstack-build/keystonemiddleware
keystonemiddleware/tests/client_fixtures.py
Python
apache-2.0
23,768
""" Sink serves just one purpose, to ensure that links are never crawled twice during the running of the phrasetank service all producers checks the sink to ensure that it does not crawl a link twice """ import zlib class PhrasetankSink(object): sinks = {} def __init__(self): pass @...
donama/phrasetank
sink/__init__.py
Python
apache-2.0
1,663
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0008_auto_20151028_1931'), ('newsletter', '0005_auto_20150927_1517'), ] operations = [ migrations.AddField( ...
rogerhil/flaviabernardes
flaviabernardes/flaviabernardes/newsletter/migrations/0006_auto_20151110_2139.py
Python
apache-2.0
1,147
"""The songpal component.""" from collections import OrderedDict import logging import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_NAME from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import Home...
tchellomello/home-assistant
homeassistant/components/songpal/__init__.py
Python
apache-2.0
1,582
#!/usr/bin/env python2.7 import datetime import monthdelta def parse_date(date_str): return datetime.datetime.strptime(date_str, "%Y-%m-%d") def unparse_date(date_obj): return date_obj.strftime("%Y-%m-%d") class Company(object): def __init__(self, name): self.name = name self.flows = [] ...
gkotian/zulip
tools/deprecated/finbot/money.py
Python
apache-2.0
7,737
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # HBN Wearable Analysis documentation build configuration file, created by # sphinx-quickstart on Wed Jun 28 15:25:14 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are presen...
ChildMindInstitute/HBN-wearable-analysis
docs/conf.py
Python
apache-2.0
5,181
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2013 Yahoo! 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.or...
pombredanne/anvil
anvil/ini_parser.py
Python
apache-2.0
9,960
from django import template register = template.Library() @register.filter def duration(td): seconds = td minutes, seconds = divmod(seconds, 60) hours, minutes = divmod(minutes, 60) return "%d:%02d:%02d" % (hours, minutes, seconds)
baalkor/timetracking
opconsole/templatetags/duration.py
Python
apache-2.0
253
import numpy from .abstract import OpticalEqipment from ..utils import ConnectionType, ureg from ..constants import GraphConstants class Telescope(OpticalEqipment): """ Class representing telescope """ def __init__(self, aperture, focal_length, vendor="unknown telescope", connection_type=ConnectionType.F_1_...
pozar87/apts
apts/opticalequipment/telescope.py
Python
apache-2.0
2,655
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os from dataclasses import dataclass from pathlib import Path from textwrap import dedent from typing import Mapping, Optional, Tuple, cast from pants.core.util_rules import subpro...
jsirois/pants
src/python/pants/backend/python/util_rules/pex_environment.py
Python
apache-2.0
10,132
# Copyright 2017 Cisco Systems, 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 o...
noironetworks/networking-cisco
networking_cisco/db/migration/alembic_migrations/versions/mitaka/expand/73c84db9f299_update_ha_group_primary_key.py
Python
apache-2.0
2,956
"""An AdaNet evaluator implementation in Tensorflow using a single graph. Copyright 2018 The AdaNet 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 https://www.ap...
tensorflow/adanet
adanet/core/evaluator.py
Python
apache-2.0
4,624
"""Copyright 2008 Orbitz WorldWide Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
pypy90/graphite-web
webapp/graphite/settings.py
Python
apache-2.0
5,977
from pocket_change.rest.util import Preserializer, JiraRelatedResource from pocket_change.rest.components import kaichu from flask import g, request, current_app from pocket_change import sqlalchemy_db from flask.ext.restful import Resource from flask.ext.restful.reqparse import RequestParser from flask.ext.login impor...
psusloparov/sneeze
pocket_change/pocket_change/rest/components/jira_extensions.py
Python
apache-2.0
5,279
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import distutils.spawn import os.path import platform import re import sys import subprocess from functools import partial from collections import defaultdict import keyboard #Using module keyboard try: from PyQt5.QtGui import * from PyQt5.QtCore im...
dedoogong/asrada
utils/labelImg.py
Python
apache-2.0
57,731
# 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...
Alzon/senlin
senlin/tests/unit/test_wsgi.py
Python
apache-2.0
18,399
# Copyright 2012-2021 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...
QuLogic/meson
mesonbuild/coredata.py
Python
apache-2.0
52,406
# Copyright 2013 NEC Corporation. # 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...
rzarzynski/tempest
tempest/api/compute/admin/test_aggregates.py
Python
apache-2.0
10,395
#!/usr/bin/env python from __future__ import print_function import os, sys import argparse import datetime import netCDF4 as nc import numpy as np import matplotlib import matplotlib.colors as mcolors from lib_util import run_ncra matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.basemap import...
CWSL/access-cm-tools
analyse/spatial_difference_plot.py
Python
apache-2.0
3,634
import django import os from django.utils import timezone # Initial setup required os.environ.setdefault("DJANGO_SETTINGS_MODULE", "homeStruction.settings") django.setup() from project.models import Temperature, Light, Humidity import matplotlib matplotlib.use("Agg") from matplotlib.dates import DateFormatter from m...
BornToDebug/homeStruction
website/imageGeneration.py
Python
apache-2.0
1,352
__source__ = 'https://leetcode.com/problems/leaf-similar-trees/' # Time: O(N + M) # Space: O(N + M) # # Description: Leetcode # 872. Leaf-Similar Trees # # Consider all the leaves of a binary tree. # From left to right order, the values of those leaves form a leaf value sequence. # # For example, in the given tree abo...
JulyKikuAkita/PythonPrac
cs15211/Leaf-SimilarTrees.py
Python
apache-2.0
3,524
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-16 15:26 from __future__ import unicode_literals from django.db import migrations, models import webapp.models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
lemarcudal/sha_thedivision
test/mysite/webapp/migrations/0001_initial.py
Python
apache-2.0
1,780
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import logging from pants.option.option_types import DictOption from pants.option.subsystem import Subsystem DEFAULT_SCALA_VERSION = "2.13.6" _logger...
pantsbuild/pants
src/python/pants/backend/scala/subsystems/scala.py
Python
apache-2.0
1,433
#!/usr/bin/env python3 # # 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 o...
googleapis/storage-testbench
tests/test_error.py
Python
apache-2.0
3,099
import functools import httplib as http import itertools from operator import itemgetter from dateutil.parser import parse as parse_date from django.core.exceptions import ValidationError from django.db.models import Q from django.utils import timezone from flask import request, redirect import pytz from framework.d...
erinspace/osf.io
website/project/views/drafts.py
Python
apache-2.0
13,819
from threading import Lock class Middleware(object): """ This class concerns middleware code for Application to extend from """ def middleware(self, class_): """ Add Application middleware :param class_: The class of the middleware :type class_: edmunds.foundation....
LowieHuyghe/edmunds
edmunds/foundation/concerns/middleware.py
Python
apache-2.0
1,120
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import requests class Brain(): def think(self, userSession): pass class WikiBrain(Brain): maxN = '' maxX = '' wikiAPI = u'https://zh.wikipedia.org/w/api.php?uselang=zh_tw&action=query&prop=extracts&format=xml&exintro=&titles=' ...
taosheng/jarvis
socialBrainTest/python/brain.py
Python
apache-2.0
1,645
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import urlparse from scrapy import log from scrapy.http import Request from base.base_wolf import Base_Wolf class Wolf(Base_Wolf): def __init__(self, *args, **kwargs): super(Wolf, self).__init__(*args, **kwargs) self.name = 'cnscg' s...
pczhaoyun/wolf
wolf/spiders/wolves/cnscg.py
Python
apache-2.0
1,092
#FLM: Save EPS from selected Glyph # Description: # Generate a EPS file for the Selected Glyph # Credits: # Pablo Impallari # http://www.impallari.com import os.path from FL import * from robofab.world import CurrentFont # Get current Glyphs f = CurrentFont() g = fl.glyph # Get path and file name path = f.path dir...
impallari/Impallari-Fontlab-Macros
IMP Testing/Save EPS from Glyph.py
Python
apache-2.0
436
#这个题面试时遇到过, 本身matrix是有特点的, 如果从左下角开始搜索 就可以看到规律 class Solution: def searchMatrix(self, matrix, target): """ :type matrix: List[List[int]] :type target: int :rtype: bool """ i = len(matrix) - 1 j = 0 flag = 0 if not matrix or not matrix[0]: ...
MingfeiPan/leetcode
array/74.py
Python
apache-2.0
655
# Copyright (c) 2015 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 ...
noironetworks/neutron
neutron/agent/l3/ha_router.py
Python
apache-2.0
19,533
""" 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 distri...
rstens/gwells
gwells/models/BCGS_Numbers.py
Python
apache-2.0
996
import unittest from application.caches.local_cache import LocalCache class LocalCacheTest(unittest.TestCase): def setUp(self): self.cache = LocalCache() def tearDown(self): pass def test_add_element(self): self.cache.add("test.key", "test.value") self.assertEqual(self.cache.get("test.key"), "test.value...
andrew749/andrew749.github.io
application/caches/test/test_local_cache.py
Python
apache-2.0
367
__author__ = 'kbiscanic' from collections import Counter from scipy.linalg import norm from features.karlo.WWO import calc_ic def _lsa(s): w = Counter(s) return {x: w[x] for x in w} def _lsaic(s): w = Counter(s) return {x: calc_ic(x) * w[x] for x in w} def _cosine_sim(da, db): sol = 0. f...
kbiscanic/apt_project
apt/features/kbiscanic/vector_space_similarity.py
Python
apache-2.0
815
import base64 import logging import platform from datetime import date, timedelta from invoke import run, task from elasticsearch import helpers from dateutil.parser import parse from six.moves.urllib import parse as urllib_parse import scrapi.harvesters # noqa from scrapi import linter from scrapi import registry f...
alexgarciac/scrapi
tasks.py
Python
apache-2.0
6,604
#!/usr/bin/env python import os import sys import confy confy.read_environment_file() if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "incredibus.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
parksandwildlife/observations
manage.py
Python
apache-2.0
297
#!/usr/bin/env python # coding: utf-8 # # Copyright 2010 Alexandre Fiori # based on the original Tornado by Facebook # # 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....
shirk3y/cyclone
demos/helloworld/helloworld.py
Python
apache-2.0
1,114
############################################################################## # Copyright 2016-2018 Rigetti Computing # # 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...
rigetticomputing/pyquil
pyquil/parser.py
Python
apache-2.0
1,511
""" Test basic std::vector functionality but with a declaration from the debug info (the Foo struct) as content. """ from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestDbgInfoContentVector(TestBase): mydir = TestBase.compute_mydir(__file__)...
apple/swift-lldb
packages/Python/lldbsuite/test/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVector.py
Python
apache-2.0
1,822
#!/bin/env python # # Copyright 2013-14 Graham McVicker and Bryce van de Geijn # # 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 re...
PrincetonUniversity/WASP
CHT/update_total_depth.py
Python
apache-2.0
10,603
''' Implements the RTSRoot class. This file is part of RTSLib. Copyright (c) 2011-2013 by Datera, Inc Copyright (c) 2011-2014 by 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 h...
mikenawrocki/rtslib-fb
rtslib/root.py
Python
apache-2.0
10,297
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # Copyright (C) 2011 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following ...
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
Python
apache-2.0
18,696
import os from flask import Flask from flask.ext.mongoengine import MongoEngine from flask.ext.login import LoginManager UPLOAD_FOLDER = '/srv/cars/cars/data/images' if 'TRAVIS' in os.environ: UPLOAD_FOLDER = '{0}/{1}'.format(os.environ['TRAVIS_BUILD_DIR'], 'cars/data/images'...
wiliamsouza/cars
cars/__init__.py
Python
apache-2.0
715
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from __future__ import division import argparse import numpy as np import yaafelib import tarfile import tempfile import os from collections import Counter parser = argparse.ArgumentParser() parser.add_argument('inputs', nargs='+', help='tar archive which contains all the...
eske/seq2seq
scripts/speech/extract.py
Python
apache-2.0
2,752
import json import demjson from datetime import datetime, timedelta class User(object): account_manager = "" date_joined = None email = "" first_name = "" id = None last_login = None last_name = "" paying_single = False paying_team = False resource_uri = "" teammate = False...
appfluence/prioritymatrix-python
pmatrix/user.py
Python
apache-2.0
3,046
#!/usr/bin/env python """ Setup file for pyddq. This file was generated with PyScaffold 2.5.6, a tool that easily puts up a scaffold for your new Python project. Learn more under: http://pyscaffold.readthedocs.org/ """ import sys import os import glob import subprocess from setuptools import setup, Co...
FRosner/drunken-data-quality
python/setup.py
Python
apache-2.0
1,956
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # encoding=UTF8 # 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 ...
sacharya/nova
nova/tests/db/test_db_api.py
Python
apache-2.0
319,684
""" Solution to simple TensorFlow exercises For the problems """ import tensorflow as tf ############################################################################### # 1a: Create two random 0-d tensors x and y of any distribution. # Create a TensorFlow object that returns x + y if x > y, and x - y otherwise. # Hin...
YeEmrick/learning
stanford-tensorflow/2017/assignments/exercises/e01_sol.py
Python
apache-2.0
4,765
# -*- 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-dialogflow
samples/generated_samples/dialogflow_generated_dialogflow_v2_participants_create_participant_async.py
Python
apache-2.0
1,524
#!/usr/bin/env python # # Copyright 2007 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 o...
nuh-temp/rest-app
main.py
Python
apache-2.0
1,441
# 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 ...
Itxaka/libcloud
libcloud/compute/drivers/cloudwatt.py
Python
apache-2.0
5,016
# import matplotlib.pyplot as plt # import numpy as np # from scipy import stats # import sys # # c = list() # b = list() # for line in sys.stdin: # linesp = list(map(float, line.strip().split(","))) # if(linesp[0] < 4): # c.append(linesp[0]) # b.append(linesp[1]) # # carr = np.array(c) # barr ...
marcos-sb/hacker-rank
artificial-intelligence/statistics-and-machine-learning/battery/Solution.py
Python
apache-2.0
639
# Copyright 2015 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 agreed ...
openstack/tripleo-common
tripleo_common/image/exception.py
Python
apache-2.0
991
# # Copyright 2014 Mingyuan Xia (http://mxia.me) and others # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
mcgill-cpslab/MonkeyHelper
examples/DroidReplayer.py
Python
apache-2.0
2,426
# Copyright 2018 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...
alexgorban/models
official/benchmark/keras_benchmark.py
Python
apache-2.0
4,024
import os import subprocess import requests import json import csv from constants import InstallAction, get_migration_directory, ServerType from common import can_edit_install from common import can_install from common import create_or_update_install_job from common import fill_custom_command_profiles from common imp...
smjurcak/csm
csmserver/views/asr9k_64_migrate.py
Python
apache-2.0
33,511
# Copyright (c) 2015, Daniele Venzano # # 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...
DistributedSystemsGroup/zoe-logger
web_logger/config.py
Python
apache-2.0
2,065
import json import logging import boto3 import unittest2 from mock import MagicMock from monocyte.handler import iam as iam_handler class IamInlinePolicyTests(unittest2.TestCase): def setUp(self): self.arn = '' logging.captureWarnings(True) self.iam_handler = iam_handler.InlinePolicy(Magi...
ImmobilienScout24/aws-monocyte
src/integrationtest/python/handler/iam_inline_policy_tests.py
Python
apache-2.0
4,364
import os import shutil import tempfile from typing import Optional from ray import logger from ray.util import PublicAPI from ray.util.ml_utils.cloud import ( download_from_bucket, clear_bucket, upload_to_bucket, is_cloud_target, ) @PublicAPI(stability="beta") class TrialCheckpoint(os.PathLike): ...
ray-project/ray
python/ray/tune/cloud.py
Python
apache-2.0
10,640
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology 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 applicable...
rogerthat-platform/rogerthat-backend
src/rogerthat/models/properties/news.py
Python
apache-2.0
14,083
# Copyright 2020 Tensorforce 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 required by applicable la...
reinforceio/tensorforce
tensorforce/environments/cartpole.py
Python
apache-2.0
8,953
from typing import Dict, List import numpy as np import hybrid_model from evaluation import evaluation_metrics from evaluation import evaluation_parting metrics_rmse = {'rmse': evaluation_metrics.Rmse()} metrics_rmse_prec = {'rmse': evaluation_metrics.Rmse(), 'prec@5': evaluation_metrics.Precis...
sbremer/hybrid_rs
evaluation/evaluation.py
Python
apache-2.0
5,761
import time import threading import sys import aux from aux import * from datetime import datetime, timedelta from sqlalchemy import exc from config import panda_config from pandalogger.PandaLogger import PandaLogger import db_interface as dbif from configurator.models import Schedconfig from taskbuffer.TaskBuffer im...
RRCKI/panda-server
pandaserver/configurator/Configurator.py
Python
apache-2.0
27,940
""" Support for MQTT Template lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.mqtt_template/ """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.components import mqtt from homeassistant.co...
tinloaf/home-assistant
homeassistant/components/light/mqtt/schema_template.py
Python
apache-2.0
16,276
''' This script shows an example of working with the output of the GetJobTasks subcommand. The script takes a single argument, which is the JobID of the job. When calculating the elapsed time for rendering tasks, the script does not account for daylight savings time differences or time zone differences. Elapsed ...
ThinkboxSoftware/Deadline
Examples/DeadlineCommand/JobTaskTimes/GetJobTaskTimes.py
Python
apache-2.0
6,747
# -*- 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_environments_delete_environment_async.py
Python
apache-2.0
1,441
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
mbohlool/client-python
kubernetes/client/models/v1beta1_external_documentation.py
Python
apache-2.0
3,788
## # Copyright (c) 2014-2017 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
macosforge/ccs-calendarserver
txdav/dps/commands.py
Python
apache-2.0
6,689
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack 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/LICEN...
genius1611/Keystone
keystone/contrib/extensions/admin/__init__.py
Python
apache-2.0
1,232
import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('pictures/adapthisteq1.png',0) plt.hist(img.ravel(),256,[0,256]); plt.savefig('adapthistsolutionhistogram.png')
alee156/NeuroCV
Module1/opencv/histeq/histogramaker.py
Python
apache-2.0
199
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
mbohlool/client-python
kubernetes/test/test_v1_role_binding_list.py
Python
apache-2.0
971
def printMap(the_map,note): print(note) for row in the_map: row_str = "" for cell in row: row_str += " {0:3d}".format(cell) print(row_str) def pathFinder(x, y, the_map, steps, lastX, lastY, wall): # count possible moves debug = False options ...
perlygatekeeper/glowing-robot
google_test/bunny_escape/bunnyEscape_fixed.py
Python
artistic-2.0
3,411
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) install_requires = [ 'requests==2.8.1...
technoarch-softwares/facebook-auth
setup.py
Python
bsd-2-clause
1,410
from spec import eq_, ok_ from mock import Mock from invoke import Collection, Config, Context, Executor, Task, call, task from invoke.parser import ParserContext from _util import expect, IntegrationSpec class Executor_(IntegrationSpec): def setup(self): s = super(Executor_, self) s.setup() ...
pfmoore/invoke
tests/executor.py
Python
bsd-2-clause
9,278
"""Manage assets. Usage: ./manage.py assets build Build all known assets; this requires tracking to be enabled: Only assets that have previously been built and tracked are considered "known". ./manage.py assets build --parse-templates Try to find as many of the project's tem...
mcfletch/django-assets
django_assets/management/commands/assets.py
Python
bsd-2-clause
4,988
# Most of this file is from the lower part of Dmitry Dvoinikov's # http://www.targeted.org/python/recipes/typecheck3000.py # reworked into py.test tests import random import re import time from traceback import extract_stack import typecheck as tc import typecheck.framework from .testhelper import expected #########...
prechelt/typecheck-decorator
typecheck/test_typecheck_basics.py
Python
bsd-2-clause
25,312