hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1ccc1dcdcf7daaf5a7a88d21e5f1fd19a42df8c3 | 2,761 | py | Python | fabric_cf/orchestrator/core/bqm_wrapper.py | fabric-testbed/ControlFramework | 95ab745e32f15c993bc7a017aa97a5a0f67f210f | [
"MIT"
] | null | null | null | fabric_cf/orchestrator/core/bqm_wrapper.py | fabric-testbed/ControlFramework | 95ab745e32f15c993bc7a017aa97a5a0f67f210f | [
"MIT"
] | 67 | 2020-12-21T15:39:49.000Z | 2022-02-27T17:55:00.000Z | fabric_cf/orchestrator/core/bqm_wrapper.py | fabric-testbed/ControlFramework | 95ab745e32f15c993bc7a017aa97a5a0f67f210f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to ... | 33.670732 | 102 | 0.676566 |
1ccc29ac310f255a62caad7da4103cfc9d0ee052 | 401 | py | Python | 104/save2_passed.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | 104/save2_passed.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | 104/save2_passed.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | message = """Hello world!
We hope that you are learning a lot of Python.
Have fun with our Bites of Py.
Keep calm and code in Python!
Become a PyBites ninja!"""
def split_in_columns(message=message):
"""Split the message by newline (\n) and join it together on '|'
(pipe), return the obtained output string""... | 33.416667 | 68 | 0.690773 |
1ccc50a22da0b497c96faa5dce2e20fbc124a7c9 | 39,009 | py | Python | pytorch_lightning/trainer/training_loop.py | neighthan/pytorch-lightning | 03a73b37bc25d66ff78fe3e71e64e2173a04b429 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/training_loop.py | neighthan/pytorch-lightning | 03a73b37bc25d66ff78fe3e71e64e2173a04b429 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/training_loop.py | neighthan/pytorch-lightning | 03a73b37bc25d66ff78fe3e71e64e2173a04b429 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 42.539804 | 119 | 0.656797 |
1ccc5917fbe239b1062cd33bdd8faa442be41dc3 | 6,060 | py | Python | main/rnn.py | Zeng-Lecheng/Music-Genre-Classification | 6d489c777431af94f5167808ac4487957743f04b | [
"MIT"
] | null | null | null | main/rnn.py | Zeng-Lecheng/Music-Genre-Classification | 6d489c777431af94f5167808ac4487957743f04b | [
"MIT"
] | 1 | 2022-03-30T19:43:34.000Z | 2022-03-30T19:43:34.000Z | main/rnn.py | Zeng-Lecheng/Music-Genre-Classification | 6d489c777431af94f5167808ac4487957743f04b | [
"MIT"
] | 1 | 2022-03-30T19:01:42.000Z | 2022-03-30T19:01:42.000Z | import torch
import torch.nn as nn
from torch.utils.data import DataLoader, random_split
import torch.optim as optim
from tqdm import tqdm
from matplotlib import pyplot as plt
from datetime import datetime
from util import WavData
from torch.utils.tensorboard import SummaryWriter
# fixed : pip3 install torch torchvi... | 36.95122 | 139 | 0.625083 |
1ccc6237240de3b725190b3b4a1b5755d09a081c | 14,037 | py | Python | rectanglecropper/crop.py | leeshinyook/RectangleCropper | c83cbef3d8c0550fd5642f7c2aed759a13fbf131 | [
"MIT"
] | 1 | 2021-09-11T15:27:33.000Z | 2021-09-11T15:27:33.000Z | rectanglecropper/crop.py | leeshinyook/RectangleCropper | c83cbef3d8c0550fd5642f7c2aed759a13fbf131 | [
"MIT"
] | null | null | null | rectanglecropper/crop.py | leeshinyook/RectangleCropper | c83cbef3d8c0550fd5642f7c2aed759a13fbf131 | [
"MIT"
] | null | null | null | from PIL import Image
from collections import deque
import numpy as np
import warnings
class ImageThresholdUtil:
"""
It has to do with the image threshold. Threshold here means filtering,
which finds the pixels to be filtered out. So this class has static methods
related to the threshold and cooperate... | 44.990385 | 166 | 0.637458 |
1ccc835436d5f6318fdfa6ff1cf1e6d9c7168201 | 81,539 | py | Python | pcdet/models/dense_heads/anchor_head_fuse_fpn_combine_cross_scale.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | 8 | 2021-06-23T02:06:56.000Z | 2022-03-18T08:34:32.000Z | pcdet/models/dense_heads/anchor_head_fuse_fpn_combine_cross_scale.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | 2 | 2021-07-17T11:19:14.000Z | 2021-09-25T03:30:36.000Z | pcdet/models/dense_heads/anchor_head_fuse_fpn_combine_cross_scale.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import scipy
from scipy.spatial.distance import cdist
from .anchor_head_template import AnchorHeadTemplate
class Self_Attn(nn.Module):
""" Self attention Layer"""
def __init__(self,in_dim,activation):
super(Self_Attn... | 55.544278 | 271 | 0.583696 |
1ccc8b701e708f9ad5bd4e244203f795e8ecd466 | 13,031 | py | Python | influxdb_client/domain/xy_view_properties.py | timbeccue/influxdb-client-python | ff136c7990527a87dcf5f8ff39f6f686ce218c98 | [
"MIT"
] | null | null | null | influxdb_client/domain/xy_view_properties.py | timbeccue/influxdb-client-python | ff136c7990527a87dcf5f8ff39f6f686ce218c98 | [
"MIT"
] | null | null | null | influxdb_client/domain/xy_view_properties.py | timbeccue/influxdb-client-python | ff136c7990527a87dcf5f8ff39f6f686ce218c98 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Influx API Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from influxd... | 27.90364 | 241 | 0.586217 |
1ccc9275fbb8827edac149d7b406da05367f9b17 | 5,467 | py | Python | hivemind/client/averaging/load_balancing.py | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 | [
"MIT"
] | 11 | 2021-06-21T19:56:01.000Z | 2021-12-22T09:06:09.000Z | hivemind/client/averaging/load_balancing.py | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 | [
"MIT"
] | null | null | null | hivemind/client/averaging/load_balancing.py | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 | [
"MIT"
] | null | null | null | from typing import Sequence, Optional, Tuple
import numpy as np
import scipy.optimize
from hivemind.utils.logging import get_logger
logger = get_logger(__name__)
LOAD_BALANCING_LP_DECIMALS = 9
def load_balance_peers(vector_size, throughputs: Sequence[Optional[float]], min_size: int = 0) -> Tuple[int, ...]:
"""... | 52.567308 | 117 | 0.728004 |
1cccb645313bb797e7202555232c8615dc4de2c5 | 6,569 | py | Python | trava_erpnext/trava_integrations/doctype/wb_settings_1/wb_settings_1.py | trava-sport/trava_erpnext_12 | 6ee070254a8e9bc5999fde925c21349f6ba0a782 | [
"MIT"
] | null | null | null | trava_erpnext/trava_integrations/doctype/wb_settings_1/wb_settings_1.py | trava-sport/trava_erpnext_12 | 6ee070254a8e9bc5999fde925c21349f6ba0a782 | [
"MIT"
] | null | null | null | trava_erpnext/trava_integrations/doctype/wb_settings_1/wb_settings_1.py | trava-sport/trava_erpnext_12 | 6ee070254a8e9bc5999fde925c21349f6ba0a782 | [
"MIT"
] | 1 | 2022-02-12T20:21:57.000Z | 2022-02-12T20:21:57.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, trava and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import dateutil
from datetime import timedelta, datetime
from frappe import _
from frappe.custom.doctyp... | 43.503311 | 133 | 0.778353 |
1cccd8e2b0d2831f2c17db3822359328ffc4385d | 1,078 | py | Python | stats/server_analytics.py | saguilarDevel/schc-sigfox | 27e14edc0e350f027e6d7b300ec79b6aa92dc06d | [
"MIT"
] | null | null | null | stats/server_analytics.py | saguilarDevel/schc-sigfox | 27e14edc0e350f027e6d7b300ec79b6aa92dc06d | [
"MIT"
] | null | null | null | stats/server_analytics.py | saguilarDevel/schc-sigfox | 27e14edc0e350f027e6d7b300ec79b6aa92dc06d | [
"MIT"
] | 2 | 2021-02-19T03:35:42.000Z | 2021-08-20T15:30:50.000Z | import pandas as pd
import json
pd.set_option('display.max_columns', None)
# json_file = json.loads('/Users/sergioaguilar/PycharmProjects/SCHCfox/stats/files/stats_file_v2.json')
with open('files/server/fragments_stats_v4.0.json') as json_file:
data = json.load(json_file)
df1 = pd.read_json(str(json.dumps(data, ... | 30.8 | 103 | 0.671614 |
1ccd11880d9c2c260416c4a0ac1a095bdfb32a0b | 4,526 | py | Python | mapproxy/test/system/test_wms_srs_extent.py | kaiCu/mapproxy | 9b28f9ca1286e686b8f2188dd52ce56b607427a7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | mapproxy/test/system/test_wms_srs_extent.py | kaiCu/mapproxy | 9b28f9ca1286e686b8f2188dd52ce56b607427a7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | mapproxy/test/system/test_wms_srs_extent.py | kaiCu/mapproxy | 9b28f9ca1286e686b8f2188dd52ce56b607427a7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # This file is part of the MapProxy project.
# Copyright (C) 2014 Omniscale <http://omniscale.de>
#
# 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... | 46.183673 | 92 | 0.625055 |
1ccd184a7114ce646dd0d5e2a5339e06dd2a5aed | 1,865 | py | Python | tests/unit_test/test_php.py | Lufedi/reaper | bdf56b499e5b704c27b9f6c053d798c2a10fa4cf | [
"Apache-2.0"
] | 106 | 2015-07-21T16:18:26.000Z | 2022-03-31T06:45:34.000Z | tests/unit_test/test_php.py | Kowndinya2000/enhanced_repo_reaper | 744f794ba53bde5667b3b0f99b07273d0e32a495 | [
"Apache-2.0"
] | 21 | 2015-07-11T03:48:28.000Z | 2022-01-18T12:57:30.000Z | tests/unit_test/test_php.py | Kowndinya2000/enhanced_repo_reaper | 744f794ba53bde5667b3b0f99b07273d0e32a495 | [
"Apache-2.0"
] | 26 | 2015-07-22T22:38:21.000Z | 2022-03-14T10:11:56.000Z | import os
import unittest
from attributes.unit_test.discoverer import get_test_discoverer
from tests import get_lsloc, REPOS_PATH
class PhpTestDiscovererTestCase(unittest.TestCase):
def setUp(self):
self.discoverer = get_test_discoverer('PHP')
@unittest.skipIf(not os.path.exists(REPOS_PATH), 'setup.... | 36.568627 | 75 | 0.666488 |
1ccd2002697a226545e3b5cf6e691f0c23f78b92 | 10,631 | py | Python | rt1/general_functions.py | ndraeger/rt1 | 8cf30a3b3604b78b1422388e479b28c921d01c09 | [
"Apache-2.0"
] | null | null | null | rt1/general_functions.py | ndraeger/rt1 | 8cf30a3b3604b78b1422388e479b28c921d01c09 | [
"Apache-2.0"
] | null | null | null | rt1/general_functions.py | ndraeger/rt1 | 8cf30a3b3604b78b1422388e479b28c921d01c09 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""helper functions that are used both in rtfits and rtplots"""
import sys
import numpy as np
from itertools import tee, islice
from collections import OrderedDict
def rectangularize(array, return_mask=False, dim=None,
return_masked=False, dtype=None):
"""
return a r... | 32.215152 | 86 | 0.596745 |
1ccd25dc6e0a8f1d8e68441ec5efe21038a2ea8d | 12,018 | py | Python | python/py_diff_pd/common/hex_mesh.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | 4 | 2022-02-10T02:28:42.000Z | 2022-02-10T07:28:35.000Z | python/py_diff_pd/common/hex_mesh.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | null | null | null | python/py_diff_pd/common/hex_mesh.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | null | null | null | import os
import struct
import numpy as np
from py_diff_pd.core.py_diff_pd_core import HexMesh3d
from py_diff_pd.common.common import ndarray
# voxels: an 0-1 array of size cell_x_num * cell_y_num * cell_z_num.
def generate_hex_mesh(voxels, dx, origin, bin_file_name, write=True):
origin = np.asarray(origin, dtype=... | 34.734104 | 114 | 0.533783 |
1ccd2f515d37eac96fcc618ca4ae76270cc6e5aa | 2,565 | py | Python | references/recognition/latency_tensorflow.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 628 | 2021-02-13T21:49:37.000Z | 2022-03-31T19:48:57.000Z | references/recognition/latency_tensorflow.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 694 | 2021-02-08T15:23:38.000Z | 2022-03-31T07:24:59.000Z | references/recognition/latency_tensorflow.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 90 | 2021-04-28T05:39:02.000Z | 2022-03-31T06:48:36.000Z | # Copyright (C) 2021, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
"""
Text recognition latency benchmark
"""
import argparse
import os
import time
import numpy as np
import tensorflow as tf
... | 34.2 | 114 | 0.672904 |
1ccd312e6a30a0a170a7533d155ebb8fa9c2b164 | 298 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/crickit_continuous_servo_simpletest.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/crickit_continuous_servo_simpletest.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 20 | 2018-06-21T15:30:26.000Z | 2022-02-07T14:10:15.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/crickit_continuous_servo_simpletest.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
# Crickit library demo - Continuous servo
from adafruit_crickit import crickit
# Start spinning continuous servo on Servo 1 terminal backwards at half speed.
crickit.continuous_servo_1.throttle = -0.5
| 29.8 | 78 | 0.812081 |
1ccd380591e706d230efb25364c0ff040d23d703 | 902 | py | Python | e2e/scripts/selectbox.py | deepchatterjeevns/streamlit | 631d42877bd16bdec14ee124c936917b430f6ce4 | [
"Apache-2.0"
] | 4 | 2019-11-10T13:50:56.000Z | 2020-01-07T21:02:29.000Z | e2e/scripts/selectbox.py | IliaLarchenko/streamlit | 9cdf4851148a43e4e0431d7633c5a5d729e5b1e3 | [
"Apache-2.0"
] | 4 | 2021-05-09T11:42:18.000Z | 2022-02-27T10:59:36.000Z | e2e/scripts/selectbox.py | IliaLarchenko/streamlit | 9cdf4851148a43e4e0431d7633c5a5d729e5b1e3 | [
"Apache-2.0"
] | 1 | 2020-06-26T14:41:01.000Z | 2020-06-26T14:41:01.000Z | # -*- coding: utf-8 -*-
# Copyright 2018-2019 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 applicabl... | 33.407407 | 82 | 0.720621 |
1ccd4a09c36bad6bd2bbf75e18dfcb7fe3f5f7cc | 3,565 | py | Python | src/nti/zodb/zlibstorage.py | NextThought/nti.zodb | 2eb56b6a617fe83c738bfc4651b31d080856e3fc | [
"Apache-2.0"
] | null | null | null | src/nti/zodb/zlibstorage.py | NextThought/nti.zodb | 2eb56b6a617fe83c738bfc4651b31d080856e3fc | [
"Apache-2.0"
] | 10 | 2017-06-08T12:24:31.000Z | 2021-04-01T16:52:38.000Z | src/nti/zodb/zlibstorage.py | NextThought/nti.zodb | 2eb56b6a617fe83c738bfc4651b31d080856e3fc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities for working with zc.zlibstorage.
TODO: Add support for zodburi, which can be installed automatically
as entry points in setup.py.
"""
from __future__ import print_function, absolute_import, division
__docformat__ = "restructuredtext en"
logger = __import__(... | 35.29703 | 86 | 0.65021 |
1ccd571fa1a297cc881be0da4cdf313091cd0b49 | 4,088 | py | Python | alipay/aop/api/request/AlipayEbppInvoiceExpensecontrolAggregationCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayEbppInvoiceExpensecontrolAggregationCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayEbppInvoiceExpensecontrolAggregationCreateRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayEbppInvoiceExpensecontrolAggregationCreateModel import AlipayEbppInvoiceExpensecontrolAggregationCreateModel
class AlipayEbppI... | 28.193103 | 148 | 0.654599 |
1ccd6b821cdef1e69c630029218402b607a94844 | 668 | py | Python | flim/models/lcn/_decoder.py | LIDS-UNICAMP/FLIM | 49947ca8962f5c548ca543ed68e5bbaf7ed8414c | [
"MIT"
] | 2 | 2021-01-18T19:28:44.000Z | 2021-06-08T23:58:17.000Z | flim/models/lcn/_decoder.py | LIDS-UNICAMP/FLIM | 49947ca8962f5c548ca543ed68e5bbaf7ed8414c | [
"MIT"
] | null | null | null | flim/models/lcn/_decoder.py | LIDS-UNICAMP/FLIM | 49947ca8962f5c548ca543ed68e5bbaf7ed8414c | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from ...utils import compute_importance
__all__ = ['Decoder']
class Decoder(nn.Module):
def __init__(self, images, markers, n_classes, device='cpu'):
super(Decoder, self).__init__()
self.n_classes = n_classes
self.device = device
self.register... | 26.72 | 127 | 0.654192 |
1ccd787b6f64f0c4e73c2fec3439fe7da11dbd39 | 1,806 | py | Python | homeassistant/components/lock/wink.py | SKarthick5121995/karthickmaduraai | d5498dfb83e9bb57fff16db854ae3e15c1e15425 | [
"MIT"
] | null | null | null | homeassistant/components/lock/wink.py | SKarthick5121995/karthickmaduraai | d5498dfb83e9bb57fff16db854ae3e15c1e15425 | [
"MIT"
] | null | null | null | homeassistant/components/lock/wink.py | SKarthick5121995/karthickmaduraai | d5498dfb83e9bb57fff16db854ae3e15c1e15425 | [
"MIT"
] | null | null | null | """
Support for Wink locks.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/lock.wink/
"""
import logging
from homeassistant.components.lock import LockDevice
from homeassistant.const import CONF_ACCESS_TOKEN
REQUIREMENTS = ['python-wink==0.6.4']
def ... | 25.43662 | 74 | 0.628461 |
1ccda440edcb2dfc8d4188b0b73a91b7505af0b2 | 18,725 | py | Python | src/sardana/sardanameta.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/sardanameta.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/sardanameta.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | 35.131332 | 80 | 0.628945 |
1ccdfb2cfe63774e3356c99307604f4d4dac0981 | 3,199 | py | Python | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.469697 | 134 | 0.694905 |
1cce02a145955403c71ce51bce20070bfbdfd32c | 1,332 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/data/region_LR.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/region_LR.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/region_LR.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. LR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_LR = PhoneMetadata(id='LR', country_code=231, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='2\\d{7,8}|[378]\\d{8}|4\\d{6}|5\\d{6... | 95.142857 | 169 | 0.673423 |
1cce2a19fbe4717265e85b772e014458569be07c | 4,082 | py | Python | alipay/aop/api/request/AlipayInsScenePetprofilePlatformprofileIdentifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayInsScenePetprofilePlatformprofileIdentifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayInsScenePetprofilePlatformprofileIdentifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayInsScenePetprofilePlatformprofileIdentifyModel import AlipayInsScenePetprofilePlatformprofileIdentifyModel
class AlipayInsScen... | 28.151724 | 148 | 0.654091 |
1cce96ffdada3e21324f8e149832f0e3583c8e7a | 44,485 | py | Python | tensorflow/python/kernel_tests/reduction_ops_test.py | ROCmSoftwarePlatform/tensorflow-upstream | 8bd1e3fcaee378945b11c96ed1474d8b890232fc | [
"Apache-2.0"
] | 615 | 2018-04-14T22:04:13.000Z | 2022-03-31T12:46:50.000Z | tensorflow/python/kernel_tests/reduction_ops_test.py | ROCmSoftwarePlatform/tensorflow-upstream | 8bd1e3fcaee378945b11c96ed1474d8b890232fc | [
"Apache-2.0"
] | 1,167 | 2018-05-15T15:26:33.000Z | 2022-03-31T18:58:41.000Z | tensorflow/python/kernel_tests/reduction_ops_test.py | ROCmSoftwarePlatform/tensorflow-upstream | 8bd1e3fcaee378945b11c96ed1474d8b890232fc | [
"Apache-2.0"
] | 93 | 2018-04-11T02:46:16.000Z | 2022-03-31T12:46:16.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.319631 | 80 | 0.659526 |
1cceb0717ff8a6e4d7a54c5720cc71821e55dfaf | 12,836 | py | Python | simplivity/resources/hosts.py | HewlettPackard/simplivity-python-sdk | 03d8e92a02fe66e878ed22b37944e5a6ce991ef1 | [
"Apache-2.0"
] | 7 | 2020-02-28T09:03:09.000Z | 2022-03-28T15:52:23.000Z | simplivity/resources/hosts.py | HewlettPackard/simplivity-python-sdk | 03d8e92a02fe66e878ed22b37944e5a6ce991ef1 | [
"Apache-2.0"
] | 47 | 2020-01-16T20:32:19.000Z | 2020-08-27T04:43:00.000Z | simplivity/resources/hosts.py | HewlettPackard/simplivity-python-sdk | 03d8e92a02fe66e878ed22b37944e5a6ce991ef1 | [
"Apache-2.0"
] | 16 | 2020-01-10T14:15:17.000Z | 2021-04-06T13:31:01.000Z | ###
# (C) Copyright [2019] Hewlett Packard Enterprise Development LP
#
# 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 ap... | 50.140625 | 119 | 0.633219 |
1ccebccca889f3c37c7672c56f355e0a365861df | 4,016 | py | Python | alipay/aop/api/request/AlipayCommerceTransportEtcInfoModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayCommerceTransportEtcInfoModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayCommerceTransportEtcInfoModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceTransportEtcInfoModifyModel import AlipayCommerceTransportEtcInfoModifyModel
class AlipayCommerceTransportEtcInfoModif... | 27.696552 | 148 | 0.648406 |
1ccebd28c3c24f477553195e9c22cd92cbbb4c15 | 1,329 | py | Python | var/spack/repos/builtin/packages/r-htmltools/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/r-htmltools/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/r-htmltools/package.py | joequant/spack | e028ee0d5903045e1cdeb57550cbff61f2ffb2fa | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 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 RHtmltools(RPackage):
"""Tools for HTML
Tools for HTML generation and output."""
... | 44.3 | 97 | 0.699774 |
1ccec8066992425bdc0e3050b8f966b3539de11a | 2,355 | py | Python | src/config/config.py | miszkur/data-efficient-NLP | 7ad9d988cd17e769ab97802adbdeb6893429af10 | [
"Apache-2.0"
] | null | null | null | src/config/config.py | miszkur/data-efficient-NLP | 7ad9d988cd17e769ab97802adbdeb6893429af10 | [
"Apache-2.0"
] | null | null | null | src/config/config.py | miszkur/data-efficient-NLP | 7ad9d988cd17e769ab97802adbdeb6893429af10 | [
"Apache-2.0"
] | null | null | null | import ml_collections
import os
def bert_tiny():
config = ml_collections.ConfigDict()
config.bert_version = 'prajjwal1/bert-tiny' #'bert-base-cased'
config.output_dim = 128
config.dropout = 0.1
config.num_classes = 8
return config
def bert_config():
config = ml_collections.ConfigDict()
config.bert_v... | 27.383721 | 129 | 0.703185 |
1cced7c8e60cf3b57fd89026acf5614d11e0e57a | 10,337 | py | Python | dashi/bcl2fastq/index_summary.py | slazicoicr/dashi | ede0cebbd2c3490e9f8c4b56ba3f2e04b6576997 | [
"MIT"
] | null | null | null | dashi/bcl2fastq/index_summary.py | slazicoicr/dashi | ede0cebbd2c3490e9f8c4b56ba3f2e04b6576997 | [
"MIT"
] | 7 | 2019-06-06T13:42:08.000Z | 2019-06-06T17:43:08.000Z | dashi/bcl2fastq/index_summary.py | slazicoicr/dashi | ede0cebbd2c3490e9f8c4b56ba3f2e04b6576997 | [
"MIT"
] | null | null | null | import urllib.parse
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash.dependencies as dep
import gsiqcetl.load
from gsiqcetl.bcl2fastq.constants import SamplesSchema, UnknownIndexSchema
import gsiqcetl.bcl2fastq.utility
index = gsiqcetl.load.bcl2fastq_known_samples(Sampl... | 35.522337 | 103 | 0.562542 |
1ccee28e881bf3f8ad8a9773aebecfc97b767b7b | 2,634 | py | Python | business_register/models/fop_models.py | Iva-khar/Data_converter | 9e991f479e2bf1c2ab430a9ad1be2da936ea139b | [
"MIT"
] | null | null | null | business_register/models/fop_models.py | Iva-khar/Data_converter | 9e991f479e2bf1c2ab430a9ad1be2da936ea139b | [
"MIT"
] | null | null | null | business_register/models/fop_models.py | Iva-khar/Data_converter | 9e991f479e2bf1c2ab430a9ad1be2da936ea139b | [
"MIT"
] | null | null | null | from django.db import models
from simple_history.models import HistoricalRecords
from business_register.models.kved_models import Kved
from data_ocean.models import DataOceanModel, Status, Authority, TaxpayerType
class Fop(DataOceanModel):
fullname = models.CharField("повне ім'я", max_length=175)
address = m... | 46.210526 | 95 | 0.709188 |
1cceecd16834d85ad084655ab1d1b7ad0790c5ce | 172 | py | Python | floodsystem/analysis.py | Ericsong2333/partia-flood-warning-system | 545a257f601535c62b3341059fdf2203e06c8e17 | [
"MIT"
] | null | null | null | floodsystem/analysis.py | Ericsong2333/partia-flood-warning-system | 545a257f601535c62b3341059fdf2203e06c8e17 | [
"MIT"
] | null | null | null | floodsystem/analysis.py | Ericsong2333/partia-flood-warning-system | 545a257f601535c62b3341059fdf2203e06c8e17 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
def polyfit(dates, levels, p):
return np.poly1d(np.polyfit(np.array(dates)-min(dates), levels,p)),min(dates)
| 24.571429 | 82 | 0.709302 |
1ccef98057c24eb6440c40abbf097c5b51043c05 | 214 | py | Python | tests/datastructures/test_square_odds.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | tests/datastructures/test_square_odds.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | tests/datastructures/test_square_odds.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | import unittest
from datastructures.lists.square_odds import square_odds
class SquareOddTests(unittest.TestCase):
def test_1(self):
self.assertEqual("1,9,25,49,81", square_odds("1,2,3,4,5,6,7,8,9"))
| 23.777778 | 74 | 0.728972 |
1ccf052ec38e577b01d7b4af1c7215e96dc87c5b | 8,840 | py | Python | composer/algorithms/mixup/mixup.py | hanlint/composer | 83d96b7efde533cbc2fff7dd7e0769da2b177807 | [
"Apache-2.0"
] | null | null | null | composer/algorithms/mixup/mixup.py | hanlint/composer | 83d96b7efde533cbc2fff7dd7e0769da2b177807 | [
"Apache-2.0"
] | null | null | null | composer/algorithms/mixup/mixup.py | hanlint/composer | 83d96b7efde533cbc2fff7dd7e0769da2b177807 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 MosaicML. All Rights Reserved.
"""Core MixUp classes and functions."""
from __future__ import annotations
import logging
from typing import Optional, Tuple
import numpy as np
import torch
from composer.core import Algorithm, Event, State
from composer.loggers import Logger
from composer.loss.utils... | 41.895735 | 119 | 0.633258 |
1ccf0fca120cf21f5380bf37eb0d786335bd2027 | 451 | py | Python | tests/test_cryptography.py | mvadari/xpring-py | b837420127d1c1e5051ed305ed4f19fe9910a4f6 | [
"0BSD"
] | 6 | 2019-12-11T00:54:56.000Z | 2021-03-11T19:44:44.000Z | tests/test_cryptography.py | mvadari/xpring-py | b837420127d1c1e5051ed305ed4f19fe9910a4f6 | [
"0BSD"
] | null | null | null | tests/test_cryptography.py | mvadari/xpring-py | b837420127d1c1e5051ed305ed4f19fe9910a4f6 | [
"0BSD"
] | 9 | 2020-02-28T18:40:46.000Z | 2022-02-28T23:01:09.000Z | import pytest
from fixtures.secp256k1 import SIGNATURE_EXAMPLES
from fixtures.packages.cryptography import make_signing_key
@pytest.mark.parametrize(*SIGNATURE_EXAMPLES)
def test_key(
signing_key_hex: str,
message_digest_hex: str,
signature_hex: str,
):
signing_key = make_signing_key(bytes.fromhex(si... | 26.529412 | 66 | 0.769401 |
1ccf3df4f642084eb86103e59035e85b30b27af6 | 827 | py | Python | src/decisionengine_modules/GCE/sources/GCEInstancePerformance.py | goodenou/decisionengine_modules | cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71 | [
"BSD-3-Clause"
] | 2 | 2020-03-17T15:51:19.000Z | 2022-02-23T15:45:37.000Z | src/decisionengine_modules/GCE/sources/GCEInstancePerformance.py | goodenou/decisionengine_modules | cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71 | [
"BSD-3-Clause"
] | 358 | 2020-03-02T20:06:38.000Z | 2022-03-28T20:39:01.000Z | src/decisionengine_modules/GCE/sources/GCEInstancePerformance.py | goodenou/decisionengine_modules | cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71 | [
"BSD-3-Clause"
] | 34 | 2020-02-24T17:17:11.000Z | 2022-01-13T21:50:11.000Z | """
This source takes input from instance_performance_gce.csv
and adds it to data block
"""
import pandas as pd
from decisionengine.framework.modules import Source
from decisionengine.framework.modules.Source import Parameter
@Source.supports_config(Parameter("csv_file", type=str, comment="path to CSV file"))
@Sourc... | 31.807692 | 84 | 0.750907 |
1ccf449e99427f2421ad38ffa370c60e56b9208b | 4,669 | py | Python | app/assets/macros.py | theLaborInVain/kdm-manager-api | fa8744c9b8a739262d1b94900648254cc69d16e1 | [
"MIT"
] | 2 | 2020-03-04T13:43:45.000Z | 2020-11-03T20:34:21.000Z | app/assets/macros.py | theLaborInVain/kdm-manager-api | fa8744c9b8a739262d1b94900648254cc69d16e1 | [
"MIT"
] | 64 | 2019-07-19T19:19:50.000Z | 2022-03-03T21:19:28.000Z | app/assets/macros.py | theLaborInVain/kdm-manager-api | fa8744c9b8a739262d1b94900648254cc69d16e1 | [
"MIT"
] | null | null | null | """
Macros are dictionaries that can be used to operate on settlements.
Most of them add a group of survivors to a settlement, e.g. the four random
starting survivors of the 'First Story' event or the four Vignette Survivors
of the Vignettes of Death expansion, etc.
This module is an extension of... | 33.589928 | 80 | 0.494324 |
1ccf6130bc2893856769c5e8fa2fb2b312010b5c | 433 | py | Python | cursoemvideoPy/Mundo1/ex034.py | BrCarlini/exPython | 3bed986e5bfa5eae191b6b18306448926aed48fd | [
"MIT"
] | null | null | null | cursoemvideoPy/Mundo1/ex034.py | BrCarlini/exPython | 3bed986e5bfa5eae191b6b18306448926aed48fd | [
"MIT"
] | null | null | null | cursoemvideoPy/Mundo1/ex034.py | BrCarlini/exPython | 3bed986e5bfa5eae191b6b18306448926aed48fd | [
"MIT"
] | null | null | null | print('============ AUMENTO SALARIAL ============')
salario = float(input('Informe seu salário: '))
aumento = 0
if salario > 1250.00:
aumento = salario * 10 / 100
print(f'Seu aumento foi de 10%: R${aumento}\nSeu salário total ficou de R${salario + aumento}.')
else:
aumento = salario * 15 / 100
print(... | 28.866667 | 100 | 0.623557 |
1ccf73f104499f1523e4fae1005788e13636fc3c | 55,499 | py | Python | oscar/lib/python2.7/site-packages/pygments/lexers/_scilab_builtins.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pygments/lexers/_scilab_builtins.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pygments/lexers/_scilab_builtins.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pygments.lexers._scilab_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin list for the ScilabLexer.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Autogenerated
commands_kw = (
'abort'... | 17.931826 | 77 | 0.474315 |
1ccf907c58b2904c5429b9d47abd7d046dd25644 | 9,560 | py | Python | geopy/geocoders/google.py | datadesk/latimes-mappingla-geopy | 1afcfd98292b929363007e7cd38beae55cdec12d | [
"MIT"
] | 3 | 2015-05-18T05:44:34.000Z | 2018-05-11T12:15:44.000Z | geopy/geocoders/google.py | datadesk/latimes-mappingla-geopy | 1afcfd98292b929363007e7cd38beae55cdec12d | [
"MIT"
] | null | null | null | geopy/geocoders/google.py | datadesk/latimes-mappingla-geopy | 1afcfd98292b929363007e7cd38beae55cdec12d | [
"MIT"
] | null | null | null | from urllib import urlencode
from urllib2 import urlopen
try:
import json as simplejson
except ImportError:
import simplejson
import xml
from xml.parsers.expat import ExpatError
from geopy.geocoders.base import Geocoder,GeocoderError,GeocoderResultError
from geopy import Point, Location, util
class Google(G... | 42.114537 | 192 | 0.618201 |
1ccfaa55bba87f533782482e97417d98d08ffc62 | 11,032 | py | Python | scf/test/test_rhf.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | scf/test/test_rhf.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | scf/test/test_rhf.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | #
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
import numpy
import unittest
from pyscf import gto
from pyscf import scf
mol = gto.M(
verbose = 5,
output = '/dev/null',
atom = '''
O 0 0 0
H 0 -0.757 0.587
H 0 0.757 0.587''',
basis = 'cc-pvdz',
)
mf = scf.RHF(mol)
mf.c... | 37.651877 | 108 | 0.554569 |
1ccfb4df94e996754ac255f6befc1869243a1572 | 506 | py | Python | generate_secret.py | cjackie/OpenWallet | 4976a4f98c4c03957a37eee3439f1c85c7b18d19 | [
"MIT"
] | 1 | 2021-09-14T15:32:14.000Z | 2021-09-14T15:32:14.000Z | generate_secret.py | cjackie/OpenWallet | 4976a4f98c4c03957a37eee3439f1c85c7b18d19 | [
"MIT"
] | 6 | 2021-11-13T05:26:41.000Z | 2022-01-08T06:46:09.000Z | generate_secret.py | cjackie/OpenWallet | 4976a4f98c4c03957a37eee3439f1c85c7b18d19 | [
"MIT"
] | 1 | 2021-09-14T15:32:16.000Z | 2021-09-14T15:32:16.000Z | from getpass import getpass
from auth import compute_secret
from bitcoin import base58
import os
if __name__ == '__main__':
passphrase = getpass("Enter passphrase: ")
passphrase2 = getpass("Enter passphrase again: ")
assert passphrase2 == passphrase, "passphrase does not match."
secret = compute_secre... | 28.111111 | 66 | 0.699605 |
1ccfdd04982cb5baee3d4eb5f1b2ac0a5313dc44 | 8,683 | py | Python | python_scripts/Trip_Distance.py | EliZucker/Paranoid-Passenger | 3abe3509c1d893e7ef3332c436418377e4a11a12 | [
"MIT"
] | 2 | 2021-06-13T12:45:47.000Z | 2021-11-29T09:51:50.000Z | python_scripts/Trip_Distance.py | ntung88/Paranoid-Passenger | 531db490f1902a9bb501e26585f431e65a7d401b | [
"MIT"
] | null | null | null | python_scripts/Trip_Distance.py | ntung88/Paranoid-Passenger | 531db490f1902a9bb501e26585f431e65a7d401b | [
"MIT"
] | 2 | 2018-12-06T21:32:54.000Z | 2020-08-10T17:32:52.000Z | import math
JetBlueDatum = {
"UVF": {
'lat': 13.733194,
'lng': -60.952597
},
"UIO": {
'lat': -0.1865944,
'lng': -78.4305382
},
"GYE": {
'lat': -2.15977,
'lng': -79.92824
},
"TPA": {
'lat': 27.975472,
'lng': -82.53325
},
"SYR"... | 18.474468 | 108 | 0.38846 |
1ccffad0a27524735a2209343ae4c95287c56561 | 72,051 | py | Python | premade_modules/2.79/2.79a/bpy/ops/mesh.py | echantry/fake-bpy-module | 004cdf198841e639b7d9a4c4db95ca1c0d3aa2c7 | [
"MIT"
] | null | null | null | premade_modules/2.79/2.79a/bpy/ops/mesh.py | echantry/fake-bpy-module | 004cdf198841e639b7d9a4c4db95ca1c0d3aa2c7 | [
"MIT"
] | null | null | null | premade_modules/2.79/2.79a/bpy/ops/mesh.py | echantry/fake-bpy-module | 004cdf198841e639b7d9a4c4db95ca1c0d3aa2c7 | [
"MIT"
] | null | null | null | def beautify_fill(angle_limit=3.14159):
'''Rearrange some faces to try to get less degenerated geometry
:param angle_limit: Max Angle, Angle limit
:type angle_limit: float in [0, 3.14159], (optional)
'''
pass
def bevel(offset_type='OFFSET',
offset=0.0,
segments=1,
... | 33.465397 | 712 | 0.66693 |
1cd02d481b5a6bba31dd47df96896647b11c57b0 | 2,659 | py | Python | src/pykeen/datasets/wordnet.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | src/pykeen/datasets/wordnet.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | src/pykeen/datasets/wordnet.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""WordNet datasets."""
import pathlib
from docdata import parse_docdata
from .base import TarFileRemoteDataset
__all__ = [
'WN18',
'WN18RR',
]
@parse_docdata
class WN18(TarFileRemoteDataset):
"""The WN18 dataset.
---
name: WordNet-18
statistics:
entities:... | 27.697917 | 102 | 0.631064 |
1cd042922c47371aee68f264202acd294b8fc826 | 1,125 | py | Python | contrib/.venv/lib/python3.8/site-packages/fastecdsa/tests/test_nonce_generation.py | jtatman/katersltc-client | 7ea88bfa32e9bdce9bf8d434a8909a07b65412f7 | [
"MIT"
] | 219 | 2016-05-01T14:19:09.000Z | 2022-03-29T00:58:42.000Z | contrib/.venv/lib/python3.8/site-packages/fastecdsa/tests/test_nonce_generation.py | jtatman/katersltc-client | 7ea88bfa32e9bdce9bf8d434a8909a07b65412f7 | [
"MIT"
] | 80 | 2016-04-05T10:35:13.000Z | 2022-03-15T19:05:45.000Z | contrib/.venv/lib/python3.8/site-packages/fastecdsa/tests/test_nonce_generation.py | jtatman/katersltc-client | 7ea88bfa32e9bdce9bf8d434a8909a07b65412f7 | [
"MIT"
] | 74 | 2016-08-19T06:35:03.000Z | 2022-03-20T04:29:58.000Z | from hashlib import sha1, sha224, sha256, sha384, sha512
from unittest import TestCase
from ..util import RFC6979
class TestNonceGeneration(TestCase):
def test_rfc_6979(self):
msg = 'sample'
x = 0x09A4D6792295A7F730FC3F2B49CBC0F62E862272F
q = 0x4000000000000000000020108A2E0CC0D99F8A5EF
... | 36.290323 | 62 | 0.701333 |
1cd0a475f1343c4080e7344c969dc36de23cc1b3 | 612 | py | Python | convertToFortran.py | danielpecak/salesman | bff2516f81e9605bcdc83417a2ac433d94961f9c | [
"MIT"
] | null | null | null | convertToFortran.py | danielpecak/salesman | bff2516f81e9605bcdc83417a2ac433d94961f9c | [
"MIT"
] | null | null | null | convertToFortran.py | danielpecak/salesman | bff2516f81e9605bcdc83417a2ac433d94961f9c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""This module writes coordinates in radians for different places to FORTRAN format. """
import cities
import sys
codes=['SA','NA','AS','AO','AF','EU','ALL']
names = ['southAmerica','northAmerica','asia','oceania','africa','europa','world']
for ii in range(len(codes)):
code = codes[ii]
... | 32.210526 | 105 | 0.596405 |
1cd0c7b7c9f93ba3783ecadb6c559754acdcb0e2 | 35,729 | py | Python | Tools/scons/scons-local/SCons/Builder.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Builder.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Builder.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """
SCons.Builder
Builder object subsystem.
A Builder object is a callable that encapsulates information about how
to execute actions to create a target Node (file) from source Nodes
(files), and how to create those dependencies for tracking.
The main entry point here is the Builder() factory method. This ... | 40.190101 | 201 | 0.588877 |
1cd0c859ccad8ff31fdde0dafb47dfac01f298c9 | 3,579 | py | Python | train/model.py | ngchc/deepBoosting | 13b3515c16f0d9a0a92b990dfb5eef09ec1a7298 | [
"MIT"
] | 49 | 2019-04-01T02:03:05.000Z | 2021-11-29T07:58:33.000Z | train/model.py | ngchc/deepBoosting | 13b3515c16f0d9a0a92b990dfb5eef09ec1a7298 | [
"MIT"
] | 4 | 2019-04-04T06:53:19.000Z | 2021-11-02T13:11:44.000Z | train/model.py | ngchc/deepBoosting | 13b3515c16f0d9a0a92b990dfb5eef09ec1a7298 | [
"MIT"
] | 16 | 2019-04-01T02:03:11.000Z | 2022-03-20T13:13:04.000Z | """
The core Boosting Network Model
"""
import tensorflow as tf
import numpy as np
from ops import *
class Net(object):
def __init__(self, data, label, wl):
"""
Args: [0, 1]
data : [batch_size, height, width, channels] float32
label: [batch_size, height, width, channels] float32
"""
# training datas... | 34.413462 | 125 | 0.615535 |
1cd0ecd9fc5b872961e0be14d9deab360be1a222 | 17,823 | py | Python | src/olympia/blocklist/tests/test_mlbf.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2020-11-15T20:06:40.000Z | 2020-11-15T20:06:40.000Z | src/olympia/blocklist/tests/test_mlbf.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | null | null | null | src/olympia/blocklist/tests/test_mlbf.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | null | null | null | import json
import os
import tempfile
from unittest import mock
from filtercascade import FilterCascade
from olympia import amo
from olympia.addons.models import GUID_REUSE_FORMAT
from olympia.amo.tests import (
addon_factory, TestCase, user_factory, version_factory)
from olympia.blocklist.models import Block
fro... | 46.657068 | 79 | 0.639062 |
1cd10f486e009ce493ffd5176a8591efa9fced69 | 5,617 | py | Python | lab/app/simulator.py | dineshkumar4u/monitor-ml-models-efficiently-across-fleets-of-devices-aim325 | ad330f3d1c37081284ffa979f4fb99630903688a | [
"MIT-0"
] | 4 | 2021-12-02T23:05:46.000Z | 2022-01-11T19:38:29.000Z | lab/app/simulator.py | dineshkumar4u/monitor-ml-models-efficiently-across-fleets-of-devices-aim325 | ad330f3d1c37081284ffa979f4fb99630903688a | [
"MIT-0"
] | 1 | 2021-11-27T04:18:50.000Z | 2021-11-27T04:43:43.000Z | lab/app/simulator.py | dineshkumar4u/monitor-ml-models-efficiently-across-fleets-of-devices-aim325 | ad330f3d1c37081284ffa979f4fb99630903688a | [
"MIT-0"
] | 2 | 2021-11-25T17:56:38.000Z | 2021-11-27T04:19:18.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import time
import pandas as pd
import subprocess
import ipywidgets as widgets
import logging
import numpy as np
import os
import signal
from turbine import WindTurbine
class WindTurbineFarmSimulator(object):
def ... | 43.207692 | 135 | 0.624711 |
1cd1713df31e45e3efe85327a93f48bb971163ff | 3,488 | py | Python | catalyst/data/scripts/split_dataframe.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/data/scripts/split_dataframe.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/data/scripts/split_dataframe.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 1 | 2018-12-21T15:56:21.000Z | 2018-12-21T15:56:21.000Z | import argparse
import json
from pathlib import Path
import pandas as pd
from catalyst.utils import folds_to_list, split_dataframe
def build_args(parser):
"""Constructs the command-line arguments for
``catalyst-data split-dataframe``.
"""
parser.add_argument(
"--in-csv",
type=Path,
... | 24.737589 | 79 | 0.597764 |
1cd1830c8d3976c381afd770e9f0a466b7a00f13 | 33,309 | py | Python | gpMgmt/bin/gppylib/commands/unix.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/commands/unix.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/commands/unix.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
"""
Set of Classes for executing unix commands.
"""
import os
import platform
import psutil
import socket
import signal
import uuid
from gppylib.gplog import get_default_logger
from gppylib.commands.base import *
logger = get_default_... | 31.874641 | 150 | 0.605032 |
1cd186a2d826635b67a113f5a75e8981a22099cb | 5,715 | py | Python | torchvision/prototype/models/vision_transformer.py | sallysyw/vision | bf073e785528970e6a1605e411e4fc382d686dc7 | [
"BSD-3-Clause"
] | null | null | null | torchvision/prototype/models/vision_transformer.py | sallysyw/vision | bf073e785528970e6a1605e411e4fc382d686dc7 | [
"BSD-3-Clause"
] | null | null | null | torchvision/prototype/models/vision_transformer.py | sallysyw/vision | bf073e785528970e6a1605e411e4fc382d686dc7 | [
"BSD-3-Clause"
] | null | null | null | # References:
# https://github.com/google-research/vision_transformer
# https://github.com/facebookresearch/ClassyVision/blob/main/classy_vision/models/vision_transformer.py
from functools import partial
from typing import Any, Optional
from torchvision.prototype.transforms import ImageNetEval
from torchvision.transf... | 29.307692 | 119 | 0.650219 |
1cd18b83524b9ad0742957045ed6e9fd08c8de81 | 250 | py | Python | bflib/characters/specialabilities/classabilities.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | 3 | 2017-10-28T11:28:38.000Z | 2018-09-12T09:47:00.000Z | bflib/characters/specialabilities/classabilities.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | bflib/characters/specialabilities/classabilities.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | from bflib.characters.specialabilities.base import SpecialAbility
class ArcaneCaster(SpecialAbility):
pass
class DivineCaster(SpecialAbility):
pass
class ReadMagic(SpecialAbility):
pass
class TurnUndead(SpecialAbility):
pass
| 13.157895 | 65 | 0.776 |
1cd19bbfe3c2e03d9a736d47851299553526bb2a | 3,213 | py | Python | etd/diff.py | fmaguire/evolving_threat_detector | 3f38ddf3760c604146d75266fe07ec2d7502b7a3 | [
"MIT"
] | 2 | 2019-12-14T17:32:57.000Z | 2020-01-07T21:39:22.000Z | etd/diff.py | fmaguire/evolving_threat_detector | 3f38ddf3760c604146d75266fe07ec2d7502b7a3 | [
"MIT"
] | 11 | 2019-12-13T20:26:08.000Z | 2020-06-17T15:47:33.000Z | etd/diff.py | fmaguire/evolving_threat_detector | 3f38ddf3760c604146d75266fe07ec2d7502b7a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
import os
import logging
def find_rgi_differences(input_rgi, closest_relatives_rgi):
"""
Between sets of RGI output tsvs as dataframes find those AMR genes unique
to the input RGI output relative to the RGI results of the mash identified
... | 40.670886 | 97 | 0.685963 |
1cd1bb6ef9ec7e41bab6d337a331776dacd7f6a2 | 127,432 | py | Python | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2021_06_01_preview/models/_models_py3.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2021_06_01_preview/models/_models_py3.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2021_06_01_preview/models/_models_py3.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 37.359132 | 125 | 0.645364 |
1cd1bdb89a05efe3c401c3f0559cc701f7386b67 | 2,935 | py | Python | strings/problems/find_if_2_strings_exist_and_if_non_overlapping.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | 10 | 2020-09-21T22:23:09.000Z | 2022-01-25T16:58:44.000Z | strings/problems/find_if_2_strings_exist_and_if_non_overlapping.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | strings/problems/find_if_2_strings_exist_and_if_non_overlapping.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | """
Given a string, we need to find , if it contains AB, and BA seperately and they are non-overlapping
The strings can be in any order.
"""
from typing import List
p = 31
m = 10 ** 9 + 9
def compute_hash(s):
n = len(s)
power_mod = [1]
for i in range(n):
power_mod.append((power_mod[-1] * p) % m)... | 24.256198 | 99 | 0.535605 |
1cd2057d4f36b7342d7259fb3a879ae56b57bd0d | 13,096 | py | Python | installer/parser/model.py | F0xedb/tos-installer-backend | 664b5d2100b302f22e649c449ccfa1376d838215 | [
"MIT"
] | 1 | 2019-09-14T17:15:23.000Z | 2019-09-14T17:15:23.000Z | installer/parser/model.py | F0xedb/tos-installer-backend | 664b5d2100b302f22e649c449ccfa1376d838215 | [
"MIT"
] | 10 | 2019-08-25T20:52:47.000Z | 2019-10-14T13:44:19.000Z | installer/parser/model.py | ODEX-TOS/tos-installer-backend | 664b5d2100b302f22e649c449ccfa1376d838215 | [
"MIT"
] | null | null | null |
# MIT License
#
# Copyright (c) 2019 Meyers Tom
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... | 32.496278 | 290 | 0.618891 |
1cd25ef1abf4fd0704507ad5fd27bc493f53af7b | 236 | py | Python | src/runner.py | mfrigerio17/robot-model-tools | 97e25d5c4d1386c503d37a70b57400022c5b7ca0 | [
"BSD-3-Clause"
] | 2 | 2020-06-16T09:23:46.000Z | 2021-01-20T09:11:43.000Z | src/runner.py | mfrigerio17/robot-model-tools | 97e25d5c4d1386c503d37a70b57400022c5b7ca0 | [
"BSD-3-Clause"
] | null | null | null | src/runner.py | mfrigerio17/robot-model-tools | 97e25d5c4d1386c503d37a70b57400022c5b7ca0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from rmt import rmt
# This script allows to launch the command line tool without installing the
# packages. Simply execute it from its directory (which should be src/).
if __name__ == '__main__':
rmt.main() | 26.222222 | 75 | 0.737288 |
1cd2643ae324ecd667e14cd5836ac8ebcc54af42 | 476 | py | Python | pbgca/__init__.py | jeromeshan/mimas | 4e4250bc74a0e69560a13053a9d556bcfd42c6c4 | [
"MIT"
] | null | null | null | pbgca/__init__.py | jeromeshan/mimas | 4e4250bc74a0e69560a13053a9d556bcfd42c6c4 | [
"MIT"
] | null | null | null | pbgca/__init__.py | jeromeshan/mimas | 4e4250bc74a0e69560a13053a9d556bcfd42c6c4 | [
"MIT"
] | null | null | null | from pbgca.cluster import Cluster
from pbgca.clusterer import Clusterer
from pbgca.cube_generator import CubeGenerator
from pbgca.connectivity_matrix import ConnectivityMatrix
from pbgca.cm_python import connectivity_matrix_python
import pyximport
import numpy as np
pyximport.install(setup_args={"include_dirs":np.get_i... | 39.666667 | 63 | 0.842437 |
1cd2668f1b0fe1adf167b2725e45e3a24a93a4be | 2,844 | py | Python | PR_Pillow_floodfill/PR-testcases-2-1/ff_original.py | yo1995/Daily_Python_Tasks | 211255deead5023cdcea1db4f49a53eedfe762b6 | [
"MIT"
] | 14 | 2018-05-21T05:12:25.000Z | 2021-11-28T14:49:55.000Z | PR_Pillow_floodfill/PR-testcases-2-1/ff_original.py | yo1995/Daily_Python_Tasks | 211255deead5023cdcea1db4f49a53eedfe762b6 | [
"MIT"
] | 2 | 2018-11-28T20:59:37.000Z | 2021-07-27T22:39:33.000Z | PR_Pillow_floodfill/PR-testcases-2-1/ff_original.py | yo1995/Daily_Python_Tasks | 211255deead5023cdcea1db4f49a53eedfe762b6 | [
"MIT"
] | 6 | 2019-03-21T01:07:57.000Z | 2021-03-29T03:24:33.000Z | import time
from PIL import Image, ImageDraw
import sys
import psutil
import os
def _color_diff(rgb1, rgb2):
"""
Uses 1-norm distance to calculate difference between two rgb values.
"""
return abs(rgb1[0]-rgb2[0]) + abs(rgb1[1]-rgb2[1]) + abs(rgb1[2]-rgb2[2])
def floodfill_o(image, xy, value, border... | 33.458824 | 77 | 0.511252 |
1cd279a5bb7a1d137cbd8131490c2896c7ac68b0 | 3,361 | py | Python | dpa/houdini/session.py | Clemson-DPA/dpa-pipe | 2482b8a0fd96dc19c0be4e82c3eaf0508914a968 | [
"MIT"
] | 55 | 2015-07-15T02:33:55.000Z | 2020-12-28T08:02:54.000Z | dpa/houdini/session.py | Clemson-DPA/dpa-pipe | 2482b8a0fd96dc19c0be4e82c3eaf0508914a968 | [
"MIT"
] | 5 | 2015-07-11T03:21:10.000Z | 2016-12-27T12:20:07.000Z | dpa/houdini/session.py | Clemson-DPA/dpa-pipe | 2482b8a0fd96dc19c0be4e82c3eaf0508914a968 | [
"MIT"
] | 12 | 2015-07-08T04:48:39.000Z | 2020-06-27T11:35:58.000Z |
import os
import time
# attempt to import hou module. if it fails, not in a houdini session.
try:
import hou
except ImportError:
HOU_IMPORTED = False
else:
HOU_IMPORTED = True
# -----------------------------------------------------------------------------
# attempt to import hou ui module. if it fails, ... | 30.279279 | 79 | 0.439155 |
1cd292f7320106972e8bde6b8d4461c4bc4624a1 | 1,079 | py | Python | python_modules/libraries/dagster-aws/dagster_aws/s3/sensor.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-aws/dagster_aws/s3/sensor.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-aws/dagster_aws/s3/sensor.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | import boto3
from dagster import check
MAX_KEYS = 1000
def get_s3_keys(bucket, prefix="", since_key=None, s3_session=None):
check.str_param(bucket, "bucket")
check.str_param(prefix, "prefix")
check.opt_str_param(since_key, "since_key")
if not s3_session:
s3_session = boto3.resource("s3", us... | 25.093023 | 91 | 0.610751 |
1cd2b2d807fbb1b1ab48ff805de4a5c2e78f1f6d | 30,452 | py | Python | txdav/dps/test/test_client.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | txdav/dps/test/test_client.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | txdav/dps/test/test_client.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2013-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.292793 | 90 | 0.615033 |
1cd2bbd00300c9cc5e7c7dd3310efe44eb742810 | 16,024 | py | Python | python_modules/dagster/dagster/core/definitions/solid_invocation.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/solid_invocation.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/solid_invocation.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | import inspect
from typing import TYPE_CHECKING, Any, Optional, Union, cast
from dagster import check
from dagster.core.errors import (
DagsterInvalidInvocationError,
DagsterInvariantViolationError,
DagsterTypeCheckDidNotPass,
)
from .events import AssetMaterialization, DynamicOutput, ExpectationResult, M... | 42.730667 | 156 | 0.652396 |
1cd2c98ee4a27a9b1e3bf88b2a43577d7269b4d9 | 47,390 | py | Python | SCRAPE/Lib/site-packages/twisted/internet/base.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | SCRAPE/Lib/site-packages/twisted/internet/base.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | SCRAPE/Lib/site-packages/twisted/internet/base.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | # -*- test-case-name: twisted.test.test_internet,twisted.internet.test.test_core -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Very basic functionality for a Reactor implementation.
"""
import builtins
import socket # needed only for sync-dns
import warnings
from abc import ABC, ab... | 35.445026 | 87 | 0.610382 |
1cd314a39000df1286f339c65a563f8d8457a109 | 3,408 | py | Python | hivemind/server/connection_handler.py | ploshkin/hivemind | 7bb656567417895e9f1d8684a0c0e9ef4e4de25d | [
"MIT"
] | null | null | null | hivemind/server/connection_handler.py | ploshkin/hivemind | 7bb656567417895e9f1d8684a0c0e9ef4e4de25d | [
"MIT"
] | null | null | null | hivemind/server/connection_handler.py | ploshkin/hivemind | 7bb656567417895e9f1d8684a0c0e9ef4e4de25d | [
"MIT"
] | null | null | null | import multiprocessing as mp
import os
import pickle
from typing import Dict
import grpc
import torch
from hivemind.proto import runtime_pb2, runtime_pb2_grpc as runtime_grpc
from hivemind.server.expert_backend import ExpertBackend
from hivemind.utils import get_logger, serialize_torch_tensor, deserialize_torch_tenso... | 46.684932 | 118 | 0.711268 |
1cd3212a80d0ec69d54eb9de38279a5385f2b0a7 | 20,692 | py | Python | backend/backend/services/audit_gen/user_cumulative_liability.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | 2 | 2022-03-17T04:50:20.000Z | 2022-03-17T04:51:31.000Z | backend/backend/services/audit_gen/user_cumulative_liability.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | backend/backend/services/audit_gen/user_cumulative_liability.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | import logging
import uuid
from datetime import datetime
from fractions import Fraction
from typing import Dict, List, Sequence, Tuple
import grpc
import sqlalchemy.orm
from common.constants import (
ADMIN_UUID,
MAX_USER_BAL,
MAX_USER_BAL_BITS,
PAGINATION_LIMIT,
SECP256K1_ALTERNATIVE_GENERATOR,
... | 46.1875 | 117 | 0.655906 |
1cd33784d484960ab0c63a6aa357d994dda3243c | 124 | py | Python | abc/abc068/b/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/abc068/b/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/abc068/b/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | N = int(input())
L = [2 ** i for i in range(10)]
for i,l in enumerate(L):
if l > N:
print(L[i-1])
exit() | 20.666667 | 31 | 0.467742 |
1cd340fb5c99521265a8f004402b60227f5e998a | 2,622 | py | Python | tests/test_teacher_views.py | Thommond/tsct-portal | 726cfcf86a15985093fd9002a2636478a2495e9e | [
"MIT"
] | 2 | 2020-04-16T00:44:44.000Z | 2020-04-21T19:14:30.000Z | tests/test_teacher_views.py | Thommond/tsct-portal | 726cfcf86a15985093fd9002a2636478a2495e9e | [
"MIT"
] | 16 | 2020-04-14T17:41:11.000Z | 2020-10-30T18:42:33.000Z | tests/test_teacher_views.py | Thommond/tsct-portal | 726cfcf86a15985093fd9002a2636478a2495e9e | [
"MIT"
] | 1 | 2020-04-07T18:08:54.000Z | 2020-04-07T18:08:54.000Z | import pytest
from portal.student_views import view_schedule
from .test_courses import login, logout
def test_all_grades(client):
# Make sure anonymous users cannot access
assert client.get('/course/216/session/1/all_grades').status_code == 302
# Login
rv = login(client, 'teacher@stevenscollege.edu', '... | 43.7 | 86 | 0.708238 |
1cd374ea05bb69c47567ea3dec24aa1194f6f316 | 15,021 | py | Python | moma_django/management/commands/loaddata_mongo.py | gadio/moma-django | 13265379be1dbab18697e5f42f38b3b37f928aa9 | [
"Apache-2.0"
] | 12 | 2015-03-29T05:31:25.000Z | 2019-06-13T16:17:37.000Z | moma_django/management/commands/loaddata_mongo.py | antoniotaranto/moma-django | 13265379be1dbab18697e5f42f38b3b37f928aa9 | [
"Apache-2.0"
] | 8 | 2015-09-04T21:00:50.000Z | 2021-06-10T17:39:44.000Z | moma_django/management/commands/loaddata_mongo.py | antoniotaranto/moma-django | 13265379be1dbab18697e5f42f38b3b37f928aa9 | [
"Apache-2.0"
] | 3 | 2015-03-25T21:52:14.000Z | 2021-01-11T03:02:29.000Z | #==========================================================================
# Copyright 2012 Lucidel, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the License.
# You may obtain a copy of the License in the LICENSE file, or at:
#
# http://... | 49.24918 | 178 | 0.48106 |
1cd37dfa3edb61c5f9c7eb7b57b2b94d839971f4 | 528 | py | Python | Chapter 8/generateQRCodes.py | PacktPublishing/Raspberry-Pi-Cookbook-for-Python-Programmers-SecondEdition | 6df896e590e3b95b72d51f779ce732f0191f64ca | [
"MIT"
] | 11 | 2016-11-18T15:06:16.000Z | 2021-07-24T19:19:58.000Z | Chapter 8/generateQRCodes.py | PacktPublishing/Raspberry-Pi-Cookbook-for-Python-Programmers-SecondEdition | 6df896e590e3b95b72d51f779ce732f0191f64ca | [
"MIT"
] | null | null | null | Chapter 8/generateQRCodes.py | PacktPublishing/Raspberry-Pi-Cookbook-for-Python-Programmers-SecondEdition | 6df896e590e3b95b72d51f779ce732f0191f64ca | [
"MIT"
] | 12 | 2017-01-28T18:31:35.000Z | 2021-10-02T16:58:19.000Z | #!/usr/bin/python3
#generateQRCodes.py
import pyqrcode
valid=False
print("QR-Code generator")
while(valid==False):
inputpages=input("How many pages?")
try:
PAGES=int(inputpages)
valid=True
except ValueError:
print("Enter valid number.")
pass
print("Creating QR-Codes for ... | 25.142857 | 53 | 0.645833 |
1cd382b50adda346a9663fa2ee16497b5da2e18c | 891 | py | Python | regparser/commands/full_tests.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 26 | 2016-06-04T20:48:09.000Z | 2021-07-28T18:13:30.000Z | regparser/commands/full_tests.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 146 | 2016-04-06T19:07:54.000Z | 2022-01-02T20:09:53.000Z | regparser/commands/full_tests.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 28 | 2016-04-09T20:40:48.000Z | 2021-05-08T17:52:59.000Z | import sys
import click
from stevedore import extension
from stevedore.exception import NoMatches
def get_stevedore_module_names(namespace):
names = []
def extension_adder(ext):
if len(ext.entry_point.attrs) == 0: # account for case without :
test_name = ext.entry_point.module_name
... | 21.731707 | 75 | 0.672278 |
1cd382d495650ec59f6e7168ebdedcc8c06db861 | 675 | py | Python | test_dispatcher.py | redcyb/rbm-dbn-mlp | b4df5ea5faf4be8f2c2faf0526e2981f9391b66c | [
"MIT"
] | null | null | null | test_dispatcher.py | redcyb/rbm-dbn-mlp | b4df5ea5faf4be8f2c2faf0526e2981f9391b66c | [
"MIT"
] | null | null | null | test_dispatcher.py | redcyb/rbm-dbn-mlp | b4df5ea5faf4be8f2c2faf0526e2981f9391b66c | [
"MIT"
] | null | null | null | from dbn_builder.dispatcher import Dispatcher
if __name__ == '__main__':
dispatcher = Dispatcher(
datasets="./data",
results="./results"
)
dataset = "mnist"
semi_labeled = False
dispatcher.dispatch(
action="build_and_train",
target="dbn",
search=1,
... | 23.275862 | 83 | 0.579259 |
1cd38bc9ce21dae2c4f4a766fc621a7dbcef6236 | 6,894 | py | Python | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_validating_webhook_configuration.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_validating_webhook_configuration.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_validating_webhook_configuration.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1bet... | 34.994924 | 295 | 0.643168 |
1cd39fc9602357e81ab2f6a28203b3ceb55e6921 | 12,288 | py | Python | src/utils/control/RemoteControlReceiverProcess.py | pauls3/Brain | 42f119b106755adc201886155b4b28e2f40e8a0b | [
"BSD-3-Clause"
] | null | null | null | src/utils/control/RemoteControlReceiverProcess.py | pauls3/Brain | 42f119b106755adc201886155b4b28e2f40e8a0b | [
"BSD-3-Clause"
] | null | null | null | src/utils/control/RemoteControlReceiverProcess.py | pauls3/Brain | 42f119b106755adc201886155b4b28e2f40e8a0b | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers
# All rights reserved.
# 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, ... | 34.909091 | 152 | 0.486735 |
1cd39ff9a3bd7f5a825a0bfc42100bcce00e9952 | 1,354 | py | Python | JDjangoDemo/docs/manage.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | 3 | 2020-12-28T05:09:02.000Z | 2021-06-23T10:02:03.000Z | JDjangoDemo/docs/manage.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | JDjangoDemo/docs/manage.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | from django.db import models
from django.db.models import Q
from django.utils.translation import gettext_lazy as _
class MenuManage(models.Manager):
def new(self,name,description,isroot=False,isvisible=True,order=0,parent_menu=None):
if None == parent_menu:
return self.create(
n... | 29.434783 | 88 | 0.584934 |
1cd3afff139c1eb6840c06f5594643ec3e902fee | 2,559 | py | Python | sjtwo-c/toolchains/mac/gcc-arm-none-eabi-8-2019-q3-update/arm-none-eabi/lib/thumb/v7-m/nofp/libstdc++.a-gdb.py | seanlinc/Playmate | 077877d172dd6b7beab910c52ec95ee300bc6480 | [
"Apache-2.0"
] | 2 | 2020-04-04T21:09:56.000Z | 2020-04-08T17:00:58.000Z | sjtwo-c/toolchains/mac/gcc-arm-none-eabi-8-2019-q3-update/arm-none-eabi/lib/thumb/v7-m/nofp/libstdc++.a-gdb.py | seanlinc/Playmate | 077877d172dd6b7beab910c52ec95ee300bc6480 | [
"Apache-2.0"
] | 13 | 2020-04-11T21:50:57.000Z | 2020-04-19T03:19:48.000Z | sjtwo-c/toolchains/mac/gcc-arm-none-eabi-8-2019-q3-update/arm-none-eabi/lib/thumb/v7-m/nofp/libstdc++.a-gdb.py | seanlinc/Playmate | 077877d172dd6b7beab910c52ec95ee300bc6480 | [
"Apache-2.0"
] | null | null | null | # -*- python -*-
# Copyright (C) 2009-2018 Free Software Foundation, Inc.
# This program 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 versio... | 41.274194 | 125 | 0.730363 |
1cd3c0fd687fd359f2db6a7fd62f11ada7bb34aa | 6,416 | py | Python | homeassistant/components/sensor/bitcoin.py | SKarthick5121995/karthickmaduraai | d5498dfb83e9bb57fff16db854ae3e15c1e15425 | [
"MIT"
] | null | null | null | homeassistant/components/sensor/bitcoin.py | SKarthick5121995/karthickmaduraai | d5498dfb83e9bb57fff16db854ae3e15c1e15425 | [
"MIT"
] | null | null | null | homeassistant/components/sensor/bitcoin.py | SKarthick5121995/karthickmaduraai | d5498dfb83e9bb57fff16db854ae3e15c1e15425 | [
"MIT"
] | 1 | 2019-10-02T14:07:14.000Z | 2019-10-02T14:07:14.000Z | """
Bitcoin information service that uses blockchain.info.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.bitcoin/
"""
import logging
from datetime import timedelta
from homeassistant.helpers.entity import Entity
from homeassistant.util import Th... | 37.741176 | 78 | 0.620168 |
1cd3cd225d09b6b5fe643a2f3ee9e7ad05016564 | 2,609 | py | Python | tests/test_umovme_get.py | kmee/python-umovme | 4d3d39f3778e464c4678b09d53022529af955bad | [
"MIT"
] | 1 | 2022-03-16T14:23:32.000Z | 2022-03-16T14:23:32.000Z | tests/test_umovme_get.py | kmee/python-umovme | 4d3d39f3778e464c4678b09d53022529af955bad | [
"MIT"
] | null | null | null | tests/test_umovme_get.py | kmee/python-umovme | 4d3d39f3778e464c4678b09d53022529af955bad | [
"MIT"
] | null | null | null | import os
from umovme.cli import main
from umovme.client import UmovmeCenter
from unittest import TestCase
class TestGet(TestCase):
def setUp(self):
self.client = UmovmeCenter(os.environ.get('UMOVME_TOKEN'))
def test_client(self):
resource_list = self.client.partner.search()
for re... | 34.328947 | 77 | 0.664239 |
1cd3dcdaad1d074a11a9236fd30c7941ae0f4ae1 | 2,185 | py | Python | deploy/templates/chc_resource/chc_dataset.py | kourtneyshort/healthcare | 1d1e2375304ac99f43a8b6aee7374fcdf641eb6f | [
"Apache-2.0"
] | null | null | null | deploy/templates/chc_resource/chc_dataset.py | kourtneyshort/healthcare | 1d1e2375304ac99f43a8b6aee7374fcdf641eb6f | [
"Apache-2.0"
] | 22 | 2019-12-16T22:18:37.000Z | 2022-03-12T00:04:43.000Z | deploy/templates/chc_resource/chc_dataset.py | animesh/healthcare | 7d3d4dc9deb3d31eab99035780ccb9a44f00b687 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 33.615385 | 77 | 0.65492 |
1cd4299f483195635663bf299d090ab0c89d3f21 | 517 | py | Python | code/run.py | cflamant/3d-pose-reconstruction | 8847a1eba88fe216b72ad74a21707e8d877bc63c | [
"MIT"
] | 5 | 2019-07-20T13:26:20.000Z | 2021-01-30T12:53:05.000Z | code/run.py | cflamant/3d-pose-reconstruction | 8847a1eba88fe216b72ad74a21707e8d877bc63c | [
"MIT"
] | null | null | null | code/run.py | cflamant/3d-pose-reconstruction | 8847a1eba88fe216b72ad74a21707e8d877bc63c | [
"MIT"
] | 1 | 2021-01-30T12:53:08.000Z | 2021-01-30T12:53:08.000Z | #!/usr/bin/env python
#Author: Cedric Flamant
# How to launch:
# In a terminal, while in this directory, simply run
# python run.py
import numpy as np
import pointstopos
import renderstick
import gui
import displaynewpoints
import optimizepoints
points,pradii,relorder,File=gui.selectpoints()
newpoints,newrelorder ... | 19.884615 | 66 | 0.808511 |
1cd440bdb3e76c78dafc420ada5062a49b424434 | 3,873 | py | Python | var/spack/repos/builtin/packages/salmon-tddft/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/salmon-tddft/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2021-01-08T22:23:53.000Z | 2022-03-30T11:08:17.000Z | var/spack/repos/builtin/packages/salmon-tddft/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 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 SalmonTddft(CMakePackage):
"""SALMON is an open-source computer program for ab-initio
... | 41.202128 | 95 | 0.626646 |
1cd45060bd1b5da3350d41d8b8b9903ef7abbd6d | 7,221 | py | Python | fastlvm/utils.py | autonlab/fastlvm | 05e77da39ca525eacf1a1e3aa2cc551e6cf18dcd | [
"MIT"
] | 4 | 2019-08-06T08:59:28.000Z | 2022-03-21T19:36:48.000Z | fastlvm/utils.py | autonlab/fastlvm | 05e77da39ca525eacf1a1e3aa2cc551e6cf18dcd | [
"MIT"
] | 10 | 2019-05-20T20:20:47.000Z | 2020-06-04T14:33:04.000Z | fastlvm/utils.py | autonlab/fastlvm | 05e77da39ca525eacf1a1e3aa2cc551e6cf18dcd | [
"MIT"
] | 2 | 2021-03-18T19:29:03.000Z | 2022-03-21T13:41:14.000Z | import copy
import numpy as np
import utilsc
import typing
from d3m.metadata import base as metadata_base
from d3m import container
from common_primitives import utils
_stirling = utilsc.new_stirling()
def read_corpus(fname, vocab=[], stopwords=[]):
return utilsc.read_corpus(fname, vocab, stopwords)
def get_re... | 35.571429 | 120 | 0.668467 |
1cd487fa256b53bc328420cbcb5cf20061cfc0a8 | 1,551 | py | Python | python/phonenumbers/data/region_TG.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 2 | 2019-03-30T02:12:54.000Z | 2021-03-08T18:59:40.000Z | python/phonenumbers/data/region_TG.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/data/region_TG.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 1 | 2018-11-10T03:47:34.000Z | 2018-11-10T03:47:34.000Z | """Auto-generated file, do not edit by hand. TG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_TG = PhoneMetadata(id='TG', country_code=228, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[29]\\d{7}', possible_number_pattern='\\... | 86.166667 | 155 | 0.769826 |
1cd4b4401a44d13599437baadf7cecd912e63cbb | 5,016 | py | Python | alipay/aop/api/domain/AlipayAssetCardDepositbackModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayAssetCardDepositbackModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayAssetCardDepositbackModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayAssetCardDepositbackModel(object):
def __init__(self):
self._biz_dt = None
self._biz_no = None
self._depositback_amount = None
self._extend_info = None
... | 31.15528 | 87 | 0.596093 |
1cd4b6544a70f081acc50ed070a7b8abfd44dcb6 | 3,524 | py | Python | classes/planet.py | Napam/MayhemPacman | cbcb3b4a2c83ed920e32748a8aaadb29b19ab5bf | [
"MIT"
] | 1 | 2021-04-07T12:54:13.000Z | 2021-04-07T12:54:13.000Z | classes/planet.py | Napam/MayhemPacman | cbcb3b4a2c83ed920e32748a8aaadb29b19ab5bf | [
"MIT"
] | null | null | null | classes/planet.py | Napam/MayhemPacman | cbcb3b4a2c83ed920e32748a8aaadb29b19ab5bf | [
"MIT"
] | null | null | null | '''
Module containing classes for celestial bodies (planets)
Written by Naphat Amundsen
'''
import pygame as pg
import numpy as np
from classes import template_classes
class planet(template_classes.game_object):
'''
Class for a planet object. The planet object feels a force pulling the object
... | 33.884615 | 109 | 0.620602 |
1cd4bb13c56bc0e6fbaae971f9a3afec7eb70101 | 1,614 | py | Python | tests/trojai_test.py | csy99/trigger-attack | 203871e894319befcaea5f8bce1d94d2ab5d859a | [
"BSD-2-Clause"
] | null | null | null | tests/trojai_test.py | csy99/trigger-attack | 203871e894319befcaea5f8bce1d94d2ab5d859a | [
"BSD-2-Clause"
] | null | null | null | tests/trojai_test.py | csy99/trigger-attack | 203871e894319befcaea5f8bce1d94d2ab5d859a | [
"BSD-2-Clause"
] | null | null | null | import unittest
from trojai_submission import data_tools
import os
import datasets
from datasets.utils import set_progress_bar_enabled
set_progress_bar_enabled(False)
class TestTriggerDataset(unittest.TestCase):
def setUp(self):
self.current_script_dirname = os.path.dirname(os.path.abspath(__file__))
... | 40.35 | 129 | 0.754027 |
1cd4c0d512bf76eb81f8b2006102f0f8838ced7b | 25 | py | Python | tests/__init__.py | proggga/hardest | 234cb41115c30a756ee11ed7c5fa41c9979d3303 | [
"MIT"
] | 2 | 2018-02-03T13:43:25.000Z | 2021-12-03T16:13:49.000Z | tests/__init__.py | proggga/hardest | 234cb41115c30a756ee11ed7c5fa41c9979d3303 | [
"MIT"
] | 8 | 2017-08-16T08:34:59.000Z | 2018-02-05T18:30:44.000Z | tests/__init__.py | proggga/hardest | 234cb41115c30a756ee11ed7c5fa41c9979d3303 | [
"MIT"
] | 1 | 2018-02-05T18:26:20.000Z | 2018-02-05T18:26:20.000Z | """Tests for hardest."""
| 12.5 | 24 | 0.6 |
1cd4d7ebb0e6747d0e84746dd66a20c0d72463b9 | 1,901 | py | Python | pyram/utils/prettyplot.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | pyram/utils/prettyplot.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | pyram/utils/prettyplot.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 4 21:36:41 2015
Tools to make plots look better
@author: hoseung
"""
def tickInPboxFloat(xr, pboxsize, nticks=3):
from numpy import arange
dx = (xr[1] - xr[0]) / nticks
return ["{:1.2f}".format(i) for i in arange(xr[0], xr[1], dx) * pboxsize]
def tickInPb... | 26.774648 | 77 | 0.633351 |
1cd4fcabd4bc312f64e9221d270de1b4675e1a70 | 516 | py | Python | python/learn/PythonDataVisualizationCookbookSE_Code/Chapter 02/ch02-tabread.py | flyingwjw/Documentation | 567608f388ca369b864c2d75a94647801b5dfa1e | [
"Unlicense"
] | 26 | 2016-08-25T01:33:36.000Z | 2022-03-20T11:33:31.000Z | python/learn/PythonDataVisualizationCookbookSE_Code/Chapter 02/ch02-tabread.py | flyingwjw/Documentation | 567608f388ca369b864c2d75a94647801b5dfa1e | [
"Unlicense"
] | null | null | null | python/learn/PythonDataVisualizationCookbookSE_Code/Chapter 02/ch02-tabread.py | flyingwjw/Documentation | 567608f388ca369b864c2d75a94647801b5dfa1e | [
"Unlicense"
] | 31 | 2016-08-16T15:32:46.000Z | 2021-01-26T19:16:48.000Z | import csv
filename = 'ch02-data.tab'
data = []
try:
with open(filename) as f:
reader = csv.reader(f, dialect=csv.excel_tab)
c = 0
for row in reader:
if c == 0:
header = row
else:
data.append(row)
c += 1
except csv.Error a... | 19.846154 | 72 | 0.505814 |
1cd4fda7110ff1254516e87f35858621bfe35dd7 | 46,989 | py | Python | hopic/test/test_build.py | LaudateCorpus1/hopic | f4e924b9162a47ec0abbcbd191924539377b7435 | [
"Apache-2.0"
] | 6 | 2020-10-08T10:13:02.000Z | 2022-02-12T17:26:12.000Z | hopic/test/test_build.py | tomtom-international/hopic | 72ea9cc90342c0dd4f5cf1533e1ba2b43376c7cb | [
"Apache-2.0"
] | 1 | 2021-09-14T03:57:51.000Z | 2021-09-14T03:57:51.000Z | hopic/test/test_build.py | LaudateCorpus1/hopic | f4e924b9162a47ec0abbcbd191924539377b7435 | [
"Apache-2.0"
] | 7 | 2020-12-08T19:20:42.000Z | 2022-01-28T09:23:47.000Z | # Copyright (c) 2019 - 2021 TomTom N.V. (https://tomtom.com)
#
# 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... | 30.140475 | 288 | 0.547064 |
1cd516361d61e08e062f19c03a16ebb4f850daae | 39,201 | py | Python | client/local_caching.py | hixio-mh/luci-py | 5e2606b0db8f5dac25e9f84fdf71d103da393894 | [
"Apache-2.0"
] | null | null | null | client/local_caching.py | hixio-mh/luci-py | 5e2606b0db8f5dac25e9f84fdf71d103da393894 | [
"Apache-2.0"
] | 1 | 2022-03-02T11:45:18.000Z | 2022-03-02T11:45:18.000Z | client/local_caching.py | hixio-mh/luci-py | 5e2606b0db8f5dac25e9f84fdf71d103da393894 | [
"Apache-2.0"
] | 1 | 2021-07-23T15:32:55.000Z | 2021-07-23T15:32:55.000Z | # Copyright 2018 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Define local cache policies."""
import errno
import io
import logging
import os
import random
import string
import subprocess
import sys
impor... | 32.131967 | 80 | 0.640392 |
1cd5225546cb3213dacce05318c61dd11bc27b02 | 2,577 | py | Python | examples/ping.py | black-security/impacket3 | 5b6145b3f511d4f7cddaba64cf150b109113afea | [
"Apache-1.1"
] | null | null | null | examples/ping.py | black-security/impacket3 | 5b6145b3f511d4f7cddaba64cf150b109113afea | [
"Apache-1.1"
] | null | null | null | examples/ping.py | black-security/impacket3 | 5b6145b3f511d4f7cddaba64cf150b109113afea | [
"Apache-1.1"
] | 1 | 2022-01-28T00:53:41.000Z | 2022-01-28T00:53:41.000Z | #!/usr/bin/python
# Copyright (c) 2003 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Simple ICMP ping.
#
# This implementation of ping uses the ICMP echo and echo-reply pack... | 29.284091 | 112 | 0.706248 |
1cd523520dd8c0219cf78331c896f604c2756719 | 989 | py | Python | resilient-lib/setup.py | shanyangqu/resilient-python-api | e9e50a60324b383daf2c8c0d14db020c2c92056d | [
"MIT"
] | null | null | null | resilient-lib/setup.py | shanyangqu/resilient-python-api | e9e50a60324b383daf2c8c0d14db020c2c92056d | [
"MIT"
] | null | null | null | resilient-lib/setup.py | shanyangqu/resilient-python-api | e9e50a60324b383daf2c8c0d14db020c2c92056d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='resilient_lib',
use_scm_version={"root": "../", "relative_to": __file__},
setup_requires=['setuptools_scm'],
url='https://github.com/ibmresilient/resilient-circuits-packages',
license='MIT',
... | 31.903226 | 131 | 0.678463 |
1cd52e0c5ebe628c0100459d005c0e7b58c45508 | 4,107 | py | Python | readthedocs/betterversion/test/test_betterversion.py | dpgeorge/readthedocs.org | 492869523c81009369f435d658c6895bbe90eafd | [
"MIT"
] | 1 | 2016-07-03T03:02:25.000Z | 2016-07-03T03:02:25.000Z | readthedocs/betterversion/test/test_betterversion.py | dpgeorge/readthedocs.org | 492869523c81009369f435d658c6895bbe90eafd | [
"MIT"
] | null | null | null | readthedocs/betterversion/test/test_betterversion.py | dpgeorge/readthedocs.org | 492869523c81009369f435d658c6895bbe90eafd | [
"MIT"
] | null | null | null | import unittest
from ..better import version_windows, BetterVersion
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.versions = [
BetterVersion("0.1.0"),
BetterVersion("0.2.0"),
BetterVersion("0.2.1"),
BetterVersion("0.3.0"),
... | 39.114286 | 156 | 0.6299 |
1cd56fbaa088670f6e344f5046e409ce59941649 | 21,789 | py | Python | b2sdk/account_info/sqlite_account_info.py | ehossack/b2-sdk-python | 034bec38671c0862b6956915993061359dbd51f6 | [
"MIT"
] | 128 | 2019-02-02T17:53:23.000Z | 2022-03-28T09:28:35.000Z | b2sdk/account_info/sqlite_account_info.py | ehossack/b2-sdk-python | 034bec38671c0862b6956915993061359dbd51f6 | [
"MIT"
] | 168 | 2019-02-26T22:14:16.000Z | 2022-03-27T06:25:28.000Z | b2sdk/account_info/sqlite_account_info.py | ehossack/b2-sdk-python | 034bec38671c0862b6956915993061359dbd51f6 | [
"MIT"
] | 52 | 2019-01-28T16:40:56.000Z | 2022-03-14T19:55:05.000Z | ######################################################################
#
# File: b2sdk/account_info/sqlite_account_info.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
import json... | 38.026178 | 117 | 0.540686 |
1cd5898b97525a86e2f492bdeb76b1e90cbcd627 | 650 | py | Python | reception/migrations/0002_auto_20201207_1056.py | henrylameck/school_management_system | 38c270977d001d28f2338eb90fffc3e8c2598d06 | [
"MIT"
] | null | null | null | reception/migrations/0002_auto_20201207_1056.py | henrylameck/school_management_system | 38c270977d001d28f2338eb90fffc3e8c2598d06 | [
"MIT"
] | 3 | 2021-06-05T00:01:48.000Z | 2021-09-22T19:39:12.000Z | reception/migrations/0002_auto_20201207_1056.py | henrylameck/school_management_system | 38c270977d001d28f2338eb90fffc3e8c2598d06 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-12-07 07:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reception', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='applicationformsale',
name='form_numb... | 27.083333 | 93 | 0.62 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.