commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
0f4e977f18dc1e3b9bbe2f25c3c326ac769fecbd | order size to have thumbnail in first | insight/api/async.py | insight/api/async.py | # -*- coding: utf-8 -*-
"""Async API view"""
from flask import abort, request
from redis import StrictRedis
import json
from insight.api.config import INSIGHT_ENGINES
try:
import settings
except ImportError:
settings = None
REDIS_QUEUE_KEY = getattr(settings, 'REDIS_QUEUE_KEY', 'insight')
REDIS_HOST = getatt... | # -*- coding: utf-8 -*-
"""Async API view"""
from flask import abort, request
from redis import StrictRedis
import json
from insight.api.config import INSIGHT_ENGINES
try:
import settings
except ImportError:
settings = None
REDIS_QUEUE_KEY = getattr(settings, 'REDIS_QUEUE_KEY', 'insight')
REDIS_HOST = getatt... | Python | 0 |
ea545f205fd495f996b90910857af6e87da14272 | update adapter to use new scheme | courses/adapter.py | courses/adapter.py | from courses.models import Semester, Department, Course
from ccxp.fetch import Browser
def get_browser(browser=None):
if browser is None:
browser = Browser()
print(browser.get_captcha_url())
browser.set_captcha(input('Input captcha from above url: '))
def update_departments(browser=None)... | from courses.models import Semester, Department, Course
from ccxp.fetch import Browser
def update_departments(browser=None):
if browser is None:
browser = Browser()
new = update = 0
for department in Browser().get_departments():
if Department.objects.filter(abbr=department['abbr']).exists(... | Python | 0 |
0116f38160c03939306470127f0489c98aeee954 | Update nanomsg build file | shipyard/shipyard/nanomsg/build.py | shipyard/shipyard/nanomsg/build.py | """Build nanomsg from source."""
from foreman import define_parameter, define_rule, decorate_rule
from shipyard import (
ensure_directory,
git_clone,
run_commands,
install_packages,
copy_libraries,
)
(define_parameter('deps')
.with_doc("""Build-time Debian packages.""")
.with_type(list)
.wi... | """Build nanomsg from source."""
from foreman import define_parameter, define_rule, decorate_rule
from shipyard import (
ensure_directory,
git_clone,
run_commands,
install_packages,
copy_libraries,
)
(define_parameter('deps')
.with_doc("""Build-time Debian packages.""")
.with_type(list)
.wi... | Python | 0 |
fe3798cf932880b2eac14e86d2652d08fdcbd093 | Make method static to make it easier to move later. | src/tdl/client.py | src/tdl/client.py | __author__ = 'tdpreece'
__author__ = 'tdpreece'
import logging
import time
import json
from collections import OrderedDict
import stomp
logger = logging.getLogger('tdl.client')
logger.addHandler(logging.NullHandler())
class Client(object):
def __init__(self, hostname, port, username):
self.hostname = ho... | __author__ = 'tdpreece'
__author__ = 'tdpreece'
import logging
import time
import json
from collections import OrderedDict
import stomp
logger = logging.getLogger('tdl.client')
logger.addHandler(logging.NullHandler())
class Client(object):
def __init__(self, hostname, port, username):
self.hostname = ho... | Python | 0 |
22f3b74fec790847c3e353aad84b51252637a90f | Revert "oe.path.relative: switch to a different appraoch" | lib/oe/path.py | lib/oe/path.py | def join(*paths):
"""Like os.path.join but doesn't treat absolute RHS specially"""
import os.path
return os.path.normpath("/".join(paths))
def relative(src, dest):
""" Return a relative path from src to dest.
>>> relative("/usr/bin", "/tmp/foo/bar")
../../tmp/foo/bar
>>> relative("/usr/bi... | def join(*paths):
"""Like os.path.join but doesn't treat absolute RHS specially"""
from os import sep
from os.path import normpath
return normpath(sep.join(paths))
def relative(src, dest=None):
""" Return a relative path from src to dest(default=cwd).
>>> relative("/usr/bin", "/tmp/foo/bar")
... | Python | 0 |
0f004830bd220ad8da1d4b151897630431d2f195 | tweak scoring functions, always | cryptools/crack.py | cryptools/crack.py | # -*- coding: utf-8 -*-
import math
import string
from stringutils import convert, freq
def brute_xor(cyphertext, st_freqs):
"""Bruteforce a given single-character XOR-encrypted cyphertext.
Statistical information is used to choose which character is the most
likely key.
:param cyphertext: the cyph... | # -*- coding: utf-8 -*-
import string
from stringutils import convert, freq
def brute_xor(cyphertext, st_freqs):
"""Bruteforce a given single-character XOR-encrypted cyphertext.
Statistical information is used to choose which character is the most
likely key.
:param cyphertext: the cyphertext to cr... | Python | 0 |
d48099080cedc81e70f79cbf45514cd77c5329eb | fix recorder bug | uliweb/contrib/recorder/middle_recorder.py | uliweb/contrib/recorder/middle_recorder.py | from uliweb import Middleware
from uliweb.utils.common import request_url
class RecorderrMiddle(Middleware):
ORDER = 600
def process_response(self, request, response):
from uliweb import settings, functions, json_dumps
import base64
#if not debug status it'll quit
... | from uliweb import Middleware
from uliweb.utils.common import request_url
class RecorderrMiddle(Middleware):
ORDER = 600
def process_response(self, request, response):
from uliweb import settings, functions, json_dumps
import base64
#if not debug status it'll quit
... | Python | 0.000001 |
c6a9fcfe817128d3e7b0f52625bcd2e6c1c92f76 | fix #4491: auth1 test needs sapi for login (#4492) | tests/auth1_test.py | tests/auth1_test.py | # -*- coding: utf-8 -*-
u"""Test sirepo.auth
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
from pykern import pkcollections
from sirepo import srunit
@sru... | # -*- coding: utf-8 -*-
u"""Test sirepo.auth
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
from pykern import pkcollections
from sirepo import srunit
@sru... | Python | 0 |
646db72eca34f6006d189f0a143d0c00388d1955 | Update viehicle.py | sketches/ev_steering_1/viehicle.py | sketches/ev_steering_1/viehicle.py | class Viehicle():
def __init__(self, x, y):
self.acceleration = PVector(0, 0)
self.velocity = PVector(0, 0)
self.location = PVector(x, y)
self.r = 8.0
self.maxspeed = 5
self.maxforce = 0.1
self.d = 25
def update(self):
self.velocity.add(s... | class Viehicle():
def __init__(self, x, y):
self.acceleration = PVector(0, 0)
self.velocity = PVector(0, 0)
self.location = PVector(x, y)
self.r = 8.0
self.maxspeed = 5
self.maxforce = 0.1
self.d = 25
def update(self):
self.velocity.add(s... | Python | 0 |
b58c8b4f9d049207b7e7e0e4de7058959df90b70 | Use sendgrid's Subject type when sending email. (#1033) | src/appengine/libs/mail.py | src/appengine/libs/mail.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 |
425ae0042b050773e7c55f3cdc34ca3a68069238 | use test app | sacrud/pyramid_ext/tests/__init__.py | sacrud/pyramid_ext/tests/__init__.py | # -*- coding: utf-8 -*-
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine, orm
import unittest
from sacrud.tests.test_models import User, Profile, PHOTO_PATH, Base
from sacrud.action import get_relations, delete_fileobj, read, update, delete
from sacrud.action import get_pk, index, create
fr... | # -*- coding: utf-8 -*-
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine, orm
import unittest
from sacrud.tests.test_models import User, Profile, PHOTO_PATH, Base
from sacrud.action import get_relations, delete_fileobj, read, update, delete
from sacrud.action import get_pk, index, create
fr... | Python | 0.000001 |
b393b432c4f24906e1919999402ed56bde49086e | Fix test case - found another trunk tunnel on layer 0. | integration-test/546-road-sort-keys-tunnel.py | integration-test/546-road-sort-keys-tunnel.py | # tunnels at level = 0
#https://www.openstreetmap.org/way/167952621
assert_has_feature(
16, 10475, 25324, "roads",
{"kind": "highway", "kind_detail": "motorway", "id": 167952621,
"name": "Presidio Pkwy.", "is_tunnel": True, "sort_rank": 333})
# http://www.openstreetmap.org/way/259492789
assert_has_feature... | # tunnels at level = 0
#https://www.openstreetmap.org/way/167952621
assert_has_feature(
16, 10475, 25324, "roads",
{"kind": "highway", "kind_detail": "motorway", "id": 167952621,
"name": "Presidio Pkwy.", "is_tunnel": True, "sort_rank": 333})
# http://www.openstreetmap.org/way/259492762
assert_has_feature... | Python | 0 |
c3b92c1de1c8a2b9e0b3e585277186d5e453a06e | Copy the namespace of the root as well, otherwise it gets added to the string elements themselves and this gets messy and ugly | java/graveyard/support/scripts/copy-string.py | java/graveyard/support/scripts/copy-string.py | #!/usr/bin/env python
import os
import os.path
import sys
import lxml.etree
source_path = os.path.expanduser('~/workspace/git/android/packages/apps/Mms')
#source_path = os.path.expanduser('~/workspace/git/android/platform/packages/apps/Mms')
#source_path = os.path.expanduser('~/workspace/git/android/frameworks/base/... | #!/usr/bin/env python
import os
import os.path
import sys
import lxml.etree
source_path = os.path.expanduser('~/workspace/git/android/packages/apps/Mms')
#source_path = os.path.expanduser('~/workspace/git/android/platform/packages/apps/Mms')
#source_path = os.path.expanduser('~/workspace/git/android/frameworks/base/... | Python | 0 |
90c42beafe4dc5168224fd96cf7891695c7cf346 | fix save default values | ini_tools/ini_file.py | ini_tools/ini_file.py | import os
from config_parser import WZConfigParser
from profile_loader import Profile, get_profiles_name_list
from generate_ini_header import get_header
class WZException(Exception):
pass
class IniFile(dict):
profiles = get_profiles_name_list()
def get_profile_for_ini(self):
name = os.path.base... | import os
from config_parser import WZConfigParser
from profile_loader import Profile, get_profiles_name_list
from generate_ini_header import get_header
class WZException(Exception):
pass
class IniFile(dict):
profiles = get_profiles_name_list()
def get_profile_for_ini(self):
name = os.path.base... | Python | 0.000001 |
8f898be3d642bb4690e19b7e91ba087fba68dac0 | Fix bug that conditions are ignored other than last [ignore_properties add-on] | jumeaux/addons/judgement/ignore_properties.py | jumeaux/addons/judgement/ignore_properties.py | # -*- coding:utf-8 -*-
"""For example of config
judgement:
- name: jumeaux.addons.judgement.ignore_properties
config:
ignores:
- title: reason
image: https://......png
link: https://......
conditions:
- path: '/route'
changed:
... | # -*- coding:utf-8 -*-
"""For example of config
judgement:
- name: jumeaux.addons.judgement.ignore_properties
config:
ignores:
- title: reason
image: https://......png
link: https://......
conditions:
- path: '/route'
changed:
... | Python | 0 |
59bdc15846158db9123a764f87cdb0dd1a959a22 | remove print statements from unit test | test_qudt4dt.py | test_qudt4dt.py | __author__ = 'adam'
#import urllib
#import time
#from subprocess import Popen
#import shlex
#import os
import fusekiutils
import qudt4dt
import unittest
class TestQudt(unittest.TestCase):
def setUp(self,result = None):
self.barb = qudt4dt.Barbara("http://localhost:3030")
def test_get_uni... | __author__ = 'adam'
#import urllib
#import time
#from subprocess import Popen
#import shlex
#import os
import fusekiutils
import qudt4dt
import unittest
class TestQudt(unittest.TestCase):
def setUp(self,result = None):
self.barb = qudt4dt.Barbara("http://localhost:3030")
def test_get_uni... | Python | 0.000018 |
3640cb895bb93d144a615d4b745af135016d67af | order imports | src/plone.server/plone/server/__init__.py | src/plone.server/plone/server/__init__.py | # -*- encoding: utf-8 -*-
# load the patch before anything else.
from plone.server import patch # noqa
from plone.server import interfaces
from plone.server import languages
# load defined migrations
from plone.server.migrate import migrations # noqa
from zope.i18nmessageid import MessageFactory
import collection... | # -*- encoding: utf-8 -*-
# create logging
import logging
logger = logging.getLogger('plone.server')
from zope.i18nmessageid import MessageFactory # noqa
_ = MessageFactory('plone')
# load the patch before anything else.
from plone.server import patch # noqa
# load defined migrations
from plone.server.migrate impor... | Python | 0.000002 |
17c2d6baadfa91985ed8f3d32754ee7d30ba87d9 | Use "1" as ui3 cookie value to not confuse IA analytics. | internetarchive/search.py | internetarchive/search.py | import requests.sessions
from . import session
# Search class
# ________________________________________________________________________________________
class Search(object):
"""This class represents an archive.org item search. You can use
this class to search for archive.org items using the advanced
sea... | import requests.sessions
from . import session
# Search class
# ________________________________________________________________________________________
class Search(object):
"""This class represents an archive.org item search. You can use
this class to search for archive.org items using the advanced
sea... | Python | 0 |
e0b298f1df9a2d4e8868d6f055a27b5fb0bb8296 | Add helper method to model | links/maker/models.py | links/maker/models.py | import uuid
from datetime import datetime
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.db import models
from django.utils import timezone
from maker.managers import (MakerManager,
PasswordResetTokenManager,
EmailChangeTok... | import uuid
from datetime import datetime
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.db import models
from django.utils import timezone
from maker.managers import (MakerManager,
PasswordResetTokenManager,
EmailChangeTok... | Python | 0.000001 |
63cdfe0de155ed32af0332310340b4d57dcef145 | bump version for release | stdeb/__init__.py | stdeb/__init__.py | # setuptools is required for distutils.commands plugin we use
import logging
import setuptools
__version__ = '0.4.3'
log = logging.getLogger('stdeb')
log.setLevel(logging.INFO)
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(message)s')
handler.setFormatter(formatter)
... | # setuptools is required for distutils.commands plugin we use
import logging
import setuptools
__version__ = '0.4.2.git'
log = logging.getLogger('stdeb')
log.setLevel(logging.INFO)
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(message)s')
handler.setFormatter(formatt... | Python | 0 |
a88a01f9e6ba01be7d68719f493405ea584b1566 | Fix merge fallout | lib/aquilon/worker/commands/search_machine.py | lib/aquilon/worker/commands/search_machine.py | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of t... | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of t... | Python | 0.000329 |
cbe58b74f6d5fe5c96b197ced9c2269cf8886d24 | make boolean functions in utils return real booleans | livesettings/utils.py | livesettings/utils.py | import sys
import types
import os
def can_loop_over(maybe):
"""Test value to see if it is list like"""
try:
iter(maybe)
except TypeError:
return False
return True
def is_list_or_tuple(maybe):
return isinstance(maybe, (types.TupleType, types.ListType))
def is_scalar(maybe):
""... | import sys
import types
import os
def can_loop_over(maybe):
"""Test value to see if it is list like"""
try:
iter(maybe)
except:
return 0
else:
return 1
def is_list_or_tuple(maybe):
return isinstance(maybe, (types.TupleType, types.ListType))
def is_scalar(maybe):
"""Te... | Python | 0.999134 |
2bf6b59a129a9d93328c3478e57a27f35bdf2e6a | Trim the hardcoded list of keywords | screencasts/hello-weave/highlight.py | screencasts/hello-weave/highlight.py | #!/usr/bin/env python3
import json
prompt = 'ilya@weave-01:~$ '
highlight = [
('weave-01', 'red'),
('weave-02', 'red'),
('docker', 'red'),
('run', 'red'),
('--name', 'red'),
('hello', 'red'),
('netcat', 'red'),
('-lk', 'red'),
('1234', 'red'),
('Hello, Weave!\r\n', 'red'),
]
h... | #!/usr/bin/env python3
import json
prompt = 'ilya@weave-01:~$ '
highlight = [
('weave-01', 'red'),
('weave-02', 'red'),
('docker', 'red'),
('run', 'red'),
('--name', 'red'),
('hello', 'red'),
('netcat', 'red'),
('-lk', 'red'),
('1234', 'red'),
('sudo curl -s -L git.io/weave -o ... | Python | 0.999999 |
d387a1976e902bbf7fa6d960bee5d16db7aacbb0 | Fix indentation. Comment out superfluous code | tools/_build.py | tools/_build.py | """
The cython function was adapted from scikits-image (http://scikits-image.org/)
"""
import sys
import os
import shutil
import subprocess
import platform
from distutils.dist import Distribution
from distutils.command.config import config as distutils_config
from distutils import log
import optparse # deprecated in 2... | """
The cython function was adapted from scikits-image (http://scikits-image.org/)
"""
import sys
import os
import shutil
import subprocess
import platform
from distutils.dist import Distribution
from distutils.command.config import config as distutils_config
from distutils import log
import optparse # deprecated in 2... | Python | 0.000001 |
a91ac10af21cf644bfc45ef729e465726491db7b | Enable android_test and friends as waf commands. | tools/flambe.py | tools/flambe.py | #!/usr/bin/env python
from waflib import *
from waflib.TaskGen import *
import os
# Waf hates absolute paths for some reason
FLAMBE_ROOT = os.path.dirname(__file__) + "/.."
def options(ctx):
ctx.add_option("--debug", action="store_true", default=False, help="Build a development version")
def configure(ctx):
... | #!/usr/bin/env python
from waflib import *
from waflib.TaskGen import *
import os
# Waf hates absolute paths for some reason
FLAMBE_ROOT = os.path.dirname(__file__) + "/.."
def options(ctx):
ctx.add_option("--debug", action="store_true", default=False, help="Build a development version")
def configure(ctx):
... | Python | 0 |
5e57234ec619d0de930333a8dde3004d1dc575d6 | Support automatically stashing local modifications during repo-rebase. | subcmds/rebase.py | subcmds/rebase.py | #
# Copyright (C) 2010 The Android Open Source Project
#
# 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 la... | #
# Copyright (C) 2010 The Android Open Source Project
#
# 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 la... | Python | 0.000007 |
d42b47f971675af4b12f59089326276b3b8ff9f4 | Bump version to 0.14.0 | syntex/pkgmeta.py | syntex/pkgmeta.py | # -------------------------------------------------------------------------
# Package meta data.
# -------------------------------------------------------------------------
# Package version number.
__version__ = "0.14.0"
| # -------------------------------------------------------------------------
# Package meta data.
# -------------------------------------------------------------------------
# Package version number.
__version__ = "0.13.4"
| Python | 0 |
64d83d2f9c0d955b9d6ef721c0d953158ebfb72c | Add API to manually set the path of an item. + Automatic creation of files when getPath() is called. | jasy/item/Abstract.py | jasy/item/Abstract.py | #
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
# Copyright 2013-2014 Sebastian Werner
#
import os
from jasy import UserError
import jasy.core.File as File
class AbstractItem:
id = None
project = None
kind = "jasy.Item"
mtime = None
__path = None
__cache = None
__text ... | #
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
# Copyright 2013-2014 Sebastian Werner
#
import os
from jasy import UserError
import jasy.core.File as File
class AbstractItem:
id = None
project = None
kind = "jasy.Item"
mtime = None
__path = None
__cache = None
__text ... | Python | 0 |
a8679b6ac5392b80cd56fa2d67fd3bf3fb6f488f | Add distance handling to base class | turbustat/statistics/base_statistic.py | turbustat/statistics/base_statistic.py |
from astropy.io import fits
import astropy.units as u
import numpy as np
from ..io import input_data
class BaseStatisticMixIn(object):
"""
Common properties to all statistics
"""
# Disable this flag when a statistic does not need a header
need_header_flag = True
# Disable this when the dat... |
from astropy.io import fits
import astropy.units as u
import numpy as np
from ..io import input_data
class BaseStatisticMixIn(object):
"""
Common properties to all statistics
"""
# Disable this flag when a statistic does not need a header
need_header_flag = True
# Disable this when the dat... | Python | 0 |
dadd800384358356542ccc49bbdad1ae54006cfc | Fix test_Bucket.BucketDataTests to test `needed` attribute. | lib/bridgedb/test/test_Bucket.py | lib/bridgedb/test/test_Bucket.py | # -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2007-2014, all entities within the AUTHORS file
# :license: 3-Clause BSD, see LICENSE for licensing information
"""Unittests for the :mod:`bridgedb.Bucket`... | # -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2007-2014, all entities within the AUTHORS file
# :license: 3-Clause BSD, see LICENSE for licensing information
"""Unittests for the :mod:`bridgedb.Bucket`... | Python | 0 |
eb856e854c3b6f94f49db6de41c3a5af758494b3 | Change in forbidden_view_config in Pyramid 1.5a3 | usingnamespace/views/authentication.py | usingnamespace/views/authentication.py | import logging
log = logging.getLogger(__name__)
from pyramid.view import (
view_config,
view_defaults,
forbidden_view_config,
)
from pyramid.security import (
remember,
forget,
authenticated_userid
)
from pyramid.httpexceptions import (
HTTPForb... | import logging
log = logging.getLogger(__name__)
from pyramid.view import (
view_config,
view_defaults,
forbidden_view_config,
)
from pyramid.security import (
remember,
forget,
authenticated_userid
)
from pyramid.httpexceptions import HTTPSeeOther
from... | Python | 0 |
c86c80854ac5ea60f43619610a21bfba9b1094f2 | add ratio | example/simple_male_female_ratio.py | example/simple_male_female_ratio.py | import pydcard
def main():
male = 0
female = 0
for page_num in range(1, 41):
print ('Sending request to page %d' % page_num)
page = pydcard.get_all_page(page_num)
for post_thread in range(0, len(page)):
if page[post_thread].get('member').get('gender') == 'M':
... | import pydcard
def main():
male = 0
female = 0
for page_num in range(1, 41):
print ('Sending request to page %d' % page_num)
page = pydcard.getAllPage(page_num)
for post_thread in range(0, len(page)):
if page[post_thread].get('member').get('gender') == 'M':
... | Python | 0.000001 |
eb41e61e80cfc29957edfa30221cbbca3d8e7958 | Update variance_reduction.py | libact/query_strategies/variance_reduction.py | libact/query_strategies/variance_reduction.py | """Variance Reduction"""
import copy
from multiprocessing import Pool
import numpy as np
from libact.base.interfaces import QueryStrategy
from libact.base.dataset import Dataset
import libact.models
from libact.query_strategies._variance_reduction import estVar
class VarianceReduction(QueryStrategy):
"""Varian... | """Variance Reduction"""
import copy
from multiprocessing import Pool
import numpy as np
from libact.base.interfaces import QueryStrategy
from libact.base.dataset import Dataset
import libact.models
from libact.query_strategies._variance_reduction import estVar
class VarianceReduction(QueryStrategy):
"""Varian... | Python | 0.000001 |
832525402091562950b1d14ccca40a68be5f306d | test that large big decimal roundtrips | tests/regression.py | tests/regression.py | ## Copyright 2014 Cognitect. All Rights Reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable... | ## Copyright 2014 Cognitect. All Rights Reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable... | Python | 0.998839 |
b3f33521bc7f837a7e4f055758cd035339446a98 | Fix an undefined variable in DB code | utils/database.py | utils/database.py | import json
import copy
from zirc.wrappers import connection_wrapper
class Database(dict):
"""Holds a dict that contains all the information
about the users and their last seen actions in a channel"""
def __init__(self, bot):
with open("userdb.json") as f:
super(Database, self).__init... | import json
import copy
from zirc.wrappers import connection_wrapper
class Database(dict):
"""Holds a dict that contains all the information
about the users and their last seen actions in a channel"""
def __init__(self, bot):
with open("userdb.json") as f:
super(Database, self).__init... | Python | 0.018335 |
8d438da54a15fa213c5b57899505e040a42548bf | Fix init for tests | linked_list.py | linked_list.py | from __future__ import unicode_literals
class Node(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
def __repr__(self):
# Just display value
return "{val}".format(val=self.val)
class LinkedList(object):
"""Class for a singly-linked list."""
... | from __future__ import unicode_literals
class LinkedList(object):
"""Class for a singly-linked list."""
def __init__(self, iterable=()):
self.length = 0
for val in iterable:
self.insert(val)
def __repr__(self):
"""Print LinkedList as Tuple literal."""
end_flag ... | Python | 0.000007 |
1bb4059a783fdbc8f397b596d5d5d5ed6d97a7b4 | use radiasoft/beamsim-jupyter image | srv/salt/jupyterhub/jupyterhub_config.py | srv/salt/jupyterhub/jupyterhub_config.py | c.Authenticator.admin_users = {'{{ pillar.jupyterhub.admin_user }}',}
c.JupyterHub.confirm_no_ssl = True
c.JupyterHub.ip = '0.0.0.0'
import base64
c.JupyterHub.cookie_secret = base64.b64decode('{{ pillar.jupyterhub.cookie_secret }}')
c.JupyterHub.proxy_auth_token = '{{ pillar.jupyterhub.proxy_auth_token }}'
# Allow bot... | c.Authenticator.admin_users = {'{{ pillar.jupyterhub.admin_user }}',}
c.JupyterHub.confirm_no_ssl = True
c.JupyterHub.ip = '0.0.0.0'
import base64
c.JupyterHub.cookie_secret = base64.b64decode('{{ pillar.jupyterhub.cookie_secret }}')
c.JupyterHub.proxy_auth_token = '{{ pillar.jupyterhub.proxy_auth_token }}'
# Allow bot... | Python | 0 |
16fc80f36fa0bade1f4e5e7bef5595b3617a42bc | fix bartlett to pass participant not participant uuid | examples/bartlett1932/experiment.py | examples/bartlett1932/experiment.py | """Bartlett's trasmission chain experiment from Remembering (1932)."""
from wallace.networks import Chain
from wallace.nodes import Source, ReplicatorAgent
from wallace import processes
from wallace.experiments import Experiment
import random
class Bartlett1932(Experiment):
"""Defines the experiment."""
de... | """Bartlett's trasmission chain experiment from Remembering (1932)."""
from wallace.networks import Chain
from wallace.nodes import Source, ReplicatorAgent
from wallace import processes
from wallace.experiments import Experiment
import random
class Bartlett1932(Experiment):
"""Defines the experiment."""
de... | Python | 0 |
6073610cb08e03e142b80dc7b1196ce359a1f55a | fix pylint import error | selfdrive/debug/toyota_eps_factor.py | selfdrive/debug/toyota_eps_factor.py | #!/usr/bin/env python3
import sys
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model # pylint: disable=import-error
from tools.lib.route import Route
from tools.lib.logreader import MultiLogIterator
MIN_SAMPLES = 30*100
def to_signed(n, bits):
if n >= (1 << max((bits - 1), 0)):
... | #!/usr/bin/env python3
import sys
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
from tools.lib.route import Route
from tools.lib.logreader import MultiLogIterator
MIN_SAMPLES = 30*100
def to_signed(n, bits):
if n >= (1 << max((bits - 1), 0)):
n = n - (1 << max(bits, 0))
... | Python | 0.000001 |
a6f95b71030026693683588287f8c54bbd7e3ee8 | use persistor to upload trained model to s3 | src/trainers/spacy_sklearn_trainer.py | src/trainers/spacy_sklearn_trainer.py | import spacy
import os, datetime, json
import cloudpickle
from rasa_nlu import util
from rasa_nlu.featurizers.spacy_featurizer import SpacyFeaturizer
from rasa_nlu.classifiers.sklearn_intent_classifier import SklearnIntentClassifier
from rasa_nlu.extractors.spacy_entity_extractor import SpacyEntityExtractor
class Spa... | import spacy
import os, datetime, json
import cloudpickle
import util
from rasa_nlu.featurizers.spacy_featurizer import SpacyFeaturizer
from rasa_nlu.classifiers.sklearn_intent_classifier import SklearnIntentClassifier
from rasa_nlu.extractors.spacy_entity_extractor import SpacyEntityExtractor
class SpacySklearnTrain... | Python | 0 |
60ebebb4cc167a010904763c5a4ffed6347c029e | Fix license tab. | lms/djangoapps/labster_course_license/tabs.py | lms/djangoapps/labster_course_license/tabs.py | """
Registers the Labster Course License for the edX platform.
"""
from django.conf import settings
from django.utils.translation import ugettext_noop
from xmodule.tabs import CourseTab
from student.roles import CourseCcxCoachRole
from courseware.access import has_access
class LicenseCourseTab(CourseTab):
"""
... | """
Registers the Labster Course License for the edX platform.
"""
from django.conf import settings
from django.utils.translation import ugettext_noop
from xmodule.tabs import CourseTab
from student.roles import CourseCcxCoachRole
class LicenseCourseTab(CourseTab):
"""
The representation of the LTI Passport... | Python | 0 |
d8e872c3d2aa141c29d993c08c207c1b7994b055 | Add missing filter decorators | sequere/templatetags/sequere_tags.py | sequere/templatetags/sequere_tags.py | from django import template
from sequere.registry import registry
from sequere.models import (get_followers_count, get_followings_count)
register = template.Library()
@register.filter
def identifier(instance, arg=None):
return registry.get_identifier(instance)
@register.filter
def followers_count(instance, id... | from django import template
from sequere.registry import registry
from sequere.models import (get_followers_count, get_followings_count)
register = template.Library()
def identifier(instance, arg=None):
return registry.get_identifier(instance)
def followers_count(instance, identifier=None):
return get_fol... | Python | 0.000001 |
90103ce492a77070a0d6e30c5247b334c803b5e7 | check access and execute as superuser | mail_move_message/mail_move_message_models.py | mail_move_message/mail_move_message_models.py | from openerp import api, models, fields, SUPERUSER_ID
from openerp.tools.translate import _
class wizard(models.TransientModel):
_name = 'mail_move_message.wizard'
message_id = fields.Many2one('mail.message', string='Message')
message_body = fields.Html(related='message_id.body', string='Message to move',... | from openerp import api, models, fields, SUPERUSER_ID
from openerp.tools.translate import _
class wizard(models.TransientModel):
_name = 'mail_move_message.wizard'
message_id = fields.Many2one('mail.message', string='Message')
message_body = fields.Html(related='message_id.body', string='Message to move',... | Python | 0 |
99c3eba0d6384cd42c90ef347823e6d66659d6e3 | Fix typo in division operator | viper/interpreter/prelude/operators.py | viper/interpreter/prelude/operators.py | from ..value import ForeignCloVal
def plus(a: int, b: int) -> int:
return a + b
def minus(a: int, b: int) -> int:
return a - b
def times(a: int, b: int) -> int:
return a * b
def divide(a: int, b: int) -> float:
return a / b
env = {
'+': ForeignCloVal(plus, {}),
'-': ForeignCloVal(minus... | from ..value import ForeignCloVal
def plus(a: int, b: int) -> int:
return a + b
def minus(a: int, b: int) -> int:
return a - b
def times(a: int, b: int) -> int:
return a * b
def divide(a: int, b: int) -> float:
return a / b
env = {
'+': ForeignCloVal(plus, {}),
'-': ForeignCloVal(minus... | Python | 0.014756 |
340e872114363ddc041b2c5cdcc5769c9b793efe | Add test_select_with_seed_too_small_raise_Exception | tests/test_bingo.py | tests/test_bingo.py | """Unit tests for cat2cohort."""
import unittest
from bingo import bingo
class TestBingoGenerator(unittest.TestCase):
"""Test methods from bingo."""
def test_bingo_generator_has_default_size(self):
bingo_generator = bingo.BingoGenerator()
expected = pow(bingo.DEFAULT_SIZE, 2)
self.a... | """Unit tests for cat2cohort."""
import unittest
from bingo import bingo
class TestBingoGenerator(unittest.TestCase):
"""Test methods from bingo."""
def test_bingo_generator_has_default_size(self):
bingo_generator = bingo.BingoGenerator()
expected = pow(bingo.DEFAULT_SIZE, 2)
self.a... | Python | 0.000008 |
bfb3b4825a41380b3cd299fc899bcf473323b68a | switch to BioPython to store FASTA | lib/msa_muscle/msa_muscleImpl.py | lib/msa_muscle/msa_muscleImpl.py | #BEGIN_HEADER
from biokbase.workspace.client import Workspace as workspaceService
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import generic_protein
import os
#END_HEADER
class msa_muscle:
'''
Module Name:
msa_muscle
Module Description:
A KB... | #BEGIN_HEADER
from biokbase.workspace.client import Workspace as workspaceService
import os
#END_HEADER
class msa_muscle:
'''
Module Name:
msa_muscle
Module Description:
A KBase module: msa_muscle
This sample module contains one small method - count_contigs.
'''
######## WARNING FOR GEVE... | Python | 0.000001 |
36f2376a2f23b295bba8cc2af16577efd3fe03ff | Add a couple of snippets. | utils/snippets.py | utils/snippets.py | #!/usr/bin/env python
# A hacky script to do dynamic snippets.
import sys
import os
import datetime
snippet_map = {
'date': datetime.datetime.now().strftime('%b %d %G %I:%M%p '),
'time': datetime.datetime.now().strftime('%I:%M%p '),
'best': 'Best,\nSameer',
'cheers': 'Cheers,\nSameer',
'thanks': '... | #!/usr/bin/env python
# A hacky script to do dynamic snippets.
import sys
import os
import datetime
snippet_map = {
'date' : datetime.datetime.now().strftime('%b %d %G %I:%M%p '),
'time' : datetime.datetime.now().strftime('%I:%M%p '),
'sign' : 'Best,\nSameer',
}
keys = '\n'.join(snippet_map.keys())
resul... | Python | 0.000002 |
7d2c4140a74fa052eda6a6a19593321056c9eb80 | convert prints to logging in jsonparser | src/unix/plugins/jsonparser/jsonparser.py | src/unix/plugins/jsonparser/jsonparser.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2011 Openstack, LLC.
# 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://... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2011 Openstack, LLC.
# 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://... | Python | 0.002846 |
6dcde2c4931b0b8945e235005c28f7eb344cbebc | build LOAFER_ROUTE based on envvars | loafer/conf.py | loafer/conf.py | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from prettyconf import config
class Settings(object):
# Logging
LOAFER_LOGLEVEL = config('LOAFER_LOGLEVEL', default='WARNING')
LOAFER_LOG_FORMAT = config('LOAFER_LOG_FORMAT',
default='%(asctime)s - %(name)s - %(levelname)s ... | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from prettyconf import config
class Settings(object):
# Logging
LOAFER_LOGLEVEL = config('LOAFER_LOGLEVEL', default='WARNING')
LOAFER_LOG_FORMAT = config('LOAFER_LOG_FORMAT',
default='%(asctime)s - %(name)s - %(levelname)s ... | Python | 0 |
8887ac66a221b443215e7ab57a2f21b1521b167b | move docs to readme | utils/workflow.py | utils/workflow.py | from __future__ import print_function
import os
import subprocess
import sys
from datetime import datetime
from string import Template
from lektor.utils import slugify
HERE = os.path.dirname(__file__)
PROJECT_PATH = os.path.join(HERE, '..')
DRAFTS_PATH = os.path.join(PROJECT_PATH, 'drafts')
CONTENT_PATH = os.path.jo... | """
Helpers for my evolving workflow.
draft [art] "My super article"
creates a prepared md file with all the necessary settings to work on.
publish drafts/my-super-article.md
will make the necessary adjustments and publish it in the contents.
deploy [clean]
will create a [clean] build and push it onli... | Python | 0 |
377f2120b3474d131b02dab90b6e51c35deb0c74 | Add comments | mathphys/constants.py | mathphys/constants.py | """Constants module."""
import math as _math
from . import base_units as _u
# temporary auxiliary derived units
_volt = (_u.kilogram * _u.meter**2) / (_u.ampere * _u.second**2)
_coulomb = _u.second * _u.ampere
_joule = _u.kilogram * _u.meter**2 / _u.second**2
_pascal = _u.kilogram / (_u.meter * _u.second**2)
# phy... | """Constants module."""
import math as _math
from . import base_units as _u
# temporary auxiliary derived units
_volt = (_u.kilogram * _u.meter**2) / (_u.ampere * _u.second**2)
_coulomb = _u.second * _u.ampere
_joule = _u.kilogram * _u.meter**2 / _u.second**2
_pascal = _u.kilogram / (_u.meter * _u.second**2)
# phy... | Python | 0 |
e732615e2e8586cc3f6a31614372ef16bae26a36 | update tests for prices.py | tests/test_price.py | tests/test_price.py | from bitshares import BitShares
from bitshares.instance import set_shared_bitshares_instance
from bitshares.amount import Amount
from bitshares.price import Price
from bitshares.asset import Asset
import unittest
class Testcases(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(Testcases, se... | from bitshares import BitShares
from bitshares.instance import set_shared_bitshares_instance
from bitshares.amount import Amount
from bitshares.price import Price
from bitshares.asset import Asset
import unittest
class Testcases(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(Testcases, se... | Python | 0 |
a26f04bddcdb92af050c2d8237ccb6c2ef1406e5 | Fix identation | jst/common/context.py | jst/common/context.py | '''
Created on Jan 18, 2015
@author: rz
'''
import configparser
import os
from os.path import expanduser
def load():
global_cfg_file = expanduser("~") + '/.jst/jst.properties'
if (not os.path.isfile(global_cfg_file)):
raise FileNotFoundError(global_cfg_file)
cwd = os.getcwd()
ctx_file = cwd ... | '''
Created on Jan 18, 2015
@author: rz
'''
import configparser
import os
from os.path import expanduser
def load():
global_cfg_file = expanduser("~") + '/.jst/jst.properties'
if (not os.path.isfile(global_cfg_file)):
raise FileNotFoundError(global_cfg_file)
cwd = os.getcwd()
ctx_file = cwd +... | Python | 0.001406 |
99bc38b7d33eef76fd99d7ce362b00080edf5067 | Change dependencies | stock_shipment_management/__openerp__.py | stock_shipment_management/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joël Grand-Guillaume
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as pu... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joël Grand-Guillaume
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as pu... | Python | 0.000001 |
aad19b0373f2b331ffbada431385173d2bf3e43e | Update cronjob.py | k8s/models/cronjob.py | k8s/models/cronjob.py | #!/usr/bin/env python
# -*- coding: utf-8
# Copyright 2017-2019 The FIAAS 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
#
# U... | #!/usr/bin/env python
# -*- coding: utf-8
# Copyright 2017-2019 The FIAAS 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
#
# U... | Python | 0.000004 |
e7dca1dae8300dd702ecfc36110518b16c9c5231 | change directory back to previous location (prevents following tests from pointing into the forest) | tests/testhelper.py | tests/testhelper.py | from contextlib import contextmanager
import tempfile
import os
import shutil
from configuration import Builder
from gitFunctions import Initializer
import configuration
@contextmanager
def mkchdir(subfolder, folderprefix="rtc2test_case"):
tempfolder = tempfile.mkdtemp(prefix=folderprefix + subfolder)
previo... | from contextlib import contextmanager
import tempfile
import os
import shutil
from configuration import Builder
from gitFunctions import Initializer
import configuration
@contextmanager
def mkchdir(subfolder, folderprefix="rtc2test_case"):
tempfolder = tempfile.mkdtemp(prefix=folderprefix + subfolder)
os.chd... | Python | 0 |
5a8199744bf658d491721b16fea7639303e47d3f | Edit view pre-populates with data from user object | july/people/views.py | july/people/views.py | from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.template.context import RequestContext
#from google.appengine.ext import db
from july.people.models import Commit
from gae_django.auth.models import User
from django.http import Http404, HttpResponseRed... | from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.template.context import RequestContext
#from google.appengine.ext import db
from july.people.models import Commit
from gae_django.auth.models import User
from django.http import Http404, HttpResponseRed... | Python | 0 |
8e9edf002368df0cd4bfa33975271b75af191ef0 | fix cache expiring | ujt/dash_app.py | ujt/dash_app.py | """ Configuration for Dash app.
Exposes app and cache to enable other files (namely callbacks) to register callbacks and update cache.
App is actually started by ujt.py
"""
import dash
import dash_bootstrap_components as dbc
import dash_cytoscape as cyto
from flask_caching import Cache
# Initialize Dash app and Flas... | """ Configuration for Dash app.
Exposes app and cache to enable other files (namely callbacks) to register callbacks and update cache.
App is actually started by ujt.py
"""
import dash
import dash_bootstrap_components as dbc
import dash_cytoscape as cyto
from flask_caching import Cache
# Initialize Dash app and Flas... | Python | 0 |
a8e43dcdbdd00de9d4336385b3f3def1ae5c2515 | Update UserX, with back compatibility | main/modelx.py | main/modelx.py | # -*- coding: utf-8 -*-
import hashlib
class BaseX(object):
@classmethod
def retrieve_one_by(cls, name, value):
cls_db_list = cls.query(getattr(cls, name) == value).fetch(1)
if cls_db_list:
return cls_db_list[0]
return None
class ConfigX(object):
@classmethod
def get_master_db(cls):
r... | # -*- coding: utf-8 -*-
import hashlib
class BaseX(object):
@classmethod
def retrieve_one_by(cls, name, value):
cls_db_list = cls.query(getattr(cls, name) == value).fetch(1)
if cls_db_list:
return cls_db_list[0]
return None
class ConfigX(object):
@classmethod
def get_master_db(cls):
r... | Python | 0 |
6ba3fc5c9fade3609695aa7f5b0498b77a8c18fa | revert to 0.2.7 tag | keras_cv/__init__.py | keras_cv/__init__.py | # Copyright 2022 The KerasCV 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2022 The KerasCV 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Python | 0.000001 |
97523ce0b98d97a4ce6d9d99d5807e1f32b21077 | correcting a typo | constructiveness_toxicity_crowdsource/common/crowd_data_aggregator.py | constructiveness_toxicity_crowdsource/common/crowd_data_aggregator.py | import pandas as pd
import numpy as np
import math
from crowd_data_aggregation_functions import *
class CrowdsourceAggregator:
'''
Aggregator for crowdsourced data for constructiveness and toxicity
'''
def __init__(self, input_csv):
self.df = pd.read_csv(input_csv)
def get_gold_que... | import pandas as pd
import numpy as np
import math
from crowd_data_aggregation_functions import *
class CrowdsourceAggregator:
'''
Aggregator for crowdsourced data for constructiveness and toxicity
'''
def __init__(self, input_csv):
self.df = pd.read_csv(input_csv)
def get_gold_que... | Python | 0.999886 |
55a3b3a845014d0e4c4c4d057bbe088d7791d43d | Prepare for v1.10.0 | src/pyckson/__init__.py | src/pyckson/__init__.py | from pyckson.decorators import *
from pyckson.json import *
from pyckson.parser import parse
from pyckson.parsers.base import Parser
from pyckson.serializer import serialize
from pyckson.serializers.base import Serializer
from pyckson.dates.helpers import configure_date_formatter, configure_explicit_nulls
from pyckson.... | from pyckson.decorators import *
from pyckson.json import *
from pyckson.parser import parse
from pyckson.parsers.base import Parser
from pyckson.serializer import serialize
from pyckson.serializers.base import Serializer
from pyckson.dates.helpers import configure_date_formatter, configure_explicit_nulls
from pyckson.... | Python | 0.000001 |
7fcb80a43d39473001610015e92973d95c0b0267 | Fix not track percent so it is not track percent | mica/web/star_hist.py | mica/web/star_hist.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.table import Table
from Chandra.Time import DateTime
from mica.stats import acq_stats, guide_stats
def get_acq_data(agasc_id):
"""
Fetch acquisition history from mica acq stats for an agasc id
:param agasc_id: AGASC id
:retu... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.table import Table
from Chandra.Time import DateTime
from mica.stats import acq_stats, guide_stats
def get_acq_data(agasc_id):
"""
Fetch acquisition history from mica acq stats for an agasc id
:param agasc_id: AGASC id
:retu... | Python | 0.998902 |
6d63ab2ef50512a794948c86cf1ce834b59acd90 | Add str method for map area | maps/models.py | maps/models.py | import json
from django.conf import settings
# from django.contrib.postgres.fields import JSONField
from django.db import models
JSONTextField = models.TextField
# See
# https://developers.google.com/maps/documentation/javascript/reference?hl=en#LatLngBoundsLiteral
class LatLngBounds(models.Model):
east = mode... | import json
from django.conf import settings
# from django.contrib.postgres.fields import JSONField
from django.db import models
JSONTextField = models.TextField
# See
# https://developers.google.com/maps/documentation/javascript/reference?hl=en#LatLngBoundsLiteral
class LatLngBounds(models.Model):
east = mode... | Python | 0 |
f8fde8fd984242f75e36644d2e54c1d306c1b785 | Remove --population=default | keysmith/__main__.py | keysmith/__main__.py | """Keysmith Default Interface"""
import argparse
import math
import string
import pkg_resources
import keysmith
def cli(parser=None):
"""Parse CLI arguments and options."""
if parser is None:
parser = argparse.ArgumentParser(prog=keysmith.CONSOLE_SCRIPT)
parser.add_argument(
'-d', '--de... | """Keysmith Default Interface"""
import argparse
import math
import string
import pkg_resources
import keysmith
def cli(parser=None):
"""Parse CLI arguments and options."""
if parser is None:
parser = argparse.ArgumentParser(prog=keysmith.CONSOLE_SCRIPT)
parser.add_argument(
'-d', '--de... | Python | 0.000009 |
646548dff38ea476a35462cf51ba028e3275748a | Fix some undefined reference and attribute errors in the deallocate simprocedure | simuvex/procedures/cgc/deallocate.py | simuvex/procedures/cgc/deallocate.py | import simuvex
import logging
l = logging.getLogger("simuvex.procedures.cgc.deallocate")
class deallocate(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, addr, length): #pylint:disable=unused-argument
# return code (see deallocate() docs)
r = self.state.se.ite_cases((
... | import simuvex
class deallocate(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, addr, length): #pylint:disable=unused-argument
# return code (see deallocate() docs)
r = self.state.se.ite_cases((
(addr % 0x1000 != 0, self.state.cgc.EINVAL),
... | Python | 0.000001 |
70c520d3ff882b499febfe021d02108f79171773 | Fix ST2(python26) compatibility. | OmniMarkupLib/Renderers/MarkdownRenderer.py | OmniMarkupLib/Renderers/MarkdownRenderer.py | from .base_renderer import *
import re
import markdown
@renderer
class MarkdownRenderer(MarkupRenderer):
FILENAME_PATTERN_RE = re.compile(r'\.(md|mkdn?|mdwn|mdown|markdown|litcoffee)$')
YAML_FRONTMATTER_RE = re.compile(r'\A---\s*\n.*?\n?^---\s*$\n?', re.DOTALL | re.MULTILINE)
def load_settings(self, rend... | from .base_renderer import *
import re
import markdown
@renderer
class MarkdownRenderer(MarkupRenderer):
FILENAME_PATTERN_RE = re.compile(r'\.(md|mkdn?|mdwn|mdown|markdown|litcoffee)$')
YAML_FRONTMATTER_RE = re.compile(r'\A---\s*\n.*?\n?^---\s*$\n?', re.DOTALL | re.MULTILINE)
def load_settings(self, rend... | Python | 0.000001 |
b7523a8bbac9fdce7d97afda32b9a7982f00a6d0 | Update Exp 7_2 | examples/sparkfun_redbot/sparkfun_experiments/Exp7_2_DriveDistance.py | examples/sparkfun_redbot/sparkfun_experiments/Exp7_2_DriveDistance.py | """
Exp7_2_DriveDistance -- RedBot Experiment 7.2
In an earlier experiment, we used a combination of speed and time to
drive a certain distance. Using the encoders, we can me much more accurate.
In this example, we will show you how to setup your robot to drive a certain
distance regardless of the motorPower... | """
Exp7_2_DriveDistance -- RedBot Experiment 7.2
In an earlier experiment, we used a combination of speed and time to
drive a certain distance. Using the encoders, we can me much more accurate.
In this example, we will show you how to setup your robot to drive a certain
distance regardless of the motorPower... | Python | 0 |
b58eaf077ff748c3604aa7520a956b03cdce6995 | Add libevent_home command line parameter | site_scons/community/command_line.py | site_scons/community/command_line.py | from SCons.Script import *
## Command Line Variables
#
# Setup all of the command line variables across all of the products and
# platforms. NOTE: if a path is configurable and will be created in the
# build process then the validation MUST be PathAccept
def get_command_line_opts( host, products, VERSIONS ):
opts ... | from SCons.Script import *
## Command Line Variables
#
# Setup all of the command line variables across all of the products and
# platforms. NOTE: if a path is configurable and will be created in the
# build process then the validation MUST be PathAccept
def get_command_line_opts( host, products, VERSIONS ):
opts ... | Python | 0.000001 |
168c80e3bf024f74fbb49184ceffbc2a09abe6c1 | Allow empty labels | kk/models/hearing.py | kk/models/hearing.py |
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from .base import ModifiableModel
class Label(ModifiableModel):
label = models.CharField(verbose_name=_('Label'), default='', max_length=200)
def __str__(se... |
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from .base import ModifiableModel
class Label(ModifiableModel):
label = models.CharField(verbose_name=_('Label'), default='', max_length=200)
def __str__(se... | Python | 0.998839 |
d58b82997d9e5d616da2f517c19c5191c43cd823 | make membship optional, on which we revert to matching_dissim; speed improvement | kmodes/util/dissim.py | kmodes/util/dissim.py | """
Dissimilarity measures for clustering
"""
import numpy as np
def matching_dissim(a, b, **_):
"""Simple matching dissimilarity function"""
return np.sum(a != b, axis=1)
def euclidean_dissim(a, b, **_):
"""Euclidean distance dissimilarity function"""
if np.isnan(a).any() or np.isnan(b).any():
... | """
Dissimilarity measures for clustering
"""
import numpy as np
def matching_dissim(a, b, **_):
"""Simple matching dissimilarity function"""
return np.sum(a != b, axis=1)
def euclidean_dissim(a, b, **_):
"""Euclidean distance dissimilarity function"""
if np.isnan(a).any() or np.isnan(b).any():
... | Python | 0 |
1b972c4ab088fd6566dd144992167f4a4ae62356 | rebuild LevelRenderData after saving changed_geometries | src/c3nav/mapdata/models/update.py | src/c3nav/mapdata/models/update.py | from contextlib import contextmanager
from django.conf import settings
from django.core.cache import cache
from django.db import models, transaction
from django.utils.http import int_to_base36
from django.utils.timezone import make_naive
from django.utils.translation import ugettext_lazy as _
from c3nav.mapdata.tasks... | from contextlib import contextmanager
from django.conf import settings
from django.core.cache import cache
from django.db import models, transaction
from django.utils.http import int_to_base36
from django.utils.timezone import make_naive
from django.utils.translation import ugettext_lazy as _
from c3nav.mapdata.tasks... | Python | 0 |
dc300cf24651036e93e94f8c40f00f1126da4a85 | fix 404 when user want to verify payments | lms/djangoapps/commerce/views.py | lms/djangoapps/commerce/views.py | """ Commerce views. """
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from edxmako.shortcuts import render_to_response
from microsite_configuration import microsite
from lms.djangoapps.verify_student.model... | """ Commerce views. """
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from edxmako.shortcuts import render_to_response
from microsite_configuration import microsite
from lms.djangoapps.verify_student.model... | Python | 0 |
73b67a30495e7a6d638421ba8b9544a5e2dc4185 | Fix task full resource | zou/app/resources/project/task_full.py | zou/app/resources/project/task_full.py | from flask import abort
from flask_login import login_required
from zou.app.models.task import Task
from zou.app.models.project import Project
from zou.app.models.person import Person
from zou.app.models.entity import Entity
from zou.app.models.entity_type import EntityType
from zou.app.models.task_status import TaskS... | from flask import abort
from flask_login import login_required
from zou.app.models.task import Task
from zou.app.models.project import Project
from zou.app.models.person import Person
from zou.app.models.entity import Entity
from zou.app.models.entity_type import EntityType
from zou.app.models.task_status import TaskS... | Python | 0.000029 |
d4563fe6991ee644350528a469884f697f02308d | Add production of very high S/N model images | models/make_images.py | models/make_images.py | #!/usr/bin/env python
from glob import glob
import pyfits
import sys, os
import numpy
shape = (100,100)
bands = ['u', 'g', 'r', 'i', 'z', 'Y', 'J', 'H', 'K']
zp = numpy.array([16.75,15.957,15.0,14.563,14.259,14.162,13.955,13.636,13.525])
def make_images(model='A', noiselevel=5,
bandsel=['u', 'g', 'r... | #!/usr/bin/env python
from glob import glob
import pyfits
import sys, os
import numpy
shape = (100,100)
bands = ['u', 'g', 'r', 'i', 'z', 'Y', 'J', 'H', 'K']
zp = numpy.array([16.75,15.957,15.0,14.563,14.259,14.162,13.955,13.636,13.525])
def make_images(model='A', noiselevel=5,
bandsel=['u', 'g', 'r... | Python | 0 |
2417f7e3c445c7f369c9eb8cb48c83ebb4c2e43d | Change blueprints to be more container-like. | kyokai/blueprints.py | kyokai/blueprints.py | """
Kyōkai blueprints are simply groups of routes.
They're a simpler way of grouping your routes together instead of having to import your app object manually all of
the time.
"""
from kyokai.route import Route
class Blueprint(object):
"""
A Blueprint is a container for routes.
"""
def __init__(self,... | """
Kyōkai are simply groups of routes.
They're a simpler way of grouping your routes together instead of having to import your app object manually all of
the time.
"""
from kyokai.route import Route
class Blueprint(object):
"""
A Blueprint contains one public method: `bp.route`. It acts exactly the same as ... | Python | 0 |
a43ada7785db136f3a5d7d96c6b64b0a686d052e | fix total_force missing | labs/lab2/analyze.py | labs/lab2/analyze.py | #!/usr/bin/env python
import re
import sys
import csv
import argparse
# This defines the patterns for extracting relevant data from the output
# files.
patterns = {
"energy": re.compile("total energy\s+=\s+([\d\.\-]+)\sRy"),
"ecut": re.compile("kinetic\-energy cutoff\s+=\s+([\d\.\-]+)\s+Ry"),
"alat": re.... | #!/usr/bin/env python
import re
import sys
import csv
import argparse
# This defines the patterns for extracting relevant data from the output
# files.
patterns = {
"energy": re.compile("total energy\s+=\s+([\d\.\-]+)\sRy"),
"ecut": re.compile("kinetic\-energy cutoff\s+=\s+([\d\.\-]+)\s+Ry"),
"alat": re.... | Python | 0.000053 |
0ce8050b797b3e2c2a9b0e74cbc67fd8e31736b3 | Remove working distros to focus on non-working ones | fog-aws-testing/scripts/settings.py | fog-aws-testing/scripts/settings.py | # The list of OSs.
#OSs = ["debian9","centos7","rhel7","fedora29","arch","ubuntu18_04"]
OSs = ["rhel7","fedora29","arch","ubuntu18_04"]
#dnsAddresses = ["debian9.fogtesting.cloud","centos7.fogtesting.cloud","rhel7.fogtesting.cloud","fedora29.fogtesting.cloud","arch.fogtesting.cloud","ubuntu18_04.fogtesting.cloud"]
dnsA... | # The list of OSs.
OSs = ["debian9","centos7","rhel7","fedora29","arch","ubuntu18_04"]
dnsAddresses = ["debian9.fogtesting.cloud","centos7.fogtesting.cloud","rhel7.fogtesting.cloud","fedora29.fogtesting.cloud","arch.fogtesting.cloud","ubuntu18_04.fogtesting.cloud"]
# The list of branches to process.
branches = ["maste... | Python | 0 |
b72ab35056ca6ec1e48db963d61c31d89ec80161 | fix on winsock2 | autoconf/winsock2.py | autoconf/winsock2.py | from _external import *
winsock2 = LibWithHeaderChecker( 'ws2_32',
['winsock2.h'],
'c',
name='winsock2' )
| from _external import *
winsock2 = LibWithHeaderChecker( 'winsock2',
['winsock2.h'],
'c',
name='ws2_32' )
| Python | 0 |
0b499f01d517775fb03294c1c785318ca6224874 | Bump to v0.0.5 | backache/__init__.py | backache/__init__.py | from . core import *
from . antioxidant import celerize # flake8: noqa
from . errors import *
__version__ = (0, 0, 5)
| from . core import *
from . antioxidant import celerize # flake8: noqa
from . errors import *
__version__ = (0, 0, 4)
| Python | 0.000001 |
da26428a6f7adf58e7cfed8ece61fc42ed76345e | Remove commented out code. pep8/pyflakes | src/recore/amqp.py | src/recore/amqp.py | # -*- coding: utf-8 -*-
# Copyright © 2014 SEE AUTHORS FILE
#
# 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, or
# (at your option) any later version.
#
#... | # -*- coding: utf-8 -*-
# Copyright © 2014 SEE AUTHORS FILE
#
# 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, or
# (at your option) any later version.
#
#... | Python | 0.000071 |
ce2cf07d9fa9dc3bdd229b1cbb56745784e3049d | Fix stray char. | law/sandbox/docker.py | law/sandbox/docker.py | # -*- coding: utf-8 -*-
"""
Docker sandbox implementation.
"""
__all__ = ["DockerSandbox"]
from law.sandbox.base import Sandbox
class DockerSandbox(Sandbox):
sandbox_type = "docker"
@property
def image(self):
return self.name
def cmd(self, task, task_cmd):
# get args for the do... | # -*- coding: utf-8 -*-
"""
Docker sandbox implementation.
"""
__all__ = ["DockerSandbox"]
from law.sandbox.base import Sandbox
class DockerSandbox(Sandbox):
sandbox_type = "docker"
@property
def image(self):
return self.name
def cmd(self, task, task_cmd):
# get args for the do... | Python | 0 |
699085edd1db5aa7a827a16ffffcbcc9a69cbf52 | Add forgotten imports for bucketlist endpoints | app/endpoints.py | app/endpoints.py | from flask import request, Blueprint
from flask_restful import Api
from controllers.accounts_manager import LoginResource, RegisterResource
from controllers.bucketlist import BucketListsResource, BucketListResource
from controllers.bucketlist_items import BucketListItems
bucketlist_blueprint = Blueprint('bucket_list... | from flask import request, Blueprint
from flask_restful import Api
from controllers.accounts_manager import LoginResource, RegisterResource
from controllers.bucketlist import GetAllBucketLists, GetBucketList
from controllers.bucketlist_items import BucketListItems
bucketlist_blueprint = Blueprint('bucket_list', __na... | Python | 0 |
6908060af5b872e54d42f63e580591931b7ff230 | Check empty string | museum_site/scroll.py | museum_site/scroll.py | from django.db import models
class Scroll(models.Model):
# Constants
SCROLL_TOP = """```
╞╤═════════════════════════════════════════════╤╡
│ Scroll ### │
╞═════════════════════════════════════════════╡
│ • • • • • • • • •│"""
SCROLL_BOTTOM = ... | from django.db import models
class Scroll(models.Model):
# Constants
SCROLL_TOP = """```
╞╤═════════════════════════════════════════════╤╡
│ Scroll ### │
╞═════════════════════════════════════════════╡
│ • • • • • • • • •│"""
SCROLL_BOTTOM = ... | Python | 0.026724 |
43a348865dcc21e9d88ebf05fd794fed2b7b350c | Update suite | mx.irbuilder/suite.py | mx.irbuilder/suite.py | suite = {
"mxversion" : "5.70.2",
"name" : "java-llvm-ir-builder",
"versionConflictResolution" : "latest",
"imports" : {
"suites" : [
{
"name" : "sulong",
"version" : "f25a652b20e9c2c7d99fbd3844b64a44da5547a6",
"urls" : [
... | suite = {
"mxversion" : "5.70.2",
"name" : "java-llvm-ir-builder",
"versionConflictResolution" : "latest",
"imports" : {
"suites" : [
{
"name" : "sulong",
"version" : "38a5bad302f48d676f15a0b3fd9b02f6f3a8abdd",
"urls" : [
... | Python | 0.000001 |
e00b7c612f34c938a3d42dada006874ffea021c8 | complete localizer | app/localizer.py | app/localizer.py | # -*- coding: utf-8 -*-
"""
localizer
localize bounding boxes and pad rest of image with zeros (255, 255, 255)
"""
import os
import cv2
import numpy as np
import multiprocessing as mp
from app.pipeline import generate_data_skeleton
from app.cv.serializer import deserialize_json
from app.settings import BOUNDINGBOX, I... | # -*- coding: utf-8 -*-
"""
localizer
localize bounding boxes and pad rest of image with zeros (255, 255, 255)
"""
import os
import cv2
import numpy as np
from app.cv.serializer import deserialize_json
from app.settings import CV_SAMPLE_PATH, BOUNDINGBOX
test_image = CV_SAMPLE_PATH + 'pos/img_00003.jpg'
class Loca... | Python | 0.000001 |
73b9246164994049d291d5b482d4dbf2ca41a124 | Rename master branch to main | tests/app/test_accessibility_statement.py | tests/app/test_accessibility_statement.py | import re
import subprocess
from datetime import datetime
def test_last_review_date():
statement_file_path = "app/templates/views/accessibility_statement.html"
# test local changes against main for a full diff of what will be merged
statement_diff = subprocess.run(
[f"git diff --exit-code origin/... | import re
import subprocess
from datetime import datetime
def test_last_review_date():
statement_file_path = "app/templates/views/accessibility_statement.html"
# test local changes against master for a full diff of what will be merged
statement_diff = subprocess.run(
[f"git diff --exit-code origi... | Python | 0.999013 |
5f5bdcf5c6b6fb70dc94945d463c5200a46699d6 | revert unfinished task test | tests/integration/unfinished_task_test.py | tests/integration/unfinished_task_test.py | # stdlib
import time
# third party
import pytest
# syft absolute
import syft as sy
from syft.core.node.common.action.save_object_action import SaveObjectAction
from syft.core.store.storeable_object import StorableObject
@pytest.mark.general
def test_unfinished_task(get_clients) -> None:
print("running test_unfi... | # third party
import pytest
# syft absolute
import syft as sy
from syft.core.node.common.action.save_object_action import SaveObjectAction
from syft.core.store.storeable_object import StorableObject
@pytest.mark.general
def test_unfinished_task(get_clients) -> None:
print("running test_unfinished_task")
clie... | Python | 0.000167 |
da3a4e8036a5933a9ce00f42795c8ca398925c38 | Update geogig_init_repo.py | lib/rogue/geogig_init_repo.py | lib/rogue/geogig_init_repo.py | from base64 import b64encode
from optparse import make_option
import json
import urllib
import urllib2
import argparse
import time
import os
import subprocess
#==#
import _geogig_init_repo
#==#
parser = argparse.ArgumentParser(description='Initialize GeoGig repository and optionally add to GeoServer instance. If you w... | from base64 import b64encode
from optparse import make_option
import json
import urllib
import urllib2
import argparse
import time
import os
import subprocess
#==#
import _geogig_init_repo
#==#
parser = argparse.ArgumentParser(description='Initialize GeoGig repository and optionally add to GeoServer instance. If you w... | Python | 0.000001 |
64cbe20e2a415d4ee294862acc02a6a7682d7af3 | Isolate memcache test from network | tests/nydus/db/backends/memcache/tests.py | tests/nydus/db/backends/memcache/tests.py | from __future__ import absolute_import
from tests import BaseTest
from nydus.db import create_cluster
from nydus.db.base import BaseCluster
from nydus.db.backends.memcache import Memcache
import mock
import pylibmc
class MemcacheTest(BaseTest):
def setUp(self):
self.memcache = Memcache(num=0)
de... | from __future__ import absolute_import
from tests import BaseTest
from nydus.db import create_cluster
from nydus.db.base import BaseCluster
from nydus.db.backends.memcache import Memcache
import mock
import pylibmc
class MemcacheTest(BaseTest):
def setUp(self):
self.memcache = Memcache(num=0)
de... | Python | 0.000001 |
a19a52a42486eaa8e849d2f0a175f9a76497029d | bump version number | intercom/__init__.py | intercom/__init__.py | __version__ = "0.0.7"
| __version__ = "0.0.6" | Python | 0.000004 |
4324418262824f59e9b38dc01673f694d434f7d4 | add check | lesscpy/plib/call.py | lesscpy/plib/call.py | """
"""
import re
from urllib.parse import quote as urlquote
from .node import Node
import lesscpy.lessc.utility as utility
import lesscpy.lessc.color as Color
class Call(Node):
def parse(self, scope):
if not self.parsed:
name = ''.join(self.tokens.pop(0))
parsed = self.process(self... | """
"""
import re
from urllib.parse import quote as urlquote
from .node import Node
import lesscpy.lessc.utility as utility
import lesscpy.lessc.color as Color
class Call(Node):
def parse(self, scope):
name = ''.join(self.tokens.pop(0))
parsed = self.process(self.tokens, scope)
if name == '... | Python | 0 |
b4abd0045178f3368fb1ddc0ba5b96094c933c22 | Verify domain exists before scanning | musubi/scan.py | musubi/scan.py |
"""
Scan multiple DNSBLs for IP addresss or domain.
Copyright (c) 2012, Rob Cakebread
All rights reserved.
If you give the domain, musubi will try to find all your IP addresses
for each mail server by querying MX DNS records and then doing a lookup
for the IPs. If your mail server uses round-robin DNS, this of cou... |
"""
Scan multiple DNSBLs for IP addresss or domain.
Copyright (c) 2012, Rob Cakebread
All rights reserved.
If you give the domain, musubi will try to find all your IP addresses
for each mail server by querying MX DNS records and then doing a lookup
for the IPs. If your mail server uses round-robin DNS, this of cou... | Python | 0 |
d23a53f5c97a3939952ecb8f39d24603fe0d4bab | bump `datadog-checks-base` version (#9718) | mysql/setup.py | mysql/setup.py | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open
from os import path
from setuptools import setup
HERE = path.abspath(path.dirname(__file__))
# Get version info
ABOUT = {}
with open(path.join(HERE, "datadog_checks", "mysql", "_... | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open
from os import path
from setuptools import setup
HERE = path.abspath(path.dirname(__file__))
# Get version info
ABOUT = {}
with open(path.join(HERE, "datadog_checks", "mysql", "_... | Python | 0 |
1ecf42f474b17e01de12d235a29b08e7f18d0726 | bump version to v1.10.3 | ndd/package.py | ndd/package.py | # -*- coding: utf-8 -*-
"""Template package file"""
__title__ = 'ndd'
__version__ = '1.10.3'
__author__ = 'Simone Marsili'
__summary__ = ''
__url__ = 'https://github.com/simomarsili/ndd'
__email__ = 'simo.marsili@gmail.com'
__license__ = 'BSD 3-Clause'
__copyright__ = 'Copyright (c) 2020, Simone Marsili'
__classifiers_... | # -*- coding: utf-8 -*-
"""Template package file"""
__title__ = 'ndd'
__version__ = '1.10.2'
__author__ = 'Simone Marsili'
__summary__ = ''
__url__ = 'https://github.com/simomarsili/ndd'
__email__ = 'simo.marsili@gmail.com'
__license__ = 'BSD 3-Clause'
__copyright__ = 'Copyright (c) 2020, Simone Marsili'
__classifiers_... | Python | 0 |
527ccd5790aa08d33387b43fd25beb2ed20335c7 | remove defaults, use self.asserts | tensorflow/python/ops/script_ops_test.py | tensorflow/python/ops/script_ops_test.py | # Copyright 2020 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... | # Copyright 2020 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... | Python | 0.000028 |
10f0807b9ab85bfa6f6bbb4ed533e1a8af642571 | fix bug in raw service | lib/svtplay_dl/service/raw.py | lib/svtplay_dl/service/raw.py | from __future__ import absolute_import
import os
import re
from svtplay_dl.service import Service
from svtplay_dl.fetcher.hds import hdsparse
from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.fetcher.dash import dashparse
class Raw(Service):
def get(self):
if self.exclude():
return
... | from __future__ import absolute_import
import os
import re
from svtplay_dl.service import Service
from svtplay_dl.fetcher.hds import hdsparse
from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.fetcher.dash import dashparse
class Raw(Service):
def get(self):
if self.exclude():
return
... | Python | 0 |
905c6d82c0b568788cd755cb5a98b0e24550f9a5 | test .to() method on particle collection | streams/nbody/tests/test_particles.py | streams/nbody/tests/test_particles.py | # coding: utf-8
""" """
from __future__ import absolute_import, unicode_literals, division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
# Third-party
import astropy.units as u
import numpy as np
import pytest
from ...misc.units import UnitSystem
from ..particles i... | # coding: utf-8
""" """
from __future__ import absolute_import, unicode_literals, division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
# Third-party
import astropy.units as u
import numpy as np
import pytest
from ...misc.units import UnitSystem
from ..particles i... | Python | 0 |
6a2aa6051c7922d1b2b37824d92634a4880e9ff2 | Correct semantic version format. | tensorflow_probability/python/version.py | tensorflow_probability/python/version.py | # Copyright 2018 The TensorFlow Probability 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 o... | # Copyright 2018 The TensorFlow Probability 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 o... | Python | 0.00053 |
82665b999fb07e3ebc41de8132ba9d22dc04140c | Change version number back to 0.8.0.dev | neo/version.py | neo/version.py | # -*- coding: utf-8 -*-
version = '0.8.0.dev'
| # -*- coding: utf-8 -*-
version = '0.7.1'
| Python | 0.000001 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.