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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d5aebe2698e23bce332a99797736cebfa29cec76 | 9,262 | py | Python | python-midonetclient/src/midonetclient/vendor_media_type.py | gdecandia/midonet-1 | 6a8e2ec3941061716fbf13c99d2133c7a3b5d3aa | [
"Apache-2.0"
] | null | null | null | python-midonetclient/src/midonetclient/vendor_media_type.py | gdecandia/midonet-1 | 6a8e2ec3941061716fbf13c99d2133c7a3b5d3aa | [
"Apache-2.0"
] | null | null | null | python-midonetclient/src/midonetclient/vendor_media_type.py | gdecandia/midonet-1 | 6a8e2ec3941061716fbf13c99d2133c7a3b5d3aa | [
"Apache-2.0"
] | 1 | 2018-10-25T05:52:05.000Z | 2018-10-25T05:52:05.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Midokura PTE LTD.
# 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/LICENS... | 49.265957 | 105 | 0.814619 |
d5af0927e62f4ea145719fe34d8613b368f816fd | 6,195 | py | Python | restapi_logging_handler/tests/test_restapi_logging_handler.py | mxreppy/restapi-logging-handler | 286bcc6309be897340c05d85bdf8e3e2df7dfc68 | [
"MIT"
] | null | null | null | restapi_logging_handler/tests/test_restapi_logging_handler.py | mxreppy/restapi-logging-handler | 286bcc6309be897340c05d85bdf8e3e2df7dfc68 | [
"MIT"
] | null | null | null | restapi_logging_handler/tests/test_restapi_logging_handler.py | mxreppy/restapi-logging-handler | 286bcc6309be897340c05d85bdf8e3e2df7dfc68 | [
"MIT"
] | 1 | 2017-01-20T12:32:11.000Z | 2017-01-20T12:32:11.000Z | import json
import uuid
import datetime
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from unittest import TestCase
import logging
from restapi_logging_handler import RestApiHandler
class TestRestApiHandler(TestCase):
@classmethod
@patch('restapi_logging_handler.re... | 27.65625 | 76 | 0.527845 |
d5af28c535a27374209bfdc518531cfe9fc597e3 | 6,532 | py | Python | pyroomacoustics/realtime/tests/test_stft.py | pswietojanski/pyroomacoustics | c1e7d2b5450be84d78f3a539f22c770f62cebad4 | [
"MIT"
] | null | null | null | pyroomacoustics/realtime/tests/test_stft.py | pswietojanski/pyroomacoustics | c1e7d2b5450be84d78f3a539f22c770f62cebad4 | [
"MIT"
] | null | null | null | pyroomacoustics/realtime/tests/test_stft.py | pswietojanski/pyroomacoustics | c1e7d2b5450be84d78f3a539f22c770f62cebad4 | [
"MIT"
] | 1 | 2019-09-11T06:11:11.000Z | 2019-09-11T06:11:11.000Z |
from __future__ import division, print_function
from unittest import TestCase
import numpy as np
from scipy.signal import fftconvolve
import pyroomacoustics as pra
'''
We create a signal, a simple filter and compute their convolution.
Then we test STFT block procesing with and without overlap,
and with and without f... | 26.128 | 74 | 0.640998 |
d5af3c14d8b2bdde49b10daf1aaa3e200c6e4bc3 | 1,023 | py | Python | setup.py | RandanCSS/randan | c72683d854f277c7907aba3cab7a99ba85f05656 | [
"MIT"
] | 1 | 2021-02-17T05:14:10.000Z | 2021-02-17T05:14:10.000Z | setup.py | RandanCSS/randan | c72683d854f277c7907aba3cab7a99ba85f05656 | [
"MIT"
] | null | null | null | setup.py | RandanCSS/randan | c72683d854f277c7907aba3cab7a99ba85f05656 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="randan", # Replace with your own username
version="0.2.1",
author="Aleksei Rotmistrov, Svetlana Zhuchkova",
author_email="alexey.n.rotmistrov@gmail.com, lana_lob@mail.ru",
descri... | 31 | 68 | 0.603128 |
d5af4cb3a961e5ac5b923882a53b987c6180bb79 | 98 | py | Python | office365/sharepoint/search/queryResult.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | 544 | 2016-08-04T17:10:16.000Z | 2022-03-31T07:17:20.000Z | office365/sharepoint/search/queryResult.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | 438 | 2016-10-11T12:24:22.000Z | 2022-03-31T19:30:35.000Z | office365/sharepoint/search/queryResult.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | 202 | 2016-08-22T19:29:40.000Z | 2022-03-30T20:26:15.000Z | from office365.runtime.client_value import ClientValue
class QueryResult(ClientValue):
pass
| 16.333333 | 54 | 0.816327 |
d5af5341a15b1d5dc90ab48d7fa48ce93c62e044 | 1,333 | py | Python | src/train-coach.py | daniel-fudge/DRL-Portfolio-Optimization | bcefaeb3e85b94cfd2d576fc21f9762c14da46e8 | [
"MIT"
] | 3 | 2021-04-23T07:51:44.000Z | 2022-02-28T16:52:36.000Z | src/train-coach.py | daniel-fudge/DRL-Portfolio-Optimization | bcefaeb3e85b94cfd2d576fc21f9762c14da46e8 | [
"MIT"
] | 2 | 2019-09-29T16:16:52.000Z | 2019-09-29T17:47:37.000Z | src/train-coach.py | daniel-fudge/DRL-Portfolio-Optimization | bcefaeb3e85b94cfd2d576fc21f9762c14da46e8 | [
"MIT"
] | 4 | 2020-11-04T04:24:03.000Z | 2022-03-20T03:58:56.000Z | import os
from sagemaker_rl.coach_launcher import SageMakerCoachPresetLauncher
import shutil
class MyLauncher(SageMakerCoachPresetLauncher):
@staticmethod
def default_preset_name():
"""This points to a .py file that configures everything about the RL job.
It can be overridden at runtime by sp... | 39.205882 | 102 | 0.696174 |
d5af6754116cc468500f2e399190416c4176d2b3 | 8,833 | py | Python | list/vovnet39.py | PHL22/Backbone | b3f103fdab657f2fca494c4cdf2f8195dc837105 | [
"MIT"
] | null | null | null | list/vovnet39.py | PHL22/Backbone | b3f103fdab657f2fca494c4cdf2f8195dc837105 | [
"MIT"
] | null | null | null | list/vovnet39.py | PHL22/Backbone | b3f103fdab657f2fca494c4cdf2f8195dc837105 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
from .build import BACKBONE_REGISTRY
from .backbone import Backbone
from detectron2.modeling import ShapeSpec
__all__ = ['VoVNet', 'vovnet27_slim', 'vovnet39', 'vovnet57']
model_urls = {
'vovnet39': '... | 34.913043 | 90 | 0.526095 |
d5af8f4040317c4cc8f6d1af77354ec94dab82e4 | 4,052 | py | Python | alipay/aop/api/request/AlipayCommerceEducateSchoolcodeTokenCreateRequest.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/request/AlipayCommerceEducateSchoolcodeTokenCreateRequest.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/request/AlipayCommerceEducateSchoolcodeTokenCreateRequest.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.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceEducateSchoolcodeTokenCreateModel import AlipayCommerceEducateSchoolcodeTokenCreateModel
class AlipayCommerceEducateSc... | 27.944828 | 148 | 0.65153 |
d5afc5b9eeee1d6cc671ac5c2e3c8652e55bccd9 | 5,667 | py | Python | mplStyle/types/convert/test/test_toFileList.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | 39 | 2015-03-08T23:05:01.000Z | 2022-02-07T16:03:35.000Z | mplStyle/types/convert/test/test_toFileList.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | null | null | null | mplStyle/types/convert/test/test_toFileList.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | 23 | 2015-03-08T19:56:59.000Z | 2021-07-15T15:16:26.000Z | #===========================================================================
#
# Copyright (c) 2014, California Institute of Technology.
# U.S. Government Sponsorship under NASA Contract NAS7-03001 is
# acknowledged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modific... | 39.908451 | 81 | 0.52691 |
d5b0031a573b844ea51dcdb635098082d28ab04e | 780 | py | Python | parlai/tasks/changemyview/agents.py | urvishdesai/ParlAI | 29743cc7b47c413c2181f68c0b7ef40a6f06a40f | [
"BSD-3-Clause"
] | 2 | 2020-03-22T10:18:09.000Z | 2020-05-06T21:48:47.000Z | parlai/tasks/changemyview/agents.py | urvishdesai/dialogue-encoding-tasks-parlai | 29743cc7b47c413c2181f68c0b7ef40a6f06a40f | [
"BSD-3-Clause"
] | null | null | null | parlai/tasks/changemyview/agents.py | urvishdesai/dialogue-encoding-tasks-parlai | 29743cc7b47c413c2181f68c0b7ef40a6f06a40f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
fr... | 33.913043 | 77 | 0.715385 |
d5b00d289c883d3dce443c8379c62da6b6bd4b71 | 2,702 | py | Python | tests/models/validators/v2_1_2/jsd_87a8ba444ce9bc59.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | tests/models/validators/v2_1_2/jsd_87a8ba444ce9bc59.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | tests/models/validators/v2_1_2/jsd_87a8ba444ce9bc59.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DNA Center Add edge device data model.
Copyright (c) 2019-2020 Cisco and/or its affiliates.
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, includi... | 32.166667 | 78 | 0.592154 |
d5b00f6666d8c276d850b6c54fff51bd6bb24af5 | 12,027 | py | Python | flatland/shapes.py | Saruccio/Flatland | 3013640872249adb02c518f78119b1ad04fb2a0b | [
"MIT"
] | null | null | null | flatland/shapes.py | Saruccio/Flatland | 3013640872249adb02c518f78119b1ad04fb2a0b | [
"MIT"
] | null | null | null | flatland/shapes.py | Saruccio/Flatland | 3013640872249adb02c518f78119b1ad04fb2a0b | [
"MIT"
] | null | null | null | # File: shapes.py
# Date: 08-09-2019
# Author: Saruccio Culmone
#
# Description
# This file contains all definitions of classes corresponding to geometric
# shapes as rectangle, square, circle that will be used to compose the
# virtual environment.
#
"""
This file contains all definitions of classes corresponding to ge... | 29.121065 | 293 | 0.582523 |
d5b0142baa7a951cbdbe7d1cea6d17711cdc5d78 | 302 | py | Python | tests/test_mantle/compare/mothball/eq2.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 14 | 2017-10-08T09:16:10.000Z | 2021-11-27T19:12:24.000Z | tests/test_mantle/compare/mothball/eq2.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 7 | 2018-04-12T21:33:49.000Z | 2018-08-21T22:14:20.000Z | tests/test_mantle/compare/mothball/eq2.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 3 | 2018-07-24T04:55:02.000Z | 2019-12-30T08:12:39.000Z | from magma import bits, wire, compile, EndCircuit
from mantle import EQ
from loam.boards.icestick import IceStick
icestick = IceStick()
for i in range(2):
icestick.J1[i].input().on()
icestick.D1.on()
main = icestick.main()
eq2 = EQ(2)
eq2(main.J1,bits([0,1]))
wire(eq2.O, main.D1)
EndCircuit()
| 17.764706 | 49 | 0.705298 |
d5b0178add83c288c953c4e82930f7d0fdf3740d | 14,748 | py | Python | ginga/tkw/ImageViewTk.py | Cadair/ginga | 5afdd8824f27c7ae7d8d82b5013b0ff0068bd8b8 | [
"BSD-3-Clause"
] | null | null | null | ginga/tkw/ImageViewTk.py | Cadair/ginga | 5afdd8824f27c7ae7d8d82b5013b0ff0068bd8b8 | [
"BSD-3-Clause"
] | null | null | null | ginga/tkw/ImageViewTk.py | Cadair/ginga | 5afdd8824f27c7ae7d8d82b5013b0ff0068bd8b8 | [
"BSD-3-Clause"
] | null | null | null | #
# ImageViewTk.py -- a backend for Ginga using a Tk canvas widget
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
import numpy
import PIL.Image as PILimage
import PIL... | 32.06087 | 82 | 0.56211 |
d5b058b510f3efc5e1b3240990c3a2f0b6aaca2e | 767 | py | Python | setup.py | hobbymarks/GitMore | d1ebc0710cb6bef1c5dce90d45396bcbdfb90c19 | [
"MIT"
] | 1 | 2021-12-22T15:36:35.000Z | 2021-12-22T15:36:35.000Z | setup.py | hobbymarks/GitMore | d1ebc0710cb6bef1c5dce90d45396bcbdfb90c19 | [
"MIT"
] | 1 | 2021-05-31T00:09:30.000Z | 2021-05-31T00:09:30.000Z | setup.py | hobbymarks/giat | d1ebc0710cb6bef1c5dce90d45396bcbdfb90c19 | [
"MIT"
] | null | null | null | from setuptools import find_packages
from setuptools import setup
setup(
name='giat@hobbymarks',
version='2021.05.31',
packages=find_packages('.'),
url='https://github.com/hobbymarks/giat',
license='MIT',
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Langu... | 29.5 | 77 | 0.628422 |
d5b065c041abd8d7cada21e5d0aa509b0a60f8b4 | 2,450 | py | Python | src/data/transforms_factory.py | benihime91/leaf-disease-classification-kaggle | e1c8b1c6b88fe199a09e9d956db7b9baa3fb9dcc | [
"MIT"
] | null | null | null | src/data/transforms_factory.py | benihime91/leaf-disease-classification-kaggle | e1c8b1c6b88fe199a09e9d956db7b9baa3fb9dcc | [
"MIT"
] | null | null | null | src/data/transforms_factory.py | benihime91/leaf-disease-classification-kaggle | e1c8b1c6b88fe199a09e9d956db7b9baa3fb9dcc | [
"MIT"
] | 3 | 2020-12-14T04:22:31.000Z | 2021-04-22T19:40:34.000Z | import albumentations as A
import torchvision.transforms as T
from hydra.utils import instantiate
from omegaconf import DictConfig
from timm.data.auto_augment import (
augment_and_mix_transform,
auto_augment_transform,
rand_augment_transform,
)
from timm.data.constants import (
DEFAULT_CROP_PCT,
IM... | 33.108108 | 87 | 0.697551 |
d5b0bb3d8041188373cdac23ef1d991f9451ca6f | 21,045 | py | Python | tests/test_pipeline_files.py | yifeiwu/scrapy | 5a386393595ae6505840f00d6ea4a51beda31e19 | [
"BSD-3-Clause"
] | null | null | null | tests/test_pipeline_files.py | yifeiwu/scrapy | 5a386393595ae6505840f00d6ea4a51beda31e19 | [
"BSD-3-Clause"
] | null | null | null | tests/test_pipeline_files.py | yifeiwu/scrapy | 5a386393595ae6505840f00d6ea4a51beda31e19 | [
"BSD-3-Clause"
] | null | null | null | import os
import random
import time
from io import BytesIO
from shutil import rmtree
from tempfile import mkdtemp
from unittest import mock, skipIf
from urllib.parse import urlparse
import attr
from itemadapter import ItemAdapter
from twisted.internet import defer
from twisted.trial import unittest
from scrapy.http i... | 40.705996 | 111 | 0.662628 |
d5b0e83c748bf7463c2826056dfcd36a42930f27 | 5,080 | py | Python | ginga/rv/plugins/Log.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | 1 | 2019-04-27T01:34:27.000Z | 2019-04-27T01:34:27.000Z | ginga/rv/plugins/Log.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | ginga/rv/plugins/Log.py | SimonKrughoff/ginga | abcd284228400092b2d7b73bb51d30632e90ee03 | [
"BSD-3-Clause"
] | null | null | null | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
See the logging output of the reference viewer.
**Plugin Type: Global**
``Log`` is a global plugin. Only one instance can be opened.
**Usage**
The ``Log`` plugin builds a UI that includes a large scrolli... | 31.75 | 74 | 0.621654 |
d5b1088fee494f4ed954bad306ce0bd9d3b88652 | 53,672 | py | Python | plugin/molecularCoverageAnalysis/molecular_coverage_analysis.py | mkalioby/TS | 108989c200fb896c1366786a70f4a5e166dc733c | [
"Apache-2.0"
] | null | null | null | plugin/molecularCoverageAnalysis/molecular_coverage_analysis.py | mkalioby/TS | 108989c200fb896c1366786a70f4a5e166dc733c | [
"Apache-2.0"
] | null | null | null | plugin/molecularCoverageAnalysis/molecular_coverage_analysis.py | mkalioby/TS | 108989c200fb896c1366786a70f4a5e166dc733c | [
"Apache-2.0"
] | 1 | 2020-04-18T13:00:23.000Z | 2020-04-18T13:00:23.000Z | #!/usr/bin/python
# Copyright (C) 2019 Thermo Fisher Scientific, Inc. All Rights Reserved.
import pysam
import os
import sys
import numpy
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import json
import string
import time
try:
import lod
except ImportError:
plugin_dir = os.pat... | 49.015525 | 273 | 0.607076 |
d5b108e48ee2687e9f841fee8fec696001031129 | 5,761 | py | Python | python/openlattice/models/entity_set_property_meta_data.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | python/openlattice/models/entity_set_property_meta_data.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | 1 | 2021-01-20T00:20:01.000Z | 2021-01-20T00:20:01.000Z | python/openlattice/models/entity_set_property_meta_data.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenLattice API
OpenLattice API # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: support@openlattice.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from openlattice.configuration import Configuration
... | 28.805 | 137 | 0.608575 |
d5b1090eefcf5b12dc7475a4aadb15addd07646e | 5,191 | py | Python | models/tensorlayer_test.py | bshishov/DeepForecasting | a562ed5fa39c097f8dd4f41ae65b52bf887f8f33 | [
"MIT"
] | 4 | 2018-12-06T08:55:20.000Z | 2020-04-11T20:30:38.000Z | models/tensorlayer_test.py | bshishov/DeepForecasting | a562ed5fa39c097f8dd4f41ae65b52bf887f8f33 | [
"MIT"
] | null | null | null | models/tensorlayer_test.py | bshishov/DeepForecasting | a562ed5fa39c097f8dd4f41ae65b52bf887f8f33 | [
"MIT"
] | 2 | 2020-04-09T14:43:37.000Z | 2020-08-04T22:34:13.000Z | import tensorflow as tf
import tensorlayer as tl
import numpy as np
import matplotlib.pyplot as plt
def create_data(size, seq_len):
seq_len = 64
ds_size = 100
sep = ds_size // 2
x_train = np.repeat(np.expand_dims(np.linspace(0, 12, seq_len), axis=0), repeats=ds_size, axis=0)
y_train = np.zeros(ds_... | 35.554795 | 135 | 0.663841 |
d5b12cb19dec1c5f6f46f089eaa8af2679c31ee5 | 14,502 | py | Python | code/facebias/visualization.py | visionjo/facerec-bias-bfw | e7479495cbc1cf14ecc214c4e899acea4c136f80 | [
"BSD-3-Clause"
] | 39 | 2020-02-14T20:43:22.000Z | 2022-03-15T11:33:54.000Z | code/facebias/visualization.py | reachananya/facerec-bias-bfw | 946a207b3d18a5357138e40f8b076737bfbfbe38 | [
"BSD-3-Clause"
] | 11 | 2020-02-27T21:24:02.000Z | 2021-10-09T00:57:34.000Z | code/facebias/visualization.py | reachananya/facerec-bias-bfw | 946a207b3d18a5357138e40f8b076737bfbfbe38 | [
"BSD-3-Clause"
] | 8 | 2020-08-10T05:12:49.000Z | 2021-08-18T21:36:14.000Z | """
Functions for generating plots and visuals.
"""
import numpy as np
import seaborn as sns
from matplotlib import colors as colors, pyplot as plt, style as style, ticker as mtick
from matplotlib.lines import Line2D
from matplotlib.ticker import ScalarFormatter
from sklearn.metrics import auc, roc_curve
from facebias... | 32.155211 | 87 | 0.608054 |
d5b13035cd05d235887a9196dec585a28873f9b3 | 27,718 | py | Python | venv/lib/python3.6/site-packages/kubernetes/client/api/authorization_v1beta1_api.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/api/authorization_v1beta1_api.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/api/authorization_v1beta1_api.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
"""
from __future__ import absolute_import
import re # noqa: F401... | 49.320285 | 276 | 0.664803 |
d5b1698c42361cd8abe024976c4df258b60d5c20 | 8,895 | py | Python | docs/conf.py | x-lhan/lemur | 1d8aaa4a242af610363e961167bc31691b358773 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | x-lhan/lemur | 1d8aaa4a242af610363e961167bc31691b358773 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | x-lhan/lemur | 1d8aaa4a242af610363e961167bc31691b358773 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# lemur documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 7 18:43:48 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 31.767857 | 98 | 0.715458 |
d5b183d876cdeba398f6e53257d09801663dfcf3 | 11,621 | py | Python | huobi/impl/websocketconnection.py | xiaohuid/huobi_Python | ebc84b2fc560f77fd77457f36ff91906c43646e3 | [
"Apache-2.0"
] | 1 | 2020-12-28T07:04:45.000Z | 2020-12-28T07:04:45.000Z | huobi/impl/websocketconnection.py | xiaohuid/huobi_Python | ebc84b2fc560f77fd77457f36ff91906c43646e3 | [
"Apache-2.0"
] | null | null | null | huobi/impl/websocketconnection.py | xiaohuid/huobi_Python | ebc84b2fc560f77fd77457f36ff91906c43646e3 | [
"Apache-2.0"
] | null | null | null | import threading
import websocket
import gzip
import ssl
import logging
from urllib import parse
import urllib.parse
from huobi.base.printtime import PrintDate
from huobi.constant.system import ApiVersion
from huobi.impl.utils.apisignaturev2 import create_signature_v2
from huobi.impl.utils.timeservice import get_curre... | 40.775439 | 108 | 0.609414 |
d5b18d9fc0e017324068ce359d263eecce63cdb0 | 1,768 | py | Python | tests/geometry/geometry_pointcloud_generalcost_test.py | ersisimou/ott | 1f38d56d57aa0b9379529851d366af5f7cc4849a | [
"Apache-2.0"
] | 110 | 2021-12-28T17:18:08.000Z | 2022-03-31T00:20:57.000Z | tests/geometry/geometry_pointcloud_generalcost_test.py | ersisimou/ott | 1f38d56d57aa0b9379529851d366af5f7cc4849a | [
"Apache-2.0"
] | 14 | 2022-01-31T14:04:47.000Z | 2022-03-24T17:20:35.000Z | tests/geometry/geometry_pointcloud_generalcost_test.py | ersisimou/ott | 1f38d56d57aa0b9379529851d366af5f7cc4849a | [
"Apache-2.0"
] | 17 | 2022-01-31T11:59:26.000Z | 2022-03-31T11:28:44.000Z | # coding=utf-8
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dis... | 31.571429 | 76 | 0.701923 |
d5b1bd2303ccd9caef19d95278248df83e21793d | 2,645 | py | Python | tests/TestDelta.py | zanachka/parsedatetime | 96a1ed0c0be7dfd6a4404c0c98dc6380f2a16916 | [
"Apache-2.0"
] | 463 | 2015-01-05T11:10:50.000Z | 2022-03-20T03:48:29.000Z | tests/TestDelta.py | zanachka/parsedatetime | 96a1ed0c0be7dfd6a4404c0c98dc6380f2a16916 | [
"Apache-2.0"
] | 196 | 2015-01-04T15:31:06.000Z | 2022-03-24T16:57:53.000Z | tests/TestDelta.py | zanachka/parsedatetime | 96a1ed0c0be7dfd6a4404c0c98dc6380f2a16916 | [
"Apache-2.0"
] | 96 | 2015-01-19T14:38:49.000Z | 2021-12-17T14:20:21.000Z | # -*- coding: utf-8 -*-
"""
Test time delta
"""
import sys
import time
import datetime
import unittest
import parsedatetime as pdt
from parsedatetime.context import pdtContext
class test(unittest.TestCase):
def setUp(self):
self.cal = pdt.Calendar(version=pdt.VERSION_CONTEXT_STYLE)
self.source = ... | 35.743243 | 77 | 0.586011 |
d5b1d86e62dc599b9888af8cf57011105d260a83 | 1,603 | py | Python | ufora/util/StackTraceLoop.py | ufora/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 571 | 2015-11-05T20:07:07.000Z | 2022-01-24T22:31:09.000Z | ufora/util/StackTraceLoop.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 218 | 2015-11-05T20:37:55.000Z | 2021-05-30T03:53:50.000Z | ufora/util/StackTraceLoop.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 40 | 2015-11-07T21:42:19.000Z | 2021-05-23T03:48:19.000Z | # Copyright 2015 Ufora Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 31.431373 | 93 | 0.650031 |
d5b1dfbf02dad1d513822eb8d100e41b1ec2aa62 | 717 | py | Python | src/9/avoiding_repetitive_property_methods/example1.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 14 | 2017-05-20T04:06:46.000Z | 2022-01-23T06:48:45.000Z | src/9/avoiding_repetitive_property_methods/example1.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | src/9/avoiding_repetitive_property_methods/example1.py | tuanavu/python-gitbook | 948a05e065b0f40afbfd22f697dff16238163cde | [
"MIT"
] | 15 | 2017-03-29T17:57:33.000Z | 2021-08-24T02:20:08.000Z | def typed_property(name, expected_type):
storage_name = '_' + name
@property
def prop(self):
return getattr(self, storage_name)
@prop.setter
def prop(self, value):
if not isinstance(value, expected_type):
raise TypeError('{} must be a {}'.format(name, expected_type))
... | 23.129032 | 74 | 0.596932 |
d5b22093904bfe7cb6a429e580265f96ee22a2ad | 481 | py | Python | Firmware/interface_generator_stub.py | rowanG077/ODrive | 431bf9116408691ec631f8286507f627e57b06d2 | [
"MIT"
] | 19 | 2018-09-08T09:51:54.000Z | 2020-10-02T06:52:26.000Z | Firmware/interface_generator_stub.py | rowanG077/ODrive | 431bf9116408691ec631f8286507f627e57b06d2 | [
"MIT"
] | 2 | 2019-06-30T05:35:29.000Z | 2020-06-25T16:41:18.000Z | Firmware/interface_generator_stub.py | rowanG077/ODrive | 431bf9116408691ec631f8286507f627e57b06d2 | [
"MIT"
] | 25 | 2019-02-09T13:39:27.000Z | 2020-09-04T03:03:29.000Z | #!/bin/python3
import sys
import os
try:
exec(open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'fibre', 'tools', 'interface_generator.py')).read())
except ImportError as ex:
print(str(ex), file=sys.stderr)
print("Note that there are new compile-time dependencies since around v0.5.1.", file=s... | 37 | 137 | 0.725572 |
d5b23c4d417e0ee81d3e93e9c66a94a42a1f1a44 | 5,252 | py | Python | whoville/cloudbreak/models/failure_policy_request.py | mikchaos/whoville | 6eabaea4b74ac0b632c03db8252590131c6ce63b | [
"Apache-2.0"
] | null | null | null | whoville/cloudbreak/models/failure_policy_request.py | mikchaos/whoville | 6eabaea4b74ac0b632c03db8252590131c6ce63b | [
"Apache-2.0"
] | null | null | null | whoville/cloudbreak/models/failure_policy_request.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... | 32.621118 | 984 | 0.614242 |
d5b2927c3b72b99fa64ec0ee25c45a270502f035 | 2,458 | py | Python | src/py/wxyz_core/src/wxyz/core/base.py | dfreeman06/wxyz | 663cf6593f4c0ca12f7b94b61e34c0a8d3cbcdfd | [
"BSD-3-Clause"
] | 1 | 2021-06-20T12:21:27.000Z | 2021-06-20T12:21:27.000Z | src/py/wxyz_core/src/wxyz/core/base.py | nrbgt/wxyz | 663cf6593f4c0ca12f7b94b61e34c0a8d3cbcdfd | [
"BSD-3-Clause"
] | null | null | null | src/py/wxyz_core/src/wxyz/core/base.py | nrbgt/wxyz | 663cf6593f4c0ca12f7b94b61e34c0a8d3cbcdfd | [
"BSD-3-Clause"
] | null | null | null | """ Reusable boilerplate for widgets
"""
# pylint: disable=broad-except,no-member
import ipywidgets as W
import traitlets as T
from ._version import module_name, module_version
class WXYZBase(W.Widget):
""" Version and front-end metadata
"""
_model_module = T.Unicode(module_name).tag(sync=True)
_mod... | 32.342105 | 78 | 0.659072 |
d5b2aa305e24c01de3525a7eae6cfeeec1c0d8d3 | 1,578 | py | Python | users/models.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | null | null | null | users/models.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | 3 | 2022-02-10T11:47:58.000Z | 2022-02-23T18:50:24.000Z | users/models.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
from .managers import UserManager
class User(AbstractUser):
class ORGANISMS(models.TextChoices):
AGENCE_URBA = "AGENCE", "Agence d'urbanisme"
AMENAGEUR = "AMENAG", "Aménageur"
ASSOCIATION = "ASSOCI", "Associa... | 29.222222 | 81 | 0.618504 |
d5b2b0c83d90c1a6da0f86899f75c5357f813cbb | 2,538 | py | Python | src/ralph_scrooge/plugins/cost/support.py | kula1922/ralph_pricing | 3887ff7a900f10a7630f451dd39f86da829ce3da | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/plugins/cost/support.py | kula1922/ralph_pricing | 3887ff7a900f10a7630f451dd39f86da829ce3da | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/plugins/cost/support.py | kula1922/ralph_pricing | 3887ff7a900f10a7630f451dd39f86da829ce3da | [
"Apache-2.0"
] | 1 | 2021-11-15T21:21:17.000Z | 2021-11-15T21:21:17.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from collections import defaultdict, namedtuple
from ralph_scrooge.models import ExtraCostType, SupportCost
from ralph_scrooge.pl... | 27.89011 | 76 | 0.589046 |
d5b2e30d142a1a9b21bb8c8d57187e5e646f5dfa | 4,956 | py | Python | ws4py/client/tornadoclient.py | idobatter/WebSocket-for-Python | f7bd95b07f5df185c32d1eb6a2d10e1e78d43637 | [
"BSD-3-Clause"
] | 1 | 2015-11-06T02:38:45.000Z | 2015-11-06T02:38:45.000Z | ws4py/client/tornadoclient.py | idobatter/WebSocket-for-Python | f7bd95b07f5df185c32d1eb6a2d10e1e78d43637 | [
"BSD-3-Clause"
] | null | null | null | ws4py/client/tornadoclient.py | idobatter/WebSocket-for-Python | f7bd95b07f5df185c32d1eb6a2d10e1e78d43637 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import ssl
from tornado import iostream, escape
from ws4py.client import WebSocketBaseClient
from ws4py.exc import HandshakeError
__all__ = ['TornadoWebSocketClient']
class TornadoWebSocketClient(WebSocketBaseClient):
def __init__(self, url, protocols=None, extensions=None,
... | 31.769231 | 86 | 0.59201 |
d5b3367f9a31a9c602e0b138e617db68834b8229 | 2,411 | py | Python | tensorflow/contrib/distributions/python/kernel_tests/bijectors/scale_tril_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/distributions/python/kernel_tests/bijectors/scale_tril_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/distributions/python/kernel_tests/bijectors/scale_tril_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 36 | 2017-07-27T21:12:40.000Z | 2022-02-03T16:45:56.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.442857 | 80 | 0.681045 |
d5b33c089404ec18787df45aa6ff397839a39652 | 879 | py | Python | src/beast/python/beast/util/Terminal.py | Ziftr/stellard | 626514cbbb2c6c2b6844315ca98a2bfcbca0b43d | [
"BSL-1.0"
] | 58 | 2015-01-07T09:10:59.000Z | 2019-07-15T14:34:01.000Z | src/beast/python/beast/util/Terminal.py | Ziftr/stellard | 626514cbbb2c6c2b6844315ca98a2bfcbca0b43d | [
"BSL-1.0"
] | 12 | 2015-01-02T00:01:45.000Z | 2018-04-25T12:35:02.000Z | src/beast/python/beast/util/Terminal.py | Ziftr/stellard | 626514cbbb2c6c2b6844315ca98a2bfcbca0b43d | [
"BSL-1.0"
] | 23 | 2015-01-04T00:13:27.000Z | 2019-02-15T18:01:17.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
import sys
from beast.platform.Platform import PLATFORM
# See https://stackoverflow.com/questions/7445658/how-to-detect-if-the-console-does-support-ansi-escape-codes-in-python
CAN_CHANGE_COLOR = (
hasattr(sys.stderr, "isatty")
... | 23.756757 | 119 | 0.691695 |
d5b35167d8c8e94e6d6a2800eda293b23f925f84 | 1,933 | py | Python | appengine/swarming/swarming_bot/test_env_bot.py | hixio-mh/luci-py | 5e2606b0db8f5dac25e9f84fdf71d103da393894 | [
"Apache-2.0"
] | 74 | 2015-04-01T02:35:15.000Z | 2021-12-17T22:10:56.000Z | appengine/swarming/swarming_bot/test_env_bot.py | luci/luci-py | 41e206ef47e42122a6343147f65e4d0e4b0165de | [
"Apache-2.0"
] | 123 | 2015-04-01T04:02:57.000Z | 2022-03-02T12:49:55.000Z | appengine/swarming/swarming_bot/test_env_bot.py | luci/luci-py | 41e206ef47e42122a6343147f65e4d0e4b0165de | [
"Apache-2.0"
] | 32 | 2015-04-03T01:40:47.000Z | 2021-11-13T15:20:13.000Z | # Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import os
import sys
# swarming_bot/
BOT_DIR = os.path.dirname(os.path.realpath(os.path.abspath(__file__)))
def setup_test_env():
"""Sets up... | 34.517857 | 80 | 0.689084 |
d5b366d7c5054bdf1a78696fa232f48ab3f39277 | 447 | py | Python | kitchensink/testutils/testrpc.py | hhuuggoo/kitchensink | 1f81050fec7eace52e0b4e1b47851b649a4e4d33 | [
"BSD-3-Clause"
] | 2 | 2015-03-17T05:02:42.000Z | 2016-04-07T15:02:28.000Z | kitchensink/testutils/testrpc.py | hhuuggoo/kitchensink | 1f81050fec7eace52e0b4e1b47851b649a4e4d33 | [
"BSD-3-Clause"
] | null | null | null | kitchensink/testutils/testrpc.py | hhuuggoo/kitchensink | 1f81050fec7eace52e0b4e1b47851b649a4e4d33 | [
"BSD-3-Clause"
] | 1 | 2015-10-07T21:50:44.000Z | 2015-10-07T21:50:44.000Z | from ..rpc import RPC
import time
def dummy_mult(x, y):
return x * y
def dummy_add(x, y):
return x + y
def dummy_sleeper_add(x, y):
print ('sleep 1')
time.sleep(1)
print ('sleep 2')
time.sleep(1)
print ('sleep 3')
time.sleep(1)
return x + y
def make_rpc():
rpc = RPC()
rpc.... | 18.625 | 44 | 0.639821 |
d5b37277da75df0223156f07c41087da9793b3b1 | 6,246 | py | Python | Choi/train.py | simon2112/OCR | 506ec018dc67832b41979784bfc847e1c7d73480 | [
"MIT"
] | 5 | 2020-02-29T09:09:01.000Z | 2021-03-16T07:02:52.000Z | Choi/train.py | simon2112/OCR | 506ec018dc67832b41979784bfc847e1c7d73480 | [
"MIT"
] | null | null | null | Choi/train.py | simon2112/OCR | 506ec018dc67832b41979784bfc847e1c7d73480 | [
"MIT"
] | 1 | 2021-03-16T07:02:53.000Z | 2021-03-16T07:02:53.000Z | import numpy as np
import tensorflow as tf
from dataset import Dataset
from network import build_network
from tools import get_label, load_img, load_train_img
import tools
from parse_args import parse_args
import time
FLAGS = parse_args()
def train():
with open(FLAGS.train_txt) as f:
sample = [line.r... | 42.202703 | 115 | 0.459174 |
d5b3c69fb315e8f20d12e8c52f20363791727981 | 1,938 | py | Python | python/pygletelm_example/random.py | OtaYuji/pathilico | b28cb0d3db043de1f8a70723f8a8142b73b8c8bd | [
"Apache-2.0"
] | null | null | null | python/pygletelm_example/random.py | OtaYuji/pathilico | b28cb0d3db043de1f8a70723f8a8142b73b8c8bd | [
"Apache-2.0"
] | null | null | null | python/pygletelm_example/random.py | OtaYuji/pathilico | b28cb0d3db043de1f8a70723f8a8142b73b8c8bd | [
"Apache-2.0"
] | null | null | null | # Copyright
# 2019 Department of Dermatology, School of Medicine, Tohoku University
#
# 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/LICENS... | 27.295775 | 78 | 0.680083 |
d5b3cd403be6f72304420d042caff5db241c62ad | 4,813 | py | Python | deid/tests/test_dicom_groups.py | glebsts/deid | a0c630ee613d358b3c8e936dd539d51dee94a5a7 | [
"MIT"
] | 88 | 2017-10-16T12:47:09.000Z | 2022-03-10T23:08:04.000Z | deid/tests/test_dicom_groups.py | glebsts/deid | a0c630ee613d358b3c8e936dd539d51dee94a5a7 | [
"MIT"
] | 180 | 2017-06-15T01:37:00.000Z | 2022-03-23T23:05:57.000Z | deid/tests/test_dicom_groups.py | glebsts/deid | a0c630ee613d358b3c8e936dd539d51dee94a5a7 | [
"MIT"
] | 41 | 2017-09-29T00:29:50.000Z | 2022-03-16T02:26:54.000Z | #!/usr/bin/env python
"""
Testing groups for a deid recipe (values and fields)
Copyright (c) 2020-2021 Vanessa Sochat
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, includi... | 37.601563 | 87 | 0.670268 |
d5b3ff70593a9c07cd082586f374b785fb34d0ef | 575 | py | Python | PythonProjects/99-CapstoneProject-202020d/libs/set_robot_number.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/99-CapstoneProject-202020d/libs/set_robot_number.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/99-CapstoneProject-202020d/libs/set_robot_number.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | """
Capstone Team Project. Sets the ROBOT NUMBER for YOUR team's robot.
Winter term, 2019-2020.
"""
def get_robot_number():
my_robot_number = None
return my_robot_number
# --------------------------------------------------------------------------
# TODO: 1. Set my_robot_number in the above to YOU... | 38.333333 | 80 | 0.48 |
d5b40832b41110dbe68b52e3b14a275b5d2b0db8 | 3,856 | py | Python | dataset/wiki_entity_path.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 8 | 2022-03-01T09:02:44.000Z | 2022-03-18T14:41:56.000Z | dataset/wiki_entity_path.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 1 | 2022-03-09T12:12:22.000Z | 2022-03-10T09:08:42.000Z | dataset/wiki_entity_path.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 2 | 2022-03-02T01:46:52.000Z | 2022-03-02T13:51:53.000Z | import json
import os
import random
from tqdm import tqdm
import torch
from torch.utils.data import Dataset
from torch.utils.data.dataset import T_co
from transformers import PreTrainedTokenizer
from transformers.tokenization_utils import PaddingStrategy, TruncationStrategy
from general_util.logger import get_child_l... | 32.133333 | 132 | 0.688019 |
d5b414a832ece6b957409555abf7e918e990516a | 6,971 | py | Python | bot/game/sdbPlayer.py | Trimatix-indie/SuperDeckBreaker | 6c5f0a6593df5e7f6807b1e2b09aff65dcf8a6fc | [
"MIT"
] | null | null | null | bot/game/sdbPlayer.py | Trimatix-indie/SuperDeckBreaker | 6c5f0a6593df5e7f6807b1e2b09aff65dcf8a6fc | [
"MIT"
] | 34 | 2021-03-20T22:42:16.000Z | 2021-09-29T15:50:31.000Z | bot/game/sdbPlayer.py | Trimatix-indie/SuperDeckBreaker | 6c5f0a6593df5e7f6807b1e2b09aff65dcf8a6fc | [
"MIT"
] | null | null | null | from .sdbDeck import SDBCard, WhiteCard
from .. import lib, botState
from ..reactionMenus import SDBDMConfigMenu
from ..cfg import cfg
from . import buttonMenus
from discord import NotFound, HTTPException, TextChannel, Message
from discord.ext.commands import Context
from discord_slash import ComponentContext
from typi... | 42.766871 | 258 | 0.657868 |
d5b42452993f988aa4dd19be01c9db78dd90ec54 | 968 | py | Python | src/utils.py | chettriyuvraj/newscastAPI | 8ee9b7088b4751fed85bbdf53675d79edcea239a | [
"MIT"
] | null | null | null | src/utils.py | chettriyuvraj/newscastAPI | 8ee9b7088b4751fed85bbdf53675d79edcea239a | [
"MIT"
] | null | null | null | src/utils.py | chettriyuvraj/newscastAPI | 8ee9b7088b4751fed85bbdf53675d79edcea239a | [
"MIT"
] | null | null | null | import datetime
import logging
import re
import pandas as pd
logger = logging.getLogger()
logging.basicConfig(level="INFO")
def parse_results(raw_results: pd.DataFrame) -> list:
'''Iterates through each record in dataframe and returning a list of all the records as dict'''
results = [parse_data(row[0]) for... | 24.2 | 99 | 0.653926 |
d5b45648074f75874b2a4fee48a8a438d25e2e4a | 12,350 | py | Python | cirq/sim/mps_simulator.py | Mu-L/Cirq | 680ae219fc53b4ecfdd1c948f5bb5658949ecead | [
"Apache-2.0"
] | null | null | null | cirq/sim/mps_simulator.py | Mu-L/Cirq | 680ae219fc53b4ecfdd1c948f5bb5658949ecead | [
"Apache-2.0"
] | null | null | null | cirq/sim/mps_simulator.py | Mu-L/Cirq | 680ae219fc53b4ecfdd1c948f5bb5658949ecead | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Cirq Developers
#
# 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 ... | 34.887006 | 100 | 0.59166 |
d5b45939c8d245f2b3a5921868d7a80479b09bd9 | 269 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/tc74_simpletest.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/tc74_simpletest.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 7 | 2021-02-19T20:00:08.000Z | 2022-01-14T10:51:12.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/tc74_simpletest.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import board
import adafruit_tc74
i2c = board.I2C()
tc = adafruit_tc74.TC74(i2c)
while True:
print(f"Temperature: {tc.temperature} C")
time.sleep(0.5)
| 17.933333 | 62 | 0.747212 |
d5b469df270bc233a31b2cd2c05cd0f9fb81b5d3 | 903 | py | Python | test/unittests/test_Erosion.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_Erosion.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_Erosion.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.MultiUse_Fxns.Erosion import Erosion
class TestErosion(VariableUnitTest):
# def test_elementwise_Erosion(self):
# z = self.z
# np.testing.assert_array_almost_equal(
# np.load("unittests/Erosion.npy"),
# ... | 39.26087 | 119 | 0.589147 |
d5b481ab3eeae5de683609daa1e4450a4483e3ad | 2,961 | py | Python | 3pp/cpython3/fetch.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | 3pp/cpython3/fetch.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | 3pp/cpython3/fetch.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 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.
import argparse
import os
import re
import subprocess
import sys
from pkg_resources import parse_version
import requests
def get_we... | 29.316832 | 80 | 0.680513 |
d5b491da57d2986603e17fca5a09b2c8d83e03d0 | 935 | py | Python | venv/Lib/site-packages/pyrogram/types/authorization/__init__.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/types/authorization/__init__.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/types/authorization/__init__.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # 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... | 40.652174 | 75 | 0.757219 |
d5b4b9d68a8d4a1774bdca840f7cd8db66baef45 | 1,555 | py | Python | setup.py | marcgibbons/django-rest-framework-docs | d09e83849f4a0f296f2361094d09f529c4a2fbb1 | [
"BSD-2-Clause"
] | 41 | 2015-03-11T12:41:47.000Z | 2021-12-05T21:01:33.000Z | setup.py | marcgibbons/django-rest-framework-docs | d09e83849f4a0f296f2361094d09f529c4a2fbb1 | [
"BSD-2-Clause"
] | 4 | 2016-05-17T11:51:31.000Z | 2018-09-03T05:53:04.000Z | setup.py | marcgibbons/django-rest-framework-docs | d09e83849f4a0f296f2361094d09f529c4a2fbb1 | [
"BSD-2-Clause"
] | 14 | 2015-05-16T17:51:41.000Z | 2020-09-29T19:50:57.000Z | import os
from setuptools import setup, find_packages
#README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
README = """
Django REST Framework Docs
Rest Framework Docs is an application built to produce an inventory and documentation for your Django Rest Framework v2 endpoints.
Installation
Fro... | 29.903846 | 130 | 0.675884 |
d5b4c166d401d5d2be2c134043ad4222c71272fe | 272 | py | Python | oscar/lib/python2.7/site-packages/faker/providers/phone_number/ru_RU/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/phone_number/ru_RU/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/phone_number/ru_RU/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from .. import Provider as PhoneNumberProvider
class Provider(PhoneNumberProvider):
formats = (
'+7 ### ### ####',
'+7 ### ### ## ##',
'+7 (###) ###-##-##',
'+7 (###) ###-####'
)
| 22.666667 | 47 | 0.433824 |
d5b4d3c779651685397b2a9337205a3bc707cb25 | 5,036 | py | Python | Manga_Scraper.py | nghinton/Manga_Scraper | ea65933dc6395420cd76fb3560ef96ca1c2fce72 | [
"MIT"
] | null | null | null | Manga_Scraper.py | nghinton/Manga_Scraper | ea65933dc6395420cd76fb3560ef96ca1c2fce72 | [
"MIT"
] | null | null | null | Manga_Scraper.py | nghinton/Manga_Scraper | ea65933dc6395420cd76fb3560ef96ca1c2fce72 | [
"MIT"
] | null | null | null | import requests
import os
from tqdm import tqdm
from bs4 import BeautifulSoup as bs
from urllib.parse import urljoin, urlparse
def is_valid(url):
"""
Checks whether `url` is a valid URL.
"""
parsed = urlparse(url)
return bool(parsed.netloc) and bool(parsed.scheme)
def get_all_chapters(url):
... | 28.942529 | 128 | 0.611994 |
d5b4f2c2c6d8e289ea4d6fbf2c298395a4147019 | 536 | py | Python | service/trigger.py | MatthieuBlais/freeldep | 092de3c603a28b9d12e9ad93d6c0cca773469c9f | [
"Apache-2.0"
] | null | null | null | service/trigger.py | MatthieuBlais/freeldep | 092de3c603a28b9d12e9ad93d6c0cca773469c9f | [
"Apache-2.0"
] | null | null | null | service/trigger.py | MatthieuBlais/freeldep | 092de3c603a28b9d12e9ad93d6c0cca773469c9f | [
"Apache-2.0"
] | null | null | null | import json
import os
import boto3
codebuild = boto3.client("codebuild")
def handler(event, context):
print(json.dumps(event))
codebuild.start_build(
projectName=os.environ["PROJECT_NAME"],
sourceTypeOverride="CODECOMMIT",
sourceLocationOverride=(
f"https://git-codecomm... | 21.44 | 79 | 0.636194 |
d5b4f4cd50645f1aace564e1472e436af81fb300 | 836 | py | Python | services/web/server/src/simcore_service_webserver/sockets_handlers.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | services/web/server/src/simcore_service_webserver/sockets_handlers.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | 2 | 2018-05-13T09:10:57.000Z | 2019-03-06T08:10:40.000Z | services/web/server/src/simcore_service_webserver/sockets_handlers.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | """ Defines **async** handlers for socket.io server
SEE https://pypi.python.org/pypi/python-socketio
SEE http://python-socketio.readthedocs.io/en/latest/
"""
# pylint: disable=C0111
# pylint: disable=W0703
import logging
import socketio
# TODO: this is the only config that is not part of the schema
# At fir... | 24.588235 | 65 | 0.726077 |
d5b4f588d3974dc370e459d0e75509a9d4b27a39 | 1,316 | py | Python | supplier/tests/test_models.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | 1 | 2021-11-06T12:08:26.000Z | 2021-11-06T12:08:26.000Z | supplier/tests/test_models.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | supplier/tests/test_models.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | import pytest
from directory_constants import user_roles
from django_extensions.db.fields import (
ModificationDateTimeField, CreationDateTimeField
)
from supplier.models import Supplier
from supplier.tests import VALID_REQUEST_DATA
@pytest.mark.django_db
def test_supplier_model_str():
supplier = Supplier(*... | 29.244444 | 71 | 0.796353 |
d5b506a094ac6a33227e18d107a861e5c27695f8 | 1,493 | py | Python | gopatch/repos/serializers.py | porala/python | 41213189a9b35b5b8c40c048f4d6cd3f8e5f25f4 | [
"DOC"
] | 1 | 2020-01-15T11:04:16.000Z | 2020-01-15T11:04:16.000Z | gopatch/repos/serializers.py | porala/python | 41213189a9b35b5b8c40c048f4d6cd3f8e5f25f4 | [
"DOC"
] | 2 | 2021-03-31T19:36:19.000Z | 2021-06-10T22:29:26.000Z | gopatch/repos/serializers.py | porala/python | 41213189a9b35b5b8c40c048f4d6cd3f8e5f25f4 | [
"DOC"
] | null | null | null | # Copyright 2016 Marcus Furlong <furlongm@gmail.com>
#
# This file is part of Patchman.
#
# Patchman is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 only.
#
# Patchman is distributed in the hope that... | 34.72093 | 74 | 0.70998 |
d5b51cc780f9fcd376693fd121e8dfe436ba4db5 | 11,881 | py | Python | tests/dirty_validators/tests_ctx.py | alfred82santa/dirty-validators | 2dd0cdb0da5bc166478667639f0f15c2902b5823 | [
"MIT"
] | 1 | 2017-04-29T17:22:16.000Z | 2017-04-29T17:22:16.000Z | tests/dirty_validators/tests_ctx.py | alfred82santa/dirty-validators | 2dd0cdb0da5bc166478667639f0f15c2902b5823 | [
"MIT"
] | 8 | 2017-03-27T12:37:49.000Z | 2020-03-31T11:04:49.000Z | tests/dirty_validators/tests_ctx.py | alfred82santa/dirty-validators | 2dd0cdb0da5bc166478667639f0f15c2902b5823 | [
"MIT"
] | null | null | null | from unittest import TestCase
from dirty_models import ArrayField, BaseModel, ModelField, StringField
from dirty_validators.ctx import Context
from .tests_complex import FakeModelInner
class FakeListModel(BaseModel):
fieldName1 = StringField()
fieldList1 = ArrayField(field_type=ModelField(model_class=FakeM... | 39.082237 | 110 | 0.518727 |
d5b53b4fdf70b9e0a89fecd9f67b4b35ab9a978c | 87 | py | Python | gipsy_toolbar/models.py | marwahaha/gipsy_toolbar | d680fa19e1db11cc740ecff1926534d54e9d779c | [
"BSD-3-Clause"
] | null | null | null | gipsy_toolbar/models.py | marwahaha/gipsy_toolbar | d680fa19e1db11cc740ecff1926534d54e9d779c | [
"BSD-3-Clause"
] | null | null | null | gipsy_toolbar/models.py | marwahaha/gipsy_toolbar | d680fa19e1db11cc740ecff1926534d54e9d779c | [
"BSD-3-Clause"
] | 1 | 2019-07-16T03:44:58.000Z | 2019-07-16T03:44:58.000Z | from gipsy_tools.models import GipsyMenu
class GipsyToolbarMenu(GipsyMenu):
pass
| 14.5 | 40 | 0.804598 |
d5b59d846271ec091acef5f8903702ba31bc67b7 | 9,031 | py | Python | salt/returners/postgres_local_cache.py | jbq/pkg-salt | b6742e03cbbfb82f4ce7db2e21a3ff31b270cdb3 | [
"Apache-2.0"
] | 1 | 2020-09-16T21:31:02.000Z | 2020-09-16T21:31:02.000Z | salt/returners/postgres_local_cache.py | jbq/pkg-salt | b6742e03cbbfb82f4ce7db2e21a3ff31b270cdb3 | [
"Apache-2.0"
] | null | null | null | salt/returners/postgres_local_cache.py | jbq/pkg-salt | b6742e03cbbfb82f4ce7db2e21a3ff31b270cdb3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Use a postgresql server for the master job cache. This helps the job cache to
cope with scale.
:maintainer: gjredelinghuys@gmail.com
:maturity: New
:depends: psycopg2
:platform: all
To enable this returner the minion will need the psycopg2 installed and
the following val... | 25.086111 | 80 | 0.592958 |
d5b5ad1af1809317712ab0f8a8d3aa8682c86cfd | 305 | py | Python | graphic_templates/stacked_column_chart/graphic_config.py | brmayes/dailygraphics-kit | ec3e4283a764b1bb519fbea67d330684100f9a70 | [
"MIT"
] | 1 | 2019-07-08T01:13:16.000Z | 2019-07-08T01:13:16.000Z | graphic_templates/stacked_column_chart/graphic_config.py | stiles/dailygraphics | 9bd125b29fdd396636937eafbd7541e86ef4e8a2 | [
"MIT"
] | 1 | 2020-07-27T01:20:51.000Z | 2020-07-27T01:20:51.000Z | graphic_templates/stacked_column_chart/graphic_config.py | stiles/dailygraphics | 9bd125b29fdd396636937eafbd7541e86ef4e8a2 | [
"MIT"
] | 1 | 2020-07-26T01:25:04.000Z | 2020-07-26T01:25:04.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1v6cL_-0Fh2rpOxLIsv8kWq4GITnr5ihBgFO2OZ3lbJE'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.816393 |
d5b5e747d9befd15f3fc82975bff7c97682b20ab | 4,189 | py | Python | nixui/graphics/main_window.py | yater/nix-gui | e7d1137ff85ef6bfe33ccc7cd8eee944475d4217 | [
"MIT"
] | null | null | null | nixui/graphics/main_window.py | yater/nix-gui | e7d1137ff85ef6bfe33ccc7cd8eee944475d4217 | [
"MIT"
] | null | null | null | nixui/graphics/main_window.py | yater/nix-gui | e7d1137ff85ef6bfe33ccc7cd8eee944475d4217 | [
"MIT"
] | null | null | null | import os
from PyQt5 import QtWidgets, QtCore, QtGui
from nixui.graphics import nav_interface, icon, diff_widget
class NixGuiMainWindow(QtWidgets.QMainWindow):
def __init__(self, statemodel, parent=None):
super().__init__(parent)
self.statemodel = statemodel
config_path = os.environ['C... | 43.635417 | 125 | 0.695393 |
d5b5ff3b1369433211e99571d39fc9ef6f2184e6 | 3,027 | py | Python | CV_adv/dataset/mit67.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | 4 | 2022-03-14T06:11:19.000Z | 2022-03-16T09:21:59.000Z | CV_backdoor/clean_dataset/mit67.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | null | null | null | CV_backdoor/clean_dataset/mit67.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | 2 | 2022-03-14T22:58:24.000Z | 2022-03-16T05:29:37.000Z | import torch.utils.data as data
from PIL import Image
import glob
import time
import numpy as np
import random
import os
from pdb import set_trace as st
class MIT67Data(data.Dataset):
def __init__(self, root, is_train=False, transform=None, shots=-1, seed=0, preload=False):
self.num_classes = 67
s... | 33.633333 | 94 | 0.540799 |
d5b60947c9395ab2d3d8d926d08d3769dda4b166 | 7,705 | py | Python | sdirl/rl/simulator.py | akangasr/sdirl | b8b2bf34fea1b1f0c2f9961a9ad9c1ad34396f5b | [
"MIT"
] | null | null | null | sdirl/rl/simulator.py | akangasr/sdirl | b8b2bf34fea1b1f0c2f9961a9ad9c1ad34396f5b | [
"MIT"
] | null | null | null | sdirl/rl/simulator.py | akangasr/sdirl | b8b2bf34fea1b1f0c2f9961a9ad9c1ad34396f5b | [
"MIT"
] | null | null | null | import numpy as np
from pybrain.rl.agents import LearningAgent
from pybrain.rl.experiments import EpisodicExperiment
from sdirl.rl.pybrain_extensions import SparseActionValueTable, EpisodeQ, EGreedyExplorer
import logging
logger = logging.getLogger(__name__)
"""An implementation of the Menu search model used in Kan... | 34.55157 | 117 | 0.602985 |
d5b60a3209bb31694b8940d6454856219368e5c0 | 2,403 | py | Python | tests/tests.py | jmptbl/puka | bc6e845c8a5f4319ffc54cc71959c56a8893edaf | [
"MIT"
] | 81 | 2015-01-22T10:09:37.000Z | 2022-01-25T04:38:29.000Z | tests/tests.py | jmptbl/puka | bc6e845c8a5f4319ffc54cc71959c56a8893edaf | [
"MIT"
] | 17 | 2015-05-13T01:51:53.000Z | 2021-03-05T04:01:39.000Z | tests/tests.py | jmptbl/puka | bc6e845c8a5f4319ffc54cc71959c56a8893edaf | [
"MIT"
] | 25 | 2015-02-12T14:02:41.000Z | 2020-05-15T14:08:43.000Z | #!/usr/bin/env python
from __future__ import print_function
import sys
import glob
import time
import os, os.path
import doctest
import unittest
try:
import coverage
except ImportError:
print("No 'coverage' module found. Try:")
print(" sudo apt-get install python-coverage")
sys.exit(1)
import logg... | 26.406593 | 96 | 0.617561 |
d5b638d21aa0ce0fa1a1c6a598b6d563408d2eb9 | 3,403 | py | Python | experiments/murtaza/ros/sawyer_sim/sawyer_torque_tdm_ddpg.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/murtaza/ros/sawyer_sim/sawyer_torque_tdm_ddpg.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/murtaza/ros/sawyer_sim/sawyer_torque_tdm_ddpg.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | from rlkit.data_management.her_replay_buffer import HerReplayBuffer
from rlkit.envs.multitask.sawyer_env_v2 import MultiTaskSawyerXYZReachingEnv
from rlkit.exploration_strategies.base import (
PolicyWrappedWithExplorationStrategy
)
from rlkit.exploration_strategies.ou_strategy import OUStrategy
from rlkit.launchers... | 29.336207 | 77 | 0.605054 |
d5b643631a7d74fe2a4ebbd38894d8c71d6ff5ac | 2,516 | py | Python | run_time/src/gae_server/third_party/old-fonttools-master/setup.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | 2 | 2019-05-24T18:19:18.000Z | 2020-09-17T10:23:13.000Z | run_time/src/gae_server/third_party/old-fonttools-master/setup.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | null | null | null | run_time/src/gae_server/third_party/old-fonttools-master/setup.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
from __future__ import print_function
import os, sys
from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext
try:
# load py2exe distutils extension, if available
import py2exe
except ImportError:
pass
try:
import xml.parsers.expat
except ImportError:
... | 28.590909 | 86 | 0.695548 |
d5b64e388d0e61c8f712b28d975a9d331f877cc3 | 1,486 | py | Python | server/routes/alarms/__tests__/test_daily_brief.py | MrCreeper1008/covid19-alarm | 2f07a602c60bafacab3aa977a22d11fc1d07b878 | [
"MIT"
] | 1 | 2021-11-30T11:03:36.000Z | 2021-11-30T11:03:36.000Z | server/routes/alarms/__tests__/test_daily_brief.py | kennethnym/covid19-alarm | 2f07a602c60bafacab3aa977a22d11fc1d07b878 | [
"MIT"
] | null | null | null | server/routes/alarms/__tests__/test_daily_brief.py | kennethnym/covid19-alarm | 2f07a602c60bafacab3aa977a22d11fc1d07b878 | [
"MIT"
] | null | null | null | import logging
from pytest_mock import mock, MockerFixture
from server.routes.alarms.daily_brief import (
__speech_engine,
__covid_brief,
__weather_brief,
__news_brief,
daily_brief,
)
__MOCK_NOW_TIME = "now"
__MOCK_ALARM_ALL_ENABLED = {
"title": "test alarm",
"include_news": True,
"in... | 24.766667 | 87 | 0.678331 |
d5b662f1d573caf98f54129c31bb5813c4a5bf2f | 5,246 | py | Python | google-cloud-sdk/.install/.backup/lib/third_party/dns/rdatatype.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/third_party/dns/rdatatype.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/third_party/dns/rdatatype.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | 21.949791 | 76 | 0.615517 |
d5b69a24cd27f3c317ef8a8692a98db669d42c95 | 1,965 | py | Python | datacube/index/fields.py | Kirill888/datacube-core | 996b395e15f975decb77c0ca9fa0555177674b2f | [
"Apache-2.0"
] | 2 | 2019-10-24T15:29:54.000Z | 2019-10-24T15:29:58.000Z | datacube/index/fields.py | Kirill888/datacube-core | 996b395e15f975decb77c0ca9fa0555177674b2f | [
"Apache-2.0"
] | 2 | 2021-03-26T00:37:36.000Z | 2021-03-31T20:05:01.000Z | datacube/index/fields.py | Kirill888/datacube-core | 996b395e15f975decb77c0ca9fa0555177674b2f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
Common datatypes for DB drivers.
"""
from datetime import date, datetime, time
from dateutil.tz import tz
from typing import List
from datacube.model import Range
from datacube.model.fields import Expression, Field
__all__ = ['Field',
'Expression',
'OrExpression',
... | 28.478261 | 84 | 0.652926 |
d5b70237f87e2c0451a96b66bad7ca3b3b1e48b9 | 14,879 | py | Python | pni_customization/pni_customization/doctype/pni_packing/pni_packing.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/pni_packing/pni_packing.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/pni_packing/pni_packing.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Jigar Tarpara and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import get_datetime, time_diff_in_hours
from frappe.utils import add_days, to... | 41.10221 | 166 | 0.614625 |
d5b7069e2288050cd02f11fc757870accb7bd15d | 2,911 | py | Python | egs/Tacotron2_x-vectors/English_multispeaker_expressive/hparams.py | ajinkyakulkarni14/ERISHA | 2135ed05845ca097f616dc4548fb1a33c6fe9ad2 | [
"BSD-3-Clause"
] | 42 | 2020-11-15T13:46:24.000Z | 2021-08-16T11:04:17.000Z | egs/Tacotron2_x-vectors/English_multispeaker_expressive/hparams.py | ajinkyakulkarni14/ERISHA | 2135ed05845ca097f616dc4548fb1a33c6fe9ad2 | [
"BSD-3-Clause"
] | 3 | 2021-02-24T03:08:31.000Z | 2021-11-05T04:15:53.000Z | egs/Tacotron2_x-vectors/English_multispeaker_expressive/hparams.py | ajinkyakulkarni14/ERISHA | 2135ed05845ca097f616dc4548fb1a33c6fe9ad2 | [
"BSD-3-Clause"
] | 18 | 2020-11-16T11:07:11.000Z | 2022-02-11T01:25:24.000Z | # from https://github.com/NVIDIA/tacotron2
# Modified by Ajinkya Kulkarni
from text import symbols
################################
# Global Parameters#
################################
language = 'English'
################################
# Experiment Parameters#
################################
epochs=500
iters_per... | 20.356643 | 79 | 0.668842 |
d5b71df68bc8af58d0ad7f4c79cc9d164b3dbcf3 | 6,006 | py | Python | tests/test_adjoint.py | BrunoMot/devito | b6e077857765b7b5fad812ec5774635ca4c6fbb7 | [
"MIT"
] | 1 | 2020-01-30T17:49:12.000Z | 2020-01-30T17:49:12.000Z | tests/test_adjoint.py | BrunoMot/devito | b6e077857765b7b5fad812ec5774635ca4c6fbb7 | [
"MIT"
] | 1 | 2019-11-06T18:01:25.000Z | 2019-11-06T18:01:25.000Z | tests/test_adjoint.py | BrunoMot/devito | b6e077857765b7b5fad812ec5774635ca4c6fbb7 | [
"MIT"
] | 2 | 2018-11-15T12:03:48.000Z | 2018-11-15T13:16:19.000Z | import numpy as np
import pytest
from numpy import linalg
from conftest import unit_box, points, skipif
from devito import Operator
from devito.logger import info
from examples.seismic import demo_model, Receiver
from examples.seismic.acoustic import acoustic_setup
pytestmark = skipif(['yask', 'ops'])
presets = {
... | 43.208633 | 89 | 0.564436 |
d5b74eaf6bf11bf7f4d1bda445b496e4f6d296fa | 11,999 | py | Python | salt/client/ssh/shell.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | salt/client/ssh/shell.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | salt/client/ssh/shell.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 1 | 2017-01-27T21:33:36.000Z | 2017-01-27T21:33:36.000Z | # -*- coding: utf-8 -*-
'''
Manage transport commands via ssh
'''
from __future__ import absolute_import
# Import python libs
import re
import os
import json
import time
import logging
import subprocess
# Import salt libs
import salt.defaults.exitcodes
import salt.utils
import salt.utils.nb_popen
import salt.utils.vt... | 32.168901 | 90 | 0.509876 |
d5b772f32a023b71d38cb5f4c2c13ed0c418d972 | 3,312 | py | Python | tests/custom_mappers_mock_tests.py | Morphotech/vdx-helper-python | 3116ad05bd9b947e0ba77988c22776507e441cea | [
"MIT"
] | null | null | null | tests/custom_mappers_mock_tests.py | Morphotech/vdx-helper-python | 3116ad05bd9b947e0ba77988c22776507e441cea | [
"MIT"
] | null | null | null | tests/custom_mappers_mock_tests.py | Morphotech/vdx-helper-python | 3116ad05bd9b947e0ba77988c22776507e441cea | [
"MIT"
] | null | null | null | from datetime import datetime
from uuid import UUID
from vdx_helper.domain import VerificationStatus, StepStatus, JobStatus
from vdx_helper.mappers import file_mapper, credential_mapper, partner_mapper
from vdx_helper.models import Credential, Job, VerificationResponse, VerificationStepResult, Certificate, \
Claim... | 41.924051 | 116 | 0.694746 |
d5b7947ef4d291d88dc17eea4b183bfe07e88b67 | 9,413 | py | Python | salt/states/trafficserver.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/states/trafficserver.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/states/trafficserver.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: Beryllium
'''
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
return 'trafficserver' if 'trafficserver.set_var' in __salt__ else False
def bounce_clust... | 23.951654 | 79 | 0.587485 |
d5b79653900faefb0e730e831133217bdcd543f9 | 18,780 | py | Python | sapp/pipeline/pysa_taint_parser.py | facebook/sapp | 4b85d10a791d8e9c8ae83d1f62fbded24845f053 | [
"MIT"
] | 74 | 2020-12-18T20:04:30.000Z | 2022-03-22T22:26:02.000Z | sapp/pipeline/pysa_taint_parser.py | facebook/sapp | 4b85d10a791d8e9c8ae83d1f62fbded24845f053 | [
"MIT"
] | 61 | 2020-12-21T21:33:05.000Z | 2022-01-27T21:22:20.000Z | sapp/pipeline/pysa_taint_parser.py | facebook/sapp | 4b85d10a791d8e9c8ae83d1f62fbded24845f053 | [
"MIT"
] | 20 | 2021-04-08T01:28:53.000Z | 2022-03-22T22:26:05.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Parse Pysa/Taint output for Zoncolan processing"""
import logging
import sys
from collections import defaultdict
from typing import (
... | 36.823529 | 88 | 0.557668 |
d5b798e01a448cd840e8c96d3a3f6b7eba93abb0 | 97 | py | Python | model/trainer/__init__.py | elviva404/food-detection-yolov5 | 796a0c1df6e9c9a705dff7782b3f9b213344f11b | [
"MIT"
] | 24 | 2021-08-09T00:47:22.000Z | 2022-03-06T09:38:48.000Z | model/trainer/__init__.py | elviva404/food-detection-yolov5 | 796a0c1df6e9c9a705dff7782b3f9b213344f11b | [
"MIT"
] | 3 | 2021-07-19T16:01:37.000Z | 2022-03-03T07:09:03.000Z | model/trainer/__init__.py | elviva404/food-detection-yolov5 | 796a0c1df6e9c9a705dff7782b3f9b213344f11b | [
"MIT"
] | 8 | 2021-11-08T12:39:05.000Z | 2022-01-30T14:59:37.000Z | from .checkpoint import Checkpoint, load_checkpoint, get_epoch_iters, get_config, get_class_names | 97 | 97 | 0.876289 |
d5b7bfcbeffe4e224c6451937851baba4e2a6172 | 134 | py | Python | math_and_algorithm/012.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | math_and_algorithm/012.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | math_and_algorithm/012.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import math
N = int(input())
for i in range(2, int(math.sqrt(N))):
if N % i == 0:
print("No")
exit()
print("Yes") | 16.75 | 37 | 0.5 |
d5b7c5abfd2648e7a23a93feac46d8e6338bdbd6 | 10,594 | py | Python | src/falconpy/api_complete.py | mccbryan3/falconpy | ec4d3a574f2e9b06d046fc8d7ca6818f1f97331f | [
"Unlicense"
] | null | null | null | src/falconpy/api_complete.py | mccbryan3/falconpy | ec4d3a574f2e9b06d046fc8d7ca6818f1f97331f | [
"Unlicense"
] | null | null | null | src/falconpy/api_complete.py | mccbryan3/falconpy | ec4d3a574f2e9b06d046fc8d7ca6818f1f97331f | [
"Unlicense"
] | null | null | null | """
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | |: 1 |
|::.. ... | 46.669604 | 114 | 0.548801 |
d5b7f4c76855314c1e79d4036dbf0c3bb53dbd74 | 29,321 | py | Python | masakari/engine/utils.py | sampathP/openstack-masakari | 108d988165271b7bafd66d985ff1000537ef3183 | [
"Apache-2.0"
] | null | null | null | masakari/engine/utils.py | sampathP/openstack-masakari | 108d988165271b7bafd66d985ff1000537ef3183 | [
"Apache-2.0"
] | null | null | null | masakari/engine/utils.py | sampathP/openstack-masakari | 108d988165271b7bafd66d985ff1000537ef3183 | [
"Apache-2.0"
] | null | null | null | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright(c) 2015 Nippon Telegraph and Telephone Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... | 38.938911 | 84 | 0.587156 |
d5b7f7fb27955ce9b7523a83d454a0933c8a1b9a | 6,922 | py | Python | bundle/sagemaker_rl_agent/lib/python3.6/site-packages/markov/log_handler/constants.py | larsll/deepracer-simapp | 9251c32ff33d49955b63ccca4f38d01a0c721d4f | [
"MIT"
] | 3 | 2021-07-25T15:10:35.000Z | 2021-10-30T02:35:33.000Z | bundle/sagemaker_rl_agent/lib/python3.6/site-packages/markov/log_handler/constants.py | larsll/deepracer-simapp | 9251c32ff33d49955b63ccca4f38d01a0c721d4f | [
"MIT"
] | null | null | null | bundle/sagemaker_rl_agent/lib/python3.6/site-packages/markov/log_handler/constants.py | larsll/deepracer-simapp | 9251c32ff33d49955b63ccca4f38d01a0c721d4f | [
"MIT"
] | 3 | 2021-07-25T15:16:06.000Z | 2022-03-28T14:13:22.000Z | '''This module houses the constants for the log_handler package'''
# Names of the exceptions, errors generated
SIMAPP_SIMULATION_WORKER_EXCEPTION = "simulation_worker.exceptions"
SIMAPP_TRAINING_WORKER_EXCEPTION = "training_worker.exceptions"
SIMAPP_VALIDATION_WORKER_EXCEPTION = "validation_worker.exceptions"
SIMAPP_S... | 45.539474 | 89 | 0.740682 |
d5b80ddf8065e3b725401294aa3ab7c0c2e0ccac | 7,959 | py | Python | ngraph/frontends/cntk/cntk_importer/importer.py | NervanaSystems/ngraph-python | ac032c83c7152b615a9ad129d54d350f9d6a2986 | [
"Apache-2.0"
] | 18 | 2018-03-19T04:16:49.000Z | 2021-02-08T14:44:58.000Z | ngraph/frontends/cntk/cntk_importer/importer.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 2 | 2019-04-16T06:41:49.000Z | 2019-05-06T14:08:13.000Z | ngraph/frontends/cntk/cntk_importer/importer.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 11 | 2018-06-16T15:59:08.000Z | 2021-03-06T00:45:30.000Z | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# 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.apa... | 33.1625 | 93 | 0.581606 |
d5b8109261e534635d40ac52e2e866ade3b3364b | 10,911 | py | Python | Stock/Trade/Strategy/Cta/DyST_AbnormalVolatility.py | MicroEngine/DevilYuan | e7f8ec10ec2f30c72ce23bdc4dc084b07f7ec1c6 | [
"MIT"
] | 135 | 2020-10-23T01:15:39.000Z | 2022-03-29T08:39:15.000Z | Stock/Trade/Strategy/Cta/DyST_AbnormalVolatility.py | bg4xsd/DevilYuan | e7f8ec10ec2f30c72ce23bdc4dc084b07f7ec1c6 | [
"MIT"
] | null | null | null | Stock/Trade/Strategy/Cta/DyST_AbnormalVolatility.py | bg4xsd/DevilYuan | e7f8ec10ec2f30c72ce23bdc4dc084b07f7ec1c6 | [
"MIT"
] | 64 | 2020-10-23T01:15:49.000Z | 2022-03-20T10:15:59.000Z | from ..DyStockCtaTemplate import *
from ....Data.Utility.DyStockDataUtility import *
class DyST_AbnormalVolatility(DyStockCtaTemplate):
name = 'DyST_AbnormalVolatility'
chName = '异常波动'
backTestingMode = 'bar1d'
broker = 'simu1'
#------------ 策略prepare参数 ------------
feedNDays = 80 # 需要向前准备的天... | 30.224377 | 138 | 0.549904 |
d5b812958d65c72be9c1d84dc935f744b85344dd | 370 | py | Python | DSA/insert_sort.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | 1 | 2015-04-23T11:43:26.000Z | 2015-04-23T11:43:26.000Z | DSA/insert_sort.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | DSA/insert_sort.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | def insert_sort(array):
'''
Implementation of insertion sort
The array will be sorted ascendingly
'''
count = len(array)
for i in range(1, count):
key = array[i]
j = i - 1
while j >= 0:
if array[j] > key:
array[j+1] = array[j]
a... | 23.125 | 40 | 0.47027 |
d5b862705ae204f97a07ca56a5ef932b34bea9aa | 407 | py | Python | ndn_hydra/repo/main/__init__.py | UCLA-IRL/ndn-hydra | e01829253876ff6dbfd6dfaa92142eca08cd6705 | [
"Apache-2.0"
] | 2 | 2021-04-14T04:12:14.000Z | 2021-04-23T02:28:49.000Z | ndn_hydra/repo/main/__init__.py | ZixuanZhong/hydra | e01829253876ff6dbfd6dfaa92142eca08cd6705 | [
"Apache-2.0"
] | 10 | 2021-07-03T18:29:26.000Z | 2022-02-01T04:11:20.000Z | ndn_hydra/repo/main/__init__.py | ZixuanZhong/ndn-distributed-repo | e01829253876ff6dbfd6dfaa92142eca08cd6705 | [
"Apache-2.0"
] | null | null | null | # ----------------------------------------------------------
# @Project: NDN Hydra
# @Date: 2021-01-25
# @Authors: Please check AUTHORS.rst
# @Source-Code: https://github.com/UCLA-IRL/ndn-hydra
# @Documentation: https://ndn-hydra.readthedocs.io/
# @Pip-Library: https://pypi.org/project/ndn-hydra/
# ------... | 40.7 | 61 | 0.484029 |
d5b889db2a1526f439f58d2ba748604ffc00a9d2 | 3,684 | py | Python | netl3d/hardware/l3dcube/__init__.py | stewartadam/netl3d | a222b7fd65d61a3b8393409a8fe6888d55d949ce | [
"MIT"
] | 3 | 2016-12-09T07:30:26.000Z | 2021-04-18T13:50:11.000Z | netl3d/hardware/l3dcube/__init__.py | stewartadam/netl3d | a222b7fd65d61a3b8393409a8fe6888d55d949ce | [
"MIT"
] | null | null | null | netl3d/hardware/l3dcube/__init__.py | stewartadam/netl3d | a222b7fd65d61a3b8393409a8fe6888d55d949ce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Interfaces with the Photon firmware to control a L3D cube over the network. L3D
cube hardware indexes at the start far back, bottom right corner and count
upward, wrapping to the right, then forward.
"""
import binascii
import math
import socket
import netl3d
from . import shapes
from .fram... | 31.487179 | 84 | 0.679696 |
d5b89104243fdff5cc460587d49d9840fd622a38 | 694 | py | Python | BuildingDepot-v3.2.8/buildingdepot/CentralService/__init__.py | Entromorgan/GIoTTo | 53ba7519c56d46af1e32a77aab5cf1c5cd8143fc | [
"MIT"
] | null | null | null | BuildingDepot-v3.2.8/buildingdepot/CentralService/__init__.py | Entromorgan/GIoTTo | 53ba7519c56d46af1e32a77aab5cf1c5cd8143fc | [
"MIT"
] | null | null | null | BuildingDepot-v3.2.8/buildingdepot/CentralService/__init__.py | Entromorgan/GIoTTo | 53ba7519c56d46af1e32a77aab5cf1c5cd8143fc | [
"MIT"
] | null | null | null | """
CentralService
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Initializes the flask app using the configuration specified in the
config file or falls back to the default one.
@copyright: (c) 2016 SynergyLabs
@license: UCSD License. See License file for details.
"""
import os
from app import create_app
from app.models.cs_models i... | 23.133333 | 68 | 0.742075 |
d5b8b99c5c404cb1bda12b8827a0bd31c6736eb2 | 5,058 | py | Python | sf6/PawleySF6.py | marshallmcdonnell/ase-scripts | 2de692304fed32b7132275b5a51c307b5797fc55 | [
"MIT"
] | null | null | null | sf6/PawleySF6.py | marshallmcdonnell/ase-scripts | 2de692304fed32b7132275b5a51c307b5797fc55 | [
"MIT"
] | null | null | null | sf6/PawleySF6.py | marshallmcdonnell/ase-scripts | 2de692304fed32b7132275b5a51c307b5797fc55 | [
"MIT"
] | null | null | null | """Pawley SF6 molecule model"""
from __future__ import print_function
from ase import Atoms, units
from ase.constraints import FixInternals
from ase.visualize import view
# Create SF6 molecule via Pawley model (G. Pawley, Mol. Phys. 43 (1981) 1321.)
class PawleySF6(object):
def __init__(self, sfbond_distance=... | 33.72 | 96 | 0.579478 |
d5b8e5cb87738f6062233090a0a532117187d285 | 10,893 | py | Python | pyADVISE/Visualize/Maps.py | lightnerdevtech/pyADVISE | 7496729b57a777c5ac73d1ac08589b9794a77955 | [
"Apache-2.0"
] | null | null | null | pyADVISE/Visualize/Maps.py | lightnerdevtech/pyADVISE | 7496729b57a777c5ac73d1ac08589b9794a77955 | [
"Apache-2.0"
] | null | null | null | pyADVISE/Visualize/Maps.py | lightnerdevtech/pyADVISE | 7496729b57a777c5ac73d1ac08589b9794a77955 | [
"Apache-2.0"
] | null | null | null | # import packages
import os
import pandas as pd
import numpy as np
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.simplefilter(action='ignore', category=UserWarning)
from bokeh.models import ColumnDataSource, Div, HoverTool, LabelSet, Label, Legend, LegendItem
from bokeh.plotti... | 31.850877 | 144 | 0.579363 |
d5b8f3393fc0b039f7bc4768cafd229b4465103c | 7,302 | py | Python | tests/unit2/test_drawing_primitives.py | mewbak/arcade | 7111d491ed875039015c45bcd37ca6076dd19ed8 | [
"MIT"
] | 1 | 2020-01-18T04:48:38.000Z | 2020-01-18T04:48:38.000Z | tests/unit2/test_drawing_primitives.py | biggzlar/arcade | fc444db356452660ac6cb2ffe241f0b1a3d4bcf3 | [
"MIT"
] | null | null | null | tests/unit2/test_drawing_primitives.py | biggzlar/arcade | fc444db356452660ac6cb2ffe241f0b1a3d4bcf3 | [
"MIT"
] | null | null | null | import arcade
import os
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
class MyGame(arcade.Window):
""" Main application class. """
def __init__(self, width, height):
"""
Initializer
"""
super().__init__(width, height)
# Set the working directory (where we expect to find fil... | 39.684783 | 95 | 0.55478 |
d5b9096a42e2ca8daac90ccc80a4c1e182261763 | 533 | py | Python | app/helpers/imagesource.py | fressive/qute-backend | 09697e56ad44619cf29c2b4168031d4ba8ef7644 | [
"MIT"
] | null | null | null | app/helpers/imagesource.py | fressive/qute-backend | 09697e56ad44619cf29c2b4168031d4ba8ef7644 | [
"MIT"
] | null | null | null | app/helpers/imagesource.py | fressive/qute-backend | 09697e56ad44619cf29c2b4168031d4ba8ef7644 | [
"MIT"
] | null | null | null | import config
import requests
from pixivpy3 import ByPassSniApi
RECOMMENDED = 0
KONACHAN = 1
YANDERE = 2
DANBOORU = 3
PIXIV = 4
pixivApi = ByPassSniApi()
pixivApi.require_appapi_hosts()
def login():
if config.pixiv_login_mode == 0:
pixivApi.auth(refresh_token=config.pixiv_refresh_token)
else:
... | 23.173913 | 89 | 0.750469 |
d5b90a55088b116513f109417eb5d502fe2810eb | 1,056 | py | Python | source/smaller_element_array/smaller_element.py | adrinamin/algorithm_exercises | 8a3c61afe4672aabaeb7a311ea9948165d9d6b10 | [
"MIT"
] | null | null | null | source/smaller_element_array/smaller_element.py | adrinamin/algorithm_exercises | 8a3c61afe4672aabaeb7a311ea9948165d9d6b10 | [
"MIT"
] | null | null | null | source/smaller_element_array/smaller_element.py | adrinamin/algorithm_exercises | 8a3c61afe4672aabaeb7a311ea9948165d9d6b10 | [
"MIT"
] | null | null | null | """ smaller_element.py module which returns a new array
where each element in the new array is then number
of smaller elements to the right of that element
in the original input array.
Usage:
python3 smaller_element.py <input_array>
"""
import sys
def get_smaller_element_array(input_array:list):
result ... | 24.55814 | 61 | 0.651515 |
d5b91a8fcd133bdeb1fdfdf57e3b9063a451b989 | 2,395 | py | Python | solidity/python/loanplanformula.py | dabdevelop/qtum-hackathon | 77333bbed06c42e0ddec778f0514425553646b07 | [
"Apache-2.0"
] | 2 | 2018-08-11T16:03:49.000Z | 2018-08-15T12:56:35.000Z | solidity/python/loanplanformula.py | DAB-Team/contracts | ae58f66cff7af90cea188b321b2a9616091674c1 | [
"Apache-2.0"
] | null | null | null | solidity/python/loanplanformula.py | DAB-Team/contracts | ae58f66cff7af90cea188b321b2a9616091674c1 | [
"Apache-2.0"
] | null | null | null | import cmath
import solidity.python.solmath as math
def sigmoid(a, b, l, d, x):
return 1/(1+cmath.exp((x-l)/d))*a+b
def _sigmoid(a, b, l, d, x):
assert a > 0
assert b >= 0
assert l >= 0
assert d > 0
if x > l:
rate = math.div(math.safeSub(x, l), d)
if rate < 0x1e00000000:
... | 30.705128 | 194 | 0.568685 |
d5b923e32d1b38940c8974871bf15d00ba630271 | 3,792 | py | Python | tests/test_base_seq.py | stjordanis/datar | 4e2b5db026ad35918954576badef9951928c0cb1 | [
"MIT"
] | 110 | 2021-03-09T04:10:40.000Z | 2022-03-13T10:28:20.000Z | tests/test_base_seq.py | sthagen/datar | 1218a549e2f0547c7b5a824ca6d9adf1bf96ba46 | [
"MIT"
] | 54 | 2021-06-20T18:53:44.000Z | 2022-03-29T22:13:07.000Z | tests/test_base_seq.py | sthagen/datar | 1218a549e2f0547c7b5a824ca6d9adf1bf96ba46 | [
"MIT"
] | 11 | 2021-06-18T03:03:14.000Z | 2022-02-25T11:48:26.000Z | import pytest
from datar.base.seq import *
from datar.base import NA
from .conftest import assert_iterable_equal
@pytest.mark.parametrize('from_, to, by, length_out, along_with, expect', [
(0, 1, None, 11, None, [.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1.]),
([4,2,1,9,3]*4, None, None, None, None, range(1, 21)),
(1... | 35.439252 | 91 | 0.579114 |
d5b93845d595442b849624f6327bec17e8bdff58 | 912 | py | Python | gopy/profile.py | strongSoda/data-structurea-and-algorithms | 261fa2b4c0344a1aabf83934d0ad6cee9c17787d | [
"MIT"
] | 1 | 2019-10-20T13:43:04.000Z | 2019-10-20T13:43:04.000Z | gopy/profile.py | strongSoda/data-structurea-and-algorithms | 261fa2b4c0344a1aabf83934d0ad6cee9c17787d | [
"MIT"
] | 11 | 2019-10-04T08:54:03.000Z | 2019-10-19T09:06:10.000Z | gopy/profile.py | strongSoda/gopy | 261fa2b4c0344a1aabf83934d0ad6cee9c17787d | [
"MIT"
] | null | null | null | """
### Building awesome visualizations for algorithms
Although on paper one algorithm might prove better than other but it's mostly based on nature of order of increase in
running time with respect to input size.
However, in practice an algorithm having higher runtime complexity than others may actually have a smal... | 30.4 | 133 | 0.781798 |
d5b948c64de3c543cd590686d7761e07baf1eea5 | 4,468 | py | Python | qnarre/core/utils.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/core/utils.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/core/utils.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | # Copyright 2022 Quantapix 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 applicable l... | 28.278481 | 86 | 0.560877 |
d5b99c327114ead579c0f0dd4cb34c50aa7cca46 | 1,802 | py | Python | articles/views.py | airinasha/try-django1 | a03baea6129a5e5974dedb002bdf405a0385ea55 | [
"MIT"
] | null | null | null | articles/views.py | airinasha/try-django1 | a03baea6129a5e5974dedb002bdf405a0385ea55 | [
"MIT"
] | null | null | null | articles/views.py | airinasha/try-django1 | a03baea6129a5e5974dedb002bdf405a0385ea55 | [
"MIT"
] | null | null | null | from django import forms
from django.shortcuts import render
from .models import Article
from django.contrib.auth.decorators import login_required
from .forms import ArticleForm
# Create your views here.
def article_search_view(request):
print(request.GET)
query_dict = request.GET
# query = query_dict.get('... | 29.540984 | 83 | 0.632075 |
d5ba1acc8a87ee8616a2b2026c79e0ec42e545d3 | 2,562 | py | Python | src/fastdown/weeklystandard_com.py | metaist/fastdown | 46a1d2baf0709211a106f101def5c2304423ff22 | [
"MIT"
] | null | null | null | src/fastdown/weeklystandard_com.py | metaist/fastdown | 46a1d2baf0709211a106f101def5c2304423ff22 | [
"MIT"
] | null | null | null | src/fastdown/weeklystandard_com.py | metaist/fastdown | 46a1d2baf0709211a106f101def5c2304423ff22 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding: utf-8
from os import path as osp
import copy
import re
from bs4 import BeautifulSoup
import requests
from core import BaseScraper
DEFAULT_CONFIG = {
'username': '',
'password': '',
'folder': '.'
}
class Scraper(BaseScraper):
'''Scraping engine for weeklystandard.com'''
... | 30.141176 | 77 | 0.583138 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.