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 django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.map, name='map'), url(r'^mapSim', views.mapSim, name='mapSim'), url(r'^api/getPos', views.getPos, name='getPos'), url(r'^api/getProjAndPos', views.getProjAndPos, name='getProjAndPos'), ]
j-herrera/icarus
icarus_site/ISStrace/urls.py
Python
gpl-2.0
279
0.014337
# -*- coding: utf-8 -*- ## Copyright 2015 Rasmus Scholer Sorensen, rasmusscholer@gmail.com ## ## This file is part of Nascent. ## ## Nascent 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 Foundati...
scholer/nascent
nascent/graph_sim_nx/debug.py
Python
agpl-3.0
1,923
0.00832
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/spacecat/AutonomousFlight/simulation/simulation_ws/src/rotors_simulator/rotors_joy_interface/include".split(';') if "/home/spacecat/AutonomousFlight/simulation/simulation_ws/src/rotors_simulator/...
chickonice/AutonomousFlight
simulation/simulation_ws/build/rotors_simulator/rotors_joy_interface/catkin_generated/pkg.develspace.context.pc.py
Python
gpl-3.0
669
0.004484
#!/usr/bin/env python # Copyright (c) 2009, Purdue University # 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 copyright notice, this # l...
stephenlienharrell/roster-dns-management
roster-config-manager/setup.py
Python
bsd-3-clause
3,685
0.005156
import logging from future.moves.urllib.parse import quote from future.moves.urllib.error import HTTPError, URLError from future.moves.urllib.request import urlopen, Request logging.getLogger(__name__).addHandler(logging.NullHandler()) class Botan(object): """This class helps to send incoming events to your bot...
thonkify/thonkify
src/lib/telegram/contrib/botan.py
Python
mit
1,522
0.001971
# -*- coding: utf-8 -*- # __author__ = "Epsirom" class BaseError(Exception): def __init__(self, code, msg): super(BaseError, self).__init__(msg) self.code = code self.msg = msg def __repr__(self): return '[ERRCODE=%d] %s' % (self.code, self.msg) class InputError(BaseErro...
liuzhenyang14/Meeting
codex/baseerror.py
Python
gpl-3.0
629
0.00159
%bash/bin/python import sys import os import socket host = localhost port = 2275 } s == socket.socket { s.connect('$port' , '$host' ); def curlhttp ('http keepalive == 300 tps '): curlhttp ('http keepalive == 300 tps '): elif curlhttp ('https keepalive == <300 ('https keepalive == <300 ...
pesaply/sarafu
smpp.py
Python
mit
447
0.067114
# Bug in 2.7 base64.py _b32alphabet = { 0: 'A', 9: 'J', 18: 'S', 27: '3', 1: 'B', 10: 'K', 19: 'T', 28: '4', 2: 'C', 11: 'L', 20: 'U', 29: '5', 3: 'D', 12: 'M', 21: 'V', 30: '6', 4: 'E', 13: 'N', 22: 'W', 31: '7', 5: 'F', 14: 'O', 23: 'X', 6: 'G', 15: 'P', 24: 'Y', 7: 'H', 16: 'Q', 25: ...
moagstar/python-uncompyle6
test/simple_source/expression/03_map.py
Python
mit
361
0
import time import numpy as np import pandas as pd class DNB: """ Class representing Dynamic Naive Bayes. """ def __init__(self, debug=False): self.states_prior = None self.states_list = None self.features = None self.A = None self.B = None self.debug ...
tsabata/PyDNB
pydnb/dnb.py
Python
mit
6,733
0.001782
from couchpotato.core.event import addEvent from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification import os import subprocess log = CPLog(__name__) class Synoindex(Notification): index_path = '/usr/syno/bin/synoindex' def __init__(self): super(Synoin...
lebabouin/CouchPotatoServer-develop
couchpotato/core/notifications/synoindex/main.py
Python
gpl-3.0
1,104
0.009964
# Copyright 2015, Ansible, Inc. # Alan Rominger <arominger@ansible.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/LICENSE-2.0 # # Unless required ...
jangsutsr/tower-cli
tests/test_resources_job_template.py
Python
apache-2.0
8,499
0
# ***** 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 distributed ...
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/scripts/modules/bl_i18n_utils/bl_extract_messages.py
Python
gpl-3.0
39,687
0.004009
import logging import httplib from urllib import urlencode import os import sys from lxml import etree # This addresses the issues with relative paths file_dir = os.path.dirname(os.path.realpath(__file__)) goal_dir = os.path.join(file_dir, "../../") proj_root = os.path.abspath(goal_dir)+'/' sys.path.insert(0, proj_root...
ctsit/research-subject-mapper
rsm/utils/redcap_transactions.py
Python
bsd-3-clause
3,580
0.004469
# # File that determines what each URL points to. This uses _Python_ regular # expressions, not Perl's. # # See: # http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3 # from django.conf import settings from django.conf.urls.defaults import * from django.contrib import admin from django....
TaliesinSkye/evennia
wintersoasis-master/web/urls.py
Python
bsd-3-clause
3,320
0.005422
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
our-city-app/oca-backend
src/solutions/common/job/module_statistics.py
Python
apache-2.0
6,018
0.001329
""" .. py:attribute:: terminal Exactly like ``bearlibterminal.terminal``, but for any function that takes arguments ``x, y``, ``dx, dy``, or ``x, y, width, height``, you can instead pass a single argument of type :py:class:`Point` (for the first two) or :py:class:`Rect` (for the last). This makes ...
irskep/clubsandwich
clubsandwich/blt/nice_terminal.py
Python
mit
3,101
0.000322
"""The test for the threshold sensor platform.""" from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, STATE_UNKNOWN, TEMP_CELSIUS from homeassistant.setup import async_setup_component async def test_sensor_upper(hass): """Test if source is above threshold.""" config = { "binary_sensor": { ...
kennedyshead/home-assistant
tests/components/threshold/test_binary_sensor.py
Python
apache-2.0
11,914
0.001007
import cPickle as pickle import os users = list(pickle.load(file('users.pickle'))) pickle.dump(users, open("users.list.pickle.tmp", "wb")) os.rename("users.list.pickle.tmp", "users.list.pickle")
fgolemo/SocWeb-Reddit-Crawler
usersToFile.py
Python
mit
195
0.005128
# -*- coding: utf-8 -*- """ openload.io urlresolver plugin Copyright (C) 2015 tknorris 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 v...
mrknow/filmkodi
script.mrknow.urlresolver/lib/urlresolver9/plugins/ol_gmu.py
Python
apache-2.0
2,291
0.003492
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils import timezone from crm.models import Person from geocodable.models import LocationAlias import uuid class Event(models.Model): name = models.CharField(max_length=200) timestamp = models.DateTimeFie...
tdfischer/organizer
events/models.py
Python
agpl-3.0
1,124
0.003559
# Double pendulum formula translated from the C code at # http://www.physics.usyd.edu.au/~wheat/dpend_html/solve_dpend.c from numpy import sin, cos import numpy as np import matplotlib.pyplot as plt import scipy.integrate as integrate import matplotlib.animation as animation G = 9.8 # acceleration due to gravity, in...
bundgus/python-playground
matplotlib-playground/examples/animation/double_pendulum_animated.py
Python
mit
2,354
0.001274
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
manojngb/Crazyfly_simple_lift
src/cfclient/ui/widgets/ai.py
Python
gpl-2.0
8,202
0
#!/usr/bin/env python # by teknohog # Python wrapper for Xilinx Serial Miner # Host/user configuration is NOT USED in ltctestmode.py ... # host = "localhost" # Stratum Proxy alternative # user = "username.1" # Your worker goes here # password = "password" # Worker password, NOT your account password # http_port = "8...
ychaim/FPGA-Litecoin-Miner
experimental/LX150-EIGHT-B/ltcminer-test-dynclock.py
Python
gpl-3.0
8,949
0.027154
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 30, transform = "RelativeDifference", sigma = 0.0, exog_count = 20, ar_order = 0);
antoinecarme/pyaf
tests/artificial/transf_RelativeDifference/trend_PolyTrend/cycle_30/ar_/test_artificial_32_RelativeDifference_PolyTrend_30__20.py
Python
bsd-3-clause
273
0.084249
import logging import os from autotest.client.shared import error, utils from virttest import data_dir, utils_test def umount_fs(mountpoint): if os.path.ismount(mountpoint): result = utils.run("umount -l %s" % mountpoint, ignore_status=True) if result.exit_status: logging.debug("Umount...
kylazhang/virt-test
libguestfs/tests/guestmount.py
Python
gpl-2.0
2,277
0
import json import logging import inspect from .decorators import pipeline_functions, register_pipeline from indra.statements import get_statement_by_name, Statement logger = logging.getLogger(__name__) class AssemblyPipeline(): """An assembly pipeline that runs the specified steps on a given set of statem...
johnbachman/indra
indra/pipeline/pipeline.py
Python
bsd-2-clause
16,636
0.00006
"""Mode which allows the player to select another mode to run.""" from mpf.core.utility_functions import Util from mpf.core.mode import Mode class Carousel(Mode): """Mode which allows the player to select another mode to run.""" __slots__ = ["_all_items", "_items", "_select_item_events", "_next_item_events...
missionpinball/mpf
mpf/modes/carousel/code/carousel.py
Python
mit
6,517
0.003376
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
Dev-Cloud-Platform/Dev-Cloud
dev_cloud/cc1/src/cm/utils/threads/image.py
Python
apache-2.0
8,639
0.002084
# # Copyright 2015 chinaskycloud.com.cn # # Author: Chunyang Liu <liucy@chinaskycloud.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/LICENSE-2.0 ...
whiteear/newrelic-plugin-agent
newrelic_plugin_agent/publisher/__init__.py
Python
bsd-3-clause
918
0.005447
""" putJSONdata.py Copyright 2016 OSIsoft, 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 a...
danielElopez/PI-Connector-for-UFL-Samples
COMPLETE_SOLUTIONS/North American General Bike Feed/putJSONdata_SF_Bikes_service.py
Python
apache-2.0
3,727
0.003756
# Copyright (C) 2012, Ansgar Burchardt <ansgar@debian.org> # # 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 pr...
tanglu-org/tdak
daklib/fstransactions.py
Python
gpl-2.0
6,500
0.001385
"""flex_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
twerp/django-admin-flexselect-py3
flex_project/urls.py
Python
cc0-1.0
816
0
# -*- coding: utf-8 -*- """ InformationMachineAPILib.Models.GetNutrientsWrapper """ from InformationMachineAPILib.APIHelper import APIHelper from InformationMachineAPILib.Models.NutrientInfo import NutrientInfo from InformationMachineAPILib.Models.MetaBase import MetaBase class GetNutrientsWrapper(object): ...
information-machine/information-machine-api-python
InformationMachineAPILib/Models/GetNutrientsWrapper.py
Python
mit
2,942
0.003059
# # 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...
Juniper/ceilometer
ceilometer/event/storage/impl_elasticsearch.py
Python
apache-2.0
11,518
0
########################################################################## # # Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
chippey/gaffer
python/GafferImageTest/ObjectToImageTest.py
Python
bsd-3-clause
3,067
0.025106
"""Generic runner functions.""" # from lutris.util.log import logger __all__ = ( # Native "linux", "steam", "browser", "web", # Microsoft based "wine", "winesteam", "dosbox", # Multi-system "mame", "mess", "mednafen", "scummvm", "residualvm", "libretro", "ags", # Commdore "fsuae", "vice...
RobLoach/lutris
lutris/runners/__init__.py
Python
gpl-3.0
1,920
0
import os def numCPUs(): if not hasattr(os, "sysconf"): raise RuntimeError("No sysconf detected.") return os.sysconf("SC_NPROCESSORS_ONLN") bind = "0.0.0.0:8000" # workers = numCPUs() * 2 + 1 workers = 1 backlog = 2048 worker_class = "sync" # worker_class = "gevent" debug = True # daemon = True # err...
yewsiang/botmother
gunicorn.py
Python
agpl-3.0
417
0.002398
"""Initial schema Revision ID: 2b8459f1e2d6 Revises: None Create Date: 2013-10-22 14:31:32.654367 """ # revision identifiers, used by Alembic. revision = '2b8459f1e2d6' down_revision = None from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): ### commands aut...
alex/changes
migrations/versions/2b8459f1e2d6_initial_schema.py
Python
apache-2.0
9,758
0.016807
# -*- coding: utf-8 -*- __author__ = """JanFan""" __email__ = 'guangyizhang.jan@gmail.com' __version__ = '0.1.0'
JanFan/py-aho-corasick
py_aho_corasick/__init__.py
Python
mit
114
0
# -*- coding: utf-8 -*- from sphinx.builders.html import JSONHTMLBuilder from sphinx.util import jsonimpl class DeconstJSONImpl: """ Enhance the default JSON encoder by adding additional keys. """ def dump(self, obj, fp, *args, **kwargs): self._enhance(obj) return jsonimpl.dump(obj, ...
smashwilson/deconst-preparer-sphinx
deconstrst/builder.py
Python
apache-2.0
1,067
0
# -*- coding: utf-8 -*- import os,tcxparser cd = os.path.dirname(os.path.abspath(__file__)) #use to browse tcx files at the correct location file_list=os.listdir(os.getcwd()) f=open("result.txt","a") f.write("date (ISO UTC Format)"+'\t'+"Distance [m]"+'\t'+"Duration [s]"+'\n') for a in file_list: if a == "result...
tdargent/TCXfilestodata
readTCXFiles.py
Python
mit
784
0.026786
#!/usr/bin/python3 # -*- Coding : UTF-8 -*- from os import path import github_update_checker from setuptools import setup, find_packages file_path = path.abspath(path.dirname(__file__)) with open(path.join(file_path, "README.md"), encoding="UTF-8") as f: long_description = f.read() setup( name="github_upda...
BenjaminSchubert/py_github_update_checker
setup.py
Python
mit
995
0
# Copyright (c) 2013 Yubico AB # 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, this list of conditi...
Yubico/yubiadmin
yubiadmin/util/app.py
Python
bsd-2-clause
7,953
0.000251
# -*- 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 index on 'Tweet', fields ['analyzed_by'] db.create_index(u'twitt...
michaelbrooks/django-twitter-stream
twitter_stream/migrations/0002_auto__add_index_tweet_analyzed_by__add_index_tweet_created_at.py
Python
mit
6,130
0.007341
#!/usr/bin/env python """Implementation of client-side file-finder subactions.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import abc from future.utils import with_metaclass from grr_response_client import client_utils from grr_response_client imp...
dunkhong/grr
grr/client/grr_response_client/client_actions/file_finder_utils/subactions.py
Python
apache-2.0
4,871
0.006159
# Copyright (c) 2014 VMware, 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...
NetApp/cinder
cinder/volume/drivers/vmware/datastore.py
Python
apache-2.0
12,036
0
### Generating picture frames to a "pic" folder #from pylab import * import numpy as np from time import sleep import matplotlib matplotlib.use("Agg") from matplotlib import rc matplotlib.rcParams['text.usetex'] = True matplotlib.rcParams['text.latex.unicode'] = True import matplotlib.pyplot as plt #matplotlib.use("A...
AlxMar/conduction-cylinder
genpics.py
Python
gpl-3.0
2,141
0.01915
#-*- coding: utf-8 -*- from django.contrib.gis.db.models import DateTimeField, Model class Base(Model): created = DateTimeField(auto_now_add=True, null=True) modified = DateTimeField(auto_now=True, null=True) class Meta: abstract = True def __str__(self): try: for propnam...
FirstDraftGIS/firstdraft
projfd/appfd/models/base.py
Python
apache-2.0
940
0.006383
#!/usr/bin/python # # Copyright 2020 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 ag...
GoogleCloudPlatform/datacatalog-connectors
google-datacatalog-connectors-commons/src/google/datacatalog_connectors/commons/monitoring/__init__.py
Python
apache-2.0
744
0
import process_operations as po import module_map_icons def process_entry(processor, txt_file, entry, index): entry_len = len(entry) output_list = ["%s %d %s %f %d " % (entry[0], entry[1], entry[2], entry[3], processor.process_id(entry[4], "snd"))] triggers = [] if entry_len >= 8: output_list.append("%f %f...
RaJiska/Warband-PW-Punishments-Manager
scripts/process_map_icons.py
Python
gpl-3.0
796
0.020101
""" Monkey patch and defuse all stdlib xml packages and lxml. """ import sys patched_modules = ( 'lxml', 'ElementTree', 'minidom', 'pulldom', 'sax', 'expatbuilder', 'expatreader', 'xmlrpc', ) if any(module in sys.modules for module in patched_modules): existing_modules = [(module,...
bqbn/addons-server
src/olympia/lib/safe_xml.py
Python
bsd-3-clause
774
0.002584
from collections import namedtuple from corehq.apps.change_feed.consumer.feed import KafkaChangeFeed from corehq.apps.change_feed.document_types import GROUP from corehq.apps.groups.models import Group from corehq.elastic import stream_es_query, get_es_new, ES_META from corehq.pillows.mappings.user_mapping import USER_...
qedsoftware/commcare-hq
corehq/pillows/groups_to_user.py
Python
bsd-3-clause
4,115
0.002916
#!/usr/bin/env python from setuptools import setup, find_packages tests_requires = [ 'ddt>=1.0.0' ] dev_requires = [ 'Sphinx==1.2.2', ] install_requires = [ 'pbr!=2.1.0', 'Babel!=2.4.0,>=2.3.4', 'cmd2<0.9.0', # TODO: Drop restriction after Waldur is migrated to Python 3. 'iptools>=0.6.1', ...
opennode/nodeconductor-openstack
setup.py
Python
mit
1,602
0.001873
# # Copyright (C) 2014 Dell, 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 wri...
JPWKU/unix-agent
src/dcm/agent/tests/unit/test_cloudmetadata.py
Python
apache-2.0
9,676
0
from __future__ import absolute_import from contextlib import contextmanager from copy import copy from flask import g, request from flask.globals import _app_ctx_stack, _request_ctx_stack from .base import VersioningManager as BaseVersioningManager class VersioningManager(BaseVersioningManager): _actor_cls = ...
kvesteri/postgresql-audit
postgresql_audit/flask.py
Python
bsd-2-clause
2,063
0
from pylab import * def stem_user(user, channel_list, start_index, stop_index): data = user.windowData for channel in channel_list: stem_pandas_column(data, channel, start_index, stop_index) def stem_pandas_column(dataframe, columname, start_index, stop_index): column = dataframe[columname] ...
joergsimon/gesture-analysis
visualise/Stem.py
Python
apache-2.0
664
0.004518
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 """Generate SystemVerilog designs from IpBlock object""" import logging as log import os from typing import Dict, Optional, Tuple from mako import exceptions # type: igno...
lowRISC/opentitan
util/reggen/gen_rtl.py
Python
apache-2.0
5,763
0
#Stage 2 Update (Python 3) from __future__ import print_function from __future__ import unicode_literals from builtins import str import datetime from optparse import make_option from django.conf import settings from django.core.mail import mail_admins from django.core.management import CommandError from django.core.ma...
DeanSherwin/django-dynamic-scraper
dynamic_scraper/management/commands/check_last_checker_deletes.py
Python
bsd-3-clause
3,890
0.007969
from __future__ import division, print_function import json from collections import Iterable, OrderedDict, namedtuple import numpy as np from six import string_types def isnamedtuple(obj): """Heuristic check if an object is a namedtuple.""" return isinstance(obj, tuple) \ and hasattr(obj, "_field...
chemlab/chemlab
chemlab/core/serialization.py
Python
gpl-3.0
2,379
0.003363
import pyparsing """ The query language that won't die. Syntax: Typical search engine query language, terms with boolean operators and parenthesized grouping: (term AND (term OR term OR ...) AND NOT term ...) In it's simplest case, xaql searches for a list of terms: term term term ... ...
michelp/xodb
xodb/xaql.py
Python
mit
1,060
0.001887
# coding: utf-8 import time, datetime # 接收的参数可以为:1. 时间戳字符串 2. datetime, 3. None def unixtime_fromtimestamp(dt = None): if dt and isinstance(dt, datetime.datetime) : return int(time.mktime(dt.timetuple())) elif dt and isinstance(dt, basestring) : return int(time.mktime(time.strptime(dt, '%Y-%m-%d %H:%M...
cychenyin/sfproxy
py/timeutils.py
Python
apache-2.0
1,010
0.02521
import math class Neptune: """ NEPTUNE - VSOP87 Series Version C HELIOCENTRIC DYNAMICAL ECLIPTIC AND EQUINOX OF THE DATE Rectangular (X,Y,Z) Coordinates in AU (Astronomical Units) Series Validity Span: 4000 BC < Date < 8000 AD Theoretical accuracy over span: +-1 arc sec ...
zdomjus60/astrometry
vsop87c/neptune.py
Python
cc0-1.0
232,946
0.003778
''' Generate a pdf knittinf pattern + chart from a bitmap image ''' __author__ = 'Thomas Payne' __email__ = 'tomkentpayne@hotmail.com' __copyright__ = 'Copyright © 2015 Thomas Payne' __licence__ = 'GPL v2' from argparse import ArgumentParser from pattern import Pattern def parse_sys_args(): ''' Parse arguments fo...
tomkentpayne/knitify
source/knitify.py
Python
gpl-2.0
676
0.008889
# Commands submodule definition. # # Import all python files in the directory to simplify adding commands. # Just drop a new command .py file in the directory and it will be picked up # automatically. # # Author: Tony DiCola # # The MIT License (MIT) # # Copyright (c) 2015 Adafruit Industries # # Permission is hereby ...
adafruit/Adafruit_Legolas
Adafruit_Legolas/commands/__init__.py
Python
mit
1,864
0.002682
""" Various bayesian regression """ # Authors: V. Michel, F. Pedregosa, A. Gramfort # License: BSD 3 clause from math import log import numpy as np from scipy import linalg from ._base import LinearModel, _rescale_data from ..base import RegressorMixin from ._base import _deprecate_normalize from ..utils.extmath imp...
shyamalschandra/scikit-learn
sklearn/linear_model/_bayes.py
Python
bsd-3-clause
26,416
0.000492
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
stonebig/bokeh
bokeh/colors/named.py
Python
bsd-3-clause
13,025
0.015432
import codecs import json import os import random import asyncio import re from cloudbot import hook from cloudbot.util import textgen @hook.on_start() def load_attacks(bot): """ :type bot: cloudbot.bot.CloudBot """ global larts, insults, flirts, kills, slaps, moms with codecs.open(os.path.join(...
nidhididi/CloudBot
plugins/attacks.py
Python
gpl-3.0
3,577
0.00643
#!/usr/bin/python ########################################################### # # Copyright (c) 2008, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way wi...
rvanlaar/tactic-client
test/pipeline_test.py
Python
epl-1.0
3,879
0.006961
from werkzeug.security import generate_password_hash, check_password_hash def hash_pwd(password): return generate_password_hash(password) def check_password(hashed, password): return check_password_hash(hashed, password)
OVERLOADROBOTICA/OVERLOADROBOTICA.github.io
mail/formspree-master/formspree/users/helpers.py
Python
mit
231
0.008658
import webuntis import mock from webuntis.utils.third_party import json from .. import WebUntisTestCase, BytesIO class BasicUsage(WebUntisTestCase): def test_parse_result(self): x = webuntis.utils.remote._parse_result a = {'id': 2} b = {'id': 3} self.assertRaisesRegex(webuntis.err...
maphy-psd/python-webuntis
tests/utils/test_remote.py
Python
bsd-3-clause
1,228
0
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import hashlib import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common import gyp.msvs_...
DanialLiu/SkiaWin32Port
third_party/externals/gyp/pylib/gyp/generator/ninja.py
Python
bsd-3-clause
74,180
0.006794
# 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 distributed in the hope that it will be useful, # but...
cnewcome/sos
sos/plugins/zfs.py
Python
gpl-2.0
1,124
0
import os from PIL import Image import numpy from utils import ensure_dir DRAWABLE = 'drawable' class ImageTypeException(Exception): pass class Density(object): LDPI = 'ldpi' MDPI = 'mdpi' HDPI = 'hdpi' XHDPI = 'xhdpi' XXHDPI = 'xxhdpi' XXXHDPI = 'xxxhdpi' RATIOS = { LDPI: ...
dimagi/commcare-android
images/dpi_manager.py
Python
apache-2.0
4,399
0.000227
# coding=utf-8 """HCTSA test time series.""" import os.path as op import numpy as np from pyopy.hctsa.hctsa_config import HCTSA_TESTTS_DIR def hctsa_sine(): return np.loadtxt(op.join(HCTSA_TESTTS_DIR, 'SY_sine.dat')) def hctsa_noise(): return np.loadtxt(op.join(HCTSA_TESTTS_DIR, 'SY_noise.dat')) def hctsa...
strawlab/pyopy
pyopy/hctsa/hctsa_data.py
Python
bsd-3-clause
540
0
#!/usr/bin/env python3 # Copyright 2017 gRPC 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 applicable law...
vjpai/grpc
tools/run_tests/sanity/check_port_platform.py
Python
apache-2.0
2,915
0.000686
# -*- coding: utf-8 -*- """ lets.alarm ~~~~~~~~~~ An event which is awoken up based on time. :copyright: (c) 2013-2018 by Heungsub Lee :license: BSD, see LICENSE for more details. """ import operator import time as time_ from gevent import get_hub, Timeout from gevent.event import Event __all__ = [...
sublee/lets
lets/alarm.py
Python
bsd-3-clause
3,197
0.000313
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsDefaultValue. .. note:: 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. """ ...
pblottiere/QGIS
tests/src/python/test_qgsdefaultvalue.py
Python
gpl-2.0
1,300
0
#!/usr/bin/python # -*- coding: utf-8 -*- """ This script adds a missing references section to pages. It goes over multiple pages, searches for pages where <references /> is missing although a <ref> tag is present, and in that case adds a new references section. These command line parameters can be used to specify w...
icyflame/batman
scripts/noreferences.py
Python
mit
25,133
0.000331
import subprocess import os import sys import commands import numpy as np import pyroms import pyroms_toolbox from remap_bio_woa import remap_bio_woa from remap_bio_glodap import remap_bio_glodap data_dir_woa = '/archive/u1/uaf/kate/COBALT/' data_dir_glodap = '/archive/u1/uaf/kate/COBALT/' dst_dir='./' src_grd = py...
kshedstrom/pyroms
examples/cobalt-preproc/Clim_bio/make_clim_file_bio_addons.py
Python
bsd-3-clause
4,460
0.01009
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
jiivan/python-oauth2
oauth2/__init__.py
Python
mit
25,600
0.003984
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2009 Edgewall Software # Copyright (C) 2007 Alec Thomas <alec@swapoff.org> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.ed...
dokipen/trac
tracopt/perm/authz_policy.py
Python
bsd-3-clause
8,731
0.002978
# Copyright (c) 2013 LE GOFF Vincent # 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 copyright notice, this # list of conditions and th...
v-legoff/croissant
croissant/output/__init__.py
Python
bsd-3-clause
1,636
0
from django import forms from event.models import Event class EventForm(forms.ModelForm): class Meta: model = Event fields = [ 'date', 'starttime', 'endtime', 'event', 'location', 'organization', 'speakers', 'rating', 'feedback' ...
kwailamchan/programming-languages
python/django/elf/elf/src/event/forms.py
Python
mit
332
0.006024
ucodes = { "U0001" : "High Speed CAN Communication Bus" , "U0002" : "High Speed CAN Communication Bus (Performance)" , "U0003" : "High Speed CAN Communication Bus (Open)" , "U0004" : "High Speed CAN Communication Bus (Low)" , "U0005" : "High Speed CAN Communication Bus (High)" , "U0006" : "High Speed ...
lkarsten/pyobd
network_codes.py
Python
gpl-2.0
18,096
0.066589
from ._fs import Vlermv from ._s3 import S3Vlermv from . import serializers, transformers # For backwards compatibility cache = Vlermv.memoize
tlevine/vlermv
vlermv/__init__.py
Python
agpl-3.0
144
0
"""The base Controller API Provides the BaseController class for subclassing. """ from pylons.controllers import WSGIController from pylons.templating import render_mako as render from quanthistling.model.meta import Session #from quanthistling.lib.helpers import History from pylons import request, response, session...
FrankNagel/qlc
src/webapp/quanthistling/quanthistling/lib/base.py
Python
gpl-3.0
1,177
0.004248
from gain import Css, Item, Parser, Xpath def test_parse(): html = '<title class="username">tom</title><div class="karma">15</div>' class User(Item): username = Xpath('//title') karma = Css('.karma') parser = Parser(html, User) user = parser.parse_item(html) assert user.results...
babykick/gain
tests/test_parser.py
Python
gpl-3.0
757
0.002642
import os import sys from Bio import SeqIO with open(sys.argv[1], "rU") as handle, open(sys.argv[2], "r") as segments, open(sys.argv[3],"w") as out_handle: """ This function takes fasta file as first argument. As second argument it takes tab delimited file containing queryid and start and end po...
NIASC/VirusMeta
seq_corret_module/seg_trim.py
Python
gpl-3.0
963
0.030114
from functools import wraps from aiohttp.abc import AbstractView from aiohttp.web import HTTPForbidden, json_response, StreamResponse try: import ujson as json except ImportError: import json from .cfg import cfg from .utils import url_for, redirect, get_cur_user def _get_request(args): # Supports class...
imbolc/aiohttp-login
aiohttp_login/decorators.py
Python
isc
1,959
0
from datetime import datetime from json import load, dump import logging from logging import INFO from os import listdir, makedirs, remove from os.path import join, exists import requests import shelve from static_aid import config from static_aid.DataExtractor import DataExtractor, bytesLabel def makeDir(dirPath): ...
GALabs/StaticAid
static_aid/DataExtractor_Adlib.py
Python
mit
27,394
0.00522
from iRODSLibrary import iRODSLibrary __version__ = "0.0.4" class iRODSLibrary(iRODSLibrary): """ iRODSLibrary is a client keyword library that uses the python-irodsclient module from iRODS https://github.com/irods/python-irodsclient Examples: | Connect To Grid | iPlant | data.iplantcoll...
jerry57/Robotframework-iRODS-Library
src/iRODSLibrary/__init__.py
Python
bsd-3-clause
422
0.004739
#! /usr/bin/env python # coding=utf-8 # Copyright (c) 2019 Uber Technologies, 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 # # Unles...
uber/ludwig
ludwig/collect.py
Python
apache-2.0
15,469
0.000388
#======================================================================= # # Python Lexical Analyser # # Exception classes # #======================================================================= import exceptions class PlexError(exceptions.Exception): message = "" class PlexTypeError(PlexError, TypeError): ...
onoga/wm
src/gnue/common/external/plex/Errors.py
Python
gpl-2.0
1,109
0.027953
from ..route_handler import BaseModelRouter, SUCCESS from ..serializers.model_serializer import ModelSerializer from .dragon_test_case import DragonTestCase from swampdragon.tests.models import TwoFieldModel class Serializer(ModelSerializer): class Meta: update_fields = ('text', 'number') model = ...
h-hirokawa/swampdragon
swampdragon/tests/test_base_model_router_subscribe.py
Python
bsd-3-clause
911
0.002195
## ## This file is part of the sigrok-meter project. ## ## Copyright (C) 2015 Jens Steinhauser <jens.steinhauser@gmail.com> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2...
swegener/sigrok-meter
multiplotwidget.py
Python
gpl-3.0
6,148
0.00244
from scrapy.commands.crawl import Command from scrapy.exceptions import UsageError class CustomCrawlCommand(Command): def run(self, args, opts): if len(args) < 1: raise UsageError() elif len(args) > 1: raise UsageError("running 'scrapy crawl' with more than one spider is no...
lnxpgn/scrapy_multiple_spiders
commands/crawl.py
Python
mit
809
0.002472
#!/usr/bin/env python #-*- coding: utf-8 -*- import paramiko def traffic(ip,username,passwd): try: ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(ip,22,username,passwd,timeout=5) stdin, stdout, stderr = ssh.exec_command('cat /proc/n...
wwgc/trafficstats
trafficstats.py
Python
gpl-2.0
912
0.032151
# -*- coding:utf-8 -*- def cipher(string): encoding = "" for character in string: #range 97 -> 123 = a-z if 97 <= ord(character) <= 123: #encode 219 - character number encoding +=chr(219-ord(character)) else: encoding += character retur...
yasutaka/nlp_100
johnny/第1章/08.py
Python
mit
425
0.009412
""" Microformats2 is a general way to mark up any HTML document with classes and propeties. This library parses structured data from a microformatted HTML document and returns a well-formed JSON dictionary. """ from .version import __version__ from .parser import Parser, parse from .mf_helpers import get_url __all__...
tommorris/mf2py
mf2py/__init__.py
Python
mit
369
0
"""Event loop implementation that uses the `asyncio` standard module. The `asyncio` module was added to python standard library on 3.4, and it provides a pure python implementation of an event loop library. It is used as a fallback in case pyuv is not available(on python implementations other than CPython). Earlier p...
meitham/python-client
neovim/msgpack_rpc/event_loop/asyncio.py
Python
apache-2.0
4,579
0