hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e8fb2b5a56ecd2849f9d868ad9aa0e070c9f55d2 | 755 | py | Python | setup.py | gusmaogabriels/xl2py | 5ce966ba1df241a0904fdf4132841c5f00df1f4f | [
"MIT"
] | 6 | 2015-10-10T13:05:02.000Z | 2021-04-17T18:52:19.000Z | setup.py | gusmaogabriels/xl2py | 5ce966ba1df241a0904fdf4132841c5f00df1f4f | [
"MIT"
] | null | null | null | setup.py | gusmaogabriels/xl2py | 5ce966ba1df241a0904fdf4132841c5f00df1f4f | [
"MIT"
] | 2 | 2019-05-21T12:47:18.000Z | 2020-11-27T01:51:41.000Z | from setuptools import setup
requires = ['numpy','pythoncom','win32com','re','copy','time']
packages = [
'xl2py',
'xl2py.core',
'xl2py.conversion_lib',
'xl2py.com_handlers',
]
package_dir = {'xl2py' : 'xl2py'}
package_data = { 'xl2py' : []}
setup(
name='xl2py',
version='1.0.2b',
packages=packa... | 24.354839 | 113 | 0.650331 |
e8fb360d2fc9716245b40230307152fdffbb532c | 7,620 | py | Python | venv/lib/python3.6/site-packages/kubernetes/client/models/v1_csi_volume_source.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1_csi_volume_source.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1_csi_volume_source.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1CSI... | 33.716814 | 206 | 0.630315 |
e8fb61199ec63f3199d38dc216222e6210b52a7e | 51 | py | Python | batchglm/api/utils/random.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/api/utils/random.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/api/utils/random.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | from batchglm.utils.random import NegativeBinomial
| 25.5 | 50 | 0.882353 |
e8fb6fc83cf2c051a57989195511b3445327078d | 3,774 | py | Python | cemu/arch/__init__.py | MatejKastak/cemu | c6f93239a5901ce00d2f739a3913d0ba7d0ed4e4 | [
"MIT"
] | null | null | null | cemu/arch/__init__.py | MatejKastak/cemu | c6f93239a5901ce00d2f739a3913d0ba7d0ed4e4 | [
"MIT"
] | null | null | null | cemu/arch/__init__.py | MatejKastak/cemu | c6f93239a5901ce00d2f739a3913d0ba7d0ed4e4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import enum
import os
import csv
import abc
Endianness = enum.Enum("Endianness", "BIG LITTLE")
Syntax = enum.Enum("Syntaxes", "INTEL ATT")
class Architecture(object):
"""Generic metaclass for the architectures."""
__metaclass__ = abc.ABCMeta
endianness = Endianness.LITTLE
__s... | 24.348387 | 97 | 0.639905 |
e8fbcef2097c1d615104b8f383641ba5efa574e3 | 9,548 | py | Python | lreid/datasets/cuhk01.py | TPCD/LifelongReID | cb33f9c29fe398e7546db345fab1c338dda8252f | [
"MIT"
] | 63 | 2021-03-20T15:33:11.000Z | 2022-03-30T03:04:14.000Z | lreid/datasets/cuhk01.py | TPCD/LifelongReID | cb33f9c29fe398e7546db345fab1c338dda8252f | [
"MIT"
] | 5 | 2021-03-23T08:04:21.000Z | 2022-03-10T02:28:43.000Z | lreid/datasets/cuhk01.py | TPCD/LifelongReID | cb33f9c29fe398e7546db345fab1c338dda8252f | [
"MIT"
] | 10 | 2021-04-30T11:14:10.000Z | 2022-03-18T16:44:55.000Z | from __future__ import division, print_function, absolute_import
import glob
import numpy as np
import os.path as osp
import zipfile
import os
from lreid.data_loader.incremental_datasets import IncrementalPersonReIDSamples
from lreid.utils import read_json, write_json
import copy
class IncrementalSamples4cuhk01(Increm... | 38.813008 | 85 | 0.536762 |
e8fbd7f3131b46819e00ae831fec4cc05ba8ecf5 | 257 | py | Python | util/custom_exceptions.py | eark-project/access_dipcreator | b1f9034d309dfdb676cbba92c9c4722bf576aba2 | [
"MIT"
] | 4 | 2019-12-19T17:17:42.000Z | 2021-12-11T23:12:45.000Z | util/custom_exceptions.py | eark-project/access_dipcreator | b1f9034d309dfdb676cbba92c9c4722bf576aba2 | [
"MIT"
] | 32 | 2020-03-19T15:56:05.000Z | 2021-12-23T12:46:06.000Z | util/custom_exceptions.py | eark-project/access_dipcreator | b1f9034d309dfdb676cbba92c9c4722bf576aba2 | [
"MIT"
] | null | null | null | class AuthenticationError(Exception):
pass
class ResourceNotAvailable(Exception):
def __init__(self, message):
super().__init__(message)
class NotFoundError(Exception):
def __init__(self, message):
super().__init__(message) | 18.357143 | 38 | 0.708171 |
e8fbdf2edaa3eccc5d6c13cef9b60708bd5d9372 | 977 | py | Python | src/util/utils.py | jorgegil96/Yargi | b65a85760e3e27487ba6c09f156993b797b8c470 | [
"MIT"
] | 3 | 2019-02-02T03:13:44.000Z | 2021-04-26T09:45:08.000Z | src/util/utils.py | jorgegil96/Yargi | b65a85760e3e27487ba6c09f156993b797b8c470 | [
"MIT"
] | 2 | 2018-05-02T00:36:05.000Z | 2018-05-02T00:44:57.000Z | src/util/utils.py | jorgegil96/Yargi | b65a85760e3e27487ba6c09f156993b797b8c470 | [
"MIT"
] | null | null | null | import operator
def parser_type_to_cube_type(type):
if type in ['int', 'float', 'bool', 'string']:
return type
if type == "TRUE" or type == "FALSE":
return "bool"
elif type == "INTNUM":
return "int"
elif type == "FLOATNUM":
return "float"
elif type == "STRINGVAL":
... | 23.261905 | 50 | 0.535312 |
e8fbf038a8d91a09a6c5db211f1b12d6c8c9d0d7 | 19,283 | py | Python | privx_api/enums.py | hokenssh/privx-sdk-for-python | 24627d25c0343f350c9b2396677344b771f8aec6 | [
"Apache-2.0"
] | null | null | null | privx_api/enums.py | hokenssh/privx-sdk-for-python | 24627d25c0343f350c9b2396677344b771f8aec6 | [
"Apache-2.0"
] | null | null | null | privx_api/enums.py | hokenssh/privx-sdk-for-python | 24627d25c0343f350c9b2396677344b771f8aec6 | [
"Apache-2.0"
] | null | null | null | # PrivX URLs.
from typing import Union
from privx_api.exceptions import InternalAPIException
class AuthEnum:
AUTHORIZE = "AUTH.AUTHORIZE"
TOKEN = "AUTH.TOKEN"
STATUS = "AUTH.STATUS"
urls = {
AUTHORIZE: "/auth/api/v1/oauth/authorize",
TOKEN: "/auth/api/v1/oauth/token",
STATUS... | 43.825 | 88 | 0.698906 |
e8fc0815149044d0bb06da38c013efef7aecc82b | 2,042 | py | Python | google-cloud-sdk/.install/.backup/lib/surface/billing/accounts/describe.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/billing/accounts/describe.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/billing/accounts/describe.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 32.412698 | 74 | 0.674339 |
e8fc0f62d7f4d25b560a0ba68dc353c3e5332292 | 2,955 | py | Python | zs/cmdline/dump.py | njsmith/zs | 42ca7679c2b986243abcff048bc42d49c204048c | [
"BSD-2-Clause"
] | 35 | 2015-06-19T02:36:14.000Z | 2021-09-22T21:19:59.000Z | zs/cmdline/dump.py | njsmith/zs | 42ca7679c2b986243abcff048bc42d49c204048c | [
"BSD-2-Clause"
] | 2 | 2016-03-07T00:52:41.000Z | 2021-11-14T16:48:33.000Z | zs/cmdline/dump.py | njsmith/zs | 42ca7679c2b986243abcff048bc42d49c204048c | [
"BSD-2-Clause"
] | 4 | 2015-01-30T09:23:18.000Z | 2019-02-05T18:03:08.000Z | # This file is part of ZS
# Copyright (C) 2013-2014 Nathaniel Smith <njs@pobox.com>
# See file LICENSE.txt for license information.
import sys
from .util import open_zs
def command_dump(opts):
"""Unpack some or all of the contents of a .zs file.
Usage:
zs dump <zs_file>
zs dump [--start=START] [--stop=STOP]... | 37.405063 | 77 | 0.611506 |
e8fc2198961e6e607b8e7e6497892eb5d4d7336a | 1,692 | py | Python | tools/clear.py | Adancurusul/MaixPy3 | 0e8050151d2972ffb0ddeecc0ecc8915dcf59e99 | [
"MIT"
] | 93 | 2021-01-12T01:56:06.000Z | 2022-03-30T12:52:01.000Z | tools/clear.py | Adancurusul/MaixPy3 | 0e8050151d2972ffb0ddeecc0ecc8915dcf59e99 | [
"MIT"
] | 29 | 2021-02-04T10:37:26.000Z | 2022-03-20T15:10:55.000Z | tools/clear.py | Adancurusul/MaixPy3 | 0e8050151d2972ffb0ddeecc0ecc8915dcf59e99 | [
"MIT"
] | 25 | 2021-01-25T18:10:09.000Z | 2022-03-31T13:55:36.000Z | #!/usr/bin/env python
#coding=utf-8
import os,sys
from stat import *
# Declares a collection of file suffix names(.xxx) to be deleted
DelFiles=['pyc', 'log', 'o']
# Declares a collection of folder names that you want to delete
DelFolders=['__pycache__', 'dist', 'build', 'MaixPy3.egg-info']
def PurgeCatalog(path):
... | 34.530612 | 96 | 0.577423 |
e8fc2c4aeda4031320568feda96bf7dcec9ef0f8 | 6,705 | py | Python | client_code/Tabs/__init__.py | jshaffstall/anvil-extras | 521eec32a98cc038fea27379ff6c0ab024f31c7f | [
"MIT"
] | null | null | null | client_code/Tabs/__init__.py | jshaffstall/anvil-extras | 521eec32a98cc038fea27379ff6c0ab024f31c7f | [
"MIT"
] | null | null | null | client_code/Tabs/__init__.py | jshaffstall/anvil-extras | 521eec32a98cc038fea27379ff6c0ab024f31c7f | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
#
# Copyright (c) 2021 The Anvil Extras project team members listed at
# https://github.com/anvilistas/anvil-extras/graphs/contributors
#
# This software is published at https://github.com/anvilistas/anvil-extras
from functools import partial
import anvil.js
from anvil import HtmlPanel ... | 28.172269 | 89 | 0.621626 |
e8fc4353220b5643143e08e4b456af9dcf783abe | 4,307 | py | Python | lymph/services/node.py | MislavStipetic/lymph | aa36a688380e5665fdea31fda76b4a0cf35b6fc0 | [
"Apache-2.0"
] | 89 | 2015-03-01T11:39:55.000Z | 2022-01-31T22:00:15.000Z | lymph/services/node.py | MislavStipetic/lymph | aa36a688380e5665fdea31fda76b4a0cf35b6fc0 | [
"Apache-2.0"
] | 214 | 2015-01-02T23:48:49.000Z | 2020-01-14T10:47:37.000Z | lymph/services/node.py | MislavStipetic/lymph | aa36a688380e5665fdea31fda76b4a0cf35b6fc0 | [
"Apache-2.0"
] | 36 | 2015-01-13T13:44:15.000Z | 2021-09-15T17:55:41.000Z | import json
import logging
import gevent
import os
import psutil
import six
from gevent import subprocess
from six.moves import range
from lymph.core.interfaces import Interface
from lymph.core.monitoring.metrics import Generator
from lymph.utils.sockets import create_socket
logger = logging.getLogger(__name__)
cl... | 33.130769 | 94 | 0.578361 |
e8fc5cfd749eff8b13ceceb2a50fb9b78e10285d | 3,380 | py | Python | src/ggrc/access_control/roleable.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/access_control/roleable.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/access_control/roleable.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Roleable model"""
from sqlalchemy import and_
from sqlalchemy import orm
from sqlalchemy.orm import remote
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.ext.hybrid import hybrid_pr... | 29.391304 | 78 | 0.68432 |
e8fc73118efb824a7239bcd4e6c9c71f40da248d | 5,838 | py | Python | rigl/experimental/jax/prune.py | vishalbelsare/rigl | f18abc7d82ae3acc6736068408a0186c9efa575c | [
"Apache-2.0"
] | 276 | 2019-11-25T22:05:45.000Z | 2022-03-30T11:55:34.000Z | rigl/experimental/jax/prune.py | vishalbelsare/rigl | f18abc7d82ae3acc6736068408a0186c9efa575c | [
"Apache-2.0"
] | 10 | 2020-02-26T14:53:50.000Z | 2021-09-08T16:27:28.000Z | rigl/experimental/jax/prune.py | vishalbelsare/rigl | f18abc7d82ae3acc6736068408a0186c9efa575c | [
"Apache-2.0"
] | 54 | 2019-11-26T18:50:33.000Z | 2022-03-29T20:08:08.000Z | # coding=utf-8
# Copyright 2021 RigL 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 or agree... | 33.551724 | 79 | 0.725762 |
e8fcb4f09442e974ef50bd46710a91be9a4031bd | 334 | py | Python | smartystreets_python_sdk/international_autocomplete/suggestion.py | melonhead901/smartystreets-python-sdk | dd1af1c497968819b3e73a701af5e1f45b58a389 | [
"Apache-2.0"
] | 19 | 2017-01-20T16:34:19.000Z | 2021-12-09T15:56:09.000Z | smartystreets_python_sdk/international_autocomplete/suggestion.py | melonhead901/smartystreets-python-sdk | dd1af1c497968819b3e73a701af5e1f45b58a389 | [
"Apache-2.0"
] | 25 | 2016-12-11T01:20:19.000Z | 2022-03-24T19:59:25.000Z | smartystreets_python_sdk/international_autocomplete/suggestion.py | melonhead901/smartystreets-python-sdk | dd1af1c497968819b3e73a701af5e1f45b58a389 | [
"Apache-2.0"
] | 28 | 2016-12-31T17:06:07.000Z | 2022-02-17T00:09:02.000Z | class Suggestion:
def __init__(self, obj=None):
self.street = obj.get('street', None)
self.locality = obj.get('locality', None)
self.administrative_area = obj.get('administrative_area', None)
self.postal_code = obj.get('postal_code', None)
self.country_iso3 = obj.get('country... | 41.75 | 71 | 0.655689 |
e8fcd51b8f762950a8901c418987e0e140bbbfe0 | 915 | py | Python | catalyst/dl/tests/test_main.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 2 | 2021-02-22T12:15:41.000Z | 2021-05-02T15:22:24.000Z | catalyst/dl/tests/test_main.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/dl/tests/test_main.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 1 | 2018-12-21T15:56:21.000Z | 2018-12-21T15:56:21.000Z | import pytest
from .. import __main__ as main
def test_arg_parser_run():
"""@TODO: Docs. Contribution is welcome."""
parser = main.build_parser()
args, uargs = parser.parse_known_args(
["run", "--config", "test.yml", "--unknown"]
)
assert args.command == "run"
assert args.configs ==... | 24.72973 | 70 | 0.628415 |
e8fce4c345066634f1c2b1faf8e2f018c1e62a1c | 7,387 | py | Python | scattertext/TermCategoryFrequencies.py | admariner/scattertext | c2ac33ce01eedf8652d9bd1d61a648751950a367 | [
"Apache-2.0"
] | 2 | 2016-07-24T20:32:18.000Z | 2016-07-26T18:54:18.000Z | scattertext/TermCategoryFrequencies.py | JasonKessler/text-to-ideas | c2ac33ce01eedf8652d9bd1d61a648751950a367 | [
"Apache-2.0"
] | 2 | 2021-11-08T22:33:12.000Z | 2021-11-15T04:48:19.000Z | scattertext/TermCategoryFrequencies.py | JasonKessler/text-to-ideas | c2ac33ce01eedf8652d9bd1d61a648751950a367 | [
"Apache-2.0"
] | null | null | null | import pkgutil
from io import StringIO
import numpy as np
import pandas as pd
from scattertext.Common import DEFAULT_BACKGROUND_SCALER_ALGO, DEFAULT_BACKGROUND_BETA
from scattertext.termscoring import ScaledFScore
class TermCategoryFrequencies(object):
'''
This class allows you to produce scatter plots of raw term... | 32.685841 | 161 | 0.723839 |
e8fcf4b14e32388d39ef4d5a639846165534409e | 556 | py | Python | setup.py | Spigushe/BotLigue | 19609ab7f10710baf2f60f6416ece51a5569715c | [
"MIT"
] | null | null | null | setup.py | Spigushe/BotLigue | 19609ab7f10710baf2f60f6416ece51a5569715c | [
"MIT"
] | null | null | null | setup.py | Spigushe/BotLigue | 19609ab7f10710baf2f60f6416ece51a5569715c | [
"MIT"
] | null | null | null | import setuptools
import setuptools.command.develop
import setuptools.command.install
class WithCompile:
def run(self):
super().run()
class InstallWithCompile(WithCompile, setuptools.command.install.install):
pass
class DevelopWithCompile(WithCompile, setuptools.command.develop.develop):
pass
... | 18.533333 | 74 | 0.728417 |
e8fd28bcc1239a2eb28f92d5de724ffb5c0f3329 | 12,709 | py | Python | bonneville/modules/upstart.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/modules/upstart.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/modules/upstart.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | 3 | 2020-05-10T02:08:44.000Z | 2020-11-06T11:01:57.000Z | # -*- coding: utf-8 -*-
'''
Module for the management of upstart systems. The Upstart system only supports
service starting, stopping and restarting.
Currently (as of Ubuntu 12.04) there is no tool available to disable
Upstart services (like update-rc.d). This[1] is the recommended way to
disable an Upstart service. S... | 25.831301 | 183 | 0.630655 |
e8fd3578886e992bc871d49b24fe718358327ea1 | 6,787 | py | Python | tests/email_tests.py | rodrigoguariento/incubator-superset | b2633a51d43faaca74751349b96fc32784d4b377 | [
"Apache-2.0"
] | 7 | 2017-11-01T06:00:12.000Z | 2019-01-05T13:31:48.000Z | tests/email_tests.py | Odirlei-Stein/incubator-superset | 52afc33b31475536b287b56d262b9eaa32f479ab | [
"Apache-2.0"
] | 108 | 2019-06-10T05:48:22.000Z | 2021-07-26T04:20:03.000Z | tests/email_tests.py | Odirlei-Stein/incubator-superset | 52afc33b31475536b287b56d262b9eaa32f479ab | [
"Apache-2.0"
] | 4 | 2020-06-25T10:42:36.000Z | 2020-08-13T05:39:09.000Z | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | 39.690058 | 86 | 0.66097 |
e8fd84b8aaba3193170bd59c925f7b46ee036021 | 16,506 | py | Python | finrl_meta/env_stock_trading/env_stocktrading_A_sinawave4.py | war3gu/FinRL-Meta | c394511530c4a87d61436b2c0467d504849737d7 | [
"MIT"
] | 1 | 2022-02-21T11:20:59.000Z | 2022-02-21T11:20:59.000Z | finrl_meta/env_stock_trading/env_stocktrading_A_sinawave4.py | war3gu/FinRL-Meta | c394511530c4a87d61436b2c0467d504849737d7 | [
"MIT"
] | null | null | null | finrl_meta/env_stock_trading/env_stocktrading_A_sinawave4.py | war3gu/FinRL-Meta | c394511530c4a87d61436b2c0467d504849737d7 | [
"MIT"
] | 1 | 2022-03-03T06:51:46.000Z | 2022-03-03T06:51:46.000Z |
import numpy as np
import pandas as pd
from gym.utils import seeding
import gym
from gym import spaces
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import pickle
from stable_baselines3.common.vec_env import DummyVecEnv, SubprocVecEnv
from stable_baselines3.common.logger import Logger as log
... | 36.197368 | 136 | 0.526172 |
e8fd971076115e07b7826ae9b871e04eaa79fa78 | 2,829 | py | Python | wienerschnitzelgemeinschaft/src/Christof/models/GAPNet/13_ext_60_40/predict_5fold_3.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | wienerschnitzelgemeinschaft/src/Christof/models/GAPNet/13_ext_60_40/predict_5fold_3.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | wienerschnitzelgemeinschaft/src/Christof/models/GAPNet/13_ext_60_40/predict_5fold_3.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | import os, sys
#os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
#os.environ["CUDA_VISIBLE_DEVICES"]="1"
import numpy as np
import pandas as pd
from tqdm import tqdm
import numpy as np
import pandas as pd
eps = 0.004
desired = {
0: 0.36239782,
1: 0.043841336,
2: 0.075268817,
3: 0.059322034,
4: 0... | 26.688679 | 79 | 0.681866 |
e8fd9ca52fb31ff6ba7d46bca9e11094fcb5b0d9 | 5,087 | py | Python | test/lmp/model/_lstm_2002/test_init.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | test/lmp/model/_lstm_2002/test_init.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | test/lmp/model/_lstm_2002/test_init.py | ProFatXuanAll/char-RNN | 531f101b3d1ba20bafd28ca060aafe6f583d1efb | [
"Beerware"
] | null | null | null | """Test model construction.
Test target:
- :py:meth:`lmp.model._lstm_2002.LSTM2002.__init__`.
"""
import math
import torch
import torch.nn as nn
from lmp.model._lstm_2002 import LSTM2002
from lmp.tknzr._base import PAD_TKID, BaseTknzr
def test_parameters(
d_blk: int,
d_emb: int,
n_blk: int,
p_emb: float,
... | 42.747899 | 118 | 0.72872 |
e8fdce3d75225bf819cd3e1843c5acac45fad872 | 13,601 | py | Python | sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/_container_apps_auth_configs_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/_container_apps_auth_configs_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/_container_apps_auth_configs_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 44.740132 | 201 | 0.680832 |
e8fdef940abde1e8ba5b5a650ffaaade0fc41ad5 | 2,562 | py | Python | info_proj/main_app/settings.py | adamkwolf/handwriting_cnn | 83cee31622b98f95660e5f09b9d4cf4f53b519ba | [
"Apache-2.0"
] | null | null | null | info_proj/main_app/settings.py | adamkwolf/handwriting_cnn | 83cee31622b98f95660e5f09b9d4cf4f53b519ba | [
"Apache-2.0"
] | null | null | null | info_proj/main_app/settings.py | adamkwolf/handwriting_cnn | 83cee31622b98f95660e5f09b9d4cf4f53b519ba | [
"Apache-2.0"
] | null | null | null | """
Django settings for learning_users project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
im... | 28.466667 | 77 | 0.686573 |
e8fe2168ecfd9d29d0dcb96aa24bc8634f324a85 | 555 | py | Python | pandaserver/test/killProdJobs.py | virthead/panda-server | d2b65f788c4539dc103641ca2a8052cb18729d44 | [
"Apache-2.0"
] | 7 | 2015-03-30T14:15:35.000Z | 2021-12-22T06:48:22.000Z | pandaserver/test/killProdJobs.py | virthead/panda-server | d2b65f788c4539dc103641ca2a8052cb18729d44 | [
"Apache-2.0"
] | 16 | 2015-06-01T13:48:01.000Z | 2022-02-08T15:03:32.000Z | pandaserver/test/killProdJobs.py | virthead/panda-server | d2b65f788c4539dc103641ca2a8052cb18729d44 | [
"Apache-2.0"
] | 15 | 2015-03-02T08:57:35.000Z | 2022-03-01T09:48:45.000Z | import sys
import pandaserver.userinterface.Client as Client
if len(sys.argv) == 2:
jobDefIDs = [sys.argv[1]]
else:
startID = int(sys.argv[1])
endID = int(sys.argv[2])
if startID > endID:
print('%d is less than %d' % (endID,startID))
sys.exit(1)
jobDefIDs = range(startID,endID+1)... | 18.5 | 53 | 0.625225 |
e8fe3ab9f3ca1f45af2510d2d95c21ba20404872 | 3,598 | py | Python | music_trees/utils/audio.py | hugofloresgarcia/music-trees | 51c47f1fc924936c25b84bf35edff52d88e9cccd | [
"MIT"
] | 25 | 2021-07-16T10:24:35.000Z | 2022-03-25T04:46:25.000Z | music_trees/utils/audio.py | loretoparisi/music-trees | 0ea3f49c2bafa97efd7352728ca687d7fee9e025 | [
"MIT"
] | 4 | 2021-11-12T10:25:29.000Z | 2021-12-01T16:11:13.000Z | music_trees/utils/audio.py | loretoparisi/music-trees | 0ea3f49c2bafa97efd7352728ca687d7fee9e025 | [
"MIT"
] | 3 | 2021-11-09T02:40:03.000Z | 2022-03-04T19:26:39.000Z | """ extensions to nussl.AudioSignal """
from nussl import AudioSignal
import warnings
import copy
import numpy as np
import sox
def trim_silence(signal: AudioSignal, sample_rate: int,
min_silence_duration=0.3):
""" trim silence from audio array using sox
"""
audio = signal.to_mono(overw... | 36.343434 | 103 | 0.665926 |
e8fe41dbaf3646e73ef892af9f8ff5963d849c47 | 2,207 | py | Python | chrome/test/chromedriver/test.py | leiferikb/bitpop-private | 4c967307d228e86f07f2576068a169e846c833ca | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-11-15T15:17:43.000Z | 2021-11-15T15:17:43.000Z | chrome/test/chromedriver/test.py | houseoflifeproperty/bitpop-private | 4c967307d228e86f07f2576068a169e846c833ca | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/test/chromedriver/test.py | houseoflifeproperty/bitpop-private | 4c967307d228e86f07f2576068a169e846c833ca | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T07:24:02.000Z | 2020-11-04T07:24:02.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""End to end tests for ChromeDriver."""
import ctypes
import os
import sys
import unittest
import chromedriver
class ChromeDriverTest(unittest.TestC... | 33.953846 | 77 | 0.719076 |
e8fe74d4bc6fd8ca5a0dbf778c6454612ae16ee9 | 80 | py | Python | functions/pipeline/shared/db_access/__init__.py | jmspring/active-learning-detect | edb20019f38ae13204a200166281e2a6baafaee4 | [
"MIT"
] | null | null | null | functions/pipeline/shared/db_access/__init__.py | jmspring/active-learning-detect | edb20019f38ae13204a200166281e2a6baafaee4 | [
"MIT"
] | null | null | null | functions/pipeline/shared/db_access/__init__.py | jmspring/active-learning-detect | edb20019f38ae13204a200166281e2a6baafaee4 | [
"MIT"
] | null | null | null | from .db_access_v2 import ImageTagDataAccess, ImageTag, ImageInfo, ImageTagState | 80 | 80 | 0.875 |
e8fe9d215a75db45bee387f432b6605479ff9172 | 3,508 | py | Python | auth/auth.py | brandonrobertz/foiamail | b3454e6117dce2d3c070af87b43ced85f4438690 | [
"MIT"
] | null | null | null | auth/auth.py | brandonrobertz/foiamail | b3454e6117dce2d3c070af87b43ced85f4438690 | [
"MIT"
] | null | null | null | auth/auth.py | brandonrobertz/foiamail | b3454e6117dce2d3c070af87b43ced85f4438690 | [
"MIT"
] | null | null | null | """
authentication tools for:
- contacts
- gmail
- sheets
- drive
that allow all other modules to work
via wrapper functions
"""
from __future__ import print_function
import sys
import httplib2
import json
from apiclient.discovery import build
from oauth2client import tools
from oauth2client.file import Storage
from oa... | 28.991736 | 143 | 0.691562 |
e8fee225919563207674f70be539ec7733dcbbfe | 3,425 | py | Python | demisto_sdk/commands/format/update_layout.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/format/update_layout.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/format/update_layout.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | from typing import Tuple
import yaml
from demisto_sdk.commands.common.hook_validations.layout import LayoutValidator
from demisto_sdk.commands.common.tools import LOG_COLORS, print_color
from demisto_sdk.commands.format.format_constants import (
DEFAULT_VERSION, ERROR_RETURN_CODE, NEW_FILE_DEFAULT_5_FROMVERSION,
... | 41.768293 | 125 | 0.641168 |
e8ff2895c700106c2f1becfd96cd8011d2c3dc2a | 10,853 | py | Python | python_modules/dagit/dagit/graphql.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagit/dagit/graphql.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagit/dagit/graphql.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from asyncio import Queue, Task, get_event_loop
from enum import Enum
from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union
from dagit.templates.playground import TEMPLATE
from graphene import Schema
from graphql.error import GraphQLError
from graphql.error impo... | 34.674121 | 102 | 0.630793 |
e8ff34706ca7261d72ba11b5eb45a5321b2b111e | 1,089 | py | Python | src/sardana/macroserver/scan/__init__.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/macroserver/scan/__init__.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/macroserver/scan/__init__.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | 34.03125 | 78 | 0.6382 |
e8ff4a1a028564382d39d802f809bebdddfbed85 | 6,036 | py | Python | dvc/utils/compat.py | amisev/dvc | 025de9aeb509a539d5560f82caf47e851162f4a2 | [
"Apache-2.0"
] | null | null | null | dvc/utils/compat.py | amisev/dvc | 025de9aeb509a539d5560f82caf47e851162f4a2 | [
"Apache-2.0"
] | null | null | null | dvc/utils/compat.py | amisev/dvc | 025de9aeb509a539d5560f82caf47e851162f4a2 | [
"Apache-2.0"
] | null | null | null | """Handle import compatibility between Python 2 and Python 3"""
from __future__ import absolute_import
import sys
import os
import errno
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = _ver[0] == 2
#: Python 3.x?
is_py3 = _ver[0] == 3
# simplified version of ipython_genutils/encoding.py
DEFAULT_ENC... | 29.881188 | 79 | 0.621107 |
e8ff96d844e123eb132d75e1a516cc756eff25fe | 24,778 | py | Python | pyglet/resource.py | regular/pyglet-avbin-optimizations | e93c0508a57c92c24cc22dee12be0a58b1fcf975 | [
"BSD-3-Clause"
] | 2 | 2017-05-10T08:27:22.000Z | 2019-10-05T14:55:00.000Z | pyglet/resource.py | regular/pyglet-avbin-optimizations | e93c0508a57c92c24cc22dee12be0a58b1fcf975 | [
"BSD-3-Clause"
] | null | null | null | pyglet/resource.py | regular/pyglet-avbin-optimizations | e93c0508a57c92c24cc22dee12be0a58b1fcf975 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | 34.703081 | 78 | 0.607232 |
e8ffa84aee24da6ceb883d74e1ddf6f4f272eb3f | 492 | py | Python | Python/Coursera/Universidad Austral/2. Estructuras de Datos/week 3/4 conjuntos_matrices.py | aguswake1/Courses_and_stuff | 841e2a8316c976488c3e40866c336dcbdb57cce2 | [
"Apache-2.0"
] | null | null | null | Python/Coursera/Universidad Austral/2. Estructuras de Datos/week 3/4 conjuntos_matrices.py | aguswake1/Courses_and_stuff | 841e2a8316c976488c3e40866c336dcbdb57cce2 | [
"Apache-2.0"
] | null | null | null | Python/Coursera/Universidad Austral/2. Estructuras de Datos/week 3/4 conjuntos_matrices.py | aguswake1/Courses_and_stuff | 841e2a8316c976488c3e40866c336dcbdb57cce2 | [
"Apache-2.0"
] | null | null | null | frutas = {'manzana', 'naranja', 'manzana', 'pera', 'naranja', 'banana', 'kiwi'}
'pera' in frutas
'yerba' in frutas
# conjunto vacio
set()
# otras formas de crear conjuntos
a = set('abracadabra')
b = set('alacazam')
# operaciones de conjuntos
a - b # letras en a pero no en b
a | b # letras en a o en b o en ambas
a... | 20.5 | 79 | 0.638211 |
e8ffaad4adcc00d16b739d4c344465a8b09fb249 | 1,988 | py | Python | test/mitmproxy/utils/test_human.py | takeratta/mitmproxy | 569d275d763f499cce9673fcf118dcc8d59d2eeb | [
"MIT"
] | 4 | 2018-03-14T03:47:22.000Z | 2018-06-28T08:00:39.000Z | test/mitmproxy/utils/test_human.py | takeratta/mitmproxy | 569d275d763f499cce9673fcf118dcc8d59d2eeb | [
"MIT"
] | null | null | null | test/mitmproxy/utils/test_human.py | takeratta/mitmproxy | 569d275d763f499cce9673fcf118dcc8d59d2eeb | [
"MIT"
] | 1 | 2018-04-22T15:43:46.000Z | 2018-04-22T15:43:46.000Z | import time
import pytest
from mitmproxy.utils import human
def test_format_timestamp():
assert human.format_timestamp(time.time())
def test_format_timestamp_with_milli():
assert human.format_timestamp_with_milli(time.time())
def test_parse_size():
assert human.parse_size("0") == 0
assert human.pa... | 34.877193 | 93 | 0.667002 |
e8ffdf49a0e40a56c78fa6aa93ae097ead1da58b | 1,764 | py | Python | v2/providers/sub_mosaiquefm.py | hamdielhamdi/vanilla | ed299d706a32b353a2c98464771134fa98e74ce9 | [
"MIT"
] | 4 | 2019-11-28T11:47:27.000Z | 2019-12-18T11:15:41.000Z | v2/providers/sub_mosaiquefm.py | hamdielhamdi/vanilla | ed299d706a32b353a2c98464771134fa98e74ce9 | [
"MIT"
] | null | null | null | v2/providers/sub_mosaiquefm.py | hamdielhamdi/vanilla | ed299d706a32b353a2c98464771134fa98e74ce9 | [
"MIT"
] | null | null | null | #########################################################
######### used to extract regional news #################
#########################################################
from datetime import datetime
import requests
from bs4 import BeautifulSoup as bs
#########################################################
#... | 32.072727 | 111 | 0.495465 |
e8fffdab00f132b513f9ddaadb072c0f0c7a2872 | 1,871 | py | Python | apps/nigiri/tests/test_fetching.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/nigiri/tests/test_fetching.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/nigiri/tests/test_fetching.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | from copy import deepcopy
import pytest
from nigiri.counter5 import Counter5ReportBase
from organizations.tests.conftest import organizations
from logs.tests.conftest import report_type_nd
from nigiri.client import Sushi5Client
from publications.models import Platform
from sushi.logic.data_import import import_sushi... | 37.42 | 93 | 0.65473 |
e8ffff3cb9fdcfaa7123313785714a00573feec1 | 50,106 | py | Python | transformers/tokenization_utils.py | rwei1218/transformers | 511e100c650b3f942c432d8f71eee3ea1c0005a8 | [
"Apache-2.0"
] | 2 | 2019-09-26T18:54:06.000Z | 2022-01-14T04:41:43.000Z | transformers/tokenization_utils.py | rwei1218/transformers | 511e100c650b3f942c432d8f71eee3ea1c0005a8 | [
"Apache-2.0"
] | 3 | 2021-06-02T02:44:05.000Z | 2022-02-10T02:26:13.000Z | transformers/tokenization_utils.py | akreal/end-to-end-slu-transformers | aa57ed62b087137018409d15422db0ccf39286c0 | [
"Apache-2.0"
] | 1 | 2021-03-16T01:28:56.000Z | 2021-03-16T01:28:56.000Z | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# 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
#
# ... | 50.510081 | 372 | 0.640283 |
33003e2b9bdf2a1cc73d3e90e3a2ad37dab3487a | 710 | py | Python | python3/july/day_10_Flatten a Multilevel Doubly Linked List.py | kashyapvinay/leetcode-challenge | 750b0056cb547dc5266d142a9a5048ebd50d8ae3 | [
"MIT"
] | 1 | 2020-06-01T11:35:46.000Z | 2020-06-01T11:35:46.000Z | python3/july/day_10_Flatten a Multilevel Doubly Linked List.py | kashyapvinay/leetcode-challenge | 750b0056cb547dc5266d142a9a5048ebd50d8ae3 | [
"MIT"
] | null | null | null | python3/july/day_10_Flatten a Multilevel Doubly Linked List.py | kashyapvinay/leetcode-challenge | 750b0056cb547dc5266d142a9a5048ebd50d8ae3 | [
"MIT"
] | null | null | null | """
# Definition for a Node.
class Node:
def __init__(self, val, prev, next, child):
self.val = val
self.prev = prev
self.next = next
self.child = child
"""
class Solution:
def flatten(self, head: 'Node') -> 'Node':
ptr = head
while(ptr):
if(ptr.child... | 22.903226 | 47 | 0.433803 |
33004d1ae043f295c54ba8dd1d924f3116580b7d | 7,122 | py | Python | python/demangle.py | gkprow-runsafe/binaryninja-api | 8f9004fa3cba785ec67909e9f96498b00086a3a7 | [
"MIT"
] | 1 | 2021-04-05T15:01:23.000Z | 2021-04-05T15:01:23.000Z | python/demangle.py | gkprow-runsafe/binaryninja-api | 8f9004fa3cba785ec67909e9f96498b00086a3a7 | [
"MIT"
] | null | null | null | python/demangle.py | gkprow-runsafe/binaryninja-api | 8f9004fa3cba785ec67909e9f96498b00086a3a7 | [
"MIT"
] | 1 | 2021-06-10T04:27:19.000Z | 2021-06-10T04:27:19.000Z | # Copyright (c) 2015-2021 Vector 35 Inc
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, ... | 43.163636 | 202 | 0.761022 |
33004d48ca4b65cb6e4b89b6cc163a0c378e5b62 | 627 | py | Python | kpiit/providers/dummy.py | lnielsen/kpiit | a48c1c2ff807aa63b04b776d010f7e6da9cfc2e0 | [
"MIT"
] | null | null | null | kpiit/providers/dummy.py | lnielsen/kpiit | a48c1c2ff807aa63b04b776d010f7e6da9cfc2e0 | [
"MIT"
] | 11 | 2018-07-05T09:44:46.000Z | 2019-08-26T08:57:39.000Z | kpiit/providers/dummy.py | lnielsen/kpiit | a48c1c2ff807aa63b04b776d010f7e6da9cfc2e0 | [
"MIT"
] | 2 | 2018-06-25T13:49:32.000Z | 2018-09-14T10:01:41.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 CERN.
#
# KPIit is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Dummy provider module."""
from celery.utils.log import get_task_logger
from kpiit.providers import BaseProvider
logger... | 23.222222 | 72 | 0.681021 |
3300656c93c437a574236b0cb68993bd1b979724 | 476 | py | Python | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2olog_and_echo.py | My-Technical-Architect/h2o-3 | d383802fb7f9c3ec9c72b7869fe636059a333d88 | [
"Apache-2.0"
] | 1 | 2017-03-28T09:10:12.000Z | 2017-03-28T09:10:12.000Z | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2olog_and_echo.py | My-Technical-Architect/h2o-3 | d383802fb7f9c3ec9c72b7869fe636059a333d88 | [
"Apache-2.0"
] | null | null | null | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2olog_and_echo.py | My-Technical-Architect/h2o-3 | d383802fb7f9c3ec9c72b7869fe636059a333d88 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
def h2olog_and_echo():
"""
Python API test: h2o.log_and_echo(message=u'')
"""
try:
h2o.log_and_echo("Testing h2o.log_and_echo")
except Exception as e:
assert Fal... | 22.666667 | 66 | 0.691176 |
330087523bad7cf1f84c8939af3b0a09a6369387 | 19,449 | py | Python | ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py | alexryndin/ambari | 478eeb02ebecef1f7f0506885a041d2070d2bccb | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py | alexryndin/ambari | 478eeb02ebecef1f7f0506885a041d2070d2bccb | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py | alexryndin/ambari | 478eeb02ebecef1f7f0506885a041d2070d2bccb | [
"Apache-2.0"
] | null | null | null | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 36.765595 | 151 | 0.630264 |
3300a8ce275eedf723fd0e2da4cfa8e6f07e0be3 | 29,526 | py | Python | src/python/pants/engine/scheduler.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | src/python/pants/engine/scheduler.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | null | null | null | src/python/pants/engine/scheduler.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import multiprocessing
import os
import sys
import time
import traceback
from dataclasses import dataclass
from textwrap import dedent
from typing import TYPE_CHECKING, Any,... | 40.838174 | 110 | 0.656167 |
3300e9b8f8282fe3200bc9bcf1755ab142a82e77 | 8,759 | py | Python | gcs/frontend/Ui_B_widget.py | cuspaceflight/m4-gcs | 577aed522c541d5910010fd48d123a1e0c622552 | [
"MIT"
] | null | null | null | gcs/frontend/Ui_B_widget.py | cuspaceflight/m4-gcs | 577aed522c541d5910010fd48d123a1e0c622552 | [
"MIT"
] | null | null | null | gcs/frontend/Ui_B_widget.py | cuspaceflight/m4-gcs | 577aed522c541d5910010fd48d123a1e0c622552 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/Ui_B_widget.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_B_widget(object):
def setupUi(self, B_widget):
B_widg... | 47.091398 | 85 | 0.679415 |
3300f53fbe63f9150e849c9155762ac12c03ff09 | 1,071 | py | Python | src/data/symbols.py | Lucaskabela/UNAST | 7a5abb5329591e37469fdadf498661ca04373bcc | [
"MIT"
] | 2 | 2021-03-26T19:51:29.000Z | 2021-03-27T19:25:20.000Z | src/data/symbols.py | Lucaskabela/UNAST | 7a5abb5329591e37469fdadf498661ca04373bcc | [
"MIT"
] | 6 | 2021-04-01T03:40:18.000Z | 2021-04-27T06:14:13.000Z | src/data/symbols.py | Lucaskabela/UNAST | 7a5abb5329591e37469fdadf498661ca04373bcc | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
'''
Defines the set of symbols used in text input to the model.
The default is a set of ASCII characters that works well for English or text that has been run
through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md for details.
'''
from data import cmudict
_pad ... | 35.7 | 197 | 0.607843 |
3300f8f36e988953de5558561af129bd8695ec0f | 14,947 | py | Python | src/sardana/taurus/qt/qtgui/extra_hkl/hklscan.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/taurus/qt/qtgui/extra_hkl/hklscan.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/taurus/qt/qtgui/extra_hkl/hklscan.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | 37.744949 | 119 | 0.616378 |
3301306bb0e681764eb5fadbf4ad9426cddcf38a | 3,517 | py | Python | gamesrc/bird.py | Adi-UA/AI-Plays-Flappy-Bird | a91519f2365d65e3014438e2c1390abeff5b1540 | [
"MIT"
] | null | null | null | gamesrc/bird.py | Adi-UA/AI-Plays-Flappy-Bird | a91519f2365d65e3014438e2c1390abeff5b1540 | [
"MIT"
] | null | null | null | gamesrc/bird.py | Adi-UA/AI-Plays-Flappy-Bird | a91519f2365d65e3014438e2c1390abeff5b1540 | [
"MIT"
] | null | null | null | import pygame
from resources import reference
from resources.reference import BIRD_IMAGES
class Bird:
"""
This class represents the bird in Flappy Bird.
Some useful Methods are:
move() which should be called every game tick to figure out how far the bird
has fallen.
jump() which tells the b... | 31.401786 | 82 | 0.58857 |
3301367d5aebe11b0f372d447d356c2b0b863718 | 6,690 | py | Python | RL/ppo.py | zkolev/ppo_general | d825f0bd0ba82d86c9ac87712d698e220fe23f73 | [
"Apache-2.0"
] | null | null | null | RL/ppo.py | zkolev/ppo_general | d825f0bd0ba82d86c9ac87712d698e220fe23f73 | [
"Apache-2.0"
] | null | null | null | RL/ppo.py | zkolev/ppo_general | d825f0bd0ba82d86c9ac87712d698e220fe23f73 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn.functional as fn
from RL.common import get_distribution_from_logits
# The network is very small
FORCE_CPU = True
device = torch.device("cuda" if torch.cuda.is_available() and not FORCE_CPU else "cpu")
if device.type == 'cuda':
print(torch.cuda.get_device_name(0))
print('Memory Usa... | 32.634146 | 113 | 0.56562 |
330150749ebd76469788ad638d34fb1f86c6c270 | 8,277 | py | Python | pagerank.py | jinkim22/PageRank | f6d8daff0494d8d2f2beff4e02de1db9f7cc4af3 | [
"MIT"
] | 9 | 2020-09-10T20:18:44.000Z | 2020-09-13T21:29:04.000Z | pagerank.py | jinkim22/PageRank | f6d8daff0494d8d2f2beff4e02de1db9f7cc4af3 | [
"MIT"
] | null | null | null | pagerank.py | jinkim22/PageRank | f6d8daff0494d8d2f2beff4e02de1db9f7cc4af3 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
'''
This file calculates pagerank vectors for small-scale webgraphs.
See the README.md for example usage.
'''
import math
import torch
import gzip
import csv
import logging
class WebGraph():
def __init__(self, filename, max_nnz=None, filter_ratio=None):
'''
Initializes the W... | 33.783673 | 105 | 0.576417 |
3301590ce0c81197f5679cd7caf8b1c79b71caa7 | 976 | py | Python | facexlib/matting/__init__.py | spy14414/facexlib | 6be8bdcfe32198374c17588132a72022ad88ae3b | [
"MIT"
] | 164 | 2021-05-15T20:15:42.000Z | 2022-03-25T19:39:24.000Z | facexlib/matting/__init__.py | spy14414/facexlib | 6be8bdcfe32198374c17588132a72022ad88ae3b | [
"MIT"
] | 7 | 2021-08-03T15:56:49.000Z | 2022-02-24T13:50:33.000Z | facexlib/matting/__init__.py | daobook/facexlib | e5768d1722a3fddc6ccd1b91a6a17f432ed149b4 | [
"MIT"
] | 32 | 2021-05-16T03:10:24.000Z | 2022-03-19T12:02:00.000Z | import torch
from copy import deepcopy
from facexlib.utils import load_file_from_url
from .modnet import MODNet
def init_matting_model(model_name='modnet', half=False, device='cuda'):
if model_name == 'modnet':
model = MODNet(backbone_pretrained=False)
model_url = 'https://github.com/xinntao/face... | 36.148148 | 111 | 0.704918 |
3301684906b42ebee238d16f09aef6fda703602d | 9,759 | py | Python | troveclient/compat/base.py | hrnciar/python-troveclient | e41d08d24325a61a213592934b508bf77ce67dac | [
"Apache-2.0"
] | 46 | 2015-01-14T12:26:24.000Z | 2021-01-05T12:54:03.000Z | troveclient/compat/base.py | hrnciar/python-troveclient | e41d08d24325a61a213592934b508bf77ce67dac | [
"Apache-2.0"
] | 3 | 2015-05-22T19:58:11.000Z | 2021-04-30T06:12:21.000Z | troveclient/compat/base.py | hrnciar/python-troveclient | e41d08d24325a61a213592934b508bf77ce67dac | [
"Apache-2.0"
] | 34 | 2015-01-21T12:33:53.000Z | 2021-10-13T00:29:35.000Z | # Copyright 2010 Jacob Kaplan-Moss
# Copyright 2012 OpenStack Foundation
# 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/lic... | 32.858586 | 79 | 0.601599 |
33022755467a116cb6dd3e8b5e62770acf167277 | 20,105 | py | Python | trazer/analyzer.py | starsoi/trazer | ca930b55c2469972abe43d80c405e3a49cdbe668 | [
"MIT"
] | null | null | null | trazer/analyzer.py | starsoi/trazer | ca930b55c2469972abe43d80c405e3a49cdbe668 | [
"MIT"
] | 1 | 2021-11-28T16:59:28.000Z | 2021-11-28T16:59:28.000Z | trazer/analyzer.py | starsoi/trazer | ca930b55c2469972abe43d80c405e3a49cdbe668 | [
"MIT"
] | null | null | null | from collections import defaultdict
from enum import Enum
import math
import re
from typing import Any, Dict, IO, List, Optional, Type, Tuple
from trazer.trace import (
Trace,
TraceEventDurationBegin,
TraceEventDurationEnd,
EventChain,
TraceEvent,
)
CODE_BASE = 52
ASCII_OFFSET = 65
class _EventT... | 44.677778 | 120 | 0.621587 |
3302347e4e07ba38f0c5a29673b4ab2aee51d437 | 9,029 | py | Python | src/olympia/amo/management/commands/compress_assets.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2021-11-27T15:47:47.000Z | 2021-11-27T15:47:47.000Z | src/olympia/amo/management/commands/compress_assets.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1,398 | 2020-10-08T06:32:26.000Z | 2022-03-31T12:06:24.000Z | src/olympia/amo/management/commands/compress_assets.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2021-11-24T07:29:55.000Z | 2021-11-24T07:29:55.000Z | import hashlib
import os
import re
import subprocess
import time
import uuid
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.staticfiles.finders import find as find_static_path
from django.utils.encoding import force_bytes
from olympia.lib.jingo_m... | 36.853061 | 78 | 0.565511 |
330250e2c92ff344218ed646ad91ff2a8d7403a6 | 38,582 | py | Python | test/unit/proxy/controllers/test_base.py | aerwin3/swift | 96c1838a15645639154f1048285d53a891809937 | [
"Apache-2.0"
] | null | null | null | test/unit/proxy/controllers/test_base.py | aerwin3/swift | 96c1838a15645639154f1048285d53a891809937 | [
"Apache-2.0"
] | null | null | null | test/unit/proxy/controllers/test_base.py | aerwin3/swift | 96c1838a15645639154f1048285d53a891809937 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | 42.028322 | 79 | 0.589964 |
330257f10a519f0633b276de621f84fdccbef88a | 85,575 | py | Python | aesara/tensor/math.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | aesara/tensor/math.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | aesara/tensor/math.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | import builtins
import warnings
import numpy as np
from aesara import config, printing
from aesara import scalar as aes
from aesara.gradient import DisconnectedType
from aesara.graph.basic import Apply, Variable
from aesara.graph.op import COp, Op
from aesara.graph.params_type import ParamsType
from aesara.graph.type... | 28.900709 | 148 | 0.599649 |
33025dfbeb4b88394539013ab8d88deb77d389c1 | 3,209 | py | Python | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.191176 | 130 | 0.698348 |
33028124798d274811869bdc3989ea80efe91119 | 6,477 | py | Python | src/utils/types.py | AndrewRLawrence/dp_gp_lvm | b0d4c776714f22e83de31127fbfbbd511f017dcd | [
"MIT"
] | 1 | 2021-01-17T11:44:36.000Z | 2021-01-17T11:44:36.000Z | src/utils/types.py | AndrewRLawrence/dp_gp_lvm | b0d4c776714f22e83de31127fbfbbd511f017dcd | [
"MIT"
] | 1 | 2020-07-19T20:47:02.000Z | 2020-07-19T20:47:02.000Z | src/utils/types.py | AndrewRLawrence/dp_gp_lvm | b0d4c776714f22e83de31127fbfbbd511f017dcd | [
"MIT"
] | 1 | 2020-07-21T07:13:13.000Z | 2020-07-21T07:13:13.000Z | """
This module defines constants and functions for managing data types in numpy and TensorFlow.
"""
from src.kernels.interfaces.kernel import Kernel
from src.models.interfaces.trainable import Trainable
import numpy as np
import tensorflow as tf
# Type constants.
TF_DTYPE = tf.float64
NP_DTYPE = np.float64
# # Co... | 42.611842 | 119 | 0.712367 |
33028875ee1502be11fa7a061706d239bc0d3166 | 8,277 | py | Python | WDSR3D/loss.py | frandorr/PROBA-V-3DWDSR | d1de7b764fdee29545561495a90656b37feee056 | [
"Apache-2.0"
] | 7 | 2020-02-06T18:44:53.000Z | 2020-10-28T04:43:25.000Z | WDSR3D/loss.py | frandorr/PROBA-V-3DWDSR | d1de7b764fdee29545561495a90656b37feee056 | [
"Apache-2.0"
] | 1 | 2020-02-08T19:01:19.000Z | 2020-11-09T02:28:19.000Z | WDSR3D/loss.py | frandorr/3DWDSRNet | d1de7b764fdee29545561495a90656b37feee056 | [
"Apache-2.0"
] | 2 | 2021-09-22T13:34:23.000Z | 2021-11-20T22:07:08.000Z | import tensorflow as tf
LR_SIZE = 34
HR_SIZE = 96
def log10(x):
numerator = tf.math.log(x)
denominator = tf.math.log(tf.constant(10, dtype=numerator.dtype))
return numerator / denominator
def l1_loss(y_true, y_pred, y_mask):
"""
Modified l1 loss to take into account pixel shifts
"""
y_sh... | 37.622727 | 88 | 0.61097 |
330290e0342dfdd0a283512c7920cd475db2941b | 6,796 | py | Python | lib/fpn/box_utils.py | taksau/sglabv1 | 868a7128e3438be980e7197bdd894310cf3aa699 | [
"MIT"
] | null | null | null | lib/fpn/box_utils.py | taksau/sglabv1 | 868a7128e3438be980e7197bdd894310cf3aa699 | [
"MIT"
] | null | null | null | lib/fpn/box_utils.py | taksau/sglabv1 | 868a7128e3438be980e7197bdd894310cf3aa699 | [
"MIT"
] | null | null | null | import torch
import numpy as np
from torch.nn import functional as F
from lib.fpn.box_intersections_cpu.bbox import bbox_overlaps as bbox_overlaps_np
from lib.fpn.box_intersections_cpu.bbox import bbox_intersections as bbox_intersections_np
from lib.cython_nms import cython_nms
def nms_cython(scores, boxes, pre_nms_t... | 37.755556 | 98 | 0.586521 |
3302e4fa98c2cb7425ecd87c711686b27dcbdb9b | 36,977 | py | Python | oscar/lib/python2.7/site-packages/prompt_toolkit/document.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/prompt_toolkit/document.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/prompt_toolkit/document.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """
The `Document` that implements all the text operations/querying.
"""
from __future__ import unicode_literals
import bisect
import re
import six
import string
import weakref
from six.moves import range, map
from .selection import SelectionType, SelectionState, PasteMode
from .clipboard import Clipboar... | 36.903194 | 106 | 0.586202 |
3302fb38ab2432997e006ee47264ef747db72f8d | 11,613 | py | Python | salt/states/pkgbuild.py | silviud/salt | 9d35ea66428a030d00ef1a2f3b93ecfe90be023c | [
"Apache-2.0"
] | 1 | 2018-09-19T22:42:54.000Z | 2018-09-19T22:42:54.000Z | salt/states/pkgbuild.py | silviud/salt | 9d35ea66428a030d00ef1a2f3b93ecfe90be023c | [
"Apache-2.0"
] | null | null | null | salt/states/pkgbuild.py | silviud/salt | 9d35ea66428a030d00ef1a2f3b93ecfe90be023c | [
"Apache-2.0"
] | 2 | 2017-01-05T16:14:59.000Z | 2019-01-31T23:15:25.000Z | # -*- coding: utf-8 -*-
'''
The pkgbuild state is the front of Salt package building backend. It
automatically builds DEB and RPM packages from specified sources
.. versionadded:: 2015.8.0
.. code-block:: yaml
salt_2015.5.2:
pkgbuild.built:
- runas: thatch
- results:
- salt-2015.5... | 31.991736 | 89 | 0.599156 |
33030e3c41368612ef3984c94dcd54067247991a | 15,485 | py | Python | models/vae/auxresconv.py | lim0606/pytorch-ardae-vae | 52f460a90fa5822692031ab7dcca39fa9168988e | [
"MIT"
] | 11 | 2020-06-11T03:01:46.000Z | 2021-06-17T02:59:39.000Z | models/vae/auxresconv.py | lim0606/pytorch-ardae-vae | 52f460a90fa5822692031ab7dcca39fa9168988e | [
"MIT"
] | 1 | 2020-06-18T00:59:24.000Z | 2020-06-19T22:55:14.000Z | models/vae/auxresconv.py | lim0606/pytorch-ardae-vae | 52f460a90fa5822692031ab7dcca39fa9168988e | [
"MIT"
] | null | null | null | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import autograd
from models.layers import Identity, MLP
from models.reparam import NormalDistributionLinear, BernoulliDistributionLinear, BernoulliDistributionConvTranspose2d
from utils import loss_kld_gaussia... | 36.435294 | 168 | 0.582951 |
330311a9f025650f87308541b3d45b893602ca63 | 7,262 | py | Python | whoville/cloudbreak/models/custom_domain_settings.py | mikchaos/whoville | 6eabaea4b74ac0b632c03db8252590131c6ce63b | [
"Apache-2.0"
] | null | null | null | whoville/cloudbreak/models/custom_domain_settings.py | mikchaos/whoville | 6eabaea4b74ac0b632c03db8252590131c6ce63b | [
"Apache-2.0"
] | null | null | null | whoville/cloudbreak/models/custom_domain_settings.py | mikchaos/whoville | 6eabaea4b74ac0b632c03db8252590131c6ce63b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... | 34.580952 | 984 | 0.655605 |
330315ad7963d14589415e35f75296d376e31342 | 18,762 | py | Python | config-docBiRNN-vis.py | shuokabe/deepQuest-mod | 7140a57c30deedb0570bc835c6ad3c848f0039f4 | [
"BSD-3-Clause"
] | null | null | null | config-docBiRNN-vis.py | shuokabe/deepQuest-mod | 7140a57c30deedb0570bc835c6ad3c848f0039f4 | [
"BSD-3-Clause"
] | null | null | null | config-docBiRNN-vis.py | shuokabe/deepQuest-mod | 7140a57c30deedb0570bc835c6ad3c848f0039f4 | [
"BSD-3-Clause"
] | null | null | null | def load_parameters():
"""
Loads the defined hyperparameters
:return parameters: Dictionary of loaded parameters
"""
# Input data params
TASK_NAME = 'doc-level' # Task name
DATASET_NAME = TASK_NAME # Dataset name
SRC_LAN = 'en' ... | 64.474227 | 175 | 0.570248 |
330395729041337a0acda9f38f4b1240a65fc823 | 2,964 | py | Python | kopyt/iterator.py | mvisat/kopyt | 48e59ed4196cb80c5498cca62ecffbcb27e6599b | [
"MIT"
] | 2 | 2021-07-21T10:24:30.000Z | 2022-01-11T11:25:25.000Z | kopyt/iterator.py | mvisat/kopyt | 48e59ed4196cb80c5498cca62ecffbcb27e6599b | [
"MIT"
] | null | null | null | kopyt/iterator.py | mvisat/kopyt | 48e59ed4196cb80c5498cca62ecffbcb27e6599b | [
"MIT"
] | 1 | 2021-07-28T05:47:28.000Z | 2021-07-28T05:47:28.000Z | """Module for iterator utility."""
from typing import (
Iterator,
Iterable,
TypeVar,
)
from collections import deque
from contextlib import contextmanager
__all__ = ["PeekableIterator"]
T = TypeVar("T")
class PeekableIterator(Iterator[T]):
def __init__(self, iterable: Iterable[T], default: T = None... | 26.464286 | 79 | 0.565115 |
3303a10e1de179409dd61ebaa7b81c832c41b86d | 11,096 | py | Python | src/gafaelfawr/verify.py | lsst-sqre/gafaelfawr | 5d965e9d7901987ef041fd341637d75407b55227 | [
"MIT"
] | null | null | null | src/gafaelfawr/verify.py | lsst-sqre/gafaelfawr | 5d965e9d7901987ef041fd341637d75407b55227 | [
"MIT"
] | 155 | 2020-05-29T17:21:13.000Z | 2022-03-28T19:55:52.000Z | src/gafaelfawr/verify.py | lsst-sqre/gafaelfawr | 5d965e9d7901987ef041fd341637d75407b55227 | [
"MIT"
] | 3 | 2021-04-26T18:02:58.000Z | 2022-02-03T01:29:13.000Z | """Verify a JWT."""
from __future__ import annotations
from typing import TYPE_CHECKING
from urllib.parse import urljoin
import jwt
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives.serialization import Encoding, Pub... | 32.731563 | 79 | 0.599585 |
3303ad33cfe2fdd7db42e8421478cb3326a35969 | 1,271 | py | Python | msdsl/expr/compression.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 15 | 2019-05-14T10:12:23.000Z | 2022-03-29T15:29:52.000Z | msdsl/expr/compression.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 19 | 2020-01-22T21:44:33.000Z | 2021-06-05T02:10:41.000Z | msdsl/expr/compression.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 5 | 2019-10-21T09:53:17.000Z | 2021-08-10T17:32:20.000Z | import numpy as np
import numpy.ma as ma
def apply_compression(r):
# convert input to an array
# ref: https://stackoverflow.com/questions/29318459/python-function-that-handles-scalar-or-arrays
r = np.asarray(r)
scalar_input = False
if r.ndim == 0:
r = r[np.newaxis] # make 1D
scalar... | 25.938776 | 101 | 0.61133 |
3303f811d6fc95a1933fbaff0d4e89eddd8e6e78 | 12,281 | py | Python | flopy/utils/voronoi.py | scottrp/flopy | af10ab377f48b41f00842cc2bfa08e8b4fc36a62 | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/utils/voronoi.py | scottrp/flopy | af10ab377f48b41f00842cc2bfa08e8b4fc36a62 | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/utils/voronoi.py | scottrp/flopy | af10ab377f48b41f00842cc2bfa08e8b4fc36a62 | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | import numpy as np
from .cvfdutil import get_disv_gridprops
from .geometry import point_in_polygon
from .utl_import import import_optional_dependency
def get_sorted_vertices(icell_vertices, vertices):
centroid = vertices[icell_vertices].mean(axis=0)
tlist = []
for i, iv in enumerate(icell_vertices):
... | 33.281843 | 77 | 0.615341 |
330415f651c1c4601d6c27ec99004c8010f683ad | 2,857 | py | Python | docs/source/examples/catalog_HIP/convert_HIP2.py | wangleon/stella | 3942f8e687065bb96760140596747cbbe6dad04b | [
"Apache-2.0"
] | null | null | null | docs/source/examples/catalog_HIP/convert_HIP2.py | wangleon/stella | 3942f8e687065bb96760140596747cbbe6dad04b | [
"Apache-2.0"
] | null | null | null | docs/source/examples/catalog_HIP/convert_HIP2.py | wangleon/stella | 3942f8e687065bb96760140596747cbbe6dad04b | [
"Apache-2.0"
] | 1 | 2021-10-02T02:18:28.000Z | 2021-10-02T02:18:28.000Z | #!/usr/bin/env python3
import os
import numpy as np
import astropy.io.fits as fits
from stella.catalog.base import _str_to_float
inputfile = os.path.join(os.getenv('ASTRO_DATA'), 'catalog/I/311/hip2.dat')
types = [
('HIP', np.int32),
('RAdeg', np.float64),
('DEdeg', np.float64),
(... | 31.395604 | 76 | 0.582079 |
330444f5fd34a8aca4dafc1e2b571a66109fecc2 | 4,342 | py | Python | alipay/aop/api/response/AlipayAssetPointVoucherprodBenefittemplateQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayAssetPointVoucherprodBenefittemplateQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayAssetPointVoucherprodBenefittemplateQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayAssetPointVoucherprodBenefittemplateQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayAssetPointVoucherprodBenefittemplateQueryResponse, self).__init__()
... | 29.739726 | 128 | 0.657301 |
3304759188e0005c202f6f31bb5a575947c66946 | 42,147 | py | Python | mnist-continual/mnist.py | ragavvenkatesan/Incremental-GAN | 66db2760d43defe36feec7e049f74a659e810fed | [
"MIT"
] | 15 | 2017-05-03T21:22:03.000Z | 2020-03-11T05:36:43.000Z | mnist-continual/mnist.py | ragavvenkatesan/Incremental-GAN | 66db2760d43defe36feec7e049f74a659e810fed | [
"MIT"
] | null | null | null | mnist-continual/mnist.py | ragavvenkatesan/Incremental-GAN | 66db2760d43defe36feec7e049f74a659e810fed | [
"MIT"
] | 4 | 2017-05-04T15:55:22.000Z | 2018-10-15T06:38:43.000Z | from yann.special.gan import gan
from yann.network import network
from yann.utils.graph import draw_network
from yann.utils.pickle import shared_params
from collections import OrderedDict
from theano import tensor as T
import numpy
import theano
import cPickle
rng = numpy.random
class cgan (object):
"""
... | 43.095092 | 216 | 0.396161 |
3304c178be1fc9428e80f4c9ec01e702e9b737f0 | 4,470 | py | Python | txweb2/dav/method/report.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | txweb2/dav/method/report.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | txweb2/dav/method/report.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | # -*- test-case-name: txweb2.dav.test.test_report -*-
##
# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, inclu... | 28.653846 | 80 | 0.667785 |
3304db90def2c523318ed9eb392caca40d158f1d | 8,623 | py | Python | keras_pipeline/python/file_utils.py | deephealthproject/UC13_pipeline | 20b24a31677fac56105d7e3a96f2fc0051f93319 | [
"MIT"
] | null | null | null | keras_pipeline/python/file_utils.py | deephealthproject/UC13_pipeline | 20b24a31677fac56105d7e3a96f2fc0051f93319 | [
"MIT"
] | null | null | null | keras_pipeline/python/file_utils.py | deephealthproject/UC13_pipeline | 20b24a31677fac56105d7e3a96f2fc0051f93319 | [
"MIT"
] | null | null | null | """
This file has functions to process edf files.
"""
import os
import sys
import bz2
import _pickle as cPickle
import numpy
from multiprocessing import Pool
# ------------------------------------------------------------------------------
def decompress_pickle(filename):
'''
Load any compressed pickle file
... | 32.912214 | 100 | 0.557695 |
330507ebc5f6e618418d842629ae1d24f3be0bf6 | 1,358 | py | Python | src/services/calendar.py | x2012x/conductor | ee1bfefd3dcd369efd2363e4c203c63dd97e2fb8 | [
"MIT"
] | 4 | 2021-06-14T15:11:26.000Z | 2022-03-15T12:34:17.000Z | src/services/calendar.py | x2012x/conductor | ee1bfefd3dcd369efd2363e4c203c63dd97e2fb8 | [
"MIT"
] | 7 | 2021-06-14T10:38:54.000Z | 2021-08-19T22:30:17.000Z | src/services/calendar.py | x2012x/conductor | ee1bfefd3dcd369efd2363e4c203c63dd97e2fb8 | [
"MIT"
] | null | null | null | '''
Created on May 22, 2021
@author: x2012x
'''
from services.base import BaseService, Response
from errors.exceptions import CalendarFailure
from errors.reasons import get_general_failure
from datetime import datetime
class CalendarService(BaseService):
''' Provides access to calendar service operations.
... | 31.581395 | 104 | 0.635493 |
330527b5bce92ba1d165dd7ae1969c32a28ec060 | 642 | py | Python | urls.default.py | andyzsf/koalixcrm | f4bed2885d4dee6bf39572af00d239e3b222048a | [
"BSD-3-Clause"
] | 1 | 2016-10-06T18:44:27.000Z | 2016-10-06T18:44:27.000Z | urls.default.py | andyzsf/koalixcrm | f4bed2885d4dee6bf39572af00d239e3b222048a | [
"BSD-3-Clause"
] | null | null | null | urls.default.py | andyzsf/koalixcrm | f4bed2885d4dee6bf39572af00d239e3b222048a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from crm.models import *
from django.conf.urls.defaults import *
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from filebrowser.sites import site
admin.autodiscover()
urlpatterns = patterns('',
(r'^media/(?P<path>.*)$', 'django.views.st... | 37.764706 | 106 | 0.697819 |
33052a43e4d04b02d2cd61d3c25f204910424bfa | 736 | py | Python | pdfextractor/models/message_model.py | snook9/pdf_extractor | 7a4c37db5026bb1789c5df5a76bc50718288bc1f | [
"MIT"
] | 1 | 2021-11-05T07:55:56.000Z | 2021-11-05T07:55:56.000Z | pdfextractor/models/message_model.py | snook9/pdf_extractor | 7a4c37db5026bb1789c5df5a76bc50718288bc1f | [
"MIT"
] | 8 | 2021-11-05T20:19:22.000Z | 2021-12-22T15:15:37.000Z | pdfextractor/models/message_model.py | snook9/pdf_extractor | 7a4c37db5026bb1789c5df5a76bc50718288bc1f | [
"MIT"
] | null | null | null | """
Name: PdfExporter
Authors: Jonathan CASSAING
Tool for parsing and extracting PDF file content
"""
import json
class MessageModel:
"""Class for returning a generic message"""
# ID of the inserted object
object_id = None
# Generic user message
message = ""
def __init__(self: object, messa... | 23 | 75 | 0.657609 |
33052b310c534321f1bcbd71af086368d1d585e4 | 13,637 | py | Python | next/database_client/CacheStore/CacheStore.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | next/database_client/CacheStore/CacheStore.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | next/database_client/CacheStore/CacheStore.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | 2 | 2017-06-07T16:03:16.000Z | 2021-03-01T08:48:27.000Z | """
Cache Store
author: Kevin Jamieson, kevin.g.jamieson@gmail.com
last updated: 12/31/2014
Cache in-memory storage solution. Database hierarchy is organized as:
CacheStore[database_id][bucket_id][doc_uid] = {key1:value1,key2:value2,...}
The database assumes that only string values are stored (even though other value... | 32.087059 | 139 | 0.577766 |
3305814b89e5e52de626cf4ef6e3314e696e26be | 45,696 | py | Python | tests/test_sendgrid_backend.py | bhumikapahariapuresoftware/django-anymail | 0252010fb3d4652c3c234fc6dba36d11c7602543 | [
"BSD-3-Clause"
] | 1,324 | 2016-03-10T04:57:52.000Z | 2022-03-31T15:14:58.000Z | tests/test_sendgrid_backend.py | bhumikapahariapuresoftware/django-anymail | 0252010fb3d4652c3c234fc6dba36d11c7602543 | [
"BSD-3-Clause"
] | 208 | 2016-03-10T03:40:59.000Z | 2022-03-22T23:16:08.000Z | tests/test_sendgrid_backend.py | bhumikapahariapuresoftware/django-anymail | 0252010fb3d4652c3c234fc6dba36d11c7602543 | [
"BSD-3-Clause"
] | 129 | 2016-03-10T09:24:52.000Z | 2022-02-07T05:37:24.000Z | from base64 import b64encode, b64decode
from calendar import timegm
from datetime import date, datetime
from decimal import Decimal
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from unittest.mock import patch
from django.core import mail
from django.test import SimpleTestCase, override_s... | 49.940984 | 119 | 0.610863 |
330597afdf33de59d5821c2821dff0d996d9fc3c | 11,394 | py | Python | src/isambard/optimisation/mmc_optimizer.py | isambard-uob/isambard | febb9d48cb16d75be7cf4252b5c36bad57897d58 | [
"MIT"
] | 13 | 2018-06-18T14:34:27.000Z | 2021-11-27T19:49:07.000Z | src/isambard/optimisation/mmc_optimizer.py | isambard-uob/isambard | febb9d48cb16d75be7cf4252b5c36bad57897d58 | [
"MIT"
] | 14 | 2018-06-18T11:47:39.000Z | 2022-03-18T17:34:40.000Z | src/isambard/optimisation/mmc_optimizer.py | isambard-uob/isambard | febb9d48cb16d75be7cf4252b5c36bad57897d58 | [
"MIT"
] | 5 | 2018-06-19T16:01:07.000Z | 2021-07-10T14:23:25.000Z | """Provides optimisation of structure using Metropolis Monte Carlo."""
import copy
import enum
import math
import random
import sys
import numpy
def float_f(f):
"""Formats a float for printing to std out."""
return '{:.0f}'.format(f)
class MMCParameterType(enum.Enum):
"""Defines the types of parameter... | 37.480263 | 80 | 0.618483 |
33059c62ae700557e6a311d3157f1ef6832c1cc0 | 3,622 | py | Python | gwd/eda/pipeline.py | kazakh-shai/kaggle-global-wheat-detection | b26295ea257f73089f1a067b70b4a7ee638f6b83 | [
"Apache-2.0"
] | 136 | 2020-08-24T08:18:16.000Z | 2022-03-31T13:45:12.000Z | gwd/eda/pipeline.py | kazakh-shai/kaggle-global-wheat-detection | b26295ea257f73089f1a067b70b4a7ee638f6b83 | [
"Apache-2.0"
] | 5 | 2020-10-07T08:44:36.000Z | 2021-12-17T06:00:57.000Z | gwd/eda/pipeline.py | kazakh-shai/kaggle-global-wheat-detection | b26295ea257f73089f1a067b70b4a7ee638f6b83 | [
"Apache-2.0"
] | 28 | 2020-08-24T11:07:07.000Z | 2022-01-01T13:07:54.000Z | import argparse
import os
import os.path as osp
import cv2
import matplotlib.pyplot as plt
import numpy as np
from mmcv import Config
from tqdm import tqdm
from gwd.datasets.wheat_detection import WheatDataset
from gwd.eda.kmeans import kmeans
from gwd.eda.visualization import draw_bounding_boxes_on_image
from mmdet.... | 37.729167 | 112 | 0.650745 |
3305ba890313db6b920f206936f3bda6e0f8db48 | 32,072 | py | Python | course_sched/test_course_sched.py | mmxmb/course-sched | 2de97797456f040280a9060fb71215e4f5cba1b0 | [
"MIT"
] | null | null | null | course_sched/test_course_sched.py | mmxmb/course-sched | 2de97797456f040280a9060fb71215e4f5cba1b0 | [
"MIT"
] | null | null | null | course_sched/test_course_sched.py | mmxmb/course-sched | 2de97797456f040280a9060fb71215e4f5cba1b0 | [
"MIT"
] | null | null | null | import unittest
from course_sched import (
CourseSched,
COURSE_GRANULARITY,
Course,
Curriculum,
SolverCallbackUtil,
SchedPartialSolutionSerializer
)
import os
import sys
from schema import SchemaError
sys.path.append(os.path.abspath('./api_schema'))
from api_schema import response_schema
N_SOL_... | 44.918768 | 149 | 0.506267 |
3305c1b5cf248381ee94a8b7179347d7253eeaa0 | 10,171 | py | Python | holmium/core/config.py | alisaifee/holmium.core | 026441584537b83e8a2743490be78a4c8f07a510 | [
"MIT"
] | 38 | 2015-03-12T05:23:26.000Z | 2021-11-18T09:26:25.000Z | holmium/core/config.py | alisaifee/holmium.core | 026441584537b83e8a2743490be78a4c8f07a510 | [
"MIT"
] | 16 | 2015-02-17T01:07:32.000Z | 2021-07-10T15:47:26.000Z | holmium/core/config.py | alisaifee/holmium.core | 026441584537b83e8a2743490be78a4c8f07a510 | [
"MIT"
] | 25 | 2015-03-24T21:45:50.000Z | 2021-07-05T07:29:54.000Z | """
configuration objects for holmium
"""
import sys
import os
import inspect
import jinja2
from selenium import webdriver
from selenium.webdriver import FirefoxProfile
class Config(dict):
"""Dictionary like helper class for maintaining test data configurations
per environment.
:class:`holmium.core.TestCase... | 30.914894 | 79 | 0.623832 |
3305c6a3643fdb059e3db71a57547353f6150f95 | 619 | py | Python | media/templatetags/media_tags.py | aaboffill/django-allmedia | 67ef405623574d90abf9eefac9a512f609300775 | [
"BSD-3-Clause"
] | null | null | null | media/templatetags/media_tags.py | aaboffill/django-allmedia | 67ef405623574d90abf9eefac9a512f609300775 | [
"BSD-3-Clause"
] | null | null | null | media/templatetags/media_tags.py | aaboffill/django-allmedia | 67ef405623574d90abf9eefac9a512f609300775 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
from allauth.socialaccount.models import SocialToken
from django import template
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
register = template.Library()
@register.assignment_tag
def get_google_social_token(user):
if not user or not isinstance(user, Us... | 26.913043 | 52 | 0.699515 |
3305d80e4c97693751abaf0c691ec209922cfb4f | 1,221 | py | Python | ninecms/management/commands/check_updates.py | Wtower/django-ninecms | e500010fb11f06c8dfe8d8c9c4d2aab0b15bc127 | [
"BSD-3-Clause"
] | 49 | 2015-11-17T16:18:02.000Z | 2021-12-10T15:01:03.000Z | ninecms/management/commands/check_updates.py | Wtower/django-ninecms | e500010fb11f06c8dfe8d8c9c4d2aab0b15bc127 | [
"BSD-3-Clause"
] | 39 | 2015-11-18T12:20:14.000Z | 2022-01-19T10:47:19.000Z | ninecms/management/commands/check_updates.py | Wtower/django-ninecms | e500010fb11f06c8dfe8d8c9c4d2aab0b15bc127 | [
"BSD-3-Clause"
] | 9 | 2016-04-07T12:12:05.000Z | 2021-02-04T15:42:02.000Z | """ Management command for checking updates """
__author__ = 'George Karakostas'
__copyright__ = 'Copyright 2015, George Karakostas'
__licence__ = 'BSD-3'
__email__ = 'gkarak@9-dev.com'
from django.core.management import BaseCommand
from django.core.cache import caches
from django.core.mail import mail_admins
from dja... | 34.885714 | 84 | 0.663391 |
3305e55c05bd03d31c46fd333db09dbab9a5d09c | 5,113 | py | Python | tensorflow/python/kernel_tests/bcast_ops_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/python/kernel_tests/bcast_ops_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/kernel_tests/bcast_ops_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.775641 | 80 | 0.620575 |
3305eab1d36f73ca4deb502e32a849cd5dae9f58 | 9,668 | py | Python | tests/integration/test_synapseutils_sync.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | tests/integration/test_synapseutils_sync.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | tests/integration/test_synapseutils_sync.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
import uuid, filecmp, os, sys, time, tempfile
from nose.tools import assert_raises, assert_equals, assert_is_none, asser... | 40.451883 | 149 | 0.71597 |
330603786e76f7f7509d63618ea8252d32e7219a | 6,621 | py | Python | code/critics/off_policy/advantage.py | arjunchandra/continuous-rl | 8f3c655c6a4b2e9d15a6b052e5466c0a75191a08 | [
"MIT"
] | 17 | 2019-03-29T18:30:36.000Z | 2021-10-17T15:38:22.000Z | code/critics/off_policy/advantage.py | arjunchandra/continuous-rl | 8f3c655c6a4b2e9d15a6b052e5466c0a75191a08 | [
"MIT"
] | 1 | 2019-04-22T22:40:30.000Z | 2019-04-24T21:45:07.000Z | code/critics/off_policy/advantage.py | ctallec/continuous-rl | 8f3c655c6a4b2e9d15a6b052e5466c0a75191a08 | [
"MIT"
] | 5 | 2019-04-29T16:26:18.000Z | 2020-01-23T07:17:49.000Z | import copy
from logging import info
from typing import Optional
import torch
from torch import Tensor
import numpy as np
from gym.spaces import Box, Discrete
from abstract import Arrayable, ParametricFunction, Tensorable
from actors.actor import Actor
from convert import arr_to_th, check_array, check_tensor
from cri... | 42.993506 | 93 | 0.646277 |
33061761d8119fafead418c6e521dd0d02645550 | 433 | py | Python | practice/54.py | porala/python | 41213189a9b35b5b8c40c048f4d6cd3f8e5f25f4 | [
"DOC"
] | 1 | 2020-01-15T11:04:16.000Z | 2020-01-15T11:04:16.000Z | practice/54.py | porala/python | 41213189a9b35b5b8c40c048f4d6cd3f8e5f25f4 | [
"DOC"
] | 2 | 2021-03-31T19:36:19.000Z | 2021-06-10T22:29:26.000Z | practice/54.py | porala/python | 41213189a9b35b5b8c40c048f4d6cd3f8e5f25f4 | [
"DOC"
] | null | null | null | #Change the last name of the second employee
from pprint import pprint
d = {"employees":[{"firstName": "John", "lastName": "Doe"},
{"firstName": "Anna", "lastName": "Smith"},
{"firstName": "Peter", "lastName": "Jones"}],
"owners":[{"firstName": "Jack", "lastName": "Petter"},
... | 30.928571 | 62 | 0.549654 |
3306588423309b0050c09694e20cfe84a5d13cc8 | 4,801 | py | Python | acme_diags/plot/vcs/zonal_mean_2d_plot.py | zshaheen/e3sm_diags | 0317d5634b14221052c0984ad0c1a27ca8484e2e | [
"BSD-3-Clause"
] | null | null | null | acme_diags/plot/vcs/zonal_mean_2d_plot.py | zshaheen/e3sm_diags | 0317d5634b14221052c0984ad0c1a27ca8484e2e | [
"BSD-3-Clause"
] | null | null | null | acme_diags/plot/vcs/zonal_mean_2d_plot.py | zshaheen/e3sm_diags | 0317d5634b14221052c0984ad0c1a27ca8484e2e | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import os
import sys
import numpy
import vcs
import acme_diags
import acme_diags.plot.vcs as utils
from acme_diags.driver.utils.general import get_output_dir
textcombined_objs = {}
def rotate_180(data):
"""Rotate the data 180 degrees."""
return data[::-1]
def log_yaxi... | 34.292857 | 79 | 0.709436 |
3306757dd67c8f1f1dfadd201b2ccd6fcbcf24d5 | 15,845 | py | Python | sunpy/coordinates/tests/test_frames.py | johan12345/sunpy | 56e1ab0c2c992f99e0fe3e6bff468b731a51228c | [
"BSD-2-Clause"
] | 2 | 2020-01-03T16:39:28.000Z | 2020-04-24T15:12:08.000Z | sunpy/coordinates/tests/test_frames.py | johan12345/sunpy | 56e1ab0c2c992f99e0fe3e6bff468b731a51228c | [
"BSD-2-Clause"
] | 1 | 2020-05-11T13:38:56.000Z | 2020-05-11T13:38:56.000Z | sunpy/coordinates/tests/test_frames.py | johan12345/sunpy | 56e1ab0c2c992f99e0fe3e6bff468b731a51228c | [
"BSD-2-Clause"
] | null | null | null |
import warnings
import numpy as np
import pytest
import astropy.units as u
from astropy.coordinates import (
CartesianRepresentation,
SkyCoord,
SphericalRepresentation,
UnitSphericalRepresentation,
)
from astropy.tests.helper import assert_quantity_allclose
from sunpy.time import parse_time
from ...... | 35.929705 | 98 | 0.620701 |
330677acc75e042a2ceeb88ff81f337fc0dcd416 | 4,748 | py | Python | projects/api/DocumentsApi.py | chamathshashika/projects-python-wrappers | 33e9f6bccba16a581b115c582033a93d43bb159c | [
"MIT"
] | null | null | null | projects/api/DocumentsApi.py | chamathshashika/projects-python-wrappers | 33e9f6bccba16a581b115c582033a93d43bb159c | [
"MIT"
] | null | null | null | projects/api/DocumentsApi.py | chamathshashika/projects-python-wrappers | 33e9f6bccba16a581b115c582033a93d43bb159c | [
"MIT"
] | null | null | null | #$Id$
from projects.util.ZohoHttpClient import ZohoHttpClient
from projects.api.Api import Api
from projects.parser.DocumentsParser import DocumentsParser
from os.path import basename
base_url = Api().base_url
zoho_http_client = ZohoHttpClient()
parser = DocumentsParser()
class DocumentsApi:
"""Documents api cla... | 33.202797 | 137 | 0.555602 |
33069a9ad12d04e8c561dc4e2a6689491ad98040 | 5,147 | py | Python | sendim/tests/views.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | 1 | 2017-12-13T20:28:32.000Z | 2017-12-13T20:28:32.000Z | sendim/tests/views.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | null | null | null | sendim/tests/views.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | null | null | null | """
"""
from django.utils import unittest
from django.test.client import Client
from django.core import management
from django.contrib.auth.models import User
from sendim.tests.defs import create_alert, end_event
from sendim.models import Alert, Event
class Views_TestCase(unittest.TestCase):
def setUp(self):
... | 42.53719 | 141 | 0.654167 |
33069c03f87fa10a4b7df67abc9e818966a32ecc | 1,445 | py | Python | py/424. Longest Repeating Character Replacement.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/424. Longest Repeating Character Replacement.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/424. Longest Repeating Character Replacement.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/longest-repeating-character-replacement/
# You are given a string s and an integer k. You can choose any character of the
# string and change it to any other uppercase English character. You can perform
# this operation at most k times.
# Return the length of the longest substring cont... | 32.111111 | 80 | 0.541176 |
3306be9d4692f1f35421c5c12727cce3eaec2958 | 1,266 | py | Python | posthog/api/test/test_user.py | bcruddy/posthog | 9ae6854254085bbe10cc4f9c98820d9efed52424 | [
"MIT"
] | 2 | 2020-02-24T20:05:53.000Z | 2020-04-16T06:41:19.000Z | posthog/api/test/test_user.py | timgl/posthog | 29af90e2eb72f32752d11197a68fa9026af228df | [
"MIT"
] | 5 | 2021-03-19T09:20:12.000Z | 2021-09-22T19:25:21.000Z | posthog/api/test/test_user.py | timgl/posthog | 29af90e2eb72f32752d11197a68fa9026af228df | [
"MIT"
] | 3 | 2020-02-21T23:19:41.000Z | 2020-03-12T11:14:47.000Z | from .base import BaseTest
from posthog.models import User
class TestUser(BaseTest):
TESTS_API = True
def test_redirect_to_site(self):
self.team.app_url = 'http://somewebsite.com'
self.team.save()
response = self.client.get('/api/user/redirect_to_site/?actionId=1')
self.assertIn... | 42.2 | 87 | 0.685624 |
3306d4bcdf84a8ad18c07fca10d51987d048fc90 | 3,880 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/updates/channel_difference_too_long.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/updates/channel_difference_too_long.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/updates/channel_difference_too_long.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 36.261682 | 224 | 0.612371 |
3306d7f40980557cb059653b0ec5299d17eebe76 | 4,342 | py | Python | development/tests/regression/run.py | OpenSourceEconomics/soepy | 4ff40292799e248e356d614c1a7141bd35a912c9 | [
"MIT"
] | 12 | 2018-12-17T14:46:55.000Z | 2022-03-28T21:15:33.000Z | development/tests/regression/run.py | OpenSourceEconomics/soepy | 4ff40292799e248e356d614c1a7141bd35a912c9 | [
"MIT"
] | 129 | 2019-02-18T08:49:39.000Z | 2022-03-25T16:52:08.000Z | development/tests/regression/run.py | OpenSourceEconomics/soepy | 4ff40292799e248e356d614c1a7141bd35a912c9 | [
"MIT"
] | 6 | 2019-02-19T15:23:40.000Z | 2022-03-28T21:16:00.000Z | #!/usr/bin/env python
"""This module contains the process that generates our regression test battery."""
import argparse
import pickle
import numpy as np
from soepy.simulate.simulate_python import simulate
from soepy.soepy_config import TEST_RESOURCES_DIR
from soepy.test.random_init import random_init
from development... | 28.379085 | 91 | 0.6345 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.