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 |
|---|---|---|---|---|---|---|
from spectre.syntax import *
class SMU2P(Netlist):
__name__ = "SMU2P"
__type__ = "netlist"
def __init__(self, name='SMU2P', nodes=('1', '2'), V1=0, V2=0):
Netlist.__init__(self)
self.name = name
self.nodes = nodes
self.V1 = V1; self.V2 = V2
save = dict(V1=nodes[0], V... | raphaelvalentin/Utils | spectre/syntax/smu.py | Python | gpl-2.0 | 4,809 | 0.021418 |
# -*- encoding: utf-8 -*-
# from django.test import TestCase
# from block.tests.helper import check_content
# from compose.tests.factories import HeaderFactory
# class TestHeader(TestCase):
#
# def test_content_methods(self):
# c = HeaderFactory()
# check_content(c)
| pkimber/compose | compose/tests/test_header.py | Python | apache-2.0 | 291 | 0 |
# -*- coding: utf-8 -*-
import json
import urllib2
def get_authkey(zabbix_server, zabbix_user, zabbix_pass, head):
url = "http://" + zabbix_server + "/zabbix/api_jsonrpc.php"
pdata = json.dumps({"jsonrpc" : "2.0",
"method" : "user.login",
"params" : {
... | Shadow5523/zabbix_api | lib/auth.py | Python | gpl-2.0 | 669 | 0.014948 |
from selfdrive.car import dbc_dict
from cereal import car
Ecu = car.CarParams.Ecu
class CarControllerParams:
def __init__(self, CP):
if CP.carFingerprint == CAR.IMPREZA_2020:
self.STEER_MAX = 1439
else:
self.STEER_MAX = 2047
self.STEER_STEP = 2 # how often we update the steer c... | commaai/openpilot | selfdrive/car/subaru/values.py | Python | mit | 11,405 | 0.001841 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | neumerance/deploy | openstack_dashboard/dashboards/project/firewalls/views.py | Python | apache-2.0 | 10,365 | 0 |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/textobject.py
__version__=''' $Id$ '''
__doc__="""
PDFTextObject is an efficient way to add text to a Canvas. Do not
instantiate directly, obtai... | BackupTheBerlios/pixies-svn | pixies/reportlab/pdfgen/textobject.py | Python | gpl-2.0 | 14,031 | 0.005274 |
# Copyright 2013 Cloudbase Solutions Srl
#
# 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... | takeshineshiro/nova | nova/tests/functional/v3/test_console_auth_tokens.py | Python | apache-2.0 | 2,711 | 0 |
#!/usr/bin/env python
"""
split_file.py [-o <dir>] <path>
Take the file at <path> and write it to multiple files, switching to a new file
every time an annotation of the form "// BEGIN file1.swift" is encountered. If
<dir> is specified, place the files in <dir>; otherwise, put them in the
current directory.
"""
impo... | khizkhiz/swift | utils/split_file.py | Python | apache-2.0 | 1,030 | 0.000971 |
# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
# 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.
#
# Thi... | crazyleen/msp430-gdb-7.2a | gdb/testsuite/gdb.python/py-prettyprint.py | Python | gpl-2.0 | 7,344 | 0.012527 |
from datetime import datetime
from parsedatetime import parsedatetime, Constants
from scrapy import signals
from scrapy.xlib.pydispatch import dispatcher
from scrapy.exceptions import NotConfigured, IgnoreRequest
from scrapy.utils.misc import load_object
class HistoryMiddleware(object):
DATE_FORMAT = '%Y%m%d'
... | playandbuild/scrapy-history-middleware | history/middleware.py | Python | mit | 3,854 | 0.002076 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-10 18:31
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0027_auto_20161110_0311'),
]
operations = [
mi... | d120/pyofahrt | workshops/migrations/0028_auto_20161110_1931.py | Python | agpl-3.0 | 795 | 0 |
## @package shesha.constants
## @brief Numerical constants for shesha and config enumerations for safe-typing
## @author COMPASS Team <https://github.com/ANR-COMPASS>
## @version 5.2.1
## @date 2022/01/24
## @copyright GNU Lesser General Public License
#
# This file is part of COMPASS <https://anr-comp... | ANR-COMPASS/shesha | shesha/constants.py | Python | gpl-3.0 | 5,648 | 0.003718 |
#!/usr/bin/python
from __future__ import division
## Math
import numpy as np
import math
## Display
import pygame
import time
## Ros
import rospy
import os, sys
from geometry_msgs.msg import Twist, Pose, PoseStamped, Point, Quaternion
from tf import transformations as tf_trans
from std_msgs.msg import Header
from ie... | ufieeehw/IEEE2015 | ros/ieee2015_simulator/nodes/mecanum_simulation.py | Python | gpl-2.0 | 7,968 | 0.009538 |
import sys
from cliff import app
from cliff import commandmanager as cm
from conf import default
import tacoclient
class TacoClientApp(app.App):
def __init__(self, **kwargs):
super(TacoClientApp, self).__init__(
description='tacoclient - CLI client for TACO(SKT All Container \
Ope... | powerds/python-tacoclient | tacoclient/shell.py | Python | apache-2.0 | 904 | 0.002212 |
# -*- coding: utf-8 -*-
#
# 2016-05-04 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Initial writup
#
# License: AGPLv3
# (c) 2016. Cornelius Kölbel
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# License as publi... | jalr/privacyidea | privacyidea/lib/eventhandler/base.py | Python | agpl-3.0 | 2,637 | 0 |
from common import common_global
from common import common_isbn
from common import common_logging_elasticsearch_httpx
from common import common_pagination_bootstrap
from sanic import Blueprint
blueprint_user_metadata_periodical = Blueprint('name_blueprint_user_metadata_periodical',
... | MediaKraken/MediaKraken_Deployment | source/web_app_sanic/blueprint/user/bp_user_metadata_periodical.py | Python | gpl-3.0 | 4,831 | 0.006417 |
# Copyright 2018 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 applicab... | cshallue/models | research/cognitive_planning/embedders.py | Python | apache-2.0 | 19,820 | 0.006105 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-dataplex | samples/generated_samples/dataplex_v1_generated_dataplex_service_delete_task_sync.py | Python | apache-2.0 | 1,521 | 0.000657 |
# -*- 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 'Person.vcard_enabled'
db.add_column(u'aldryn_people_person', 'vcard_enabled',
... | Venturi/cms | env/lib/python2.7/site-packages/aldryn_people/south_migrations/0013_auto__add_field_person_vcard_enabled.py | Python | gpl-2.0 | 14,400 | 0.007917 |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import pgettext_lazy
from .base import Product
from .variants import (ProductVariant, PhysicalProduct, ColoredVariant,
StockedProduct)... | hongquan/saleor | saleor/product/models/products.py | Python | bsd-3-clause | 1,423 | 0 |
#!/usr/bin/env python
'''
Set of analytics based on ssdeep hash.
- compare
Simple implementation of ssdeep comparisions using a few optimizations
described at the links below
https://www.virusbulletin.com/virusbulletin/2015/11/optimizing-ssdeep-use-scale
http://www.intezer.com/intezer-community-tip-s... | jmlong1027/multiscanner | analytics/ssdeep_analytics.py | Python | mpl-2.0 | 10,551 | 0.001516 |
# -*- coding: utf-8 -*-
"""
Managing Vocab Caching.
@summary: RDFa parser (distiller)
@requires: U{RDFLib<http://rdflib.net>}
@organization: U{World Wide Web Consortium<http://www.w3.org>}
@author: U{Ivan Herman<a href="http://www.w3.org/People/Ivan/">}
@license: This software is available for use under the
U{W3C® SOF... | RDFLib/PyRDFa | pyRdfa/rdfs/cache.py | Python | bsd-3-clause | 15,733 | 0.038075 |
import moe
from moe.easy_interface.experiment import Experiment
from moe.easy_interface.simple_endpoint import gp_next_points, gp_hyper_opt
import pymbar
import seaborn as sns
import scipy.interpolate
import pymc
import sklearn.gaussian_process
import os
import pandas as pd
import glob
keys = ["q0", "sigma0"]
data = p... | kyleabeauchamp/DBayes | dbayes/analysis/test_moe.py | Python | gpl-2.0 | 1,864 | 0.004292 |
from keras.models import Sequential
from keras.layers import convolutional
from keras.layers.core import Dense, Flatten
from SGD_exponential_decay import SGD_exponential_decay as SGD
### Parameters obtained from paper ###
K = 152 # depth of convolutional layers
LEARNING_RATE = .003 # ini... | wrongu/AlphaGo | AlphaGo/models/value.py | Python | mit | 1,711 | 0.01052 |
#!/usr/bin/env python
import os
import argparse
from subprocess import call
admin_username = 'admin'
admin_password = os.environ['MONGO_ADMIN_PASSWORD']
parser=argparse.ArgumentParser()
parser.add_argument("-d", "--db-name", help="the DB to create the user in", required=True)
parser.add_argument("-c", "--collection"... | ministryofjustice/opg-docker | mongodb/docker/opt/reindex_database.py | Python | mit | 784 | 0.019133 |
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])
from clang.cindex import LinkageKind
from clang.cindex import Cursor
from clang.cindex import TranslationUnit
from .util import get_cursor
from .util import get_tu
import uni... | endlessm/chromium-browser | third_party/llvm/clang/bindings/python/tests/cindex/test_linkage.py | Python | bsd-3-clause | 1,175 | 0.001702 |
"""
Classes for char-to-int mapping and int-to-int mapping.
:Author: James Taylor (james@bx.psu.edu)
The char-to-int mapping can be used to translate a list of strings
over some alphabet to a single int array (example for encoding a multiple
sequence alignment).
The int-to-int mapping is particularly useful for crea... | bxlab/bx-python | lib/bx/seqmapping.py | Python | mit | 2,856 | 0 |
from distutils.core import setup
import yavd
setup (
name = 'YAVD',
version = yavd.__version__,
description= 'Download videos from Youtube and others.',
author = '10n1z3d',
author_email = '10n1z3d@w.cn',
url = '',
license = 'GPLv3',
packages = ['YAVD'],
... | 10n1z3d/YAVD | setup.py | Python | gpl-3.0 | 391 | 0.046036 |
# encoding: 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 index on 'Place', fields ['place_id']
db.create_index('storybase_geo_place', ['place_id'])
... | denverfoundation/storybase | apps/storybase_geo/migrations/0004_auto.py | Python | mit | 7,705 | 0.007787 |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | sebrandon1/neutron | neutron/tests/unit/services/trunk/drivers/openvswitch/test_driver.py | Python | apache-2.0 | 2,829 | 0 |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import finufft
from finufft import interface
import numpy as np
import pytest
__all__ = [
"test_nufft1d1", "test_nufft1d2", "test_nufft1d3",
]
def test_nufft1d1(seed=42, iflag=1):
np.random.seed(seed)
ms = int(1e3)
n = int(2e... | dfm/python-finufft | tests/test_1d.py | Python | apache-2.0 | 1,814 | 0.000551 |
# Write a function to delete a node (except the tail) in a singly linked list,
# given only access to that node.
#
# Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node
# with value 3, the linked list should become 1 -> 2 -> 4 after calling your function.
#
# time: O(1)
# space: O(1)
# Defini... | RobinCPC/algorithm-practice | LinkedList/deleteNode.py | Python | mit | 1,861 | 0.005911 |
# vim: set tw=0:
from django.conf.urls import url, include
from django.core.urlresolvers import RegexURLPattern
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework.authtoken.views import obtain_auth_token
from . import views
def format_patterns(urlpatterns):
"If a URL pattern ends i... | editorsnotes/editorsnotes | editorsnotes/api/urls.py | Python | agpl-3.0 | 3,744 | 0.006143 |
from bears.java.InferBear import InferBear
from tests.LocalBearTestHelper import verify_local_bear
good_file = """
class InferGood {
int test() {
String s = null;
return s == null ? 0 : s.length();
}
}
"""
bad_file = """
class InferBad {
int test() {
String s = null;
retur... | sounak98/coala-bears | tests/java/InferBearTest.py | Python | agpl-3.0 | 585 | 0 |
# Copyright (C) 2010 Google 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 writ... | palladius/gcloud | packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/discovery.py | Python | gpl-3.0 | 26,209 | 0.008623 |
from threading import Thread
import time
from scapy.all import *
class AttackProcess(Thread):
def __init__(self, main):
Thread.__init__(self)
self.main = main
self.selected_hosts = []
self.is_attacking = False
def run(self):
while True:
while self.is_attac... | GadgeurX/NetworkLiberator | Daemon/AttackProcess.py | Python | gpl-3.0 | 586 | 0.001706 |
"""
WSGI config for circuit 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 7Pros/circuit | circuit/wsgi.py | Python | gpl-2.0 | 391 | 0 |
def estriangulo(a,b,c):
print("el primer argumento es:",a)
print("el segundo argumento es:",b)
print("el tercer argumento es:",c)
return a+b>c and a+c>b and c+b>a
def espitagorico(a,b,c):
return a**2+b**2==c**2 or a**2+c**2==b**2 or b**2+c**2==a**2
def esisosceles(a,b,c):
return a==b or a==c o... | jabaier/iic1103.20152.s4 | estriangulo_prueba.py | Python | unlicense | 428 | 0.063084 |
#!/usr/bin/python
import RPi.GPIO as GPIO
import subprocess
# Starting up
GPIO.setmode(GPIO.BCM)
GPIO.setup(3, GPIO.IN)
# Wait until power button is off
# Recommended to use GPIO.BOTH for cases with switch
GPIO.wait_for_edge(3, GPIO.BOTH)
# Shutting down
subprocess.call(['shutdown', '-h', 'now'], shell=False)
| UBayouski/RaspberryPiPowerButton | power_button.py | Python | mit | 315 | 0 |
#
# 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 ... | protochron/aurora | src/test/python/apache/aurora/client/cli/test_quota.py | Python | apache-2.0 | 4,844 | 0.0064 |
from .base import (ExtensionArray, # noqa
ExtensionScalarOpsMixin)
from .categorical import Categorical # noqa
from .datetimes import DatetimeArrayMixin # noqa
from .interval import IntervalArray # noqa
from .period import PeriodArrayMixin # noqa
from .timedeltas import TimedeltaArrayMixin # ... | kdebrab/pandas | pandas/core/arrays/__init__.py | Python | bsd-3-clause | 325 | 0 |
# Copyright (c) 2009 Moxie Marlinspike
#
# 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 program is distributed... | vejeshv/main_project | knockknock/MacFailedException.py | Python | gpl-3.0 | 790 | 0 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2013, gamesun
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyr... | gamesun/MyTerm-for-YellowStone | setup.py | Python | bsd-3-clause | 4,648 | 0.010327 |
# -*- coding: utf-8 -*-
"""
Dashboard stuff for admin_tools
"""
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from admin_tools.dashboard import modules, Dashboard, AppIndexDashboard
from admin_tools.utils import get_admin_site_name
class CustomIndexDashboard(Dash... | emencia/emencia_paste_djangocms_3 | emencia_paste_djangocms_3/django_buildout/project/mods_available/admin_tools/dashboard.py | Python | mit | 3,336 | 0.014688 |
# Class for a network object.
from NetworkPrimitives import Ip, Mac
from Config import config
from Exceptions import *
import Toolbox
import easysnmp
import requests
import json
import time
from datetime import datetime
import uuid
import geocoder
# Disable security warnings.
from requests.packages.urllib3.exception... | mudbungie/NetExplorer | Host.py | Python | mit | 17,053 | 0.002346 |
"""Upgrade a virtual server."""
# :license: MIT, see LICENSE for more details.
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
from SoftLayer.CLI import virt
import click
@click.command(epilog="""Note:... | iftekeriba/softlayer-python | SoftLayer/CLI/virt/upgrade.py | Python | mit | 1,538 | 0 |
import datetime
import itertools
from hashlib import sha256
from collections import defaultdict
from flanker import mime
from sqlalchemy import (Column, Integer, BigInteger, String, DateTime,
Boolean, Enum, ForeignKey, Index)
from sqlalchemy.dialects.mysql import LONGBLOB
from sqlalchemy.orm im... | wakermahmud/sync-engine | inbox/models/message.py | Python | agpl-3.0 | 22,094 | 0.000181 |
import os
import sys
import msgfmt
from setuptools import setup
from setuptools.command.install_lib import install_lib as _install_lib
from setuptools.command.develop import develop as _develop
from distutils.command.build import build as _build
from setuptools.command.test import test as TestCommand
from distutils.cm... | ael-code/libreant | setup.py | Python | agpl-3.0 | 4,963 | 0.002015 |
"""Polynomial factorization routines in characteristic zero. """
from __future__ import print_function, division
from sympy.polys.galoistools import (
gf_from_int_poly, gf_to_int_poly,
gf_lshift, gf_add_mul, gf_mul,
gf_div, gf_rem,
gf_gcdex,
gf_sqf_p,
gf_factor_sqf, gf_factor)
from sympy.poly... | kaushik94/sympy | sympy/polys/factortools.py | Python | bsd-3-clause | 34,338 | 0.00067 |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | dhermes/google-cloud-python | vision/google/cloud/vision_v1/types.py | Python | apache-2.0 | 2,315 | 0 |
"""
KeepNote Extension
new_file
Extension allows adding new filetypes to a notebook
"""
#
# KeepNote
# Copyright (c) 2008-2011 Matt Rasmussen
# Author: Matt Rasmussen <rasmus@mit.edu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | reshadh/Keepnote-LaTeX | keepnote/extensions/new_file/__init__.py | Python | gpl-2.0 | 17,272 | 0.004805 |
"""
MagPy
IAGA02 input filter
Written by Roman Leonhardt June 2012
- contains test, read and write function
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from io import open
from magpy.stream import *
#global va... | hschovanec-usgs/magpy | magpy/lib/format_iaga02.py | Python | gpl-3.0 | 20,820 | 0.011479 |
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/hydro/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, os.path.joi... | HailStorm32/Q.bo_stacks | qbo_webi/build/catkin_generated/generate_cached_setup.py | Python | lgpl-2.1 | 1,266 | 0.004739 |
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.management import call_command
from django.db import models, connections, transaction
from django.urls import reverse
from django_tenants.clone import CloneSchema
from .postgresql_backend.base import _check_sc... | tomturner/django-tenants | django_tenants/models.py | Python | mit | 9,732 | 0.001747 |
from sympy.utilities.pytest import XFAIL, raises
from sympy import (symbols, lambdify, sqrt, sin, cos, pi, atan, Rational, Float,
Matrix, Lambda, exp, Integral, oo, I)
from sympy.printing.lambdarepr import LambdaPrinter
from sympy import mpmath
from sympy.utilities.lambdify import implemented_function
import ma... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/sympy/utilities/tests/test_lambdify.py | Python | agpl-3.0 | 11,262 | 0.010478 |
from __future__ import unicode_literals
import os
from mopidy import config, exceptions, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'
ext_name = 'gmusic'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.di... | jeh/mopidy-gmusic | mopidy_gmusic/__init__.py | Python | apache-2.0 | 976 | 0 |
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
# In[2]:
train_df = pd.read_csv('./input/train.csv', index_col=0)
test_df = pd.read_csv('./input/test.csv', index_col=0)
# In[4]:
train_df.head()
# In[6]:
#label本身并不平滑。为了我们分类器的学习更加准确,我们会首先把label给“平滑化”(正态化)
import matplotlib.pyplot as plt
pr... | muxiaobai/CourseExercises | python/kaggle/competition/house-price/house.py | Python | gpl-2.0 | 4,162 | 0.010591 |
# -*- coding: utf8 -*-
# This file is a part of SMSShell
#
# Copyright (c) 2016-2018 Pierre GINDRAUD
#
# SMSShell 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... | Turgon37/SMSShell | SMSShell/commands/help.py | Python | gpl-3.0 | 1,862 | 0.001611 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('polls', '0004_pollanswer_zaventemtransport'),
]
operations = [
migrations.AlterField(
model_name='zaventemtransp... | tfiers/arenberg-online | polls/migrations/0005_auto_20150428_0016.py | Python | mit | 510 | 0.001961 |
from kervi.hal.gpio import IGPIODeviceDriver
class GPIODriver(IGPIODeviceDriver):
def __init__(self, gpio_id="generic_gpio"):
IGPIODeviceDriver.__init__(self, gpio_id)
pass
def _get_channel_type(self, channel):
from kervi.hal.gpio import CHANNEL_TYPE_GPIO, CHANNEL_TYPE_ANALOG_IN, CHA... | kervi/kervi | kervi-hal-win/kervi/platforms/windows/gpio.py | Python | mit | 1,575 | 0.000635 |
#!/usr/bin/env python3
_version = (0,4,0)
| arizona-phonological-imaging-lab/autotres | a3/constants.py | Python | apache-2.0 | 43 | 0.046512 |
# -*- coding: utf-8 -*-
# Copyright 2015 Spanish National Research Council
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | orviz/ooi | ooi/tests/fakes.py | Python | apache-2.0 | 17,912 | 0 |
from tkinter import ttk
from ozopython.colorLanguageTranslator import ColorLanguageTranslator
from .ozopython import *
from tkinter import *
def run(filename):
code = ozopython.compile(filename)
colorcode = ColorLanguageTranslator.translate(code)
def load(prog, prog_bar):
colormap = {
... | Kaarel94/Ozobot-Python | ozopython/__init__.py | Python | mit | 1,375 | 0.004364 |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | odoousers2014/odoo_addons-2 | clv_batch/history/__init__.py | Python | agpl-3.0 | 1,429 | 0.011896 |
#!/usr/bin/env python
# print_needed_variables.py
#
# Copyright (C) 2014, 2015 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
import os
import sys
if __name__ == '__main__' and __package__ is None:
dir_path = os.path.abspath(os.path.join(os.path.dirname(__f... | rcocetta/kano-profile | tools/print_needed_variables.py | Python | gpl-2.0 | 1,082 | 0.000924 |
from distutils.core import setup
setup(
name='browser-cookie3',
version='0.13.0',
packages=['browser_cookie3'],
# look for package contents in current directory
package_dir={'browser_cookie3': '.'},
author='Boris Babic',
author_email='boris.ivan.babic@gmail.com',
description='Loads cook... | borisbabic/browser_cookie3 | setup.py | Python | lgpl-3.0 | 632 | 0.003165 |
#----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, i... | dana-i2cat/felix | ofam/src/src/ext/sfa/trust/gid.py | Python | apache-2.0 | 9,265 | 0.004425 |
# coding=utf-8
"""Ingest workflow management tool
FileNameSource Class
"""
__copyright__ = "Copyright (C) 2016 University of Maryland"
__license__ = "GNU AFFERO GENERAL PUBLIC LICENSE, Version 3"
import abc
import os
import sys
import psycopg2
class FileNameSource:
def __init__(self): pass
def __ite... | UMD-DRASTIC/drastic | drastic/DrasticLoader/FileNameSource.py | Python | agpl-3.0 | 7,914 | 0.006444 |
##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | ULHPC/modules | easybuild/easybuild-framework/test/framework/utilities.py | Python | mit | 14,540 | 0.002682 |
import io
import base64
import gevent
from Tkinter import Label
from PIL import ImageTk, Image
class AnimatedImgLabel(Label):
# http://stackoverflow.com/questions/7960600/python-tkinter-display-animated-gif-using-pil
def __init__(self, master, data, encoding='base64', **kwargs):
if encoding == 'base64... | MoroGasper/client | client/plugins/ui/tk/animate.py | Python | gpl-3.0 | 1,581 | 0.003163 |
import os.path
from fabric.api import env
from fabsetup.fabutils import checkup_git_repo_legacy, needs_packages
from fabsetup.fabutils import needs_repo_fabsetup_custom, suggest_localhost
from fabsetup.fabutils import install_file_legacy, run, subtask, subsubtask, task
from fabsetup.utils import flo, update_or_append... | theno/fabsetup | fabsetup/fabfile/setup/powerline.py | Python | mit | 5,053 | 0.00099 |
import unittest
import random, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_rf, h2o_hosts, h2o_import as h2i
# RF train parameters
paramsTrainRF = {
'ntree' : 100,
'depth' : 300,
'bin_limit' : 20000,
'ignore' : None,
'stat_ty... | janezhango/BigDataMachineLearning | py/testdir_ec2/test_rf_iris.py | Python | apache-2.0 | 2,017 | 0.011403 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 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 3 of the License, or
# (at your option) any ... | kaplun/inspire-next | tests/integration/test_latex_exporting.py | Python | gpl-3.0 | 2,222 | 0.0027 |
#!/usr/bin/python
"""Test to verify presentation of selectable list items."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("<Control><Shift>n"))
sequence.append(KeyComboAction("Tab"))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAct... | pvagner/orca | test/keystrokes/oowriter/ui_role_list_item.py | Python | lgpl-2.1 | 1,384 | 0.001445 |
"""
@name: GDWCalc_Lite.py
@vers: 1.3
@author: Douglas Thor
@created: 2013-04-19
@modified: 2013-10-08
@descr: Calcualtes Gross Die per Wafer (GDW), accounting for
wafer flat, edge exclusion, and front-side-scribe (FSS)
... | dougthor42/GDWCalc | archive/GDWCalc_Lite v1.3.py | Python | gpl-2.0 | 8,852 | 0.001695 |
__source__ = 'https://leetcode.com/problems/walls-and-gates/description/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/walls-and-gates.py
# Time: O(m * n)
# Space: O(g)
#
# Description: Leetcode # 286. Walls and Gates
#
# You are given a m x n 2D grid initialized with these three possible values.
#
# -1 -... | JulyKikuAkita/PythonPrac | cs15211/WallsandGates.py | Python | apache-2.0 | 8,470 | 0.002597 |
# -*- coding: utf-8 -*-
from django.conf.urls import url
from api.account.views import RegistrationAPI, LoginAPI, LogoutAPI, UpdatePasswordAPI, UpdateProfileAPI
urlpatterns = [
url(r'^registration/$', RegistrationAPI.as_view(), name='registration'),
url(r'^login/$', LoginAPI.as_view(), name='login'),
url... | doraemonext/DEOnlineJudge | api/account/urls.py | Python | mit | 541 | 0.005545 |
from datetime import timedelta
CELERYBEAT_SCHEDULE = {
"reddit-validations": {
"task": "reddit.tasks.process_validations",
"schedule": timedelta(minutes=10),
},
"eveapi-update": {
"task": "eve_api.tasks.account.queue_apikey_updates",
"schedule": timedelta(minutes=10),
},... | nikdoof/test-auth | app/conf/celeryschedule.py | Python | bsd-3-clause | 1,084 | 0 |
#!/usr/bin/env python
"""
"""
# Python 2.6 and newer support
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from future.builtins import (
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
... | sfinucane/deviceutils | deviceutils/action/query.py | Python | apache-2.0 | 2,510 | 0.004382 |
# Copyright (C) 2014, Hitachi, Ltd.
#
# 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... | hybrid-storage-dev/cinder-fs-111t-hybrid-cherry | volume/drivers/hitachi/hbsd_iscsi.py | Python | apache-2.0 | 16,385 | 0 |
# This file is part of Buildbot. Buildbot 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 that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | pmisik/buildbot | master/buildbot/test/util/changesource.py | Python | gpl-2.0 | 3,747 | 0.000267 |
# Copyright (C) 2016 Fan Long, Martin Rianrd and MIT CSAIL
# Prophet
#
# This file is part of Prophet.
#
# Prophet 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 y... | jyi/ITSP | prophet-gpl/tools/libtiff-prepare-test.py | Python | mit | 1,700 | 0.018235 |
#
# Copyright 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#... | UpYou/relay | usrp_transmit_path.py | Python | gpl-3.0 | 3,809 | 0.006563 |
from bottle import redirect, request, abort, response
from db import db
from functools import wraps
from inspect import Signature
from user import User
class SessionPlugin(object):
name = 'SessionPlugin'
keyword = 'user'
api = 2
def __init__(self, loginpage):
self.loginpage = loginpage
d... | b3yond/ticketfrei | session.py | Python | isc | 1,063 | 0.001881 |
#
# Copyright (C) 2020 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | jkonecny12/anaconda | pyanaconda/modules/payloads/payload/dnf/initialization.py | Python | gpl-2.0 | 1,604 | 0.000623 |
from django import template
register = template.Library()
@register.filter
def multiplyby(value, arg):
return int(value * arg)
@register.filter
def subtractfrom(value, arg):
return arg - value
@register.filter
def plus(value, arg):
return value + arg
@register.filter
def appears_in(value, arg):
for name in... | rtts/qqq | qqq/templatetags/customfilters.py | Python | gpl-3.0 | 807 | 0.032218 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 New Dream Network, LLC (DreamHost)
#
# 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/li... | sajuptpm/neutron-ipam | neutron/tests/unit/services/loadbalancer/agent/test_api.py | Python | apache-2.0 | 4,901 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import MySQLdb, sys
# for ide
if False:
from gluon import *
def clumusuario(email):
"""consulto usuario tabla clave unificada"""
dbmysql = MySQLdb.connect(
host=myconf.take('datos.clum_srv'),
port=int(myconf.take('datos.clum_port')),
... | redondomarco/useradm | src/models/unificada.py | Python | gpl-3.0 | 16,421 | 0.015982 |
# Test which PDB entries error on PDB/mmCIF parsers
# Writes output to a file labelled with the week
import os
from datetime import datetime
from math import ceil
from Bio.PDB import PDBList
from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.MMCIFParser import MMCIFParser
start = datetime.now()
basedir = "."
pdbl =... | jgreener64/pdb-benchmarks | checkwholepdb/checkwholepdb.py | Python | mit | 2,107 | 0.004271 |
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', include('dashboard.urls', namespace='dashboard')),
u... | DigitalMockingbird/EULAThingy | eulathingy/urls.py | Python | mit | 637 | 0.006279 |
# Copyright (c) 2001 Autonomous Zone Industries
# Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
An object that makes some of the attributes of your class persistent, pickling
them and lazily writing them to a file.
"""
# from the Python Standard... | heathseals/CouchPotatoServer | libs/pyutil/PickleSaver.py | Python | gpl-3.0 | 8,932 | 0.002799 |
#!/usr/bin/python
# 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... | Tatsh-ansible/ansible | lib/ansible/modules/cloud/google/gce_instance_template.py | Python | gpl-3.0 | 19,433 | 0.000412 |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: romanText/rtObjects.py
# Purpose: music21 objects for processing roman numeral analysis text files
#
# Authors: Christopher Ariza
# Michael Scott Cuthbert
#
# Copyright: Co... | arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/music21/romanText/rtObjects.py | Python | mit | 48,702 | 0.004312 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-monitor/azure/mgmt/monitor/models/webhook_receiver_py3.py | Python | mit | 1,347 | 0 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Ui_ExportData.ui'
#
# Created: Sat May 28 00:16:57 2011
# by: PyQt4 UI code generator 4.8.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except A... | bbreslauer/PySciPlot | src/ui/Ui_ExportData.py | Python | gpl-3.0 | 13,612 | 0.004187 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import osv
from openerp.report import report_sxw
def titlize(journal_name):
words = journal_name.split()
while words.pop() != 'journal':
continue
return ' '.join(words)
... | vileopratama/vitech | src/addons/point_of_sale/report/pos_receipt.py | Python | mit | 2,154 | 0.003714 |
def Tmin(arg0, *args):
_min = arg0
for arg in args:
if arg < _min:
_min = arg
return _min
| Oreder/PythonSelfStudy | TestModule/Tmin.py | Python | mit | 122 | 0 |
__author__ = 'mdavid'
from attrdict import AttrDict
import os
# Addressimo Configuration
config = AttrDict()
# General Setup
config.site_url = 'addressimo.netki.com'
config.cache_loader_process_pool_size = 4
config.cache_loader_blocktx_pool_size = 15
config.bip32_enabled = True
config.bip70_enabled = True
config.bip... | netkicorp/addressimo | addressimo/config.py | Python | bsd-3-clause | 2,378 | 0.002103 |
#!/usr/bin/env python
from cogent.app.util import CommandLineApplication,\
CommandLineAppResult, ResultPath
from cogent.app.parameters import Parameter,ValuedParameter,Parameters
__author__ = "Shandy Wikman"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__contributors__ = ["Shandy Wikman"]
__license__... | sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/cogent/app/ilm.py | Python | mit | 3,567 | 0.017101 |
../common/cgi_runtests.py | ankurjimmy/catawampus | tr/vendor/tornado/maint/appengine/py27/cgi_runtests.py | Python | apache-2.0 | 25 | 0.04 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.