text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python3
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Software Foundation, either... | oliver-sanders/cylc | cylc/flow/scripts/play.py | Python | gpl-3.0 | 999 | 0 |
# 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 https://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.base import BaseRegion
class DownloadButton(BaseRegion):
... | mozilla/bedrock | tests/pages/regions/download_button.py | Python | mpl-2.0 | 947 | 0.003168 |
# coding: utf-8
"""
pyextend.core.math
~~~~~~~~~~~~~~~~~~
pyextend core math tools.
:copyright: (c) 2016 by Vito.
:license: GNU, see LICENSE for more details.
"""
def isprime(n):
"""Check the number is prime value. if prime value returns True, not False."""
n = abs(int(n))
if n < 2:
... | Vito2015/pyextend | pyextend/core/math.py | Python | gpl-2.0 | 643 | 0.001715 |
from django.shortcuts import render
from rest_framework import generics, serializers
from beacon.models import Inquiry, Reply
class InquirySerializer(serializers.ModelSerializer):
class Meta:
model = Inquiry
class ReplySerializer(serializers.ModelSerializer):
class Meta:
model = Reply
cl... | SorenOlegnowicz/tracker | tracker/api/views.py | Python | agpl-3.0 | 739 | 0.005413 |
#!~/envs/udacity_python3_mongodb
"""
$push is similar to $addToSet. The difference is that rather than accumulating only unique values
it aggregates all values into an array.
Using an aggregation query, count the number of tweets for each user. In the same $group stage,
use $push to accumulate all the tweet texts for... | francisrod01/wrangling_mongodb | lesson 9/using_push.py | Python | mit | 2,530 | 0.004348 |
#!/usr/bin/env python
# python-gphoto2 - Python interface to libgphoto2
# http://github.com/jim-easterbrook/python-gphoto2
# Copyright (C) 2015-19 Jim Easterbrook jim@jim-easterbrook.me.uk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | jim-easterbrook/python-gphoto2 | examples/read-exif-exifread.py | Python | gpl-3.0 | 3,776 | 0.001589 |
"""Support for Xiaomi Gateways."""
from datetime import timedelta
import logging
import voluptuous as vol
from xiaomi_gateway import XiaomiGateway, XiaomiGatewayDiscovery
from homeassistant import config_entries, core
from homeassistant.const import (
ATTR_BATTERY_LEVEL,
ATTR_DEVICE_ID,
ATTR_VOLTAGE,
... | sander76/home-assistant | homeassistant/components/xiaomi_aqara/__init__.py | Python | apache-2.0 | 12,713 | 0.000551 |
import time
from core import logger
from core.auto_process.common import ProcessResult
from core.auto_process.managers.sickbeard import SickBeard
import requests
class PyMedusa(SickBeard):
"""PyMedusa class."""
def __init__(self, sb_init):
super(PyMedusa, self).__init__(sb_init)
def _create_ur... | clinton-hall/nzbToMedia | core/auto_process/managers/pymedusa.py | Python | gpl-3.0 | 6,117 | 0.00327 |
# Para manipular a linha de comando
import os, sys, getopt, re
# Para manipular e validar arquivos XML
from lxml import etree
from lxml.etree import XMLSyntaxError, Element
# Quem é este pokemon?
from pokemon.pokemon import Pokemon
# Battle state schema file
bss = 'battle_state.xsd'
def usage():
"""Imprime inst... | andredalton/bcc | 2014/MAC0242/Projeto/battle.py | Python | apache-2.0 | 6,126 | 0.004255 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-kms | google/cloud/kms_v1/services/key_management_service/transports/grpc.py | Python | apache-2.0 | 50,118 | 0.001576 |
#!/usr/bin/env python
## app.py
import curses
import locale
import key_event
import key_move
import model
import edit
import copy
# global data holder
class App():
def __init__(self):
self.win = curses.initscr()
self.setup_window()
h, w = self.win.getmaxyx()
self.data = model.Model(w, h)
def se... | homma/terminal-dots | app.py | Python | mit | 2,068 | 0.024662 |
default_app_config = 'work.apps.WorkAppConfig'
| FreedomCoop/valuenetwork | work/__init__.py | Python | agpl-3.0 | 47 | 0 |
""" Python's random module includes a function choice(data) that returns a
random element from a non-empty sequence. The random module includes
a more basic function randrange, with parametrization similar to
the built-in range function, that return a random choice from the given
range. Using only the randrange functio... | claudiordgz/GoodrichTamassiaGoldwasser | ch01/r112.py | Python | mit | 3,148 | 0.000953 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import Queue
import signal
import sys
import os
import threading
import time
from ConfigParser import ConfigParser
from thread_manager import ThreadManager
from thread_mysql import ThreadMySQL
from thread_statsd import ThreadStatsd, ThreadFakeStatsd
clas... | spilgames/mysql-statsd | mysql_statsd/mysql_statsd.py | Python | bsd-3-clause | 5,234 | 0.004776 |
"""General-use classes to interact with the AppSync service through CloudFormation.
See Also:
`AWS developer guide for AppSync
<https://docs.aws.amazon.com/appsync/latest/devguide/welcome.html>`_
"""
# noinspection PyUnresolvedReferences
from .._raw import appsync as _raw
# noinspection PyUnresolvedReference... | garyd203/flying-circus | src/flyingcircus/service/appsync.py | Python | lgpl-3.0 | 351 | 0.002849 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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 o... | robocomp/robocomp-robolab | components/localization/UWBpublisher/src/specificworker.py | Python | gpl-3.0 | 6,357 | 0.002832 |
#Copyright (C) 2012 Excensus, LLC.
#
#This file is part of PlanetWoo.
#
#PlanetWoo 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) any later version.
#
#Plan... | blc56/PlanetWoo | tiletree/multi.py | Python | gpl-3.0 | 4,546 | 0.031236 |
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.lines import lineStyles
Light_cnames={'mistyrose':'#FFE4E1','navajowhite':'#FFDEAD','seashell':'#FFF5EE','papayawhip':'#FFEFD5','blanchedalmond':'#FFEBCD','white':'#FFFFFF','mintcream':'#F5FFFA','antiquewhite':'#FAEBD7','moccasin':'#FFE4B5','ivory':'#F... | newera912/WeatherTransportationProject | target/classes/edu/albany/cs/transWeatherPy/plotMesonetOrgData.py | Python | gpl-2.0 | 43,328 | 0.03882 |
from . import mp2
from .mp2 import RMP2
| sunqm/mpi4pyscf | mpi4pyscf/mp/__init__.py | Python | gpl-3.0 | 40 | 0 |
"""
============================================================
Empirical evaluation of the impact of k-means initialization
============================================================
Evaluate the ability of k-means initializations strategies to make
the algorithm convergence robust as measured by the relative stan... | DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/examples/cluster/plot_kmeans_stability_low_dim_dense.py | Python | mit | 4,324 | 0.001619 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import os
long_description = open("README.rst").read()
install_requires = ['numpy>=1.3.0',
'quantities>=0.9.0']
if os.environ.get('TRAVIS') == 'true' and \
os.environ.get('TRAVIS_PYTHON_VERSION').startswith('2.6'):
... | mschmidt87/python-neo | setup.py | Python | bsd-3-clause | 1,476 | 0.01355 |
# Copyright 2016 Hewlett Packard Enterprise Development Company, LP
#
# 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 ap... | bigswitch/neutron | neutron/tests/unit/services/trunk/test_db.py | Python | apache-2.0 | 1,965 | 0 |
from __future__ import print_function
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016,2017
import sys
import sysconfig
import inspect
if sys.version_info.major == 2:
import funcsigs
import imp
import glob
import os
import shutil
import argparse
import subprocess
import xml.etree.ElementTree as ET
im... | IBMStreams/streamsx.topology | test/python/spl/tk17/opt/.__splpy/packages/streamsx/scripts/extract.py | Python | apache-2.0 | 18,964 | 0.008437 |
# Copyright (c) 2010-2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
#
# 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, includin... | catapult-project/catapult | third_party/gsutil/gslib/vendored/boto/boto/cloudformation/__init__.py | Python | bsd-3-clause | 2,185 | 0 |
# ----------------------------------------------------------------------------
# Copyright (c) 2017-, LabControl development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -------------------------------------------------... | jdereus/labman | labcontrol/gui/handlers/plate.py | Python | bsd-3-clause | 9,784 | 0 |
from stations.models import OpticFilter, Brand, Product, Device, SensorCalibration, Position, Station, Configuration, Measurement
from tastypie import fields
from tastypie.authentication import SessionAuthentication
from tastypie.resources import ModelResource
from tastypie_polymorphic import PolymorphicModelResource
... | gersolar/stations | stations/api.py | Python | mit | 2,047 | 0.020029 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/droid/shared_binary_load_lifter_droid_chassis.iff"
result... | anhstudios/swganh | data/scripts/templates/object/tangible/component/droid/shared_binary_load_lifter_droid_chassis.py | Python | mit | 510 | 0.043137 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Loic Blot <loic.blot@unix-experience.fr>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.... | jbenden/ansible | lib/ansible/modules/monitoring/logstash_plugin.py | Python | gpl-3.0 | 4,754 | 0.001472 |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | luzheqi1987/nova-annotation | nova/tests/unit/api/openstack/compute/contrib/test_simple_tenant_usage.py | Python | apache-2.0 | 21,262 | 0.000282 |
# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | cloudbase/neutron-virtualbox | neutron/tests/sub_base.py | Python | apache-2.0 | 5,363 | 0 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 - 2016 CoNWeT Lab., Universidad Politécnica de Madrid
# This file belongs to the business-charging-backend
# of the Business API Ecosystem.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License... | FIWARE-TMForum/business-ecosystem-charging-backend | src/wstore/ordering/models.py | Python | agpl-3.0 | 4,227 | 0.000237 |
from JumpScale import j
try:
import ujson as json
except:
import json
class CacheFactory:
def __init__(self):
self.__jslocation__ = "j.tools.cache"
def get(self, db, expiration=300):
"""
db is keyvalue stor to use
e.g. j.tools.cache.get(j.servers.kvs.getRedisStore(na... | Jumpscale/jumpscale_core8 | lib/JumpScale/tools/cache/Cache.py | Python | apache-2.0 | 1,412 | 0.000708 |
#!/usr/bin/env python
import platform
import time
import numpy
from pyscf import lib
from pyscf.dft import uks
from mpi4pyscf.lib import logger
from mpi4pyscf.scf import uhf as mpi_uhf
from mpi4pyscf.dft import rks as mpi_rks
from mpi4pyscf.tools import mpi
comm = mpi.comm
rank = mpi.rank
@lib.with_doc(uks.get_vef... | sunqm/mpi4pyscf | mpi4pyscf/dft/uks.py | Python | gpl-3.0 | 4,017 | 0.000498 |
from datetime import timedelta
from decimal import Decimal
import pytest
from bs4 import BeautifulSoup
from django.core.files.uploadedfile import SimpleUploadedFile
from django.utils.timezone import now
from pretix.base.models import (
Event, EventPermission, Item, Order, OrderPosition, Organizer, Quota, User,
)
... | Flamacue/pretix | src/tests/plugins/banktransfer/test_import.py | Python | apache-2.0 | 4,988 | 0.001405 |
import sys
import codecs
from textblob import Blobber
from textblob.wordnet import Synset
from textblob.en.np_extractors import ConllExtractor
from collections import Counter
import re
from nltk.corpus import wordnet as wn
from nltk.corpus.reader import NOUN
import os
import string
import itertools
from nltk.corpus imp... | darenr/MOMA-Art | extract_concepts/concepts.py | Python | mit | 2,123 | 0.021667 |
"""
The *_font_gradient.pdf files have 16 slides that contain a different
sized text:
* the first slide contains 1/1 sized text - the text is as high as
the page
* the second slide contains 1/2 sized text - the text is twice smaller than
the page
* ...
* the 16th slide contains 1/16 sized text - t... | enkidulan/slidelint | src/slidelint/tests/checkers/font_size/TestCheckerFontSize.py | Python | apache-2.0 | 13,339 | 0.000075 |
"""
Tests for Blocks Views
"""
import json
import ddt
from django.test import RequestFactory, TestCase
from django.core.urlresolvers import reverse
import httpretty
from student.tests.factories import UserFactory
from third_party_auth.tests.utils import ThirdPartyOAuthTestMixin, ThirdPartyOAuthTestMixinGoogle
from ... | ampax/edx-platform | lms/djangoapps/oauth_dispatch/tests/test_views.py | Python | agpl-3.0 | 9,406 | 0.001701 |
#!/usr/bin/python2
# vim: sts=4 sw=4 et
import gtk
class GladeBuilder:
""" This is wrapper around Glade object that behaves just like gtk.Builder """
def __init__(self, glade):
self.glade = glade
def get_object(self, name):
return self.glade.get_widget(name)
def get_objects(self):
... | strahlex/machinekit | lib/python/gladevcp/gladebuilder.py | Python | lgpl-2.1 | 852 | 0.003521 |
# Summary text hub
#
# Copyright (C) 2012 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the h... | kparal/anaconda | pyanaconda/ui/tui/hubs/summary.py | Python | gpl-2.0 | 5,735 | 0.001918 |
# 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 | 0.002176 |
from __future__ import print_function
try:
import atpy
atpyOK = True
except ImportError:
atpyOK = False
# rewrite this garbage
class write_txt(object):
def __init__(self, Spectrum):
self.Spectrum = Spectrum
def write_data(self, clobber = True):
"""
Write all fit informatio... | mikelum/pyspeckit | pyspeckit/spectrum/writers/txt_writer.py | Python | mit | 1,770 | 0.011864 |
# Copyright 2019 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/ops/linalg/linear_operator_toeplitz.py | Python | apache-2.0 | 11,235 | 0.003115 |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
################################################################################
#
# Method call parameters/return value type checking decorators.
# (c) 2006-2007, Dmitry Dvoinikov <dmitry@targeted.org>
# Distributed under BSD license.
#
# Samples:
#
# from typecheck i... | wezs/uktils | uktils/third/aspn426123.py | Python | gpl-2.0 | 14,222 | 0.006961 |
# 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 | 0.039326 |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | Beckhoff/ADS | doc/source/conf.py | Python | mit | 2,430 | 0.000412 |
import _plotly_utils.basevalidators
class OpacitysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="opacitysrc", parent_name="scattercarpet.marker", **kwargs
):
super(OpacitysrcValidator, self).__init__(
plotly_name=plotly_name,
pa... | plotly/python-api | packages/python/plotly/plotly/validators/scattercarpet/marker/_opacitysrc.py | Python | mit | 474 | 0.00211 |
# Copyright 2014 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 ... | CSCI1200Course/csci1200OnlineCourse | tests/functional/modules_data_source_providers.py | Python | apache-2.0 | 14,954 | 0.000134 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | nzlosh/st2 | st2api/st2api/controllers/v1/traces.py | Python | apache-2.0 | 2,445 | 0.000818 |
"""The tests for the DirecTV Media player platform."""
from datetime import datetime, timedelta
from typing import Optional
from pytest import fixture
from homeassistant.components.directv.media_player import (
ATTR_MEDIA_CURRENTLY_RECORDING,
ATTR_MEDIA_RATING,
ATTR_MEDIA_RECORDED,
ATTR_MEDIA_START_TI... | pschmitt/home-assistant | tests/components/directv/test_media_player.py | Python | apache-2.0 | 14,615 | 0.000479 |
# Copyright (C) 2016 Statoil ASA, Norway.
#
# This file is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 ... | Ensembles/ert | python/python/ert/enkf/config/field_type_enum.py | Python | gpl-3.0 | 1,042 | 0.004798 |
#-
# Copyright (c) 2013 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BER... | 8l/beri | cheritest/trunk/tests/fpu/test_raw_fpu_div_d32.py | Python | apache-2.0 | 1,767 | 0.003962 |
#!/usr/bin/env python
import fileinput
import sys
import re
t0first=len(sys.argv) < 2 or sys.argv[1] != "1"
t0firstLayers=sys.argv[2:]
if len(t0firstLayers) == 0:
t0firstLayers=map(str,range(0,1000))
# t0firstLayers=["0"]
numeric="([-+]?(?:(?: \d* \. \d+ )|(?: \d+ \.? )))"
rX=re.compile("X"+numeric,re.VERBOS... | vectorgraphics/robox | bin/firstnozzle.py | Python | gpl-3.0 | 5,461 | 0.027467 |
# Django settings for example_project project.
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import django
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Justin Quick', 'justquick@gmail.com'),
)
ENGINE = os.environ.get('DATABASE_ENGINE', 'django.db.ba... | hiepthai/django-activity-stream | actstream/runtests/settings.py | Python | bsd-3-clause | 3,999 | 0.00075 |
# -*- coding: iso-8859-1 -*-
from gi.repository import Gtk, Gdk
class CreateNotebookDialog:
def __init__(self):
self.builder = Gtk.Builder()
self.builder.add_from_file("dialogs/createNotebook.glade")
self.window = self.builder.get_object("window1")
self.builder.connect_signals(sel... | biberino/notes | dialogs/createNotebook.py | Python | mit | 708 | 0.007062 |
#!/usr/bin/python
#
# Generic script to check how many images exist on the host
#
import sys
import json
import subprocess
# Configuration mode: return the custom metrics data should be defined
def config():
settings = {
"maxruntime": 30000, # How long the script is allowed to run
"period": 60, ... | CoScale/coscale-generic-scripts | docker/docker-images.py | Python | bsd-3-clause | 1,250 | 0.0056 |
#!Measurement
'''
baseline:
after: true
before: false
counts: 120
detector: H1
mass: 34.2
settling_time: 15.0
default_fits: nominal
equilibration:
eqtime: 40
inlet: R
inlet_delay: 3
outlet: O
use_extraction_eqtime: false
multicollect:
counts: 400
detector: H1
isotope: Ar40
peakcenter:
afte... | USGSDenverPychron/pychron | docs/user_guide/operation/scripts/examples/argus/measurement/jan_unknown400_120_HT_off.py | Python | apache-2.0 | 2,553 | 0.017235 |
# encoding: utf-8
import json
import pytest
from pytest_factoryboy import LazyFixture, register
from . import factories
@pytest.fixture
def elements(fixture):
return json.loads(fixture('simple_form.json'))['form']['elements']
register(factories.FormDataFactory, 'form', elements=LazyFixture('elements'))
regist... | transcode-de/hopper | tests/form_data_tests/conftest.py | Python | bsd-3-clause | 396 | 0.002525 |
#
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os, mimetypes, re, cgi, copy
import webutil
from mercurial... | hekra01/mercurial | mercurial/hgweb/webcommands.py | Python | gpl-2.0 | 43,136 | 0.001437 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 mulhern <amulhern@redhat.com>
# 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 Foundation; either version 2.1 of the License, or (at your
# option) any la... | schlizbaeda/yamuplay | pyudev/src/pyudev/_ctypeslib/__init__.py | Python | gpl-3.0 | 974 | 0 |
#!/usr/bin/env python
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# 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 ... | ericlink/adms-server | playframework-dist/play-1.1/python/Lib/Cookie.py | Python | mit | 26,007 | 0.01019 |
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S+00:00'
| liveblog/liveblog | server/liveblog/tests/test_settings.py | Python | agpl-3.0 | 40 | 0 |
def main():
s=raw_input()
if s.isdigit():
print "True"
else:
print "False"
main()
| kumarisneha/practice_repo | techgig/techgig_isnumeric.py | Python | mit | 117 | 0.025641 |
# -*- coding: utf-8 -*-
# Recall is a program for storing bookmarks of different things
# Copyright (C) 2012 Cal Paterson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version... | calpaterson/recall | src/recall/search.py | Python | agpl-3.0 | 7,881 | 0.003936 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | VitalPet/c2c-rd-addons | c2c_budget_chricar/wizard/chart.py | Python | agpl-3.0 | 12,006 | 0.010082 |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:9447")
pwd = raw_input("Enter old wallet passphrase: ")
pwd2 = raw_input("Enter new wallet passphrase: ")
access.walletpassphrasechange(pwd, pwd2)
| IlfirinIlfirin/shavercoin | contrib/wallettools/walletchangepass.py | Python | mit | 220 | 0 |
import unittest
from streamlink.plugins.senategov import SenateGov
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlSenateGov(PluginCanHandleUrl):
__plugin__ = SenateGov
should_match = [
"https://www.foreign.senate.gov/hearings/business-meeting-082218"
"https://www.se... | amurzeau/streamlink-debian | tests/plugins/test_senategov.py | Python | bsd-2-clause | 827 | 0.002418 |
"""
Builds out and synchronizes yum repo mirrors.
Initial support for rsync, perhaps reposync coming later.
Copyright 2006-2007, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.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
th... | colloquium/cobbler | cobbler/action_reposync.py | Python | gpl-2.0 | 22,241 | 0.006519 |
from __future__ import print_function
import sys
import dbdb
OK = 0
BAD_ARGS = 1
BAD_VERB = 2
BAD_KEY = 3
def usage():
print("Usage:", file=sys.stderr)
print("\tpython -m dbdb.tool DBNAME get KEY", file=sys.stderr)
print("\tpython -m dbdb.tool DBNAME set KEY VALUE", file=sys.stderr)
print("\tpython... | yntantan/beetles | dbdb/tool.py | Python | apache-2.0 | 1,012 | 0 |
#
# Autogenerated by Thrift Compiler (0.7.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
from ttypes import *
VERSION = "19.35.0"
| driftx/Telephus | telephus/cassandra/constants.py | Python | mit | 187 | 0 |
"""
WSGI config for reviews project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | uday12kumar/myreview | reviews/reviews/wsgi.py | Python | mit | 1,422 | 0.000703 |
#-*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | deKupini/erp | addons/project_issue/project_issue.py | Python | agpl-3.0 | 30,662 | 0.004925 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# CherryMusic - a standalone music server
# Copyright (c) 2012 - 2014 Tom Wallroth & Tilman Boerner
#
# Project page:
# http://fomori.org/cherrymusic/
# Sources on github:
# http://github.com/devsnd/cherrymusic/
#
# CherryMusic is based on
# jPlayer (GPL/MIT licens... | andpp/cherrymusic | cherrymusicserver/service.py | Python | gpl-3.0 | 7,773 | 0.000129 |
import os
import unittest
import tempfile
from diff_rulekeys import *
class MockFile(object):
def __init__(self, lines):
self._lines = lines
def readlines(self):
return self._lines
class TestRuleKeyDiff(unittest.TestCase):
def test_key_value_diff(self):
list_diff = KeyValueDiff... | daedric/buck | scripts/diff_rulekeys_test.py | Python | apache-2.0 | 11,725 | 0.000597 |
"""Test Home Assistant template helper methods."""
import asyncio
from datetime import datetime
import unittest
import random
import math
import pytz
from unittest.mock import patch
from homeassistant.components import group
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import template
... | MartinHjelmare/home-assistant | tests/helpers/test_template.py | Python | apache-2.0 | 39,409 | 0 |
import os
import unittest
from vsg.rules import package
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_001_test_input.vhd'))
dIndentMap = utils.read_indent_file()
lExpected = []
lExpected.append('')
... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/package/test_rule_001.py | Python | gpl-3.0 | 1,229 | 0.004068 |
{"ifconfig":
{
"lo0": dict(
interfaceName='lo0',
mtu=8232,
operStatus=1,
adminStatus=1,
compname="os", ),
"xnf0": dict(
interfaceName='xnf0',
mtu=1500,
operStatus=1,
adminStatus=1,
speed=1000000000,
... | zenoss/ZenPacks.community.OpenSolaris | ZenPacks/community/OpenSolaris/tests/plugindata/Solaris/server3/ifconfig.py | Python | gpl-2.0 | 393 | 0.007634 |
# usr/bin/env python
"""
Created on Fri Jun 23
@author : Vijayasai S
"""
def DateMonthYear(data):
year = [] ; month = [] ; date = []
for index in range(len(data["packettimestamp"])):
year.append(int(data["packettimestamp"][index][0:4]))
month.append(int(data["packettimestamp"][index][5:7]))
date.append(int(da... | Vijaysai005/KProject | vijay/POI_RLE/timedate.py | Python | gpl-3.0 | 709 | 0.03385 |
from calendar import monthrange
from datetime import date
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.timezone import ... | flamingspaz/remo | remo/profiles/tasks.py | Python | bsd-3-clause | 5,501 | 0.000364 |
import operator
import numpy as np
from pandas._libs import index as libindex
from pandas import compat
from pandas.compat.numpy import function as nv
from pandas.core.dtypes.generic import ABCCategorical, ABCSeries
from pandas.core.dtypes.dtypes import CategoricalDtype
from pandas.core.dtypes.common import (
is_... | louispotok/pandas | pandas/core/indexes/category.py | Python | bsd-3-clause | 31,573 | 0 |
#!/usr/bin/env python
import unittest
from pentai.base.game_state import *
from pentai.base.game import *
import pentai.base.player as p_m
from pentai.base.rules import *
from pentai.ai.rot_standardise import *
class RotStandardiseTest(unittest.TestCase):
def setUp(self):
self.rules = Rules(9, "standard"... | cropleyb/pentai | pentai/ai/t_rot_standardise.py | Python | mit | 11,292 | 0.005756 |
import unittest
import os.path as op
import sys
import os
from methylcoder.fastqindex import FastQIndex, FastaIndex, FastQEntry, FastaEntry, guess_index_class
import bsddb
PATH = op.dirname(__file__)
DATA = op.join(PATH, "data")
class GuesserTest(unittest.TestCase):
def setUp(self):
self.fastq = op.join(D... | brentp/methylcode | methylcoder/tests/test_index.py | Python | bsd-3-clause | 2,099 | 0.003335 |
# -*- coding: utf-8 -*-
__version__ = '0.5.0'
request_post_identifier = 'current_aldryn_blog_entry'
| aldryn/aldryn-blog | aldryn_blog/__init__.py | Python | bsd-3-clause | 100 | 0 |
# testing/requirements.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Global database feature support policy.
Provides decorators to mark tests ... | michaelBenin/sqlalchemy | lib/sqlalchemy/testing/requirements.py | Python | mit | 17,967 | 0.001169 |
import re
import json
import flask
_URIPATH_REGEX = re.compile(r'http[s]?://[^/]+/(.*)')
def new_blueprint(github, basic_auth):
blueprint = flask.Blueprint('api', __name__, url_prefix='/api')
@blueprint.route('/status')
@basic_auth.required
def status():
data = {}
user = github.ge... | rhlobo/github_jackdaw | server/blueprints/api.py | Python | mit | 2,205 | 0.006349 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#Uncomment to debug. If you aren't me, I bet you want to change the paths, too.
import sys
from wsnamelet import wsnamelet_globals
if wsnamelet_globals.debug:
sys.stdout = open ("/home/munizao/hacks/wsnamelet/debug.stdout", "w", buffering=1)
sys.stderr = open ("/ho... | munizao/mate-workspace-name-applet | wsname_applet.py | Python | gpl-2.0 | 7,780 | 0.0063 |
import tarfile
import time
import os
import json
class BackupTool(object):
"""Simple backup utility."""
def __init__(self):
pass
@staticmethod
def backup(openbazaar_installation_path,
backup_folder_path,
on_success_callback=None,
on_error_callback... | atsuyim/OpenBazaar | node/backuptool.py | Python | mit | 4,817 | 0 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
from ulakbus.models import AbstractRole
from ulakbus.models import Personel
from ulakbus.models import Role
from zengine.views.crud import CrudView
from z... | zetaops/ulakbus | ulakbus/views/bap/bap_iletisim.py | Python | gpl-3.0 | 1,146 | 0 |
# -*- coding: utf-8 -*-
"""
Created on 2017/3/24
@author: will4906
"""
# from logbook import Logger
# from service import log
# # # from service.account import *
# # # from service.proxy import *
# #
# # logger = Logger('main')
# #
# # if __name__ == '__main__':
# # # stupid()
# # # update_proxy()
# # # n... | will4906/PatentCrawler | service/__init__.py | Python | apache-2.0 | 413 | 0.002421 |
from putlocker import Putlocker
putlocker = Putlocker()
series = putlocker.search('Gold Rush')
serie = series[0]
print(serie.getName())
print(serie.getImageUrl())
print(serie.url)
print('-' * 80)
seasons = serie.getSeasons()
season = seasons[0]
episodes = season.getEpisodes()
for episode in episodes:
print(episod... | tomsik68/kodi-putlocker-tvshows | examples/putlockertest.py | Python | mit | 357 | 0 |
# Copyright 2022 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | quantumlib/Cirq | cirq-core/cirq/transformers/target_gatesets/sqrt_iswap_gateset_test.py | Python | apache-2.0 | 13,585 | 0.001914 |
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Zheqi he, Xinlei Chen, based on code from Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
from __fu... | junranhe/tf-faster-rcnn | tools/test_net.py | Python | mit | 3,912 | 0.016616 |
# -*- coding: utf-8 -*-
#
# test_weights_as_lists.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 2 of the L... | SepehrMN/nest-simulator | pynest/nest/tests/test_weights_as_lists.py | Python | gpl-2.0 | 4,995 | 0.002002 |
"""The tests for the MQTT lock platform."""
import json
from unittest.mock import ANY
from homeassistant.components import lock, mqtt
from homeassistant.components.mqtt.discovery import async_start
from homeassistant.const import (
ATTR_ASSUMED_STATE,
STATE_LOCKED,
STATE_UNAVAILABLE,
STATE_UNLOCKED,
)
... | Teagan42/home-assistant | tests/components/mqtt/test_lock.py | Python | apache-2.0 | 20,567 | 0.000194 |
from datetime import date
from django.db import models
from django.test import TestCase
from django.contrib.auth.models import User
from turbion.bits.utils import merging
class MyProfile(models.Model):
user_ptr = models.ForeignKey(User, unique=True)
nickname = models.CharField(max_length=100)
www = model... | strogo/turbion | turbion/bits/utils/tests/merging.py | Python | bsd-3-clause | 2,375 | 0.002947 |
import os.path
def writeToFile(element):
if not os.path.exists("interestingThreads.txt"):
outF = open("interestingThreads.txt", "w")
outF.write(string)
outF.close()
else:
outF = open("interestingThreads.txt", "a")
outF.write(string)
outF.close()
de... | LeereNix/2chParser | optional.py | Python | bsd-3-clause | 553 | 0.003617 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | ravibhure/ansible | lib/ansible/modules/network/aci/aci_epg_monitoring_policy.py | Python | gpl-3.0 | 4,278 | 0.002338 |
"""
Django settings for fplbot project.
Generated by 'django-admin startproject' using Django 1.10.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
im... | dizzy54/fplbot | fplbot/settings.py | Python | mit | 4,120 | 0.001214 |
# ./MARC21relaxed.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:5e592dacc0cf5bbbe827fb7d980f3324ca92c3dc
# Generated 2016-12-21 00:24:34.092428 by PyXB version 1.2.4 using Python 2.7.12.final.0
# Namespace http://www.loc.gov/MARC21/slim
from __future__ import unicode_literals
import pyxb
import pyxb.binding
import... | PixelDragon/pixeldragon | MARC21relaxed.py | Python | apache-2.0 | 30,253 | 0.007074 |
from jroc.tasks.tokenizers.TokenizerTask import SentenceTokenizerTask, WordTokenizerTask
| domenicosolazzo/jroc | tests/tasks/tokenizers/__init__.py | Python | gpl-3.0 | 89 | 0.011236 |
import pprint
class Flinf(object):
"""Information about a generated flask application. By default, provides
the url map and configuration variables of the generated application. To
return additional information pass a list to requested.
:param requested: a list of information items to extract from th... | thrisp/flails | flask_flails/flinf.py | Python | mit | 2,087 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.