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 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleads/google-ads-python
google/ads/googleads/v8/enums/types/frequency_cap_event_type.py
Python
apache-2.0
1,199
import sys import multiprocessing from . import helpers import pybedtools def _parallel_wrap(orig_bedtool, shuffle_kwargs, genome_fn, method, method_args, method_kwargs, sort=False, shuffle=True, reduce_func=None): """ Given a BedTool object `orig_bedtool`, call its `meth...
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/parallel.py
Python
apache-2.0
7,880
from alembic import command, util, package_dir from argparse import ArgumentParser import ConfigParser import inspect import os import sys class Config(object): """Represent an Alembic configuration. Within an ``env.py`` script, this is available via the :attr:`.EnvironmentContext.config` attribute, w...
shadowmint/py-test-watcher
lib/alembic-0.5.0/alembic/config.py
Python
apache-2.0
9,959
# Copyright 2018 The Cirq Developers # # 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 ...
quantumlib/Cirq
dev_tools/prepared_env.py
Python
apache-2.0
5,340
# 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...
openstack/python-glanceclient
glanceclient/common/utils.py
Python
apache-2.0
21,573
# Copyright 2015 CloudByte 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...
bswartz/cinder
cinder/volume/drivers/cloudbyte/cloudbyte.py
Python
apache-2.0
43,674
# Copyright (c) 2014 Navneet Singh. All rights reserved. # Copyright (c) 2014 Clinton Knight. 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:...
openstack/manila
manila/share/drivers/netapp/dataontap/client/api.py
Python
apache-2.0
36,946
# Copyright 2013 Metacloud, Inc. # Copyright 2012 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 ...
UTSA-ICS/keystone-kerberos
keystone/assignment/controllers.py
Python
apache-2.0
33,254
from __future__ import unicode_literals import json try: from urllib import unquote except ImportError: from urllib.parse import unquote from moto.core.utils import amz_crc32, amzn_request_id, path_url from moto.core.responses import BaseResponse from .models import lambda_backends class LambdaResponse(Bas...
william-richard/moto
moto/awslambda/responses.py
Python
apache-2.0
17,730
""" :codeauthor: Jayesh Kariya <jayeshk@saltstack.com> """ import salt.modules.sqlite3 as sqlite3 from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase class MockSqlite3: """ Mock sqlite3 class """ version = "2.6.0" sqlite_version = "3.8.2" def ...
saltstack/salt
tests/unit/modules/test_sqlite3.py
Python
apache-2.0
2,946
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
jamielennox/python-kiteclient
kiteclient/common/resource.py
Python
apache-2.0
1,931
from collections import OrderedDict import unittest from .util import unflatten_dict class UnflattenDictTest(unittest.TestCase): def test_output_type(self): in_ = OrderedDict({"a/b": 1, "c/d": 2, "e": 3}) out = unflatten_dict(in_) assert type(in_) is type(out) def test_one_level_nes...
richardliaw/ray
python/ray/tune/utils/util_test.py
Python
apache-2.0
1,058
from keras.datasets import mnist from keras.utils import to_categorical from keras import layers from keras import models # Define model model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3)...
quanhua92/learning-notes
libs/keras/keras-tutorials/examples/01_convnets.py
Python
apache-2.0
1,252
from logging.config import dictConfig from reports.core import BaseUtility, NEW_ALG_DATE from reports.helpers import ( thresholds_headers, value_currency_normalize, get_arguments_parser, Kind, read_config ) class RefundsUtility(BaseUtility): view = 'report/tenders_owner_date' def __init...
openprocurement/reports
reports/utilities/refunds.py
Python
apache-2.0
3,189
# Copyright (C) 2016-Present Pivotal Software, Inc. All rights reserved. # # This program and the accompanying materials are made available under # the terms of the 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 Li...
Pivotal-Field-Engineering/ephemerol
ephemerol/test/test_YAMLRules.py
Python
apache-2.0
16,390
#!/usr/bin/python # ZALOZENIA CO DO USTAWIN GRY # # - okno gry na fullscreen 1365x767 # - lewy panel max w prawo (najwiekszy) # - prawy panel max w lewo (najwiekszy) # - gorny panel max w dol (najwiekszy) # - dolny panel max w dol (najmniejszy) # - minimapa lewy gorny rog, jeden raz '-' od najwiekszego powiekszenia # ...
miernota/auto_zez_python
au_BIJ_DOOKOLA_noobchar.py
Python
apache-2.0
2,730
from __future__ import unicode_literals from datetime import datetime from datetime import timedelta import warnings import pytz from boto3 import Session from dateutil.parser import parse as dtparse from moto.core import BaseBackend, BaseModel from moto.emr.exceptions import EmrError, InvalidRequestException from .u...
william-richard/moto
moto/emr/models.py
Python
apache-2.0
22,592
# # 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 # ...
rh-s/heat
heat/engine/resources/openstack/neutron/subnet.py
Python
apache-2.0
11,477
# Copyright 2016 Sergey Melnikov # # 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...
RainM/perf-toolkit
phase_disassembler.py
Python
apache-2.0
1,353
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-12 01:35 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0002_auto_20161012_0126'), ] operations = [ migrations.AlterField( ...
baylee-d/cos.io
blog/migrations/0003_auto_20161012_0135.py
Python
apache-2.0
700
# Copyright 2015 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 writi...
steinarvk/rigour
rigour/util.py
Python
apache-2.0
1,573
import json import subprocess g_root_url = '/' def set_root_url(root: str): global g_root_url g_root_url = root HTML_HEAD = '''<html> <head> <style type="text/css"> tr.Record:hover { color: Blue; cursor: pointer; } h2 { color: DodgerBlue; text-align: center; font-family: Trebuchet MS; ...
avitalyahel/autolite
web/server.py
Python
apache-2.0
4,649
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from datetime import datetime import datetime as dt from uuid import UUID from django.contrib.auth import authenticate, login from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.core....
ItsCalebJones/SpaceLaunchNow-Server
web/views.py
Python
apache-2.0
33,480
# Copyright 2013 craigslist # # 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...
craigslist/python-climage
test/test_processor.py
Python
apache-2.0
5,670
import json import uuid import warnings from distutils.version import StrictVersion from typing import Any, Callable, Optional from aiohttp import web from . import AbstractStorage, Session try: import aioredis except ImportError: # pragma: no cover aioredis = None class RedisStorage(AbstractStorage): ...
aio-libs/aiohttp_session
aiohttp_session/redis_storage.py
Python
apache-2.0
3,638
#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, so...
DanCech/graphite-web
webapp/graphite/render/functions.py
Python
apache-2.0
183,034
# -*- coding: utf-8 -*- """ Created on Mon Aug 1 14:21:09 2016 @author: ganong """ import gspread from oauth2client.service_account import ServiceAccountCredentials scope = ['https://spreadsheets.google.com/feeds'] credentials = ServiceAccountCredentials.from_json_keyfile_name('gspread-oauth.json', scope) gc = gspre...
ganong123/HARK
gn/test_google_spreadsheets.py
Python
apache-2.0
3,436
#!/usr/bin/env python # Copyright 2015, 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 ...
marcomaccio/python-docs-samples
bigquery/api/export_data_to_cloud_storage.py
Python
apache-2.0
5,229
# 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/engine/scheduler.py
Python
apache-2.0
5,105
class ForceDefaultLanguageMiddleware(object): """ Ignore Accept-Language HTTP headers This will force the I18N machinery to always choose settings.LANGUAGE_CODE as the default initial language, unless another one is set via sessions or cookies Should be installed *before* any middleware that chec...
huguesmayolle/famille
famille/middlewares.py
Python
apache-2.0
517
import heapq class PriorityQueue: def __init__(self): self._queue = [] self._index = 0 def push(self, item, priority): heapq.heappush(self._queue, (priority, self._index, item)) self._index += 1 def isEmpty(self): if((self._index)>0): return False ...
mrhsce/simPython
PriorityQueue.py
Python
apache-2.0
506
# Copyright 2015 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/LICENSE-2.0 # # Unless required b...
igor-toga/local-snat
neutron/ipam/exceptions.py
Python
apache-2.0
3,063
# Copyright 2018 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,...
CloudVLab/professional-services
examples/dataflow-data-generator/data-generator-pipeline/data_generator_joinable_table.py
Python
apache-2.0
6,406
# -*- coding: ascii -*- u""" :Copyright: Copyright 2017 Andr\xe9 Malo or his licensors, as applicable :License: 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...
ndparker/tdi3
tdi/abstract.py
Python
apache-2.0
925
from unittest import TestCase import pandas as pd from .test_trading_calendar import ExchangeCalendarTestBase from zipline.utils.calendars.exchange_calendar_nyse import NYSEExchangeCalendar class NYSECalendarTestCase(ExchangeCalendarTestBase, TestCase): answer_key_filename = 'nyse' calendar_class = NYSEExch...
magne-max/zipline-ja
tests/calendars/test_nyse_calendar.py
Python
apache-2.0
8,825
import random import string class SessionHelper: def __init__(self, app): self.app = app def login(self, username, password): wd = self.app.wd self.app.open_home_page() wd.find_element_by_name("user").click() wd.find_element_by_name("user").clear() wd.find_elem...
dmitryvorobev/python_training
fixture/session.py
Python
apache-2.0
1,740
#!/usr/bin/python3 -Wall """ removeDuplicates.py: remove duplicate ids from the output of findUnknownIds.py usage: for f in *; do findDuplicateIds.py < f; done | sort -n | ./removeDuplicates.py 20180403 erikt(at)xs4all.nl """ import sys COMMAND = sys.argv[0] KNOWNTAG = "K" UNKNOWNTAG = "U" lastId = "" la...
online-behaviour/find-journalists
removeDuplicates.py
Python
apache-2.0
662
# -*- 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...
gslb/gslb
doc/source/conf.py
Python
apache-2.0
2,452
# # 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...
iemejia/incubator-beam
sdks/python/apache_beam/io/utils.py
Python
apache-2.0
2,415
#!/usr/bin/env python """ 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");...
arenadata/ambari
ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
Python
apache-2.0
6,118
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-11-06 09:53 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('mpm', '0006_banner'), ] operations = [ migra...
gustavofoa/pympm
apps/mpm/migrations/0007_auto_20171106_0753.py
Python
apache-2.0
1,927
from test import get_client_credentials_session, cassette def test_should_page_through_search_results(): session = get_client_credentials_session() with cassette('fixtures/resources/catalog/list_search/page_through_search_results.yaml'): first_page = session.catalog.search('mapreduce').list(page_size...
Mendeley/mendeley-python-sdk
test/resources/catalog/test_list_search.py
Python
apache-2.0
1,212
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-09 00:07 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0002_auto_20170328_2101'), ] operations = [ migrations.AddField( ...
colonelx/benchparty-cms
blog/migrations/0003_post_image.py
Python
apache-2.0
454
"""Handle the frontend for Home Assistant.""" import json import logging import os import pathlib from aiohttp import web, web_urldispatcher, hdrs import voluptuous as vol import jinja2 from yarl import URL import homeassistant.helpers.config_validation as cv from homeassistant.components.http.view import HomeAssista...
aequitas/home-assistant
homeassistant/components/frontend/__init__.py
Python
apache-2.0
14,421
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
mjwtom/swift
swift/common/storage_policy.py
Python
apache-2.0
28,157
from django.db import models from django.conf import settings from django.contrib.auth.models import User # Create your models here. class LatchSetup(models.Model): latch_appid = models.CharField(max_length = 256, null = False, unique = True) latch_secret = models.CharField(max_length = 128, null = False, uni...
rootedcon/django-latch
latch/models.py
Python
apache-2.0
638
''' setup virtual router suite environment, including start zstack node, deploy initial database, setup vlan devices. @author: Frank ''' import os import zstacklib.utils.linux as linux import zstacklib.utils.http as http import zstacktestagent.plugins.host as host_plugin import zstacktestagent.testagent a...
zstackorg/zstack-woodpecker
integrationtest/vm/vpc/suite_setup.py
Python
apache-2.0
4,050
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-04 12:14 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('portfolio', '0004_auto_20170204_1729'), ] operations = [ migrations.RemoveF...
stornado/djwechat
djwechat/portfolio/migrations/0005_auto_20170204_2014.py
Python
apache-2.0
978
# Copyright 2015 Conchylicultor. 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 ...
bluedisk/DeepQA
chatbot/cornelldata.py
Python
apache-2.0
3,814
# 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/backend/numpy/control_flow.py
Python
apache-2.0
9,138
# coding: utf-8 -- from api.lib import bottle from api.lib.bottle import * from api import tipo,asientos,rubro # Si vamos a tener por separado los handlers, aca no deberiamos importar modelos :P # from api.models import * app = bottle.Bottle({'mode': 'development'}) response.content_type = 'application/json' @app.ro...
hermagrini/pochoclo-system
main.py
Python
apache-2.0
479
import inspect import numpy as np # Import Data Assimilation class from pyda.assimilation.assimilation_smoother import DA_smoother # Import Ensemble Generation class from pyda.ensemble_generator.SIRensemble import SIRensemble # Import analysis class from pyda.analysis_generator.kf.enkf1 import ENKF1 class SIR_DA_SM...
hickmank/pyda
examples/SIR_enks.py
Python
apache-2.0
2,011
# # 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...
dhuang/incubator-airflow
airflow/sensors/smart_sensor.py
Python
apache-2.0
30,842
"""Test Yeelight.""" from datetime import timedelta from unittest.mock import AsyncMock, patch from yeelight import BulbException, BulbType from homeassistant.components.yeelight import ( CONF_NIGHTLIGHT_SWITCH, CONF_NIGHTLIGHT_SWITCH_TYPE, DATA_CONFIG_ENTRIES, DATA_DEVICE, DOMAIN, NIGHTLIGHT_...
sander76/home-assistant
tests/components/yeelight/test_init.py
Python
apache-2.0
14,883
#!/usr/bin/env python # -*- coding: utf-8 -*- # # fabfile.py -- distribute Arcus cluster with fabric # import sys import os import site # FIXME Add Arcus's python lib directory to PYTHONPATH ARCUS_PATH = os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + '/..') ARCUS_SITE = os.path.join(ARCUS_PATH, 'lib/p...
ruo91/arcus
scripts/fabfile.py
Python
apache-2.0
18,613
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from dreal import * import unittest import math x = Variable("x") y = Variable("y") z = Variable("z") inf = float("inf") class IntervalTest(unittest.TestCase): def test_construct...
soonho-tri/dreal4
dreal/test/python/util_test.py
Python
apache-2.0
11,081
from django.contrib import admin from browse.models import * from import_export import resources from import_export.admin import ImportExportModelAdmin # Register your models here. #for import_export class geneResource(resources.ModelResource): class Meta: model = gene # class gene admin class geneAdmin(I...
polojacky/ehfpi
ehf/browse/admin.py
Python
apache-2.0
3,502
# -*- coding: windows-1252 -*- # Record Order in BIFF8 # Workbook Globals Substream # BOF Type = workbook globals # Interface Header # MMS # Interface End # WRITEACCESS # CODEPAGE # DSF # TABID # FNGROUPCOUNT # Workbook Protection Block # WINDOWP...
pwltt/MES-PWLTT-ENVI
Pwltt/BDL/pobrane z bdl/xlwt/Workbook.py
Python
apache-2.0
23,151
import base64 import binascii import datetime import struct import time # component lengths in bytes VERSION_LEN = 1 TIMESTAMP_LEN = 8 IV_LEN = 16 CIPHERTEXT_LEN_MOD = 16 # variable length, multiples of 16 bytes HMAC_LEN = 32 # compute the start of each component VERSION_START = 0 TIMESTAMP_START = VERSION_LEN IV_S...
dolph/keyless-fernet
keyless_fernet/core.py
Python
apache-2.0
3,112
""" #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This file is part of the Smart Developer Hub Project: http://www.smartdeveloperhub.org Center for Open Middleware http://www.centeropenmiddleware.com/ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=...
SmartDeveloperHub/sdh-curator
sdh/curator/actions/ext/stream.py
Python
apache-2.0
7,167
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © Daniele Pantaleone 2015, Zdenko Podobný 2017 # Licensed under the terms of the Apache License Version 2.0 # based on: # http://stackoverflow.com/questions/34429632/resize-a-qgraphicsitem-with-the-mouse """ Custom Area Item """ import sys from PyQt5.QtCore ...
zdenop/pyTesseractDemo
libs/areaitem.py
Python
apache-2.0
11,470
#!/usr/bin/env python3 # Copyright 2017 Project Mahjong. 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...
0xsuu/gym-free-DQN
dqns/dqn_queue_memory_interface.py
Python
apache-2.0
2,084
# Copyright 2017-2021 TensorHub, 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 writ...
guildai/guild
guild/commands/runs_tag.py
Python
apache-2.0
3,320
# 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...
spring-week-topos/cinder-week
cinder/api/v2/views/volumes.py
Python
apache-2.0
4,901
import os import shutil import tempfile import requests import traceback from setuptools import archive_util from cloudify.decorators import workflow from cloudify.manager import get_rest_client from cloudify.models_states import BlueprintUploadState from cloudify.exceptions import InvalidBlueprintImport, WorkflowFai...
cloudify-cosmo/cloudify-manager
workflows/cloudify_system_workflows/blueprint.py
Python
apache-2.0
9,830
#!/usr/bin/python3 # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
google/google-ctf
2020/hackceler8/match-pre-package/task2/task2.py
Python
apache-2.0
1,102
# Copyright 2014-2018 The PySCF Developers. 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 appl...
gkc1000/pyscf
pyscf/lib/parameters.py
Python
apache-2.0
2,769
#!/usr/bin/python import MySQLdb import math def betterRelations(major1,major2): cur.execute("SELECT id FROM Departments WHERE name = '"+major1+"'") tup = cur.fetchall(); id1 = str(tup[0][0]) cur.execute("SELECT id FROM Departments WHERE name = '"+major2+"'") tup = cur.fetchall(); ...
luciencd/suggestr
model/testingMajorSimilarity.py
Python
apache-2.0
3,776
# Copyright 2008-2015 Nokia Solutions and Networks # # 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...
fingeronthebutton/RIDE
src/robotide/lib/robot/running/runner.py
Python
apache-2.0
9,548
# Copyright 2021 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
tensorflow/compression
tensorflow_compression/python/layers/initializers_test.py
Python
apache-2.0
1,753
# Copyright 2016 Team - iAS, University Of Peradeniya # # 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...
CodeLankaHack/team---iAS
iAS/core/devicemgt/DeviceDAO.py
Python
apache-2.0
2,653
from django.db import models from django.utils import timezone class Town(models.Model): name = models.CharField(max_length=200, verbose_name="Town") size = models.IntegerField() address = models.CharField( max_length=200, null=True, blank=True, verbose_name="住所") created = models.DateTimeFiel...
Snowman88/DODOTOWN
town/models.py
Python
apache-2.0
3,313
#!/usr/bin/python """ Pass -v=3 to morgoth so it prints verbose logs. Feed the logs into this script and it will create some plots around the histograms the the MGOF algo used to make its decision NOTE: plotting requires matplotlib and numpy """ #Headless config import matplotlib matplotlib.use('Agg') import matplo...
mre/morgoth
debugging/mgof.py
Python
apache-2.0
1,530
#!/usr/bin/env python """This is the setup.py file for the GRR client. This is just a meta-package which pulls in the minimal requirements to create a client. This package needs to stay simple so that it can be installed on windows and ancient versions of linux to build clients. """ from __future__ import absolute_im...
demonchild2112/travis-test
grr/client/setup.py
Python
apache-2.0
3,586
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
tensorflow/model-analysis
tensorflow_model_analysis/extractors/unbatch_extractor.py
Python
apache-2.0
3,963
from os import linesep from stepic.discrete_math.graphs.vertex_with_adjacency_list import Vertex __author__ = 'mlaptev' class Graph(object): def __init__(self, _vs): self._vertexes = dict([(_v, Vertex(_v)) for _v in list(_vs)]) def __len__(self): return len(self._vertexes) @property ...
MikeLaptev/sandbox_python
stepic/discrete_math/graphs/graph_with_adjacency_list.py
Python
apache-2.0
1,751
# # 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...
nudles/incubator-singa
examples/onnx/arcface.py
Python
apache-2.0
3,911
#!/usr/bin/env python3 """ """ import sys, argparse VERSION = "0.0" VERBOSE = False DEBUG = False def main(): args = parse_cmd_line() dprint(args) return 0 def parse_cmd_line(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( '--version', help='Print the ver...
fretboardfreak/code
templates/python3.py
Python
apache-2.0
2,106
from model.contact import Contact import random import time def test_del_some_contact(app, db): if app.contact.count() == 0: app.contact.contact_creation((Contact(firstname = "123", middlename = "123", lastname = ...
0racul/pythonize
test/test_delete_contact.py
Python
apache-2.0
1,526
from jinja2 import Template from moto.core.responses import BaseResponse from moto.ec2.utils import ( dhcp_configuration_from_querystring, sequence_from_querystring) from moto.ec2.models import ec2_backend from moto.ec2.exceptions import( InvalidVPCIdError, InvalidParameterValueError, ) NETBIOS_NODE_TY...
andresriancho/moto
moto/ec2/responses/dhcp_options.py
Python
apache-2.0
5,892
# Copyright 2011 OpenStack, 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...
maoy/zknova
nova/api/openstack/compute/contrib/extended_status.py
Python
apache-2.0
4,009
# # Copyright (c) 2015 Autodesk 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...
a3linux/ochothon
images/portal/resources/toolset/toolset/commands/ping.py
Python
apache-2.0
2,721
import copy import os from pathlib import Path import re import shutil from typing import Optional import yaml import click import dbt.config import dbt.clients.system from dbt import flags from dbt.version import _get_adapter_plugin_names from dbt.adapters.factory import load_plugin, get_include_paths from dbt.cont...
analyst-collective/dbt
core/dbt/task/init.py
Python
apache-2.0
14,079
"""Default settings for plots.""" ################################################################################################### ################################################################################################### ## Define collections of style arguments # Plot style arguments are those that can b...
voytekresearch/neurodsp
neurodsp/plts/settings.py
Python
apache-2.0
1,112
import urllib3 urllib3.disable_warnings() import argparse from elasticsearch import Elasticsearch, TransportError try: from elyzer import stepWise, getAnalyzer, AnalyzerNotFound from envDefault import EnvDefault except ImportError: from .elyzer import stepWise, getAnalyzer, AnalyzerNotFound from .envD...
o19s/elyzer
elyzer/__main__.py
Python
apache-2.0
2,084
# -*- 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_dataset_service_list_data_items_sync.py
Python
apache-2.0
1,529
from django.urls import reverse from django.test import TestCase from example_project.polls.factories import UserFactory from example_project.polls.models import Choice class LoggedInTestCase(TestCase): def setUp(self): super(LoggedInTestCase, self).setUp() UserFactory.create( is_staf...
crccheck/django-object-actions
django_object_actions/tests/tests.py
Python
apache-2.0
3,156
# 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...
huggingface/transformers
tests/bert/test_tokenization_bert.py
Python
apache-2.0
13,962
#!/usr/bin/env python # cardinal_pythonlib/metaclasses.py """ =============================================================================== Original code copyright (C) 2009-2021 Rudolf Cardinal (rudolf@pobox.com). This file is part of cardinal_pythonlib. Licensed under the Apache License, Version 2.0 ...
RudolfCardinal/pythonlib
cardinal_pythonlib/metaclasses.py
Python
apache-2.0
4,808
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Administrator # # Created: 08/10/2011 # Copyright: (c) Administrator 2011 # Licence: <your licence> #--------------------------------------------------------------------...
hemmerling/codingdojo
src/game_of_life/python_coderetreat_socramob/cr_socramob07/zelle.py
Python
apache-2.0
1,520
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008-2014,2016,2019 Contributor # # 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 Li...
quattor/aquilon
lib/aquilon/aqdb/model/disk.py
Python
apache-2.0
6,185
# Copyright (c) 2015 Clinton Knight. 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...
NetApp/manila
manila/share/drivers/netapp/dataontap/cluster_mode/drv_single_svm.py
Python
apache-2.0
7,686
""" Import Tests """ from nose.tools import assert_true def test_import_murphy(): import murphy assert_true(murphy, msg="Failed to import murphy") def test_import_attributehandler(): from murphy import attributehandler assert_true(attributehandler, msg="Failed to import attributehandler") def test...
drsuuzzz/murphy
murphy/tests/test_imports.py
Python
apache-2.0
573
# This file is part of Moksha. # Copyright (C) 2008-2010 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 b...
ralphbean/moksha
moksha/utils/__init__.py
Python
apache-2.0
1,773
#!/usr/bin/env python3 # # Copyright (c) 2014, Scott Silver Labs, 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...
scottsilverlabs/raspberrystem
rstem/led_matrix/__init__.py
Python
apache-2.0
20,970
# # Copyright (c) SAS Institute 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 w...
fedora-conary/rmake-2
rmake/multinode/server/subscriber.py
Python
apache-2.0
2,675
from Utility import logging from numpy import * import random def load_dataset(file_name): data_mat = [] label_mat = [] with open(file_name) as fr: for line in fr.readlines(): line_arr = line.strip().split('\t') data_mat.append([float(line_arr[0]), float(line_arr[1])]) ...
408794550/Mechine-Learning-In-Action
Ch06/SVM.py
Python
apache-2.0
5,901
#!/usr/bin/python import os import pickle GK_SHAPE_TYPE = [ "box", "ellipse", "diamond", "folder", "image" ] class GKNode(object): def __init__(self, name=None, image=None, shape=GK_SHAPE_TYPE[0]): """contain module definition""" self.m_name = name self.m_description...
terranum-ch/GraphLink
graphlink/core/gk_node.py
Python
apache-2.0
2,285
# TestSwiftRangeTypes.py # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/CONT...
apple/swift-lldb
packages/Python/lldbsuite/test/lang/swift/ranges/TestSwiftRangeTypes.py
Python
apache-2.0
1,556
# Copyright 2014 Citrix Systems # # 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...
citrix-openstack-build/neutron-lbaas
neutron_lbaas/tests.skip/unit/services/loadbalancer/drivers/netscaler/test_ncc_client.py
Python
apache-2.0
9,317