hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fe17f72c7021d8205a27e05f2ecce89723852ecd | 1,289 | py | Python | qcloudsdkscaling/DescribeScheduledTaskRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkscaling/DescribeScheduledTaskRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkscaling/DescribeScheduledTaskRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class DescribeScheduledTaskRequest(Request):
def __init__(self):
super(DescribeScheduledTaskRequest, self).__init__(
'scaling', 'qcloudcliV1', 'DescribeScheduledTask', 'scaling.api.qcloud.com')
def get_limit(self):
... | 32.225 | 88 | 0.719162 |
20605e5821481f371f58f1260baf237fd327d9b5 | 5,619 | py | Python | pyram/etc/rd_hal_pure.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | pyram/etc/rd_hal_pure.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | pyram/etc/rd_hal_pure.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | import numpy as np
import struct
def load_header(brick_data, double=False):
offset = 4
if double:
nbytes = 8
dtype_float="d"
else:
nbytes = 4
dtype_float="f"
nbodies = struct.unpack("i", brick_data[4:8])[0]
offset += 12
massp = struct.unpack(dtype_float, brick_d... | 40.42446 | 115 | 0.587649 |
c34eb1b6c536dd7f28acf602ddafddfa29b163f0 | 2,758 | py | Python | MS5803.py | joachimlindborg/onion_omega | cd6e634fcf39796c790f41d09ab03139871c49a5 | [
"MIT"
] | null | null | null | MS5803.py | joachimlindborg/onion_omega | cd6e634fcf39796c790f41d09ab03139871c49a5 | [
"MIT"
] | null | null | null | MS5803.py | joachimlindborg/onion_omega | cd6e634fcf39796c790f41d09ab03139871c49a5 | [
"MIT"
] | null | null | null | # Distributed with a free-will license.
# Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
# MS5803_30BA
# This code is designed to work with the MS5803_30BA_I2CS I2C Mini Module available from ControlEverything.com.
# https://www.controleverything.com/content/Analog-Di... | 26.776699 | 114 | 0.668238 |
49ee47ce9bca2eabe80c879f6fbef5b8a68ca61d | 5,684 | py | Python | src/gt4sd/algorithms/controlled_sampling/tests/test_class_controlled_sampling.py | YoelShoshan/gt4sd-core | 9ee86fc28634b43d69542159fe06a7a5132e23ae | [
"MIT"
] | 1 | 2022-02-22T02:06:10.000Z | 2022-02-22T02:06:10.000Z | src/gt4sd/algorithms/controlled_sampling/tests/test_class_controlled_sampling.py | kwehden/gt4sd-core | ac907c1f6cfc6b0ff38b71325dd749001071c863 | [
"MIT"
] | 12 | 2022-02-21T12:59:24.000Z | 2022-02-22T12:25:49.000Z | src/gt4sd/algorithms/controlled_sampling/tests/test_class_controlled_sampling.py | C-nit/gt4sd-core | 01854438f2fdbf7f8123a322aeed5520beb1e696 | [
"MIT"
] | null | null | null | """CLaSS tests."""
import pickle
from typing import ClassVar, Type
import pytest
from gt4sd.algorithms.core import AlgorithmConfiguration
from gt4sd.algorithms.registry import ApplicationsRegistry
from gt4sd.extras import EXTRAS_ENABLED
if not EXTRAS_ENABLED:
pytest.skip("Extras from custom PyPI disabled", allo... | 28.278607 | 315 | 0.663265 |
ed02c156168253705662bbce24bf570f0bdd2f1f | 105,120 | py | Python | venv/Lib/site-packages/numpy/core/tests/test_numeric.py | unbun/snake.ai | 0c017357608dc7c06af0ca3ca57d870641461207 | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | venv/Lib/site-packages/numpy/core/tests/test_numeric.py | unbun/snake.ai | 0c017357608dc7c06af0ca3ca57d870641461207 | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | venv/Lib/site-packages/numpy/core/tests/test_numeric.py | unbun/snake.ai | 0c017357608dc7c06af0ca3ca57d870641461207 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | from __future__ import division, absolute_import, print_function
import sys
import warnings
import itertools
import platform
import pytest
from decimal import Decimal
import numpy as np
from numpy.core import umath
from numpy.random import rand, randint, randn
from numpy.testing import (
assert_, assert_equal, as... | 37.569693 | 91 | 0.533685 |
d1a0982887a670d4106c82412f101ca5cc3acaaa | 165,496 | py | Python | python/ccxt/async_support/okex.py | fyesgo/ccxt | ba75b256fcdc0ba781ecdb9ae69c293bc0fa22ef | [
"MIT"
] | 1 | 2022-01-20T10:47:10.000Z | 2022-01-20T10:47:10.000Z | python/ccxt/async_support/okex.py | fyesgo/ccxt | ba75b256fcdc0ba781ecdb9ae69c293bc0fa22ef | [
"MIT"
] | null | null | null | python/ccxt/async_support/okex.py | fyesgo/ccxt | ba75b256fcdc0ba781ecdb9ae69c293bc0fa22ef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 47.352217 | 521 | 0.471667 |
5dfebdaaaf7e259a82f58fad3b83d632806686a0 | 4,475 | py | Python | src/mixins/fixed_cone_mixin.py | cvxgrp/qcml | ff5e378cfeeebcf3f85a6e30c3449585f9af869f | [
"BSD-2-Clause-FreeBSD"
] | 26 | 2015-02-06T02:59:17.000Z | 2021-11-15T18:13:27.000Z | src/mixins/fixed_cone_mixin.py | cvxgrp/qcml | ff5e378cfeeebcf3f85a6e30c3449585f9af869f | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2015-06-14T04:43:43.000Z | 2019-10-27T11:03:30.000Z | src/mixins/fixed_cone_mixin.py | cvxgrp/qcml | ff5e378cfeeebcf3f85a6e30c3449585f9af869f | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2015-03-14T07:40:56.000Z | 2019-12-30T23:11:36.000Z | # TODO: (ECHU) presumably, this will work, but in actuality, i'm not sure...
# Need to test this.
#
# This code doesn't work yet. Requires expression slices.
#
from .. ast.constraints import SOC, SOCProd
from .. codes import SliceCoeff
from variable_creation_mixin import VariableCreatorMixin
class FixedConeMixin(Varia... | 38.577586 | 90 | 0.529832 |
d4bb40f31065712f45c03f3ba22440f9f1b89b19 | 3,508 | py | Python | mne/viz/tests/test_evoked.py | jaeilepp/eggie | a7e812f27e33f9c43ac2e36c6b45a26a01530a06 | [
"BSD-2-Clause"
] | null | null | null | mne/viz/tests/test_evoked.py | jaeilepp/eggie | a7e812f27e33f9c43ac2e36c6b45a26a01530a06 | [
"BSD-2-Clause"
] | null | null | null | mne/viz/tests/test_evoked.py | jaeilepp/eggie | a7e812f27e33f9c43ac2e36c6b45a26a01530a06 | [
"BSD-2-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Cathy Nangini <cnangini@gmail.com>
# Mainak Jas <mainak@neuro.hut.fi>
#... | 32.785047 | 77 | 0.661345 |
04c0dfee375fa10451792eb5dc0b3eb7e94a2830 | 54 | py | Python | xuperchain/__init__.py | xuperchain/contract-sdk-py | 190c1f80d055ea29c3cb16e4eeea46845e06cd88 | [
"Apache-2.0"
] | null | null | null | xuperchain/__init__.py | xuperchain/contract-sdk-py | 190c1f80d055ea29c3cb16e4eeea46845e06cd88 | [
"Apache-2.0"
] | null | null | null | xuperchain/__init__.py | xuperchain/contract-sdk-py | 190c1f80d055ea29c3cb16e4eeea46845e06cd88 | [
"Apache-2.0"
] | 1 | 2021-04-02T03:50:57.000Z | 2021-04-02T03:50:57.000Z | from xuperchain.contract_method import contract_method | 54 | 54 | 0.925926 |
3a883431edaa642a8b96cac6844270b437843b04 | 5,548 | py | Python | pruning/main.py | acnagle/optimal-lottery-tickets | 9412547700c359339c819d8144e67c2f33a9e786 | [
"Apache-2.0"
] | 2 | 2020-11-26T00:37:23.000Z | 2021-10-03T18:26:11.000Z | pruning/main.py | acnagle/optimal-lottery-tickets | 9412547700c359339c819d8144e67c2f33a9e786 | [
"Apache-2.0"
] | null | null | null | pruning/main.py | acnagle/optimal-lottery-tickets | 9412547700c359339c819d8144e67c2f33a9e786 | [
"Apache-2.0"
] | 1 | 2021-06-24T11:36:04.000Z | 2021-06-24T11:36:04.000Z | from __future__ import print_function
import os
import math
import random
import numpy as np
import sys
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import CosineAnnealingLR
import t... | 32.828402 | 476 | 0.650324 |
822b1b8e47ebc1e15cce2fdbacb755fccd62f9b0 | 837 | py | Python | tests/model_tasklog_tests.py | richard-ma/dress | 86e892673635319c0a1860edb33cdba7ed22a7fb | [
"MIT"
] | 2 | 2019-10-23T09:06:47.000Z | 2019-11-07T12:52:42.000Z | tests/model_tasklog_tests.py | richard-ma/dress | 86e892673635319c0a1860edb33cdba7ed22a7fb | [
"MIT"
] | 4 | 2017-12-28T01:44:42.000Z | 2017-12-31T13:08:18.000Z | tests/model_tasklog_tests.py | richard-ma/dress | 86e892673635319c0a1860edb33cdba7ed22a7fb | [
"MIT"
] | 2 | 2019-10-15T07:42:33.000Z | 2019-10-24T06:49:22.000Z | #!/usr/bin/env python
import unittest
from flask_testing import TestCase
import dress
from dress.models import *
from manager import seed
class ModelTaskLogTestCase(TestCase):
def create_app(self):
app = dress.create_app()
app.config.testing = True
return app
def setUp(self):
... | 21.461538 | 59 | 0.634409 |
3ff234037e4aabe49b84f6ae1ccc32bffeb82207 | 14,618 | py | Python | ctapipe/reco/hillas_intersection.py | mpecimotika/ctapipe | ffd7930921f7139b761fbf1208da16dd302e97a6 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/reco/hillas_intersection.py | mpecimotika/ctapipe | ffd7930921f7139b761fbf1208da16dd302e97a6 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/reco/hillas_intersection.py | mpecimotika/ctapipe | ffd7930921f7139b761fbf1208da16dd302e97a6 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
TODO:
- Speed tests, need to be certain the looping on all telescopes is not killing
performance
- Introduce new weighting schemes
- Make intersect_lines code more readable
"""
import numpy as np
import itertools
import astropy.units as u
from ctapip... | 33.995349 | 88 | 0.577918 |
cfbb0558359bc109f34b756df9635c9844639ec7 | 2,350 | py | Python | color-depth-reduction/CIFAR-10/CW_attack.py | jfc43/pixel-discretization | 1543649e5172cb4f8226962a5ab5087091910418 | [
"Apache-2.0"
] | 6 | 2019-03-08T23:09:20.000Z | 2021-07-29T19:23:58.000Z | color-depth-reduction/CIFAR-10/CW_attack.py | jfc43/pixel-discretization | 1543649e5172cb4f8226962a5ab5087091910418 | [
"Apache-2.0"
] | null | null | null | color-depth-reduction/CIFAR-10/CW_attack.py | jfc43/pixel-discretization | 1543649e5172cb4f8226962a5ab5087091910418 | [
"Apache-2.0"
] | 1 | 2020-02-05T20:07:19.000Z | 2020-02-05T20:07:19.000Z | import tensorflow as tf
import numpy as np
from util import preprocess
class CWAttack:
def __init__(self, model, num_steps, step_size, epsilon, codes, batch_size, alpha):
self.model = model
self.num_steps = num_steps
self.step_size = step_size
self.codes = codes
self.xs = t... | 37.301587 | 87 | 0.58766 |
0d0d2ff8103a0b8723377d21503c48a8cc4f7b90 | 30,165 | py | Python | built-in/TensorFlow/Official/cv/detection/MaskRcnn_ID0011_for_TensorFlow/dataloader_.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/TensorFlow/Official/cv/detection/MaskRcnn_ID0011_for_TensorFlow/dataloader_.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/TensorFlow/Official/cv/detection/MaskRcnn_ID0011_for_TensorFlow/dataloader_.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.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... | 41.954103 | 121 | 0.641273 |
ededdc8cbb2813f08bc96cfb328b7084691608eb | 3,223 | py | Python | dnnf/model.py | dlshriver/DNNF | 898e4df69be35312ace622ce2c47f7bf8d6a0ffe | [
"MIT"
] | 5 | 2021-01-13T19:52:03.000Z | 2021-12-10T02:54:35.000Z | dnnf/model.py | dlshriver/DNNF | 898e4df69be35312ace622ce2c47f7bf8d6a0ffe | [
"MIT"
] | 1 | 2021-09-15T20:45:17.000Z | 2021-09-23T15:47:10.000Z | dnnf/model.py | dlshriver/DNNF | 898e4df69be35312ace622ce2c47f7bf8d6a0ffe | [
"MIT"
] | 1 | 2021-11-03T02:56:30.000Z | 2021-11-03T02:56:30.000Z | import numpy as np
import torch
import torch.nn.functional as F
from .reduction import HPolyProperty
class FalsificationModel:
def __init__(self, prop: HPolyProperty):
self.prop = prop
self.op_graph = prop.suffixed_op_graph()
self.input_details = self.op_graph.input_details
self.i... | 30.990385 | 86 | 0.591374 |
0b4b37e1b8ff30adeafa90e83bcf4e3c97bf4770 | 12,240 | py | Python | lib/python/treadmill/context.py | drienyov/treadmill | ce21537cd9a2fdb0567ac2aa3de1afcb2f6861de | [
"Apache-2.0"
] | null | null | null | lib/python/treadmill/context.py | drienyov/treadmill | ce21537cd9a2fdb0567ac2aa3de1afcb2f6861de | [
"Apache-2.0"
] | null | null | null | lib/python/treadmill/context.py | drienyov/treadmill | ce21537cd9a2fdb0567ac2aa3de1afcb2f6861de | [
"Apache-2.0"
] | null | null | null | """Treadmill context.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import logging
import socket
from treadmill import plugin_manager
_LOGGER = logging.getLogger(__name__)
class ContextError... | 25.237113 | 79 | 0.547059 |
2a9eff59b0e3fd240bb114d6f792d334bc327d09 | 401 | py | Python | innetProject/innetProject/innetProject/wsgi.py | stefanSuYiGuo/Django_case2 | e0e06d95f747a4ada5416dae7d8064037bc5adf0 | [
"MIT"
] | null | null | null | innetProject/innetProject/innetProject/wsgi.py | stefanSuYiGuo/Django_case2 | e0e06d95f747a4ada5416dae7d8064037bc5adf0 | [
"MIT"
] | null | null | null | innetProject/innetProject/innetProject/wsgi.py | stefanSuYiGuo/Django_case2 | e0e06d95f747a4ada5416dae7d8064037bc5adf0 | [
"MIT"
] | null | null | null | """
WSGI config for innetProject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
6833c56e8f510a8ed2a2e0e955cb67003aa487cc | 496 | py | Python | examples/misc/djangotasks/todo/views.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 739 | 2015-01-01T02:05:11.000Z | 2022-03-30T15:26:16.000Z | examples/misc/djangotasks/todo/views.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 33 | 2015-03-25T23:17:04.000Z | 2021-08-19T08:25:22.000Z | examples/misc/djangotasks/todo/views.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 167 | 2015-01-01T22:27:47.000Z | 2022-03-17T13:29:19.000Z | # Create your views here.
from django.pimentech.network import *
from todo.models import Todo
service = JSONRPCService()
@jsonremote(service)
def getTasks (request):
return [(str(task),task.id) for task in Todo.objects.all()]
@jsonremote(service)
def addTask (request, taskFromJson):
t = Todo()
t.task = taskFrom... | 19.076923 | 60 | 0.743952 |
f2f123f9c7fbf276e4dc31df44a1df1630ae868b | 43,126 | py | Python | pyzoo/test/zoo/chronos/data/test_tsdataset.py | wangyoucaocxl/analytics-zoo | 125d1c146f6552f3ceb38d78a2174af902535341 | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/chronos/data/test_tsdataset.py | wangyoucaocxl/analytics-zoo | 125d1c146f6552f3ceb38d78a2174af902535341 | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/chronos/data/test_tsdataset.py | wangyoucaocxl/analytics-zoo | 125d1c146f6552f3ceb38d78a2174af902535341 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo 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 agreed to... | 48.674944 | 98 | 0.509391 |
cef93b2051eab851e4cd2fd6bb83355728b401f9 | 810 | py | Python | manage.py | avinash795k/leaveProject | 264818f052e0abfdd47a0b9e73b1a9fa28114da0 | [
"MIT"
] | null | null | null | manage.py | avinash795k/leaveProject | 264818f052e0abfdd47a0b9e73b1a9fa28114da0 | [
"MIT"
] | null | null | null | manage.py | avinash795k/leaveProject | 264818f052e0abfdd47a0b9e73b1a9fa28114da0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "leaveProject.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that... | 35.217391 | 77 | 0.644444 |
bb712c5cfb785c0c0fa1b98d02fa48ffd2861c63 | 24,343 | py | Python | keystone/identity/core.py | christophgysin/openstack-keystone | ab4f7473c34b8a94ed5a3aced01bf055d4453905 | [
"Apache-2.0"
] | null | null | null | keystone/identity/core.py | christophgysin/openstack-keystone | ab4f7473c34b8a94ed5a3aced01bf055d4453905 | [
"Apache-2.0"
] | null | null | null | keystone/identity/core.py | christophgysin/openstack-keystone | ab4f7473c34b8a94ed5a3aced01bf055d4453905 | [
"Apache-2.0"
] | 1 | 2021-08-29T16:53:06.000Z | 2021-08-29T16:53:06.000Z | # Copyright 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 agreed to in... | 35.693548 | 79 | 0.654192 |
d7de9b55370073145f653163d5da240ac4d7e133 | 25,441 | py | Python | pytorch_toolkit/text_spotting/text_spotting/datasets/datasets.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 3 | 2020-12-29T02:47:32.000Z | 2021-11-12T08:12:51.000Z | pytorch_toolkit/text_spotting/text_spotting/datasets/datasets.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 28 | 2020-09-25T22:40:36.000Z | 2022-03-12T00:37:36.000Z | pytorch_toolkit/text_spotting/text_spotting/datasets/datasets.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 1 | 2021-04-02T07:51:01.000Z | 2021-04-02T07:51:01.000Z | """
Copyright (c) 2020 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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | 37.579025 | 100 | 0.552966 |
0a06a6e077bdec81e2d5cc5f0593b79585aecc8b | 77 | py | Python | tests/development/conftest.py | denssk/backup | 292d5f1b1a3765ce0ea8d3cab8bd1ae0c583f72e | [
"Apache-2.0"
] | 69 | 2016-06-29T16:13:55.000Z | 2022-03-21T06:38:37.000Z | tests/development/conftest.py | denssk/backup | 292d5f1b1a3765ce0ea8d3cab8bd1ae0c583f72e | [
"Apache-2.0"
] | 237 | 2016-09-28T02:12:34.000Z | 2022-03-25T13:32:23.000Z | tests/development/conftest.py | denssk/backup | 292d5f1b1a3765ce0ea8d3cab8bd1ae0c583f72e | [
"Apache-2.0"
] | 45 | 2017-01-04T21:20:27.000Z | 2021-12-29T10:42:22.000Z | from twindb_backup import setup_logging, LOG
setup_logging(LOG, debug=True)
| 19.25 | 44 | 0.831169 |
652e166f64b376d9e6ea0b8ee4469ffb49db67de | 4,046 | py | Python | laikarestd.py | sandialabs/laikaboss | 3064ac1176911651d61c5176e9bd83eacec36b16 | [
"Apache-2.0"
] | 2 | 2019-11-02T23:40:23.000Z | 2019-12-01T22:24:57.000Z | laikarestd.py | sandialabs/laikaboss | 3064ac1176911651d61c5176e9bd83eacec36b16 | [
"Apache-2.0"
] | null | null | null | laikarestd.py | sandialabs/laikaboss | 3064ac1176911651d61c5176e9bd83eacec36b16 | [
"Apache-2.0"
] | 3 | 2017-08-09T23:58:40.000Z | 2019-12-01T22:25:06.000Z | #!/usr/bin/env python
# Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | 35.80531 | 110 | 0.749135 |
67c808f4ed62f104cc9a60d4442724dac655b0ff | 3,406 | py | Python | sdv/docker/sdvstate/tools/conf/__init__.py | opnfv/cirv-sdv | 31fb310d3fd1c9c1f12cfe0c654870e24f5efab6 | [
"Apache-2.0"
] | 2 | 2021-09-16T06:31:45.000Z | 2022-03-09T19:59:55.000Z | sdv/docker/sdvstate/tools/conf/__init__.py | opnfv/cirv-sdv | 31fb310d3fd1c9c1f12cfe0c654870e24f5efab6 | [
"Apache-2.0"
] | null | null | null | sdv/docker/sdvstate/tools/conf/__init__.py | opnfv/cirv-sdv | 31fb310d3fd1c9c1f12cfe0c654870e24f5efab6 | [
"Apache-2.0"
] | 2 | 2021-05-11T14:41:01.000Z | 2021-05-14T05:59:38.000Z | # Copyright 2020 University Of Delhi.
#
# 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 wr... | 28.14876 | 79 | 0.611861 |
d178cbddbc46bdb4b04a594ebd401f53bbcd4a85 | 453 | py | Python | zezere/migrations/0008_runrequest_raw_settings.py | Rintsi/zezere | 1a49476d3d9cef26d65c7dcab2c4abb47938b934 | [
"MIT"
] | 32 | 2020-02-16T21:37:22.000Z | 2022-03-29T06:34:28.000Z | zezere/migrations/0008_runrequest_raw_settings.py | Rintsi/zezere | 1a49476d3d9cef26d65c7dcab2c4abb47938b934 | [
"MIT"
] | 44 | 2019-12-18T14:03:22.000Z | 2022-03-31T11:54:21.000Z | zezere/migrations/0008_runrequest_raw_settings.py | Rintsi/zezere | 1a49476d3d9cef26d65c7dcab2c4abb47938b934 | [
"MIT"
] | 15 | 2019-12-05T18:46:35.000Z | 2022-03-29T12:21:33.000Z | # Generated by Django 2.2.6 on 2019-10-29 12:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("zezere", "0007_auto_20191021_1444")]
operations = [
migrations.AddField(
model_name="runrequest",
name="raw_settings",
... | 23.842105 | 75 | 0.604857 |
8aeef6c8143075baaddb2fc79089598e98ac648c | 953 | py | Python | tests/v1/test_timeseries_widget_definition_type.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | tests/v1/test_timeseries_widget_definition_type.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | tests/v1/test_timeseries_widget_definition_type.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import absolute_import
import sys
import unittest
im... | 28.029412 | 108 | 0.756558 |
248aeefc8743bf6be9be72cfb51fb2c4bf80ab8e | 130 | py | Python | pypro/base/views.py | limberger/curso-django | 9b099a9934871c221be2018d2e80331e90bee40f | [
"Apache-2.0"
] | null | null | null | pypro/base/views.py | limberger/curso-django | 9b099a9934871c221be2018d2e80331e90bee40f | [
"Apache-2.0"
] | 1,012 | 2020-06-22T21:43:39.000Z | 2022-03-31T22:09:32.000Z | pypro/base/views.py | limberger/curso-django | 9b099a9934871c221be2018d2e80331e90bee40f | [
"Apache-2.0"
] | 1 | 2020-08-06T19:50:33.000Z | 2020-08-06T19:50:33.000Z |
# Create your views here.
from django.shortcuts import render
def home(request):
return render(request, 'base/home.html')
| 14.444444 | 44 | 0.730769 |
e3273fcb87325d9e3c5c093beacf6a58fc5c00f4 | 174 | py | Python | 02/00/getreader.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | 02/00/getreader.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | 32 | 2017-09-01T00:52:17.000Z | 2017-10-01T00:30:02.000Z | 02/00/getreader.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | #!python3.6
#encoding:utf-8
import codecs
text = '日本語'
for enc in ['utf-8', 'utf-16LE', 'utf-16BE', 'utf-32', 'shift-jis', 'euc-jp']:
print(enc, codecs.getreader(enc))
| 19.333333 | 78 | 0.626437 |
3abd6121a2045489e599f3d8fb6fcb1e7db9ab8b | 10,424 | py | Python | utils/dataloaders.py | adrift00/imagenet_pretrain | fb824a860b105aad0bda1c4dcc0b9bffea5fb418 | [
"Apache-2.0"
] | null | null | null | utils/dataloaders.py | adrift00/imagenet_pretrain | fb824a860b105aad0bda1c4dcc0b9bffea5fb418 | [
"Apache-2.0"
] | null | null | null | utils/dataloaders.py | adrift00/imagenet_pretrain | fb824a860b105aad0bda1c4dcc0b9bffea5fb418 | [
"Apache-2.0"
] | null | null | null | import os
import torch
import numpy as np
import torchvision.datasets as datasets
import torchvision.transforms as transforms
DATA_BACKEND_CHOICES = ['pytorch']
try:
from nvidia.dali.plugin.pytorch import DALIClassificationIterator
from nvidia.dali.pipeline import Pipeline
import nvidia.dali.ops as ops
... | 39.78626 | 156 | 0.601784 |
06c3f5dbf1ed4e6e30448f5a857e377a1753c66e | 4,115 | py | Python | amqp/abstract_channel.py | smurfix/py-amqp | 583e5c8f2b6fc37070654e68efcdc6ed681b87ea | [
"BSD-3-Clause"
] | null | null | null | amqp/abstract_channel.py | smurfix/py-amqp | 583e5c8f2b6fc37070654e68efcdc6ed681b87ea | [
"BSD-3-Clause"
] | null | null | null | amqp/abstract_channel.py | smurfix/py-amqp | 583e5c8f2b6fc37070654e68efcdc6ed681b87ea | [
"BSD-3-Clause"
] | null | null | null | """Code common to Connection and Channel objects."""
# Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org>)
from __future__ import absolute_import, unicode_literals
from vine import ensure_promise, promise
from .exceptions import AMQPNotImplementedError, RecoverableConnectionError
from .serialization import dumps,... | 31.174242 | 77 | 0.590765 |
8d3bf08c426df034576d4813300d6f8a05caf297 | 1,713 | py | Python | xen/xen-4.2.2/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py | zhiming-shen/Xen-Blanket-NG | 47e59d9bb92e8fdc60942df526790ddb983a5496 | [
"Apache-2.0"
] | 1 | 2018-02-02T00:15:26.000Z | 2018-02-02T00:15:26.000Z | xen/xen-4.2.2/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py | zhiming-shen/Xen-Blanket-NG | 47e59d9bb92e8fdc60942df526790ddb983a5496 | [
"Apache-2.0"
] | null | null | null | xen/xen-4.2.2/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py | zhiming-shen/Xen-Blanket-NG | 47e59d9bb92e8fdc60942df526790ddb983a5496 | [
"Apache-2.0"
] | 1 | 2019-05-27T09:47:18.000Z | 2019-05-27T09:47:18.000Z | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
from XmTestLib import *
from XmTestLib.block_utils import *
if ENABLE_HVM_SUPPORT:
SKIP("Block-list not supported for HVM domains")
domain = XmTestDomain()
try:
domain.start(noConsole=True)
... | 27.629032 | 74 | 0.676007 |
e976e750a39493a6066a1cef2c31e77767cc2a11 | 4,094 | py | Python | python/graphscope/tests/unittest/test_java_app.py | luoxiaojian/GraphScope-1 | 97785684f2b2495c41dc079aed64198b5a6e1331 | [
"Apache-2.0"
] | 2 | 2021-04-07T07:57:13.000Z | 2021-11-19T09:44:01.000Z | python/graphscope/tests/unittest/test_java_app.py | luoxiaojian/GraphScope-1 | 97785684f2b2495c41dc079aed64198b5a6e1331 | [
"Apache-2.0"
] | 16 | 2021-12-22T09:19:25.000Z | 2022-03-29T02:43:34.000Z | python/graphscope/tests/unittest/test_java_app.py | luoxiaojian/GraphScope-1 | 97785684f2b2495c41dc079aed64198b5a6e1331 | [
"Apache-2.0"
] | 2 | 2022-01-25T10:16:51.000Z | 2022-02-07T11:51:20.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... | 29.242857 | 88 | 0.74597 |
94592d0c5d4dff58a268ddc1cd719d067e9701fd | 1,824 | py | Python | objectModel/Python/cdm/resolvedmodel/resolved_entity_reference_set.py | rt112000/CDM | 34bd34f9260140a8f8aa02bd87c23033f3daad4c | [
"CC-BY-4.0",
"MIT"
] | 884 | 2019-05-10T02:09:10.000Z | 2022-03-31T14:02:00.000Z | objectModel/Python/cdm/resolvedmodel/resolved_entity_reference_set.py | spbast/CDM | bf97a3720c97ee4c9df3625084cf8b3bc65ff9c7 | [
"CC-BY-4.0",
"MIT"
] | 171 | 2019-06-10T11:34:37.000Z | 2022-03-31T22:50:12.000Z | objectModel/Python/cdm/resolvedmodel/resolved_entity_reference_set.py | spbast/CDM | bf97a3720c97ee4c9df3625084cf8b3bc65ff9c7 | [
"CC-BY-4.0",
"MIT"
] | 340 | 2019-05-07T18:00:16.000Z | 2022-03-31T12:00:15.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
from typing import List, Optional, TYPE_CHECKING
if TYPE_CHECKING:
from cdm.objectmodel import CdmEntityDefinition, SpewCatcher
from cdm.resolvedmodel imp... | 46.769231 | 114 | 0.697368 |
92ad9de318fd5152094b8872d8254796ff8f6e08 | 1,003 | py | Python | tests/test_feedback.py | voyagegroup/apns-proxy-server | 5858d1b33d37b9333ca153cd92f091bad9537455 | [
"BSD-2-Clause"
] | 16 | 2015-01-20T22:54:43.000Z | 2021-07-07T03:33:04.000Z | tests/test_feedback.py | voyagegroup/apns-proxy-server | 5858d1b33d37b9333ca153cd92f091bad9537455 | [
"BSD-2-Clause"
] | null | null | null | tests/test_feedback.py | voyagegroup/apns-proxy-server | 5858d1b33d37b9333ca153cd92f091bad9537455 | [
"BSD-2-Clause"
] | 6 | 2015-01-22T05:00:36.000Z | 2022-03-03T15:20:00.000Z | # -*- coding: utf-8 -*-
"""
Tests for apns_proxy_server.feedback
"""
from datetime import datetime
from nose.tools import ok_, eq_
import simplejson as json
from apns_proxy_server.feedback import FeedbackProxy
def test_instance():
proxy = FeedbackProxy(True, '/path/to/cert', '/path/to/key')
ok_(proxy)
... | 23.880952 | 78 | 0.666002 |
c261420a300c4ce53735f0cd1ba088344d58a79a | 7,926 | py | Python | aiida_vasp/workchains/tests/test_vasp_wc.py | MichaelWolloch/aiida-vasp | 315b79bf874b8449dd702f1f3bc48c55aa89683b | [
"MIT"
] | 28 | 2019-03-06T11:33:01.000Z | 2022-02-25T22:29:12.000Z | aiida_vasp/workchains/tests/test_vasp_wc.py | MichaelWolloch/aiida-vasp | 315b79bf874b8449dd702f1f3bc48c55aa89683b | [
"MIT"
] | 386 | 2018-09-04T15:05:51.000Z | 2022-03-04T12:18:39.000Z | aiida_vasp/workchains/tests/test_vasp_wc.py | MichaelWolloch/aiida-vasp | 315b79bf874b8449dd702f1f3bc48c55aa89683b | [
"MIT"
] | 35 | 2019-01-14T17:12:08.000Z | 2022-02-24T18:52:11.000Z | """
Test submitting a VaspWorkChain.
This does not seem to work, for `submit` the daemon will not pick up the workchain
and `run` just seems to get stuck after a while.
"""
# pylint: disable=unused-import,wildcard-import,unused-wildcard-import,unused-argument,redefined-outer-name, import-outside-toplevel
from __future... | 35.070796 | 132 | 0.676634 |
35186bb87f7e509bca13d96949b0ab808bd786ad | 6,384 | py | Python | openstack_dashboard/dashboards/project/database_backups/tests.py | maofutian/horizon | dab92e7d2f576caea8f81c8e22a516fb45633794 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/database_backups/tests.py | maofutian/horizon | dab92e7d2f576caea8f81c8e22a516fb45633794 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/database_backups/tests.py | maofutian/horizon | dab92e7d2f576caea8f81c8e22a516fb45633794 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Mirantis 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 agre... | 34.885246 | 78 | 0.620771 |
c2e39d13ced0835f16408cb680517001e90f1caa | 188 | py | Python | redhawk/test/files/python/z004.py | spranesh/Redhawk | e2be5a6553df8449acecee2239b60c7bca0f22bc | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2016-10-04T11:46:32.000Z | 2017-07-09T15:23:55.000Z | redhawk/test/files/python/z004.py | spranesh/Redhawk | e2be5a6553df8449acecee2239b60c7bca0f22bc | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2016-03-07T13:16:48.000Z | 2018-03-21T00:25:04.000Z | redhawk/test/files/python/z004.py | spranesh/Redhawk | e2be5a6553df8449acecee2239b60c7bca0f22bc | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2016-04-06T08:04:34.000Z | 2020-03-17T20:59:47.000Z | # Test Try, Except
try:
x = a.x
y = a.y
z = a.array[0]
except AttributeError as e:
x = 1
y = 1
z = 1
except IndexError as e:
x = 0
y = 0
z = 0
finally:
print(x, y, z)
| 11.058824 | 27 | 0.526596 |
4b457f80788111d80cb0fb6b5838695f237fc5f6 | 4,733 | py | Python | python/pyspark/pandas/tests/plot/test_frame_plot.py | akhalymon-cv/spark | 76191b9151b6a7804f8894e53eef74106f98b787 | [
"Apache-2.0"
] | 35,083 | 2015-01-01T03:05:13.000Z | 2022-03-31T21:57:40.000Z | python/pyspark/pandas/tests/plot/test_frame_plot.py | akhalymon-cv/spark | 76191b9151b6a7804f8894e53eef74106f98b787 | [
"Apache-2.0"
] | 32,117 | 2015-01-01T00:00:24.000Z | 2022-03-31T23:54:58.000Z | python/pyspark/pandas/tests/plot/test_frame_plot.py | akhalymon-cv/spark | 76191b9151b6a7804f8894e53eef74106f98b787 | [
"Apache-2.0"
] | 29,687 | 2015-01-01T02:40:43.000Z | 2022-03-31T16:49:33.000Z | #
# 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 us... | 37.864 | 97 | 0.640397 |
4f51ecb40dc2f9b80a3a072d784295c5e4c5925f | 456 | py | Python | Section 19/9.Document-complie-operations.py | airbornum/-Complete-Python-Scripting-for-Automation | bc053444f8786259086269ca1713bdb10144dd74 | [
"MIT"
] | 18 | 2020-04-13T03:14:06.000Z | 2022-03-09T18:54:41.000Z | Section 19/9.Document-complie-operations.py | airbornum/-Complete-Python-Scripting-for-Automation | bc053444f8786259086269ca1713bdb10144dd74 | [
"MIT"
] | null | null | null | Section 19/9.Document-complie-operations.py | airbornum/-Complete-Python-Scripting-for-Automation | bc053444f8786259086269ca1713bdb10144dd74 | [
"MIT"
] | 22 | 2020-04-29T21:12:42.000Z | 2022-03-17T18:19:54.000Z | import re
my_str="This is about python. Python is easy to learn and we have two major versions: python2 and python3 "
my_pat=r'\bPython[23]?\b'
#print(re.search(my_pat,my_str))
#print(re.findall(my_pat,my_str,flags=re.I))
#print(re.split(my_pat,my_str))
pat_ob=re.compile(my_pat,flags=re.I)
print(pat_ob)... | 24 | 109 | 0.719298 |
314a5c1a65f462d0ca7d5fecec70069e9f0c97a0 | 439 | py | Python | api/cloud_provider/migrations/0007_auto_20190731_0424.py | 240325184/KubeOperator | 777774050b236abf938a5a9ef505124c26e4916e | [
"Apache-2.0"
] | 3 | 2019-11-29T03:49:08.000Z | 2020-07-29T02:52:51.000Z | api/cloud_provider/migrations/0007_auto_20190731_0424.py | 240325184/KubeOperator | 777774050b236abf938a5a9ef505124c26e4916e | [
"Apache-2.0"
] | 27 | 2021-05-05T02:51:26.000Z | 2022-01-04T21:30:21.000Z | api/cloud_provider/migrations/0007_auto_20190731_0424.py | 240325184/KubeOperator | 777774050b236abf938a5a9ef505124c26e4916e | [
"Apache-2.0"
] | 1 | 2020-07-06T04:53:51.000Z | 2020-07-06T04:53:51.000Z | # Generated by Django 2.1.2 on 2019-07-31 04:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cloud_provider', '0006_region_cloud_region'),
]
operations = [
migrations.RemoveField(
model_name='region',
name='connected'... | 19.954545 | 55 | 0.567198 |
0aa24044bdd1197df87c9f5bf04ff6b0db185e3f | 285 | py | Python | week03/CodingSkills/coding_skills_test.py | PreslavaKuzova/Python101 | 716cdd2d818f7eef45a1cdafdfb85a208daec750 | [
"MIT"
] | 4 | 2019-04-06T20:06:19.000Z | 2020-03-31T20:51:56.000Z | week03/CodingSkills/coding_skills_test.py | PreslavaKuzova/Python101 | 716cdd2d818f7eef45a1cdafdfb85a208daec750 | [
"MIT"
] | null | null | null | week03/CodingSkills/coding_skills_test.py | PreslavaKuzova/Python101 | 716cdd2d818f7eef45a1cdafdfb85a208daec750 | [
"MIT"
] | 1 | 2020-03-21T00:49:56.000Z | 2020-03-21T00:49:56.000Z | import unittest
from coding_skills import coding_skills, read_json
class TestCodingSkills(unittest.TestCase):
def test_when_no_system_argument_is_given_are_throw_an_exception(self):
self.assertRaises(Exception, read_json())
if __name__ == '__main__':
unittest.main() | 31.666667 | 75 | 0.796491 |
3f0ca4b1e1fddb156f8bba69b9d8acd0fc9b31a1 | 1,493 | py | Python | todo/routes.py | hhao99/flask-todo | dc0bc6ffcdde206e05b4ea7636324efa26315241 | [
"CNRI-Python"
] | 3 | 2020-02-01T11:25:48.000Z | 2020-02-04T14:11:50.000Z | todo/routes.py | hhao99/flask-todo | dc0bc6ffcdde206e05b4ea7636324efa26315241 | [
"CNRI-Python"
] | 1 | 2021-06-02T01:11:26.000Z | 2021-06-02T01:11:26.000Z | todo/routes.py | hhao99/flask-todo | dc0bc6ffcdde206e05b4ea7636324efa26315241 | [
"CNRI-Python"
] | null | null | null | from flask import (
render_template, redirect, render_template,
request, g, flash, url_for
)
from .forms import TodoForm
from .models import Todo
from .models import db
def init_route(app):
@app.route('/')
def index():
todos = Todo.query.all()
return render_template... | 29.27451 | 75 | 0.54789 |
e175189fdb42e853767f0afbb683b6553f8c27eb | 828 | py | Python | collatelogs/metahandlers.py | tchamberlin/collatelogs | 00335099a2a0a893bec1f927b3541d2acb5fb932 | [
"MIT"
] | null | null | null | collatelogs/metahandlers.py | tchamberlin/collatelogs | 00335099a2a0a893bec1f927b3541d2acb5fb932 | [
"MIT"
] | 1 | 2018-05-04T14:54:42.000Z | 2018-05-04T15:48:22.000Z | collatelogs/metahandlers.py | tchamberlin/collatelogs | 00335099a2a0a893bec1f927b3541d2acb5fb932 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""File metadata handlers: provide metadata based on a given path
These are used to populated keywords in the line_output_format, elsewhere"""
import os
try:
# For unix
import pwd
except ImportError:
# For windows
import win32security
import sys
def get_owner_from_path(path... | 23.657143 | 85 | 0.707729 |
d9b8172a25a0d56e4aceb18f37a936063e1bc2df | 242 | py | Python | exampleproject/lectures/admin.py | rishikesh67/django-shared-schema-tenants | ed3bcddf80a7838979fe1be2045dfa16b545beed | [
"MIT"
] | 20 | 2017-08-29T02:36:32.000Z | 2021-12-06T21:29:46.000Z | exampleproject/lectures/admin.py | rishikesh67/django-shared-schema-tenants | ed3bcddf80a7838979fe1be2045dfa16b545beed | [
"MIT"
] | 35 | 2017-08-18T06:28:31.000Z | 2021-09-02T01:53:09.000Z | exampleproject/lectures/admin.py | rishikesh67/django-shared-schema-tenants | ed3bcddf80a7838979fe1be2045dfa16b545beed | [
"MIT"
] | 9 | 2018-06-17T22:04:13.000Z | 2022-03-18T09:27:18.000Z | from django.contrib import admin
from shared_schema_tenants_custom_data.admin import TenantSpecificModelAdmin
from .models import Lecture
class LectureAdmin(TenantSpecificModelAdmin):
pass
admin.sites.register(Lecture, LectureAdmin)
| 20.166667 | 76 | 0.847107 |
be5ef80622566f1ace154f2c6c86d4d4f30a9442 | 10,355 | py | Python | tests/unit/pynwb_tests/test_ophys.py | VBaratham/pynwb | a9429c93f29763b9ebe9022b099afcffbc6be493 | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/unit/pynwb_tests/test_ophys.py | VBaratham/pynwb | a9429c93f29763b9ebe9022b099afcffbc6be493 | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/unit/pynwb_tests/test_ophys.py | VBaratham/pynwb | a9429c93f29763b9ebe9022b099afcffbc6be493 | [
"BSD-3-Clause-LBNL"
] | null | null | null | import unittest
from pynwb.ophys import TwoPhotonSeries, RoiResponseSeries, DfOverF, Fluorescence, PlaneSegmentation, \
ImageSegmentation, OpticalChannel, ImagingPlane, MotionCorrection, CorrectedImageStack
from pynwb.image import ImageSeries
from pynwb.base import TimeSeries
from pynwb.device import Device
from p... | 41.09127 | 120 | 0.627523 |
3bbcf7b77edc894d07497e30200a30fbfc8201c5 | 137 | py | Python | apis/raw/021_raw/021_cleaner_bs4_version.py | sighill/shade_app | 2b42d6411bc6e292b112a5e6be3598de8edadee1 | [
"MIT"
] | null | null | null | apis/raw/021_raw/021_cleaner_bs4_version.py | sighill/shade_app | 2b42d6411bc6e292b112a5e6be3598de8edadee1 | [
"MIT"
] | null | null | null | apis/raw/021_raw/021_cleaner_bs4_version.py | sighill/shade_app | 2b42d6411bc6e292b112a5e6be3598de8edadee1 | [
"MIT"
] | null | null | null | from requests import get
from bs4 import BeautifulSoup
file = '/home/common/shade/apis/raw/021_raw/src'
soup = BeautifulSoup(file)
| 22.833333 | 49 | 0.759124 |
1e5fe405209094bcd713d6efce48b34fd054c594 | 6,827 | py | Python | rioxarray/raster_writer.py | spestana/rioxarray | a96c6083ee15b090ffe15b2beb34047777e90ecf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | rioxarray/raster_writer.py | spestana/rioxarray | a96c6083ee15b090ffe15b2beb34047777e90ecf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | rioxarray/raster_writer.py | spestana/rioxarray | a96c6083ee15b090ffe15b2beb34047777e90ecf | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
This module contains a dataset writer for Dask.
Credits:
RasterioWriter dask write functionality was adopted from https://github.com/dymaxionlabs/dask-rasterio # noqa: E501
Source file:
- https://github.com/dymaxionlabs/dask-rasterio/blob/8dd7fdece7ad094a41908c0ae6b4fe6ca49cf5e1/dask_rasterio/write.py # noqa: E... | 36.704301 | 130 | 0.609345 |
8daa7d5624c694926e07552e655edd1742be7468 | 6,871 | py | Python | webWeixin/webWeixin.py | awesome-archive/awesome-python-login-model | 98aecab631a717934efc308c873fd00cbc6ef930 | [
"MIT"
] | 2 | 2019-04-12T15:10:02.000Z | 2019-04-12T15:11:18.000Z | webWeixin/webWeixin.py | masdude/awesome-python-login-model | aa67e633c0be8634081bae9fa1ed218c1f9fb75c | [
"MIT"
] | null | null | null | webWeixin/webWeixin.py | masdude/awesome-python-login-model | aa67e633c0be8634081bae9fa1ed218c1f9fb75c | [
"MIT"
] | 1 | 2019-03-31T15:45:36.000Z | 2019-03-31T15:45:36.000Z | import os
import re
import time
import sys
import subprocess
import requests
import xml.dom.minidom
import json
"""
info:
author:CriseLYJ
github:https://github.com/CriseLYJ/
update_time:2019-3-6
"""
session = requests.session()
headers = {
'User-Agent' : 'Mozilla/5.0 (Windows NT 5.1; rv:33.0) Gecko/20100101 Firef... | 24.539286 | 240 | 0.572988 |
2207f92aa9a28e0454a7ba0b7e5d54d108fa1f3b | 5,454 | py | Python | external/configure_panorama.py | jabielecki/azure-vmseries-terraform | 338337c347c54b1a07b5c6f0f0a38efd54f26d08 | [
"Apache-2.0"
] | null | null | null | external/configure_panorama.py | jabielecki/azure-vmseries-terraform | 338337c347c54b1a07b5c6f0f0a38efd54f26d08 | [
"Apache-2.0"
] | null | null | null | external/configure_panorama.py | jabielecki/azure-vmseries-terraform | 338337c347c54b1a07b5c6f0f0a38efd54f26d08 | [
"Apache-2.0"
] | null | null | null | from terraform_external_data import terraform_external_data
from panosxml import Panos
import re
import urllib3
urllib3.disable_warnings()
from xml.etree import ElementTree
from constants import *
import os
import subprocess
import time
OUTPUT_DIR="output"
REQUIRED_ARGS=[
"panorama_ip",
"username",
"passwo... | 28.259067 | 185 | 0.642831 |
827b8015080165a574795a1927545e7e66951a64 | 15,556 | py | Python | scipy/sparse/linalg/isolve/_gcrotmk.py | EverLookNeverSee/scipy | 5ffd20ab831b3bc46bc5692c8624c01f8df09a9b | [
"BSD-3-Clause"
] | 1 | 2021-08-16T09:32:42.000Z | 2021-08-16T09:32:42.000Z | scipy/sparse/linalg/isolve/_gcrotmk.py | EverLookNeverSee/scipy | 5ffd20ab831b3bc46bc5692c8624c01f8df09a9b | [
"BSD-3-Clause"
] | 44 | 2019-06-27T15:56:14.000Z | 2022-03-15T22:21:10.000Z | scipy/sparse/linalg/isolve/_gcrotmk.py | EverLookNeverSee/scipy | 5ffd20ab831b3bc46bc5692c8624c01f8df09a9b | [
"BSD-3-Clause"
] | 4 | 2020-06-13T10:32:25.000Z | 2021-12-03T15:48:16.000Z | # Copyright (C) 2015, Pauli Virtanen <pav@iki.fi>
# Distributed under the same license as SciPy.
import warnings
import numpy as np
from numpy.linalg import LinAlgError
from scipy.linalg import (get_blas_funcs, qr, solve, svd, qr_insert, lstsq)
from scipy.sparse.linalg.isolve.utils import make_system
__all__ = ['gcr... | 31.682281 | 86 | 0.5144 |
0432bffe20765a015ff93b81699d46ffae4d736f | 21,654 | py | Python | AtomicASTChangeMining/src/test/resources/ASTConversion/main.py | maldil/CPATMiner2.0 | 743aa8a5b638a1963e621f59f63d794728ab0c79 | [
"Apache-2.0"
] | 4 | 2021-11-04T02:47:31.000Z | 2022-01-25T02:04:05.000Z | AtomicASTChangeMining/src/test/resources/ASTConversion/main.py | maldil/R-CPATMiner | 88b96a5af438a9c2ea2dab351cb8b210119132a2 | [
"Apache-2.0"
] | null | null | null | AtomicASTChangeMining/src/test/resources/ASTConversion/main.py | maldil/R-CPATMiner | 88b96a5af438a9c2ea2dab351cb8b210119132a2 | [
"Apache-2.0"
] | 1 | 2021-09-11T06:52:39.000Z | 2021-09-11T06:52:39.000Z | #!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 48.55157 | 119 | 0.573012 |
518a563ab73b988bb3feb87130aa6da3ec7f7bf6 | 1,608 | py | Python | accounts/api.py | notrealanurag/curezo_old | c3fd350750a799ae975ed6a89f6db2b39a22fbd0 | [
"MIT"
] | null | null | null | accounts/api.py | notrealanurag/curezo_old | c3fd350750a799ae975ed6a89f6db2b39a22fbd0 | [
"MIT"
] | 5 | 2021-03-19T11:01:39.000Z | 2021-09-22T19:35:40.000Z | accounts/api.py | notrealanurag/curezo_old | c3fd350750a799ae975ed6a89f6db2b39a22fbd0 | [
"MIT"
] | null | null | null |
from rest_framework import generics, permissions, viewsets
from rest_framework.response import Response
from knox.models import AuthToken
from knox.auth import TokenAuthentication
from .serializers import UserSerializer, RegisterSerializer, LoginSerializer
from django.contrib.auth.models import User
# Register Viewse... | 35.733333 | 87 | 0.709577 |
f5a5d9548048d51e81e6caa7f88042c87c428fad | 214 | py | Python | setup.py | ioliveros/github-api-client | 2bbc832af0a7e744958e4741b9f6419cdabc4eb0 | [
"MIT"
] | null | null | null | setup.py | ioliveros/github-api-client | 2bbc832af0a7e744958e4741b9f6419cdabc4eb0 | [
"MIT"
] | 1 | 2021-06-02T03:15:56.000Z | 2021-06-02T03:15:56.000Z | setup.py | ioliveros/github-api-client | 2bbc832af0a7e744958e4741b9f6419cdabc4eb0 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='github_api_client',
version='1.1',
author='Ian Oliveros',
author_email='ioliveros.dev@gmail.com',
packages=find_packages(),
python_requires='>=3.6'
)
| 19.454545 | 43 | 0.747664 |
19cc55f8af9df936d3b09e882b98454ba4361514 | 7,482 | py | Python | models/networks_basic.py | nistath/PerceptualSimilarity | 29c5c71a6b09557ea0d049f27ec44f02d9ba7937 | [
"BSD-2-Clause"
] | null | null | null | models/networks_basic.py | nistath/PerceptualSimilarity | 29c5c71a6b09557ea0d049f27ec44f02d9ba7937 | [
"BSD-2-Clause"
] | null | null | null | models/networks_basic.py | nistath/PerceptualSimilarity | 29c5c71a6b09557ea0d049f27ec44f02d9ba7937 | [
"BSD-2-Clause"
] | null | null | null |
from __future__ import absolute_import
import sys
import torch
import torch.nn as nn
import torch.nn.init as init
from torch.autograd import Variable
import numpy as np
from pdb import set_trace as st
from skimage import color
from IPython import embed
from . import pretrained_networks as pn
from .. import models as... | 39.797872 | 134 | 0.623095 |
d22b875fd1a5d832cd2a299573b03a9270994d6f | 194 | py | Python | search/settings/settings_api.py | JinHai-CN/phantoscope | 1148a30bd379691220e46520248f76615f1d86d3 | [
"Apache-2.0"
] | null | null | null | search/settings/settings_api.py | JinHai-CN/phantoscope | 1148a30bd379691220e46520248f76615f1d86d3 | [
"Apache-2.0"
] | null | null | null | search/settings/settings_api.py | JinHai-CN/phantoscope | 1148a30bd379691220e46520248f76615f1d86d3 | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint
from common.common import json_response
settings = Blueprint("settings", __name__)
@settings.route("/ping")
@json_response
def settings_ping():
return "pong"
| 16.166667 | 42 | 0.762887 |
701e74b0b13c6bd090e81c58ec45e7a2bd6dc2fa | 1,830 | py | Python | examples/fona_simpletest.py | FoamyGuy/Adafruit_CircuitPython_FONA | 0343cb590901c78af4f0510f25c63e4ef50d351f | [
"MIT"
] | null | null | null | examples/fona_simpletest.py | FoamyGuy/Adafruit_CircuitPython_FONA | 0343cb590901c78af4f0510f25c63e4ef50d351f | [
"MIT"
] | null | null | null | examples/fona_simpletest.py | FoamyGuy/Adafruit_CircuitPython_FONA | 0343cb590901c78af4f0510f25c63e4ef50d351f | [
"MIT"
] | null | null | null | # pylint: disable=unused-import
import time
import board
import busio
import digitalio
import adafruit_requests as requests
from adafruit_fona.adafruit_fona import FONA
from adafruit_fona.fona_3g import FONA3G
import adafruit_fona.adafruit_fona_network as network
import adafruit_fona.adafruit_fona_socket as cellular_so... | 25.068493 | 76 | 0.743169 |
11cd643eae0d7845c378b6833d48874d4c20506d | 309 | py | Python | tests/test_dataset.py | elifesciences/elife-crossref-xml-generation | 1cd7b3981d9c78032d2d0ffb68b651de40a8d622 | [
"MIT"
] | 3 | 2018-03-01T01:14:14.000Z | 2021-01-19T13:04:42.000Z | tests/test_dataset.py | elifesciences/elife-crossref-xml-generation | 1cd7b3981d9c78032d2d0ffb68b651de40a8d622 | [
"MIT"
] | 88 | 2017-07-20T00:13:47.000Z | 2021-11-29T04:58:01.000Z | tests/test_dataset.py | elifesciences/elife-crossref-xml-generation | 1cd7b3981d9c78032d2d0ffb68b651de40a8d622 | [
"MIT"
] | 4 | 2017-06-28T22:22:20.000Z | 2021-02-17T23:06:39.000Z | import unittest
from elifecrossref import dataset
class TestDataset(unittest.TestCase):
def test_choose_dataset_identifier_none(self):
"""test when an object has no attributes"""
self.assertIsNone(dataset.choose_dataset_identifier(None))
if __name__ == "__main__":
unittest.main()
| 23.769231 | 66 | 0.747573 |
7d4a70d474b2b52ac32a7a02bef47ac4a3f2e3db | 1,691 | py | Python | escea/discover.py | snikch/escea | 9678b8dbec81b67e61e8f9fb62578ec5870af61e | [
"MIT"
] | 3 | 2016-09-18T02:39:07.000Z | 2019-09-02T03:07:09.000Z | escea/discover.py | snikch/escea | 9678b8dbec81b67e61e8f9fb62578ec5870af61e | [
"MIT"
] | 3 | 2019-03-24T04:56:27.000Z | 2020-09-29T10:00:33.000Z | escea/discover.py | snikch/escea | 9678b8dbec81b67e61e8f9fb62578ec5870af61e | [
"MIT"
] | 3 | 2019-09-05T06:46:32.000Z | 2022-03-29T05:32:37.000Z | import socket
import binascii
from escea.message import (
)
from escea.error import (ConnectionTimeout)
class Fire(object):
UDP_PORT = 3300
def __init__(self, ip):
super(Fire, self).__init__()
self._ip = ip
self._prefix = '47'
self._suffix = '46'
def start(self):
... | 26.84127 | 83 | 0.643998 |
58edfcb94d4e5fc3120d5f013f575d59aeb4dd9f | 1,026 | py | Python | codes/a_config/c_pybullet_parameters/parameters_ant_ddpg.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | null | null | null | codes/a_config/c_pybullet_parameters/parameters_ant_ddpg.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | null | null | null | codes/a_config/c_pybullet_parameters/parameters_ant_ddpg.py | linklab/link_rl | e3d3196dcd49fd71b45941e07fc0d8a27d1d8c99 | [
"MIT"
] | 1 | 2021-11-23T12:30:37.000Z | 2021-11-23T12:30:37.000Z | from codes.a_config._rl_parameters.off_policy.parameter_ddpg import PARAMETERS_DDPG
from codes.e_utils.names import *
from codes.a_config.parameters_general import PARAMETERS_GENERAL
# https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_gym_env.py
class PARAM... | 35.37931 | 124 | 0.792398 |
e0ba0a82781711224640c363d3caf75836714486 | 644 | py | Python | setup.py | python-diamond/diamond-redis | f55d747e5853b92b17b917d4616eb2c723e6f09b | [
"MIT"
] | 2 | 2015-09-08T05:24:45.000Z | 2017-03-14T08:46:59.000Z | setup.py | python-diamond/diamond-redis | f55d747e5853b92b17b917d4616eb2c723e6f09b | [
"MIT"
] | 1 | 2020-09-25T06:29:00.000Z | 2020-09-28T06:22:50.000Z | setup.py | python-diamond/diamond-redis | f55d747e5853b92b17b917d4616eb2c723e6f09b | [
"MIT"
] | 1 | 2021-02-21T10:58:21.000Z | 2021-02-21T10:58:21.000Z | #!/usr/bin/env python
from setuptools import setup
install_requires = [
'diamond',
'redis',
]
setup(
name='diamond-redis',
version='0.0.1',
author='Matt Robenolt',
author_email='matt@ydekproductons.com',
url='https://github.com/python-diamond/diamond-redis',
description='',
long_d... | 20.125 | 58 | 0.61646 |
226bb9ddf543214d178c457597840963294d3dfa | 3,374 | py | Python | web/api/get_mp_function.py | spudmind/spud | 86e44bca4efd3cd6358467e1511048698a45edbc | [
"MIT"
] | 2 | 2015-04-11T12:22:41.000Z | 2016-08-18T11:12:06.000Z | web/api/get_mp_function.py | spudmind/spud | 86e44bca4efd3cd6358467e1511048698a45edbc | [
"MIT"
] | 84 | 2015-01-22T14:33:49.000Z | 2015-04-01T23:15:29.000Z | web/api/get_mp_function.py | spudmind/spud | 86e44bca4efd3cd6358467e1511048698a45edbc | [
"MIT"
] | 1 | 2015-04-16T03:10:39.000Z | 2015-04-16T03:10:39.000Z | from web.api import BaseAPI
from data_models import government_models
from utils import mongo
class MpApi(BaseAPI):
def __init__(self):
BaseAPI.__init__(self)
self._db = mongo.MongoInterface()
self._db_table = 'api_mps'
def request(self, args):
name = args['name']
res... | 38.781609 | 85 | 0.557499 |
360fabb24d52b432a80272fe5b616de7b9c63233 | 1,610 | py | Python | setup.py | howl-anderson/tf_summary_reader | a88d6aeeb325405f91c011c74c04c5efb641a06c | [
"MIT"
] | null | null | null | setup.py | howl-anderson/tf_summary_reader | a88d6aeeb325405f91c011c74c04c5efb641a06c | [
"MIT"
] | null | null | null | setup.py | howl-anderson/tf_summary_reader | a88d6aeeb325405f91c011c74c04c5efb641a06c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ["pandas", "tensorflow>=1.15.0,<2.0.0"... | 31.568627 | 81 | 0.642236 |
8563ebfc903383a99eb74a9bfc8ecd9e64dd9f3f | 393 | py | Python | cha_bebe/wsgi.py | intelektos/Cha_bebe | 23df4af3901413c9c50e73bd305ade165c81001b | [
"MIT"
] | null | null | null | cha_bebe/wsgi.py | intelektos/Cha_bebe | 23df4af3901413c9c50e73bd305ade165c81001b | [
"MIT"
] | 9 | 2020-06-08T03:31:08.000Z | 2022-01-13T02:44:42.000Z | cha_bebe/wsgi.py | intelektos/Cha_bebe | 23df4af3901413c9c50e73bd305ade165c81001b | [
"MIT"
] | 1 | 2020-06-01T17:43:20.000Z | 2020-06-01T17:43:20.000Z | """
WSGI config for cha_bebe project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
0595e0cbf847c9acb45d88519985a86f3413f473 | 8,885 | py | Python | tests/pouw/nods/decentralized/test_worker.py | projectpai/pouw-main-iteration | e2505f63e11bbf80648c8cbe56b6d6f3e3a8546e | [
"MIT"
] | 11 | 2020-06-22T05:31:18.000Z | 2022-03-29T16:50:21.000Z | tests/pouw/nods/decentralized/test_worker.py | AIIJJII/pouw-main-iteration | e2505f63e11bbf80648c8cbe56b6d6f3e3a8546e | [
"MIT"
] | 3 | 2020-06-23T18:20:09.000Z | 2021-07-06T23:28:24.000Z | tests/pouw/nods/decentralized/test_worker.py | AIIJJII/pouw-main-iteration | e2505f63e11bbf80648c8cbe56b6d6f3e3a8546e | [
"MIT"
] | 3 | 2020-09-02T11:03:16.000Z | 2022-03-29T16:50:00.000Z | from copy import copy
import mxnet as mx
import pytest
from mock import MagicMock
from mxnet.gluon import nn
from pai.pouw.nodes.decentralized.worker import create_network, get_layer_parameters_from_config, WorkerNode
def test_create_network_fc_dnn():
model_data = {
'type': 'FC-DNN',
'hidden-uni... | 28.477564 | 111 | 0.448171 |
6ada85e40f050c2e639ce1d4f0b808bef81bde9b | 106 | py | Python | ex2-21.py | ppedraum/infosatc-lp-avaliativo-01 | aa548868ada4a98727587da3a4c6452a4042c199 | [
"MIT"
] | null | null | null | ex2-21.py | ppedraum/infosatc-lp-avaliativo-01 | aa548868ada4a98727587da3a4c6452a4042c199 | [
"MIT"
] | null | null | null | ex2-21.py | ppedraum/infosatc-lp-avaliativo-01 | aa548868ada4a98727587da3a4c6452a4042c199 | [
"MIT"
] | null | null | null | #21
l = float(input("Digite uma massa em libras: "))
k = l*0.45
print("{:.2f}lb2 = {:.2f}kg".format(l, k)) | 26.5 | 48 | 0.584906 |
6917711c32e4be05cbef44b881d3c2e33fbff33c | 4,701 | py | Python | iunets/baseline_networks.py | YoelShoshan/iunets | 9789da07e2ef932c5ea612737066ba88f4f26977 | [
"MIT"
] | 86 | 2020-05-12T06:33:43.000Z | 2022-03-29T13:56:30.000Z | iunets/baseline_networks.py | YoelShoshan/iunets | 9789da07e2ef932c5ea612737066ba88f4f26977 | [
"MIT"
] | 8 | 2020-05-19T08:08:01.000Z | 2022-02-25T09:04:14.000Z | iunets/baseline_networks.py | YoelShoshan/iunets | 9789da07e2ef932c5ea612737066ba88f4f26977 | [
"MIT"
] | 13 | 2020-05-12T06:33:55.000Z | 2021-12-20T07:59:43.000Z | import torch
from torch import nn
from .utils import get_num_channels
from .layers import StandardBlock
class StandardUNet(nn.Module):
def __init__(self,
input_shape_or_channels,
dim=None,
architecture=[2,2,2,2],
base_filters=32,
skip_... | 33.578571 | 100 | 0.478196 |
c8338493827b6156d8a392083666d8439c7104bf | 562 | py | Python | var/spack/repos/builtin/packages/libinih/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/libinih/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/libinih/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libinih(MesonPackage):
"""
inih (INI Not Invented Here) is a simple .INI file parser w... | 29.578947 | 77 | 0.688612 |
300031c71c91ad83d18767a77b2cc0ee03e6ed16 | 6,428 | py | Python | invtorch/nn/modules/module.py | xmodar/invtorch | 74b80be3b4126925e583282b6f78171b99788b37 | [
"Apache-2.0"
] | 14 | 2021-11-18T11:26:11.000Z | 2022-01-20T13:29:52.000Z | invtorch/nn/modules/module.py | xmodar/invtorch | 74b80be3b4126925e583282b6f78171b99788b37 | [
"Apache-2.0"
] | null | null | null | invtorch/nn/modules/module.py | xmodar/invtorch | 74b80be3b4126925e583282b6f78171b99788b37 | [
"Apache-2.0"
] | null | null | null | """Base Invertible Modules"""
import itertools
from contextlib import contextmanager
import torch
from torch import nn
from ...autograd.grad_mode import backward_mode, dry_mode
from ...utils.checkpoint import checkpoint
from ...utils.tools import pack
__all__ = ['Module']
class Module(nn.Module):
"""Base inver... | 34.374332 | 79 | 0.60781 |
f3f3b0001b880c6b44df6ecf5d674e70a6eb0283 | 1,420 | py | Python | custom_components/samsungtv_encrypted/PySmartCrypto/command_encryption.py | MizterB/ha-samsungtv-encrypted | 6b81a311b5d40b4a7f3311917ba7eade91bb6cd5 | [
"Apache-2.0"
] | 41 | 2020-03-08T23:49:29.000Z | 2022-01-25T01:33:57.000Z | custom_components/samsungtv_encrypted/PySmartCrypto/command_encryption.py | MizterB/ha-samsungtv-encrypted | 6b81a311b5d40b4a7f3311917ba7eade91bb6cd5 | [
"Apache-2.0"
] | 88 | 2020-03-08T23:11:36.000Z | 2022-03-15T01:32:21.000Z | custom_components/samsungtv_encrypted/PySmartCrypto/command_encryption.py | MizterB/ha-samsungtv-encrypted | 6b81a311b5d40b4a7f3311917ba7eade91bb6cd5 | [
"Apache-2.0"
] | 29 | 2020-03-16T09:24:41.000Z | 2022-03-14T06:44:46.000Z | from hashlib import md5
from base64 import b64decode
from base64 import b64encode
from Crypto.Cipher import AES
import binascii
# Padding for the input string --not
# related to encryption itself.
BLOCK_SIZE = 16 # Bytes
pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * \
chr(BLOCK_SIZE - len(s) % BLOCK_S... | 32.272727 | 185 | 0.689437 |
b69420463a7e079e9c7dc894a50509a0273a42c2 | 548 | py | Python | tutorial/matplotlib-tutorial/image_clip_path.py | zixia/python-facenet | d86e0c49a9ce413bef6e58a19a9f723aadcef968 | [
"MIT"
] | 4 | 2018-06-11T03:02:49.000Z | 2018-07-11T07:18:52.000Z | tutorial/matplotlib-tutorial/image_clip_path.py | zixia/python-facenet | d86e0c49a9ce413bef6e58a19a9f723aadcef968 | [
"MIT"
] | null | null | null | tutorial/matplotlib-tutorial/image_clip_path.py | zixia/python-facenet | d86e0c49a9ce413bef6e58a19a9f723aadcef968 | [
"MIT"
] | 2 | 2017-08-31T05:35:36.000Z | 2018-10-11T16:42:15.000Z | """
http://matplotlib.org/examples/images_contours_and_fields/image_demo_clip_path.html
Demo of image that's been clipped by a circular patch.
"""
# %%
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.cbook as cbook
image_file = cbook.get_sample_data('grace_hopper.png')
image = p... | 21.076923 | 83 | 0.748175 |
5bfc9e528b1e39f02302fc0e428e17c864c94289 | 5,612 | py | Python | mosdef_code/spectra/check_line_broadness.py | brianlorenz/code | e24277bbb1deb2f0488f7b6e1f28c7b633c2c12b | [
"MIT"
] | null | null | null | mosdef_code/spectra/check_line_broadness.py | brianlorenz/code | e24277bbb1deb2f0488f7b6e1f28c7b633c2c12b | [
"MIT"
] | null | null | null | mosdef_code/spectra/check_line_broadness.py | brianlorenz/code | e24277bbb1deb2f0488f7b6e1f28c7b633c2c12b | [
"MIT"
] | 1 | 2021-12-08T01:20:12.000Z | 2021-12-08T01:20:12.000Z |
import initialize_mosdef_dirs as imd
from astropy.io import ascii
import pandas as pd
import numpy as np
from scipy import interpolate
import scipy.integrate as integrate
from scipy.optimize import curve_fit
import os
import matplotlib.pyplot as plt
def check_broadness(groupID, run_name, rest_wave, width=15):
... | 37.413333 | 135 | 0.656272 |
a8a6be3d2b5cea8702763c75c0ac12ef819b87a2 | 10,868 | py | Python | applications/camera_calibration/scripts/create_calibration_pattern.py | xiesc/camera_calibration | 8bd0071a1175894101f6dd204345297010756c09 | [
"BSD-3-Clause"
] | 1 | 2020-11-03T13:25:49.000Z | 2020-11-03T13:25:49.000Z | applications/camera_calibration/scripts/create_calibration_pattern.py | xiesc/camera_calibration | 8bd0071a1175894101f6dd204345297010756c09 | [
"BSD-3-Clause"
] | null | null | null | applications/camera_calibration/scripts/create_calibration_pattern.py | xiesc/camera_calibration | 8bd0071a1175894101f6dd204345297010756c09 | [
"BSD-3-Clause"
] | 1 | 2020-12-05T07:41:04.000Z | 2020-12-05T07:41:04.000Z | # Copyright 2019 ETH Zürich, Thomas Schöps
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following dis... | 43.822581 | 157 | 0.688075 |
5957f574864cfc36583d783bd5ac791643dbe615 | 605 | py | Python | haokan.py | squ33ker/Dlink_Parse | b8ea35e64e480720fff5f466c3959e631b379abf | [
"MIT"
] | 142 | 2021-04-10T01:54:06.000Z | 2022-03-29T11:22:43.000Z | haokan.py | squ33ker/Dlink_Parse | b8ea35e64e480720fff5f466c3959e631b379abf | [
"MIT"
] | 4 | 2021-04-11T00:50:30.000Z | 2021-09-14T13:00:56.000Z | haokan.py | squ33ker/Dlink_Parse | b8ea35e64e480720fff5f466c3959e631b379abf | [
"MIT"
] | 57 | 2021-05-21T09:58:12.000Z | 2022-03-31T06:49:01.000Z | import requests
import re
import json
class haokan:
def __init__(self, url):
self.url = url
self.headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36¬",
}
def getJson(self, text):... | 24.2 | 149 | 0.601653 |
a7a404ccde43b5c0cef09258b3ff7c189c0ea9a1 | 2,234 | py | Python | euca2ools/commands/iam/listmfadevices.py | sjones4/euca2ools | 03b0e421eeebd8f402422a0ad6994bd6ee4e4127 | [
"BSD-2-Clause"
] | null | null | null | euca2ools/commands/iam/listmfadevices.py | sjones4/euca2ools | 03b0e421eeebd8f402422a0ad6994bd6ee4e4127 | [
"BSD-2-Clause"
] | null | null | null | euca2ools/commands/iam/listmfadevices.py | sjones4/euca2ools | 03b0e421eeebd8f402422a0ad6994bd6ee4e4127 | [
"BSD-2-Clause"
] | 2 | 2016-06-24T20:19:40.000Z | 2020-02-05T10:50:19.000Z | # Copyright 2009-2013 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions ... | 42.961538 | 77 | 0.732319 |
ccc97c5de0ae0a6490739b53580e96de914abfa2 | 355 | py | Python | python/148-SortList.py | vermouth1992/Leetcode | 0d7dda52b12f9e01d88fc279243742cd8b4bcfd1 | [
"MIT"
] | null | null | null | python/148-SortList.py | vermouth1992/Leetcode | 0d7dda52b12f9e01d88fc279243742cd8b4bcfd1 | [
"MIT"
] | null | null | null | python/148-SortList.py | vermouth1992/Leetcode | 0d7dda52b12f9e01d88fc279243742cd8b4bcfd1 | [
"MIT"
] | null | null | null | """
Sort a linked list in O(n log n) time using constant space complexity.
"""
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class Solution(object):
def sortList(self, head):
"""
:type head: ListNode
... | 20.882353 | 70 | 0.580282 |
c9fb10966cd84268c6d017f0795fb65c86504e1d | 3,033 | py | Python | pyOCD/flash/flash_stm32f031.py | mesheven/mesh-pyocd-old | 99ecfeeac95820dacab52a1280b0fba6d4f51fc9 | [
"Apache-2.0"
] | null | null | null | pyOCD/flash/flash_stm32f031.py | mesheven/mesh-pyocd-old | 99ecfeeac95820dacab52a1280b0fba6d4f51fc9 | [
"Apache-2.0"
] | null | null | null | pyOCD/flash/flash_stm32f031.py | mesheven/mesh-pyocd-old | 99ecfeeac95820dacab52a1280b0fba6d4f51fc9 | [
"Apache-2.0"
] | null | null | null | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | 54.160714 | 130 | 0.616551 |
ebe7869b55db4736175b00562c3b025ff0c9dd11 | 3,136 | py | Python | rstem/projects/space_invaders/space_invaders_2.py | readysetstem/readysetstem-api | 01e1360f4a28a6783ee1e0fa1bc239dd999de6be | [
"Apache-2.0"
] | 1 | 2018-02-23T20:20:45.000Z | 2018-02-23T20:20:45.000Z | rstem/projects/space_invaders/space_invaders_2.py | readysetstem/readysetstem-api | 01e1360f4a28a6783ee1e0fa1bc239dd999de6be | [
"Apache-2.0"
] | 1 | 2016-10-25T18:00:15.000Z | 2016-10-25T18:00:15.000Z | rstem/projects/space_invaders/space_invaders_2.py | readysetstem/readysetstem-api | 01e1360f4a28a6783ee1e0fa1bc239dd999de6be | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2014, Scott Silver Labs, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 30.745098 | 118 | 0.691008 |
5d505065709ebdb10e4155b2df0e09bd1687992b | 2,545 | py | Python | user.py | Brian-M-code/password-locker | 12ae594f310baa72dd7df6b7f91749418f0b1925 | [
"MIT"
] | null | null | null | user.py | Brian-M-code/password-locker | 12ae594f310baa72dd7df6b7f91749418f0b1925 | [
"MIT"
] | null | null | null | user.py | Brian-M-code/password-locker | 12ae594f310baa72dd7df6b7f91749418f0b1925 | [
"MIT"
] | null | null | null |
import string
import secrets
import pyperclip
import random
class User:
# Class Variables
# global users_list
users_list = []
def __init__(self,first_name,last_name,password):
'''
Method to define the properties for each user object will hold.
'''
# instance variables
self.first_name = first_name... | 24.95098 | 95 | 0.743811 |
ece5985dc043465f4b258f6d25cdc513fb0bf48d | 16,355 | py | Python | tools/test_files/test_vault/less_than_10/rd53_133.py | Astlaan/OpenQL | 404b3edf4406071992e9ad190303b12e143689a0 | [
"Apache-2.0"
] | null | null | null | tools/test_files/test_vault/less_than_10/rd53_133.py | Astlaan/OpenQL | 404b3edf4406071992e9ad190303b12e143689a0 | [
"Apache-2.0"
] | null | null | null | tools/test_files/test_vault/less_than_10/rd53_133.py | Astlaan/OpenQL | 404b3edf4406071992e9ad190303b12e143689a0 | [
"Apache-2.0"
] | null | null | null | from openql import openql as ql
import os
import argparse
def circuit(config_file, new_scheduler='yes', scheduler='ASAP', uniform_sched= 'no', sched_commute = 'yes', mapper='base', moves='no', maptiebreak='random', initial_placement='no', output_dir_name='test_output', optimize='no', measurement=True, log_level='LOG_W... | 25.755906 | 270 | 0.467441 |
d02c5af1eb177db138aeed094c68cd69db10c397 | 5,860 | py | Python | nbdev/sync.py | theccalderon/nbdev | 59a49fbc587894d7ef73970e762cca8c92cf5a13 | [
"Apache-2.0"
] | 1 | 2021-02-15T05:48:35.000Z | 2021-02-15T05:48:35.000Z | nbdev/sync.py | bhoov/nbdev | 0e071dc35c7cafebd7945367badb5894cab21c2e | [
"Apache-2.0"
] | 2 | 2021-09-28T01:11:23.000Z | 2022-02-26T06:50:19.000Z | nbdev/sync.py | bhoov/nbdev | 0e071dc35c7cafebd7945367badb5894cab21c2e | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_sync.ipynb (unless otherwise specified).
__all__ = ['get_name', 'qual_name', 'source_nb', 'relimport2name', 'script2notebook', 'diff_nb_script']
# Cell
from .imports import *
from .export import *
# Cell
def _get_property_name(p):
"Get the name of property `p`"
... | 40.413793 | 129 | 0.630546 |
e56185c5f39178ae4229787ab6a81a31bde8ef49 | 1,167 | py | Python | week1/ex6.py | kingpeen/My_Pynet | 328b5b3441ace4e3bbd524c726833a077c2e2dd6 | [
"Apache-2.0"
] | null | null | null | week1/ex6.py | kingpeen/My_Pynet | 328b5b3441ace4e3bbd524c726833a077c2e2dd6 | [
"Apache-2.0"
] | null | null | null | week1/ex6.py | kingpeen/My_Pynet | 328b5b3441ace4e3bbd524c726833a077c2e2dd6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
Write a Python program that creates a list. One of the elements of the list
should be a dictionary with at least two keys. Write this list out to a file
using both YAML and JSON formats. The YAML file should be in the expanded form.
'''
import yaml
import json
def main():
'''
Write ... | 23.34 | 80 | 0.60497 |
c831f8ff1cdc1e72723d6a5ac532a984bf6fd3aa | 6,498 | py | Python | lib/services/vloadbalancer/ncloud_vloadbalancer/model/set_target_group_description_response.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 12 | 2018-11-20T04:30:49.000Z | 2021-11-09T12:34:26.000Z | lib/services/vloadbalancer/ncloud_vloadbalancer/model/set_target_group_description_response.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 1 | 2019-01-24T15:56:15.000Z | 2019-05-31T07:56:55.000Z | lib/services/vloadbalancer/ncloud_vloadbalancer/model/set_target_group_description_response.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 6 | 2018-06-29T03:45:50.000Z | 2022-03-18T01:51:45.000Z | # coding: utf-8
"""
vloadbalancer
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from ncloud_vloadbalancer.model.target_group import TargetGroup # noqa: F401,E501
class SetTargetGroupDescriptionResponse(object):
"""NOTE: Th... | 30.083333 | 134 | 0.628347 |
4395c2d4e74cdfd6ac4fe48c550ffe4ae4f0b5be | 5,174 | py | Python | dead_hosts/launcher/updater/pyfunceble_config.py | dead-hosts/infrastructure-launcher | 23287ef68007532958a3385703e01fbab651a0dc | [
"MIT"
] | 4 | 2020-04-20T01:15:44.000Z | 2021-06-17T07:55:11.000Z | dead_hosts/launcher/updater/pyfunceble_config.py | dead-hosts/infrastructure-launcher | 23287ef68007532958a3385703e01fbab651a0dc | [
"MIT"
] | 2 | 2020-05-21T02:49:24.000Z | 2020-06-06T13:06:44.000Z | dead_hosts/launcher/updater/pyfunceble_config.py | dead-hosts/infrastructure-launcher | 23287ef68007532958a3385703e01fbab651a0dc | [
"MIT"
] | 2 | 2020-05-21T05:48:35.000Z | 2021-07-05T06:47:20.000Z | """
Dead Hosts's launcher - The launcher of the Dead-Hosts infrastructure.
Provides the updater of the PyFunceble configuration.
Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Project link:
https://github.com/dead-hosts/infrastructure-launcher
License:
::
MIT License
Copyright (c)... | 33.597403 | 88 | 0.676846 |
5750afa4293cdacab8dd00966128e781c96f2a36 | 19,271 | py | Python | robot/transform.py | sgowda/brain-python-interface | 708e2a5229d0496a8ce9de32bda66f0925d366d9 | [
"Apache-2.0"
] | 7 | 2015-08-25T00:28:49.000Z | 2020-04-14T22:58:51.000Z | robot/transform.py | sgowda/brain-python-interface | 708e2a5229d0496a8ce9de32bda66f0925d366d9 | [
"Apache-2.0"
] | 89 | 2020-08-03T16:54:08.000Z | 2022-03-09T19:56:19.000Z | robot/transform.py | sgowda/brain-python-interface | 708e2a5229d0496a8ce9de32bda66f0925d366d9 | [
"Apache-2.0"
] | 4 | 2016-10-05T17:54:26.000Z | 2020-08-06T15:37:09.000Z | """
Primitive operations for 3x3 orthonormal and 4x4 homogeneous matrices.
@author: Peter Corke
@copyright: Peter Corke
"""
from numpy import *
from robot.utility import *
from numpy.linalg import norm
from .Quaternion import *
def rotx(theta):
"""
Rotation about X-axis
@type theta: number
@par... | 27.490728 | 103 | 0.518032 |
5c3adfda9d1f2b50a8ab55b3a95b306407ca1588 | 24,286 | py | Python | python_modules/dagster/dagster/core/workspace/context.py | dehume/dagster | 3b55c4e864775b7a70ed8ff539629317a1202505 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/workspace/context.py | dehume/dagster | 3b55c4e864775b7a70ed8ff539629317a1202505 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/workspace/context.py | dehume/dagster | 3b55c4e864775b7a70ed8ff539629317a1202505 | [
"Apache-2.0"
] | null | null | null | import sys
import threading
import time
import warnings
from abc import ABC, abstractmethod
from collections import OrderedDict
from contextlib import ExitStack
from typing import TYPE_CHECKING, Dict, List, Optional, Union, cast
from dagster import check
from dagster.core.errors import DagsterInvariantViolationError, ... | 35.767305 | 102 | 0.680474 |
a4fd95cdbbffd86f4c4e7ef02992638073ae43c5 | 1,109 | py | Python | quickstart.py | erickmartinez/pydlcp | 611eceeb0816af432e1c06ee171376af2bc13a0e | [
"BSD-3-Clause"
] | null | null | null | quickstart.py | erickmartinez/pydlcp | 611eceeb0816af432e1c06ee171376af2bc13a0e | [
"BSD-3-Clause"
] | null | null | null | quickstart.py | erickmartinez/pydlcp | 611eceeb0816af432e1c06ee171376af2bc13a0e | [
"BSD-3-Clause"
] | null | null | null | import pydlcp.arduino_board as ard
import pydlcp.controller as controller
import configparser
import os
settings = r'G:\Shared drives\FenningLab2\LabData\ImpedanceAnalyzer\DLCP\20200922_training\D69_clean_low_frequency.ini'
arduino_com = 'COM8'
unit_name = 'HP1'
pin = 1
pinMappings = {
'keithley': 'A0', 'fan': '... | 30.805556 | 120 | 0.679892 |
7ed9cae26cadfbf52b8679b7edb377dff7bd90d7 | 320 | py | Python | 2018/day-01/part2.py | amochtar/adventofcode | 292e7f00a1e19d2149d00246b0a77fedfcd3bd08 | [
"MIT"
] | 1 | 2019-12-27T22:36:30.000Z | 2019-12-27T22:36:30.000Z | 2018/day-01/part2.py | amochtar/adventofcode | 292e7f00a1e19d2149d00246b0a77fedfcd3bd08 | [
"MIT"
] | null | null | null | 2018/day-01/part2.py | amochtar/adventofcode | 292e7f00a1e19d2149d00246b0a77fedfcd3bd08 | [
"MIT"
] | null | null | null | def solve(input):
f = 0
ff = set([f])
frs = list(map(int, input))
while True:
for fr in frs:
f += fr
if f in ff:
print(f)
return
ff.add(f)
with open('input.txt', 'r') as f:
input = f.read().splitlines()
solve(input)
| 16.842105 | 33 | 0.425 |
9212a5939104a181dcdd48fe7d37ab61603d3868 | 593 | gyp | Python | deps/libgdal/gyp-formats/mrsid_lidar.gyp | seraph144/node-gdal | c6987705ced2b4eba8be123ececa40be80e56694 | [
"Apache-2.0"
] | null | null | null | deps/libgdal/gyp-formats/mrsid_lidar.gyp | seraph144/node-gdal | c6987705ced2b4eba8be123ececa40be80e56694 | [
"Apache-2.0"
] | null | null | null | deps/libgdal/gyp-formats/mrsid_lidar.gyp | seraph144/node-gdal | c6987705ced2b4eba8be123ececa40be80e56694 | [
"Apache-2.0"
] | null | null | null | {
"includes": [
"../common.gypi"
],
"targets": [
{
"target_name": "libgdal_mrsid_lidar_frmt",
"type": "static_library",
"sources": [
"../gdal/frmts/mrsid_lidar/gdal_MG4Lidar.cpp"
],
"include_dirs": [
... | 29.65 | 108 | 0.473862 |
c94b8eaa127adee64848c9105b93aad25d5c9b8b | 2,573 | py | Python | generate_flashcards.py | district10/shuangpin-heatmap | 0a299d4f567673648e5ca08db7744b0be1d90951 | [
"MIT"
] | 9 | 2020-03-09T14:27:10.000Z | 2022-01-11T13:57:53.000Z | generate_flashcards.py | district10/shuangpin-heatmap | 0a299d4f567673648e5ca08db7744b0be1d90951 | [
"MIT"
] | null | null | null | generate_flashcards.py | district10/shuangpin-heatmap | 0a299d4f567673648e5ca08db7744b0be1d90951 | [
"MIT"
] | 2 | 2021-01-13T11:27:36.000Z | 2022-03-07T16:37:52.000Z | import pygal
import pypinyin
from typing import Union, Set, Dict, List, Any, Tuple, Optional
import os
import sys
import json
from collections import defaultdict
import numpy as np
import re
from pprint import pprint
from shuangpin_heatmap import pinyin2shuangpin, mkdir_p
import shutil
PWD = os.path.abspath(os.path.d... | 31.765432 | 100 | 0.487369 |
7ffe8debb982828d2a4bdc7cbc20ff9c992e3bbb | 36,292 | py | Python | research/object_detection/utils/config_util.py | Santhanalakshmimano/SpeedBump_detection_usingCV | 7b68f260cf1351d757983a48c5a62e063df807c9 | [
"Apache-2.0"
] | null | null | null | research/object_detection/utils/config_util.py | Santhanalakshmimano/SpeedBump_detection_usingCV | 7b68f260cf1351d757983a48c5a62e063df807c9 | [
"Apache-2.0"
] | null | null | null | research/object_detection/utils/config_util.py | Santhanalakshmimano/SpeedBump_detection_usingCV | 7b68f260cf1351d757983a48c5a62e063df807c9 | [
"Apache-2.0"
] | 1 | 2021-07-13T01:22:08.000Z | 2021-07-13T01:22:08.000Z | # Copyright 2017 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... | 38.814973 | 80 | 0.7473 |
f66aa47124f47c307ae7f2ee24b939df77566559 | 2,648 | py | Python | app/models.py | tinabayi/blogs | 690db73b8f2b9976217e19ab432cc42dd0fd83fd | [
"MIT"
] | null | null | null | app/models.py | tinabayi/blogs | 690db73b8f2b9976217e19ab432cc42dd0fd83fd | [
"MIT"
] | null | null | null | app/models.py | tinabayi/blogs | 690db73b8f2b9976217e19ab432cc42dd0fd83fd | [
"MIT"
] | null | null | null | from . import db
from werkzeug.security import generate_password_hash,check_password_hash
from flask_login import UserMixin
from . import login_manager
class User(UserMixin,db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer,primary_key = True)
username = db.Column(db.String(255),index = True)
... | 24.072727 | 74 | 0.646903 |
eeda4fc09d510ab7c3a8844b50360f132d3934eb | 1,374 | py | Python | cred-append.py | BlackDiverX/CredCompilator | 737cc3e7e7992cd7c49dd5f5222371d275f1d4a1 | [
"Apache-2.0"
] | 6 | 2017-11-02T16:26:10.000Z | 2021-06-07T10:01:29.000Z | cred-append.py | BlackDiverX/CredCompilator | 737cc3e7e7992cd7c49dd5f5222371d275f1d4a1 | [
"Apache-2.0"
] | null | null | null | cred-append.py | BlackDiverX/CredCompilator | 737cc3e7e7992cd7c49dd5f5222371d275f1d4a1 | [
"Apache-2.0"
] | 1 | 2019-09-04T12:03:09.000Z | 2019-09-04T12:03:09.000Z | #!/usr/bin/python
# cred-append.py
# Version: 1.0
# License: Apache License Version 2.0
# Author: Georgii Starostin
# E-mail# blackdiverx@gmail.com
# Site: http://BlackDiver.net
import sys
if len (sys.argv) != 6:
print ("Утилита для добавления текста в начало или конец строки.")
print ("Синтаксис:")
pr... | 28.040816 | 88 | 0.614993 |
32a46fe7ceb6cfa9bbefaad5a1bdfa42c1fccef5 | 7,253 | py | Python | src/audio/aubio/python/tests/test_specdesc.py | vrushank-agrawal/video_editor_BX23 | 3a458114f499e0ba3d1c61afde2b9d30bc76459b | [
"Apache-2.0"
] | null | null | null | src/audio/aubio/python/tests/test_specdesc.py | vrushank-agrawal/video_editor_BX23 | 3a458114f499e0ba3d1c61afde2b9d30bc76459b | [
"Apache-2.0"
] | null | null | null | src/audio/aubio/python/tests/test_specdesc.py | vrushank-agrawal/video_editor_BX23 | 3a458114f499e0ba3d1c61afde2b9d30bc76459b | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
from numpy.testing import TestCase, assert_equal, assert_almost_equal
from numpy import random, arange, log, zeros
from aubio import specdesc, cvec, float_type
methods = ["default",
"energy",
"hfc",
"complex",
"phase",
"specdiff",
"kl",
"mkl",
"specflux",... | 31.128755 | 82 | 0.524886 |
ddc83e627025704c5e7fbc401781c975fad633b4 | 648 | py | Python | e2e/scripts/st_info.py | kamito/streamlit | af68a915b3a1f37ddd411d081e430dad70869c45 | [
"Apache-2.0"
] | 19,099 | 2019-08-25T14:00:15.000Z | 2022-03-31T21:00:28.000Z | e2e/scripts/st_info.py | linzhou-zhong/streamlit | fde1b548e4bf2d2e5a97b5c3fcf655d43134b342 | [
"Apache-2.0"
] | 3,078 | 2019-08-25T19:50:14.000Z | 2022-03-31T23:26:14.000Z | e2e/scripts/st_info.py | linzhou-zhong/streamlit | fde1b548e4bf2d2e5a97b5c3fcf655d43134b342 | [
"Apache-2.0"
] | 1,892 | 2019-08-26T04:44:24.000Z | 2022-03-30T16:11:51.000Z | # Copyright 2018-2021 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 36 | 74 | 0.762346 |
20d9a4c2812c63b13e845105f6b7111076c05881 | 1,471 | py | Python | machinelearn2.py | varnaugj/Python-Early-Codes | 3b659529c65dc608eaf41ec5d5ffaa4c18704946 | [
"MIT"
] | null | null | null | machinelearn2.py | varnaugj/Python-Early-Codes | 3b659529c65dc608eaf41ec5d5ffaa4c18704946 | [
"MIT"
] | null | null | null | machinelearn2.py | varnaugj/Python-Early-Codes | 3b659529c65dc608eaf41ec5d5ffaa4c18704946 | [
"MIT"
] | null | null | null | #News Article specific reader
#import nltk
#from nltk import send_tokenize
#from nltk import word_tokenize
import requests
import newspaper
from bs4 import BeautifulSoup as bs
from newspaper import Article
def news():
#target we want to open
url = 'https://www.cnn.com'
papertest = newspaper.build(u... | 21.014286 | 49 | 0.600272 |
44609016798ad96c96c6d1b464e4a38f819977d8 | 11,761 | py | Python | pandadoc_client/model/document_create_request_content_placeholders.py | PandaDoc/pandadoc-api-python-client | a707c540e788eee485cc338f29ca363acca4973e | [
"MIT"
] | 27 | 2021-11-16T11:30:13.000Z | 2022-03-17T08:56:18.000Z | pandadoc_client/model/document_create_request_content_placeholders.py | PandaDoc/pandadoc-api-python-client | a707c540e788eee485cc338f29ca363acca4973e | [
"MIT"
] | null | null | null | pandadoc_client/model/document_create_request_content_placeholders.py | PandaDoc/pandadoc-api-python-client | a707c540e788eee485cc338f29ca363acca4973e | [
"MIT"
] | 2 | 2021-12-16T13:38:15.000Z | 2022-01-09T00:38:00.000Z | """
PandaDoc Public API
PandaDoc Public API documentation # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from pandadoc_client.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
ca... | 44.381132 | 124 | 0.583539 |
13139a39a5b5ddcc410924d54dba2ad031ca1239 | 1,057 | py | Python | data-handling-scripts/split_rid_newendo.py | bolero2/DeepLearning-dc | 680266128d5a7aff590e2d6b9b71cb340b95c2ab | [
"Apache-2.0"
] | 2 | 2021-04-23T03:49:30.000Z | 2021-04-23T03:49:33.000Z | data-handling-scripts/split_rid_newendo.py | bolero2/DeepLearning-dc | 680266128d5a7aff590e2d6b9b71cb340b95c2ab | [
"Apache-2.0"
] | null | null | null | data-handling-scripts/split_rid_newendo.py | bolero2/DeepLearning-dc | 680266128d5a7aff590e2d6b9b71cb340b95c2ab | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import glob
import os
import random
import shutil as sh
df = pd.read_csv("RID_for_test_newENDO.csv")
rid = list(df.loc[df['GUBUN'] == "TRAIN"]['RID'])
print(f'RID= {rid}')
root = os.getcwd()
print(root)
os.chdir(f'{root}/yolo_dataset/')
for imagename in glob.glob('*.jpg'):
three = imagename[... | 25.166667 | 77 | 0.535478 |
7d07851c3aa3f4962dd40b267f3fdf81c60126f3 | 3,492 | py | Python | src/mykrobe/typing/models/variant.py | chamilaadikaram/mykrobe | 2bcebf7b37f1c1416f397374da6ebfd02ce1aead | [
"MIT"
] | 1 | 2020-08-08T01:08:01.000Z | 2020-08-08T01:08:01.000Z | src/mykrobe/typing/models/variant.py | chamilaadikaram/mykrobe | 2bcebf7b37f1c1416f397374da6ebfd02ce1aead | [
"MIT"
] | null | null | null | src/mykrobe/typing/models/variant.py | chamilaadikaram/mykrobe | 2bcebf7b37f1c1416f397374da6ebfd02ce1aead | [
"MIT"
] | null | null | null | import datetime
import json
import logging
logger = logging.getLogger(__name__)
class VariantProbeCoverage(object):
def __init__(self, reference_coverages,
alternate_coverages,
var_name=None,
params={}):
self.reference_coverages = reference_coverages
... | 32.333333 | 83 | 0.684994 |
0a61e3a9ac1bd1b8232eb8bb893b97a4327bc46c | 8,166 | py | Python | Lib/concurrent/futures/thread.py | MaxNoe/cpython | 29d018aa63b72161cfc67602dc3dbd386272da64 | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2021-03-26T10:54:41.000Z | 2021-03-26T10:54:41.000Z | Lib/concurrent/futures/thread.py | MaxNoe/cpython | 29d018aa63b72161cfc67602dc3dbd386272da64 | [
"CNRI-Python-GPL-Compatible"
] | 4 | 2022-03-30T01:50:22.000Z | 2022-03-30T01:50:28.000Z | Lib/concurrent/futures/thread.py | MaxNoe/cpython | 29d018aa63b72161cfc67602dc3dbd386272da64 | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2021-02-01T20:44:21.000Z | 2021-02-01T20:44:21.000Z | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ThreadPoolExecutor."""
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
import atexit
from concurrent.futures import _base
import itertools
import queue
import threading
import weakref
import os
# Wo... | 36.950226 | 82 | 0.59613 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.