hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5e37960667eb3583128774bf429ae73437019954 | 1,848 | py | Python | bin/config.py | strauch-co/ahb2apb_bridge_vip | 9e9c9990dedb981f3de660aa3d1d14e66604abe0 | [
"MIT"
] | null | null | null | bin/config.py | strauch-co/ahb2apb_bridge_vip | 9e9c9990dedb981f3de660aa3d1d14e66604abe0 | [
"MIT"
] | null | null | null | bin/config.py | strauch-co/ahb2apb_bridge_vip | 9e9c9990dedb981f3de660aa3d1d14e66604abe0 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
##------------------------------------------------------------------------------
## Copyright (c) 2021 by Strauch Consulting, LLC. and Xpeerant, Inc.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## Y... | 34.222222 | 80 | 0.510281 |
a01f8ad7e173ff4e19a8a9f96955453a93bd2227 | 182 | py | Python | robot_framework/visualization/base_visualization.py | abarcis/robot-framework | a2cef7850784ae4c12b47fc7fb297f3772c2e2fe | [
"MIT"
] | null | null | null | robot_framework/visualization/base_visualization.py | abarcis/robot-framework | a2cef7850784ae4c12b47fc7fb297f3772c2e2fe | [
"MIT"
] | null | null | null | robot_framework/visualization/base_visualization.py | abarcis/robot-framework | a2cef7850784ae4c12b47fc7fb297f3772c2e2fe | [
"MIT"
] | null | null | null | #! /usr/bin/env python
class BaseVisualization:
def update(self, states, states_log=None):
raise NotImplementedError()
def reinit(self, params=None):
pass
| 18.2 | 46 | 0.664835 |
fe97e96e1680b2ca779cc192a08bb2a62d8308ff | 1,099 | py | Python | ros2_message_converter/json_message_converter.py | ubica-robotics/ros2_message_converter | a383a06bdbe47288d2ab13db2e6c71fbc25cae8a | [
"BSD-3-Clause"
] | 2 | 2021-09-09T12:50:25.000Z | 2021-09-17T12:19:39.000Z | ros2_message_converter/json_message_converter.py | ubica-robotics/ros2_message_converter | a383a06bdbe47288d2ab13db2e6c71fbc25cae8a | [
"BSD-3-Clause"
] | 3 | 2021-10-04T11:30:07.000Z | 2021-12-01T07:51:57.000Z | ros2_message_converter/json_message_converter.py | ubica-robotics/ros2_message_converter | a383a06bdbe47288d2ab13db2e6c71fbc25cae8a | [
"BSD-3-Clause"
] | 2 | 2021-09-21T09:54:12.000Z | 2021-11-26T21:06:58.000Z | import json
from ros2_message_converter import message_converter
def convert_json_to_ros_message(message_type, json_message, strict_mode=True):
"""
Takes in the message type and a JSON-formatted string and returns a ROS
message.
If strict_mode is set, an exception will be thrown if the json message co... | 36.633333 | 113 | 0.747043 |
98fe6b555f4d0e7c40db423b00e8d1fee48d9bfd | 1,302 | py | Python | pyemc/test_stress.py | numerodix/memcache.rs | fec9ccd0e762cbe0d74fa5199594c9a59e16918b | [
"MIT"
] | 63 | 2016-01-10T22:08:46.000Z | 2019-08-21T20:55:07.000Z | pyemc/test_stress.py | numerodix/memcache.rs | fec9ccd0e762cbe0d74fa5199594c9a59e16918b | [
"MIT"
] | 1 | 2016-10-06T21:24:07.000Z | 2017-01-29T16:12:56.000Z | pyemc/test_stress.py | numerodix/memcache.rs | fec9ccd0e762cbe0d74fa5199594c9a59e16918b | [
"MIT"
] | 6 | 2016-01-12T14:15:17.000Z | 2020-09-24T04:01:38.000Z | import time
from pyemc.abstractions.test_api import TestCase
class TestStress(TestCase):
def run_bench(self, func, loops, desc):
# untimed warmup
warmup_loops = loops / 3
for _ in xrange(loops):
func()
# timed execution
start_time = time.time()
for _ i... | 25.529412 | 78 | 0.571429 |
73ff5d28c14572b2bd952435101e045f821c5760 | 1,231 | py | Python | main.py | guard-project/cb-manager | 7dc7c7b9beacc45236674642f4b64373a2f4cdb3 | [
"MIT"
] | 2 | 2020-05-14T00:32:32.000Z | 2022-02-28T21:08:16.000Z | main.py | guard-project/cb-manager | 7dc7c7b9beacc45236674642f4b64373a2f4cdb3 | [
"MIT"
] | 4 | 2020-12-09T16:22:45.000Z | 2021-04-06T09:58:01.000Z | main.py | guard-project/cb-manager | 7dc7c7b9beacc45236674642f4b64373a2f4cdb3 | [
"MIT"
] | null | null | null | import os
path = os.path.abspath(__file__)
dir_path = os.path.dirname(path)
os.chdir(dir_path)
import waitress # noqa: E402
from rich import pretty, traceback # noqa: E402
from rich.console import Console # noqa: E402
from rich.panel import Panel # noqa: E402
pretty.install()
traceback.install(show_locals=False)... | 33.27027 | 74 | 0.727864 |
4a12df7ee6f62c095aa1451c14fc7fbf4d9fafeb | 10,554 | py | Python | evology/research/MCarloLongRuns/archiv/PopulationDynamics.py | aymericvie/evology | 8f00d94dee7208be5a5bdd0375a9d6ced25097f4 | [
"Apache-2.0"
] | null | null | null | evology/research/MCarloLongRuns/archiv/PopulationDynamics.py | aymericvie/evology | 8f00d94dee7208be5a5bdd0375a9d6ced25097f4 | [
"Apache-2.0"
] | 2 | 2022-01-10T02:10:56.000Z | 2022-01-14T03:41:42.000Z | evology/research/MCarloLongRuns/archiv/PopulationDynamics.py | aymericvie/evology | 8f00d94dee7208be5a5bdd0375a9d6ced25097f4 | [
"Apache-2.0"
] | null | null | null | """
This experiment investigates how learning rates and reinvestment rates affect population dynamics.
It takes a fixed initial condition (wealth coordinates), time horizon and population size.
"""
# Imports
import numpy as np
import pandas as pd
import sys
if sys.platform == "darwin":
sys.path.append("/Users/a... | 23.40133 | 99 | 0.538185 |
5555e48d548861a9a649249c2431e3d418af9c57 | 3,792 | py | Python | appengine/findit/findit_v2/model/test/luci_build_test.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | null | null | null | appengine/findit/findit_v2/model/test/luci_build_test.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | appengine/findit/findit_v2/model/test/luci_build_test.py | NDevTK/chromium-infra | d38e088e158d81f7f2065a38aa1ea1894f735ec4 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 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.
from datetime import datetime
import mock
from go.chromium.org.luci.buildbucket.proto import common_pb2
from go.chromium.org.luci.buildbucket.proto.build_pb... | 38.30303 | 78 | 0.714926 |
547225ed5520a6ab6247a523be1c4eeb45c97807 | 2,695 | py | Python | shaystack/__init__.py | pprados/shaystack | 5bd73173d33099213515c1cf3311aa76aba4d6c9 | [
"BSD-2-Clause"
] | 1 | 2021-03-04T10:36:33.000Z | 2021-03-04T10:36:33.000Z | shaystack/__init__.py | pprados/shaystack | 5bd73173d33099213515c1cf3311aa76aba4d6c9 | [
"BSD-2-Clause"
] | 7 | 2021-03-19T07:31:22.000Z | 2021-03-26T12:31:45.000Z | shaystack/__init__.py | pprados/shaystack | 5bd73173d33099213515c1cf3311aa76aba4d6c9 | [
"BSD-2-Clause"
] | 1 | 2021-04-19T07:48:21.000Z | 2021-04-19T07:48:21.000Z | # -*- coding: utf-8 -*-
# Haystack module
# See the accompanying LICENSE file.
# (C) 2016 VRT Systems
# (C) 2021 Engie Digital
#
# vim: set ts=4 sts=4 et tw=78 sw=4 si:
"""
Implementation of Haystack project https://www.project-haystack.org/
Propose API :
- to read or write Haystack file (Zinc, JSon, CSV)
- to manipul... | 30.280899 | 105 | 0.643785 |
aa1c36674710b6750c6c0294c4c82e790f013c44 | 16,096 | py | Python | nebulousAD/modimpacket/examples/ntlmrelayx/servers/httprelayserver.py | BraveLittleRoaster/nebulousAD | 37a44f131d13f1668a73b61f2444ad93b9e657cc | [
"Apache-2.0",
"MIT"
] | 130 | 2019-08-06T22:23:28.000Z | 2022-02-07T02:47:52.000Z | nebulousAD/modimpacket/examples/ntlmrelayx/servers/httprelayserver.py | BraveLittleRoaster/nebulousAD | 37a44f131d13f1668a73b61f2444ad93b9e657cc | [
"Apache-2.0",
"MIT"
] | 2 | 2019-09-16T09:08:36.000Z | 2020-02-07T10:18:16.000Z | nebulousAD/modimpacket/examples/ntlmrelayx/servers/httprelayserver.py | BraveLittleRoaster/nebulousAD | 37a44f131d13f1668a73b61f2444ad93b9e657cc | [
"Apache-2.0",
"MIT"
] | 21 | 2019-08-07T01:54:33.000Z | 2021-05-07T06:37:26.000Z | # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved.
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# HTTP Relay Server
#
# Authors:
# Alberto Solino (@agsolino)
# Dirk-jan Mo... | 47.904762 | 150 | 0.576106 |
53cd8532155ba48eaa77f1c1d3992b5e4b6d876a | 423 | py | Python | sweets/migrations/0011_sweetshop_email.py | adityapandadev/FoodMaster | ac3de44964bc935d5fa669e3554f693e90813148 | [
"MIT"
] | null | null | null | sweets/migrations/0011_sweetshop_email.py | adityapandadev/FoodMaster | ac3de44964bc935d5fa669e3554f693e90813148 | [
"MIT"
] | null | null | null | sweets/migrations/0011_sweetshop_email.py | adityapandadev/FoodMaster | ac3de44964bc935d5fa669e3554f693e90813148 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-04-19 09:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sweets', '0010_auto_20200418_1307'),
]
operations = [
migrations.AddField(
model_name='sweetshop',
name='email',
... | 22.263158 | 88 | 0.612293 |
23f0e2fdd5745ff4feb8c882a904eaf93d38eced | 1,730 | py | Python | HW4/getIrisData.py | serkanbodur/Deep-Learning-Basics | 10ec82d51523ec5f1d4a422b750f23331bccb4b5 | [
"MIT"
] | null | null | null | HW4/getIrisData.py | serkanbodur/Deep-Learning-Basics | 10ec82d51523ec5f1d4a422b750f23331bccb4b5 | [
"MIT"
] | null | null | null | HW4/getIrisData.py | serkanbodur/Deep-Learning-Basics | 10ec82d51523ec5f1d4a422b750f23331bccb4b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 19 19:25:59 2019
@author: Mysia
"""
import scipy.io
import numpy as np
irisData = scipy.io.loadmat('irisData.mat')
stack = scipy.io.loadmat('stack.mat')
testSet = scipy.io.loadmat('testSet.mat')
trainingSet = scipy.io.loadmat('trainingSet.mat')
y1 = scipy.io... | 25.441176 | 50 | 0.50289 |
1e372bd234a2fcfa94819f51892175747a3c8475 | 1,731 | py | Python | pyts/stressModels/main.py | JensGM/pyTurbSim | 89357e94607e99e5a27e069975684fe8e6a89a9d | [
"Apache-2.0"
] | 8 | 2017-07-24T23:01:28.000Z | 2021-12-06T04:31:23.000Z | pyts/stressModels/main.py | camilledub/pyTurbSim | 69db0d7670afe5b2b386087aa0229a7511ef070d | [
"Apache-2.0"
] | 9 | 2015-04-06T16:01:06.000Z | 2020-06-16T16:51:49.000Z | pyts/stressModels/main.py | camilledub/pyTurbSim | 69db0d7670afe5b2b386087aa0229a7511ef070d | [
"Apache-2.0"
] | 17 | 2015-04-22T15:27:28.000Z | 2021-11-20T08:10:16.000Z | from .base import stressModelBase, stressObj
class uniform(stressModelBase):
"""Uniform Reynold's stress model.
In this model each component of the Reynold's stress can be
specified explicitly, but the values are uniform in space.
Parameters
----------
upvp_ : float
The u'v' com... | 29.844828 | 88 | 0.476603 |
193d2033e69b69708089eae4d287a202b7f389a6 | 405 | py | Python | Stereo/TestStereo.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | Stereo/TestStereo.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | Stereo/TestStereo.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | import numpy as np
import cv2
from matplotlib import pyplot as plt
imgL = cv2.imread('imL.png',0)
imgR = cv2.imread('imR.png',0)
print imgL.shape, imgR.shape
# Print class
print(type(imgL).__name__)
# Show image DOESNT WORK
plt.imshow(imgL,'gray')
plt.show()
stereo = cv2.StereoBM_create(numDisparities=16, blockSi... | 19.285714 | 61 | 0.745679 |
f3f3d248a3d133d2d1714cd41d79f24320d3a487 | 78,549 | py | Python | oldversions/V14.py | outkine/Ascension | 1b942a853558cec2c94a312936bf2bbae3b1ffda | [
"MIT"
] | 1 | 2017-10-27T14:35:36.000Z | 2017-10-27T14:35:36.000Z | oldversions/V14.py | Jetmate/Ascension | 1b942a853558cec2c94a312936bf2bbae3b1ffda | [
"MIT"
] | null | null | null | oldversions/V14.py | Jetmate/Ascension | 1b942a853558cec2c94a312936bf2bbae3b1ffda | [
"MIT"
] | null | null | null | from math import sqrt
import pygame as pygame
from pygame.locals import *
pygame.init()
def get_list(l, indexes):
return [l[i] for i in indexes]
def polarity(n):
if n == 0:
return n
return n / abs(n)
def combine_lists(l1, l2, sign):
l1 = list(l1)
for i in range(2)... | 47.779197 | 133 | 0.52655 |
7f4bea60e6882845275b4d1773fa13b51b383b99 | 13,019 | py | Python | dymos/transcriptions/common/control_group.py | naylor-b/dymos | 56ee72041056ae20c3332d060e291c4da93844b1 | [
"Apache-2.0"
] | null | null | null | dymos/transcriptions/common/control_group.py | naylor-b/dymos | 56ee72041056ae20c3332d060e291c4da93844b1 | [
"Apache-2.0"
] | null | null | null | dymos/transcriptions/common/control_group.py | naylor-b/dymos | 56ee72041056ae20c3332d060e291c4da93844b1 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, division
from six import string_types, iteritems
import numpy as np
from openmdao.api import ExplicitComponent, Group, IndepVarComp
from ..grid_data import GridData
from ...utils.misc import get_rate_units, CoerceDesvar
from ...utils.constants import INF_BOUND
class ControlI... | 43.687919 | 98 | 0.571549 |
cf069335756ba5c958e0b1f2d3d09bc66cfb0165 | 5,195 | py | Python | Scrapers/commons.py | Eric-Canas/bet-arbitrage-analysis | ac1b6939a7688bcefeb3e53fbd584adf3a2cb16c | [
"MIT"
] | 3 | 2021-07-21T16:20:01.000Z | 2022-03-27T18:25:09.000Z | Scrapers/commons.py | Eric-Canas/bet-arbitrage-analysis | ac1b6939a7688bcefeb3e53fbd584adf3a2cb16c | [
"MIT"
] | 1 | 2021-06-28T18:08:19.000Z | 2021-06-28T18:35:26.000Z | Scrapers/commons.py | Eric-Canas/bet-arbitrage-analysis | ac1b6939a7688bcefeb3e53fbd584adf3a2cb16c | [
"MIT"
] | null | null | null | from Constants import *
import numpy as np
#Defining the sports which information is easily computable
sports = ['tenis-mesa/tenis-de-mesa', 'e-sports', 'baloncesto',
'rugby', 'tenis', 'futbol-americano', '/boxeo-mma/boxeo',
'boxeo-mma/ufc-mma', 'futbol']
# Defining sports where draw is not ... | 49.47619 | 136 | 0.625987 |
ea60e3a983cb60a3613d48e77127d243f50e3466 | 46,973 | py | Python | pgdata.py | jpmorgen/precisionguide | d90936f3cfbaa45102ddc57a32696f3fbb7df33f | [
"MIT"
] | null | null | null | pgdata.py | jpmorgen/precisionguide | d90936f3cfbaa45102ddc57a32696f3fbb7df33f | [
"MIT"
] | null | null | null | pgdata.py | jpmorgen/precisionguide | d90936f3cfbaa45102ddc57a32696f3fbb7df33f | [
"MIT"
] | null | null | null | """Define the base data containing classes for precisionguide system
These are designed to be portable across any platform, since they do
not depend on the specifics of the telescsope control system. Thus,
data can be recorded using this code on, e.g., a Windows system and
uploaded to any other platform for detailed ... | 38.470925 | 256 | 0.630107 |
75dba91333f195823c0a9019873052586c4eb969 | 7,127 | py | Python | meiduo_mall/meiduo_mall/settings/dev.py | amour-lee/MeiDuoProject | 72bae3886d5db79f63725d3aa1a6b4bad294572e | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/settings/dev.py | amour-lee/MeiDuoProject | 72bae3886d5db79f63725d3aa1a6b4bad294572e | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/settings/dev.py | amour-lee/MeiDuoProject | 72bae3886d5db79f63725d3aa1a6b4bad294572e | [
"MIT"
] | null | null | null | # 开发环境配置文件
"""
Django settings for meiduo_mall project.
Generated by 'django-admin startproject' using Django 1.11.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/setting... | 27.20229 | 94 | 0.645152 |
bd762f81bf475eed4f2fa7fc384e51d93a4ec686 | 7,348 | py | Python | tasks/simplification.py | CartoDB/bigmetadata | a32325382500f23b8a607e4e02cc0ec111360869 | [
"BSD-3-Clause"
] | 45 | 2015-12-14T03:05:55.000Z | 2021-06-29T22:46:40.000Z | tasks/simplification.py | CartoDB/bigmetadata | a32325382500f23b8a607e4e02cc0ec111360869 | [
"BSD-3-Clause"
] | 480 | 2016-02-19T15:58:44.000Z | 2021-09-10T16:38:56.000Z | tasks/simplification.py | CartoDB/bigmetadata | a32325382500f23b8a607e4e02cc0ec111360869 | [
"BSD-3-Clause"
] | 13 | 2016-08-09T21:03:02.000Z | 2020-04-29T23:40:20.000Z | import os
from luigi import Task, Parameter, LocalTarget
from .util import shell
from .targets import PostgresTarget
from .meta import CurrentSession
OBSERVATORY_SCHEMA = 'observatory'
DEFAULT_GEOMFIELD = 'the_geom'
TMP_DIRECTORY = 'tmp'
SIMPLIFICATION_DIRECTORY = 'simplification'
SIMPLIFIED_SUFFIX = '_simpl'
SKIPFAIL... | 45.079755 | 121 | 0.633506 |
5ec586fd92c852bd84f12a7089d0cb6ea4ad8b5f | 13,314 | py | Python | constrained_language_typology/vanilla_reader_main.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | constrained_language_typology/vanilla_reader_main.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | constrained_language_typology/vanilla_reader_main.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | 34.314433 | 80 | 0.709704 |
118d17b45e9ab23aac0dd9b3a14187de23202d45 | 13,920 | py | Python | scripts/render_core.py | tomuram/mb_aligner_adisuissa | eaaa81fd7bc9ffc58c2683dc6cca8e2d5e90c11a | [
"MIT"
] | null | null | null | scripts/render_core.py | tomuram/mb_aligner_adisuissa | eaaa81fd7bc9ffc58c2683dc6cca8e2d5e90c11a | [
"MIT"
] | null | null | null | scripts/render_core.py | tomuram/mb_aligner_adisuissa | eaaa81fd7bc9ffc58c2683dc6cca8e2d5e90c11a | [
"MIT"
] | 3 | 2020-04-28T05:23:09.000Z | 2021-04-13T20:10:00.000Z | from rh_renderer.tilespec_renderer import TilespecRenderer
from rh_renderer.multiple_tiles_renderer import BlendType
from rh_renderer import models
#from rh_renderer.hist_matcher import HistMatcher
#import rh_renderer.normalization.hist_adjuster
#from rh_aligner.common.bounding_box import BoundingBox
import cv2
import ... | 50.989011 | 225 | 0.581178 |
28b52e31aca258473ad66b9dc2bfc0a7c791c688 | 7,133 | py | Python | django/core/management/commands/runserver.py | benjaoming/django | 6dbe979b4d9396e1b307c7d27388c97c13beb21c | [
"BSD-3-Clause"
] | 1 | 2016-06-27T08:35:00.000Z | 2016-06-27T08:35:00.000Z | django/core/management/commands/runserver.py | benjaoming/django | 6dbe979b4d9396e1b307c7d27388c97c13beb21c | [
"BSD-3-Clause"
] | null | null | null | django/core/management/commands/runserver.py | benjaoming/django | 6dbe979b4d9396e1b307c7d27388c97c13beb21c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from datetime import datetime
import errno
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import run, get_internal_wsgi_application
from django.db import connections, DEFAULT_DB_AL... | 40.76 | 105 | 0.604514 |
288e6fd2b52da40e083b72dcca58df21a67e0f71 | 4,287 | py | Python | py/desitarget/test/test_mock_build.py | ameisner/desitarget | 86f211b72ff2b989a42269ff7b3d801e34387628 | [
"BSD-3-Clause"
] | null | null | null | py/desitarget/test/test_mock_build.py | ameisner/desitarget | 86f211b72ff2b989a42269ff7b3d801e34387628 | [
"BSD-3-Clause"
] | null | null | null | py/desitarget/test/test_mock_build.py | ameisner/desitarget | 86f211b72ff2b989a42269ff7b3d801e34387628 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test desitarget.mock.build, but only add_mock_shapes_and_fluxes for now.
"""
import unittest
import tempfile
import os
import shutil
from pkg_resources import resource_filename
import numpy as np
from astropy.table import Table
i... | 37.605263 | 142 | 0.658036 |
5596edc89ee216191c19b02e69002a91fce67f55 | 306 | py | Python | tweetset/manage.py | janezkranjc/tweetset | 0f7ff4bed48efd5122522e1aa68c2502fefa9846 | [
"MIT"
] | 17 | 2015-06-07T20:44:45.000Z | 2021-02-07T23:34:06.000Z | tweetset/manage.py | janezkranjc/tweetset | 0f7ff4bed48efd5122522e1aa68c2502fefa9846 | [
"MIT"
] | 1 | 2018-03-15T23:28:56.000Z | 2018-03-15T23:28:56.000Z | tweetset/manage.py | janezkranjc/tweetset | 0f7ff4bed48efd5122522e1aa68c2502fefa9846 | [
"MIT"
] | 8 | 2015-02-24T21:26:29.000Z | 2016-11-10T08:28:22.000Z | #!/usr/bin/env python
import os
import sys
sys.path.append(os.path.realpath(__file__))
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tweetset.settings.production")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 25.5 | 83 | 0.781046 |
07f3fed0dd31bdaf2a383b1a465654d2026c699b | 2,846 | py | Python | 2021/day/05/day5.py | patrick-andrew-jain-taylor/advent-of-code | ce87ed4e60f46189323a1bd6a5ba4d711597526b | [
"MIT"
] | null | null | null | 2021/day/05/day5.py | patrick-andrew-jain-taylor/advent-of-code | ce87ed4e60f46189323a1bd6a5ba4d711597526b | [
"MIT"
] | 23 | 2021-12-02T16:12:37.000Z | 2021-12-20T18:17:39.000Z | 2021/day/05/day5.py | patrick-andrew-jain-taylor/advent-of-code | ce87ed4e60f46189323a1bd6a5ba4d711597526b | [
"MIT"
] | null | null | null | """
Day 5
"""
class OceanFloor:
"""
Representation of the ocean floor with geothermic vents.
"""
def __init__(self, size: int):
self.floor = [['.' for i in range(size)] for j in range(size)]
def __repr__(self):
return '\n'.join(''.join(row) for row in self.floor)
def __str__... | 28.747475 | 112 | 0.501405 |
1b9a4867f39d169b3b45af213e09cc0c7bf78b13 | 991 | py | Python | src/ZODB/scripts/referrers.py | unkloud/ZODB | 63dcee8d3bf0df6a05b75a378292a1a6061ce0c2 | [
"ZPL-2.1"
] | null | null | null | src/ZODB/scripts/referrers.py | unkloud/ZODB | 63dcee8d3bf0df6a05b75a378292a1a6061ce0c2 | [
"ZPL-2.1"
] | null | null | null | src/ZODB/scripts/referrers.py | unkloud/ZODB | 63dcee8d3bf0df6a05b75a378292a1a6061ce0c2 | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 34.172414 | 78 | 0.602422 |
0b4cb5ff09dee55d438b9ae9d5c595bb96d38216 | 444 | py | Python | test/visuals/test_pattern.py | rohernandezz/coldtype | 724234fce454699a469d17b6c78ae50fa8138169 | [
"Apache-2.0"
] | null | null | null | test/visuals/test_pattern.py | rohernandezz/coldtype | 724234fce454699a469d17b6c78ae50fa8138169 | [
"Apache-2.0"
] | null | null | null | test/visuals/test_pattern.py | rohernandezz/coldtype | 724234fce454699a469d17b6c78ae50fa8138169 | [
"Apache-2.0"
] | null | null | null | from coldtype import *
@renderable((1000, 1000))
def test_pattern_generate(r):
return (DATPen()
.rect(r.inset(250))
.rotate(45)
.flatten()
.roughen(150)
.f(hsl(0.7, 0.7, 0.7)))
@renderable((1000, 1000))
def test_pattern_use(r):
imgp = test_pattern_generate.last_passes[0... | 24.666667 | 59 | 0.578829 |
a8638317578df29a041c7eebf5c64b9cd208285b | 6,672 | py | Python | mv_gp.py | shiyuechengineer/mv-gp | f68111f06e9d29f626b2d638d5576cca0fc3236d | [
"MIT"
] | null | null | null | mv_gp.py | shiyuechengineer/mv-gp | f68111f06e9d29f626b2d638d5576cca0fc3236d | [
"MIT"
] | null | null | null | mv_gp.py | shiyuechengineer/mv-gp | f68111f06e9d29f626b2d638d5576cca0fc3236d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
READ_ME = '''
=== PREREQUISITES ===
Run in Python 3
Install both requests & Meraki Dashboard API Python modules:
pip[3] install requests [--upgrade]
pip[3] install meraki [--upgrade]
=== DESCRIPTION ===
This script finds all MV cameras with a specified tag, and then iterates
through all networks t... | 37.483146 | 146 | 0.646283 |
7eda1f1eb620394617665044e36e0a7034d7007f | 3,727 | py | Python | openGaussBase/testcase/TOOLS/INTERNAL_TOOLS/gs_probackup/Opengauss_Function_Tools_Gs_Probackup_Case0043.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/INTERNAL_TOOLS/gs_probackup/Opengauss_Function_Tools_Gs_Probackup_Case0043.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/INTERNAL_TOOLS/gs_probackup/Opengauss_Function_Tools_Gs_Probackup_Case0043.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 36.184466 | 84 | 0.624094 |
5799c41e83d382a800b17033c97def48243465bc | 167 | py | Python | multiplication.py | AkashM006/the-iron-legions | 9cde6dd97b03463ce0d3d0782f4cf08f97e0e3f9 | [
"MIT"
] | null | null | null | multiplication.py | AkashM006/the-iron-legions | 9cde6dd97b03463ce0d3d0782f4cf08f97e0e3f9 | [
"MIT"
] | 1 | 2021-03-20T15:18:46.000Z | 2021-03-20T15:18:46.000Z | multiplication.py | AkashM006/the-iron-legions | 9cde6dd97b03463ce0d3d0782f4cf08f97e0e3f9 | [
"MIT"
] | null | null | null | def domultiplication(a,b):
return (a*b) # Return the product of a and b
a = int(input("Enter a"))
b = int(input("Enter b"))
res = domultiplication(a,b)
print(res) | 23.857143 | 48 | 0.664671 |
68179ad54c20ae5dad526ac7f369b47993496fab | 9,404 | py | Python | tests/components/ps4/test_init.py | guiguid/core | d43617c41d6507f2d2b77aadf4fa1ebaf0058b14 | [
"Apache-2.0"
] | 1 | 2020-04-07T15:44:54.000Z | 2020-04-07T15:44:54.000Z | tests/components/ps4/test_init.py | guiguid/core | d43617c41d6507f2d2b77aadf4fa1ebaf0058b14 | [
"Apache-2.0"
] | null | null | null | tests/components/ps4/test_init.py | guiguid/core | d43617c41d6507f2d2b77aadf4fa1ebaf0058b14 | [
"Apache-2.0"
] | null | null | null | """Tests for the PS4 Integration."""
from asynctest import MagicMock, patch
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import ps4
from homeassistant.components.media_player.const import (
ATTR_MEDIA_CONTENT_TYPE,
ATTR_MEDIA_TITLE,
MEDIA_TYPE_GAME,
)
from homeass... | 32.095563 | 87 | 0.720438 |
dc704ffafe07ff565a77f5208975f355d9b20180 | 2,023 | py | Python | Module2/assignment5.py | luuduytung/programming-with-python-for-data-science-microsoft | 87d855020c0f991e38365b4848836e751617d658 | [
"MIT"
] | null | null | null | Module2/assignment5.py | luuduytung/programming-with-python-for-data-science-microsoft | 87d855020c0f991e38365b4848836e751617d658 | [
"MIT"
] | null | null | null | Module2/assignment5.py | luuduytung/programming-with-python-for-data-science-microsoft | 87d855020c0f991e38365b4848836e751617d658 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
#
# TODO:
# Load up the dataset, setting correct header labels.
#
# .. your code here ..
df = pd.read_csv('Datasets/census.data',header=None,
names = ['education', 'age', 'capital-gain', 'race', 'capital-loss', 'hours-per-week', 'sex', 'classification'])
#
# ... | 31.123077 | 129 | 0.715769 |
ec1107bad0c6253d6b60cdf273b1764ec23f2bea | 1,521 | py | Python | DesignPattern/pool.py | zzragida/PythonExamples | ed94ae2773a580a42e158ebdc7321a89ca4e991b | [
"MIT"
] | null | null | null | DesignPattern/pool.py | zzragida/PythonExamples | ed94ae2773a580a42e158ebdc7321a89ca4e991b | [
"MIT"
] | null | null | null | DesignPattern/pool.py | zzragida/PythonExamples | ed94ae2773a580a42e158ebdc7321a89ca4e991b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""http://stackoverflow.com/questions/1514120/python-implementation-of-the-object-pool-design-pattern"""
class QueueObject():
def __init__(self, queue, auto_get=False):
self._queue = queue
self.object = self._queue.get() if auto_get else None
de... | 24.532258 | 104 | 0.625904 |
37bae3636bef81446c938f76a5d4768e40d9deb3 | 24,970 | py | Python | rf-controller/src/nox/lib/core.py | ederlf/RouteFlow | 2955dbd51b0d2f823356341a30caf39c2ef5da5a | [
"Apache-2.0"
] | 1 | 2021-03-15T18:49:51.000Z | 2021-03-15T18:49:51.000Z | rf-controller/src/nox/lib/core.py | ederlf/RouteFlow | 2955dbd51b0d2f823356341a30caf39c2ef5da5a | [
"Apache-2.0"
] | null | null | null | rf-controller/src/nox/lib/core.py | ederlf/RouteFlow | 2955dbd51b0d2f823356341a30caf39c2ef5da5a | [
"Apache-2.0"
] | null | null | null | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# NOX is d... | 37.157738 | 93 | 0.562795 |
d93465e5aa4c104324225ae31cc29b51841fe4f0 | 512 | py | Python | pendulum/locales/pl/custom.py | seandstewart/pendulum | daa4b936daf3f4dfa7d211aa0ac1e9d82d5401d4 | [
"MIT"
] | 5,049 | 2016-07-04T07:16:34.000Z | 2022-03-31T07:41:48.000Z | pendulum/locales/pl/custom.py | seandstewart/pendulum | daa4b936daf3f4dfa7d211aa0ac1e9d82d5401d4 | [
"MIT"
] | 536 | 2016-07-05T22:46:29.000Z | 2022-03-22T12:41:54.000Z | pendulum/locales/pl/custom.py | seandstewart/pendulum | daa4b936daf3f4dfa7d211aa0ac1e9d82d5401d4 | [
"MIT"
] | 373 | 2016-07-05T19:51:51.000Z | 2022-03-23T16:57:46.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
pl custom locale file.
"""
translations = {
"units": {"few_second": "kilka sekund"},
# Relative time
"ago": "{} temu",
"from_now": "za {}",
"after": "{0} po",
"before": "{0} przed",
# Date formats
"date_formats": {
... | 19.692308 | 44 | 0.480469 |
77a9cf21bae24f3539ef16e9805e646edc5798dc | 385 | py | Python | module_03_numbers/psl_03.01_math_01.py | CodingGearsCourses/Python-3-Standard-Library-Essentials | 8b80bc8b77fa477b6ccbe2886ed9239c2defdfda | [
"Apache-2.0"
] | null | null | null | module_03_numbers/psl_03.01_math_01.py | CodingGearsCourses/Python-3-Standard-Library-Essentials | 8b80bc8b77fa477b6ccbe2886ed9239c2defdfda | [
"Apache-2.0"
] | null | null | null | module_03_numbers/psl_03.01_math_01.py | CodingGearsCourses/Python-3-Standard-Library-Essentials | 8b80bc8b77fa477b6ccbe2886ed9239c2defdfda | [
"Apache-2.0"
] | null | null | null | # --------------------------------
# CodingGears.io
# --------------------------------
# Math Module
import math
# TODO: Square root
result = math.sqrt(7)
print(result)
# TODO: Greatest Common Denominator
result = math.gcd(100, 25)
print(result)
# TODO: pow (x raised to the power y)
result = math.pow(2, 4)
print(re... | 17.5 | 37 | 0.587013 |
8b3dbd25860ceb2e102e32153d7a93151664a62b | 1,623 | py | Python | tests/test_pep8.py | cfranken/isofit | a67a26fe59fe0eb3fd5fe3503736294e17172f82 | [
"Apache-2.0"
] | null | null | null | tests/test_pep8.py | cfranken/isofit | a67a26fe59fe0eb3fd5fe3503736294e17172f82 | [
"Apache-2.0"
] | null | null | null | tests/test_pep8.py | cfranken/isofit | a67a26fe59fe0eb3fd5fe3503736294e17172f82 | [
"Apache-2.0"
] | 1 | 2020-07-25T05:36:49.000Z | 2020-07-25T05:36:49.000Z | #! /usr/bin/env python3
#
# Copyright 2018 California Institute of Technology
#
# 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
#
# Unle... | 33.122449 | 75 | 0.699322 |
56e54db0d77209ba1a8f1aa035138626d2c794fe | 302 | py | Python | leetcode/python/70-ClimbingStairs.py | yu-H-ang/code-backup | ea7469122fd63b0910e2c851f39f9e48d5d54fea | [
"MIT"
] | null | null | null | leetcode/python/70-ClimbingStairs.py | yu-H-ang/code-backup | ea7469122fd63b0910e2c851f39f9e48d5d54fea | [
"MIT"
] | null | null | null | leetcode/python/70-ClimbingStairs.py | yu-H-ang/code-backup | ea7469122fd63b0910e2c851f39f9e48d5d54fea | [
"MIT"
] | null | null | null | class Solution(object):
def __init__(self):
self.dic = {1:1, 2:2}
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
if n not in self.dic:
self.dic[n] = self.climbStairs(n-1) + self.climbStairs(n-2)
return self.dic[n]
| 25.166667 | 71 | 0.5 |
fe76aeabd70a2dd444d07f3e373233479e9ed011 | 30,385 | py | Python | tests/kbcr/clutrr/classic/test_classic.py | alex4321/ctp | 22a6a55442a648e5f7d8c10f90708a7340360720 | [
"MIT"
] | null | null | null | tests/kbcr/clutrr/classic/test_classic.py | alex4321/ctp | 22a6a55442a648e5f7d8c10f90708a7340360720 | [
"MIT"
] | null | null | null | tests/kbcr/clutrr/classic/test_classic.py | alex4321/ctp | 22a6a55442a648e5f7d8c10f90708a7340360720 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import multiprocessing
import numpy as np
from itertools import cycle, islice
import torch
from torch import nn, optim, Tensor
from kbcr.kernels import GaussianKernel
from kbcr.clutrr.models.classic import NeuralKB, Hoppy
from kbcr.reformulators import AttentiveReformulator
from kbcr.refor... | 35.705053 | 109 | 0.565443 |
51e43f709e6c23fbb21042409829d2ce2edac2e8 | 1,259 | py | Python | main.py | JDJGInc/jdjgapi | 0c25bebaacd498cc6acfc6f85f5f5bda762c2297 | [
"MIT"
] | null | null | null | main.py | JDJGInc/jdjgapi | 0c25bebaacd498cc6acfc6f85f5f5bda762c2297 | [
"MIT"
] | 2 | 2021-12-09T05:26:00.000Z | 2021-12-09T05:26:13.000Z | main.py | JDJGInc/jdjgapi | 0c25bebaacd498cc6acfc6f85f5f5bda762c2297 | [
"MIT"
] | 1 | 2021-12-09T05:13:59.000Z | 2021-12-09T05:13:59.000Z | from quart import Quart
import json, random
app = Quart(__name__)
@app.route('/')
async def handleRoot():
with open('index.html', 'r') as file:
data = file.read(), 200, {'content-type':'text/html'}
return data
@app.route('/api/')
async def handleApi():
with open('api.html', 'r') as file:
... | 27.977778 | 75 | 0.621922 |
c3666294229c53dd7319f50213adffb308a8ee0b | 2,804 | py | Python | week2/task_hasanozdemir_oop.py | hasanozdem1r/patika_yemeksepeti_bootcamp | 59a2a5b615dcd76b9719d98f716cf3d3be764850 | [
"MIT"
] | null | null | null | week2/task_hasanozdemir_oop.py | hasanozdem1r/patika_yemeksepeti_bootcamp | 59a2a5b615dcd76b9719d98f716cf3d3be764850 | [
"MIT"
] | null | null | null | week2/task_hasanozdemir_oop.py | hasanozdem1r/patika_yemeksepeti_bootcamp | 59a2a5b615dcd76b9719d98f716cf3d3be764850 | [
"MIT"
] | null | null | null | """
This script created to apply CRUD operations on CSV files.
Hasan Özdemir 2021
"""
from csv import reader,DictReader,writer
from os import path
class FileOperations(object):
def __init__(self,file_path:str,fields:list=None) -> None:
"""
This is a FileInitialize class constructor and create... | 32.988235 | 143 | 0.577033 |
8133065176d9db57ef092d3746709a8e45af348a | 2,757 | py | Python | restricted_boltzmann_machine/Mnist.py | dodiku/learning_machines_class | d261a3647f678784bd15641e39fbd03de59dc144 | [
"MIT"
] | null | null | null | restricted_boltzmann_machine/Mnist.py | dodiku/learning_machines_class | d261a3647f678784bd15641e39fbd03de59dc144 | [
"MIT"
] | null | null | null | restricted_boltzmann_machine/Mnist.py | dodiku/learning_machines_class | d261a3647f678784bd15641e39fbd03de59dc144 | [
"MIT"
] | 1 | 2019-09-29T12:47:32.000Z | 2019-09-29T12:47:32.000Z | #!/usr/bin/python
'''
Learning Machines
Taught by Patrick Hebron at NYU ITP
MNIST dataset helpers.
'''
import os
import gzip
import pickle
import numpy as np
def mnist_encode_one_hot_label(idx):
'''MNIST one-hot encoder function'''
enc = np.zeros( 10 )
enc[ idx ] = 1.0
return enc
def mnist_decode_one_hot_label... | 33.621951 | 113 | 0.725426 |
dc181475bee3609a5c24ae20daa1f1e6843c9833 | 8,556 | py | Python | theano/sandbox/theano_object.py | ganguli-lab/Theano | d61c929b6d1a5bae314545cba79c879de687ea18 | [
"BSD-3-Clause"
] | 11 | 2016-12-01T19:49:28.000Z | 2021-11-08T11:12:08.000Z | theano/sandbox/theano_object.py | AtousaTorabi/Theano_old | ba2d2f74406243112e813df31429721c791a889a | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/theano_object.py | AtousaTorabi/Theano_old | ba2d2f74406243112e813df31429721c791a889a | [
"BSD-3-Clause"
] | 6 | 2015-06-21T20:55:55.000Z | 2019-04-24T20:03:25.000Z | """DRAFT: TheanoObject
N.B. the gotcha with this design is listed in the documentation of `TheanoObject`
"""
import theano
from theano import tensor
import numpy
def theano_type(x):
"""Return a theano Type instance suitable for containing value `x`."""
if type(x) is int:
return tensor.lscalar
els... | 37.362445 | 98 | 0.645161 |
cf53dd4df69c630bb359d1442670bcee00044e70 | 6,304 | py | Python | azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 50.83871 | 125 | 0.681631 |
5e590361a58d117f0c36246d8e11269e855831f6 | 257 | py | Python | test/test_utils.py | yarrdiddy/vegamite | 9fdf554e46b09ff23dc98f0df373bcdb3b322510 | [
"MIT"
] | 1 | 2019-04-21T13:46:09.000Z | 2019-04-21T13:46:09.000Z | test/test_utils.py | yarrdiddy/vegamite | 9fdf554e46b09ff23dc98f0df373bcdb3b322510 | [
"MIT"
] | 1 | 2018-03-13T19:46:38.000Z | 2018-03-13T19:46:38.000Z | test/test_utils.py | yarrdiddy/vegamite | 9fdf554e46b09ff23dc98f0df373bcdb3b322510 | [
"MIT"
] | null | null | null | import pytest
from vegamite.utils.timeutil import parse_time_range
def test_parse_time_range():
# import ipdb; ipdb.set_trace()
test1 = parse_time_range('90 days')
test2 = parse_time_range('1 month')
assert test1.days == 90
assert test2.days == 30
| 19.769231 | 52 | 0.754864 |
a1df1c9d8656aa062fc84ab392e913bedb90a1d8 | 303 | py | Python | Python_Exercicios/ex113.py | gabrieldepaiva/Exercicios-CursoEmVideo | 118231c24f040ca0ac3d3b6e6bf633e4eaa06858 | [
"MIT"
] | null | null | null | Python_Exercicios/ex113.py | gabrieldepaiva/Exercicios-CursoEmVideo | 118231c24f040ca0ac3d3b6e6bf633e4eaa06858 | [
"MIT"
] | null | null | null | Python_Exercicios/ex113.py | gabrieldepaiva/Exercicios-CursoEmVideo | 118231c24f040ca0ac3d3b6e6bf633e4eaa06858 | [
"MIT"
] | null | null | null | def leiaint (txt):
while True:
try:
n = int(input(txt))
except:
print('Erro! Por Favor digite um número inteiro válido.')
continue
else:
return n
num = leiaint('Escreva um número - ')
print(f'O número digitado foi {num}.')
| 18.9375 | 69 | 0.521452 |
863e18e361108fd126e625f5db6d9385336e2711 | 12,411 | py | Python | examples/extract_features.py | jayleicn/pytorch-pretrained-BERT | 9f1c253469ce2953f1e6a8eafea4bd7fcb674eb1 | [
"Apache-2.0"
] | 1 | 2020-08-21T00:38:15.000Z | 2020-08-21T00:38:15.000Z | examples/extract_features.py | jayleicn/pytorch-pretrained-BERT | 9f1c253469ce2953f1e6a8eafea4bd7fcb674eb1 | [
"Apache-2.0"
] | null | null | null | examples/extract_features.py | jayleicn/pytorch-pretrained-BERT | 9f1c253469ce2953f1e6a8eafea4bd7fcb674eb1 | [
"Apache-2.0"
] | 2 | 2021-02-24T09:14:29.000Z | 2021-12-16T10:05:22.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | 40.960396 | 120 | 0.617436 |
aa872f72617c32f12e3ee875164db8100877fb60 | 2,523 | py | Python | services.py | adipopbv/shows-app | 8bd14ee0613b7d7ede246881baf6267569d509fc | [
"BSD-3-Clause"
] | null | null | null | services.py | adipopbv/shows-app | 8bd14ee0613b7d7ede246881baf6267569d509fc | [
"BSD-3-Clause"
] | null | null | null | services.py | adipopbv/shows-app | 8bd14ee0613b7d7ede246881baf6267569d509fc | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from threading import Lock
from repositories import SqliteSalesRepository, SqliteShowsRepository, \
SqliteSoldSeatsRepository, SqliteRepository
repo = SqliteRepository()
sales_repo = SqliteSalesRepository()
shows_repo = SqliteShowsRepository()
sold_seats_repo = SqliteSoldSeatsReposit... | 31.5375 | 102 | 0.667856 |
bb23bf4597c4efd890768d61115ed3066fb13665 | 652 | py | Python | setup.py | vndee/python-options | f518ec4e13c529a12a997a9bddbb54f86e21b55d | [
"MIT"
] | null | null | null | setup.py | vndee/python-options | f518ec4e13c529a12a997a9bddbb54f86e21b55d | [
"MIT"
] | null | null | null | setup.py | vndee/python-options | f518ec4e13c529a12a997a9bddbb54f86e21b55d | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r") as f:
readme = f.read()
setup(
name='python-options',
version='1.0.0-3',
packages=find_packages(),
url='https://github.com/TinDang97/python-options',
license='LICENSE',
author='tindang',
author_email='rainstone1029... | 31.047619 | 88 | 0.677914 |
4cee88027f12d0c81c247d88bfd651538cfe31b0 | 704 | py | Python | model_zoo/official/cv/resnext101/src/backbone/__init__.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | 2 | 2021-07-08T13:10:42.000Z | 2021-11-08T02:48:57.000Z | model_zoo/official/cv/resnext101/src/backbone/__init__.py | peixinhou/mindspore | fcb2ec2779b753e95c762cf292b23bd81d1f561b | [
"Apache-2.0"
] | null | null | null | model_zoo/official/cv/resnext101/src/backbone/__init__.py | peixinhou/mindspore | fcb2ec2779b753e95c762cf292b23bd81d1f561b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 41.411765 | 78 | 0.676136 |
e37cc72266127d512768b9234ce2637c15b92cb4 | 291 | py | Python | Assignment1/Push_Image_to_wandb.py | utsavdey/Fundamentals_Of_Deep_Learning_Assignments | c1b2fc49e929ab09760f083aa8b052845afad48f | [
"MIT"
] | null | null | null | Assignment1/Push_Image_to_wandb.py | utsavdey/Fundamentals_Of_Deep_Learning_Assignments | c1b2fc49e929ab09760f083aa8b052845afad48f | [
"MIT"
] | null | null | null | Assignment1/Push_Image_to_wandb.py | utsavdey/Fundamentals_Of_Deep_Learning_Assignments | c1b2fc49e929ab09760f083aa8b052845afad48f | [
"MIT"
] | null | null | null | # CODE to push plot as an image to wandb
import wandb
from matplotlib import pyplot as plt
path_to_img = "<Provide Absolute file Path >"
im = plt.imread(path_to_img)
# Initialize run
wandb.init(project="<Provide project name in wandb>")
# Log image(s)
wandb.log({"img": [wandb.Image(im)]}) | 26.454545 | 53 | 0.735395 |
34c25dc5474dfcd7c19c5e71f40119a87b895430 | 3,024 | py | Python | naslib/optimizers/oneshot/gdas/optimizer.py | az2104nas/sztnb302alsr2bs21on | 6084c82c59a4a89498a191d96c231f47df10317d | [
"Apache-2.0"
] | null | null | null | naslib/optimizers/oneshot/gdas/optimizer.py | az2104nas/sztnb302alsr2bs21on | 6084c82c59a4a89498a191d96c231f47df10317d | [
"Apache-2.0"
] | 4 | 2021-06-08T21:32:32.000Z | 2022-03-12T00:29:33.000Z | naslib/optimizers/oneshot/gdas/optimizer.py | az2104nas/sztnb302alsr2bs21on | 6084c82c59a4a89498a191d96c231f47df10317d | [
"Apache-2.0"
] | null | null | null | import logging
import torch
from naslib.optimizers.core.operations import GDASMixedOp
from naslib.optimizers.oneshot.darts.optimizer import DARTSOptimizer
class GDASOptimizer(DARTSOptimizer):
def __init__(self, tau_max, tau_min, *args, **kwargs):
super(GDASOptimizer, self).__init__(*args, **kwargs)
... | 41.424658 | 107 | 0.627976 |
b0cbc9db9f5e1dd6b0342069e0ee7037b2b8e224 | 650 | py | Python | Chapter4_OpenAIGym/cartpoleSpace.py | franneck94/UdemyAI | bb3decc35ec626a09edf0abdbfbe7c36dac6179a | [
"MIT"
] | 2 | 2021-02-10T19:50:27.000Z | 2021-12-30T06:15:55.000Z | Chapter4_OpenAIGym/cartpoleSpace.py | franneck94/UdemyAI | bb3decc35ec626a09edf0abdbfbe7c36dac6179a | [
"MIT"
] | 1 | 2020-12-21T15:29:20.000Z | 2022-01-15T12:06:09.000Z | Chapter4_OpenAIGym/cartpoleSpace.py | franneck94/UdemyAI | bb3decc35ec626a09edf0abdbfbe7c36dac6179a | [
"MIT"
] | 4 | 2020-11-08T17:07:53.000Z | 2022-02-07T06:40:55.000Z | import gym
env = gym.make("CartPole-v1")
env.reset()
act_space = env.action_space
obs_space = env.observation_space
print("Action Space: ", act_space)
print("Observation Space: ", obs_space)
act_space_n = env.action_space.n
obs_space_low = env.observation_space.low
obs_space_high = env.observation_space.high
obs_... | 24.074074 | 51 | 0.763077 |
c834de1bd5ab608f4debc44e745a712e9d1b1f54 | 3,236 | py | Python | homeassistant/components/solax/sensor.py | zalke/home-assistant | a31e49c857722c0723dc5297cd83cbce0f8716f6 | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | homeassistant/components/solax/sensor.py | zalke/home-assistant | a31e49c857722c0723dc5297cd83cbce0f8716f6 | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | homeassistant/components/solax/sensor.py | zalke/home-assistant | a31e49c857722c0723dc5297cd83cbce0f8716f6 | [
"Apache-2.0"
] | 1 | 2018-04-29T02:14:32.000Z | 2018-04-29T02:14:32.000Z | """Support for Solax inverter via local API."""
import asyncio
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.const import (
TEMP_CELSIUS,
CONF_IP_ADDRESS
)
from homeassistant.helpers.entity import Entity
import homeassistant.helpers.config_validation as cv
... | 27.65812 | 78 | 0.640297 |
658fdb40c1bd71dc3bd9d161fa6363df61c4d22f | 3,913 | py | Python | Framework/generateAOall.py | lishi0927/FrameWork | 8ff62a38ebd05d088721acca4b622b448cbe2978 | [
"MIT"
] | null | null | null | Framework/generateAOall.py | lishi0927/FrameWork | 8ff62a38ebd05d088721acca4b622b448cbe2978 | [
"MIT"
] | null | null | null | Framework/generateAOall.py | lishi0927/FrameWork | 8ff62a38ebd05d088721acca4b622b448cbe2978 | [
"MIT"
] | null | null | null | import struct
import os
import os.path
import sys
import numpy
import scipy
import random
import math
from PIL import Image
import matplotlib.pyplot as plt
def readHeight(fname): # 90 degree
#print 'rotating', fname
f = open(fname, 'rb')
header = f.read(256) # read headers
version, w, h, spacing, ntex... | 31.813008 | 109 | 0.61104 |
6dbb52538aba4d67c3475d528a88aba5fe25ce56 | 601 | py | Python | locallibrary/catalog/migrations/0004_bookinstance_borrower.py | ren-zxcyq/django_collection | b4811ae225326787baab9baa6ebe27bd3896f9fc | [
"MIT"
] | null | null | null | locallibrary/catalog/migrations/0004_bookinstance_borrower.py | ren-zxcyq/django_collection | b4811ae225326787baab9baa6ebe27bd3896f9fc | [
"MIT"
] | null | null | null | locallibrary/catalog/migrations/0004_bookinstance_borrower.py | ren-zxcyq/django_collection | b4811ae225326787baab9baa6ebe27bd3896f9fc | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-10-10 12:33
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('catalog', '0003_book_gen... | 27.318182 | 134 | 0.678869 |
29c293b82af0cc962e143565dddf3e20234f4e7b | 9,468 | py | Python | orange3/doc/data-mining-library/source/tutorial/conf.py | rgschmitz1/BioDepot-workflow-builder | f74d904eeaf91ec52ec9b703d9fb38e9064e5a66 | [
"MIT"
] | 54 | 2017-01-08T17:21:49.000Z | 2021-11-02T08:46:07.000Z | orange3/doc/data-mining-library/source/tutorial/conf.py | Synthia-3/BioDepot-workflow-builder | 4ee93abe2d79465755e82a145af3b6a6e1e79fd4 | [
"MIT"
] | 22 | 2017-03-28T06:03:14.000Z | 2021-07-28T05:43:55.000Z | orange3/doc/data-mining-library/source/tutorial/conf.py | Synthia-3/BioDepot-workflow-builder | 4ee93abe2d79465755e82a145af3b6a6e1e79fd4 | [
"MIT"
] | 21 | 2017-01-26T21:12:09.000Z | 2022-01-31T21:34:59.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# scripting-tutorial documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 22 18:51:25 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present i... | 32.313993 | 87 | 0.706907 |
edde6362e2038a44a45705f226c4ba569b0886ed | 24,121 | py | Python | unstructuredmesh/ddm/localstructure.py | imadki/unstructuredmesh | 08cd9346ca052622698ad376da1098fd634c9a6f | [
"MIT"
] | null | null | null | unstructuredmesh/ddm/localstructure.py | imadki/unstructuredmesh | 08cd9346ca052622698ad376da1098fd634c9a6f | [
"MIT"
] | null | null | null | unstructuredmesh/ddm/localstructure.py | imadki/unstructuredmesh | 08cd9346ca052622698ad376da1098fd634c9a6f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 22 16:08:27 2021
@author: kissami
"""
#from numba.typed import Dict
import timeit
from numpy import zeros, ones, asarray, double, int64, unique, where, array, sort, dot
from collections import OrderedDict
from mpi4py import MPI
from unstructured... | 36.163418 | 131 | 0.53982 |
63b773840349f977f8ee11367abcb8cf358d893b | 6,381 | py | Python | neutron/notifiers/ironic.py | tankertyp/openstack-learning | d729672663f170d0138ecf23b3c23df225c1b1b8 | [
"Apache-2.0"
] | 4 | 2015-11-07T01:58:32.000Z | 2019-10-08T06:18:36.000Z | neutron/notifiers/ironic.py | tankertyp/openstack-learning | d729672663f170d0138ecf23b3c23df225c1b1b8 | [
"Apache-2.0"
] | 5 | 2018-05-31T13:09:00.000Z | 2022-01-13T15:23:29.000Z | neutron/notifiers/ironic.py | tankertyp/openstack-learning | d729672663f170d0138ecf23b3c23df225c1b1b8 | [
"Apache-2.0"
] | 2 | 2017-12-05T15:05:26.000Z | 2019-09-09T16:03:49.000Z | # Copyright (c) 2019 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 42.258278 | 79 | 0.614951 |
5fa36135ebd6bba2e7d01908f93f053c321425e1 | 10,640 | py | Python | fna_seg/furnace/engine/evaluator.py | BaiYuYuan/FNA | d86fc5feb516190cb9622e1a84dfbad341e770c5 | [
"Apache-2.0"
] | 173 | 2019-12-25T04:44:25.000Z | 2021-12-20T01:48:46.000Z | fna_seg/furnace/engine/evaluator.py | BaiYuYuan/FNA | d86fc5feb516190cb9622e1a84dfbad341e770c5 | [
"Apache-2.0"
] | 22 | 2020-03-02T13:23:10.000Z | 2022-01-21T09:38:16.000Z | fna_seg/furnace/engine/evaluator.py | BaiYuYuan/FNA | d86fc5feb516190cb9622e1a84dfbad341e770c5 | [
"Apache-2.0"
] | 26 | 2020-01-09T15:15:17.000Z | 2021-07-29T07:30:06.000Z | import os
import os.path as osp
import cv2
import numpy as np
import time
from tqdm import tqdm
import torch
import torch.nn.functional as F
import torch.multiprocessing as mp
from engine.logger import get_logger
from utils.pyt_utils import load_model, link_file, ensure_dir
from utils.img_utils import pad_image_to_sh... | 37.464789 | 80 | 0.546805 |
f7808469984c5766ae0c484b8c03535af4f97eb2 | 55,768 | py | Python | scripts/object_tracker_generator.py | ZandroFargnoli/Vulkan-ValidationLayers | 45c73d999ed8cc46f62754649cd78c3a917575c5 | [
"Apache-2.0"
] | null | null | null | scripts/object_tracker_generator.py | ZandroFargnoli/Vulkan-ValidationLayers | 45c73d999ed8cc46f62754649cd78c3a917575c5 | [
"Apache-2.0"
] | null | null | null | scripts/object_tracker_generator.py | ZandroFargnoli/Vulkan-ValidationLayers | 45c73d999ed8cc46f62754649cd78c3a917575c5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3 -i
#
# Copyright (c) 2015-2020 The Khronos Group Inc.
# Copyright (c) 2015-2020 Valve Corporation
# Copyright (c) 2015-2020 LunarG, Inc.
# Copyright (c) 2015-2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 52.961064 | 219 | 0.604289 |
4a81a78194953478d3d410d6e13f6e215a0c029f | 4,430 | py | Python | _depreciated/Analyser and Visualisers/iris set reader.py | albert118/Data-Analytics | 31245940d08cf5bd07059f02242441d86d2a2ddc | [
"MIT"
] | 1 | 2020-02-10T10:21:24.000Z | 2020-02-10T10:21:24.000Z | _depreciated/Analyser and Visualisers/iris set reader.py | albert118/Data-Analytics | 31245940d08cf5bd07059f02242441d86d2a2ddc | [
"MIT"
] | 5 | 2021-06-05T00:11:16.000Z | 2022-03-12T00:57:54.000Z | _depreciated/Analyser and Visualisers/iris set reader.py | albert118/Data-Analytics | 31245940d08cf5bd07059f02242441d86d2a2ddc | [
"MIT"
] | null | null | null | # IRIS DATA SET TESTING
# Three copies of the same data set, one doesnt work due to line-delimiter error
# \r instead of \r\n
import csv
import matplotlib.pyplot as plt
import numpy as np
import math
################################################################################
# class def's
######################... | 29.144737 | 109 | 0.610609 |
3606e2b9f838bd2f29c68a5f9254efb9c33020c5 | 822 | py | Python | autocorrect/__init__.py | brandonmpace/autocorrect | 4bef4a1607e7a54cf50cbe4047ab3dd58ebdc943 | [
"MIT"
] | null | null | null | autocorrect/__init__.py | brandonmpace/autocorrect | 4bef4a1607e7a54cf50cbe4047ab3dd58ebdc943 | [
"MIT"
] | null | null | null | autocorrect/__init__.py | brandonmpace/autocorrect | 4bef4a1607e7a54cf50cbe4047ab3dd58ebdc943 | [
"MIT"
] | null | null | null | # Python 3 Spelling Corrector
#
# Copyright 2014 Jonas McCallum.
# Updated for Python 3, based on Peter Norvig's
# 2007 version: http://norvig.com/spell-correct.html
#
# Open source, MIT license
# http://www.opensource.org/licenses/mit-license.php
"""
Spell function
Author: Jonas McCallum
https://github.com/foobarmus/... | 30.444444 | 69 | 0.70073 |
f93ea58f1777fcc1d07a6eccd8a349350de3ed8d | 1,202 | py | Python | tests/parsers/test_parser_create_user.py | tableau/tabcmd | a6a44795b2568933505dfc8c443ee16542c9e4c0 | [
"MIT"
] | 3 | 2022-02-15T03:07:51.000Z | 2022-03-09T13:14:52.000Z | tests/parsers/test_parser_create_user.py | tableau/tabcmd | a6a44795b2568933505dfc8c443ee16542c9e4c0 | [
"MIT"
] | 57 | 2022-01-31T22:33:17.000Z | 2022-03-28T22:05:53.000Z | tests/parsers/test_parser_create_user.py | tableau/tabcmd | a6a44795b2568933505dfc8c443ee16542c9e4c0 | [
"MIT"
] | 2 | 2022-02-23T23:05:35.000Z | 2022-03-03T21:32:53.000Z | import unittest
from unittest import mock
from tabcmd.commands.user.create_users_command import CreateUsersCommand
from .common_setup import *
commandname = "createusers"
class CreateUsersTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.parser_under_test = initialize_test_pieces(comman... | 38.774194 | 88 | 0.710483 |
2f04de359c9dbc0b194227f136cb0d625b7c9101 | 4,222 | py | Python | conans/errors.py | datalogics-kam/conan | 7bf230cd5f8ef68eb804908777ebaad75e951b16 | [
"MIT"
] | 1 | 2021-06-14T01:39:27.000Z | 2021-06-14T01:39:27.000Z | conans/errors.py | datalogics-kam/conan | 7bf230cd5f8ef68eb804908777ebaad75e951b16 | [
"MIT"
] | 2 | 2018-02-22T21:28:04.000Z | 2018-09-28T13:51:47.000Z | conans/errors.py | datalogics-kam/conan | 7bf230cd5f8ef68eb804908777ebaad75e951b16 | [
"MIT"
] | 1 | 2021-06-03T23:08:43.000Z | 2021-06-03T23:08:43.000Z | """
Exceptions raised and handled in Conan server.
These exceptions are mapped between server (as an HTTP response) and client
through the REST API. When an error happens in server its translated to an HTTP
error code that its sent to client. Client reads the server code and raise the
matching excep... | 27.415584 | 133 | 0.638797 |
57d4679381357016d3c76ed5d9a20b52adc41ab2 | 15,754 | py | Python | bels/id_utils.py | VertNet/bels | 5d3a2424e14d54e620fb45e05b4a9733996510cf | [
"Apache-2.0"
] | 6 | 2020-12-19T06:19:25.000Z | 2022-02-20T18:44:47.000Z | bels/id_utils.py | VertNet/bels | 5d3a2424e14d54e620fb45e05b4a9733996510cf | [
"Apache-2.0"
] | 26 | 2021-01-07T15:48:10.000Z | 2021-09-27T15:47:24.000Z | bels/id_utils.py | VertNet/bels | 5d3a2424e14d54e620fb45e05b4a9733996510cf | [
"Apache-2.0"
] | 1 | 2020-12-29T23:12:40.000Z | 2020-12-29T23:12:40.000Z | #!/usr/bin/env python3
# -*- 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... | 53.40339 | 295 | 0.6545 |
353cc7a2d918ba9529487ab0fba23a29602edb4a | 1,390 | py | Python | dicom_wsi/compare_imgs.py | Steven-N-Hart/dicom_wsi | 254fc404193594e9b321fdefa2aeefb56a42e99a | [
"MIT"
] | 6 | 2020-12-23T01:20:38.000Z | 2022-01-13T09:06:20.000Z | dicom_wsi/compare_imgs.py | Steven-N-Hart/dicom_wsi | 254fc404193594e9b321fdefa2aeefb56a42e99a | [
"MIT"
] | 5 | 2020-01-10T21:24:52.000Z | 2020-08-18T20:04:39.000Z | dicom_wsi/compare_imgs.py | Steven-N-Hart/dicom_wsi | 254fc404193594e9b321fdefa2aeefb56a42e99a | [
"MIT"
] | 6 | 2019-11-25T16:03:58.000Z | 2021-09-25T11:42:16.000Z | from PIL import Image
import pyvips
from skimage.metrics import structural_similarity as ssim
from skimage.metrics import mean_squared_error
import pydicom
import numpy as np
from os.path import basename as bn
svs_file = '../tests/CMU-1.svs'
dcm_file = 'svs_jp2.0-1.dcm'
compression = 'jp2'
x, y = 24001, 2501
tile_size... | 28.958333 | 111 | 0.711511 |
050b9526f1c952f6d9589c38b5d7007b04f7d8c9 | 42,303 | py | Python | torch/onnx/symbolic_opset11.py | jeongukjae/pytorch | d168eae114f95c2a8893104353a5566fd6fb4655 | [
"Intel"
] | null | null | null | torch/onnx/symbolic_opset11.py | jeongukjae/pytorch | d168eae114f95c2a8893104353a5566fd6fb4655 | [
"Intel"
] | 1 | 2021-04-12T19:49:08.000Z | 2021-04-12T19:49:08.000Z | torch/onnx/symbolic_opset11.py | shmsong/pytorch | 90e532f3ef17a9611e9e7a9f1f6189d4168bf084 | [
"Intel"
] | 1 | 2022-02-23T02:34:50.000Z | 2022-02-23T02:34:50.000Z |
from sys import maxsize
import torch
import torch.onnx.symbolic_helper as sym_help
import warnings
import numpy
from torch.onnx.symbolic_helper import parse_args, _unimplemented, _is_tensor_list
from torch.onnx.symbolic_opset9 import expand, unused
from torch.nn.modules.utils import _single, _pair, _triple
from torc... | 44.717759 | 131 | 0.650379 |
8e06ecc37fe3c7245408dde4b7b391c97cc6c815 | 1,474 | py | Python | my_utils/log_wrapper.py | ashishbaghudana/san_mrc | 03ed7d94c735f1fe2854bb9c208385b5fde44905 | [
"BSD-3-Clause"
] | 1 | 2019-08-23T13:33:37.000Z | 2019-08-23T13:33:37.000Z | my_utils/log_wrapper.py | ashishbaghudana/san_mrc | 03ed7d94c735f1fe2854bb9c208385b5fde44905 | [
"BSD-3-Clause"
] | null | null | null | my_utils/log_wrapper.py | ashishbaghudana/san_mrc | 03ed7d94c735f1fe2854bb9c208385b5fde44905 | [
"BSD-3-Clause"
] | null | null | null | import logging
import sys
from time import gmtime, strftime
from colorlog import ColoredFormatter
def create_logger(name, silent=False, to_disk=False, log_file=None, prefix=None):
"""Logger wrapper
by xiaodl
"""
# setup logger
log = logging.getLogger(name)
log.setLevel(logging.DEBUG)
form... | 30.081633 | 118 | 0.580733 |
ae2cbe4d69c97473f67868c3bd3018493f6120f8 | 5,553 | py | Python | telegram_bot/decorators.py | torbencarstens/bildbot | 69dd04cab8cf5ff4e9bdbf1773983ecf024cfe70 | [
"MIT"
] | 1 | 2022-03-29T08:27:09.000Z | 2022-03-29T08:27:09.000Z | telegram_bot/decorators.py | torbencarstens/bildbot | 69dd04cab8cf5ff4e9bdbf1773983ecf024cfe70 | [
"MIT"
] | 1 | 2020-03-15T16:12:22.000Z | 2020-03-15T16:46:55.000Z | telegram_bot/decorators.py | preparingforexams/bildbot | 8e50f3099044344d77033b63ebcf5db721cc72b9 | [
"MIT"
] | 1 | 2021-03-28T05:10:15.000Z | 2021-03-28T05:10:15.000Z | from __future__ import annotations
import inspect
from datetime import timedelta
from telegram import Update
from telegram.ext import CallbackContext
from . import bot
from . import chat
from . import logger
from . import user
class Command:
def __init__(self, chat_admin: bool = False, main_admin: bool = False... | 38.296552 | 130 | 0.593913 |
238502c9d37dce4d01ecd710ebc042803c28bfb1 | 5,692 | py | Python | vnpy/api/ctp/vnctpmd/test/mdtest.py | riverdarda/vnpy.-msincense | 4f39ef3269082581171f3d0d6f046224266a8d21 | [
"MIT"
] | 3 | 2020-08-14T00:06:32.000Z | 2021-11-22T00:50:02.000Z | vnpy/api/ctp/vnctpmd/test/mdtest.py | riverdarda/vnpy.-msincense | 4f39ef3269082581171f3d0d6f046224266a8d21 | [
"MIT"
] | null | null | null | vnpy/api/ctp/vnctpmd/test/mdtest.py | riverdarda/vnpy.-msincense | 4f39ef3269082581171f3d0d6f046224266a8d21 | [
"MIT"
] | 3 | 2020-03-07T12:45:00.000Z | 2021-02-14T03:10:38.000Z | # encoding: UTF-8
import sys,os
from time import sleep
#from qtpy import QtGui
vnpy_root = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','..','..','..','..'))
if vnpy_root not in sys.path:
print(u'append {}'.format(vnpy_root))
sys.path.append(vnpy_root)
from vnpy.api.ctp.vnctpmd import MdApi
f... | 26.351852 | 93 | 0.448349 |
0919569616587935efdf7974805bd00251126de0 | 675 | py | Python | PyMOTW/source/math/math_distance_2_points.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | PyMOTW/source/math/math_distance_2_points.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2020-07-18T03:52:03.000Z | 2020-07-18T04:18:01.000Z | PyMOTW/source/math/math_distance_2_points.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 2 | 2021-03-06T04:28:32.000Z | 2021-03-06T04:59:17.000Z | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Calculate the distance to a point.
"""
#end_pymotw_header
import math
print('{:^8} {:^8} {:^8} {:^8} {:^8}'.format(
'X1', 'Y1', 'X2', 'Y2', 'Distance',
))
print('{:-^8} {:-^8} {:-^8} {:-^8} {:-^8}'.format(
... | 20.454545 | 59 | 0.435556 |
b863b347758a25b2054e8bf7725c3eaad7bf89bb | 8,291 | py | Python | salt/states/zabbix_valuemap.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 19 | 2016-01-29T14:37:52.000Z | 2022-03-30T18:08:01.000Z | salt/states/zabbix_valuemap.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 223 | 2016-03-02T16:39:41.000Z | 2022-03-03T12:26:35.000Z | salt/states/zabbix_valuemap.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 64 | 2016-02-04T19:45:26.000Z | 2021-12-15T02:02:31.000Z | # -*- coding: utf-8 -*-
"""
.. versionadded:: 2017.7
Management of Zabbix Valuemap object over Zabbix API.
:codeauthor: Jakub Sliva <jakub.sliva@ultimum.io>
"""
from __future__ import absolute_import, unicode_literals
import json
import logging
try:
from salt.ext import six
from salt.exceptions import SaltE... | 35.431624 | 119 | 0.522494 |
aac0b33bdc978a47b057f8ae5ce42498535363fe | 521 | py | Python | landavailability/api/migrations/0007_auto_20161128_1727.py | alphagov/land-avilability-api | 048d4eed4caedb7b9f41caa5d69025506b2eb57d | [
"MIT"
] | 1 | 2017-07-24T17:00:34.000Z | 2017-07-24T17:00:34.000Z | landavailability/api/migrations/0007_auto_20161128_1727.py | alphagov/land-availability-api | 048d4eed4caedb7b9f41caa5d69025506b2eb57d | [
"MIT"
] | 23 | 2016-11-21T15:00:11.000Z | 2019-06-04T07:07:55.000Z | landavailability/api/migrations/0007_auto_20161128_1727.py | alphagov/land-avilability-api | 048d4eed4caedb7b9f41caa5d69025506b2eb57d | [
"MIT"
] | 4 | 2017-03-23T16:42:40.000Z | 2021-12-01T07:27:30.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-28 17:27
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0006_location'),
]
operations = [
... | 23.681818 | 99 | 0.642994 |
7a65817d4d10eddefbfa50057dbd3b9b73049f27 | 2,937 | py | Python | data/p2DJ/New/program/qiskit/QC/startQiskit_QC12.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/QC/startQiskit_QC12.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/QC/startQiskit_QC12.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=5
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as... | 27.448598 | 82 | 0.621042 |
e126d7210746acb5c091d671fae0ab304445c7d4 | 3,184 | py | Python | tests/sentry/utils/test_types.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 2 | 2019-03-04T12:45:54.000Z | 2019-03-04T12:45:55.000Z | tests/sentry/utils/test_types.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 196 | 2019-06-10T08:34:10.000Z | 2022-02-22T01:26:13.000Z | tests/sentry/utils/test_types.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 1 | 2017-02-09T06:36:57.000Z | 2017-02-09T06:36:57.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.utils.types import (
InvalidTypeError,
Any,
Bool,
Int,
Float,
String,
Dict,
Sequence,
)
from unittest import TestCase
class OptionsTypesTest(TestCase):
def test_any(self):
assert Any('foo') == 'foo... | 29.481481 | 53 | 0.539573 |
5cb293386c1213e28470fcf24070bf9b82674a25 | 19,282 | py | Python | run_stanford_stages.py | Stanford-STAGES/stanford-stages | 819a32d0edba23917f867436c0dd32347af31515 | [
"CC-BY-4.0"
] | 51 | 2018-08-08T14:39:23.000Z | 2022-03-13T07:57:19.000Z | run_stanford_stages.py | Stanford-STAGES/stanford-stages | 819a32d0edba23917f867436c0dd32347af31515 | [
"CC-BY-4.0"
] | 30 | 2019-04-12T10:15:21.000Z | 2022-02-10T13:27:28.000Z | run_stanford_stages.py | Stanford-STAGES/stanford-stages | 819a32d0edba23917f867436c0dd32347af31515 | [
"CC-BY-4.0"
] | 23 | 2018-11-08T06:30:44.000Z | 2022-03-22T03:52:42.000Z | import sys, time, json, traceback
from collections import namedtuple
from pathlib import Path
import copy
import csv
import inf_tools
from inf_tools import print_log
import inf_narco_app as narcoApp
class MissingRequiredChannelError(Exception):
pass
class ConfigurationStagesError(Exception):
pass
class Ru... | 48.205 | 181 | 0.643242 |
e808e0b1cb860b3a375d220062dc0559134d575f | 7,723 | py | Python | material/templatetags/material_form_internal.py | hansegucker/django-material | 5a3d47504569ba3d65250d5b75e8d9c7e63640b7 | [
"BSD-3-Clause"
] | null | null | null | material/templatetags/material_form_internal.py | hansegucker/django-material | 5a3d47504569ba3d65250d5b75e8d9c7e63640b7 | [
"BSD-3-Clause"
] | 8 | 2021-03-19T04:45:42.000Z | 2021-09-22T19:11:49.000Z | virtual/lib/python3.6/site-packages/material/templatetags/material_form_internal.py | tw8130/Awwards | d1296cdc26356443d6ec5869495eedb766ecbcf2 | [
"Unlicense"
] | null | null | null | from __future__ import division
import math
import re
import json
from collections import OrderedDict
import django
from django.db.models.query import QuerySet
from django.forms.forms import BoundField
from django.template import Library
from django.template.base import (
Node, TemplateSyntaxError, Variable, toke... | 31.267206 | 97 | 0.622556 |
73bbcd560635e9d61b2583e2868593ebbf8e75ae | 260 | py | Python | script1.py | YohannesGetu/Personal-Website-with-Python | d4d43972c3d8844d341f275996afbd2324e33211 | [
"MIT"
] | null | null | null | script1.py | YohannesGetu/Personal-Website-with-Python | d4d43972c3d8844d341f275996afbd2324e33211 | [
"MIT"
] | null | null | null | script1.py | YohannesGetu/Personal-Website-with-Python | d4d43972c3d8844d341f275996afbd2324e33211 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home():
return render_template("home.html")
@app.route('/about')
def about():
return render_template("about.html")
if __name__ == "__main__":
app.run(debug=True) | 18.571429 | 40 | 0.688462 |
a2e59ef93363978c04a1951422efd4e6c66f6789 | 1,376 | py | Python | dags/tutorial.py | leofontesnascimento/simple-airflow | f713b818165914e0473d804066d64d6856b09c7d | [
"Apache-2.0"
] | null | null | null | dags/tutorial.py | leofontesnascimento/simple-airflow | f713b818165914e0473d804066d64d6856b09c7d | [
"Apache-2.0"
] | null | null | null | dags/tutorial.py | leofontesnascimento/simple-airflow | f713b818165914e0473d804066d64d6856b09c7d | [
"Apache-2.0"
] | null | null | null | """
Code that goes along with the Airflow tutorial located at:
https://github.com/apache/airflow/blob/master/airflow/example_dags/tutorial.py
"""
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'Airflow',
'depe... | 24.571429 | 78 | 0.65189 |
ada2e7bc20fafdd0f292090a7307ba3f739035d6 | 1,065 | py | Python | abm-swarm.py | RachidStat/PyCX | a1a597e61d03b25cf138dd11ab136db8202e1243 | [
"BSD-2-Clause-FreeBSD"
] | 176 | 2019-12-18T11:44:28.000Z | 2022-03-27T09:09:33.000Z | abm-swarm.py | RachidStat/PyCX | a1a597e61d03b25cf138dd11ab136db8202e1243 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2020-03-29T00:51:25.000Z | 2020-07-19T11:08:32.000Z | abm-swarm.py | RachidStat/PyCX | a1a597e61d03b25cf138dd11ab136db8202e1243 | [
"BSD-2-Clause-FreeBSD"
] | 56 | 2019-12-18T19:04:12.000Z | 2022-03-22T09:35:33.000Z | import pycxsimulator
from pylab import *
class agent:
def __init__(self):
self.x = rand(2)
self.v = rand(2) - array([0.5, 0.5])
self.xs = [self.x[0]]
self.ys = [self.x[1]]
def accelerate(self):
c = mean([a.x for a in agents])
f = 0.5 * (c - self.x) / norm(c - sel... | 25.97561 | 71 | 0.528638 |
8cae4157f01a489785edf029548e0c8207beee1e | 7,307 | py | Python | sos4hjb/test/optimization/test_sos_program.py | TobiaMarcucci/sos4hjb | d8bd5c0179891ff09f11be48777bef148d952a2d | [
"MIT"
] | 3 | 2020-07-05T17:36:06.000Z | 2021-11-20T10:41:58.000Z | sos4hjb/test/optimization/test_sos_program.py | TobiaMarcucci/sos4hjb | d8bd5c0179891ff09f11be48777bef148d952a2d | [
"MIT"
] | null | null | null | sos4hjb/test/optimization/test_sos_program.py | TobiaMarcucci/sos4hjb | d8bd5c0179891ff09f11be48777bef148d952a2d | [
"MIT"
] | 1 | 2022-01-25T06:39:56.000Z | 2022-01-25T06:39:56.000Z | import unittest
import numpy as np
from sos4hjb.polynomials import (Variable, MonomialVector, ChebyshevVector,
Polynomial)
def make_test_sos_program(SosProgram):
Vectors = (MonomialVector, ChebyshevVector)
class TestSosProgram(unittest.TestCase):
x = Variable.multiv... | 47.141935 | 87 | 0.577255 |
d9ae6b271044f6c58630540c91b26185baf85a6e | 2,669 | py | Python | CIS106 Projects/DecrypterCode.py | TommyT2021/TommyT2021 | bb806cc69df4e073df1d15f5f37992dcfe5f960d | [
"MIT"
] | null | null | null | CIS106 Projects/DecrypterCode.py | TommyT2021/TommyT2021 | bb806cc69df4e073df1d15f5f37992dcfe5f960d | [
"MIT"
] | null | null | null | CIS106 Projects/DecrypterCode.py | TommyT2021/TommyT2021 | bb806cc69df4e073df1d15f5f37992dcfe5f960d | [
"MIT"
] | null | null | null | #the Shift Dictionary and Apply Shift
class Message(object):
def __init__(self, text):
self.message_text = text
self.valid_words = load_words(WORDLIST_FILENAME)
def get_message_text(self):
return self.message_text
def get_valid_words(self):
return self.valid_words... | 31.4 | 62 | 0.579618 |
947087f4db02eb92c0de4e759cfa1f16a102ceec | 19,952 | py | Python | jinja/lexer.py | dcramer/jinja1-djangosupport | 755287f155c18ccabe69f1318bacdaca14f55da3 | [
"BSD-3-Clause"
] | 2 | 2015-09-24T19:53:35.000Z | 2015-11-06T10:47:02.000Z | jinja/lexer.py | dcramer/jinja1-djangosupport | 755287f155c18ccabe69f1318bacdaca14f55da3 | [
"BSD-3-Clause"
] | null | null | null | jinja/lexer.py | dcramer/jinja1-djangosupport | 755287f155c18ccabe69f1318bacdaca14f55da3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
jinja.lexer
~~~~~~~~~~~
This module implements a Jinja / Python combination lexer. The
`Lexer` class provided by this module is used to do some preprocessing
for Jinja.
On the one hand it filters out invalid operators like the bitshift
operators we don't allow i... | 38.44316 | 78 | 0.458651 |
4261b8a4c5a0d64f273826d7c36deb3b6b156eba | 1,870 | py | Python | Projetos/Image_converter/source/image_convert.py | JoaoEmanuell/Meus-Estudos-Python | f6f6eeb6016919e594613785ffe7136d74241ada | [
"MIT"
] | 2 | 2021-07-29T18:58:02.000Z | 2021-10-29T21:11:22.000Z | Projetos/Image_converter/source/image_convert.py | JoaoEmanuell/Meus-Estudos-Python | f6f6eeb6016919e594613785ffe7136d74241ada | [
"MIT"
] | null | null | null | Projetos/Image_converter/source/image_convert.py | JoaoEmanuell/Meus-Estudos-Python | f6f6eeb6016919e594613785ffe7136d74241ada | [
"MIT"
] | null | null | null | from PIL import Image
from pathlib import Path
class ImageConvert():
def __init__(self, IMAGENAME, NEWIMAGEFORMAT) -> None:
"""[Convert the desired image to the desired format.]
Args:
IMAGENAME ([str]): [Name of the image to be converted]
NEWIMAGEFORMAT ([str]): [Format the... | 37.4 | 128 | 0.583422 |
99ecc1fcafd2f157b3ae5532465cf6186be3ebd1 | 1,718 | py | Python | plotly/validators/ohlc/decreasing/line/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 6 | 2019-05-03T02:12:04.000Z | 2020-03-01T06:33:21.000Z | plotly/validators/ohlc/decreasing/line/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | null | null | null | plotly/validators/ohlc/decreasing/line/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 5 | 2019-05-18T16:50:11.000Z | 2021-07-06T21:14:36.000Z |
import _plotly_utils.basevalidators
class WidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='width',
parent_name='ohlc.decreasing.line',
**kwargs
):
super(WidthValidator, self).__init__(
plotly_name=plotly_name,... | 26.430769 | 78 | 0.579744 |
3cc5c7620526ae1b462d981906b17d5ee8c00a5d | 11,778 | py | Python | tests/TestSuite.py | LuminosoInsight/aplus | a8ede978dcbfa24d0ad4b2e07fbc104fe662b5b6 | [
"MIT"
] | null | null | null | tests/TestSuite.py | LuminosoInsight/aplus | a8ede978dcbfa24d0ad4b2e07fbc104fe662b5b6 | [
"MIT"
] | null | null | null | tests/TestSuite.py | LuminosoInsight/aplus | a8ede978dcbfa24d0ad4b2e07fbc104fe662b5b6 | [
"MIT"
] | null | null | null | # This is my attempt to translate the
# Javascript promises-aplus test suite
# (https://github.com/promises-aplus/promises-tests)
# into Python and then apply it to the
# promises library I've created.
from nose.tools import assert_equals
from aplus import Promise
class Counter:
"""
A helper class with some s... | 24.900634 | 78 | 0.61946 |
34760988a56a4da762b7167c6d388ad71240fb1f | 39,070 | py | Python | py3k-sympy/sympy/physics/quantum/gate.py | cielavenir/sympy | ada04faf48a4eb6c1529e8a5d49a6f2f9ce2616e | [
"BSD-3-Clause"
] | null | null | null | py3k-sympy/sympy/physics/quantum/gate.py | cielavenir/sympy | ada04faf48a4eb6c1529e8a5d49a6f2f9ce2616e | [
"BSD-3-Clause"
] | null | null | null | py3k-sympy/sympy/physics/quantum/gate.py | cielavenir/sympy | ada04faf48a4eb6c1529e8a5d49a6f2f9ce2616e | [
"BSD-3-Clause"
] | null | null | null | """An implementation of gates that act on qubits.
Gates are unitary operators that act on the space of qubits.
Medium Term Todo:
* Optimize Gate._apply_operators_Qubit to remove the creation of many
intermediate Qubit objects.
* Add commutation relationships to all operators and use this in gate_sort.
* Fix gate_so... | 32.423237 | 87 | 0.551241 |
f6174a6a89004ac00ba9d6f1a14a143adf90a5fb | 970 | py | Python | zendesk/komand_zendesk/actions/delete_user/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | zendesk/komand_zendesk/actions/delete_user/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | zendesk/komand_zendesk/actions/delete_user/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
USER_ID = "user_id"
class Output:
STATUS = "status"
class DeleteUserInput(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"properties": {
"user_id": {
"type": "str... | 16.724138 | 61 | 0.550515 |
0d5f3a3e75c7934c727779a685fb91a4e860da28 | 16,746 | py | Python | perfkitbenchmarker/providers/aws/athena.py | jojoya/PerfKitBenchmarker | 46c6db0e20de7f751601a9b7b7cbb19c786d395b | [
"Apache-2.0"
] | 2 | 2021-01-15T09:40:28.000Z | 2021-01-15T09:40:36.000Z | perfkitbenchmarker/providers/aws/athena.py | dharmateja03/PerfKitBenchmarker | 2f9abd17872dafd2b0eb45ab4cd2e6afe1585004 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/providers/aws/athena.py | dharmateja03/PerfKitBenchmarker | 2f9abd17872dafd2b0eb45ab4cd2e6afe1585004 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 PerfKitBenchmarker 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 appli... | 38.232877 | 80 | 0.701063 |
28c5a670cbc83afd2f09e479365588d80997b011 | 13,419 | py | Python | frappe/desk/doctype/desktop_icon/desktop_icon.py | ssuda777/frappe | d3f3df2ce15154aecc1d9d6d07d947e72c2e8c6e | [
"MIT"
] | 1 | 2021-06-11T10:28:07.000Z | 2021-06-11T10:28:07.000Z | frappe/desk/doctype/desktop_icon/desktop_icon.py | JMBodz/frappe | eb218a06d1cbfc3a8f1cc00ba8dac2c927d2f71d | [
"MIT"
] | 3 | 2021-08-23T15:20:28.000Z | 2022-03-27T07:47:36.000Z | frappe/desk/doctype/desktop_icon/desktop_icon.py | JMBodz/frappe | eb218a06d1cbfc3a8f1cc00ba8dac2c927d2f71d | [
"MIT"
] | 1 | 2021-08-03T07:12:43.000Z | 2021-08-03T07:12:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
import json
import random
from frappe.model.document import Document
from frappe.utils.user import UserPermissions
class DesktopIcon(Documen... | 27.554415 | 115 | 0.690588 |
5b6efbb202f8af7f6c81d760e27085bd2295fca0 | 158 | py | Python | demo4/single_file_executor/my_executor.py | nan-wang/python-meetup-hangzhou-202203 | f4867f6a4a3c1f90da41ad46e9597ef9e398d146 | [
"Apache-2.0"
] | 3 | 2022-03-06T13:24:21.000Z | 2022-03-31T09:30:26.000Z | demo4/single_file_executor/my_executor.py | nan-wang/python-meetup-hangzhou-202203 | f4867f6a4a3c1f90da41ad46e9597ef9e398d146 | [
"Apache-2.0"
] | null | null | null | demo4/single_file_executor/my_executor.py | nan-wang/python-meetup-hangzhou-202203 | f4867f6a4a3c1f90da41ad46e9597ef9e398d146 | [
"Apache-2.0"
] | null | null | null | from jina import Executor, requests
class FooExecutor(Executor):
@requests
def foo(self, **kwargs):
print('this is a single-file executor')
| 19.75 | 47 | 0.683544 |
261ff58679c234dd43868942d8bc1ca7abe28080 | 5,528 | py | Python | calculations/AllMetrics.py | leogoesger/func-flow | c81f73998df9b02c04c19a6beae463121d5a8898 | [
"MIT"
] | 11 | 2018-04-14T00:34:34.000Z | 2021-05-04T17:23:50.000Z | calculations/AllMetrics.py | Yesicaleon/func-flow | c81f73998df9b02c04c19a6beae463121d5a8898 | [
"MIT"
] | 15 | 2019-04-02T03:35:22.000Z | 2022-02-12T13:17:11.000Z | calculations/AllMetrics.py | Yesicaleon/func-flow | c81f73998df9b02c04c19a6beae463121d5a8898 | [
"MIT"
] | 9 | 2018-12-01T19:46:11.000Z | 2022-03-31T17:18:15.000Z | import numpy as np
from utils.calc_drh import calc_drh
from utils.calc_all_year import calc_all_year
from utils.calc_winter_highflow import calc_winter_highflow_annual
from utils.calc_summer_baseflow import calc_start_of_summer, calc_summer_baseflow_durations_magnitude
from utils.calc_fall_flush import calc_fall_flush_... | 46.453782 | 163 | 0.736614 |
a806348715fed64e1268759522d4fb261a9f51c8 | 3,137 | py | Python | src/haddock/modules/analysis/seletopclusts/__init__.py | rvhonorato/haddock3 | 84866ecab73a56c20c3e457abfc5077233b311b3 | [
"Apache-2.0"
] | null | null | null | src/haddock/modules/analysis/seletopclusts/__init__.py | rvhonorato/haddock3 | 84866ecab73a56c20c3e457abfc5077233b311b3 | [
"Apache-2.0"
] | 1 | 2021-07-24T15:34:58.000Z | 2021-07-24T15:34:58.000Z | src/haddock/modules/analysis/seletopclusts/__init__.py | rvhonorato/haddock3 | 84866ecab73a56c20c3e457abfc5077233b311b3 | [
"Apache-2.0"
] | null | null | null | """HADDOCK3 module to select a top cluster/model."""
from pathlib import Path
from haddock import log
from haddock.libs.libontology import ModuleIO
from haddock.modules import BaseHaddockModule
RECIPE_PATH = Path(__file__).resolve().parent
DEFAULT_CONFIG = Path(RECIPE_PATH, "defaults.cfg")
class HaddockModule(Base... | 34.472527 | 78 | 0.579853 |
707580bfe960150f043dc66a0cd9aea09f87c432 | 9,857 | py | Python | pandas/tests/io/test_common.py | maketestsgofaster/pandas | 3493abaa9c47e39b410752833c901fd27f5b3a76 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"BSD-3-Clause"
] | 3 | 2017-02-09T20:01:04.000Z | 2021-08-11T00:33:41.000Z | pandas/tests/io/test_common.py | mwaskom/pandas | d1010643fea058ba43c2c7124af75cc462ccf242 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/tests/io/test_common.py | mwaskom/pandas | d1010643fea058ba43c2c7124af75cc462ccf242 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"BSD-3-Clause"
] | 1 | 2021-02-05T02:22:31.000Z | 2021-02-05T02:22:31.000Z | """
Tests for the pandas.io.common functionalities
"""
import mmap
import pytest
import os
from os.path import isabs
import pandas as pd
import pandas.util.testing as tm
from pandas.io import common
from pandas.compat import is_platform_windows, StringIO, FileNotFoundError
from pandas import read_csv, concat
c... | 33.989655 | 79 | 0.59369 |
4a17a8f610810fcb135cfeb49b9d7e6dc26b24a1 | 20,455 | py | Python | paypal/express/views.py | evonove/django-oscar-paypal | f3561efb4654470e84087c2a7823d95feb8d28f1 | [
"BSD-3-Clause"
] | null | null | null | paypal/express/views.py | evonove/django-oscar-paypal | f3561efb4654470e84087c2a7823d95feb8d28f1 | [
"BSD-3-Clause"
] | 2 | 2022-02-02T10:13:09.000Z | 2022-02-02T12:07:25.000Z | paypal/express/views.py | evonove/django-oscar-paypal | f3561efb4654470e84087c2a7823d95feb8d28f1 | [
"BSD-3-Clause"
] | null | null | null | import logging
from decimal import Decimal as D
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import get_object_o... | 40.991984 | 110 | 0.629919 |
0a5f9ac7b8bd891ef7b10a7fc9b8b9f2cb347dea | 564 | py | Python | driver/migrations/0004_auto_20180520_1323.py | sami-mai/Carpool-R-Us | 306c60788e3dc123c3ac85e0c40ac5a291590709 | [
"MIT"
] | null | null | null | driver/migrations/0004_auto_20180520_1323.py | sami-mai/Carpool-R-Us | 306c60788e3dc123c3ac85e0c40ac5a291590709 | [
"MIT"
] | 5 | 2020-02-12T00:43:34.000Z | 2021-06-10T20:18:42.000Z | driver/migrations/0004_auto_20180520_1323.py | sami-mai/Carpool-R-Us | 306c60788e3dc123c3ac85e0c40ac5a291590709 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-20 10:23
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('driver', '0003_auto_20180520_1217'),
]
operations = [
migrations.AlterModelOptions(
... | 22.56 | 52 | 0.588652 |
e9a6faccfda8b808af3a40d6f1649d2e1390f4e0 | 459 | py | Python | Week 5/Solution_5_3.py | ChanchalKumarMaji/Competitive-Programmer-s-Core-Skills | 26102bfe6c708af732349ec7f085dc87939e4cb2 | [
"MIT"
] | 4 | 2020-01-20T01:07:42.000Z | 2022-01-09T01:18:21.000Z | Week 5/Solution_5_3.py | ChanchalKumarMaji/Competitive-Programmer-s-Core-Skills | 26102bfe6c708af732349ec7f085dc87939e4cb2 | [
"MIT"
] | null | null | null | Week 5/Solution_5_3.py | ChanchalKumarMaji/Competitive-Programmer-s-Core-Skills | 26102bfe6c708af732349ec7f085dc87939e4cb2 | [
"MIT"
] | 1 | 2021-09-23T04:24:34.000Z | 2021-09-23T04:24:34.000Z | # python3
dp = [[-1]*(162+1) for _ in range(18+1)]
def f(L, S):
if S < 0:
return 0
if L == 0:
return S == 0
if dp[L][S] != -1:
return dp[L][S]
res = 0
for k in range(10):
res += f(L-1, S-k)
dp[L][S] = res
return res
def solve(L, S):
if S == 0 and L == 1... | 17 | 40 | 0.440087 |
612837417445f392d1011c1b31774354294d9828 | 14,673 | py | Python | examples/learning/reinforcement/flowControl/_model/KS.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 43 | 2018-07-26T07:20:42.000Z | 2022-03-02T10:23:12.000Z | examples/learning/reinforcement/flowControl/_model/KS.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 212 | 2018-09-21T10:44:07.000Z | 2022-03-22T14:33:05.000Z | examples/learning/reinforcement/flowControl/_model/KS.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 16 | 2018-07-25T15:00:36.000Z | 2022-03-22T14:19:46.000Z | from numpy import pi
from scipy.fftpack import fft, ifft
import numpy as np
np.seterr(over='raise', invalid='raise')
def gaussian( x, mean, sigma ):
return 1/np.sqrt(2*np.pi*sigma**2)*np.exp(-1/2*( (x-mean)/sigma )**2)
class KS:
#
# Solution of the 1D Kuramoto-Sivashinsky equation
#
# u_t + u*u_x... | 40.871866 | 223 | 0.510052 |
e896c4c7113726282453b1cfb2e768db50878492 | 585 | py | Python | Chapter13/ch13_BIRCH.py | PacktPublishing/Applied-Computational-Thinking-with-Python | fd9982383c5b473ffa1640998540d602876816e5 | [
"MIT"
] | 18 | 2020-11-27T22:41:12.000Z | 2021-12-27T08:20:46.000Z | Chapter13/ch13_BIRCH.py | PacktPublishing/Applied-Computational-Thinking-with-Python | fd9982383c5b473ffa1640998540d602876816e5 | [
"MIT"
] | null | null | null | Chapter13/ch13_BIRCH.py | PacktPublishing/Applied-Computational-Thinking-with-Python | fd9982383c5b473ffa1640998540d602876816e5 | [
"MIT"
] | 8 | 2020-11-30T17:51:11.000Z | 2021-12-25T05:23:02.000Z | from numpy import unique
from numpy import where
from sklearn.datasets import make_classification
from sklearn.cluster import Birch
from matplotlib import pyplot
#Synthetic dataset definition
X, _ = make_classification(n_samples=1800, n_features=2, n_informative=2, n_redundant=0, n_clusters_per_class=1, random_state=4)... | 30.789474 | 128 | 0.791453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.