code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# 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 Li... | pypa/warehouse | warehouse/migrations/versions/34b18e18775c_add_last_totp_value_to_user.py | Python | apache-2.0 | 940 |
# Copyright (c) 2017 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
#
# ... | bswartz/manila | manila/policies/base.py | Python | apache-2.0 | 1,172 |
# Copyright 2010 Fluidinfo 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, ... | fluidinfo/Tickery | tickery/www/tickerytab.py | Python | apache-2.0 | 7,178 |
import getpass
import os
from typing import Any
from typing import Dict
from typing import List
from typing import Mapping
from typing import Optional
try:
from vault_tools.client.jsonsecret import get_plaintext
from vault_tools.paasta_secret import get_vault_client
from vault_tools.gpg import TempGpgKeyri... | Yelp/paasta | paasta_tools/secret_providers/vault.py | Python | apache-2.0 | 6,460 |
#!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo 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... | ApolloAuto/apollo | modules/tools/record_play/rtk_recorder.py | Python | apache-2.0 | 7,449 |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hpe.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | openstack/designate | designate/quota/__init__.py | Python | apache-2.0 | 966 |
# 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... | dimtruck/magnum | magnum/tests/unit/db/test_magnum_service.py | Python | apache-2.0 | 4,105 |
from genc.regions import (
Region,
REGIONS,
)
try:
basestring
except NameError: # pragma: no cover
basestring = str
def _build_cache(name):
idx = Region._fields.index(name)
return dict([(reg[idx].upper(), reg) for reg in REGIONS
if reg[idx] is not None])
_alpha2 = _build_c... | hannosch/genc | genc/__init__.py | Python | apache-2.0 | 935 |
#!/usr/bin/env python
# encoding: utf-8
# Copyright 2010 California Institute of Technology. ALL RIGHTS
# RESERVED. U.S. Government Sponsorship acknowledged.
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class DropHandler(BaseHTTPRequestHandler):
def dropRequest(self):
self.send_response(... | EDRN/PublicPortal | support/dropsies.py | Python | apache-2.0 | 703 |
# Code in this file is copied and adapted from
# https://github.com/openai/evolution-strategies-starter.
import gym
import numpy as np
import tree
import ray
import ray.experimental.tf_utils
from ray.rllib.agents.es.es_tf_policy import make_session
from ray.rllib.models import ModelCatalog
from ray.rllib.policy.polic... | richardliaw/ray | rllib/agents/ars/ars_tf_policy.py | Python | apache-2.0 | 4,456 |
__source__ = 'https://leetcode.com/problems/search-in-rotated-sorted-array/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/search-in-rotated-sorted-array.py
# Time: O(logn)
# Space: O(1)
# Binary Search
#
# Description: Leetcode # 33. Search in Rotated Sorted Array
#
# Suppose a sorted array is rotated at ... | JulyKikuAkita/PythonPrac | cs15211/SearchinRotatedSortedArray.py | Python | apache-2.0 | 6,100 |
import logging
import os
import jinja2
import webapp2
from google.appengine.ext.webapp.util import run_wsgi_app
from server.service import Service
jinja_environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(os.path.dirname(__file__))),
variable_start_string='[[',
variable_end_st... | mvkirk/appengine-lumx-skeleton | app/server/main.py | Python | apache-2.0 | 766 |
#
# 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... | witgo/spark | python/pyspark/sql/functions.py | Python | apache-2.0 | 158,844 |
# (c) 2012-2013, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | dlab-berkeley/collaboratool-archive | bsd2/vagrant-ansible/ansible/lib/ansible/playbook/play.py | Python | apache-2.0 | 27,767 |
# Copyright 2016 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 ag... | googleapis/python-spanner | google/cloud/spanner_v1/database.py | Python | apache-2.0 | 45,568 |
#!/usr/bin/env python
"""End to end tests that run ArtifactCollectorFlow."""
from grr.endtoend_tests import base
from grr.lib import aff4
from grr.lib.rdfvalues import client as rdf_client
class TestDarwinPersistenceMechanisms(base.AutomatedTest):
"""Test DarwinPersistenceMechanisms."""
platforms = ["Darwin"]
... | pombredanne/grr | endtoend_tests/artifacts.py | Python | apache-2.0 | 4,156 |
r"""
Cole-Cole
=========
There are various different definitions of a Cole-Cole model, see for instance
Tarasov and Titov (2013). We try a few different ones here, but you can supply
your preferred version.
The original Cole-Cole (1941) model was formulated for the complex dielectric
permittivity. It is reformulated ... | prisae/empymod | examples/time_domain/cole_cole_ip.py | Python | apache-2.0 | 8,028 |
#Copyright 2009 Humanitarian International Services Group
#
#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... | mattmillr/utaka | src/exceptions/BadRequestException.py | Python | apache-2.0 | 11,951 |
import os
from setuptools import setup, find_packages
version = '0.3.2'
install_requires = [
'Markdown < 3',
'beautifulsoup4 < 5',
'inlinestyler==0.2.1',
'pystache < 0.6',
'parse < 2'
]
tests_require = [
'nose',
'flake8==2.5.4',
'coverage',
]
devtools_require = [
'twine',
'bu... | KeepSafe/ks-email-parser | setup.py | Python | apache-2.0 | 1,170 |
# Copyright 2012 SINA Corporation
# Copyright 2014 Cisco Systems, 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/licens... | rackerlabs/marconi | marconi/openstack/common/config/generator.py | Python | apache-2.0 | 10,412 |
"""
Author: Shraey Bhatia
Date: October 2016
File: doc2vectrain.py
Gives a trained document vectors model (also known as Doc2VecModel).
The input format are documents extrated using wiki extractor and tokenized using stanford tokenizer stored in a directory
Output would be a trained doc2ve... | sb1992/NETL-Automatic-Topic-Labelling- | training/doc2vectrain.py | Python | apache-2.0 | 3,504 |
import unittest
from rx import Observable
from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable
from rx.disposables import Disposable, SerialDisposable
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
sub... | dbrattli/RxPY | tests/test_observable/test_forin.py | Python | apache-2.0 | 1,468 |
#!/usr/bin/python2.7
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import time
import unittest
from pycopia import anypath
from pycopia import asyncio
from pycopia import asyncserver
from pycop... | kdart/pycopia | core/test.py | Python | apache-2.0 | 6,033 |
#!/usr/bin/python
import webbrowser
from helper import gitflow
git_flow_func = gitflow.GitFunctions()
print("\nAvailable local release branches: \n")
git_flow_func.show_branch_state("release")
release_version = input("Please enter name of release branch: release-")
release_branch = "release-" + release_version
git_... | stefan0722/gitflowv2 | script/python/r02_finish-release-branch.py | Python | apache-2.0 | 1,179 |
from distutils.core import setup, Extension
setup (name = 'krbV',
version = '1.0.90',
description = 'Kerberos V Bindings for Python',
long_description = """
python-krbV allows python programs to use Kerberos 5 authentication/security
""",
author = 'Test',
author_email = 'mikeb@redhat.com',
classifiers = [... | ivecera/gentoo-overlay | dev-python/python-krbV/files/setup.py | Python | apache-2.0 | 714 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from base import BaseHandler
import os
import sys
sys.path.append('..')
from models.user import User
class ChangeHandler(BaseHandler):
def get(self):
uname = self.get_current_user()
user = User.get_user_by_name(uname)
error=""
if len(... | oujiaqi/suiyue | routes/setting.py | Python | apache-2.0 | 2,131 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Django_study.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| zhangyage/Python-oldboy | day13/Django_study/manage.py | Python | apache-2.0 | 255 |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: david@reciprocitylabs.com
# Maintained By: david@reciprocitylabs.com
import datetime
import factory
import random
from factory.base import BaseFact... | vladan-m/ggrc-core | src/tests/ggrc/behave/factories.py | Python | apache-2.0 | 12,159 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | hlt-mt/tensorflow | tensorflow/models/rnn/fbk_nmt/seq2seq_model.py | Python | apache-2.0 | 13,619 |
class Solution(object):
def increasingTriplet(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
first, second = None, None
for n in nums:
if first is None or n <= first:
first = n
elif second is None or n <= second:
... | ckclark/leetcode | py/increasing-triplet-subsequence.py | Python | apache-2.0 | 409 |
"""Graph debug results dumping class."""
import os
import json
import tvm
GRAPH_DUMP_FILE_NAME = '_tvmdbg_graph_dump.json'
class DebugResult(object):
"""Graph debug data module.
Data dump module manage all the debug data formatting.
Output data and input graphs are formatted and dumped to file.
Front... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/python/tvm/contrib/debugger/debug_result.py | Python | apache-2.0 | 6,677 |
#!/usr/bin/env python3
# Copyright 2019 The Kapitan Authors
# SPDX-FileCopyrightText: 2020 The Kapitan Authors <kapitan-admins@googlegroups.com>
#
# SPDX-License-Identifier: Apache-2.0
"Project description variables"
PROJECT_NAME = "kapitan"
VERSION = '0.29.4'
DESCRIPTION = "Generic templated configuration managemen... | ademariag/kapitan | kapitan/version.py | Python | apache-2.0 | 504 |
import networkx as nx
class Roadmap(nx.Graph):
def __init__(self, gd, max_dist, *args, **kwargs):
self.gd = gd
self.max_dist = max_dist
nx.Graph.__init__(self, *args, **kwargs)
def insert(self, sample):
self.gd.insert(sample)
for smpl in self.gd.get_nearest(sample):
... | wallarelvo/racer | racer/roadmap.py | Python | apache-2.0 | 539 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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... | ntt-sic/heat | heat/engine/update.py | Python | apache-2.0 | 7,456 |
from django.test import TestCase
# Create your tests here.
from passlib.hash import sha512_crypt
from .models import *
class UserTestCase(TestCase):
def test_password_gets_hashed(self):
user = User()
user.name = "valid@email.address"
password = "un-crypted password"
user.password... | 0xdc/pdje | pdje/tests.py | Python | apache-2.0 | 791 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2015 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... | opadron/girder | plugins/user_quota/server/quota.py | Python | apache-2.0 | 18,128 |
# 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... | nathanbjenx/cairis | cairis/gui/OMPanel.py | Python | apache-2.0 | 3,444 |
import sys
from chopImagesToImageTiles import WriteDescription
duration = GetMovieDuration(sys.argv[1])
print "Duration:", duration
| rpwagner/tiled-display | flTile/scripts/testWriteDescription.py | Python | apache-2.0 | 133 |
# Copyright 2014 Netflix, 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... | odin1314/sketchy | sketchy/controllers/tasks.py | Python | apache-2.0 | 16,270 |
import sqlite3
import shutil
import win32crypt
import sys, os, platform
class Chrome():
def __init__(self):
pass
def run(self):
database_path = ''
if 'HOMEDRIVE' in os.environ and 'HOMEPATH' in os.environ:
# For Win7
path_Win7 = os.environ.get('HOMEDRIVE') + o... | mehulj94/Radium-Keylogger | Recoveries/chrome.py | Python | apache-2.0 | 2,142 |
import sqlite3
import csv
def csv_to_arr(csv_file, start=1, has_header=True):
arr = []
with open(csv_file, 'rU') as f:
reader = csv.reader(f)
arr = list(reader)
if arr == []:
return
header = ""
if has_header:
header = ','.join(arr[0])
arr = arr[start:]
return header, arr
else:
return arr[start:... | frederick623/HTI | omm/merge_csv.py | Python | apache-2.0 | 3,078 |
#!/usr/bin/env python
"""
fastq_split.py [-n|--num_files N_FILES] <input filename> <output directory>
"""
import os
import sys
import math
from srt.fastq import *
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-n", "--num_files", dest="num_files",
help="Number of output files", type... | PapenfussLab/Srtools | bin/fastq_split.py | Python | artistic-2.0 | 1,113 |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 22 09:33:57 2010
@author: -
"""
import os
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
from PyQt4 import QtCore, QtGui
from ilastik.modules.classification.core.batchProcess import BatchOptions, BatchProcessCore
from ilastik.gui.i... | ilastik/ilastik-0.5 | ilastik/modules/classification/gui/batchProcessDlg.py | Python | bsd-2-clause | 6,255 |
from django.contrib import admin
from note.models import Note, MyUser
# Register your models here.
admin.site.register(Note)
admin.site.register(MyUser)
| LeMeteore/boomer2 | note/admin.py | Python | bsd-2-clause | 153 |
# -*- coding: utf-8 -*-
import re
from django.utils.translation import ugettext_lazy as _
from .router import Patterns
HTTP_STATUS_CODES = (
# Infomational
(100, _('Continue')),
(101, _('Switching Protocols')),
(102, _('Processing (WebDAV)')),
# Success
(200, _('OK')),
(201, _('Created')... | kylef/django-request | request/utils.py | Python | bsd-2-clause | 5,183 |
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.template import RequestContext, loader
from django.shortcuts import render, get_object_or_404
from django.core.urlresolvers import reverse
from .models import Question, Choice
def index(request):
latest_question_list = Question.object... | yxs1112003/Django-read-python | polls/views.py | Python | bsd-2-clause | 1,707 |
# -*- coding: utf-8 -*-
import logging
import os
import sys
import requests
from imp import find_module, load_module, acquire_lock, release_lock
from tempfile import mkstemp
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from wechat_... | doraemonext/wechat-platform | wechat_platform/system/plugin/framework.py | Python | bsd-2-clause | 26,824 |
from socket import gethostname
from django.utils.translation import ugettext as _
from mezzanine.conf import register_setting
####################################################################
# This first set of settings already exists in Mezzanine but can #
# be overridden or appended to here with Cartridge... | readevalprint/cartridge | cartridge/shop/defaults.py | Python | bsd-2-clause | 8,233 |
"""
Django settings for figexample project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | cosmoz/figtest_django | figexample/settings.py | Python | bsd-2-clause | 2,142 |
"""projectash URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | Ashaba/jash | projectash/urls.py | Python | bsd-2-clause | 1,803 |
# TODO:
# - Figure out when to use previous runs' information
# - merge this module's parse_clustermerging and
# newick.parse_clustermerging
from StringIO import StringIO
from os import remove
import shutil
import os.path as op
import subprocess as sp
import sys
import numpy as np
CM_FILE = 'ClusterMerging.txt'
c... | runiq/modeling-clustering | find-correct-cluster-number/clustering_run.py | Python | bsd-2-clause | 6,261 |
import angr
import claripy
import logging
l = logging.getLogger('angr.procedures.win32.dynamic_loading')
class LoadLibraryA(angr.SimProcedure):
def run(self, lib_ptr):
lib = self.state.mem[lib_ptr].string.concrete
return self.load(lib)
def load(self, lib):
if '.' not in lib:
... | chubbymaggie/angr | angr/procedures/win32/dynamic_loading.py | Python | bsd-2-clause | 3,321 |
import sys, argparse, os, re
import subprocess
from datetime import datetime
import somaticseq.utilities.dockered_pipelines.container_option as container
from somaticseq._version import __version__ as VERSION
ts = re.sub(r'[:-]', '.', datetime.now().isoformat() )
DEFAULT_PARAMS = {'vardict_image' : 'lethal... | bioinform/somaticseq | somaticseq/utilities/dockered_pipelines/somatic_mutations/VarDict.py | Python | bsd-2-clause | 11,186 |
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.db.models import AutoField
from django.forms import ValidationError, ModelForm
from django.http import HttpResponseRedirect
from django.shortcuts import redirect
from django.utils.transl... | dekomote/mezzanine-modeltranslation-backport | mezzanine/core/admin.py | Python | bsd-2-clause | 10,434 |
from __future__ import print_function, division, absolute_import
from abc import ABCMeta, abstractmethod, abstractproperty
import itertools
import weakref
import numpy as np
from ..six import add_metaclass
from ..utils import cached_property
# Types are added to a global registry (_typecache) in order to assign
# ... | stefanseefeld/numba | numba/types/abstract.py | Python | bsd-2-clause | 9,786 |
#!/usr/bin/python
import sys, commands, struct, operator, subprocess, os
if len(sys.argv) != 3:
print 'usage:',sys.argv[0],'<program> <core>'
sys.exit(1)
prog, core = sys.argv[1:]
# finds out the size of void*/size_t. could be hardcoded for speed...
try:
cell = int(commands.getoutput('gdb '+prog+r''' -ex 'prin... | yosefk/heapprof | heapprof.py | Python | bsd-2-clause | 3,588 |
import re
import logging
from indra.resources import load_resource_json
logger = logging.getLogger(__name__)
identifiers_url = 'https://identifiers.org'
# These are just special cases of name spaces where the mapping from INDRA to
# identifiers.org is not a question of simplecapitalization.
identifiers_mappings = ... | johnbachman/indra | indra/databases/identifiers.py | Python | bsd-2-clause | 11,854 |
import dev, random, time
class reed(dev.dev):
def __init__(self, sendto, name):
self.sendto = sendto
self.name = name
def _loop(self):
open = 1 if random.uniform(0, 100) > 95 else 0
self.send(self.sendto, open)
time.sleep(2)
def main(argv):
src = int... | sergey-raevskiy/dcs | src/smart/reed.py | Python | bsd-2-clause | 450 |
import sys
import types
import skytools
from cc.job import CCJob
from cc.daemon.plugins import CCDaemonPlugin
#
# Base class for daemons
#
class CCDaemon (CCJob):
log = skytools.getLogger ('d:CCDaemon')
def find_plugins (self, mod_name, probe_func = None):
""" plugin lookup helper """
p = [... | markokr/cc | cc/daemon/__init__.py | Python | bsd-2-clause | 1,635 |
"""Unit test for LinUCB
"""
from striatum.storage import (
MemoryHistoryStorage,
MemoryModelStorage,
MemoryActionStorage,
Action,
Recommendation,
)
class BaseBanditTest(object):
# pylint: disable=protected-access
def setUp(self): # pylint: disable=invalid-name
self.model_storage ... | ntucllab/striatum | striatum/bandit/tests/base_bandit_test.py | Python | bsd-2-clause | 7,923 |
#!/usr/bin/env python
# Python Network Interface Library
#
# Author: Yandy Ramirez
# Twitter: @IPyandy (https://twitter.com/IPyandy)
# Site: http://ipyandy.net
# Code Verion: 0.0.1
#
# ----------------------------------------------------------------
'''
Library to make A... | IPyandy/pnil | eapi.py | Python | bsd-3-clause | 12,608 |
##
##
# File auto-generated against equivalent DynamicSerialize Java class. Then modified to add functionality
#
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# ??/??/?? xxxxx... | mjames-upc/python-awips | dynamicserialize/dstypes/com/raytheon/uf/common/time/TimeRange.py | Python | bsd-3-clause | 5,059 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.AutoField(verbo... | ormnv/os_final_project | osfinalproject/migrations/0001_initial.py | Python | bsd-3-clause | 1,936 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class PathologicalMobileSitesPage(page_module.Page):
... | sgraham/nope | tools/perf/page_sets/pathological_mobile_sites.py | Python | bsd-3-clause | 1,806 |
from pax import plugin
import numpy as np
class DeleteLowLevelInfo(plugin.TransformPlugin):
"""This deletes low-level info from the datastructure, to make the output file smaller.
By default, this is what gets removed:
* hits for all but the main s1
* pulses for all but the main s1
* sum wav... | XENON1T/pax | pax/plugins/DeleteLowLevelInfo.py | Python | bsd-3-clause | 2,081 |
#!/usr/bin/env python
"""
Example usage of 'print_container', a tool to print
any layout in a non-interactive way.
"""
from prompt_toolkit.shortcuts import print_container
from prompt_toolkit.widgets import Frame, TextArea
print_container(
Frame(
TextArea(text="Hello world!\n"),
title="Stage: parse... | jonathanslenders/python-prompt-toolkit | examples/print-text/print-frame.py | Python | bsd-3-clause | 331 |
import flask_whooshalchemy as whooshalchemy
from models import HrApplication, HrApplicationComment
def register_search_models(app):
pass
# whooshalchemy.whoosh_index(app, HrApplication)
| tyler274/Recruitment-App | recruit_app/recruit/search.py | Python | bsd-3-clause | 196 |
# proxy module
from __future__ import absolute_import
from mayavi.filters.collection import *
| enthought/etsproxy | enthought/mayavi/filters/collection.py | Python | bsd-3-clause | 94 |
import re
from django.template.defaultfilters import slugify
from django.conf import settings
def check_internal_spam_words(content):
return any(word.lower() in (content.lower()) for word in settings.SPAM_WORDS)
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
... | alexisbellido/django-vodkamartini-article | vodkamartiniarticle/helper.py | Python | bsd-3-clause | 3,113 |
import datetime
import pytest
from fixtures import COLLECTION_OPEN, COLLECTIONS_A
@pytest.mark.parametrize("with_messages", [True, False])
def test_delete_content_blocks(app, with_messages):
app.taxii_server.servers.taxii1.persistence.create_collection(COLLECTIONS_A[0])
app.taxii_server.servers.taxii1.persi... | EclecticIQ/OpenTAXII | tests/test_delete_content_blocks.py | Python | bsd-3-clause | 483 |
# coding=UTF-8
"""
SMS Plus GSM MultiInfo gateway
"""
from __future__ import division
from hashlib import sha1
import unicodedata, httplib, urllib, urlparse, json, BaseHTTPServer, time
from satella.threads import BaseThread
from cyrkus.redaction.plugins.httpifc.format import fformat
class HttpServerThread(BaseThread):... | piotrmaslanka/cyrkus | redaction/plugins/httpifc/__init__.py | Python | bsd-3-clause | 2,636 |
#!C:\Users\DMoran\Downloads\WinPython-64bit-2.7.13.1Zero\python-2.7.13.amd64\python.exe
#
# The Python Imaging Library.
# $Id$
#
# convert image files
#
# History:
# 0.1 96-04-20 fl Created
# 0.2 96-10-04 fl Use draft mode when converting images
# 0.3 96-12-30 fl Optimize output (PNG, JPEG)
# 0.4 97... | tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Scripts/pilconvert.py | Python | bsd-3-clause | 2,427 |
"""Forest of trees-based ensemble methods
Those methods include random forests and extremely randomized trees.
The module structure is the following:
- The ``BaseForest`` base class implements a common ``fit`` method for all
the estimators in the module. The ``fit`` method of the base ``Forest``
class calls the ... | clemkoa/scikit-learn | sklearn/ensemble/forest.py | Python | bsd-3-clause | 78,779 |
from django.urls import path
from .views import ProcessView
urlpatterns = [
path('', ProcessView.as_view(), name='process'),
]
| richardcornish/richardcornish | richardcornish/process/urls.py | Python | bsd-3-clause | 134 |
from setuptools import setup, find_packages
setup(name='FTPRelayer',
version='0.2.1',
description="Redistributes files which arrive at a machine to several machines",
long_description="""\
""",
classifiers=[],
keywords='',
author='Meteogrid',
author_email='alberto@meteogrid.com',
... | meteogrid/FTPRelayer | setup.py | Python | bsd-3-clause | 813 |
from blaze.data.dynd import *
from dynd import nd
from unittest import TestCase
class TestDyND(TestCase):
data = [[1, 1], [2, 2]]
def setUp(self):
arr = nd.array(self.data, dtype='2 * 2 * int32')
self.dd = DyND(arr)
def test_dshape(self):
assert str(self.dd.dshape) == '2 * 2 * i... | aterrel/blaze | blaze/data/tests/test_dynd.py | Python | bsd-3-clause | 854 |
#Copyright (c) 2012, Carnegie Mellon University.
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions
#are met:
#1. Redistributions of source code must retain the above copyright
# notice, this list of condition... | mrcaps/rainmon | code/ui/rain/tasks.py | Python | bsd-3-clause | 5,117 |
# -*- coding: utf-8 -*-
from flask import (Flask, request, session, render_template, url_for, redirect,
jsonify)
app = Flask(__name__)
app.debug = True
app.secret_key = 'dummy secret key'
from flaskext.mitten import Mitten
mitten = Mitten(app) # apply Mitten
@app.route('/')
def in... | lanius/flask-mitten | example/app.py | Python | bsd-3-clause | 1,645 |
from midx.notify.common import iter_modified_files
| mikeboers/midx | midx/notify/__init__.py | Python | bsd-3-clause | 51 |
# -*- coding: utf-8 -*-
'''
This module implements :class:`AnalogSignalArray`, an array of analog signals.
:class:`AnalogSignalArray` derives from :class:`BaseAnalogSignal`, from
:module:`neo.core.analogsignal`.
:class:`BaseAnalogSignal` inherits from :class:`quantites.Quantity`, which
inherits from :class:`numpy.arr... | npyoung/python-neo | neo/core/analogsignalarray.py | Python | bsd-3-clause | 11,882 |
import os
from datetime import date
TODAY_DATE = date.today().strftime("%D")
LANDMAPPER_DIR = os.path.dirname(os.path.abspath(__file__))
###########################################
## Keys ###
###########################################
MAPBOX_TOKEN = 'set_in_landmapper_local_settings... | Ecotrust/forestplanner | lot/landmapper/settings.py | Python | bsd-3-clause | 33,100 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import connected_accounts.fields
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('connected_accounts', '0001_initial'),
('cms', '0001_initial'),
]
... | mishbahr/djangocms-twitter2 | djangocms_twitter/migrations/0001_initial.py | Python | bsd-3-clause | 2,646 |
import sys
sys.path.append('../..')
import web
from web.contrib.template import render_jinja
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from social.utils import setting_name
from social.apps.webpy_app.utils import psa, backends
from social.apps.webpy_app import app ... | fearlessspider/python-social-auth | examples/webpy_example/app.py | Python | bsd-3-clause | 3,421 |
import itertools
import numpy as np
from scipy import ndimage as ndi
# adapted from github.com/janelia-flyem/gala
def smallest_int_dtype(number, *, signed=False, min_dtype=np.int8):
"""Return the smallest numpy integer dtype that can represent `number`.
Parameters
----------
number : int
The ... | jni/skan | src/skan/nputil.py | Python | bsd-3-clause | 10,475 |
from time import sleep
from django.conf import settings
from couchdbkit import ResourceConflict
from couchdbkit.client import Database
from memoized import memoized
from requests.models import Response
from requests.exceptions import RequestException
from dimagi.ext.couchdbkit import Document
from dimagi.utils.chunk... | dimagi/commcare-hq | corehq/ex-submodules/dimagi/utils/couch/database.py | Python | bsd-3-clause | 6,069 |
# Authors: Eric Larson <larson.eric.d@gmail.com>
# Sheraz Khan <sheraz@khansheraz.com>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from ..filter import next_fast_len
from ..source_estimate import _BaseSourceEstimate
from ..utils import verbose, _check_c... | Eric89GXL/mne-python | mne/connectivity/envelope.py | Python | bsd-3-clause | 6,631 |
#!/usr/bin/env python
from os.path import exists
from setuptools import setup
import eqpy
setup(
name='eqpy',
version=eqpy.__version__,
description='Solve systems of equations and assumptions, linear and '
'non-linear, numerically and symbolically.',
url='http://github.com/eriknw/eqpy/... | eriknw/eqpy | setup.py | Python | bsd-3-clause | 1,281 |
# -*- coding: utf-8 -*-
from django.views.generic import View
from django.views.decorators.csrf import csrf_exempt
try:
from django.http import StreamingHttpResponse as HttpResponse
except ImportError:
from django.http import HttpResponse
from django.utils.decorators import method_decorator
from sse import S... | raspberrywhite/django-sse | django_sse/views.py | Python | bsd-3-clause | 1,543 |
from datetime import date, datetime, timedelta
from distutils.version import LooseVersion
import numpy as np
import pytest
from pandas._libs.tslibs import (
NaT, OutOfBoundsDatetime, Timestamp, conversion, timezones)
from pandas._libs.tslibs.frequencies import (
INVALID_FREQ_ERR_MSG, get_freq_code, get_freq_s... | cbertinato/pandas | pandas/tests/tseries/offsets/test_offsets.py | Python | bsd-3-clause | 131,811 |
"""Defines unit tests for :mod:`colour.io.uprtek_sekonic` module."""
from __future__ import annotations
import json
import numpy as np
import os
import unittest
from colour.colorimetry import SpectralDistribution
from colour.hints import Any, Dict, Optional
from colour.io import (
SpectralDistribution_UPRTek,
... | colour-science/colour | colour/io/tests/test_uprtek_sekonic.py | Python | bsd-3-clause | 33,878 |
"""Parse C output file from Autolev code dynamics().
Prints the following to stdout:
Parameters with default values
States variables listed with default initial conditions
Section to evaluate constants
Section to evaluate right hand side of state derivatives
Section to evaluate output quantit... | hazelnusse/alparse | alparse.py | Python | bsd-3-clause | 11,017 |
# proxy module
from __future__ import absolute_import
from envisage.resource.resource_manager import *
| enthought/etsproxy | enthought/envisage/resource/resource_manager.py | Python | bsd-3-clause | 103 |
"""
Tests related to deprecation warnings. Also a convenient place
to document how deprecations should eventually be turned into errors.
"""
from __future__ import division, absolute_import, print_function
import datetime
import sys
import operator
import warnings
import numpy as np
from numpy.testing import (
r... | bringingheavendown/numpy | numpy/core/tests/test_deprecations.py | Python | bsd-3-clause | 17,790 |
"""
The parser:
1. gets and expression
2. parses it
3. handles all boolean logic
4. delegates operator and rvalue parsing to the OperatorMap
SchemaFreeOperatorMap
supports all mongo operators for all fields.
SchemaAwareOperatorMap
1. verifies fields exist.
2. verifies operators are applied to fields of correc... | alonho/pql | pql/matching.py | Python | bsd-3-clause | 14,159 |
# -*- coding: utf-8 -*-
# The IRC nickname and password to connect and identify with
NICKNAME = 'momobot_test'
PASSWORD = ''
# The IRC server and port to connect to
SERVER = 'irc.rizon.net'
PORT = 6667
# The channel to join
CHANNEL = '#momotest'
# A list of command indicators
COMMAND_INDICATORS = ['!', '.', 'momo, ... | adamgreig/momobot | settings.py | Python | bsd-3-clause | 508 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__ = """
███╗ ███╗███████╗███████╗ ██████╗
████╗ ████║██╔════╝██╔════╝██╔════╝
██╔████╔██║█████╗ ███████╗██║
██║╚██╔╝██║██╔══╝ ╚════██║██║
██║ ╚═╝ ██║███████╗███████║╚██████╗
╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝
MESC: Minimun Essential Security Checks
Author... | 1modm/mesc | include/serverinfo/tcpip.py | Python | bsd-3-clause | 7,349 |
from flask import Blueprint, flash, redirect, render_template, request, url_for,send_from_directory, abort, make_response, send_file, session
from octs.user.models import Course,Task, User, Message, Team,TeamUserRelation, File,Source,Term,TaskTeamRelation, Tag,UserScore
from .forms import CourseForm,TaskForm, FileForm,... | kaiueo/octs | octs/teacher/views.py | Python | bsd-3-clause | 34,607 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Department, Employee, FruitProduct
admin.site.register(Department)
admin.site.register(Employee)
admin.site.register(FruitProduct)
| uranusjr/django-mosql | testproject/djangomosqltest/admin.py | Python | bsd-3-clause | 233 |
#-------------------------------------------------------------------------------
#
# Define standard Enable 'control' components, like text/image labels,
# push buttons, radio buttons, check boxes, and so on.
#
# Written by: David C. Morrill
#
# Date: 10/10/2003
#
# (c) Copyright 2003 by Enthought, Inc.
#
# Class... | tommy-u/enable | enable/controls.py | Python | bsd-3-clause | 22,474 |
from __future__ import print_function
import datetime
from collections import OrderedDict
from django.urls import reverse
from django.http import JsonResponse
from django.utils.translation import get_language, activate
from wagtail.core import blocks
from wagtail.core.models import Page
from wagtail.core.rich_text imp... | PARINetwork/pari | core/utils.py | Python | bsd-3-clause | 5,677 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.