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
ksleg = "http://www.kslegislature.org/li" url = "%s/api/v11/rev-1/" % ksleg # These actions are from the KLISS API documentation, # and are in the same order as that table # The PDF is linked from this webpage, and changes name # based on the most recent API version: # http://www.kslegislature.org/klois/Pages/RESTianA...
openstates/openstates
openstates/ks/ksapi.py
Python
gpl-3.0
8,104
0.000123
"""Tests for the forms of the ``event_rsvp`` app.""" from django.test import TestCase from django.utils import timezone from django_libs.tests.factories import UserFactory from event_rsvp.forms import EventForm, GuestForm from event_rsvp.models import Event, Guest from event_rsvp.tests.factories import EventFactory ...
bitmazk/django-event-rsvp
event_rsvp/tests/forms_tests.py
Python
mit
3,796
0
# 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 agreed to in writing, ...
google/gazoo-device
gazoo_device/tests/unit_tests/nrf_matter_device_test.py
Python
apache-2.0
4,549
0.005056
from zen import * import unittest import os import os.path as path import tempfile class GMLTokenizerCase(unittest.TestCase): tok = gml_tokenizer.GMLTokenizer() codec = gml_codec.BasicGMLCodec() interp = gml_interpreter.GMLInterpreter(codec, tok) def test_basic_correct(self): tokens = [ ('keyOne', 0, 1),...
networkdynamics/zenlib
src/zen/tests/gml_interpreter.py
Python
bsd-3-clause
2,727
0.041437
from __future__ import absolute_import, print_function, division from mitmproxy import exceptions import pprint def _get_name(itm): return getattr(itm, "name", itm.__class__.__name__) class Addons(object): def __init__(self, master): self.chain = [] self.master = master ...
x2Ident/x2Ident_test
mitmproxy/mitmproxy/addons.py
Python
gpl-3.0
2,173
0
# Copyright (c) 2016 HuaWei, 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 writi...
openstack/zaqar
zaqar/storage/configuration.py
Python
apache-2.0
1,625
0
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozilla.org/MPL/ # # Softwa...
peterbe/configman
configman/tests/test_option.py
Python
bsd-3-clause
12,084
0.000248
""" Test of tracking and detector response. """ # pylint: disable=C0103 from ..detector import LayeredDetector from ..track import gen_straight_tracks from matplotlib import pyplot as plt def main(): """ Test if construction of detector works and propagate tracks through detector. """ A = LayeredD...
jepio/JKalFilter
test/test_track.py
Python
gpl-2.0
673
0.001486
import warnings import unittest import sys from nose.tools import assert_raises from gplearn.skutils.testing import ( _assert_less, _assert_greater, assert_less_equal, assert_greater_equal, assert_warns, assert_no_warnings, assert_equal, set_random_state, assert_raise_message) fro...
danbob123/gplearn
gplearn/skutils/tests/test_testing.py
Python
bsd-3-clause
3,785
0.000264
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2015 PyBuilder Team # # 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/l...
Danielweber7624/pybuilder
src/main/python/pybuilder/plugins/python/pep8_plugin.py
Python
apache-2.0
1,506
0.000664
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Nicira 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/lice...
wallnerryan/quantum_migrate
quantumclient/quantum/v2_0/nvp_qos_queue.py
Python
apache-2.0
2,899
0
# 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 may ...
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_express_route_circuit_peerings_operations.py
Python
mit
21,838
0.00522
__author__ = 'James DeVincentis <james.d@hexhost.net>' from .ipaddress import Ipaddress class Ipv6(Ipaddress): def __init__(self, *args, **kwargs): self._mask = None super(Ipv6, self).__init__(self, args, **kwargs) @property def mask(self): return self._mask @mask.setter ...
Danko90/cifpy3
lib/cif/types/observables/ipv6.py
Python
gpl-3.0
836
0.001196
#!/usr/bin/python import argparse from . import CLI from .utils import _list_files from .find import batchy_find from .update import batchy_update from .view import batchy_view def _batchy_find(args): return batchy_find(args.pattern, args.keys, args.replace, args.files) def _batchy_update(args): return ba...
jkloo/BatchY
batchy/cli.py
Python
mit
2,138
0.003274
import os import re import locale locale.setlocale(locale.LC_ALL, '') # decimals according to locale out_file_name = './logs/output_basic_constants.csv' sep_char_for_csv = '|' out_file = open(out_file_name, mode='w') out_file_full_path = os.path.abspath(out_file_name) def str_list_to_np_array_str(param): retur...
santiago-salas-v/walas
basic_constants_from_the_properties_of_gases_and_liquids.py
Python
mit
10,361
0.002124
#/usr/bin/env python3 import webtools as wt import os, crypt, cgitb cgitb.enable() modes = {"0": "no mode", "1": "lock", "2": "sticky", "3": "stickylock", "4": "permasage" } settings = "./settings.txt" b_conf = [] cd = {} with open(settings, "r") as settings: setting...
153/wbs
admin.py
Python
cc0-1.0
4,183
0.005259
# from cryptography import * from salmon import MagicSig from crypt import strip_whitespaces, b64_to_num, b64_to_str, b64encode, b64decode, generate_rsa_key, export_rsa_key from activitystreams import salmon, salmon1, salmon2, salmon3 from webfinger import WebfingerClient from convert import str_to_datetime, datetime_...
bijanebrahimi/pystatus
pystatus/libs/__init__.py
Python
gpl-3.0
331
0.003021
# This file is part of Maker Keeper Framework. # # Copyright (C) 2017-2018 reverendus # Copyright (C) 2018 bargst # # 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 3 of the...
makerdao/keeper
pymaker/numeric.py
Python
agpl-3.0
14,935
0.003348
#!/usr/bin/python '''Scrape a website using urllib2 (A library for pinging URLs) and BeautifulSoup (A library for parsing HTML)''' from bs4 import BeautifulSoup import urllib2 import time import sys import socket start_time = time.time() #Open files rfile = open("input.csv","r").read().splitlines() wfile = open("tran...
joelthe1/web-scraping
scrape-website-example-1.py
Python
mit
3,431
0.01195
"""Support for Modbus covers.""" from __future__ import annotations from datetime import timedelta from typing import Any from pymodbus.exceptions import ConnectionException, ModbusException from pymodbus.pdu import ExceptionResponse from homeassistant.components.cover import SUPPORT_CLOSE, SUPPORT_OPEN, CoverEntity...
w1ll1am23/home-assistant
homeassistant/components/modbus/cover.py
Python
apache-2.0
7,501
0.000533
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
google-research/google-research
basisnet/personalization/centralized_emnist/data_processing.py
Python
apache-2.0
4,786
0.006686
from __future__ import absolute_import import torch import torch.nn.functional as F from torch import nn, autograd class OIM(autograd.Function): def __init__(self, lut, momentum=0.5): super(OIM, self).__init__() self.lut = lut self.momentum = momentum def forward(self, inputs, target...
dapengchen123/code_v1
reid/loss/oim.py
Python
mit
1,727
0.000579
#!/usr/bin/env python # For python 2.6-2.7 from __future__ import print_function from os.path import * import re # from parseBrackets import parseBrackets from parseDirectiveArgs import parseDirectiveArguments class MyError(Exception): def __init__(self, value): self.value = value def __str__(self)...
LungNoodle/lungsim
tests/pFUnit-3.2.9/bin/pFUnitParser.py
Python
apache-2.0
34,426
0.011735
""" Copyright 2008-2016 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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 License, or (at your option) any l...
stwunsch/gnuradio
grc/core/Platform.py
Python
gpl-3.0
11,876
0.001347
#CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2016, Intel Corporation # #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; Version 2. # #This program is distributed in the hope...
chipsecintel/chipsec
source/tool/chipsec/cfg/__init__.py
Python
gpl-2.0
894
0.020134
<<<<<<< HEAD <<<<<<< HEAD # -*- coding: utf-8 -*- """Tests for distutils.archive_util.""" import unittest import os import sys import tarfile from os.path import splitdrive import warnings from distutils import archive_util from distutils.archive_util import (check_archive_formats, make_tarball, ...
ArcherSys/ArcherSys
Lib/distutils/tests/test_archive_util.py
Python
mit
35,333
0.002723
from tests import unittest from tests import mock from unbound_ec2 import server from tests import attrs class TestServer(server.Server): HANDLE_FORWARD_RESULT = 'dummy_handle_forward' HANDLE_PASS_RESULT = True DNSMSG = mock.MagicMock() def handle_request(self, _id, event, qstate, qdata, request_type...
unibet/unbound-ec2
tests/unit/test_server.py
Python
isc
6,080
0.002138
__author__ = 'jmoran' from Asteroids import Object class MovingObject(Object): def __init__(self, window, game, init_point, slope): Object.__init__(self, window, game) self.point = init_point self.slope = slope
waddedMeat/asteroids-ish
Asteroids/MovingObject.py
Python
mit
242
0
import os import numpy as np import sys label_file = open('/home/hypan/data/celebA/test.txt', 'r') lines = label_file.readlines() label_file.close() acc = np.zeros(40) cou = 0 for line in lines: info = line.strip('\r\n').split() name = info[0].split('.')[0] gt_labels = info[1: ] feat_path = '/home/hy...
last-one/tools
caffe/result/celeba_multilabel_acc.py
Python
bsd-2-clause
857
0.002334
from __future__ import absolute_import, print_function import petname import six import re from bitfield import BitField from uuid import uuid4 from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from django.utils.translation im...
beeftornado/sentry
src/sentry/models/projectkey.py
Python
bsd-3-clause
8,014
0.001497
# -*- coding: utf-8 -*- __author__ = 'eveliotc' __license__ = 'See LICENSE' import alfred from alfred import Item import sys from subprocess import Popen, PIPE def json_to_obj(x): if isinstance(x, dict): return type('X', (), {k: json_to_obj(v) for k, v in x.iteritems()}) else: return x def jo...
eveliotc/gradleplease-workflow
common.py
Python
apache-2.0
1,475
0.013559
from random import randrange import fractions def get_primes(n): numbers = set(range(n, 1, -1)) primes = [] while numbers: p = numbers.pop() primes.append(p) numbers.difference_update(set(range(p*2, n+1, p))) return primes def egcd(a, b): if a == 0: return (b, 0, 1) else: g, y, x =...
Qwaz/solved-hacking-problem
SharifCTF/2016/RSA-Keygen/generate-key.py
Python
gpl-2.0
2,346
0.020887
from django.utils.translation import ugettext_lazy as _ from crystal_dashboard.dashboards.crystal import dashboard import horizon class Controllers(horizon.Panel): name = _("Controllers") slug = 'controllers' dashboard.CrystalController.register(Controllers)
Crystal-SDS/dashboard
crystal_dashboard/dashboards/crystal/controllers/panel.py
Python
gpl-3.0
271
0
""" Abstract base for a specific IP transports (TCP or UDP). * It starts and stops a socket * It handles callbacks for incoming frame service types """ from __future__ import annotations from abc import ABC, abstractmethod import asyncio import logging from typing import Callable, cast from xknx.exceptions import Co...
XKNX/xknx
xknx/io/transport/ip_transport.py
Python
mit
3,449
0.00087
import re from copy import copy from random import randint class Server(object): def __init__(self, ip, port, hostname): self.ip = ip self.port = port self.hostname = hostname self.weight = 500 self.maxconn = None def __cmp__(self, other): if not isinstance(othe...
meltwater/proxymatic
src/proxymatic/services.py
Python
mit
5,559
0.002159
''' Created on Mar 28, 2017 @author: J001684 ''' from math import hypot class Vector: ''' classdocs ''' def __init__(self, x=0, y=0): ''' Constructor ''' self.x = x self.y = y def _repr_(self): return 'Vector({x}, {y...
domchoi/fluentPython
dataModel/vector.py
Python
gpl-3.0
743
0.014805
#!/usr/bin/env python # 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) 2015 Mozilla Corporation # # Contributors: # Aaron Meihm <ameihm@mozilla.com> fro...
serbyy/MozDef
alerts/unauth_ssh_pyes.py
Python
mpl-2.0
2,867
0.002093
# # Copyright (c) 2015 Juniper Networks, Inc. All rights reserved. # from gevent import monkey monkey.patch_all() import os import sys import socket import subprocess import json import time import datetime import platform import gevent import ConfigParser from nodemgr.common.event_manager import EventManager from p...
tcpcloud/contrail-controller
src/nodemgr/analytics_nodemgr/analytics_event_manager.py
Python
apache-2.0
2,984
0.008378
"""distutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.""" __revision__ = "$Id$" # XXX this module has *lots* of code ripped-off quite transparently from # build_ext.py -- not sur...
ktan2020/legacy-automation
win/Lib/distutils/command/build_clib.py
Python
mit
8,340
0.001439
import json import logging from functools import wraps logger = logging.getLogger(__name__) class PandaError(Exception): pass def error_check(func): @wraps(func) def check(*args, **kwargs): try: res = func(*args, **kwargs) if "error" in res: logger.error(re...
pandastream/panda_client_python
panda/models.py
Python
mit
5,728
0.005237
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-02-22 20:39 from __future__ import unicode_literals import time import logging import progressbar from django.db import connection, migrations from django.db.models import Q from django.contrib.contenttypes.models import ContentType from bulk_update.helper i...
caseyrollins/osf.io
addons/wiki/migrations/0010_migrate_node_wiki_pages.py
Python
apache-2.0
23,077
0.003467
# ~*~ coding: utf-8 ~*~ from __future__ import unicode_literals from django.conf.urls import url from rest_framework.routers import DefaultRouter from .. import api app_name = "audits" router = DefaultRouter() router.register(r'ftp-log', api.FTPLogViewSet, 'ftp-log') urlpatterns = [ ] urlpatterns += router.urls
eli261/jumpserver
apps/audits/urls/api_urls.py
Python
gpl-2.0
319
0
# -*- coding: utf-8 -*- import datetime import unittest import clowder import mock # import psutil class BaseClowderTestCase(unittest.TestCase): """Base class for all clowder test cases.""" def assert_send_contains_data(self, send_mock, key, value): """Assert that the given send mock was called wit...
keithhackbarth/clowder_python_client
tests.py
Python
gpl-2.0
6,224
0
# Copyright (c) 2013 Jose Cruz-Toledo # 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 rights # to use, copy, modify, merge, publish, dis...
jctoledo/ligandneighbours
ligandneighbours.py
Python
mit
10,769
0.023865
# -*- coding: utf-8 -*- # Future from __future__ import absolute_import, division, print_function, \ unicode_literals, with_statement # Standard Library from datetime import datetime # Third Party import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D # Load 3d plots ca...
cigroup-ol/metaopt
metaopt/plugin/visualization/best_fitness.py
Python
bsd-3-clause
1,969
0
#!/usr/bin/env python3 import fileinput import string import sys DELETE = '' REPLACE = {'“': '``', '”': '\'\'', '’': '\'', '\\': '\\textbackslash ', '*': '\\textasteriskcentered ', '_': '\\_', '#': '\\#', '$': '\\$', '%': '\\%', ...
st3f4n/latex-sanitizer
sanitize.py
Python
gpl-3.0
1,706
0
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-05 13:59 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('marketplace', '0012_auto_20170604_1335'), ] operation...
MOOCworkbench/MOOCworkbench
marketplace/migrations/0013_auto_20170605_1359.py
Python
mit
601
0.001664
import Base import VS import GUI import XGUITypes import XGUIDebug XGUIRootSingleton = None XGUIPythonScriptAPISingleton = None """----------------------------------------------------------------""" """ """ """ XGUIRoot - root management interface for th...
vegastrike/Assets-Production
modules/XGUI.py
Python
gpl-2.0
2,379
0.008407
# -*- coding: utf-8 -*- # # test_quantal_stp_synapse.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 th...
HBPNeurorobotics/nest-simulator
pynest/nest/tests/test_quantal_stp_synapse.py
Python
gpl-2.0
4,353
0
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager doc = DocumentManager.Instance.CurrentDBDocument faminstances = UnwrapElement(I...
andydandy74/ClockworkForDynamo
nodes/2.x/python/FamilyInstance.FlipFromToRoom.py
Python
mit
612
0.011438
import tests.periodicities.period_test as per per.buildModel((7 , 'T' , 1600));
antoinecarme/pyaf
tests/periodicities/Minute/Cycle_Minute_1600_T_7.py
Python
bsd-3-clause
82
0.04878
import re """Rules are based on Brunot & Bruneau (1949). """ estre_replace = [('^sereient$|^fussions$|^fussiens$|^sereies$|^sereiet$|^serïens$|^seriiez$|^fussiez$|^fussent$|^ierent$|^fustes$|^furent$|^ierent$|^sereie$|^seroie$|^sereit$|^seiens$|^seient$|^fusses$|^fussez$|^estant$|^seiens$|^somes$|^estes$|^ieres$|^ier...
LBenzahia/cltk
cltk/lemmatize/french/french.py
Python
mit
2,931
0.006188
# -*- coding: utf-8 -*- #=============================================================================== # # Copyright 2013 Horacio Guillermo de Oro <hgdeoro@gmail.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 ...
hgdeoro/GarnishMyPic
gmp/dnd.py
Python
gpl-3.0
4,062
0.003693
# -*- encoding: 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...
OpusVL/odoo
addons/account/wizard/account_change_currency.py
Python
agpl-3.0
3,683
0.003801
## www.pubnub.com - PubNub Real-time push service in the cloud. # coding=utf8 ## PubNub Real-time Push APIs and Notifications Framework ## Copyright (c) 2010 Stephen Blum ## http://www.pubnub.com/ import sys from pubnub import PubnubTornado as Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' subscri...
teddywing/pubnub-python
python-tornado/examples/here-now.py
Python
mit
1,031
0.007759
import string import random import webserver.views.api.exceptions def generate_string(length): """Generates random string with a specified length.""" return ''.join([random.SystemRandom().choice( string.ascii_letters + string.digits ) for _ in range(length)]) def reformat_date(value, fmt="%b %d,...
metabrainz/acousticbrainz-server
webserver/utils.py
Python
gpl-2.0
860
0.002326
# coding: utf-8 # ## Plot velocity from non-CF HOPS dataset # In[5]: get_ipython().magic(u'matplotlib inline') import netCDF4 import matplotlib.pyplot as plt # In[6]: url='http://geoport.whoi.edu/thredds/dodsC/usgs/data2/rsignell/gdrive/nsf-alpha/Data/MIT_MSEAS/MSEAS_Tides_20160317/mseas_tides_2015071612_2015081...
rsignell-usgs/notebook
HOPS/hops_velocity.py
Python
mit
830
0.03253
# SConsBuildFramework - Copyright (C) 2013, Nicolas Papier. # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation. # Author Nicolas Papier import os from src.sbfRsync import createRsyncAction from src.SConsBuildFramework import stringFormatter ...
npapier/sbf
src/sbfDoxygen.py
Python
gpl-3.0
6,169
0.041984
import os import re import asyncio import logging from collections import OrderedDict from pypeman.message import Message from pypeman.errors import PypemanConfigError logger = logging.getLogger("pypeman.store") DATE_FORMAT = '%Y%m%d_%H%M' class MessageStoreFactory(): """ Message store factory class can gener...
jrmi/pypeman
pypeman/msgstore.py
Python
apache-2.0
9,722
0.00288
# val for type checking (literal or ENUM style) from pyrser import fmt from pyrser.type_system.signature import * from pyrser.type_system.type_name import * class Val(Signature): """ Describe a value signature for the language """ nvalues = 0 valuniq = dict() def __init__(self, value, tret: s...
payet-s/pyrser
pyrser/type_system/val.py
Python
gpl-3.0
1,017
0
while(True): n = input() if(n == 42): break else: print n
aqfaridi/Code-Online-Judge
web/env/Main1145/Main1145.py
Python
mit
90
0.011111
import pandas as pd import numpy as np from swiftnav.ephemeris import * from swiftnav.single_diff import SingleDiff from swiftnav.gpstime import * def construct_pyobj_eph(eph): return Ephemeris( eph.tgd, eph.crs, eph.crc, eph.cuc, eph.cus, eph.cic, eph.cis, eph.dn, ep...
imh/gnss-analysis
gnss_analysis/mk_sdiffs.py
Python
lgpl-3.0
4,406
0.006809
#!/usr/bin/env python3 # 556A_zeroes.py - Codeforces.com/problemset/problem/556/A Zeroes quiz by Sergey 2015 # Standard modules import unittest import sys import re # Additional modules ############################################################################### # Zeroes Class ###################################...
snsokolov/contests
codeforces/556A_zeroes.py
Python
unlicense
2,674
0.000748
from __future__ import division from math import sqrt, cos, sin, acos, degrees, radians, log from collections import MutableSequence # This file contains classes for the different types of SVG path segments as # well as a Path object that contains a sequence of path segments. MIN_DEPTH = 5 ERROR = 1e-12 def segmen...
sqaxomonophonen/worldmapsvg
svg/path/path.py
Python
cc0-1.0
15,350
0.001303
# -*- coding: utf-8 -*- from django.db import models from tweets.models import Tweet class Tag(models.Model): name = models.CharField(max_length=255, unique=True, db_index=True) is_hashtag = models.BooleanField(default=False) tweets = models.ManyToManyField(Tweet, related_name='tags') class Meta: ...
kk6/onedraw
onedraw/tags/models.py
Python
mit
345
0
""" A simple module to get the links of first 10 images displayed on google image search """ from googleapiclient.discovery import build class GoogleImageSearch: def __init__(self,api_key,cse_id): self.my_api_key = api_key self.my_cse_id= cse_id def search(self,search_term,**kwargs): ...
shravan97/WordHunter
ImageSearch/image_searcher.py
Python
mit
775
0.023226
""" Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 7], you should return 4. Credits: Special thanks to @amrsaqr for adding this problem and creating all test cases. """ class Solution(object): def rangeBitwis...
urashima9616/Leetcode_Python
Leet201_BitwiswAndRange.py
Python
gpl-3.0
1,001
0.006993
# -*- coding: utf-8 -*- class GetText(): _file_path = None _body_list = None _target = None def __init__(self, file_path): #self._file_path = open(file_path, "r+").read().replace("<br","\n<br") self._file_path = file_path.replace("<br />", "<br />\n") #self._file_path = (se...
henriquesouza/toply
src/objects/GetText.py
Python
gpl-3.0
6,417
0.009512
#!/usr/local/munkireport/munkireport-python2 # encoding: utf-8 from . import display from . import prefs from . import constants from . import FoundationPlist from munkilib.purl import Purl from munkilib.phpserialize import * import subprocess import pwd import sys import hashlib import platform from urllib import ur...
munkireport/munkireport-php
public/assets/client_installer/payload/usr/local/munkireport/munkilib/reportcommon.py
Python
mit
17,507
0.000914
# -*- coding: utf-8 -*- # @Author: Marco Benzi <marco.benzi@alumnos.usm.cl> # @Date: 2015-06-07 19:44:12 # @Last Modified 2015-06-09 # @Last Modified time: 2015-06-09 16:07:05 # ========================================================================== # This program is free software: you can redistribute it and/or...
Lisergishnu/LTXKit
uStripDesign.py
Python
gpl-2.0
5,581
0.03064
from hiveplotter import HivePlot from networkx import nx import random from unittest import TestCase SEED = 1 NTYPES = ['A', 'B', 'C'] class SimpleCase(TestCase): def make_graph(self): G = nx.fast_gnp_random_graph(30, 0.2, seed=SEED) for node, data in G.nodes_iter(data=True): data[...
clbarnes/hiveplotter
test/simple_tests.py
Python
bsd-3-clause
882
0
import json import logging from django.contrib.auth.models import User from django.contrib.auth import login, authenticate, logout from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect, get_object_or_404 from django.http import HttpResponse from django.core.mail import...
macarthur-lab/xbrowse
xbrowse_server/base/views/account_views.py
Python
agpl-3.0
4,556
0.004829
import sys import math import wave import struct import curses import pyaudio import numpy as np import matplotlib.pyplot as plt # 'curses' configuration stdscr = curses.initscr() stdscr.nodelay(True) curses.noecho() curses.cbreak() # PyAudio object variable pa = pyaudio.PyAudio() # The mode the user chose with a sc...
loehnertz/rattlesnake
rattlesnake.py
Python
mit
15,227
0.001773
#!/usr/bin/env python # -*- coding: utf-8 -*- # # sorteddict.py # Sorted dictionary (implementation for Python 2.x) # # Copyright (c) 2010 Jan Kaliszewski (zuo) # # The MIT License: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (th...
ddurieux/alignak
alignak/sorteddict.py
Python
agpl-3.0
6,690
0.000149
import lxml.html from .bills import NHBillScraper from .legislators import NHLegislatorScraper from .committees import NHCommitteeScraper metadata = { 'abbreviation': 'nh', 'name': 'New Hampshire', 'capitol_timezone': 'America/New_York', 'legislature_name': 'New Hampshire General Court', 'legislatu...
cliftonmcintosh/openstates
openstates/nh/__init__.py
Python
gpl-3.0
3,210
0.005296
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt origin = 'lower' #origin = 'upper' delta = 0.025 x = y = np.arange(-3.0, 3.01, delta) X, Y = np.meshgrid(x, y) Z1 = plt.mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = plt.mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1) Z = 10 * (Z1 - Z2) nr,...
radiasoft/radtrack
radtrack/plot/contourf_demo.py
Python
apache-2.0
3,308
0.009069
# Copyright (c) 2010-2012 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 agree...
bkolli/swift
test/unit/proxy/test_sysmeta.py
Python
apache-2.0
16,039
0
from __future__ import print_function import datetime import sys import re import os import json import urlparse import fnmatch import functools import mock import lxml.html import requests from requests.adapters import HTTPAdapter from configman import Namespace from configman.converters import class_converter, str...
Tayamarn/socorro
socorro/cron/jobs/ftpscraper.py
Python
mpl-2.0
19,943
0.000301
import json from mock import patch from django.core.urlresolvers import reverse from django.core.files.uploadedfile import SimpleUploadedFile from student.tests.factories import UserFactory from biz.djangoapps.ga_invitation.tests.test_views import BizContractTestBase from biz.djangoapps.ga_manager.tests.factori...
nttks/edx-platform
biz/djangoapps/gx_org_group/tests/test_views.py
Python
agpl-3.0
34,785
0.003823
#!/usr/bin/env python # -*- coding: utf-8 -*- import serial import time import serial.tools.list_ports #import json import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import style from matplotlib.gridspec import GridSpec #from mpl_toolkits.mplot3d import Axes3D #import threading i...
Debaq/Triada
CP_Marcha/TUG.py
Python
gpl-3.0
8,883
0.014643
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from ..azure_common import BaseTest, arm_template class IoTHubTest(BaseTest): def setUp(self): super(IoTHubTest, self).setUp() def test_iot_hub_schema_validate(self): with self.sign_out_patch(): p = sel...
thisisshi/cloud-custodian
tools/c7n_azure/tests_azure/tests_resources/test_iot_hub.py
Python
apache-2.0
921
0
# from ..ocl import ApiResource # class ConceptClass(ApiResource): # def __init__(self): # super(ConceptClass, self).__init__() # self.names = [] # self.descriptions = [] # self.sources = []
kavasoglu/ocl_web
ocl_web/libs/ocl/concept_class.py
Python
mpl-2.0
229
0
"""engine.SCons.Platform.hpux Platform-specific initialization for HP-UX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 200...
bleepbloop/Pivy
scons/scons-local-1.2.0.d20090919/SCons/Platform/hpux.py
Python
isc
1,763
0.002836
# Copyright (c) 2012 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. import logging import os import sys from telemetry.core import browser_finder from telemetry.core import browser_options from telemetry.page import page_...
codenote/chromium-test
tools/telemetry/telemetry/page/page_test_runner.py
Python
bsd-3-clause
2,691
0.010777
# Copyright (c) 2019 Ansible Project # 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 class ModuleDocFragment(object): # Windows shell documentation fragment # FIXME: set_module...
privateip/ansible
lib/ansible/plugins/doc_fragments/shell_windows.py
Python
gpl-3.0
1,460
0.002055
# Copyright 2019 DeepMind Technologies Limited # # 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 agr...
deepmind/open_spiel
open_spiel/python/algorithms/psro_v2/meta_strategies.py
Python
apache-2.0
5,344
0.008046
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyNistats(PythonPackage): """Modeling and Statistical analysis of fMRI data in Python.""" ...
LLNL/spack
var/spack/repos/builtin/packages/py-nistats/package.py
Python
lgpl-2.1
1,272
0.002358
#! /usr/bin/env python # -*- coding: utf-8 -*- """Student CNN encoder for XE training.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from models.encoders.core.cnn_util import conv_layer, max_pool, batch_norm...
hirofumi0810/tensorflow_end2end_speech_recognition
models/encoders/core/student_cnn_xe.py
Python
mit
4,732
0.000634
import fbchat from fbchat import PageData def test_page_from_graphql(session): data = { "id": "123456", "name": "Some school", "profile_picture": {"uri": "https://scontent-arn2-1.xx.fbcdn.net/v/..."}, "url": "https://www.facebook.com/some-school/", "category_type": "SCHOOL"...
carpedm20/fbchat
tests/threads/test_page.py
Python
bsd-3-clause
669
0.001495
""" WSGI config for board 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.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "board.settings") from django.core.wsgi ...
Atom1c/home
board/board/wsgi.py
Python
unlicense
385
0.002597
# ********************************************************************************************* # Copyright (C) 2017 Joel Becker, Jillian Anderson, Steve McColl and Dr. John McLevey # # This file is part of the tidyextractors package developed for Dr John McLevey's Networks Lab # at the University of Waterloo. For mor...
networks-lab/tidyextractors
tidyextractors/tidymbox/mbox_to_pandas.py
Python
gpl-3.0
6,462
0.002787
from mpf.tests.MpfFakeGameTestCase import MpfFakeGameTestCase from unittest.mock import MagicMock, patch from mpf.tests.MpfTestCase import MpfTestCase class TestDropTargets(MpfTestCase): def get_config_file(self): return 'test_drop_targets.yaml' def get_machine_path(self): return 'tests/mac...
missionpinball/mpf
mpf/tests/test_DropTargets.py
Python
mit
18,577
0.001453
""" WSGI config for mysite6 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTI...
wasit7/PythonDay
django/mysite6/mysite6/wsgi.py
Python
bsd-3-clause
391
0
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2015 ERP|OPEN (www.erpopen.nl). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Aff...
rosenvladimirov/addons
product_barcodes_bg/__init__.py
Python
agpl-3.0
992
0.001008
#!/usr/bin/env python3 from configparser import ConfigParser from colorama import Fore, Back, Style import time import argparse import ast import pymysql if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("-c", "--config", help="JSON Config File with our Storage Info", required=True...
chalbersma/persist_transaction
archive.py
Python
gpl-3.0
3,154
0.045656
# griddata.py - 2010-07-11 ccampo import numpy as np def griddata(x, y, z, binsize=0.01, retbin=True, retloc=True): """ Place unevenly spaced 2D data on a grid by 2D binning (nearest neighbor interpolation). Parameters ---------- x : ndarray (1D) The idependent data x-axis of the g...
shaunwbell/FOCI_Analysis
temp/griddata.py
Python
mit
3,221
0.005899
# Copyright (C) 2006-2011, University of Maryland # # 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 rights # to use, copy, modify, merge,...
reflectometry/direfl
direfl/gui/simulation_page.py
Python
mit
41,666
0.002328
# 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...
coreycb/horizon
openstack_dashboard/dashboards/project/images/utils.py
Python
apache-2.0
3,845
0
# 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...
tensorflow/tpu
models/official/efficientnet/eval_ckpt_main.py
Python
apache-2.0
4,717
0.003604
import utils, TLV_utils from iso_7816_4_card import * import building_blocks class CardOS_Card(ISO_7816_4_Card,building_blocks.Card_with_ls): DRIVER_NAME = ["CardOS"] ATRS = [ ("3bf2180002c10a31fe58c80874", None), ] APDU_LIFECYCLE = C_APDU("\x00\xCA\x01\x83\x00") APDU_PHASE_CO...
12019/cyberflex-shell
cards/cardos_card.py
Python
gpl-2.0
4,862
0.005965