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
import re def balance(book): calc_lines = [] total_expense =0 book = re.sub("[^\w\d\.\s\n]", "", book) book = re.sub("\s{2,}", "\n", book) lines = book.splitlines() budget = float(lines.pop(0)) remains = budget for line in lines: line = line.split() balance = float...
e1r0nd/codewars
(6 kyu) Easy Balance Checking/(6 kyu) Easy Balance Checking.py
Python
mit
816
"""Tests for Table Schema integration.""" from collections import OrderedDict import json import numpy as np import pytest from pandas.core.dtypes.dtypes import ( CategoricalDtype, DatetimeTZDtype, PeriodDtype, ) import pandas as pd from pandas import DataFrame import pandas._testing as tm from pandas.i...
jorisvandenbossche/pandas
pandas/tests/io/json/test_json_table_schema.py
Python
bsd-3-clause
28,054
import ctypes import jaraco.windows.api.credential as api from . import error CRED_TYPE_GENERIC = 1 def CredDelete(TargetName, Type, Flags=0): error.handle_nonzero_success(api.CredDelete(TargetName, Type, Flags)) def CredRead(TargetName, Type, Flags=0): cred_pointer = api.PCREDENTIAL() res = api.CredRead(Targe...
clinton-hall/nzbToMedia
libs/win/jaraco/windows/cred.py
Python
gpl-3.0
546
# -*- coding: utf-8 -*- ## ## This file is part of INSPIRE. ## Copyright (C) 2015 CERN. ## ## INSPIRE 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) a...
ioannistsanaktsidis/inspire-next
inspire/base/format_elements/bfe_inspire_conferences_proc.py
Python
gpl-2.0
2,655
""" Provides support for the ClearCase configuration management system. It integrates into GPS's VCS support, and uses the same menus as all other VCS systems supported by GPS. You can easily edit this file if you would like to customize the cleartool commands that are sent for each of the menus. """ import GPS impor...
qunying/gps
share/support/core/vcs/clearcase.py
Python
gpl-3.0
3,645
"""A dumb and slow but simple dbm clone. For database spam, spam.dir contains the index (a text file), spam.bak *may* contain a backup of the index (also a text file), while spam.dat contains the data (a binary file). XXX TO DO: - seems to contain a bug when updating... - reclaim free space (currently, sp...
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Lib/dumbdbm.py
Python
gpl-3.0
5,187
# encoding: UTF-8 from vnpy.trader import vtConstant from ctpGateway import CtpGateway gatewayClass = CtpGateway gatewayName = 'CTP' gatewayDisplayName = 'CTP' gatewayType = vtConstant.GATEWAYTYPE_FUTURES gatewayQryEnabled = True
harveywwu/vnpy
vnpy/trader/gateway/ctpGateway/__init__.py
Python
mit
232
# Author: Hubert Kario, (c) 2016 # Jakub Jelen, (c) 2018 # Released under Gnu GPL v2.0, see LICENSE file for details from __future__ import print_function import traceback import sys import getopt from itertools import chain, islice from tlsfuzzer.runner import Runner from tlsfuzzer.messages import Connect, C...
mildass/tlsfuzzer
scripts/test-tls13-signature-algorithms.py
Python
gpl-2.0
31,758
#!/usr/bin/env python from __future__ import division, absolute_import, print_function from future.builtins import super from iris_sdk.models.account_users import AccountUsers from iris_sdk.models.available_npa_nxx import AvailableNpaNxx from iris_sdk.models.available_numbers import AvailableNumbers from iris_sdk.mod...
bandwidthcom/python-bandwidth-iris
iris_sdk/models/account.py
Python
mit
4,216
# 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 Gengeo(AutotoolsPackage): """GenGeo is a library of tools for creating complex particle ...
LLNL/spack
var/spack/repos/builtin/packages/gengeo/package.py
Python
lgpl-2.1
1,514
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_django-formaggio ------------ Tests for `django-formaggio` models module. """ from django.test import TestCase from formaggio import models class TestFormaggio(TestCase): def setUp(self): pass def test_something(self): pass def ...
scotu/django-formaggio
tests/test_models.py
Python
bsd-3-clause
348
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Responses/GetBuddyWalkedResponse.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message f...
favll/pogom
pogom/pgoapi/protos/POGOProtos/Networking/Responses/GetBuddyWalkedResponse_pb2.py
Python
mit
3,581
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio 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 ...
MSusik/invenio
invenio/modules/deposit/config.py
Python
gpl-2.0
1,862
"""Tests for the URL-generation aspect of :class:`Bundle`. However, URL generation that is associated with a special feature is more likely` found in `test_bundle_various.py``. """ from __future__ import with_statement from nose.tools import assert_raises, assert_equals from nose import SkipTest from webassets impo...
torchbox/webassets
tests/test_bundle_urls.py
Python
bsd-2-clause
11,956
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
ownport/ansiblite
src/ansiblite/utils/_text.py
Python
gpl-3.0
9,336
from sklearn.linear_model import LogisticRegression import Validation from sklearn import cross_validation import ModelTrainer import pandas as pd from sklearn.externals import joblib from sklearn.metrics import log_loss import numpy as np features = ModelTrainer.features def getModel(): return joblib.load('LR') ...
KenerChang/kaggle
sf_crime/LR.py
Python
mit
959
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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 import os import json import pytest import sys if sys.version_info < (2, ...
alxgu/ansible
test/units/modules/network/f5/test_bigip_ucs_fetch.py
Python
gpl-3.0
3,954
from __future__ import division from flask import Flask, request, session, redirect, url_for, \ render_template, jsonify, abort from collections import defaultdict import math import os import sys import importlib import traceback import time import datetime import re import json from functools import wraps import ...
BenHeubl/StoryMapJS
api.py
Python
mpl-2.0
27,450
#!/usr/bin/env python # # Copyright 2016 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 requir...
Aloomaio/googleads-python-lib
examples/adwords/v201806/reporting/parallel_report_download.py
Python
apache-2.0
8,581
#!/usr/bin/env python # _*_ coding: utf-8 _*_ ''' @Author : Soner @version : @Time : 2017/11/7/0007 21:35 @license : Copyright(C), Your Company ''' import urllib.request import urllib.parse import json import time from tkinter import * def translation(): content=text1.get(1.0,END) if content=='': ...
lsp84ch83/PyText
公开课/爬虫/fanyi.py
Python
gpl-3.0
1,731
# Copyright 2018 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
GoogleCloudPlatform/cloudspanner-ticketshop-demo
buybots/main.py
Python
apache-2.0
8,402
# Open EPW and STAT weather files together # # Ladybug: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari # # This file is part of Ladybug. # # Copyright (c) 2013-2015, Chris Mackey <Chris@MackeyArchitecture.com> # Ladybug is free software; you can redistribute it and/or modify # it...
boris-p/ladybug
src/Ladybug_Open EPW And STAT Weather Files.py
Python
gpl-3.0
7,729
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-09-14 10:36 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('organization_pages', '0043_custompage_separator'), ] operations = [ migrat...
Ircam-Web/mezzanine-organization
organization/pages/migrations/0044_custompage_display_content.py
Python
agpl-3.0
510
"""This module's main class reads a text corpus and assembles a list of n most common words.""" __author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>' __license__ = 'MIT License. See LICENSE.' from cltk.corpus.utils.formatter import assemble_tlg_author_filepaths from cltk.corpus.utils.formatter import assemble_phi...
mbevila/cltk
cltk/utils/frequency.py
Python
mit
2,334
# -*- coding: utf-8 -*- """ *************************************************************************** rgb2pct.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******************************...
nextgis/NextGIS_QGIS_open
python/plugins/processing/algs/gdal/rgb2pct.py
Python
gpl-2.0
2,612
from ckan.logic import validate from ckan.plugins import toolkit from ckanext.cadastaroles.logic import schema from ckanext.cadastaroles.logic.action.util import cadasta_get_api @toolkit.side_effect_free @validate(schema.cadasta_get_parcels_schema) def cadasta_show_parcel(context, data_dict): '''Make api call to...
okfn/ckanext-cadastaroles
ckanext/cadastaroles/logic/action/parcel.py
Python
agpl-3.0
3,615
# coding: utf-8 import copy import json from mock import Mock, PropertyMock, patch from tests.helpers import Handler, BaseTestCase, ServerMock, get_free_port, DatabaseMock from core.exceptions import CreationException, ConnectionError, \ SessionException, TimeoutException from core.config import setup_config, co...
2gis/vmmaster
tests/unit/test_commands.py
Python
mit
16,406
#!/usr/bin/env python import os from setuptools import setup, find_packages def read(filename): return open(os.path.join(os.path.dirname(__file__), filename)).read() setup( name='feincms-photos', version=__import__('photos').__version__, description='Photo gallery version 42', long_description=...
matthiask/feincms-photos
setup.py
Python
bsd-3-clause
1,759
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
stdweird/aquilon
lib/python2.6/aquilon/worker/commands/update_interface_machine.py
Python
apache-2.0
7,493
# Copyright 2016 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...
chenjun0210/tensorflow
tensorflow/python/tools/inspect_checkpoint.py
Python
apache-2.0
5,040
# 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...
ctrlaltdel/neutrinator
vendor/openstack/tests/functional/network/v2/test_flavor.py
Python
gpl-3.0
2,908
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 version 2 # of the License, or (at your option) any later version. # # This program is distrib...
michielkleinnijenhuis/NeuroBlender
utils.py
Python
gpl-3.0
23,305
#!/usr/bin/env python """ Select GeneSets from MSigDb using expression data from GTEx Pablo Cingolani 2013 """ import sys # Debug mode? debug = False # Value threshold minValue = float("-inf") maxValue = float("inf") #------------------------------------------------------------------------------ # Load MSigD...
NGSchool2016/ngschool2016-materials
src/snpEff/scripts/gsa/geneSetsGtex.py
Python
gpl-3.0
4,047
# -*- coding: utf-8 -*- import PyQt5.QtCore as Qc import PyQt5.QtGui as Qg import PyQt5.QtWidgets as Qw import sys import tedqt as qted #from PyQt5.QtCore import pyqtSlot class Test(Qw.QDialog): def __init__(self, db, parent=None): super().__init__() sq1 = "SELECT id || ' ' || lmp FROM lm WHERE i...
tedlaz/pyted
tederp/test_qted.py
Python
gpl-3.0
2,636
# coding: utf-8 # ## Load DCC Data # In[144]: from pandas import Series, DataFrame import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # In[145]: dfile = '../../zzData_RAW/2017-01-16-tc-dcc-scrub/order_comment.txt' hfile = '../../zzData_RAW/2017-01-16-tc-dcc-scrub/backord...
trevor-crowley/jnb_trump_train
develop/2017-01-17-tc-dcc-scrub.py
Python
mit
1,023
from setuptools import setup version = {} with open("timml/version.py") as fp: exec(fp.read(), version) l_d = "" try: import pypandoc l_d = pypandoc.convert("README.md", "rst") except: pass setup( name="timml", version=version["__version__"], description="Steady multi-layer AEM Model", ...
Hugovdberg/timml
setup.py
Python
mit
637
# coding: utf-8 # 😬 class RowHandler: def handle_row(self, row): """ handle_row(row) should return False to return to the base handler """ raise NotImplementedError("RowHandler.handle_row" " must be overridden by subclass") class BaseHandler(Ro...
kobotoolbox/kpi
kpi/utils/xlsform_preprocessors/base_handlers.py
Python
agpl-3.0
1,248
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 1 20:31:46 2017 @author: jeremy """ import pandas as pd import gmplot emp_addresses = pd.read_csv('employees_with_geocode.csv') bus_stops = pd.read_csv('Results.csv') gmap = gmplot.GoogleMapPlotter(37.75, -122.427325, 13) for index,row in em...
Jeremy123W/Optimizing-Employee-Shuttle-Stops
Scripts/Show_Results.py
Python
gpl-3.0
814
__author__ = 'Cedric Da Costa Faro' from flask.ext.wtf import Form from wtforms import StringField, TextAreaField, SubmitField from wtforms.ext.sqlalchemy.fields import QuerySelectField from wtforms.validators import Length, Required from wtforms.fields.html5 import DateField from ..models import Client import datetim...
cdcf/time_tracker
app/projects/forms.py
Python
bsd-3-clause
1,544
import unittest class TestSubcommands(unittest.TestCase): def test_show_defined_routes(self): pass
robertdfrench/psychic-disco
psychic_disco/tests/test_sucommands.py
Python
mit
113
""" Karl Persson, Mac OSX 10.8.4/Windows 8, Python 2.7.5, Pygame 1.9.2pre Class taking care of all file actions ingame - Levels - Textures - Sounds """ import pygame from pygame.locals import * import sys, Level, os, random # Class taking care of all file actions class FileManager: # Constructor...
KPRSN/Pulse
Pulse/FileManager.py
Python
mit
7,618
# coding: utf-8 """ Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 The version of the OpenAPI document: 1.1.2-pre.0 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unitte...
cliffano/swaggy-jenkins
clients/python-legacy/generated/test/test_null_scm.py
Python
mit
1,332
#!/usr/bin/python3 from tkinter import * from urllib.request import * #from tkinter.ttk import * from html.parser import HTMLParser class MyHTMLParser(HTMLParser): def handle_starttag(self, tag, attrs): print("Encountered a start tag:", str(tag)) def handle_endtag(self, tag): print("Encountered...
thepegasus/pegabrowser
pegabrowser.py
Python
mit
2,566
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (C) 2011-2014 German Aerospace Center DLR (Deutsches Zentrum fuer Luft- und Raumfahrt e.V.), Institute of System Dynamics and Control All rights reserved. This file is part of PySimulator. PySimulator is free software: you can redistribute it and/or modify...
PySimulator/PySimulator
PySimulator/Plugins/Analysis/MinMax/MinMax.py
Python
lgpl-3.0
6,032
# Copyright (C) 2013 Statoil ASA, Norway. # # The file 'config_parser.py' 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 ...
iLoop2/ResInsight
ThirdParty/Ert/devel/python/python/ert/config/config_parser.py
Python
gpl-3.0
4,458
#!/usr/bin/env python2 import argparse from lxml import etree from lxml.builder import ElementMaker import os.path import sys import uuid import archivematicaXMLNamesSpace as namespaces import archivematicaCreateMETS2 import django django.setup() # dashboard from django.utils import timezone from main.models import ...
eckardm/archivematica
src/MCPClient/lib/clientScripts/createPointerFile.py
Python
agpl-3.0
8,974
# -*- coding: utf-8 -*- # -*- Channel Goovie -*- # -*- Created for Alfa-addon -*- # -*- By the Alfa Develop Group -*- import sys PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int import re from channelselector import get_thumb from core import httptools from co...
alfa-addon/addon
plugin.video.alfa/channels/goovie.py
Python
gpl-3.0
10,928
from __future__ import absolute_import from sfepy.base.testing import TestCommon from sfepy.homogenization.engine import HomogenizationEngine as he from sfepy.homogenization.engine import HomogenizationWorkerMulti as hwm import six import numpy as nm class Test(TestCommon): @staticmethod def from_conf(conf, o...
vlukes/sfepy
tests/test_homogenization_engine.py
Python
bsd-3-clause
3,497
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL # Purpose: Script to translate GDAL supported raster into XYZ ASCII # point stream. # Author: Frank Warmerdam, warmerdam@pobox.com # ##############################################...
hrishioa/Aviato
flask/Lib/site-packages/osgeo/scripts/gdal2xyz.py
Python
gpl-2.0
4,980
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from obci.drivers.generic import py_amplifier from obci.configs import settings, variables_pb2 from obci.utils.openbci_logging import log_crash from multiplexer.multiplexer_constants import peers, types from openbciv3 import OpenBCIBoard MAX_CHANNELS = 8 + 3 ...
BrainTech/openbci
obci/drivers/eeg/openbciv3/amplifier_openbciv3_peer.py
Python
gpl-3.0
3,934
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-06-18 21:38 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('enquiry', '0003_auto_20170618_2137'), ] operations = [ migrations.RenameField( ...
samsath/cpcc_backend
src/website/enquiry/migrations/0004_auto_20170618_2138.py
Python
gpl-3.0
433
class Invertible(object): r""" Mix-in for invertible transforms. Provides an interface for taking the `pseudo` or true inverse of a transform. Has to be implemented in conjunction with :map:`Transform`. """ @property def has_true_inverse(self): r""" ``True`` if the pseudo...
yuxiang-zhou/menpo
menpo/transform/base/invertible.py
Python
bsd-3-clause
1,913
#!/usr/bin/python # -*- coding: utf-8 -*- """ pc_syntax This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. revision 0.1 2017/abr mlabru initial release (Linux/Python) """ __version__ = "$...
mlabru/papi_calibra
model/pc_syntax.py
Python
gpl-3.0
7,476
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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...
mehmetkose/tornado
tornado/curl_httpclient.py
Python
apache-2.0
22,169
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # http://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals class AnobiicrawlSpiderMiddleware(object): # Not all methods need to be defined. If a method is not defined, # scra...
shaform/anobii2goodreads
anobiicrawl/anobiicrawl/middlewares.py
Python
gpl-3.0
1,885
# -*- coding: utf-8 -*- # This file is part of wger Workout Manager. # # wger Workout Manager 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 License, or # (at your option) any ...
wger-project/wger
wger/weight/urls.py
Python
agpl-3.0
1,641
#! /usr/bin/env python import re from threading import Thread from common_utils import * # Todo: refactor using more of common_utils receiver_end_time = 0 receiver_status = 0 def wait_for_receiver_finish(receiver_process): global receiver_end_time global receiver_status receiver_status = receiver_proce...
ldemailly/wdt
test/wdt_port_block_test.py
Python
bsd-3-clause
3,215
# encoding: utf-8 # module samba.dcerpc.lsa # from /usr/lib/python2.7/dist-packages/samba/dcerpc/lsa.so # by generator 1.135 """ lsa DCE/RPC """ # imports import dcerpc as __dcerpc import talloc as __talloc class TransSidArray2(__talloc.Object): # no doc def __init__(self, *args, **kwargs): # real signature ...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/lsa/TransSidArray2.py
Python
gpl-2.0
746
# -*- coding: utf-8 -*- # # Spans documentation build configuration file, created by # sphinx-quickstart on Sun Dec 20 00:50:15 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. # # All...
runfalk/spans
doc/conf.py
Python
mit
9,521
#!/usr/bin/python import os,sys import time home_dir =os.getenv("HOME") #print home_dir sys.path.append(home_dir + "/drc/software/build/lib/python2.7/site-packages") sys.path.append(home_dir + "/drc/software/build/lib/python2.7/dist-packages") import lcm from drc.robot_state_t import robot_state_t import time lc = l...
openhumanoids/oh-distro
software/utils/drc_utils/python/send_a_val_state.py
Python
bsd-3-clause
1,324
from ddq.topics.logics.logic import Variable class BoundVariable(Variable): pass
jadnohra/connect
proto_3/ddq/topics/logics/fol/bound_variable.py
Python
unlicense
86
from collections import namedtuple import json import os Language = namedtuple(u'Language', u'english native iso639_1') file = os.path.join(os.path.dirname(__file__), 'languages.json') locales = json.loads(open(file, 'r').read()) LOCALES = {} for k in locales: LOCALES[k] = Language(locales[k]['english'], locale...
YOTOV-LIMITED/kitsune
kitsune/lib/sumo_locales.py
Python
bsd-3-clause
386
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 Hernán M. Foffani # # 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 r...
hfoffani/pddl-lib
pddlpy/__init__.py
Python
apache-2.0
665
def binary_search(seq, t): min = 0 max = len(seq) - 1 while True: if max < min: return -1 m = (min + max) // 2 if seq[m] < t: min = m + 1 elif seq[m] > t: max = m - 1 else: return m
ActiveState/code
recipes/Python/81188_Binary_search/recipe-81188.py
Python
mit
282
import json from typing import Tuple from great_expectations.core.id_dict import IDDict class MetricConfiguration: def __init__( self, metric_name: str, metric_domain_kwargs: dict, metric_value_kwargs: dict = None, metric_dependencies: dict = None, ): self._met...
great-expectations/great_expectations
great_expectations/validator/metric_configuration.py
Python
apache-2.0
2,379
import os import json import random from twisted.python import log import sys log.startLogging(sys.stdout) from twisted.internet import reactor from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner def random_event(): """ make a random _network_ event of the form: {"parm": "192.168.6....
crossbario/crossbarexamples
reactjs/netmonitor/netmonitor.py
Python
apache-2.0
1,770
"""Byrd-Omojokun Trust-Region SQP method.""" from __future__ import division, print_function, absolute_import from scipy.sparse import eye as speye from .projections import projections from .qp_subproblem import modified_dogleg, projected_cg, box_intersections import numpy as np from numpy.linalg import norm __all__ ...
gertingold/scipy
scipy/optimize/_trustregion_constr/equality_constrained_sqp.py
Python
bsd-3-clause
8,657
c = get_config() c.NotebookApp.base_url = '{{ env.url }}' c.NotebookApp.ip = '127.0.0.1' c.NotebookApp.trust_xheaders = True c.NotebookApp.webapp_setting = { 'static_url_prefix': '{{ env.url }}' }
hsharrison/proxy-ipynb-envs
ipyproxy/templates/ipython_notebook_config.py
Python
bsd-2-clause
202
from .base import DeweyCommand class Command(DeweyCommand): def pre_default(self, *args, **kwargs): return "workon %s" % kwargs["<project_name>"] def run_command(self, *args, **kwargs): pass def post_default(self, *args, **kwargs): pass
skoczen/dewey
dewey/commands/workon.py
Python
mit
277
# # This file is part of Gruvi. Gruvi is free software available under the # terms of the MIT license. See the file "LICENSE" that was provided # together with this source file for the licensing terms. # # Copyright (c) 2012-2017 the Gruvi authors. See the file "AUTHORS" for a # complete list. from __future__ import a...
geertj/gruvi
lib/gruvi/ssl.py
Python
mit
22,032
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Domain', fields=[ ('id', models.AutoField(help_...
erigones/esdc-ce
pdns/migrations/0001_initial.py
Python
apache-2.0
9,038
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # EasyDev documentation build configuration file, created by # sphinx-quickstart on Wed Oct 28 20:27:48 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 # au...
UniversoLibreMexicoAC/easydev-es
doc/conf.py
Python
gpl-3.0
9,210
import pytest from app import models from app.extensions import db @pytest.fixture(scope='function') def mock_picture(): def make_mock_picture(user=None, tags=None, despriction=None, address=None): _picture = models.Picture( userId=str(user.id), despriction=despriction or 'testdes',...
eightHundreds/irides
tests/mocks/pictures.py
Python
gpl-3.0
743
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.website_event.controllers.main import WebsiteEventController class EventOnlineController(WebsiteEventController): def _get_registration_confirm_values(self, event, attendees_sudo): values =...
ygol/odoo
addons/website_event_track_online/controllers/event.py
Python
agpl-3.0
473
#!/usr/bin/python a = 60 # 60 = 2b00111100 b = 13 # 13 = 2b00001101 c = 0 # 0 = 2b00000000 c = a & b # 12 = 2b00001100 print "Line 1: Value of c = a & b is: ", c c = a | b # 61 = 2b00111101 print "Line 2: Value of c = a | b is: ", c c = a ^ b # 49 = 2b00110001 print "L...
HuuHoangNguyen/Python_learning
bitwise_operators.py
Python
mit
586
#!/usr/bin/env python # -*- coding: utf-8 -*- from nose.tools import assert_equal from nose.tools import assert_true import os.path as osp import numpy as np import jsk_apc2016_common _this_dir = osp.dirname(osp.realpath(osp.abspath(__file__))) def test_get_object_data(): obj_data = jsk_apc2016_common.get_ob...
start-jsk/jsk_apc
jsk_apc2016_common/python/jsk_apc2016_common/tests/__init__.py
Python
bsd-3-clause
2,437
# Generated by Django 2.0.1 on 2018-01-27 06:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('billing', '0011_cascade_delete_product_properties'), ] operations = [ migrations.AlterField( model_name='charge', na...
skioo/django-customer-billing
billing/migrations/0012_index_deleted_field.py
Python
mit
420
from rest_framework import exceptions from rest_framework import permissions from rest_framework import serializers import rest_framework.response import rest_framework.views from fjord.alerts.models import Alert, AlertFlavor, AlertSerializer, Link from fjord.api_auth.api_utils import TokenAuthentication from fjord.ba...
staranjeet/fjord
fjord/alerts/api_views.py
Python
bsd-3-clause
6,843
import os from sendgrid.helpers.inbound.config import Config from sendgrid.helpers.inbound.app import app try: import unittest2 as unittest except ImportError: import unittest class UnitTests(unittest.TestCase): def setUp(self): self.config = Config() app.testing = True self.tes...
blackpioter/sendgrid-python
test/test_app.py
Python
mit
664
# -*- coding:utf-8 -*- from flask_principal import RoleNeed, Permission admin = Permission(RoleNeed('admin')) auth = Permission(RoleNeed('authenticated')) null = Permission(RoleNeed('null'))
kdyq007/cmdb-api
permissions.py
Python
gpl-2.0
195
import random, string, smtplib from time import sleep from getpass import getpass from subprocess import call class color: PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033[1m' UNDERLINE = '\033[...
toxic-ig/Trity
trity/sms.py
Python
gpl-3.0
1,613
# # 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...
benguillet/wmr-frontend
lib/thrift/Thrift.py
Python
apache-2.0
3,530
"""Mathematical constants""" DEG2RAD = 0.017453293 LINEAR_THRESHOLD = 0.9995 ERROR_TOLERANCE = 1e-7
brianjimenez/lightdock
lightdock/mathutil/constants.py
Python
gpl-3.0
101
# encoding: utf-8 from __future__ import unicode_literals from marrow.tags.html5 import * from widgets import search from datetime import datetime SITE_NAME = "Contentment, the WebCore CMS" def site_header(): return div ( strip = True ) [ header [ hgroup [ ...
marrow/tags
examples/complex/master.py
Python
mit
768
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals import json import os import random from string import ascii_letters import subprocess from tempfile...
maxamillion/atomic-reactor
atomic_reactor/plugins/exit_koji_promote.py
Python
bsd-3-clause
25,242
#!/usr/bin/python # src https://learn.sparkfun.com/tutorials/raspberry-pi-twitter-monitor/dissecting-the-code from sense_hat import SenseHat import time from twython import TwythonStreamer sense = SenseHat() sense.set_rotation(180) red = (255, 0, 0) tweet_color = (255,255,255) msg = "Starting 8x8 tweeter!!" print msg...
ljack/raspberrypi
8x8-tweeter.py
Python
apache-2.0
1,242
''' @author: Youyk ''' import os import tempfile import uuid import time import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state test_stub = test_lib.lib_get_test_stub() test_obj_dict = test_state.TestStateDict() tmp_...
zstackorg/zstack-woodpecker
integrationtest/vm/installation/test_zs_inst_on_cos7.py
Python
apache-2.0
1,445
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University # Copyright (c) 2011, 2012 Open Networking Foundation # Copyright (c) 2012, 2013 Big Switch Networks, Inc. # See the file LICENSE.pyloxi which should have been included in the source distribution # Automatically generated by LOXI from ...
floodlight/loxigen-artifacts
pyloxi3/loxi/of14/oxm.py
Python
apache-2.0
214,363
""" Test the 'memory read' command. """ from __future__ import print_function import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil class MemoryReadTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): # Call super's setUp(). ...
apple/swift-lldb
packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
Python
apache-2.0
5,028
import argparse from Bio import SeqIO import math import numpy as np parser = argparse.ArgumentParser(description="Calculate effective lengths of sequences") parser.add_argument("fasta_file", type=str, help="fasta file of reference sequences") args = parser.parse_args() n_records = 0 record_lens = [] handle = open(a...
Yandell-Lab/taxonomer_0.5
taxonomer/scripts/fasta_stats.py
Python
mit
708
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2014 Andrés Aguirre <aaguirre@fing.edu.uy> # Copyright (c) 2014 Mercedes Marzoa <mmarzoa@fing.edu.uy> # Copyright (C) 2014 Alan Aguiar <alanjas@hotmail.com> # Copyright (C) 2014 Butiá Team butia@fing.edu.uy # Butia is a free open plataform for robotics pr...
nvazquez/Turtlebots
plugins/fischer/fischer.py
Python
mit
9,271
############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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 ## ## ht...
DamnedFacts/RSWebSocket
AutobahnTesting/fuzzer/servers/test_autobahn.py
Python
apache-2.0
1,381
import os import operator import sys from collections import defaultdict import matplotlib.pyplot as pp import CommonConf BASE = 'ksp' algs = ['mcf', 'raeke', 'edksp', 'vlb', 'ksp', 'ecmp'] def setupMPPDefaults(): pp.rcParams['font.size'] = 66 pp.rcParams['mathtext.default'] = 'regular' pp.rcParams['ytick...
merlin-lang/kulfi
simulate/viz/LatencyDiffPoints.py
Python
lgpl-3.0
5,142
#!/usr/bin/env python # # $File: utils.py $ # $LastChangedDate: 2014-02-05 14:38:36 -0600 (Wed, 05 Feb 2014) $ # $Rev: 4792 $ # # This file is part of simuPOP, a forward-time population genetics # simulation environment. Please visit http://simupop.sourceforge.net # for details. # # Copyright (C) 2004 - 2010 Bo Peng (...
BoPeng/simuPOP
src/demography.py
Python
gpl-2.0
97,830
import re import os from .cli import CLI from .runner import Runner class JuliaRunner(Runner): INCLUDE_REGEX = re.compile(r'^\s*include\s*\((.*?)\)\s*$') def reset(self): self.included = [] def make_code(self, file, filepath, filename): files = dict() code = '' for line...
srz-zumix/wandbox-api
wandbox/__julia__.py
Python
mit
1,505
# coding=utf-8 from __future__ import print_function import locale import os import re import subprocess import sys import platform import time # init libs PROGRAM_DIR = os.path.dirname(os.path.normpath(os.path.abspath(os.path.join(__file__, os.pardir)))) LIBS_DIR = os.path.join(PROGRAM_DIR, 'libs') sys.path.insert...
bbsan2k/nzbToMedia
core/__init__.py
Python
gpl-3.0
36,910
from ask_amy.tests.utility import TestCaseASKAmy from ask_amy.core.reply import Reply, Card class TestReply(TestCaseASKAmy): def setUp(self): pass def test_card_simple(self): card = Card.simple('title','some content') print(card) def test_build_w_card(self): pass
dphiggs01/ask_amy
ask_amy/tests/core/test_reply.py
Python
apache-2.0
311
# # Copyright 2012-2013 eNovance <licensing@enovance.com> # # Author: Julien Danjou <julien@danjou.info> # # 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/license...
luogangyi/Ceilometer-oVirt
ceilometer/compute/manager.py
Python
apache-2.0
1,366
from __future__ import division import hmac import hashlib import sys from struct import Struct, pack, error as struct_error from itertools import count, islice if sys.version_info[0] == 3: buffer = lambda x: x MAX_INT64 = 0xffffffffffffffffffffffffffffffff COUNTER8 = Struct('>B').pack COUNTER16 = Struct('>H').pac...
dbakker/python-hkdf
hkdf.py
Python
bsd-2-clause
3,659
# 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 ...
Azure/azure-sdk-for-python
sdk/servermanager/azure-mgmt-servermanager/azure/mgmt/servermanager/models/resource_py3.py
Python
mit
1,868