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 pytest
from django.contrib.contenttypes.models import ContentType
from addons.osfstorage import settings as osfstorage_settings
from osf.models import BaseFileNode, Folder, File
from osf_tests.factories import (
UserFactory,
ProjectFactory
)
pytestmark = pytest.mark.django_db
@pytest.fixture()
def us... | erinspace/osf.io | osf_tests/test_files.py | Python | apache-2.0 | 2,401 |
# Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/telluride_decoding | test/regression_data_test.py | Python | apache-2.0 | 3,840 |
# 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 u... | mistercrunch/panoramix | superset/views/base_api.py | Python | apache-2.0 | 21,953 |
# -*- coding: utf-8 -*-
"""
Copyright 2022 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lice... | Telefonica/toolium | toolium/utils/driver_wait_utils.py | Python | apache-2.0 | 18,753 |
# -*- encoding: utf-8 -*-
from decimal import Decimal
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import timezone
from reversion import revi... | pkimber/pay | pay/models.py | Python | apache-2.0 | 11,680 |
from api.mon.backends.zabbix.monitor import Zabbix, get_zabbix, del_zabbix
from api.mon.backends.zabbix.server import ZabbixMonitoringServer
get_monitoring = get_zabbix
del_monitoring = del_zabbix
MonitoringBackendClass = Zabbix
MonitoringServerClass = ZabbixMonitoringServer
__all__ = ('get_monitoring', 'del_monit... | erigones/esdc-ce | api/mon/backends/zabbix/__init__.py | Python | apache-2.0 | 379 |
from concurrent.futures import Future
from unittest import mock
from gmncurses.ui import signals, views
from gmncurses import controllers, config
from gmncurses.executor import Executor
from gmncurses.core import StateMachine
from tests import factories
| jespino/urwintranet | tests/controllers/test_wiki_controller.py | Python | apache-2.0 | 258 |
"""
Unit tests for salt/modules/salt_version.py
"""
import salt.modules.salt_version as salt_version
import salt.version
from tests.support.mock import MagicMock, patch
def test_mocked_objects():
"""
Test that the mocked objects actually have what we expect.
For example, earlier tests incorrectly mocked... | saltstack/salt | tests/pytests/unit/modules/test_salt_version.py | Python | apache-2.0 | 8,304 |
# :coding: utf-8
import re
#: Regular Expression pattern for single line comments
_ONE_LINE_COMMENT_PATTERN = re.compile(r"(\n|^| )//.*?\n")
#: Regular Expression pattern for multi-line comments
_MULTI_LINES_COMMENT_PATTERN = re.compile(r"/\*.*?\*/", re.DOTALL)
#: Regular Expression pattern for nested element symb... | buddly27/champollion | source/champollion/parser/helper.py | Python | apache-2.0 | 5,395 |
# 0 = open space, 1=boundary , 2= the robot, 3= finish
def maze_vision():
path= ''
maze=[]
maze.append(list('000000002000000'))
maze.append(list('000000003001100'))
maze.append(list('000000000000000'))
maze.append(list('000000000000000'))
maze.append(list('000000000000000'))
maze.append(list('000... | jpschnel/maze-vision | maze_vision.py | Python | apache-2.0 | 2,411 |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2013,2014 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a co... | guillaume-philippon/aquilon | lib/aquilon/consistency/checks/branch.py | Python | apache-2.0 | 3,427 |
# Copyright 2012 Pinterest.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | ewdurbin/pymemcache | pymemcache/client/base.py | Python | apache-2.0 | 39,766 |
# -*- coding: utf-8 -*-
from model.group import Group
def test_add_group(app, db, json_groups, check_ui):
group = json_groups
old_groups = db.get_group_list()
app.group.create(group)
# assert len(old_groups) + 1 == app.group.count()
new_groups = db.get_group_list()
old_groups.append(group)
as... | Tattiuss/python_training | test/test_add_group.py | Python | apache-2.0 | 1,283 |
# -*- coding: utf-8 -*-
#
# Copyright 2016 edX PDR Lab, National Central University, Taiwan.
#
# http://edxpdrlab.ncu.cc/
#
# 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://w... | yrchen/CommonRepo | commonrepo/infor_api/serializers.py | Python | apache-2.0 | 842 |
# Copyright (c) 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 requi... | tomasdubec/openstack-cinder | cinder/scheduler/host_manager.py | Python | apache-2.0 | 10,868 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Enquiry',
fields=[
('id', models.AutoField(auto... | pkimber/enquiry | enquiry/migrations/0001_initial.py | Python | apache-2.0 | 1,028 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017 team1@course_bigdata, Saint Joseph's University
#
# 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/li... | sacrefies/csc643_bigdata | project1/src/queries.py | Python | apache-2.0 | 7,595 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Arne Roomann-Kurrik <kurrik@gmail.com>'
import os
import sys
import math
import argparse
from subprocess import call
def ParseLine(line):
# Line format is <screen_name>,"<id1>,<id2>,..."\n
split_index = line.index(',')
screen_name = line[:split_index]... | kurrik/github-recs | src/apriori/apriori.py | Python | apache-2.0 | 5,606 |
# Copyright 2013-2014 Aerospike, 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... | PavanGupta01/aerospike-admin | lib/controller.py | Python | apache-2.0 | 27,343 |
#!/usr/bin/env python3
import argparse
import numpy as np
import random
import sys
parser = argparse.ArgumentParser()
parser.add_argument('ref_vectors')
parser.add_argument('vectors')
parser.add_argument('-n', type=int, default=500000)
parser.add_argument('-k', type=int, default=1)
parser.add_argument('-m', type=int... | eske/seq2seq | scripts/post_editing/select-by-ter.py | Python | apache-2.0 | 1,303 |
# python script to execute RNA Sequence Pipeline Task #1
# usage: python rnaseq-pipeline-task1.py --num_threads <num_threads> --gene_transcript_file <gene_transcript_file> --genome_index <genome_index >
# --data_dir <data_dir> --output_dir <output_dir> --sample_id <sample_id>
# e... | EDRN/labcas-backend | workflows/src/main/resources/rnaseq/pges/rnaseq-task1.py | Python | apache-2.0 | 2,942 |
"""
WSGI config for django_db project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_db.settings")
from django.co... | wfarn/scratchpad | django/django_db/django_db/wsgi.py | Python | apache-2.0 | 393 |
#!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
SPELL=u'yángfǔ'
CN=u'阳辅'
NAME=u'yangfu23'
CHANNEL='gallbladder'
CHANNEL_FULLNAME='GallbladderChannelofFoot-Shaoyang'
SEQ='GB38'
if __name__ == '__main__':
pass
| sinotradition/meridian | meridian/acupoints/yangfu23.py | Python | apache-2.0 | 242 |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify im... | alien4cloud/alien4cloud-cloudify3-provider | alien4cloud-cloudify3-provider/src/test/resources/outputs/blueprints/openstack/storage/wrapper/LinuxFileSystem_3/tosca.interfaces.node.lifecycle.Standard/start/_a4c_start.py | Python | apache-2.0 | 15,688 |
# 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... | briancurtin/python-openstacksdk | examples/cluster/profile.py | Python | apache-2.0 | 2,100 |
# -*- coding: utf-8 -*-
import json
import hashlib
import psycopg2
from tornado import gen
from .main_handlers import BaseHandler
class AuthCreateUserHandler(BaseHandler):
# FIX ME
def post(self):
pass
class AuthLoginHandler(BaseHandler):
def get(self):
self.redirect('/')
def pas... | freundallein/marynado | handlers/auth_handlers.py | Python | apache-2.0 | 1,461 |
#!/usr/bin/env python
#
# Copyright 2010 Hunter Freyer and Michael Kelly
#
# 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... | hjfreyer/marry-fuck-kill | backend/html_handlers.py | Python | apache-2.0 | 8,480 |
import tensorgraph as tg
import numpy as np
import time
def test_SimpleBlocks():
X = np.random.rand(100, 200)
with open('X.npy', 'wb') as f:
np.save(f, X)
db = tg.SimpleBlocks(['X.npy']*10, batchsize=32, allow_preload=True)
t1 = time.time()
count = 1
for blk in db:
print(count... | hycis/TensorGraph | test/data_iterator_test.py | Python | apache-2.0 | 1,793 |
# Create your views here.
from django.shortcuts import render, redirect
from django.views import generic
from Financers.models import Financers
import re
import random
def financer_detail(request, name):
template_name = 'financer_detail.html'
financer = ''
if name != "Unknown":
name = name.replace(',', '')
f... | kdunn926/eunomia-django | Financers/views.py | Python | apache-2.0 | 856 |
import threading
import time
import os
class CheckThread(threading.Thread):
def __init__(self, files):
threading.Thread.__init__(self)
self.files = files
def check_reward(self,files):
os.remove("./cluster/log/checklog.log")
check_log = open('./cluster/log/checklog.log', 'a')
check_log.write("hehehehhfffff\... | guanxiLi/django_check | d3jscluster/cluster/rewardprocess.py | Python | apache-2.0 | 373 |
# Copyright 2016 ZTE 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 in ... | open-o/nfvo | lcm/lcm/ns/vls/urls.py | Python | apache-2.0 | 1,036 |
#
# 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... | mrkm4ntr/incubator-airflow | tests/dags/test_on_kill.py | Python | apache-2.0 | 1,647 |
"""Test on deps, data, requires and provides."""
import os
import subprocess
import unittest
class DataDepTest(unittest.TestCase):
def test_direct_dep(self):
"""Test that we can import the module directly."""
from test.python_rules import data_dep
self.assertEqual(42, data_dep.the_answer... | thought-machine/please | test/python_rules/data_dep_test.py | Python | apache-2.0 | 577 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
PACKAGE_NAME = 'cappat'
def main():
""" Install entry-point """
from os import path as op
from glob import glob
from inspect import getfile, currentframe
from setuptools import setup, find_packages
from io import open # pylint: disable=W0622
... | poldracklab/crn-app-registration-tool | setup.py | Python | apache-2.0 | 2,099 |
"""
Unit tests and test utilities for django Organice.
NOTE: Having an __init__ file in test directories is bad practice according to
py.test recommendations:
http://pytest.org/latest/goodpractises.html#choosing-a-test-layout-import-rules
However, this makes relative imports work in test modules (e.g. helper from ``u... | Organice/django-organice | tests/units/__init__.py | Python | apache-2.0 | 920 |
# Copyright 2015 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... | CODAIT/graph_def_editor | graph_def_editor/reroute.py | Python | apache-2.0 | 19,100 |
# -*- coding: utf-8 -*-
#
# 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
#... | owlabs/incubator-airflow | airflow/example_dags/example_bash_operator.py | Python | apache-2.0 | 2,045 |
# -*- coding: utf-8 -*-
"""
BlueButtonDev.appmgmt
FILE: utils
Created: 12/2/15 8:09 PM
"""
__author__ = 'Mark Scrimshire:@ekivemark'
from django.contrib import messages
from .models import DEVELOPER_ROLE_CHOICES
from django.conf import settings
def Choice_Display(role):
"""
Receive a string of the current r... | ekivemark/BlueButtonDev | appmgmt/utils.py | Python | apache-2.0 | 1,004 |
#!/usr/bin/env python3
#
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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... | openstack/bifrost | bifrost/inventory.py | Python | apache-2.0 | 10,872 |
# Copyright 2020 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... | Intel-Corporation/tensorflow | tensorflow/python/pywrap_tensorflow.py | Python | apache-2.0 | 3,448 |
from core.adminmodel import *
from core.adminsearch import *
from core.decorators import *
from core import errors
from core.list_filter import *
from core.list_search import *
from core.request_handlers import *
from core.app import *
from core import html
__version__ = '1.0.0'
| sminteractive/ndb-gae-admin | smadmin/__init__.py | Python | apache-2.0 | 282 |
#!/usr/bin/python
#
# 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 ag... | GoogleCloudPlatform/datacatalog-connectors-bi | google-datacatalog-sisense-connector/tests/google/datacatalog_connectors/sisense/prepare/assembled_entry_factory_test.py | Python | apache-2.0 | 13,804 |
# Copyright (c) 2017, John Skinner
import unittest
import numpy as np
import pickle
import database.tests.test_entity
import util.dict_utils as du
import util.transform as tf
import core.sequence_type
import trials.slam.visual_slam as vs
import trials.slam.tracking_state as ts
class TestSLAMTrialResult(database.tests... | jskinn/robot-vision-experiment-framework | trials/slam/tests/test_visual_slam.py | Python | bsd-2-clause | 4,146 |
#!/usr/bin/env python
import os, sys, re
import gc
stests = [
r'Kerning: AVA $AVA$',
r'\$100.00 $\alpha \_$',
r'$\frac{\$100.00}{y}$',
r'$x y$',
r'$x+y\ x=y\ x<y\ x:y\ x,y\ x@y$',
r'$100\%y\ x*y\ x/y x\$y$',
r'$x\leftarrow y\ x\forall y\ x-y$',
r'$x \sf x \bf x {\cal X} \rm x$',
... | sniemi/SamPy | sandbox/src1/examples/mathtext_examples.py | Python | bsd-2-clause | 2,927 |
"""
@package mi.dataset.driver.ctdpf_ckl.wfp_sio_mule.driver
@file marine-integrations/mi/dataset/driver/ctdpf_ckl/wfp_sio_mule/driver.py
@author cgoodrich
@brief Driver for the ctdpf_ckl_wfp_sio_mule
Release notes:
Initial Release
"""
__author__ = 'cgoodrich'
__license__ = 'Apache 2.0'
import os
from mi.core.log i... | ooici/marine-integrations | mi/dataset/driver/ctdpf_ckl/wfp_sio_mule/driver.py | Python | bsd-2-clause | 7,545 |
import sys
import os
cur_path = os.getcwd()
sys.path.append(cur_path)
start_env = '''
1. mysqld should be start by sys
2. ngnix should be start by sys
3. need manually start uwsgi: . uwsgi_chaos.sh
note socket 127.0.0.1:9527 is takend by it
'''
init_env = '''
1. install git:
sudo yum ... | tanchao/chaos.trade | __init__.py | Python | bsd-2-clause | 1,215 |
# -*- coding: utf-8 -*-
import time
import re
import getpass
import socket
from kids.cache import cache
from kids.cmd import msg
from kids.ansi import aformat
from . import ooop_utils
_DEFAULT_NOT_SET = object()
_DB_REGEX = re.compile('''^
(?P<dbname>[a-zA-Z0-9_]+) ## db_name
(
@(?P<host>[a-zA-Z0-9\... | 0k/oem | src/oem/db.py | Python | bsd-2-clause | 5,051 |
# ----------------------------------------------------------------------
# author : Martin Ruchti
# contact : martin.ruchti@tum.de
# ----------------------------------------------------------------------
from __future__ import print_function, absolute_import, division
from numpy import *
from .variables import *
'''... | AJBrodie/inflowProject | pyKratos/newton_raphson_strategy.py | Python | bsd-2-clause | 6,317 |
def _init():
# any modules that need to be initialized early will be imported here
import ed2d.debug
ed2d.debug.debug('Debug module init.')
_init()
| explosiveduck/ed2d | ed2d/__init__.py | Python | bsd-2-clause | 161 |
#!/usr/bin/env python
"""
redis-contrib
======
Missing contrib packages for redis-py.
"""
from setuptools import setup, find_packages
setup(
name='redis-contrib',
version='0.0.0',
author='Matt Robenolt',
author_email='matt@ydekproductions.com',
url='https://github.com/mattrobenolt/redis-py-contri... | mattrobenolt/redis-py-contrib | setup.py | Python | bsd-2-clause | 768 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | jkyeung/XlsxWriter | xlsxwriter/test/comparison/test_table19.py | Python | bsd-2-clause | 1,269 |
# -*- coding: utf-8 -*-
from django.conf.urls import include, url
from servo.views.rules import *
urlpatterns = [
url(r'^$', list_rules, name='rules-list_rules'),
url(r'^add/$', edit_rule, name='rules-create'),
url(r'^(?P<pk>\d+)$', view_rule, name='rules-view_rule'),
url(r'^(?P<pk>\d+)/edit/$', edi... | fpsw/Servo | servo/urls/rules.py | Python | bsd-2-clause | 429 |
import sys,os
try:
import argparse
except ImportError:
print("""ERROR: Could not import argparse
Either use python2.7 or later (perhaps in a strange location such as
/bgsys/tools/python2.7.5-gnu-20130730/bin/hostpython) or install from
PyPI (https://pypi.python.org/pypi/argparse/).""")
sys.exit(1)
def mkd... | ucb-sejits/hpgmg | hpgmgconf.py | Python | bsd-2-clause | 5,489 |
from petsc4py import PETSc
import numpy as np
class mymesh(PETSc.Vec):
__array_priority__ = 1000
def __new__(cls, init=None, val=0.0):
if isinstance(init, mymesh) or isinstance(init, PETSc.Vec):
obj = PETSc.Vec().__new__(cls)
init.copy(obj)
elif isinstance(init, PETSc.DM... | Parallel-in-Time/pySDC | pySDC/playgrounds/other/petsc_datatype.py | Python | bsd-2-clause | 2,170 |
# ENVISIoN
#
# Copyright (c) 2019-2021 Jesper Ericsson, Gabriel Anderberg, Didrik Axén,
# Adam Engman, Kristoffer Gubberud Maras, Joakim Stenborg
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | rartino/ENVISIoN | envisionpy/processor_network/LinePlotNetworkHandler.py | Python | bsd-2-clause | 11,390 |
"""This is a Python-based web server that can be run to
read with Eidos. To run the server, do
python -m indra.sources.eidos.server
and then submit POST requests to the `localhost:5000/process_text` endpoint
with JSON content as `{'text': 'text to read'}`. The response will be the
Eidos JSON-LD output.
"""
impor... | pvtodorov/indra | indra/sources/eidos/server.py | Python | bsd-2-clause | 764 |
"""Test cases for STEREO Map subclasses.
This particular test file pertains to CORMap.
@Author: Pritish C. (VaticanCameos)
"""
import os
import glob
from sunpy.map.sources.stereo import CORMap
from sunpy.map import Map
import sunpy.data.test
path = sunpy.data.test.rootdir
fitspath = glob.glob(os.path.join(path, "cor... | Alex-Ian-Hamilton/sunpy | sunpy/map/sources/tests/test_cor_source.py | Python | bsd-2-clause | 977 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"debug camera"
__author__ = "baixue"
from ctypes import *
import os, sys
from time import sleep
from binascii import unhexlify
import serial
DIR_ROOT = os.getcwd()
HEADER = 'AABB'
ADDR = '01'
RELAY_NO = ['%02d' % (i+1) for i in range(16)]
# config camera info
GROUP_A... | baixuexue123/note | python/others/serialport/camera.py | Python | bsd-2-clause | 3,086 |
import claripy
from ..shellcode import Shellcode
class X86LeakAddress(Shellcode):
os = ["cgc"]
arches = ["X86"]
name = "leakaddress"
code = [b"\x31\xc0\x40\x40\x31\xdb\x43\xb9", b"\xba", b"\x31\xf6\xcd\x80"]
def __init__(self, address, length):
"""
:param addr: Address to le... | shellphish/rex | rex/exploit/shellcodes/x86_leakaddress.py | Python | bsd-2-clause | 876 |
#!/usr/bin/python
''' this file contains functions for experimenting with the different players and for running many trials and averaging results '''
from Player import RandomPlayer
from MCPlayer import MCPlayer, PNGSPlayer, GreedyPlayer
import Board
import sys, traceback
import time
def runRandomPlayerFirstSol(file... | ajstarna/RicochetRobots | Brobot/experimentsFirstSolution.py | Python | bsd-2-clause | 6,257 |
#!/usr/bin/env python3.4
# ---------------------------------------------------------------------------- #
import csv, os
# ---------------------------------------------------------------------------- #
def Validate():
Message1 = 'VALIDATED!!!'
Message2 = '''
$$$$$$$$\
$$ | $$$$$$\ $$$$$$\ $$$$$$\ $$$$$... | rssenar/PyToolkit | ValidateFiles.py | Python | bsd-2-clause | 2,072 |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | jmcnamara/XlsxWriter | xlsxwriter/test/comparison/test_hyperlink31.py | Python | bsd-2-clause | 929 |
__all__ = ["Frame"]
from importlib import util
# use the dataclass version of Frame if available.
# this will work on python >= 3.7 or 3.6 with dataclasses
# backport installed
if util.find_spec("dataclasses") is not None:
from ._frame_dataclass import Frame
else:
from ._frame_class import Frame # type: igno... | zeroepoch/plotbitrate | frame/__init__.py | Python | bsd-2-clause | 323 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from simplejson import load
class Configuration(dict):
def __init__(self, conf_fns):
self.conf_fns = conf_fns
for conf_fn in self.conf_fns:
abs_conf_fn = os.path.abspath(conf_fn)
if os.path.exists(a... | justinvanwinkle/flexiconfig | flexiconfig/__init__.py | Python | bsd-2-clause | 419 |
import types
import functools
import unittest
from .agent import Config, Agent
# XXX bring into compliance with python 2.7 unittest api
class AssertRaisesContextManager(object):
def __init__(self, expected):
self.expected = expected
def __enter__(self):
return self
def __exit__(se... | p/webracer | webracer/testcase.py | Python | bsd-2-clause | 4,545 |
# This file is eval'd inside the plot-correlation.py file
# This maps the named GPGPU-Sim config to the card name reported in the nvprof file.
# Every time you want to correlate a new configuration, you need to map it here.
config_maps = \
{
"PUB_TITANX": "TITAN X (Pascal)",
"TITANX_P102": "TITAN X (Pascal)"... | tgrogers/gpgpu-sim_simulations | util/plotting/correl_mappings.py | Python | bsd-2-clause | 21,360 |
# coding: utf-8
from pprint import pformat
from six import iteritems
import re
class InlineResponse2003(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, cursor=None, next_cursor=None, count=None, items=No... | huffpostdata/python-pollster | pollster/models/inline_response_200_3.py | Python | bsd-2-clause | 3,634 |
# -*- coding: utf-8 -*-
"""
pygments.lexers._mapping
~~~~~~~~~~~~~~~~~~~~~~~~
Lexer mapping definitions. This file is generated by itself. Everytime
you change something on a builtin lexer definition, run this script from
the lexers folder to update it.
Do not alter the LEXERS dictionary by ha... | fearthecowboy/pygments | Pygments/pygments-lib/pygments/lexers/_mapping.py | Python | bsd-2-clause | 45,831 |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017, Thierry Lemeunier <thierry at lemeunier dot net>
# 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 reta... | thethythy/Mnemopwd | mnemopwd/client/uilayer/uicomponents/InputBox.py | Python | bsd-2-clause | 5,588 |
""" support pyarrow compatibility across versions """
from pandas.util.version import Version
try:
import pyarrow as pa
_pa_version = pa.__version__
_palv = Version(_pa_version)
pa_version_under1p0 = _palv < Version("1.0.0")
pa_version_under2p0 = _palv < Version("2.0.0")
pa_version_under3p0 =... | jorisvandenbossche/pandas | pandas/compat/pyarrow.py | Python | bsd-3-clause | 705 |
# -*- coding: utf-8 -*-
#
# pygeocodio documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 22 14:09:09 2014.
#
# 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.
#
... | bennylope/pygeocodio | docs/conf.py | Python | bsd-3-clause | 8,264 |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Recipes for NativeClient toolchain packages.
The real entry plumbing is in toolchain_main.py.
"""
import collections
import f... | davidbrazdil/nacl | toolchain_build/toolchain_build.py | Python | bsd-3-clause | 39,585 |
from django.shortcuts import render_to_response
from django.core.context_processors import csrf
from django.conf import settings
def my_render(request, template, context={}):
context.update(csrf(request))
context['STATIC_URL'] = settings.STATIC_URL
context['flash'] = request.get_flash()
context['user'... | MERegistro/meregistro | meregistro/shortcuts.py | Python | bsd-3-clause | 533 |
survey_data_decoupled.groupby(survey_data_decoupled["eventDate"].dt.year).size().plot(kind='barh', color="#00007f", figsize=(10, 10)) | jorisvandenbossche/DS-python-data-analysis | notebooks/_solutions/case2_biodiversity_processing11.py | Python | bsd-3-clause | 133 |
# TRAIN_LABELS_PATH = "data/raw/solutions_training.csv"
TRAIN_LABELS_PATH = "data/raw/training_solutions_rev1.csv"
TARGET_PATH = "data/solutions_train.npy"
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from termcolor import colored
import load_data
output_names=["smooth","featureOrdisk... | garbersc/keras-galaxies | output_corr.py | Python | bsd-3-clause | 1,543 |
import hashlib
from django.conf import settings
from django.core.cache import cache
from django.db.models import Count
from elasticsearch.exceptions import TransportError
from statsd import statsd
from kitsune.products.models import Topic
from kitsune.wiki.models import Document, DocumentMappingType
def topics_for... | dbbhattacharya/kitsune | kitsune/wiki/facets.py | Python | bsd-3-clause | 5,435 |
""" Primitives to manage and construct pipelines for compression/encryption. """
from gevent import sleep
from wal_e.exception import UserCritical
from wal_e.piper import popen_sp, NonBlockPipeFileWrap, PIPE
PV_BIN = 'pv'
GPG_BIN = 'gpg'
LZOP_BIN = 'lzop'
# BUFSIZE_HT: Buffer Size, High Throughput
#
# This is set co... | fdr/heroku-wal-e | wal_e/pipeline.py | Python | bsd-3-clause | 4,389 |
from sympy import Sieve, sieve, Symbol, S, limit, I, zoo, nan, Rational
from sympy.core.compatibility import range
from sympy.ntheory import isprime, totient, mobius, randprime, nextprime, prevprime, \
primerange, primepi, prime, primorial, composite, compositepi, reduced_totient
from sympy.ntheory.generate import... | kaushik94/sympy | sympy/ntheory/tests/test_generate.py | Python | bsd-3-clause | 6,809 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import multiprocessing
import gunicorn.app.base
from gunicorn.six import iteritems
def number_of_workers():
return (multiprocessing.cpu_count() * 2) + 1
class StandaloneApplication(gunicorn.app.base.BaseApplication):
de... | radical-software/mongrey | mongrey/web/worker.py | Python | bsd-3-clause | 1,033 |
""" This file contains defines parameters for dipy that we use to fill
settings in setup.py, the dipy top-level docstring, and for building the
docs. In setup.py in particular, we exec this file, so it cannot import dipy
"""
# dipy version information. An empty _version_extra corresponds to a
# full release. '.dev'... | maurozucchelli/dipy | dipy/info.py | Python | bsd-3-clause | 3,570 |
# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from collections import OrderedDict
from multiconf import AbstractConfigItem
from multiconf.multiconf import _RootEnvProxy, _ItemParentProxy
def _id_name_type(item):
return repr(id(i... | lhupfeldt/multiconf | test/utils/check_containment.py | Python | bsd-3-clause | 2,613 |
from sympy.core.add import Add
from sympy.core.mul import Mul
from sympy.core.power import Pow
from sympy.core.function import Function
from sympy.core.symbol import Symbol, Wild
from sympy.core.basic import S, C, Atom, sympify
from sympy.core.numbers import Integer, Rational
from sympy.functions import exp, sin , co... | jbaayen/sympy | sympy/integrals/risch.py | Python | bsd-3-clause | 11,561 |
# 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.
_SUPPORTED_MASTERS = [
# Tree-closer.
'chromium',
'chromium.win',
'chromium.mac',
'chromium.linux',
'chromium.chromiumos',
'chro... | nicko96/Chrome-Infra | appengine/findit/waterfall/masters.py | Python | bsd-3-clause | 919 |
# -*- coding: utf-8 -*-
import json
from unittest import mock
from oauthlib.oauth2.rfc6749 import errors
from oauthlib.openid import RequestValidator, UserInfoEndpoint
from tests.unittest import TestCase
def set_scopes_valid(token, scopes, request):
request.scopes = ["openid", "bar"]
return True
class Use... | idan/oauthlib | tests/openid/connect/core/endpoints/test_userinfo_endpoint.py | Python | bsd-3-clause | 2,522 |
import os
from django.conf import settings
from windmill.authoring import djangotest
from lfs.core.models import Shop
from lfs.catalog.models import Product
class CartPriceIntegrationTest(djangotest.WindmillDjangoUnitTest):
test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'windmilltests', 'gr... | diefenbach/django-lfs | lfs/integrationtests/wmtests.py | Python | bsd-3-clause | 1,998 |
# -*- coding: utf-8 -*-
# YaBlog
# (c) Regis FLORET
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the fol... | regisf/yablog | plugins/contact/__init__.py | Python | bsd-3-clause | 3,704 |
# ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
from __future__ import absolute_import
import os
from django import forms
from django.conf import settings as django_settings
from django.contrib import... | pjdelport/feincms | feincms/module/medialibrary/modeladmins.py | Python | bsd-3-clause | 8,526 |
# encoding: utf-8
"""
Copyright (c) 2012 - 2015, Marian Steinbach, Ernesto Ruge
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,... | okfde/ris-web | scripts/remove_thumbs.py | Python | bsd-3-clause | 2,543 |
from distutils.core import setup
import py2exe
import sys
from os.path import join, dirname
setup(
windows=[{"script": "hockey_prediction_app.py", "icon_resources": [(1, join(dirname(sys.argv[0]), 'hokey.ico'))]}],
options={"py2exe": {"includes": ["sip", 'lxml.etree', 'lxml._elementpath', 'gzip', 'pandas', 'nu... | ahcub/hokey_prediction_app | setup.py | Python | bsd-3-clause | 578 |
from django.conf.urls.defaults import *
from django.contrib import admin
from fumblerooski.feeds import CoachesFeed
feeds = {
'coaches': CoachesFeed,
}
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/coach_totals/', "fumblerooski.college.views.admin_coach_totals"),
url(r'^admin/doc/', incl... | dwillis/fumblerooski | urls.py | Python | bsd-3-clause | 1,591 |
from .bhtsne import bh_tsne
__all__ = ["_bhtsne", "bh_tsne"]
| CurryBoy/ProtoML-Deprecated | protoml/extras/tsne/_bhtsne/__init__.py | Python | bsd-3-clause | 62 |
__version__ = '0.1.0'
from dedal.site import site
__all__ = ['site']
| vi4m/django-dedal | dedal/__init__.py | Python | bsd-3-clause | 71 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 30, transform = "Fisher", sigma = 0.0, exog_count = 20, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Fisher/trend_ConstantTrend/cycle_30/ar_12/test_artificial_128_Fisher_ConstantTrend_30_12_20.py | Python | bsd-3-clause | 267 |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from social_auth.models import UserSocialAuth
from django.contrib.auth.models import User
from social_f... | laplacesdemon/django-social-friends-finder | social_friends_finder/tests.py | Python | bsd-3-clause | 2,413 |
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, Http404
from django.db.models import Q
from django.template import RequestContext
from projects.models import Project, SubProject
from data.models import Protocol, Result, Experiment
from reagents.models import Ant... | davebridges/ExperimentDB | experimentdb/views.py | Python | bsd-3-clause | 1,226 |
#!/usr/bin/env python
# ===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... | alex-ip/agdc | api-examples/source/main/python/tool/summarise_dataset_time_series.py | Python | bsd-3-clause | 25,656 |
from __future__ import print_function
# bench related imports
import numpy as np
import shutil
import bquery
import pandas as pd
import itertools as itt
import cytoolz
import cytoolz.dicttoolz
from toolz import valmap, compose
from cytoolz.curried import pluck
import blaze as blz
# other imports
import contextlib
impor... | FrancescElies/bquery | bquery/benchmarks/bench_groupby.py | Python | bsd-3-clause | 2,373 |
from django.contrib import admin
from devilry.devilry_dbcache.models import AssignmentGroupCachedData
@admin.register(AssignmentGroupCachedData)
class AssignmentGroupCachedDataAdmin(admin.ModelAdmin):
list_display = [
'id',
'group',
'first_feedbackset',
'last_feedbackset',
... | devilry/devilry-django | devilry/devilry_dbcache/admin.py | Python | bsd-3-clause | 1,516 |
import errno
import functools
import gevent
import gevent.pool
import itertools
import json
import os
import sys
from io import StringIO
from wal_e import log_help
from wal_e import storage
from wal_e import tar_partition
from wal_e.exception import UserException, UserCritical
from wal_e.worker import prefetch
from wa... | tenstartups/wal-e | wal_e/operator/backup.py | Python | bsd-3-clause | 23,283 |
AUTH_ENDPOINT = 'https://auth.mxit.com'
API_ENDPOINT = 'https://api.mxit.com'
| Mxit/python-mxit | mxit/settings.py | Python | bsd-3-clause | 78 |