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 |
|---|---|---|---|---|---|---|
# Generated by Django 3.0.3 on 2020-03-13 20:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_token_permissions'),
]
operations = [
migrations.AlterField(
model_name='token',
name='description',
... | digitalocean/netbox | netbox/users/migrations/0004_standardize_description.py | Python | apache-2.0 | 400 | 0 |
#!/usr/bin/env python3
# fwiloprov.py
import re
import getpass
import pexpect
from pexpect import EOF
from pexpect import TIMEOUT
from pexpect import ExceptionPexpect
from locationcode import Loccode
from networksid import NWdevice
from ipaddress import ip_address
from ipaddress import ip_network
from ipa... | takkaneko/netengtools | fwiloprov.py | Python | mit | 6,508 | 0.006454 |
from south.db import db
from django.db import models
from transifex.releases.models import *
class Migration:
def forwards(self, orm):
"Write your forwards migration here"
def backwards(self, orm):
"Write your backwards migration here"
models = {
}
complete_apps = ['releases... | tymofij/adofex | transifex/releases/migrations/0001_initial.py | Python | gpl-3.0 | 323 | 0.009288 |
#!/usr/bin/env python3
# coding: utf-8
#
import re
import os
import time
import argparse
import yaml
import bunch
import uiautomator2 as u2
from logzero import logger
CLICK = "click"
# swipe
SWIPE_UP = "swipe_up"
SWIPE_RIGHT = "swipe_right"
SWIPE_LEFT = "swipe_left"
SWIPE_DOWN = "swipe_down"
SCREENSHOT = "screensh... | openatx/uiautomator2 | examples/runyaml/run.py | Python | mit | 3,918 | 0.002061 |
#### 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 = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_dress_formal_26.iff"
result.attri... | anhstudios/swganh | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_dress_formal_26.py | Python | mit | 462 | 0.047619 |
# coding=utf-8
"""
Class used for representing tIntermediateCatchEvent of BPMN 2.0 graph
"""
import graph.classes.events.catch_event_type as catch_event
class IntermediateCatchEvent(catch_event.CatchEvent):
"""
Class used for representing tIntermediateCatchEvent of BPMN 2.0 graph
"""
def __init__(sel... | krisss2121/bpmn-python | bpmn_python/graph/classes/events/intermediate_catch_event_type.py | Python | gpl-3.0 | 478 | 0 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | hfp/tensorflow-xsmm | tensorflow/contrib/optimizer_v2/rmsprop_test.py | Python | apache-2.0 | 19,033 | 0.010561 |
"""
Post processing (subset of columns) to calculate intermediate sum edit counts
and other variables. Date sorted.
Usage:
calculate_intermediate_sums (-h|--help)
calculate_intermediate_sums <input> <output>
[--debug]
[--verbose]
Options:
-h... | hall1467/wikidata_usage_tracking | python_analysis_scripts/longitudinal_misalignment/calculate_intermediate_sums.py | Python | mit | 2,652 | 0.006033 |
"""
This process takes in the training dataset and outputs
a data structure that includes the name of the molecule,
the predictor, and the CAS number
Attributes:
input_file (str): This is the training file that
is read by the output
Instance (class): This is a private class which
structures each instanc... | sandialabs/BioCompoundML | bcml/Parser/build_training.py | Python | bsd-3-clause | 6,250 | 0.00048 |
# OeQ autogenerated correlation for 'Window/Wall Ratio West in Correlation to the Building Age'
import math
import numpy as np
from . import oeqCorrelation as oeq
def window_wall_west_ratio_MFH_by_building_age_correlation(*xin):
# OeQ autogenerated correlation for 'Window to Wall Ratio in Western Direction'
A... | UdK-VPT/Open_eQuarter | mole3/stat_corr/window_wall_west_ratio_MFH_by_building_age_correlation.py | Python | gpl-2.0 | 570 | 0.036842 |
from os.path import exists
from kokki import Environment, Execute
def site(name, enable=True):
env = Environment.get_instance()
if enable:
cmd = 'nxensite'
else:
cmd = 'nxdissite'
def _not_if():
e = exists("%s/sites-enabled/%s" % (env.config.nginx.dir, name))
return e... | samuel/kokki | kokki/cookbooks/nginx/libraries/sites.py | Python | bsd-3-clause | 535 | 0.013084 |
# Copyright (C) 2012,2013,2019
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of ... | govarguz/espressopp | src/esutil/RNG.py | Python | gpl-3.0 | 1,767 | 0.006791 |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, getdate, formatdate, cstr
from erpnext.accounts.report.financial_statements import filter_accou... | Zlash65/erpnext | erpnext/accounts/report/profitability_analysis/profitability_analysis.py | Python | gpl-3.0 | 5,970 | 0.031658 |
# HAppy
import sys
import logging
from optparse import OptionParser
logger = logging.getLogger(__name__)
SUB_COMMANDS = [
'daemon',
'takeover',
'release',
'status',
]
def parse_args(argv):
if len(argv) > 0 and argv[0] in SUB_COMMANDS:
subcommand = argv.pop(0)
... | adregner/HAppy | happy/shell.py | Python | mit | 1,151 | 0.013901 |
"""
dotcloud.ui.colors - Pythonic wrapper around colorama
Usage:
colors = Colors()
# Format string inlining
print '{c.green}->{c.reset} Hello world!'.format(c=colors)
# Call
print colors.blue('Hello world!')
# Wrapper
with colors.red:
print 'Hello world'
"""
import sys
import c... | andresriancho/dotcloud-cli | dotcloud/ui/colors.py | Python | mit | 2,257 | 0 |
#
# 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... | nathanielvarona/airflow | airflow/contrib/operators/qubole_operator.py | Python | apache-2.0 | 1,158 | 0.001727 |
# -*- encoding: UTF-8 -*-
import struct
from time import localtime
import itertools
import codecs
import gevent
from copy import copy
from copy import deepcopy
import screen
from screen import ForegroundColors, BackgroundColors
from screen import Align
from utility import Dimension
from string import lowercase
retu... | pencilcheck/pttbbs-py | src/pttbbs/screenlets.py | Python | mit | 33,791 | 0.004458 |
import numpy as np
import os
import sys
import os.path as op
import matplotlib as mpl
import mpl.pyplot as plt
import palettable.colorbrewer as pal
from datetime import datetime
from cycler import cycler
#plt.rc('axes', prop_cycle=cycler('color', pal.qualitative.Dark2_8.mpl_colors)+
# cycler('marker',['D','o','v','... | OSUmageed/1DSweptCUDA | ResultPlots/ConferencePaper/Parsed/plotit.py | Python | mit | 4,498 | 0.028902 |
# -*- coding: utf-8 -*-
from rest_framework import viewsets
from . import serializers, models
class FileViewSet(viewsets.ModelViewSet):
queryset = models.File.objects.all()
serializer_class = serializers.FileSerializer
| nathanhi/deepserve | deepserve/fileupload/views.py | Python | mit | 231 | 0 |
import urllib
def basic_authentication(username=None, password=None, protocol="http"):
from .fixtures import server_config, url
build_url = url(server_config())
query = {}
return build_url("/webdriver/tests/support/authentication.py",
query=urllib.urlencode(query),
... | UK992/servo | tests/wpt/web-platform-tests/webdriver/tests/support/authentication.py | Python | mpl-2.0 | 800 | 0 |
# Copyright 2010 OpenStack Foundation
# Copyright 2013 NTT corp.
# 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/LIC... | dims/cinder | cinder/image/glance.py | Python | apache-2.0 | 23,309 | 0 |
import sys
import multiprocessing
import os
import shutil
import tempfile
import unittest
from unittest.mock import patch
from scripts_EM import mrc2mrc as m
# class test_files_operations(unittest.TestCase):
#
# def setUp(self):
# self.files = ['1.mrc', '2.mrc', '3.mrc']
# self.tempdir = te... | AGMMGA/EM_scripts | EM_scripts/tests/mrc2mrc_tests.py | Python | gpl-2.0 | 8,856 | 0.004855 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'QuestionReport'
db.create_table(u'survey_questionreport', (
(u'question_ptr', se... | point97/hapifis | server/apps/survey/migrations/0036_auto__add_questionreport__del_field_question_filterBy__del_field_quest.py | Python | gpl-3.0 | 7,859 | 0.007126 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Testing core module functions
"""
import math
import numpy as npy
import volmdlr as vm
v2D_1 = vm.Vector2D(3*npy.random.random(2)-1.5)
v2D_2 = vm.Vector2D(3*npy.random.random(2)-1.5)
p2D_1 = vm.Point2D(3*npy.random.random(2)-1.5)
p2D_2 = vm.Point2D(3*npy.random.rand... | masfaraud/volmdlr | tests/core.py | Python | gpl-3.0 | 1,065 | 0.002817 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'AcquisitionSessionConfig.dark_thumbnail'
db.add_column(u'acquisition_acquisitionsessionconfi... | GaretJax/csat | csat/acquisition/migrations/0013_auto__add_field_acquisitionsessionconfig_dark_thumbnail.py | Python | mit | 3,962 | 0.008329 |
# stdlib
import logging
import unittest
# project
from dogstream.cassandra import parse_cassandra
logger = logging.getLogger(__name__)
class TestCassandraDogstream(unittest.TestCase):
def testStart(self):
events = parse_cassandra(logger, " INFO [main] 2012-12-11 21:46:26,995 StorageService.java (line 6... | GabrielNicolasAvellaneda/dd-agent | tests/checks/mock/test_cassandra.py | Python | bsd-3-clause | 5,234 | 0.004776 |
# encoding: utf-8
"""
Copyright (c) 2012 - 2015, Marian Steinbach, Ernesto Ruge
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,... | okfde/ris-web | scripts/remove_thumbs.py | Python | bsd-3-clause | 2,543 | 0.005899 |
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed in the hope that ... | tux-00/ansible | lib/ansible/module_utils/facts/hardware/freebsd.py | Python | gpl-3.0 | 6,910 | 0.001881 |
" spar loading for gust case "
import os
from numpy import pi, hstack, array
from ad.admath import cos
import pandas as pd
from gpkit import parse_variables
from gpfit.fit_constraintset import FitCS
from .sparloading import SparLoading
#pylint: disable=invalid-name, no-member, arguments-differ, exec-used
#pylint: disa... | convexengineering/gplibrary | gpkitmodels/GP/aircraft/wing/gustloading.py | Python | mit | 2,004 | 0.001497 |
# -*- coding: utf-8 -*-
import json
from layeredconfig import source
class JsonFile(source.Source):
"""Source for json files"""
def __init__(self, source, **kwargs):
super(JsonFile, self).__init__(**kwargs)
self._source = source
def _read(self):
with open(self._source) as fh:
... | hakkeroid/lcconcept | src/layeredconfig/sources/jsonfile.py | Python | bsd-3-clause | 457 | 0 |
#!/home/ilovejsp/project/ad3/django-allauth/example/env/bin/python
#
# The Python Imaging Library
# $Id$
#
# convert sequence format to GIF animation
#
# history:
# 97-01-03 fl created
#
# Copyright (c) Secret Labs AB 1997. All rights reserved.
# Copyright (c) Fredrik Lundh 1997.
#
# See the README file for ... | okwow123/djangol2 | example/env/bin/gifmaker.py | Python | mit | 689 | 0 |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public t... | kadhikari/navitia | source/jormungandr/jormungandr/georef.py | Python | agpl-3.0 | 5,482 | 0.001642 |
## Copyright (c) 2001-2009, Scott D. Peckham
## November 2009 (converted from IDL)
#-----------------------------------------------------------------------
# Notes: Use the random midpoint displacement method to create
# a fractal surface/landscape (due to Mandelbrot).
# This can be used as initial s... | mdpiper/topoflow | topoflow/utils/midpoints.py | Python | mit | 10,558 | 0.014302 |
# coding=utf-8
#
# Copyright © 2015 VMware, Inc. All Rights Reserved.
#
# 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, co... | vmware/nsxramlclient | tests/clusterprep.py | Python | mit | 2,874 | 0.007658 |
# encoding: utf-8
# Example for a RichText widget
from yast import import_module
import_module('UI')
from yast import *
class RichText2Client:
def main(self):
UI.OpenDialog(
Opt("defaultsize"),
VBox(
RichText(
Opt("plainText"),
"This is a RichText in plainT... | yast/yast-python-bindings | examples/RichText2.py | Python | gpl-2.0 | 673 | 0.011887 |
from __future__ import unicode_literals
from __future__ import absolute_import
import logging
import os
import tempfile
import shutil
from .. import unittest
import mock
from compose.cli import main
from compose.cli.main import TopLevelCommand
from compose.cli.errors import ComposeFileNotFound
from six import StringI... | abesto/fig | tests/unit/cli_test.py | Python | apache-2.0 | 4,148 | 0.000482 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UpFile'
db.create_table(u'catalog_upfile', (
... | Makeystreet/makeystreet | woot/apps/catalog/migrations/0137_auto__add_upfile.py | Python | apache-2.0 | 70,587 | 0.007749 |
import os
import warnings
from static_precompiler import exceptions, utils
from . import base
__all__ = (
"Babel",
)
class Babel(base.BaseCompiler):
name = "babel"
input_extension = "es6"
output_extension = "js"
def __init__(self, executable="babel", sourcemap_enabled=False, modules=None, plu... | liumengjun/django-static-precompiler | static_precompiler/compilers/babel.py | Python | mit | 2,171 | 0.001382 |
# -*- coding: utf-8; -*-
"""
Copyright (C) 2007-2013 Guake authors
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 progra... | Guake/guake | guake/globals.py | Python | gpl-2.0 | 3,863 | 0.001812 |
def format_date(dt):
return dt.strftime('%Y-%m-%d %H:%M:%S')
| aabed/mhn | server/mhn/common/templatetags.py | Python | lgpl-2.1 | 65 | 0 |
#
# Copyright 2014, 2015 Red Hat. All Rights Reserved.
#
# Author: Chris Dent <chdent@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | FND/gabbi | gabbi/simple_wsgi.py | Python | apache-2.0 | 3,301 | 0 |
"""
Ethernet (TCP/IP protocol stack)
"""
from binascii import unhexlify
from construct import *
from construct.protocols.layer3.ipv4 import IpAddressAdapter
from ethernet import MacAddressAdapter
def HwAddress(name):
return IfThenElse(name, lambda ctx: ctx.hardware_type == "ETHERNET",
MacAddressAdapter(... | gkonstantyno/construct | construct/protocols/layer2/arp.py | Python | mit | 2,137 | 0.04773 |
"""Support for RFXtrx devices."""
import asyncio
import binascii
from collections import OrderedDict
import copy
import logging
import RFXtrx as rfxtrxmod
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
fro... | tboyce021/home-assistant | homeassistant/components/rfxtrx/__init__.py | Python | apache-2.0 | 16,421 | 0.00067 |
#!/usr/bin/env python
import os
import json
from argparse import ArgumentParser
from datetime import datetime
import time
import numpy as np
from tools import diff_last, cost_val, load_kind
def year_to_ms(y):
"""converts years to milliseconds."""
x = datetime(y, 1, 1)
x = time.mktime(x.timetuple()) * 10... | cyclus/cyc3d | data_to_json.py | Python | bsd-3-clause | 912 | 0.006579 |
"""This is mostly a copy of methods and internal classes from loadable"""
from django.db.models.loading import get_models
from fixture.loadable.loadable import DeferredStoredObject
def assert_empty(mod):
for model in get_models(mod):
assert model.objects.count() == 0
def resolve_stored_object(column_val)... | patrickod/fixture | fixture/test/test_loadable/test_django/util.py | Python | lgpl-2.1 | 579 | 0.008636 |
import os
import sys
import json
from datetime import datetime
from django.db import connection, transaction
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from fly_project import constants
from api.mo... | Oinweb/py-fly | api/management/commands/evaluate_quiz.py | Python | bsd-2-clause | 3,663 | 0.001092 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | google-research/language | language/bert_extraction/steal_bert_qa/utils/filter_queries_victim_agreement.py | Python | apache-2.0 | 5,977 | 0.009035 |
"""
Helper module for Python version 3.0 and above
- Ordered dictionaries
- Encoding/decoding urls
- Unicode/Bytes (for sending/receiving data from/to socket, base64)
- Exception handling (except Exception as e)
"""
import base64
from urllib.parse import unquote, quote
from collections import OrderedDict
def modulen... | martomo/SublimeTextXdebug | xdebug/helper/helper.py | Python | mit | 1,497 | 0.000668 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
import itertools
class SerialFinder():
_command = """ls -al /sys/class/tty/ttyUSB* | grep -o "/sys/class/tty/ttyUSB.*"| sed 's/ -> .*//'"""
_replace = "/sys/class/tty"
_replaceWith = "/dev"
def Find(self):
proc = subprocess.Popen([se... | MaxMorgenstern/EmeraldAI | EmeraldAI/Logic/ROS/Serial/SerialFinder.py | Python | apache-2.0 | 888 | 0.005631 |
import json
import requests
import base64
from . import check_input_attribute, checking_error, standard_error_message
from pymisp import MISPEvent, MISPObject
from urllib.parse import quote
moduleinfo = {'version': '1.0',
'author': 'Ben Verschaeren',
'description': 'SOPHOSLabs Intelix Integ... | VirusTotal/misp-modules | misp_modules/modules/expansion/sophoslabs_intelix.py | Python | agpl-3.0 | 6,396 | 0.004378 |
#!/usr/bin/env python3
import socket, sys, getopt, os
from signal import signal, pause, SIGINT, SIGTERM, SIG_IGN
from pickle import load, dump
from multiprocessing import Process
from multiprocessing.managers import SyncManager
from lib.server import tcp_server, udp_server, udp_client
from lib.utils import (read_byte... | RafaelPAndrade/LEIC-A-IST | RC/Proj/CS.py | Python | mit | 16,058 | 0.002678 |
# encoding=utf8
# Copyright (c) 2016 Uber Technologies, 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, including without limitation the rights
# to use, copy, mod... | uber/tchannel-python | tests/tornado/test_peer.py | Python | mit | 12,004 | 0.000083 |
# Copyright 2011 Nicholas Bray
#
# 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... | ncbray/pystream | sandbox/learning/__init__.py | Python | apache-2.0 | 578 | 0.00173 |
from .hourglass import *
from .hourglass_gn import *
from .pose_resnet import *
| bearpaw/pytorch-pose | pose/models/__init__.py | Python | gpl-3.0 | 80 | 0 |
# -*- coding: utf-8 -*-
import json
import numpy as np
import sys
# Compare a set of computed solutions to best known solutions on the
# same problems.
# See src/vrptw_to_json.py, src/pdptw_to_json.py and
# src/hvrp_to_json.py.
CUSTOM_PRECISION = 1000
BENCH_DOUBLE_PRECISION = 100
CUSTOM_PRECISION_CLASSES = [
"sol... | VROOM-Project/vroom-scripts | benchmarks/compare_to_BKS.py | Python | bsd-2-clause | 5,946 | 0.000841 |
# -*- coding: utf-8 -*-
from django.db import models
from cms.models import CMSPlugin
# sorry for the cryptic names. But we were hitting max lengths on Django 1.6
# and 1.7 with the too long names otherwise.
class UnalteredPM(CMSPlugin):
title = models.CharField(max_length=50)
search_fields = ['title']
cl... | czpython/django-cms | cms/test_utils/project/pluginapp/plugins/revdesc/models.py | Python | bsd-3-clause | 1,417 | 0.003529 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | cxxgtxy/tensorflow | tensorflow/python/lib/core/bfloat16_test.py | Python | apache-2.0 | 17,140 | 0.004959 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('changeset', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='changeset',
name='r... | batpad/osmcha-django | osmchadjango/changeset/migrations/0002_auto_20150804_0119.py | Python | gpl-3.0 | 448 | 0.002232 |
"""
Filename: robustlq.py
Authors: Chase Coleman, Spencer Lyon, Thomas Sargent, John Stachurski
Solves robust LQ control problems.
"""
from __future__ import division # Remove for Python 3.sx
import numpy as np
from lqcontrol import LQ
from quadsums import var_quadratic_sum
from numpy import dot, log, sqrt, identit... | 28ideas/quant-econ | quantecon/robustlq.py | Python | bsd-3-clause | 8,434 | 0.002846 |
"""
Instructor Views
"""
## NOTE: This is the code for the legacy instructor dashboard
## We are no longer supporting this file or accepting changes into it.
from contextlib import contextmanager
import csv
import json
import logging
import os
import re
import requests
from collections import defaultdict, OrderedDict... | xiandiancloud/edxplaltfom-xusong | lms/djangoapps/instructor/views/legacy.py | Python | agpl-3.0 | 82,769 | 0.003383 |
# -*- coding: utf-8 -*-
#
#
# Copyright 2014 Camptocamp SA
# Author: Yannick Vaucher
#
# 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
# License,... | jorsea/vertical-ngo | logistic_order_requisition_donation/__openerp__.py | Python | agpl-3.0 | 1,324 | 0 |
import cocos
from MultiLanguage import MultiLanguage
from package.helper import ProjectHelper
class FrameworkUpdate(cocos.CCPlugin):
@staticmethod
def plugin_name():
return "update-framework"
@staticmethod
def brief_description():
return MultiLanguage.get_string('FRAMEWORK_UPDATE_BR... | dios-game/dios-cocos | src/oslibs/cocos/cocos-src/tools/cocos2d-console/plugins/framework/framework_update.py | Python | mit | 934 | 0.001071 |
# -*- test-case-name: nevow.test.test_appserver -*-
# Copyright (c) 2004 Divmod.
# See LICENSE for details.
"""A web application server built using twisted.web
"""
import cgi
from copy import copy
from urllib import unquote
from types import StringType
import warnings
from twisted.web import server
from twisted.web... | mclois/iteexe | nevow/appserver.py | Python | gpl-2.0 | 13,064 | 0.002526 |
#!/usr/bin/python
# coding=utf-8
# Copyright (c) 2015, 2016 Björn Schrader
#
# 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 3 of the License, or
# (at your option) any later ve... | BjoernSch/WLANThermo_v2 | software/usr/sbin/wlt_2_nextion.py | Python | gpl-3.0 | 53,246 | 0.006524 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Item Info')
class TestItemInfo(unittest.TestCase):
pass
| reddymeghraj/showroom | erpnext/buying/doctype/item_info/test_item_info.py | Python | agpl-3.0 | 300 | 0.01 |
import zipfile
import os
import array
import collections
from struct import unpack
from ctypes import c_ubyte
import pygp.utils as utils
import pygp.constants as constants
import pygp.crypto as crypto
class Loadfile(object):
'''
This class builds a LoadFile object from a disk-based file.
and provides bas... | GPContributors/PyGP | pygp/loadfile.py | Python | lgpl-3.0 | 19,068 | 0.007971 |
"""
Author: Eric J. Ma
Affiliation: Massachusetts Institute of Technology
"""
from random import choice
from generate_id import generate_id
class Sequence(object):
"""
The Sequence object is the lowest level object in the pathogen simulator.
It provides a container for storing seed sequences for the pathogens pre... | ericmjl/reassortment-simulation-and-reconstruction | sequence.py | Python | mit | 1,435 | 0.036934 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-21 06:05
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('profiles', '0002_auto_20170721_1129'),
]
operations = [
migrations.RemoveField(
... | sunilsm7/django_resto | profiles/migrations/0003_remove_profile_following.py | Python | mit | 398 | 0 |
"""Class for Roomba devices."""
import logging
from homeassistant.components.vacuum import SUPPORT_FAN_SPEED
from .irobot_base import SUPPORT_IROBOT, IRobotVacuum
_LOGGER = logging.getLogger(__name__)
ATTR_BIN_FULL = "bin_full"
ATTR_BIN_PRESENT = "bin_present"
FAN_SPEED_AUTOMATIC = "Automatic"
FAN_SPEED_ECO = "Eco... | jawilson/home-assistant | homeassistant/components/roomba/roomba.py | Python | apache-2.0 | 3,241 | 0 |
"""Pytorch Densenet implementation w/ tweaks
This file is a copy of https://github.com/pytorch/vision 'densenet.py' (BSD-3-Clause) with
fixed kwargs passthrough and addition of dynamic global avg/max pool.
"""
import re
from collections import OrderedDict
from functools import partial
import torch
import torch.nn as n... | rwightman/pytorch-image-models | timm/models/densenet.py | Python | apache-2.0 | 15,611 | 0.003139 |
# -*- coding: utf-8 -*-
"""
Copyright © 2017 - Alexandre Machado <axmachado@gmail.com>
This file is part of Simple POS Compiler.
Simnple POS Compiler 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 Found... | axmachado/simplepos | simplepos/codegen/boolean.py | Python | gpl-3.0 | 15,374 | 0.00013 |
"""Test the Dexcom config flow."""
from unittest.mock import patch
from pydexcom import AccountError, SessionError
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.dexcom.const import DOMAIN, MG_DL, MMOL_L
from homeassistant.const import CONF_UNIT_OF_MEASUREMENT, CONF_USERNAME
... | lukas-hetzenecker/home-assistant | tests/components/dexcom/test_config_flow.py | Python | apache-2.0 | 4,420 | 0 |
"""
Tests of the utility code.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from copy import copy
import boto
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
from boto.ec2.autoscale.group import AutoScalingGroup
from boto.ec2.autoscale import Tag
import six
def c... | eltoncarr/tubular | tubular/tests/test_utils.py | Python | agpl-3.0 | 3,467 | 0.001154 |
import sqlalchemy as sa
from sqlalchemy import testing, util
from sqlalchemy.orm import mapper, deferred, defer, undefer, Load, \
load_only, undefer_group, create_session, synonym, relationship, Session,\
joinedload, defaultload, aliased, contains_eager, with_polymorphic
from sqlalchemy.testing import eq_, Asse... | robin900/sqlalchemy | test/orm/test_deferred.py | Python | mit | 30,663 | 0.003131 |
#!/usr/bin/env python
import rhythm
re = rhythm.RhythmExtract()
# fname = '/media/Data/Data/CompMusicDB/Carnatic/audio/Aneesh_Vidyashankar/Pure_Expressions/7_Jagadoddharana.mp3'
fname = '/media/Code/UPFWork/PhD/Data/CMCMDa/mp3/adi/10014_1313_Bhagyadalakshmi.mp3'
results = re.run(fname)
print("All done")
| MTG/pycompmusic | test/essentia/rhythmTest.py | Python | agpl-3.0 | 306 | 0.006536 |
from datetime import date, datetime, timedelta
from django.core import serializers
from django.db import models
import bleach
from constance import config
from .constants import (ALLOWED_TAGS, ALLOWED_ATTRIBUTES, ALLOWED_STYLES,
TEMPLATE_TITLE_PREFIX)
from .content import parse as parse_conte... | anaran/kuma | kuma/wiki/managers.py | Python | mpl-2.0 | 8,955 | 0.000335 |
"""
sudo
~~~~
:copyright: (c) 2020 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
try:
VERSION = __import__("pkg_resources").get_distribution("sudo").version
except Exception: # pragma: no cover
VERSION = "unknown"
| mattrobenolt/django-sudo | sudo/__init__.py | Python | bsd-3-clause | 246 | 0 |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/audit/auditmessages.py | Python | apache-2.0 | 6,791 | 0.035488 |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010 by Joel Andersson, Moritz Diehl, K.U.Leuven. All rights reserved.
#
# CasADi is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Pub... | jgillis/casadi | documentation/examples/solvers/exacthessian.py | Python | lgpl-3.0 | 2,328 | 0.020189 |
"""This module contains the data handler."""
import numpy as np
import tssim
from bokeh.models import ColumnDataSource
def create_source(series):
return ColumnDataSource(data=dict(x=series.index.values, y=series.values))
def dummy1():
ts = tssim.TimeSeries(start="2017-04-04", freq="D", periods=1100)
ts... | mansenfranzen/notebooks | Confidence Interval Simulation Bokeh/model.py | Python | mit | 2,316 | 0.003886 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2014 Edgewall Software
# Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2004-2006 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2006 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2008 Matt Good <matt@matt-good.net>
# All rights reserved.
#... | pkdevbox/trac | trac/web/session.py | Python | bsd-3-clause | 22,324 | 0.000134 |
import sys
import commands
import re
import glob
import types
from os import popen
from math import * # any function could be used by set()
import numpy as np
oldnumeric = False
try:
from DEFAULTS import PIZZA_GUNZIP
except:
PIZZA_GUNZIP = "gunzip"
class dump:
def __init__(self, *list):
... | eddiejessup/pizza | src/dump.py | Python | gpl-2.0 | 39,268 | 0.001248 |
#### 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/ship/crafted/reactor/shared_base_reactor_subcomponent_mk5.iff"
resu... | obi-two/Rebelion | data/scripts/templates/object/tangible/ship/crafted/reactor/shared_base_reactor_subcomponent_mk5.py | Python | mit | 499 | 0.044088 |
# -*- coding: utf-8 -*-
"""
Covenant Add-on
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 3 of the License, or
(at your option) any later version.
This prog... | TheWardoctor/Wardoctors-repo | script.module.uncoded/lib/resources/lib/sources/de/horrorkino.py | Python | apache-2.0 | 3,418 | 0.005851 |
import pygame
from GameFrame import TextObject, Globals, Level
class EntryTextObject(TextObject):
def __init__(self, room: Level, x: int, y: int, max_len=4):
TextObject.__init__(self, room, x, y, '')
self.max_len = max_len
self.handle_key_events = True
self.accepting_input = True
... | tuxta/gameframe | GameFrame/EntryTextObject.py | Python | gpl-3.0 | 4,969 | 0 |
#!/usr/bin/env python
"""
Extract atomic parameters for QEq potential.
Usage:
extract_bvs_params.py [options] DATA_FILE NAME [NAME...]
Options:
-h, --help Show this message and exit.
"""
from __future__ import print_function
from docopt import docopt
__author__ = "RYO KOBAYASHI"
__version__ = "180112"
out_Co... | ryokbys/nap | pmd/force_params/QEq_params/extract_QEq_params.py | Python | mit | 3,310 | 0.02145 |
import mock, unittest
from mercurial import ui
from tortoisehg.hgqt import thgrepo
def mockrepo(ui, path):
m = mock.MagicMock(ui=ui, root=path)
m.unfiltered = lambda: m
return m
LOCAL_SIGNALS = ['repositoryOpened', 'repositoryClosed']
MAPPED_SIGNALS = ['configChanged', 'repositoryChanged', 'repositoryDest... | velorientc/git_test7 | tests/qt_repomanager_test.py | Python | gpl-2.0 | 2,859 | 0.001749 |
import urllib2
import json
#Get json data from Weather Underground by using IP address
f = urllib2.urlopen('http://api.wunderground.com/api/***KEY***/conditions/forecast/hourly/q/autoip.json')
json_string = f.read()
parsed_json = json.loads(json_string)
#Current Location and Observation Time
location = parse... | doktorinjh/WeatherPane | WU_Bridge_GitHub.py | Python | apache-2.0 | 4,290 | 0.007925 |
# This is an automatically generated file.
# DO NOT EDIT or your changes may be overwritten
import base64
from xdrlib import Packer, Unpacker
from ..type_checked import type_checked
from .allow_trust_op import AllowTrustOp
from .begin_sponsoring_future_reserves_op import BeginSponsoringFutureReservesOp
from .bump_sequ... | StellarCN/py-stellar-base | stellar_sdk/xdr/operation_body.py | Python | apache-2.0 | 23,177 | 0.00164 |
import re
class ibeon:
def remSpaces(data):
return data.replace(" ", "")
def remNumbers(data):
return ''.join([x for x in data if not x.isdigit()])
def remSymbols(data):
return re.sub('[^\w]', '', data)
def onlyNumbers(data):
return re.sub('[^0-9]', '', data)
def onlyAlp... | Aroliant/iBeon | python/ibeon.py | Python | mit | 901 | 0.057714 |
from math import *
from Vertex import *
#Length of the three subparts of the robot leg
L1 = 51.0
L2 = 63.7
L3 = 93.0
Alpha = 20.69 #Mecanic constraint on Theta 2
Beta = 5.06 #Mecanic constraint on Theta 3
# Check if the given float match with radian (between 2PI and -2PI)
def radValidation (radian):
return (radian... | Foxnox/robotique-delpeyroux-monseigne | src/direct_kinematics.py | Python | mit | 1,409 | 0.034776 |
# Copyright 2017 FiberHome Telecommunication Technologies CO.,LTD
# Copyright (C) 2017 Dell Inc. or its subsidiaries.
# 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 Lice... | openstack/tempest | tempest/api/volume/admin/test_group_snapshots.py | Python | apache-2.0 | 12,992 | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-24 15:01
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("notification", "0004_delete_old_email_notification")]
operations = [
migrations.RenameModel(
... | project-callisto/callisto-core | callisto_core/notification/migrations/0005_rename_to_emailnotification.py | Python | agpl-3.0 | 408 | 0 |
''' Script to reduce data files to create unit test fixtures.
'''
import tables as tb
def create_fixture(file_in, file_out, n_readouts, nodes):
with tb.open_file(file_in, 'r') as in_file:
with tb.open_file(file_out, 'w') as out_file:
in_file.copy_node('/configuration', out_file.root, recursiv... | SiLab-Bonn/pyBAR | pybar/testing/tools/create_fixture.py | Python | bsd-3-clause | 1,622 | 0.003699 |
#!/usr/bin/python
# coding: utf8
from upload import create_file_list
import exifread
import math
import pexif
import re
import datetime
import time
from bs4 import BeautifulSoup
from geojson import FeatureCollection, Feature, LineString, Point
import json
def utc_to_localtime(utc_time):
utc_offset_timedelta = da... | DenisCarriere/mapillary | mapillary/geotag.py | Python | mit | 6,563 | 0.001067 |
"""
Contains base level parents that aren't to be used directly.
"""
from twisted.internet.defer import inlineCallbacks, returnValue
from fuzzywuzzy.process import QRatio
from fuzzywuzzy import utils as fuzz_utils
from src.daemons.server.ansi import ANSI_HILITE, ANSI_NORMAL
from src.daemons.server.objects.exceptions ... | gtaylor/dott | src/game/parents/base_objects/base.py | Python | bsd-3-clause | 25,944 | 0.001156 |
from gi.repository import Gtk
from gi.repository import WebKit
class BrowserView:
def __init__(self):
window = Gtk.Window()
window.connect('delete-event',Gtk.main_quit)
self.view = WebKit.WebView()
#self.view.load_uri('http://example.net')
#https://www.raspberrypi.or... | samurailens/sop | app/samplePythonScript/webapp.py | Python | gpl-2.0 | 609 | 0.026273 |
import threading
import time
MOVEXCOUNT = 20
GETCOUNT = 21
COUNT = 22
RESETCOUNT = 23
RESETEDCOUNT = 24
SETPOSCONTROLSTATUS = 25
SETACCELERATION = 26
SETDECELERATION = 27
SETMAXSPEED = 28
SETSPEED = 40
GETSPEED = 41
SPEED = 42
SETPID = 43
SETPIDLIMIT = 44
class Motors(threading.Thread):
def __init__(self, cmdMes... | jgrizou/robot_2WD | python/robotControl/Motors.py | Python | gpl-2.0 | 3,698 | 0.001082 |
import itertools
from .base import MessageHandler
from .. import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(
settings.EMOJI_REACTIONS.keys() + settings.MESSAGE_REACTIONS.keys())
HELP = 'add emoji and message reactions'
def handle_message... | nkouevda/slack-rtm-bot | slack_rtm_bot/handlers/reaction.py | Python | mit | 976 | 0.009221 |
from django.db import models
# Create your models here.
class ParklePlayer(models.Model):
""" Consider this our User model for a Registered Parkle Player.
"""
username = models.CharField(max_length=30, unique=True)
email = models.EmailField(unique=True)
player_key = models.CharField(max_length=32,... | matteius/parkle-api | accounts/models.py | Python | gpl-3.0 | 422 | 0.00237 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.