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 |
|---|---|---|---|---|---|
import subprocess
from constants import get_migration_directory, JobStatus
from models import ConvertConfigJob
from multi_process import WorkUnit
import os
import re
NOX_64_BINARY = "nox-linux-64.bin"
NOX_64_MAC = "nox-mac64.bin"
class ConvertConfigWorkUnit(WorkUnit):
def __init__(self, job_id):
WorkUni... | csm-aut/csm | csmserver/work_units/convert_config_work_unit.py | Python | apache-2.0 | 3,413 |
from mod_base import *
class CmdPrefix(Command):
"""Check or set the command prefix that the bot will respond to."""
def run(self, win, user, data, caller=None):
args = Args(data)
if args.Empty():
cp = self.bot.config["cmd_prefix"]
win.Send("current command prefix is: " ... | richrd/bx | modules/cmdprefix.py | Python | apache-2.0 | 528 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2017 Snowflake Computing Inc. All right reserved.
#
"""
Concurrent test module
"""
from logging import getLogger
from multiprocessing.pool import ThreadPool
import pytest
from parameters import (CONNECTION_PARAMETERS_ADMIN)
logger = getLogger(__name... | mayfield/snowflake-connector-python | test/test_concurrent_multi_users.py | Python | apache-2.0 | 5,324 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v9/services/services/bidding_strategy_service/transports/grpc.py | Python | apache-2.0 | 12,551 |
__author__ = 'wangxun'
"""def double(list):
i=0
while i <len(list):
print i
list[i]=list[i]*2
i+=1
return(list)
"""
def doulbe(list):
i=0
[list[i]=list[i]*2 while i<len(list)]
return(list)
print double([1,2,3,4]) | wonstonx/wxgittest | day2 test1.py | Python | apache-2.0 | 266 |
'''
Created on 04/11/2015
@author: S41nz
'''
class TBTAFMetadataType(object):
'''
Simple enumeration class that describes the types of metadata that can be discovered within a source code asset
'''
#Verdict enumeration types
#The verdict for a passing test
TEST_CODE="Test Code"
#The v... | S41nz/TBTAF | tbtaf/common/enums/metadata_type.py | Python | apache-2.0 | 379 |
input = """
f(1).
:- f(X).
"""
output = """
f(1).
:- f(X).
"""
| veltri/DLV2 | tests/parser/grounding_only.2.test.py | Python | apache-2.0 | 71 |
# Copyright 2015-2018 Capital One Services, 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 ... | taohungyang/cloud-custodian | tools/c7n_azure/tests/test_networksecuritygroup.py | Python | apache-2.0 | 6,524 |
# Copyright 2021 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 | cirq-rigetti/cirq_rigetti/sampler.py | Python | apache-2.0 | 5,548 |
"""Reverse complement reads with Seqtk."""
import os
from plumbum import TEE
from resolwe.process import (
Cmd,
DataField,
FileField,
FileHtmlField,
ListField,
Process,
StringField,
)
class ReverseComplementSingle(Process):
"""Reverse complement single-end FASTQ reads file using Seqt... | genialis/resolwe-bio | resolwe_bio/processes/support_processors/seqtk_reverse_complement.py | Python | apache-2.0 | 8,764 |
"""TcEx Framework Service Common module"""
# standard library
import json
import threading
import time
import traceback
import uuid
from datetime import datetime
from typing import Callable, Optional, Union
from .mqtt_message_broker import MqttMessageBroker
class CommonService:
"""TcEx Framework Service Common m... | kstilwell/tcex | tcex/services/common_service.py | Python | apache-2.0 | 14,584 |
# Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | obulpathi/poppy | poppy/transport/validators/stoplight/helpers.py | Python | apache-2.0 | 823 |
"""
* Copyright 2007 Fred Sauer
*
* 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... | jaredly/pyjamas | library/pyjamas/dnd/util/CoordinateLocation.py | Python | apache-2.0 | 1,133 |
import torch
from torch import nn, Tensor
from typing import Iterable, Dict
from sentence_transformers import SentenceTransformer
from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM, PreTrainedModel
import logging
logger = logging.getLogger(__name__)
class DenoisingAutoEncoderLoss(nn.Module):
... | UKPLab/sentence-transformers | sentence_transformers/losses/DenoisingAutoEncoderLoss.py | Python | apache-2.0 | 6,700 |
import sys
from typing import Optional
from bowler import Query, LN, Capture, Filename, TOKEN, SYMBOL
from fissix.pytree import Node, Leaf
from lib2to3.fixer_util import Name, KeywordArg, Dot, Comma, Newline, ArgList
def filter_print_string(node, capture, filename) -> bool:
function_name = capture.get("function_... | edx/repo-tools | edx_repo_tools/codemods/django2/foreignkey_on_delete_mod.py | Python | apache-2.0 | 1,718 |
#!/usr/bin/env python
''' Script to ingest GCP billing data into a DB '''
import logging
import os
import re
import sys
from datetime import datetime
from dateutil.relativedelta import relativedelta
from dateutil.parser import parse as parse_date
from httplib2 import Http
import transaction
from apiclient.discover... | blentz/cloud-costs | budget/scripts/gcp_test.py | Python | apache-2.0 | 2,730 |
class Config(object):
SERVER_URL = "BACKEND_SERVER_URL"
CAMERA_NAME = "CAM_NAME"
API_KEY = "API_KEY"
class Backend(object):
URL_PREFIX = "http://"
API_PREFIX = "/api/v1/"
AUTH_URL = "%susers/auth" % API_PREFIX
REGISTER_CAM_URL = "%scam" % API_PREFIX
UPLOAD_URL = "%scam/upload" % API_PR... | SillentTroll/rascam_client | wsgi/common/constants.py | Python | apache-2.0 | 370 |
# -*- coding: utf-8 -*-
#
# Copyright 2014-2020 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | jaor/bigmler | bigmler/processing/ensembles.py | Python | apache-2.0 | 3,944 |
import operator
import pandas as pd
import pandas.util.testing as tm
import pytest
import ibis
from ibis.common import IbisTypeError
def test_array_length(t, df):
expr = t.projection([
t.array_of_float64.length().name('array_of_float64_length'),
t.array_of_int64.length().name('array_of_int64_le... | deepfield/ibis | ibis/pandas/execution/tests/test_arrays.py | Python | apache-2.0 | 6,305 |
# -*- 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_tensorboard_service_update_tensorboard_async.py | Python | apache-2.0 | 1,730 |
# This file is for dev branch
| umitmertcakmak/PySpyder | scrappers/devTest.py | Python | apache-2.0 | 31 |
# Copyright 2016 Cloudbase Solutions Srl
#
# 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... | stackforge/cloudbase-init | cloudbaseinit/constant.py | Python | apache-2.0 | 1,737 |
import web
urls = (
'/wx', 'Handle',
)
class Handle(object):
def GET(self):
return "hello, this is a test"
if __name__ == '__main__':
app = web.application(urls, globals())
app.run() | tanjoc/MyRespository | oauth/weixindemo/__init__.py | Python | apache-2.0 | 210 |
# -*- encoding: utf-8 -*-
from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from functools import wraps
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.core... | frhumanes/consulting | web/src/decorators.py | Python | apache-2.0 | 3,520 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hubblemon.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| naver/hubblemon | manage.py | Python | apache-2.0 | 252 |
# Copyright 2021 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | kubeflow/pipelines | samples/core/condition/condition_test.py | Python | apache-2.0 | 2,438 |
# -*- 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-contact-center-insights | samples/generated_samples/contactcenterinsights_v1_generated_contact_center_insights_update_issue_sync.py | Python | apache-2.0 | 1,517 |
#!/usr/bin/python
# Copyright 2016 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 agre... | googlegenomics/cloudml-examples | trainer/util.py | Python | apache-2.0 | 2,296 |
#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... | dhtech/graphite-web | webapp/graphite/render/functions.py | Python | apache-2.0 | 101,346 |
from pyparsing import (
CaselessLiteral,
Combine,
Literal,
ParseException,
Regex,
Suppress,
Word,
alphanums,
alphas,
)
from great_expectations.exceptions import GreatExpectationsError
try:
import pyspark.sql.functions as F
except ImportError:
F = None
try:
import sqlal... | great-expectations/great_expectations | great_expectations/expectations/row_conditions.py | Python | apache-2.0 | 3,909 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the zip path specification implementation."""
import unittest
from dfvfs.path import zip_path_spec
from tests.path import test_lib
class ZipPathSpecTest(test_lib.PathSpecTestCase):
"""Tests for the zip path specification implementation."""
def testInitial... | manashmndl/dfvfs | tests/path/zip_path_spec.py | Python | apache-2.0 | 1,347 |
def get_injured_sharks():
"""
>>> from ibeis.scripts.getshark import * # NOQA
"""
import requests
url = 'http://www.whaleshark.org/getKeywordImages.jsp'
resp = requests.get(url)
assert resp.status_code == 200
keywords = resp.json()['keywords']
key_list = ut.take_column(keywords, 'in... | SU-ECE-17-7/ibeis | ibeis/scripts/getshark_old.py | Python | apache-2.0 | 22,458 |
"""Test the TcEx Batch Module."""
# third-party
import pytest
# pylint: disable=no-self-use
class TestIndicator3:
"""Test the TcEx Batch Module."""
def setup_class(self):
"""Configure setup before all tests."""
@pytest.mark.parametrize(
'indicator,description,label,tag',
[
... | kstilwell/tcex | tests/batch/test_indicator_interface_3.py | Python | apache-2.0 | 6,925 |
from perfrunner.helpers import local
from perfrunner.helpers.cbmonitor import timeit, with_stats
from perfrunner.helpers.profiler import with_profiles
from perfrunner.helpers.worker import java_dcp_client_task
from perfrunner.tests import PerfTest
class DCPThroughputTest(PerfTest):
def _report_kpi(self, time_ela... | couchbase/perfrunner | perfrunner/tests/dcp.py | Python | apache-2.0 | 4,121 |
from herd.manager.server import HerdManager
manager = HerdManager(address=None, port=8339, ip='127.0.0.1', config=None,
stream_ip='127.0.0.1', stream_port=8338)
manager.start_listener()
| hoangelos/Herd | demo/misc/manager_node1.py | Python | apache-2.0 | 209 |
from __future__ import division
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import os
import string
plt.ioff()
data = np.load("attn_weights.npz")
lines = map(lambda x: x.split('\t'), open("sanitycheck.txt", 'r').readlines())
save_dir = "attn_plots3"
sentences = []
current_... | strubell/Parser | bin/plot_attn.py | Python | apache-2.0 | 3,315 |
# 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... | openstack/smaug | karbor/tests/unit/api/v1/test_quotas.py | Python | apache-2.0 | 4,032 |
from turbo import register
import app
import api
register.register_group_urls('', [
('/', app.HomeHandler),
('/plus', app.IncHandler),
('/minus', app.MinusHandler),
])
register.register_group_urls('/v1', [
('', api.HomeHandler),
])
| wecatch/app-turbo | demos/jinja2-support/apps/app/__init__.py | Python | apache-2.0 | 253 |
"""
thainlp tag command line.
"""
import argparse
from pythainlp import cli
from pythainlp.tag import locations, named_entity, pos_tag
class SubAppBase:
def __init__(self, name, argv):
parser = argparse.ArgumentParser(**cli.make_usage("tag " + name))
parser.add_argument(
"text", type=... | PyThaiNLP/pythainlp | pythainlp/cli/tag.py | Python | apache-2.0 | 2,123 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v9/enums/types/simulation_type.py | Python | apache-2.0 | 1,302 |
#Please read "usefull links" before going on, they are necessary for better understanding
import StringIO
import json #Imports the json library that decodes json tokens recieved from telegram api
import logging #Imports the library that puts messages in the log info of the google app engine
import random #Library that ... | 0Cristofer/telebot | main.py | Python | apache-2.0 | 6,516 |
from flask import Blueprint, render_template, Response, current_app, send_from_directory
from pyox import ServiceError
from pyox.apps.monitor.api import get_cluster_client
from datetime import datetime
cluster_ui = Blueprint('cluster_ui',__name__,template_folder='templates')
@cluster_ui.route('/')
def index():
cl... | alexmilowski/python-hadoop-rest-api | pyox/apps/monitor/views.py | Python | apache-2.0 | 1,129 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a cop... | salamb/girder | tests/base.py | Python | apache-2.0 | 21,800 |
# -*- coding: utf-8 -*-
'''
Module for listing programs that automatically run on startup
(very alpha...not tested on anything but my Win 7x64)
'''
# Import python libs
import os
# Import salt libs
import salt.utils
# Define a function alias in order not to shadow built-in's
__func_alias__ = {
'list_': 'list'
}... | victorywang80/Maintenance | saltstack/src/salt/modules/win_autoruns.py | Python | apache-2.0 | 1,932 |
# Copyright 2010 Jacob Kaplan-Moss
#
# 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 ... | akash1808/python-novaclient | novaclient/v1_1/flavors.py | Python | apache-2.0 | 6,740 |
from flask import Flask
app = Flask(__name__)
@app.get("/")
def index():
return "hello, world"
if __name__ == "__main__":
# Dev only: run "python main.py" and open http://localhost:8080
app.run(host="localhost", port=8080, debug=True)
| GoogleCloudPlatform/buildpack-samples | sample-python/main.py | Python | apache-2.0 | 252 |
import json
import random
from datetime import datetime, timedelta
import hashlib
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render_to_response
from django.template import loader
from django.utils import encoding
from core.grafana.GrafanaES import Grafana
from core.grafana.QueryES... | PanDAWMS/panda-bigmon-core | core/grafana/views.py | Python | apache-2.0 | 19,477 |
# 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/trajectories/trajectory_test.py | Python | apache-2.0 | 14,383 |
class yamMessageHandlerBase(object):
"""
Base class for message handlers for a :class:`ZMQProcess`.
Inheriting classes only need to implement a handler function for each
message type. It must assign the protobuf Message class to self.cls and
create a mapping of message types to handler functions
... | dpquigl/YAM | src/pyyam/yam/handlers/yamMessageHandlerBase.py | Python | apache-2.0 | 1,148 |
"""Base configuration implementation."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2018 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | wackerly/faucet | faucet/conf.py | Python | apache-2.0 | 5,573 |
#!/usr/bin/env python
# import libs
import unittest
import sys
import os
import random
import uuid
# import classes
import analytics.utils.misc as misc
import analytics.exceptions.exceptions as ex
import analytics.service as service
from analytics.datamanager.datamanager import DataManager
class IntegrationTestSeque... | sadikovi/pulsar | analytics/tests/integrationtest_service.py | Python | apache-2.0 | 3,628 |
import requests
class Client(object):
def __init__(self, tornado_server):
self.tornado_server = tornado_server
@property
def base_url(self):
return "http://localhost:{}/api/v1".format(self.tornado_server.port)
def request(self, method, url, **kwargs):
headers = {}
... | dropbox/notouch | tests/api_tests/util.py | Python | apache-2.0 | 1,077 |
from django.conf.urls import patterns, url
urlpatterns = patterns('accounts.views',
url(r'^$', 'home_view', name='home'),
url(r'^login/$', 'login_view', name='login'),
url(r'^logout/$', 'logout_view', name='logout'),
url(r'^register/$', 'register_view', name='register'),
url(r'^password/$', 'password_vi... | goncha/django-accounts | urls.py | Python | apache-2.0 | 449 |
# pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-lines
# noqa: E301,E302,E303,T001
class OpenShiftCLIError(Exception):
'''Exception class for openshiftcli'''
pass
ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')]
def locate_oc_binary():
''' Find and return oc binar... | akubicharm/openshift-ansible | roles/lib_openshift/src/lib/base.py | Python | apache-2.0 | 21,165 |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | dmitryilyin/mistral | mistral/tests/unit/engine/default/test_executor.py | Python | apache-2.0 | 4,084 |
import codecs
from pandas import read_csv
import argparse
import numpy as np
import codecs
import os
FIELD_NAMES = ["context_id","target","target_pos","target_position","gold_sense_ids","predict_sense_ids", "golden_related","predict_related","context"]
FIELD_TYPES = {"context_id":np.dtype(str),"target":np.dtype(str),"... | mpelevina/context-eval | semeval_2013_13/dataset2key.py | Python | apache-2.0 | 2,427 |
from django.test import TestCase
from django.utils.timezone import utc
from datetime import datetime
import json
import logging
import mock
from dbkeeper.models import Organization, Team, Setting
from piservice.models import PiStation, PiEvent
import scoreboard.views as target
def _mocked_utcNow():
return datetime... | brata-hsdc/brata.masterserver | workspace/ms/scoreboard/tests/test_dock.py | Python | apache-2.0 | 49,951 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | GoogleCloudPlatform/mlops-with-vertex-ai | src/common/datasource_utils.py | Python | apache-2.0 | 2,483 |
"""Insteon base entity."""
import functools
import logging
from pyinsteon import devices
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers.entity import DeviceInfo, Entity
from .const import (
... | aronsky/home-assistant | homeassistant/components/insteon/insteon_entity.py | Python | apache-2.0 | 5,749 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sample-weight-meta.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.p... | FederatedAI/FATE | python/federatedml/protobuf/generated/sample_weight_meta_pb2.py | Python | apache-2.0 | 3,206 |
from __future__ import absolute_import
from django.utils.translation import ugettext as _
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth import authenticate
from zerver.decorator import authenticated_json_post_view, has_request_variables, REQ
from zerver... | peiwei/zulip | zerver/views/user_settings.py | Python | apache-2.0 | 9,076 |
# coding=utf-8
from ..base import BitbucketBase
class BitbucketCloudBase(BitbucketBase):
def __init__(self, url, *args, **kwargs):
"""
Init the rest api wrapper
:param url: string: The base url used for the rest api.
:param *args: list: The fixed arguments for the Atlassian... | MattAgile/atlassian-python-api | atlassian/bitbucket/cloud/base.py | Python | apache-2.0 | 2,467 |
from django.core.files import locks
from django.core.urlresolvers import reverse
from django.db.models import Count, F, Q, Min
from django.template import RequestContext, TemplateDoesNotExist
from django.template.loader import get_template, select_template
from django.utils import timezone
from django.views.decorators.... | amplab/ampcrowd | ampcrowd/basecrowd/views.py | Python | apache-2.0 | 33,310 |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
requires = [
'cdo',
'bokeh',
'ocgis',
'pandas',
'nose',
]
classifiers=[
... | sradanov/flyingpigeon | setup.py | Python | apache-2.0 | 1,385 |
# Copyright (c) OpenMMLab. All rights reserved.
import itertools
import numpy as np
import torch
from .general_data import GeneralData
class InstanceData(GeneralData):
"""Data structure for instance-level annnotations or predictions.
Subclass of :class:`GeneralData`. All value in `data_fields`
should h... | open-mmlab/mmdetection | mmdet/core/data_structures/instance_data.py | Python | apache-2.0 | 6,926 |
from ajenti.api import *
from ajenti.plugins import *
info = PluginInfo(
title='Resource Manager',
icon='link',
dependencies=[
],
)
def init():
import server
| lupyuen/RaspberryPiImage | usr/share/pyshared/ajenti/plugins/resources/__init__.py | Python | apache-2.0 | 182 |
#!/usr/bin/python -Werror
#
# Copyright (c) 2015 Midokura SARL, All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | midonet/orizuru | lib/orizuru/operations.py | Python | apache-2.0 | 17,776 |
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | donnadionne/grpc | src/python/grpcio_health_checking/grpc_version.py | Python | apache-2.0 | 710 |
import time
import django
from django import forms
try:
from django.forms.utils import ErrorDict
except ImportError:
from django.forms.util import ErrorDict
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.utils.crypto import salted_hmac, constant_time_c... | sheshkovsky/jaryan | comments/forms.py | Python | apache-2.0 | 9,802 |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the version from version.py
with open('humanname/version.py') as f:
exec(f.read(), globals(), locals())
setup(
name='humanname',
version=__version__,
description='... | djudd/human-name-py | setup.py | Python | apache-2.0 | 2,800 |
"""
Configuration file for database connections
"""
class MySQLConfig:
"""configuration for MySQL"""
username = 'root'
password = 'root'
host = 'localhost'
database = 'ecosystem_mapping'
| BIDS-projects/aggregator | bidsaggregator/utils/config.py | Python | apache-2.0 | 209 |
"""Chessboard: Describe an application once, deploy and manage it anywhere.
Chessboard includes utilities for modeling application topologies and
deploying/managing applications in a provider-agnostic way.
"""
import setuptools
VERSION = '0.1.0'
setuptools.setup(
name='chessboard',
version=VERSION,
mai... | larsbutler/chessboard | setup.py | Python | apache-2.0 | 1,395 |
# Copyright 2011 Tsutomu Uchino
#
# 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... | hanya/MRI | pythonpath/mytools_Mri/ui/tools.py | Python | apache-2.0 | 2,328 |
#
# 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... | MBoustani/climate | ocw/esgf/main.py | Python | apache-2.0 | 3,986 |
from datetime import datetime
from bson import ObjectId
class SettingsService(object):
def __init__(self, db):
self.db = db
self.settings = db.settings_collection
self._id = ObjectId("5bbbaee7bacf833c1203d7b3")
def save(self, item):
item['_id'] = self._id
item['create... | cackharot/fbeazt | src/foodbeazt/service/SettingsService.py | Python | apache-2.0 | 491 |
#
# 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... | wooga/airflow | airflow/ti_deps/deps/trigger_rule_dep.py | Python | apache-2.0 | 10,691 |
# 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... | stackforge/python-openstacksdk | openstack/baremetal_introspection/v1/_proxy.py | Python | apache-2.0 | 7,038 |
##
# Copyright (c) 2009-2015 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... | red-hood/calendarserver | twistedcaldav/test/test_database.py | Python | apache-2.0 | 7,176 |
'''
This module provides some handle-related functions
that are needed across various modules of the
pyhandle library.
'''
from __future__ import absolute_import
import base64
from future.standard_library import install_aliases
install_aliases()
from urllib.parse import quote
from . import handleexceptions
from . impor... | EUDAT-B2SAFE/PYHANDLE | pyhandle/utilhandle.py | Python | apache-2.0 | 5,268 |
import sys
def test(suspect):
for i in range(2, suspect):
if suspect % i is 0:
return False
return True
if len(sys.argv) == 1:
print('please call me like "python prime.py range"')
sys.exit(0)
primes = []
for i in range(int(sys.argv[1])):
if test(i) == True:
primes.append... | tomecho/PrimeSpeedTest | prime.py | Python | apache-2.0 | 343 |
from __future__ import absolute_import, division, print_function, unicode_literals
from amaascore.market_data.eod_price import EODPrice
from amaascore.market_data.fx_rate import FXRate
from amaascore.market_data.curve import Curve
from amaascore.market_data.corporate_action import CorporateAction
def json_to_eod_pri... | amaas-fintech/amaas-core-sdk-python | amaascore/market_data/utils.py | Python | apache-2.0 | 723 |
# 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... | phenoxim/nova | nova/tests/functional/compute/test_instance_list.py | Python | apache-2.0 | 23,474 |
# Copyright 2011 OpenStack Foundation
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Grid Dynamics
# Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... | jumpstarter-io/nova | nova/api/openstack/compute/contrib/floating_ips.py | Python | apache-2.0 | 12,423 |
#/usr/bin/python
"""
Author: David Benson ([email protected])
Date: 02/09/2013
Description: This python module is responsible for storing information about all
systems within the eve universe.
"""
import system
import datetime
import evelink.api
class EveUniverse:
""" This class acts as a storage class for the al... | Funi1234/InternetSpaceships | python/main/eve_universe.py | Python | apache-2.0 | 1,437 |
"""Check that available RPM packages match the required versions."""
from openshift_checks import OpenShiftCheck
from openshift_checks.mixins import NotContainerizedMixin
class PackageVersion(NotContainerizedMixin, OpenShiftCheck):
"""Check that available RPM packages match the required versions."""
name = ... | wbrefvem/openshift-ansible | roles/openshift_health_checker/openshift_checks/package_version.py | Python | apache-2.0 | 3,386 |
from .layout_helpers import *
| armstrong/armstrong.core.arm_layout | tests/templatetags/__init__.py | Python | apache-2.0 | 30 |
# 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... | phenoxim/nova | nova/tests/unit/scheduler/client/test_report.py | Python | apache-2.0 | 143,398 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
import six
import logging
import filecmp
import os
import re
import sys
import uuid
import json
import time
from nose.plug... | zimingd/synapsePythonClient | tests/integration/test_command_line_client.py | Python | apache-2.0 | 36,272 |
import collections
import re
import sys
import time
import traceback
from functools import partial
from multiprocessing import Process, Queue
from unittest import skipIf
from cassandra import ConsistencyLevel
from cassandra.cluster import Cluster
from cassandra.query import SimpleStatement
# TODO add in requirements.t... | thobbs/cassandra-dtest | materialized_views_test.py | Python | apache-2.0 | 61,309 |
# Copyright 2012 VMware, 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 ... | blueboxgroup/neutron | neutron/tests/unit/test_l3_agent.py | Python | apache-2.0 | 100,926 |
# Copyright 2011 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... | salv-orlando/MyRepo | nova/tests/api/openstack/contrib/test_volume_types.py | Python | apache-2.0 | 5,886 |
from typing import Callable, List, Sequence, Tuple
import numpy as np
import pytest
import scipy
import tensorflow as tf
from _pytest.fixtures import SubRequest
import gpflow
import gpflow.inducing_variables.multioutput as mf
import gpflow.kernels.multioutput as mk
from gpflow import set_trainable
from gpflow.base im... | GPflow/GPflow | tests/gpflow/conditionals/test_multioutput.py | Python | apache-2.0 | 31,704 |
from __future__ import unicode_literals
import pygst
pygst.require('0.10')
import gst # noqa
from mopidy.audio import output
import logging
logger = logging.getLogger(__name__)
# This variable is a global that is set by the Backend
# during initialization from the extension properties
encoder = 'identity'
class ... | liamw9534/mopidy-rtp | mopidy_rtp/sink.py | Python | apache-2.0 | 1,944 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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... | probcomp/cgpm | src/crosscat/statedoc.py | Python | apache-2.0 | 8,646 |
import os
import threading
import datetime
import cloudstorage as gcs
from google.appengine.api import app_identity
class FileServer():
def __init__(self):
bucket_name = os.environ.get('BUCKET_NAME',
app_identity.get_default_gcs_bucket_name())
self.bucket = '/' + bucket_name... | benmorss/excalibur | cloudserver.py | Python | apache-2.0 | 563 |
# Copyright (c) 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | olivierlemasle/murano | murano/tests/unit/dsl/foundation/object_model.py | Python | apache-2.0 | 2,019 |
#!/astro/apps/pkg/python/bin/python
import pyfits
import SDSSfits
import numpy
from tools import create_fits
import os
def main(OUT_DIR = "/astro/net/scratch1/vanderplas/SDSS_GAL_RESTFRAME/",
DIR_ROOT = "/astro/net/scratch1/sdssspec/spectro/1d_26/*/1d",
LINES_FILE = "LINES_SHORT.TXT",
... | excelly/xpy-ml | sdss/jake_lib/make_condensed_fits.py | Python | apache-2.0 | 4,199 |
# -*- coding: utf-8 -*-
'''
部分通用的数据结构
container.py :
NetInterface : 描述容器的一个虚拟网卡
-name : 虚拟网卡名称
-hostVeth : 虚拟网卡对应的主机veth名称
-ip : IP地址
-mac : mac地址
-vethMac : 主机veth的mac地址
+ NetInterface::create : 创建一个虚拟网卡,返回NetInterface对象
container : 目标容器
vName : 容器端peer名字
h_vName : 主机端peer的名字
Container : 描述一个... | onlysheep5200/NetnsEx | lib/__init__.py | Python | apache-2.0 | 2,175 |
#
# 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... | eljefe6a/incubator-beam | sdks/python/apache_beam/runners/portability/fn_api_runner_test.py | Python | apache-2.0 | 2,196 |
# Copyright (c) 2016. Mount Sinai School of Medicine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | hammerlab/varcode | varcode/effects/__init__.py | Python | apache-2.0 | 2,401 |