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
""" Django settings for pythonapi project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ # Parse da...
viktorRock/myFirstPythonAPI
pythonapi/settings.py
Python
unlicense
5,496
# Imports environment-specific settings. import os import sys try: from colorama import init as colorama_init except ImportError: def colorama_init(autoreset=False, convert=None, strip=None, wrap=True): """ Fallback function that initializes colorama. """ pass try: from t...
django-settings/django-settings
myproject/myproject/user_settings.py
Python
unlicense
2,239
import sys sys.path.append('../..') import codestudio z = codestudio.load('s1level108') z.speed = 'faster' def draw_tree(depth,branches): if depth > 0: z.color = z.random_color() z.move_forward(7*depth) z.turn_left(130) for count in range(branches): z.turn_right(180/bran...
skilstak/code-dot-org-python
solutions/stage19-artist5/s1level108.py
Python
unlicense
449
import os import wave import platform import threading from functools import wraps import time import pyaudio CUSTOMCMDS = (), AUTOCMDS = ( 'BufNewFile', 'BufReadPre', 'BufRead', 'BufReadPost', 'BufReadCmd', 'FileReadPre', 'FileReadPost', 'FileReadCmd', 'FilterReadPre', 'FilterReadPost', 'StdinReadPre', ...
timeyyy/orchestra.nvim
rplugin/python3/orchestra/util.py
Python
unlicense
7,671
# -*- coding: utf-8 -*- import os import errno import time import tarfile import shutil import re from utils import * import configuration # a helper class for actual backends class BaseBackend(object): def __init__(self, keep_dirs): self._root_dir = configuration.Configuration.get( 'backen...
wk8/Brive
backend.py
Python
unlicense
8,783
from django.conf.urls.defaults import patterns, include, url from django.utils.functional import curry from django.views.defaults import server_error, page_not_found from tracker.api import MemberResource, ReportResource from tastypie.api import Api v1_api = Api(api_name='v1') v1_api.register(MemberResource()) v1_api....
dwillis/socialcongress
tracker/urls.py
Python
unlicense
1,173
import unittest import utils def _find_max_possible_index(s, count, counts): counts = list(counts) for i in range(len(s) - 1, -1, -1): c = ord(s[i]) if counts[c]: counts[c] = 0 count -= 1 if count == 0: return i # O(n^2) time. O(1) space. ...
chrisxue815/leetcode_python
problems/test_0316_greedy.py
Python
unlicense
1,258
# Define settings that are specific to the local environment. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'database.db', } } INTERNAL_IPS = ('127.0.0.1',) from custom_settings import INSTALLED_APPS INSTALLED_APPS += ( # 'debug_toolbar', )
django-settings/django-settings
myproject/myproject/local_settings.py
Python
unlicense
301
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import logging import io_weixin_auth def test_get_user_token_by_code(): #code = '0010bc8ec77f6972b66ad5cb143ceb4i' code = '041709e7b1cff6ece362b81e8e071a1j' token_info = io_weixin_auth.get_user_token_by_code(code) return token_info def test_...
MingdaMingda/WE060001-NMJKL
TT_io_weixin_auth.py
Python
unlicense
1,327
from django.db import models from django.contrib.auth.models import User from django.db.models import Sum, Q # Create your models here. class Profile(models.Model): avatar = models.ImageField( verbose_name=u'Аватар', blank=True ) description = models.TextField( verbose_name=u'Описа...
MaximKsh/web_1sem
repository/askkashirin/askservice/models.py
Python
unlicense
3,753
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
google-research/google-research
etcmodel/layers/embedding_test.py
Python
apache-2.0
9,033
""" Copyright 2018 vidosits (https://github.com/vidosits/) 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...
delftrobotics/keras-retinanet
tests/models/test_densenet.py
Python
apache-2.0
1,587
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
brianrodri/oppia
core/domain/user_domain.py
Python
apache-2.0
46,090
# Copyright 2009 ITA Software, 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...
marineam/nagcat
python/nagcat/unittests/test_test.py
Python
apache-2.0
1,910
import os, sys, os.path, math, time, random import ast, re valid_id = re.compile(r'[a-zA-Z$_]+[a-zA-Z0-9$_]*') def get_type_name(t): s = str(t).replace("<_ast.", "").replace("<class '_ast.", "").replace("'>", "") if "object at" in s: s = s[:s.find(" ")] s = s.replace("[", "").replace("]", "").strip() s = ...
joeedh/webblender
tools/extjs_cc/py_to_js.py
Python
apache-2.0
11,738
# # Copyright 2017 the original author or 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...
opencord/voltha
voltha/northbound/rpc_dispatcher.py
Python
apache-2.0
803
import os from base import * # NOQA # TEST SETTINGS ALLOWED_HOSTS = ['localhost'] PASSWORD_HASHERS = ( 'django.contrib.auth.hashers.MD5PasswordHasher', ) CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } } SELENIUM_DEFAULT_BROWSER = 'firefox' SELENIUM_TEST_COM...
project-icp/bee-pollinator-app
src/icp/icp/settings/test.py
Python
apache-2.0
724
import urllib.request import re def getHtml(url): page = urllib.request.urlopen(url) html = page.read().decode('utf-8') return html def getImg(html): reg = r'src="(.+?\.jpg)" pic_ext' imgre = re.compile(reg) imglist = re.findall(imgre,html) x = 0 for imgurl in imglist: urllib.r...
Octoberr/swmcdh
cong/zijixieyige.py
Python
apache-2.0
496
import os import sys from glob import glob import dicom # collection root directory: collection_dir = '/usr/local/labcas/backend/staging/CBIS-DDSM/' # dataset directory dataset = sys.argv[1] dataset_dir = '%s/%s' % (collection_dir, dataset) # dataset version directory version_dir = '%s/1' % dataset_dir if not os.pat...
EDRN/labcas-backend
common/src/main/python/gov/nasa/jpl/edrn/labcas/preprocess/dicom_make_dir_structure.py
Python
apache-2.0
1,269
#!/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/stacks/BigInsights/4.0/services/KAFKA/package/scripts/params.py
Python
apache-2.0
5,521
#!/usr/bin/env python3 import json import re import sys def _decode_pattern_list(data): rv = [] contains_dict = False for item in data: if isinstance(item, list): item = _decode_pattern_list(item) elif isinstance(item, dict): item = _decode_pattern_dict(item) ...
rueckstiess/mtools
mtools/util/pattern.py
Python
apache-2.0
7,303
from __future__ import absolute_import from changes.constants import Status, Result from changes.config import db from changes.jobs.update_project_stats import ( update_project_stats, update_project_plan_stats ) from changes.models.project import Project from changes.testutils import TestCase class UpdateProject...
dropbox/changes
tests/changes/jobs/test_update_project_stats.py
Python
apache-2.0
1,357
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators import django.contrib.auth.models class Migration(migrations.Migration): dependencies = [ ('core', '0011_atmosphere_user_manager_update'), ] operations = [ ...
CCI-MOC/GUI-Backend
core/migrations/0012_remove_null_from_many_many.py
Python
apache-2.0
1,573
"""The venstar component.""" import asyncio from requests import RequestException from venstarcolortouch import VenstarColorTouch from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_PIN, CONF_SSL, CONF_USERNAME, ) from homeassistant.exceptions import ConfigEntryNotReady from homeassis...
aronsky/home-assistant
homeassistant/components/venstar/__init__.py
Python
apache-2.0
3,291
from typing import Any # Copyright (c) 2016 Google Inc. (under http://www.apache.org/licenses/LICENSE-2.0) # If not annotate_pep484, info in pyi files is augmented with heuristics to decide if un-annotated # arguments are "Any" or "" (like "self") class B(object): def __init__(self): pass def f(self, ...
google/merge_pyi
testdata/heuristics.comment.py
Python
apache-2.0
631
"""Includes MetadataCollector class. Responsible for keeping track of when widget values change or are selected. """ import ipywidgets as widgets from IPython.display import display import requests class MetadataCollector: """Handle information inside the widgets.""" def __init__(self, topic, ontologies, ...
chapmanbe/pymitools
pymitools/ontologies/metadataCollector.py
Python
apache-2.0
8,067
# vim:tw=50 """"While" Loops Recursion is powerful, but not always convenient or efficient for processing sequences. That's why Python has **loops**. A _loop_ is just what it sounds like: you do something, then you go round and do it again, like a track: you run around, then you run around again. Loops let you do ...
shiblon/pytour
3/tutorials/while_loops.py
Python
apache-2.0
1,756
# -*- coding: utf-8 -*- # Copyright 2015 Ravshello Authors (rsaw@redhat.com; https://github.com/ryran/ravshello) # Copyright 2016 upvm Contributors (see CONTRIBUTORS.md file in source) # License: Apache License 2.0 (see LICENSE file in source) # Modules from standard library from __future__ import print_function from ...
ryran/upvm
modules/string_ops.py
Python
apache-2.0
3,658
""" Cisco_IOS_XR_ncs5500_coherent_portmode_oper This module contains a collection of YANG definitions for Cisco IOS\-XR ncs5500\-coherent\-portmode package operational data. This module contains definitions for the following management objects\: controller\-port\-mode\: Coherent PortMode operational data Copyrig...
111pontes/ydk-py
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ncs5500_coherent_portmode_oper.py
Python
apache-2.0
6,344
# # Copyright 2012 ibiblio # # 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.txt # # Unless required by applicable law or agreed to in writing...
terasaur/seedbank
src/seedbank/cli/add_command.py
Python
apache-2.0
3,950
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google/gae-secure-scaffold-python3
src/securescaffold/factory.py
Python
apache-2.0
3,574
#!/usr/bin/env python2 # coding=utf-8 """ Defines gitver commands """ import re import os import sys from string import Template from termcolors import term, bold from git import get_repo_info from gitver.storage import KVStore from sanity import check_gitignore from defines import CFGDIR, PRJ_ROOT, CFGDIRNAME from ...
manuelbua/gitver
gitver/commands.py
Python
apache-2.0
15,445
#!/usr/bin/env python3 # encoding: utf-8 # Author: MeteorsHub # License: BSD Licence # Contact: JimRanor@outlook.com # Site: http://www.meteorshub.com # File: ssd.py # Time: 2017/4/24 10:17 ''' """Keras implementation of SSD.""" ''' from __future__ import absolute_import from __future__ import division from __f...
MeteorKepler/RICGA
ricga/reference/ssd.py
Python
apache-2.0
11,963
# Copyright (c) 2013 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...
openstack/zaqar
zaqar/tests/unit/transport/wsgi/v1_1/test_messages.py
Python
apache-2.0
25,080
""" Gridsearch implementation """ from hops import hdfs, tensorboard, devices from hops.experiment_impl.util import experiment_utils from hops.experiment import Direction import threading import six import time import os def _run(sc, train_fn, run_id, args_dict, direction=Direction.MAX, local_logdir=False, name="no...
hopshadoop/hops-util-py
hops/experiment_impl/parallel/grid_search.py
Python
apache-2.0
4,463
""" Copyright 2015 Kris Steinhoff, The University of Michigan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
box-community/box-weekly-stats
add_shared_to_group.py
Python
apache-2.0
3,242
# Copyright 2012 Nebula, 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 agree...
openstack/manila-ui
manila_ui/dashboards/project/shares/urls.py
Python
apache-2.0
2,838
import re, sys, time, splunk.Intersplunk import urllib, zlib, base64 import logging, logging.handlers try: import xml.etree.cElementTree as xml except ImportError: import xml.etree.ElementTree as xml def setup_logger(LOGGER_NAME,LOGFILE_NAME): logger = logging.getLogger(LOGGER_NAME) file_handler ...
bcarroll/splunk_samltools
bin/splunksaml.py
Python
apache-2.0
6,313
# # MLDB-1594-aggregator-empty-row.py # mldb.ai inc, 2016 # this file is part of mldb. copyright 2016 mldb.ai inc. all rights reserved. # import unittest from mldb import mldb, MldbUnitTest, ResponseException class Mldb1594(MldbUnitTest): def test_simple(self): res1 = mldb.query("select {}") r...
mldbai/mldb
testing/MLDB-1594-aggregator-empty-row.py
Python
apache-2.0
1,755
"""Testing early attach behavior with LoadBalanced view Test setup: Start the ipcontroller and 1 ipengine, and run this script. The time to finish the 10 apps should be ~10s. In the second run, start the parsl script, and as soon as the run starts, start additional ipengines. The time to finish the 10 apps should st...
swift-lang/swift-e-lab
parsl/tests/integration/test_early_attach_bug.py
Python
apache-2.0
1,099
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, with_statement import os import sys import codecs from setuptools import setup, find_packages # Change to source's directory prior to running any command try: SETUP_DIRNAME = os.path.dirname(__file__) except NameError: # We'...
saltstack/pytest-logging
setup.py
Python
apache-2.0
2,340
# -*- coding: utf-8 -*- # # Juicer documentation build configuration file, created by # sphinx-quickstart on Thu May 21 00:27:23 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
tbielawa/sphinxcontrib-showterm
docsite/source/conf.py
Python
apache-2.0
8,592
# -*- coding: utf-8 -*- # Copyright 2017, 2021 ProjectQ-Framework (www.projectq.ch) # # 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....
ProjectQ-Framework/ProjectQ
projectq/cengines/_main_test.py
Python
apache-2.0
7,119
from fnmatch import fnmatchcase from trac.config import Option from trac.core import * from trac.perm import IPermissionPolicy revision = "$Rev: 11490 $" url = "$URL: https://svn.edgewall.org/repos/trac/tags/trac-1.0.1/sample-plugins/permissions/public_wiki_policy.py $" class PublicWikiPolicy(Component): """Allo...
cghr/cghr-chef-repository
cookbooks/trac/files/default/plugins-stock/public_wiki_policy.py
Python
apache-2.0
2,244
client_id = 'jian-mac'
jianhuashao/WebDownloadJobsManage
post-process/CONFIG.py
Python
apache-2.0
24
import json import pathlib from unittest.mock import patch from freezegun import freeze_time from datahub.ingestion.run.pipeline import Pipeline from datahub.ingestion.source.identity.azure_ad import AzureADConfig from tests.test_helpers import mce_helpers FROZEN_TIME = "2021-08-24 09:00:00" def test_azure_ad_conf...
linkedin/WhereHows
metadata-ingestion/tests/integration/azure_ad/test_azure_ad.py
Python
apache-2.0
7,798
# Copyright 2016 GoDaddy. # # 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, ...
noironetworks/neutron
neutron/tests/unit/extensions/test_network_ip_availability.py
Python
apache-2.0
21,269
#!/usr/bin/python # Copyright (C) 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...
jonpetersen/transitfeed-1.2.12
build/scripts-2.7/unusual_trip_filter.py
Python
apache-2.0
5,999
import pytest from click.testing import CliRunner from cassandra_tools import cli @pytest.fixture def runner(): return CliRunner() def test_cli(runner): result = runner.invoke(cli.main) assert result.exit_code == 0 assert not result.exception assert result.output.strip() == 'Hello, world.' def...
a-rank/cassandra-tools
tests/test_cli.py
Python
apache-2.0
720
""" File for helper function add_suffix() """ def add_suffix(string, suffix): """ Adds a suffix to a string, if the string does not already have that suffix. :param string: the string that should have a suffix added to it :param suffix: the suffix to be added to the string :return: the string wit...
samjabrahams/anchorhub
anchorhub/util/addsuffix.py
Python
apache-2.0
544
def bench_dict_hist(): """ CommandLine: xdoctest -m ~/code/ubelt/dev/bench_dict_hist.py bench_dict_hist Results: Timed best=48.330 µs, mean=49.437 ± 1.0 µs for dict_subset_iter Timed best=59.392 µs, mean=63.395 ± 11.9 µs for dict_subset_list Timed best=47.203 µs, mean=47.632...
Erotemic/ubelt
dev/bench/bench_dict_hist.py
Python
apache-2.0
2,446
from abc import abstractmethod, ABCMeta import numpy as np from lolopy.loloserver import get_java_gateway from lolopy.utils import send_feature_array, send_1D_array from sklearn.base import BaseEstimator, RegressorMixin, ClassifierMixin, is_regressor from sklearn.exceptions import NotFittedError __all__ = ['RandomFor...
CitrineInformatics/lolo
python/lolopy/learners.py
Python
apache-2.0
23,987
#!/usr/bin/env python3 # # Copyright 2019 by Raytheon BBN Technologies Corp. All Rights Reserved. """ Create a test ChannelLibrary. 3 qubits, with a bidirectional edge between q1 and q2. If we're assigning to HW (default not), do something APS2ish spreading across APS1-10. Stores in an in-memory ChannelLibrary. """ d...
BBN-Q/pyqgl2
src/python/pyqgl2/test_cl.py
Python
apache-2.0
7,256
""" Form classes """ from copy import deepcopy from django.utils.datastructures import SortedDict from django.utils.html import escape from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode from django.utils.safestring import mark_safe from fields import Field, FileField from widgets import Me...
jamslevy/gsoc
app/django/forms/forms.py
Python
apache-2.0
17,780
import numpy as np import unittest import os import openmdao.api as om from openmdao.utils.assert_utils import assert_near_equal import pycycle.api as pyc from N3_SPD import N3_SPD_model class N3MDPOptTestCase(unittest.TestCase): def benchmark_case1(self): prob = N3_SPD_model() ...
JustinSGray/pyCycle
example_cycles/N+3ref/benchmark_N3_SPD.py
Python
apache-2.0
6,750
# 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...
tensorflow/tpu
models/hyperparameters/flags_to_params.py
Python
apache-2.0
2,887
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
skuda/client-python
kubernetes/test/test_v1beta1_subject_access_review_status.py
Python
apache-2.0
999
from sevenbridges.meta.resource import Resource from sevenbridges.meta.fields import StringField, DictField class BatchGroup(Resource): """ Batch group for a batch task. Represents the group that is assigned to the child task from the batching criteria that was used when the task was started. """ ...
sbg/sevenbridges-python
sevenbridges/models/compound/tasks/batch_group.py
Python
apache-2.0
454
import booby from booby import fields from booby.inspection import get_fields, is_model from booby.validators import Required from pydoc import locate from collections import OrderedDict from collections import OrderedDict from tabulate import tabulate import readline MODEL_MAP = {} class tabCompleter(object): ...
makkus/pyclist
pyclist/model_helpers.py
Python
apache-2.0
8,972
# -*- coding: utf-8 -*- """ Created on Tue Nov 27 23:40:50 2018 @author: austin """ import requests import re from bs4 import BeautifulSoup,SoupStrainer #import matplotlib.pyplot as plt from fake_useragent import UserAgent import time,random,sys import pandas#pandas大法好 #ua=UserAgent()#使用随机header,模拟人类 #headers1={'Us...
benaustin2000/ShanghaiHousePrice
GetChengJiaoListV0.2.py
Python
apache-2.0
7,661
# -*- coding: utf-8 -*- # Licensed to the StackStorm, Inc ('StackStorm') 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 "Licen...
StackStorm/st2-auth-backend-ldap
setup.py
Python
apache-2.0
2,573
########################################################################### # # 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/l...
google/starthinker
dags/itp_audit_dag.py
Python
apache-2.0
35,487
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google-research/augmix
imagenet.py
Python
apache-2.0
15,187
import subprocess from subprocess import PIPE import sys if len(sys.argv) != 5: print "%s: requires a script name, URL file name arguments, number of instances and number of URLs to distribute" sys.exit(1) script = sys.argv[1] url_file = sys.argv[2] instances = int(sys.argv[3]) num_urls = int(sys.argv[4]) start_...
mpi-sws-rse/datablox
blox/bookmark_client__1_0/bookmarks_ui/distributer.py
Python
apache-2.0
847
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Yahoo Japan Corporation # # 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...
yahoojapan/NGT
python/ngt/base.py
Python
apache-2.0
18,446
from __future__ import annotations from typing import Any from public import public import ibis import ibis.common.exceptions as com from .. import datatypes as dt from .core import Expr @public class ValueExpr(Expr): """ Base class for a data generating expression having a fixed and known type, eithe...
cpcloud/ibis
ibis/expr/types/generic.py
Python
apache-2.0
7,005
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # Copyright 2016-2020 Eotvos Lorand University, Budapest, Hungary import argparse from hlir16.hlir import * from compiler_log_warnings_errors import * import compiler_log_warnings_errors from compiler_load_p4 import load_from_p4 fr...
P4ELTE/t4p4s
src/compiler.py
Python
apache-2.0
22,115
#!/usr/bin/env python # Copyright 2014-2019 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 # # U...
gkc1000/pyscf
pyscf/scf/hf_symm.py
Python
apache-2.0
36,696
import os import datetime from utils.util import run_command __author__ = 'maa' class MsBuilder: def __init__(self, msbuild): if msbuild == None: self.msbuild = r"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe" else: self.msbuild = msbuild def build_with...
amatkivskiy/baidu
baidu/utils/msbuilder.py
Python
apache-2.0
1,654
""" .. See the NOTICE file distributed with this work for additional information regarding copyright ownership. 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....
Multiscale-Genomics/mg-dm-api
tests/test_meta_modification.py
Python
apache-2.0
1,367
import unittest import hashlib from os.path import isfile from os import remove from hashdd.hashddcli import hashddcli from hashdd import hashdd from hashdd.constants import Features, Algorithms class TestHashddCli(unittest.TestCase): TEST_FILENAME='tests/data/sample.exe' TEST_RECURSIVE_DIRECTORY='tests/dat...
hashdd/pyhashdd
tests/test_hashddcli.py
Python
apache-2.0
5,139
""" Error types """ class AlreadyBoundError(Exception): """ Raised if a factory is already bound to a name. """ pass class CyclicGraphError(Exception): """ Raised if a graph has a cycle. """ pass class LockedGraphError(Exception): """ Raised when attempting to create a c...
globality-corp/microcosm
microcosm/errors.py
Python
apache-2.0
595
# Copyright (c) 2016-present, Facebook, 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...
xzturn/caffe2
caffe2/python/rnn/__init__.py
Python
apache-2.0
821
# Copyright 2017-2018 IBM Corp. All Rights Reserved. # See LICENSE for details. # # Author: Henrik Loeser # # Manage workspaces for IBM Watson Assistant service on IBM Cloud. # See the README for documentation. # import json, argparse, importlib from os.path import join, dirname from ibm_watson import AssistantV1 from...
data-henrik/watson-conversation-tool
wctool.py
Python
apache-2.0
13,189
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
hplustree/trove
trove/common/wsgi.py
Python
apache-2.0
23,631
class JWTValidationError(Exception): pass class JWTAudienceError(JWTValidationError): pass
uc-cdis/cdis-python-utils
cdispyutils/auth/errors.py
Python
apache-2.0
101
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'designer/ui_smooth_dialog.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): D...
mdoucet/reflectivity_ui
reflectivity_ui/interfaces/generated/ui_smooth_dialog.py
Python
apache-2.0
13,216
from spoonerist.data import pairs from spoonerist.app import app
scottynomad/spoonerist
spoonerist/__init__.py
Python
apache-2.0
65
# Copyright 2013 eBay Inc. # Copyright 2013 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/LIC...
bswartz/cinder
cinder/tests/unit/api/contrib/test_qos_specs_manage.py
Python
apache-2.0
33,465
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
sjug/perf-tests
verify/boilerplate/boilerplate.py
Python
apache-2.0
4,896
from contextlib import contextmanager import datetime import itertools import requests import mock from mock import call from typing import Any, Dict, List, Optional import base64 import os import ujson import uuid from django.test import override_settings from django.conf import settings from django.http import Http...
tommyip/zulip
zerver/tests/test_push_notifications.py
Python
apache-2.0
82,169
# Copyright (c) 2016 Huawei Technologies Co., Ltd. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
openstack/cinder
cinder/volume/drivers/huawei/huawei_driver.py
Python
apache-2.0
23,610
#!/usr/bin/env python """This is the GRR class registry. A central place responsible for registring plugins. Any class can have plugins if it defines __metaclass__ = MetaclassRegistry. Any derived class from this baseclass will have the member classes as a dict containing class name by key and class as value. """ #...
MiniSEC/GRR_clone
lib/registry.py
Python
apache-2.0
5,555
# -*- 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...
sasha-gitg/python-aiplatform
google/cloud/aiplatform_v1beta1/services/vizier_service/transports/grpc_asyncio.py
Python
apache-2.0
29,300
"""UniFi Network sensor platform tests.""" from datetime import datetime from unittest.mock import patch from aiounifi.controller import MESSAGE_CLIENT, MESSAGE_CLIENT_REMOVED import pytest from homeassistant.components.device_tracker import DOMAIN as TRACKER_DOMAIN from homeassistant.components.sensor import DOMAIN...
jawilson/home-assistant
tests/components/unifi/test_sensor.py
Python
apache-2.0
10,710
from rest_framework import generics from ..serializers import UserSerializer class UserRegistration(generics.CreateAPIView): """ This is basically an API to create a user. This currently provides no email functionality. """ serializer_class = UserSerializer
ComfyLabs/beefeater
users/views/registration.py
Python
apache-2.0
281
# Multiple Linear Regression # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('50_Startups.csv') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, 4].values # One hot encoding from sklearn.preprocessing impor...
balazssimon/ml-playground
udemy/Machine Learning A-Z/Part 2 - Regression/Section 5 - Multiple Linear Regression/backward_elimination_manual.py
Python
apache-2.0
1,681
import math,sys from math import pi def ieee754 (a): rep = 0 #sign bit if (a<0): rep = 1<<31 a = math.fabs(a) if (a >= 1): #exponent exp = int(math.log(a,2)) rep = rep|((exp+127)<<23) #mantissa temp = a / pow(2,exp) - 1 i = 22 while i>=0: temp = temp * 2 if temp > 1: rep = rep | (1...
ankitshah009/High-Radix-Adaptive-CORDIC
Testbench Generation code/Testbench Files/test_sin,sinh.py
Python
apache-2.0
3,601
#--------------------------------------------------------------------------- # Copyright 2014 The Open Source Electronic Health Record Agent # # 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 # ...
shabiel/VistA
Utilities/Dox/PythonScripts/FileManDataToHtml.py
Python
apache-2.0
36,623
# Copyright 2013 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...
ntymtsiv/tempest
tempest/services/identity/v3/json/policy_client.py
Python
apache-2.0
2,378
# copied from OpenCAMLib Google code project, Anders Wallin says it was originally from Julian Todd. License unknown, likely to be GPL # python stl file tools import re import struct import math import sys ########################################################################### def TriangleNormal(x0, y0, z...
JohnyEngine/CNC
heekscnc/STLTools.py
Python
apache-2.0
10,565
## @package split # Module caffe2.python.layers.split from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, schema from caffe2.python.layers.layers import ( ModelLayer, ) class Split(Mod...
bwasti/caffe2
caffe2/python/layers/split.py
Python
apache-2.0
1,613
# -*- coding: utf-8 -*- """The extractor class definitions. An extractor is a class used to extract information from "raw" data. """ import copy import pysigscan from dfvfs.helpers import file_system_searcher from dfvfs.lib import definitions as dfvfs_definitions from dfvfs.lib import errors as dfvfs_errors from df...
Onager/plaso
plaso/engine/extractors.py
Python
apache-2.0
20,405
from .server import (init) from .objects import ( JobDescription, FileSystem, Scheduler, Path, Job, PosixFilePermission, CopyMode, CopyStatus, JobStatus, QueueStatus) from .proto.xenon_pb2 import ( CopyRequest, CertificateCredential, PasswordCredential, KeytabCredential, PropertyDescription, Crede...
NLeSC/pyxenon
xenon/__init__.py
Python
apache-2.0
969
# -*- coding=utf8 -*- """libev接收请求""" import errno import signal import socket import logging import pyev from .const import ( READ_BUFFER_SIZE, ReadState, ) from .thrift import ( TError, Decoder, Encoder, TMessageType, ) logging.basicConfig(level=logging.ERROR) # python的垃圾回收机制可能会把socket都回收掉,...
LiuRoy/dracula
dracula/ev.py
Python
apache-2.0
4,857
# Copyright 2012 Cloudera Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
caseyching/Impala
common/function-registry/impala_functions.py
Python
apache-2.0
54,160
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "omxwebremote.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
blm08/omxWebRemote
manage.py
Python
apache-2.0
255
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apark263/tensorflow
tensorflow/python/autograph/pyct/static_analysis/type_info_test.py
Python
apache-2.0
6,883
# 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...
ntymtsiv/tempest
tempest/api/identity/admin/test_users.py
Python
apache-2.0
9,689
# # Copyright (c) 2015 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
trustedanalytics/data-catalog
data_catalog/app.py
Python
apache-2.0
4,855