code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# Copyright 2017 Janos Czentye
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | hsnlab/escape | escape/escape/infr/topology.py | Python | apache-2.0 | 40,815 |
#!/usr/bin/env python
#
# test_write_pdb.py
#
# tests for ModernaStructure PDB write feature.
#
# http://iimcb.genesilico.pl/moderna/
#
__author__ = "Magdalena Rother, Tomasz Puton, Kristian Rother"
__copyright__ = "Copyright 2008, The Moderna Project"
__credits__ = ["Janusz Bujnicki"]
__license__ = "GPL"
__maintainer_... | lenarother/moderna | tests/test_write_pdb.py | Python | gpl-3.0 | 2,583 |
import logging, redis, time
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from monscale.rules import evaluate_traps
class Command(BaseCommand):
args = ''
help = 'Retrieve queued actions and execute them.'
def handle(self, *args, **options):
# log... | jpardobl/monscale | monscale/management/commands/trap_worker.py | Python | bsd-3-clause | 654 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Import modules for CGI handling
import cgi
import cgitb
import Cookie
import os
import time
# =====================***** C-o-n-f-i-g--m-o-d-e *****================ #
import ConfigParser
Config = ConfigParser.ConfigParser()
Config.read(r'setting/devices.ini')
settingSec =... | 5610110083/Safety-in-residential-project | cgi-bin/device.py | Python | apache-2.0 | 15,469 |
import time
from pageobjects.base import PageObject
from pageobjects.base import Popup
from pageobjects.tabs import Tabs
class Actions(PageObject):
@property
def name(self):
return self.parent.\
find_element_by_css_selector('.environment-action-form input')
@property
def rename(... | ddepaoli3/fuel-main-dev | fuelweb_ui_test/pageobjects/actions.py | Python | apache-2.0 | 3,127 |
# 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... | tqchen/tvm | python/tvm/topi/arm_cpu/cortex_m7/conv2d/__init__.py | Python | apache-2.0 | 856 |
# -*- coding: utf-8 -*-
from mock import patch
from unittest import TestCase
from django.template import Template, Context
@patch('django_thumbor.templatetags.thumbor_tags.generate_url')
class TestThumborURLTTagMock(TestCase):
url = 'domain.com/path/image.jpg'
def test_should_assign_result_to_variable(self,... | ricobl/django-thumbor | testproject/tests/test_assign_thumbor_url_ttag.py | Python | mit | 777 |
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... | dnanexus/dx-toolkit | src/python/dxpy/bindings/dxjob.py | Python | apache-2.0 | 14,894 |
import numpy as np
#===============================================
#===============================================
#===============================================
#Corrections from ML2/alpha = 0.8 to 3D from Tremblay et al. (2013)
def ml28_to_3d_teff(teff,logg):
c = np.zeros(8)
c[0] = 1.0947335E-03
c... | joshfuchs/ZZCeti_analysis | analysis_tools.py | Python | mit | 8,141 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2013 Star2Billing S.L.
#
# The Initia... | garyjs/Newfiesautodialer | newfies/dialer_cdr/dialer_cdr_custom_spamlib.py | Python | mpl-2.0 | 767 |
import os
import re
import pandas
from PyQt4.QtGui import QCheckBox
from ert.enkf import ErtPlugin, CancelPluginException
from ert.enkf.export import SummaryCollector, GenKwCollector, MisfitCollector, DesignMatrixReader, CustomKWCollector
from ert_gui.ertwidgets.customdialog import CustomDialog
from ert_gui.ertwidget... | arielalmendral/ert | share/workflows/jobs/internal-gui/scripts/csv_export.py | Python | gpl-3.0 | 7,663 |
from note.infrastructure.error import FileContentError
from note.module.element import QAState, QA, Command
from note.module.filehandler import FileContentHandler
from note.module.markdown.qa import MarkdownQA
from note.module.markdown.title_pat import *
from note.utils.os import fs
class MarkdownFileContentHandler(F... | urnote/urnote | note/module/markdown/filehandler.py | Python | gpl-3.0 | 10,422 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v8/enums/types/campaign_experiment_traffic_split_type.py | Python | apache-2.0 | 1,292 |
# -*- coding: utf-8 -*-
# RelayBot - Simple VNC Relay Service, modules/minecraft/udpprotocol.py
#
# Copyright (C) 2021 Matthew Beeching
#
# This file is part of RelayBot.
#
# RelayBot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | jobe1986/relaybot | modules/minecraft/udpprotocol.py | Python | gpl-3.0 | 15,528 |
"""
This file contains a management command for exporting the modulestore to
neo4j, a graph database.
"""
import logging
from celery import task
from django.conf import settings
from django.utils import six, timezone
from edx_django_utils.cache import RequestCache
from opaque_keys.edx.keys import CourseKey
from py2n... | edx-solutions/edx-platform | openedx/core/djangoapps/coursegraph/tasks.py | Python | agpl-3.0 | 13,566 |
#!/usr/bin/env python
from keras import backend as K
def mean_corner_error(y_true, y_pred):
y_true = K.reshape(y_true, (-1, 4, 2))
y_pred = K.reshape(y_pred, (-1, 4, 2))
return K.mean(K.sqrt(K.sum(K.square(y_pred - y_true), axis=-1, keepdims=True)), axis=1)
| baudm/HomographyNet | homographynet/losses.py | Python | apache-2.0 | 273 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './QScintilla/SearchWidget.ui'
#
# Created: Tue Nov 18 17:53:58 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_SearchWidget(object):... | davy39/eric | QScintilla/Ui_SearchWidget.py | Python | gpl-3.0 | 4,989 |
#!/usr/bin/env python
"""
Unit tests for the EsuRestApi class
"""
import unittest, random, string, hashlib
from xml.etree.ElementTree import fromstring
from EsuRestApi import EsuRestApi, EsuException
class EsuRestApiTest(unittest.TestCase):
# Enter your own host in the form of sub.domain.com or ... | ab24v07/atmos-python | EsuRestApiTest.py | Python | bsd-3-clause | 9,555 |
import pytest
from opentrons.calibration_storage import file_operators
from opentrons import config
@pytest.fixture
def grab_id(set_up_index_file_temporary_directory):
labware_to_access = 'opentrons_96_tiprack_10ul'
uri_to_check = f'opentrons/{labware_to_access}/1'
offset_path =\
config.get_opent... | Opentrons/labware | robot-server/tests/service/labware/test_labware_calibration_access.py | Python | apache-2.0 | 2,492 |
import socketserver
import json
class dynDnsServerHandler(socketserver.BaseRequestHandler):
def handle(self):
try:
response = {}
updated = False
clientIp = self.client_address[0]
dataReceived = self.request.recv(10).decode('UTF-8')
self.server.logger.info('Request #' + dataReceived ... | MilkyWeb/dyndns | server/dynDnsServerHandler.py | Python | mit | 759 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""QSRlib ROS server interface.
:Author: Yiannis Gatsoulis <y.gatsoulis@leeds.ac.uk>
:Organization: University of Leeds
:Date: 22 September 2014
:Version: 0.1
:Status: Development
:Copyright: STRANDS default
"""
from __future__ import print_function, division
import rospy... | yianni/strands_qsr_lib_rviz | qsr_lib/scripts/qsrlib_ros_server.py | Python | mit | 1,518 |
# Copyright (c) 2016 Tigera, 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 ... | quater/calico-containers | release-scripts/utils.py | Python | apache-2.0 | 17,408 |
from multiprocessing.connection import Client
import sys
import time
from mergesort import mergesort as main
print("Ginnungagap client version 1.0.0 for UCA Cluster, based in Heimdall")
host = input("Type the master's ip: ")
toprint = not input("Should print? (y or n)> ") == "n"
porta = 666
ok = True #the ok is again, ... | victor-cortez/Heimdall | mergesort/Ginnungagap_slave.py | Python | mit | 2,395 |
#####################################################################
# G85_map.py
#
# (c) Copyright 2015, Benjamin Parzella. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Fo... | bparzella/gemma | app/models/G85_map.py | Python | lgpl-2.1 | 6,751 |
"""Provide an MCA simulator."""
import time
import numpy
import gevent
from .base import BaseMCA, PresetMode, TriggerMode, Stats
class SimulatedMCA(BaseMCA):
_init_time = 1.
_prepare_time = 0.1
_cleanup_time = 0.1
_gate_end = 0.5
_mapping_modulo = 2
# Initialization
def initialize_at... | tiagocoutinho/bliss | bliss/controllers/mca/simulation.py | Python | lgpl-3.0 | 4,984 |
# imports the thing that reads files and imports random to make random numbers
from sys import argv
import random
# assigns some stuff to argv
script, filename = argv
# opens the file that the user specifies and assigns it to txt
txt = open(filename,'r')
# makes a list of the all the lines in the file
verbList = txt... | HeatherJW/Code | dutch_verbs_practice/dutch2.py | Python | unlicense | 1,313 |
#!/usr/bin/env python
#
# Copyright 2007 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and tha... | qilicun/python | python2/PyMOTW-1.132/PyMOTW/shelve/shelve_writeback.py | Python | gpl-3.0 | 1,446 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from django import forms
from .models impor... | Finntack/pootle | pootle/apps/pootle_language/forms.py | Python | gpl-3.0 | 467 |
"""
Answer to question 3
"""
import sys
ADENINE = "A"
CYTOSINE = "C"
GUANINE = "G"
THYMINE = "T"
COMPLEMENT_MAP = {ADENINE:THYMINE, THYMINE:ADENINE, CYTOSINE: GUANINE, GUANINE:CYTOSINE}
input_file = sys.argv[1]
output_file = sys.argv[2]
input_string = ""
def read_input_data():
"""
Reads input data.
... | thewickedaxe/600.647-Computational-Genomics | HW-1/answer3.py | Python | mit | 909 |
from django.middleware.cache import FetchFromCacheMiddleware
class CacheAdminMiddleware(FetchFromCacheMiddleware):
def process_request(self, request):
user = getattr(request, "user", None)
if user and user.is_superuser:
request._cache_update_cache = False
return None
... | lotrekagency/djlotrek | djlotrek/middleware/cache_admin.py | Python | mit | 388 |
# -*- coding: utf-8 -*-
import argparse
from twstock.codes import __update_codes
from twstock.cli import best_four_point
from twstock.cli import stock
from twstock.cli import realtime
def run():
parser = argparse.ArgumentParser()
parser.add_argument('-b', '--bfp', nargs='+')
parser.add_argument('-s', '--... | mlouielu/twstock | twstock/cli/__init__.py | Python | mit | 845 |
# -*- coding: utf-8 -*-
#
# Flow Framework documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 08 11:09: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... | chewbakartik/flow-development-collection | TYPO3.Flow/Documentation/conf.py | Python | mit | 10,318 |
from __future__ import annotations
from datetime import date, datetime, time
from decimal import Decimal
from math import isinf, isnan
from struct import pack as struct_pack
from struct import unpack as struct_unpack
from struct import unpack_from as struct_unpack_from
from typing import TYPE_CHECKING, Any, Callable
... | adamchainz/mariadb-dyncol | src/mariadb_dyncol/base.py | Python | mit | 12,070 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.core.cache import cache
from ...core.tests import utils
from .models import Flag, CommentFlag
from .forms import FlagForm
class FlagViewTest(TestCase):
def ... | dvreed/Spirit | spirit/comment/flag/tests.py | Python | mit | 1,829 |
from datetime import date, datetime, time, timedelta
import numpy as np
import pytest
import pandas as pd
from pandas import DatetimeIndex, Index, Timestamp, date_range, notna
import pandas._testing as tm
from pandas.core.indexes.base import InvalidIndexError
from pandas.tseries.offsets import BDay, CDay
START, END... | TomAugspurger/pandas | pandas/tests/indexes/datetimes/test_indexing.py | Python | bsd-3-clause | 23,710 |
##########################################################################
#
# Copyright (c) 2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | hradec/gaffer | python/GafferSceneUITest/DocumentationTest.py | Python | bsd-3-clause | 2,209 |
#!/usr/bin/env python2
#
# This file is part of the coreboot project.
#
# Copyright (c) 2015 MediaTek Inc.
# Author: Tristan Shieh <tristan.shieh@mediatek.com>
#
# This program 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 Soft... | librecore-org/librecore | util/mtkheader/gen-bl-img.py | Python | gpl-2.0 | 2,886 |
import chainer
from chainer.functions.array import broadcast
from chainer.functions.array import reshape
def scale(x, y, axis=1):
"""Elementwise product with broadcasting.
Computes a elementwise product of two input variables, with the shape of
the latter variable broadcasted to match the shape of the fo... | aonotas/chainer | chainer/functions/math/scale.py | Python | mit | 1,448 |
(S'f2d5decc4813e22fef85936300f74439'
p1
(ihappydoclib.parseinfo.moduleinfo
ModuleInfo
p2
(dp3
S'_namespaces'
p4
((dp5
(dp6
tp7
sS'_import_info'
p8
(ihappydoclib.parseinfo.imports
ImportInfo
p9
(dp10
S'_named_imports'
p11
(dp12
sS'_straight_imports'
p13
(lp14
S'_pysssr'
p15
aS'sys'
p16
asbsS'_filename'
p17
S'../python/f... | tuffery/Frog2 | frowns/extensions/pysssr/.happydoc.test_sssr.py | Python | gpl-3.0 | 708 |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | diegocortassa/TACTIC | src/pyasm/application/common/application.py | Python | epl-1.0 | 7,585 |
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | silenceli/nova | nova/api/openstack/compute/contrib/server_usage.py | Python | apache-2.0 | 2,996 |
# -*- coding: utf-8 -*-
'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org>
Task Coach 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 vers... | TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/render.py | Python | gpl-3.0 | 12,800 |
#!/usr/bin/env python3
import xml.etree.ElementTree as etree
import requests
import sys
import urllib.parse
XML_URL = 'http://www.billboard.com/rss/charts/hot-100'
ROW_TMPL = """
<tr>
<td>{rank}</td>
<td>{lastrank}</td>
<td><a href="{link}">{title}</a></td>
<td>{artist}</td>
</tr>
"""
PAGE_TMPL = """
<!DOCTYPE html>
... | sampsyo/hot100 | hot100.py | Python | mit | 1,662 |
import string
from htmllib import HTMLParser
from cgi import escape
from urlparse import urlparse
from formatter import AbstractFormatter
from htmlentitydefs import entitydefs
from xml.sax.saxutils import quoteattr
import re
ALPHABET = string.ascii_uppercase + string.ascii_lowercase + \
string.digits + '-_'... | MapStory/geonode | geonode/contrib/worldmap/wm_extra/encode.py | Python | gpl-3.0 | 8,522 |
"""spaCy
Run spaCy tools and pipelines on your datasets.
Currently only includes tokenization, but this could be expanded to include
many more of spaCy's tools.
Or, if you want a different tool/pipeline, you could create your own
module type following the same approach.
""" | markgw/pimlico | src/python/pimlico/modules/spacy/__init__.py | Python | gpl-3.0 | 278 |
#!/usr/bin/env python3
import sys
import gzip
filename_nTx = sys.argv[1]
#filename_nTx = 'TKLab201907n_PELCHtx_mms9171+Heart_NoPart_nTx.fa'
filename_quant = filename_nTx.replace('_NoPart_nTx.fa', '.salmon_quant.sf')
f_nTx = open(filename_nTx, 'r')
if filename_nTx.endswith('.gz'):
f_nTx = gzip.open(filename_nTx, '... | marcottelab/NuevoTx | quant/filter-nTx-by-quant.py | Python | apache-2.0 | 1,154 |
import itertools
import pytest
from tlz import merge
np = pytest.importorskip("numpy")
import dask
import dask.array as da
from dask import config
from dask.array.slicing import (
_sanitize_index_element,
_slice_1d,
cached_cumsum,
make_block_sorted_slices,
new_blockdim,
normalize_index,
s... | jakirkham/dask | dask/array/tests/test_slicing.py | Python | bsd-3-clause | 32,269 |
# -*- coding:utf-8 -*-
import logging
import warnings
from flypwd.config import config
with warnings.catch_warnings():
warnings.simplefilter("ignore")
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
log = logging.getLogger(__name__)
def check_key(keyfile):
"""
checks the R... | giupo/flypwd | flypwd/keys.py | Python | bsd-3-clause | 658 |
from RMPY.rig.biped.rig import arm
from RMPY.rig.biped.rig import rigSpine
from RMPY.rig.biped.rig import hand
from RMPY.rig import rigFK
from RMPY.rig import rigWorld
from RMPY.rig.biped.rig import neckHead
from RMPY.rig.biped.rig import rigIKFKLegFeet
from RMPY.rig import rigBase
from RMPY.rig import rigProp
from RMP... | rendermotion/RMPY | rig/quadruped/rigQuadruped.py | Python | lgpl-3.0 | 6,548 |
"""The tests for the REST switch platform."""
import asyncio
import aiohttp
import homeassistant.components.rest.switch as rest
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
CONF_HEADERS,
CONF_NAME,
CONF_PARAMS,
CONF_PLATFORM,
CONF_RESOURCE,
... | tboyce021/home-assistant | tests/components/rest/test_switch.py | Python | apache-2.0 | 8,431 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py | Python | mit | 1,345 |
import rospy
import time
from collections import deque
class Publisher(object):
def __init__(self):
self.publishers = {}
self.queue = deque()
def add_publisher(self, alias, publisher):
self.publishers[alias] = publisher
def publish(self):
while len(self.queue) > 0:
... | jgrizou/robot_omniwheel | catkin_ws/src/roslego/scripts/publisher.py | Python | gpl-3.0 | 541 |
#!/usr/bin/python3
#-*- coding: utf-8 -*-
name = 'ITU Turkish NLP Pipeline Caller'
__copyright__ = '__copyright__ 2015-2018 Maintainers'
__license__ = 'GPLv2\n\
This program is free software; you can redistribute it and/or \
modify it under the terms of the GNU General Public license version 2 \
as published by the ... | ferittuncer/ITU-Turkish-NLP-Pipeline-Caller | pipeline_caller.py | Python | gpl-2.0 | 6,662 |
# 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 import benchmark
from measurements import draw_properties
import page_sets
@benchmark.Disabled() # http://crbug.com/463111
class DrawPrope... | sgraham/nope | tools/perf/benchmarks/draw_properties.py | Python | bsd-3-clause | 974 |
"""The Garages Amsterdam integration."""
from datetime import timedelta
import logging
import async_timeout
import garages_amsterdam
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers import aiohttp_client
from homeassistant.helpers.update_coor... | jawilson/home-assistant | homeassistant/components/garages_amsterdam/__init__.py | Python | apache-2.0 | 1,819 |
from django.apps import AppConfig
class LandingConfig(AppConfig):
name = 'landing'
| duncanwp/cis_esp | web/landing/apps.py | Python | lgpl-3.0 | 89 |
"""
This module will be available in templates as ``u``.
This module is also used to lookup custom template context providers, i.e. functions
following a special naming convention which are called to update the template context
before rendering resource's detail or index views.
"""
import re
import itertools
import co... | clld/grambank | grambank/util.py | Python | apache-2.0 | 5,510 |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | emgerner-msft/azure-storage-python | azure/storage/blob/models.py | Python | apache-2.0 | 23,827 |
'''
Flowchart based particle parser.
'''
import re
from .instrgeom import RayBundle, ParticleStory, ParticleCompGroup, ParticleState
from .flowchart import FCNTerminal, FCNDecisionBool, FCNDecisionMulti, FCNProcess, FlowChartControl
# terminal nodes implementation
def t_begin(args):
print("starting particle parsin... | markusappel/McCode | tools/Python/mccodelib/fcparticleparser.py | Python | gpl-2.0 | 8,291 |
# Copyright 2019 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.
"""Implements commands for running/interacting with Fuchsia on an emulator."""
import pkg_repo
import boot_data
import logging
import os
import subprocess
i... | nwjs/chromium.src | build/fuchsia/emu_target.py | Python | bsd-3-clause | 4,940 |
import sys, os, time, atexit
from signal import SIGTERM
class BaseDaemon(object):
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
logfile = None
stdin = "/dev/null"
stdout = "/dev/null"
stderr = "/dev/null"
chdir ... | procool/mygw | globals/utils/daemon/basedaemon.py | Python | bsd-2-clause | 3,715 |
#!/usr/bin/env python
"""Tests client actions related to administrating the client."""
import os
import StringIO
import psutil
from grr.client import actions
from grr.client import comms
from grr.lib import config_lib
from grr.lib import rdfvalue
from grr.lib import stats
from grr.lib import test_lib
class Confi... | MiniSEC/GRR_clone | client/client_actions/admin_test.py | Python | apache-2.0 | 4,821 |
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from . import boundingBox
from . import imageGradients
from . import rawData
view_extensions = [
# Set show=True if extension should be shown by default
# in the 'Select Visualization Method' dialog. These d... | dongjoon-hyun/DIGITS | digits/extensions/view/__init__.py | Python | bsd-3-clause | 1,210 |
def extractChuunihimeWordpressCom(item):
'''
Parser for 'chuunihime.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loi... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractChuunihimeWordpressCom.py | Python | bsd-3-clause | 560 |
""" pimms.py Entry point for PI.M.M.S application. Does all the web rendering.
Copyright 2013 Will Bickerstaff <will.bickerstaff@gmail.com>
This file is part of Pi.M.M.S.
Pi.M.M.S is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... | WillBickerstaff/PiMMS | www/web.py | Python | gpl-3.0 | 4,054 |
"""Unit tests for feedgrabber"""
from django.test import TestCase
| Fantomas42/django-feedgrabber | feedgrabber/tests.py | Python | bsd-3-clause | 67 |
#$Id$#
from books.model.Bill import Bill
from books.model.LineItem import LineItem
from books.model.Address import Address
from books.model.PaymentAndCredit import PaymentAndCredit
from books.model.BillPayment import BillPayment
from books.service.ZohoBooks import ZohoBooks
zoho_books = ZohoBooks("{auth_token}", "{or... | zoho/books-python-wrappers | test/BillTest.py | Python | mit | 3,928 |
from django.conf.urls import url,include
from django.contrib import admin
from webchat import views
urlpatterns = [
url(r'^$', views.dashboard,name='chat_dashboard'),
url(r'^msg_send/$', views.send_msg,name='send_msg'),
url(r'^new_msgs/$', views.get_new_msgs,name='get_new_msgs'),
]
| XiaJieCom/change | stu103151/days21/project/webchat/urls.py | Python | lgpl-2.1 | 296 |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | t3wz/mtasa-blue | vendor/google-breakpad/src/tools/gyp/pylib/gyp/win_tool.py | Python | gpl-3.0 | 12,634 |
from itertools import product
from rpython.rlib import jit, rarithmetic, rstring
from rpython.rlib.rbigint import rbigint
import debug
class KernelValue(object):
simple = True
def __init__(self, source_pos=None):
self.source_pos = source_pos
def equal(self, other):
return other is self
... | euccastro/icbink | kernel_type.py | Python | mit | 41,697 |
import unittest
from common import gtk
class TreeViewTest(unittest.TestCase):
# Check for #350252
# Cooment out this test until we get a response
# on bug #546005 and #498010
#
#def test_default_attributes(self):
# model = gtk.ListStore(str)
# treeview = gtk.TreeView(model)
# ... | GNOME/pygtk | tests/test_treeview.py | Python | lgpl-2.1 | 864 |
import json
from six.moves.urllib.parse import parse_qs
from xml.dom.minidom import parseString
class XeroException(Exception):
def __init__(self, response, msg=None):
self.response = response
super(XeroException, self).__init__(msg)
class XeroNotVerified(Exception):
# Credentials haven't b... | unomena/pyxeropos | xero/exceptions.py | Python | bsd-3-clause | 3,809 |
#-*- coding: utf-8 -*-
"""
Certificates Tests.
"""
import itertools
import json
import ddt
import mock
import six
from django.conf import settings
from django.test.utils import override_settings
from opaque_keys.edx.keys import AssetKey
from six.moves import range
from cms.djangoapps.contentstore.tests.utils impor... | stvstnfrd/edx-platform | cms/djangoapps/contentstore/views/tests/test_certificates.py | Python | agpl-3.0 | 31,931 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | titasakgm/brc-stock | openerp/addons/base/res/res_config.py | Python | agpl-3.0 | 25,514 |
import os
import tempfile
import urllib
from imposm.parser import OSMParser
from .importer import GraphImporter
def parse_file(filename, parse_direction=False, **kwargs):
"""
Return an OSM networkx graph from the input OSM file
Only works with OSM xml, xml.bz2 and pbf files. This function cannot take
... | Mapkin/osmgraph | osmgraph/main.py | Python | mit | 3,041 |
# pylint: disable=too-few-public-methods
"""State which governs the SANS compatibility mode. This is not part of the reduction itself and should be removed
once the transition to the new reducer is satisfactory and complete. This feature allows users to have the
two reduction approaches produce the exact same re... | ScreamingUdder/mantid | scripts/SANS/sans/state/compatibility.py | Python | gpl-3.0 | 2,226 |
import autocomplete_light
from django.conf.urls import patterns, include, url
from django.contrib import admin
from SCIng import settings
autocomplete_light.autodiscover()
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'SCIng.views.home', name='home'),
# url(r'^blog/', include(... | jesusgp22/scing | SCIng/urls.py | Python | gpl-2.0 | 710 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-30 19:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('bot', '0013_alertausuario_frecuencia'),
]
operations = [
migrations.RemoveField(
... | foxcarlos/decimemijobot | bot/respaldo/0014_remove_alertausuario_frecuencia.py | Python | gpl-3.0 | 406 |
# -*- coding: utf-8 -*-
"""
Authors: Gonzalo E. Espinoza-Dávalos
Contact: g.espinoza@un-ihe.org, gespinoza@utexas.edu
Repository: https://github.com/gespinoza/davgis
Module: davgis
Description:
This module is a python wrapper to simplify scripting and automation of common
GIS workflows used in water resources.
"""
fr... | wateraccounting/SEBAL | hants_old/wa_gdal/davgis/functions.py | Python | apache-2.0 | 29,458 |
from django.test import TestCase
from django.test.utils import override_settings
from rest_framework import status
from rest_framework.test import APIClient
from axes.signals import user_locked_out
import json
import time
from family_tree.models.family import Family
from family_tree.models.person import Person
from cu... | JustinWingChungHui/MyFamilyRoot | auth_api/tests.py | Python | gpl-2.0 | 5,613 |
"""Argument parsing."""
import argparse
from encarne.stats import show_stats, clean_movies
# Specifying commands
parser = argparse.ArgumentParser(
description='Encarne reencoder')
parser.add_argument(
'-d', '--directory', type=str,
help='Directory that should be explored for video container to be encoded.... | Nukesor/encarne | encarne/argument_parser.py | Python | mit | 1,664 |
# Copyright 2011-12 Michael Thomas
#
# See www.whatang.org for more information.
#
# This file is part of DrumBurp.
#
# DrumBurp 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,... | Whatang/DrumBurp | src/GUI/QMeasureLine.py | Python | gpl-3.0 | 9,326 |
from django.contrib import admin
from .models import (
CatalogoTipoAlumno,
TablaAlumno,
CatalogoEstadoSolicitud,
CatalogoTipoDocumento,
TablaSolicitud,
TablaCambioSolicitud
)
@admin.register(CatalogoTipoAlumno)
class AdminCatalogoTipoAlumno(admin.ModelAdmin):
list_display = ('id','tipo',)
... | CallmeTorre/Idalia | ESCOM/Ventanilla/admin.py | Python | apache-2.0 | 1,129 |
#!/usr/bin/env python
import os, time, requests, argparse, datetime
def main():
parser = argparse.ArgumentParser(description='Download all PrairieLearn course data as JSON via the API')
parser.add_argument('-t', '--token', required=True, help='the API token from PrairieLearn')
parser.add_argument('-i', '-... | PrairieLearn/PrairieLearn | tools/api_download.py | Python | agpl-3.0 | 5,246 |
#!/usr/bin/python
"""
.. module:: shellscribe
Shell-Scribe run.py
@author: Keith E. Miller <keithmiller@umass.edu>
Expected issues:
- cd command is shell-scribe specific so commands that use cd in a non-trivial
way might break the cd command
"""
import cmd
import os
import sys
import argparse as ap
import datetime
im... | keithemiller/shell-scribe | shell-scribe.py | Python | apache-2.0 | 12,528 |
# ext/preprocessors.py
# Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""preprocessing functions, used with the 'preprocessor'
argument on Template, TemplateLooku... | alanjw/GreenOpenERP-Win-X86 | python/Lib/site-packages/mako/ext/preprocessors.py | Python | agpl-3.0 | 586 |
import logging
from allauth.account.adapter import DefaultAccountAdapter
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
logger = logging.getLogger(__name__)
class NoNewUsersAccountAdapter(DefaultAccountAdapter):
def is_open_for_signup(self, request):
"""
Checks whether or ... | DemocracyClub/yournextrepresentative | ynr/account_adapter.py | Python | agpl-3.0 | 1,278 |
from django.conf.urls import patterns, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = patterns('',
url(r'^$', 'charts.views.chart_index', name='chart_index'),
url(r'^total_incomes/$', 'charts.views.total_incomes', name='total_incomes'),
url(r'^incomes/(?P<year>\d{4})/... | OscarPDR/projects_morelab | charts/urls.py | Python | gpl-3.0 | 781 |
# -*- coding: utf-8 -*-
"""
Test file question type.
"""
from tests.pyxform_test_case import PyxformTestCase
class FileWidgetTest(PyxformTestCase):
"""
Test file widget class.
"""
def test_file_type(self):
"""
Test file question type.
"""
self.assertPyxformXform(
... | XLSForm/pyxform | tests/test_file.py | Python | bsd-2-clause | 622 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The kernel density estimators.
"""
from __future__ import (division, print_function, absolute_import, unicode_literals)
import numpy as np
import numpy.ma as ma
from scipy import linalg as la
from scipy.cluster.vq import kmeans, vq
try:
from scipy.special import l... | bfarr/kombine | kombine/clustered_kde.py | Python | mit | 17,254 |
#!/usr/bin/python
#
#Copyright (C) 2011 by Venkata Pingali (pingali@gmail.com) & TCS
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the righ... | pingali/pyAadhaarAuth | bin/aadhaar-sample-client.py | Python | mit | 2,890 |
"""674. Longest Continuous Increasing Subsequence
https://leetcode.com/problems/longest-continuous-increasing-subsequence/
Given an unsorted array of integers nums, return the length of the longest
continuous increasing subsequence (i.e. subarray). The subsequence must be
strictly increasing.
A continuous increasing ... | isudox/leetcode-solution | python-algorithm/leetcode/problem_674.py | Python | mit | 1,398 |
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['ros2opencv'],
package_dir={'': 'src'},
)
setup(**setup_args) | vytasrgl/pi_vision | ros2opencv/setup.py | Python | gpl-2.0 | 309 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
import logging
import re
import time
import types
import openerp
from openerp import SUPERUSER_ID
from openerp import models, tools, api
from openerp.modules.registry import RegistryM... | Fl0rianFischer/sme_odoo | openerp/addons/base/ir/ir_model.py | Python | gpl-3.0 | 63,424 |
# -*- coding: utf-8 -*-
"""Create an application instance."""
from flask.helpers import get_debug_flag
from authmgr.app import create_app
#from authmgr.settings import DevConfig, ProdConfig
#CONFIG = DevConfig if get_debug_flag() else ProdConfig
app = create_app()
| bcarroll/authmgr | authmgr/autoapp.py | Python | bsd-3-clause | 268 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 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 copy of ... | opadron/girder | plugins/metadata_extractor/server/metadata_extractor.py | Python | apache-2.0 | 4,146 |
"""
Django settings for gateway 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, ...)
im... | davisk/gateway | configuration/settings.py | Python | mit | 3,183 |
"""
Get Information about the fields in a excel table
"""
def get_columns_position(sheet_object, cols_name):
"""
Given the name, find the column position in the file
cols_position = {
column_name: position_index, ...
}
"""
from gasp import goToList
cols_name = goToLis... | JoaquimPatriarca/senpy-for-gis | gasp/xls/fields.py | Python | gpl-3.0 | 1,736 |
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from repanier.const import PRODUCT_ORDER_UNIT_DEPOSIT
from repanier.models.product import Product
from rest_framework import serializers
from rest_framework.fields import DecimalField
class ProductSerializer(serial... | pcolmant/repanier | repanier/rest/product.py | Python | gpl-3.0 | 2,827 |
#!/usr/bin/env python3
#
# This is a VERY simple non-elegant Python script to scrape a Twitter Accounts
# followers.
# You'll need your OWN twitter OAuth keys.... login to http://apps.twitter.com
# to set this up.... ALSO you'll need to install the python tweepy module..
# because we are using the tweepy module to inte... | m00cat/twatterScripts | twatFollowersScraper.py | Python | gpl-3.0 | 2,733 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.