hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7b5f00385afd1218c29643068449bf1af12389e7 | 269 | py | Python | redirink/insights/pagination.py | Egor4ik325/redirink | 17ef85f48145ee6112f2fcbab60dcd9d65ba78bf | [
"MIT"
] | null | null | null | redirink/insights/pagination.py | Egor4ik325/redirink | 17ef85f48145ee6112f2fcbab60dcd9d65ba78bf | [
"MIT"
] | null | null | null | redirink/insights/pagination.py | Egor4ik325/redirink | 17ef85f48145ee6112f2fcbab60dcd9d65ba78bf | [
"MIT"
] | 1 | 2021-12-31T00:46:31.000Z | 2021-12-31T00:46:31.000Z | from rest_framework import pagination
class InsightPagination(pagination.PageNumberPagination):
"""
Response data pagination for insight.
"""
page_size = 30
max_page_size = 30
page_query_param = "page"
page_size_query_param = "page_size"
| 20.692308 | 57 | 0.72119 |
182df7613c8cdc5d4a724151ac50db0bd2e98c61 | 3,528 | py | Python | tools/utils/skeleton_to_ntu_format.py | bruceyo/TSMF | 80f0306d4aca697acf5776e792f4428035a6cd88 | [
"BSD-2-Clause"
] | 8 | 2021-03-01T03:12:03.000Z | 2021-12-14T12:45:09.000Z | tools/utils/skeleton_to_ntu_format.py | bruceyo/TSMF | 80f0306d4aca697acf5776e792f4428035a6cd88 | [
"BSD-2-Clause"
] | null | null | null | tools/utils/skeleton_to_ntu_format.py | bruceyo/TSMF | 80f0306d4aca697acf5776e792f4428035a6cd88 | [
"BSD-2-Clause"
] | 3 | 2021-07-09T02:49:33.000Z | 2022-03-14T09:26:39.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu May 7 13:52:08 2020
@author: bruce
"""
import os
import numpy as np
skeleton_folder = 'Z:/PKUMMD/data/PKU_Skeleton_Renew/'
label_folder = 'Z:/PKUMMD/Label/Train_Label_PKU_final/'
save_path = 'Z:/PKUMMD/data/skeleton_ntu/'
view_dic = {'L':'001','M':'002','R':... | 36 | 99 | 0.55102 |
eafcf58fcd51b58e372a5b34a15db0f55e9b0b7f | 84,473 | py | Python | pymc/tests/test_distributions_random.py | percevalve/pymc | 05aa247957553f608d9690ff9f61240aa35b71f8 | [
"Apache-2.0"
] | null | null | null | pymc/tests/test_distributions_random.py | percevalve/pymc | 05aa247957553f608d9690ff9f61240aa35b71f8 | [
"Apache-2.0"
] | null | null | null | pymc/tests/test_distributions_random.py | percevalve/pymc | 05aa247957553f608d9690ff9f61240aa35b71f8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 35.211755 | 112 | 0.593776 |
d718e8d23069959591cf8b758d5c45381a08e628 | 873 | py | Python | pyACA/FeatureSpectralSpread.py | RichardYang40148/pyACA-1 | 870d100ed232cca5a890570426116f70cd0736c8 | [
"MIT"
] | null | null | null | pyACA/FeatureSpectralSpread.py | RichardYang40148/pyACA-1 | 870d100ed232cca5a890570426116f70cd0736c8 | [
"MIT"
] | null | null | null | pyACA/FeatureSpectralSpread.py | RichardYang40148/pyACA-1 | 870d100ed232cca5a890570426116f70cd0736c8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
computes the spectral spread from the magnitude spectrum
Args:
X: spectrogram (dimension FFTLength X Observations)
f_s: sample rate of audio data
Returns:
vss spectral spread (in Hz)
"""
import numpy as np
from FeatureSpectralCentroid import FeatureSpectralCentroid
... | 22.973684 | 65 | 0.618557 |
93dc622697e60e16d08254e8228d4ad66792e772 | 4,134 | py | Python | unittest_reinvent/inception_tests/test_empty_inception.py | fujirock/Reinvent | 9c57636f9d32b4ce5b75670f43906a70d5daf886 | [
"MIT"
] | 4 | 2021-05-11T05:34:01.000Z | 2022-03-30T10:04:21.000Z | unittest_reinvent/inception_tests/test_empty_inception.py | prasannavd/Reinvent | ca02ebee8d8ed83223c55f4a1dd1b3fbc2359616 | [
"MIT"
] | null | null | null | unittest_reinvent/inception_tests/test_empty_inception.py | prasannavd/Reinvent | ca02ebee8d8ed83223c55f4a1dd1b3fbc2359616 | [
"MIT"
] | 2 | 2021-06-01T11:56:10.000Z | 2021-10-05T04:33:56.000Z | import os
import shutil
import unittest
import numpy as np
import numpy.testing as nt
import torch as ts
import utils.general as utils_general
from models.model import Model
from running_modes.configurations.reinforcement_learning.inception_configuration import InceptionConfiguration
from running_modes.reinforcement_... | 49.807229 | 119 | 0.652879 |
ab037f25a1721157c0d866217fdf19be324b67bd | 22,155 | py | Python | swaps/client/market.py | DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur | 1120ebfb487ce4987fe70e6645b36e0d7ce041ec | [
"Apache-2.0"
] | 1 | 2021-09-06T00:09:11.000Z | 2021-09-06T00:09:11.000Z | swaps/client/market.py | DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur | 1120ebfb487ce4987fe70e6645b36e0d7ce041ec | [
"Apache-2.0"
] | null | null | null | swaps/client/market.py | DunnCreativeSS/cash_carry_leveraged_futures_arbitrageur | 1120ebfb487ce4987fe70e6645b36e0d7ce041ec | [
"Apache-2.0"
] | null | null | null | from swaps.constant import *
from swaps.model.market import *
from swaps.utils import *
from swaps.utils.input_checker import check_in_list
class MarketClient(object):
def __init__(self, **kwargs):
"""
Create the request client instance.
:param kwargs: The option of request connection.
... | 44.577465 | 157 | 0.653893 |
8d53e6b062a3ef25bc51f74d907d7000efe038c5 | 765 | py | Python | src/pyrtime/rtime/datastructures.py | amitu/rtime | 6e23a2f86a2cae4399932879f0d157f8e63a8358 | [
"BSD-3-Clause"
] | 2 | 2017-04-01T14:05:58.000Z | 2017-04-02T07:57:56.000Z | src/pyrtime/rtime/datastructures.py | amitu/rtime | 6e23a2f86a2cae4399932879f0d157f8e63a8358 | [
"BSD-3-Clause"
] | 3 | 2016-11-08T08:00:08.000Z | 2016-11-08T08:15:20.000Z | src/pyrtime/rtime/datastructures.py | amitu/rtime | 6e23a2f86a2cae4399932879f0d157f8e63a8358 | [
"BSD-3-Clause"
] | null | null | null | class Frame(dict):
def __init__(self, name=None, *args, **kwargs):
super(Frame, self).__init__(*args, **kwargs)
if name:
self.name = name
def get_current_frame(self):
if not self.stack:
self.stack.insert(-1, Frame())
return self.stack[-1]
def get_nam... | 24.677419 | 56 | 0.580392 |
983d7c5b9f43b607603a25d22267e4ebe302b830 | 5,931 | py | Python | tabla/tabla/simulation/pu.py | ziqingzeng/public | 4102b3bd42f43b49cf74599492d52d4f755ab7b2 | [
"BSD-3-Clause"
] | 6 | 2021-04-20T06:33:25.000Z | 2022-02-24T06:46:13.000Z | tabla/tabla/simulation/pu.py | ziqingzeng/public | 4102b3bd42f43b49cf74599492d52d4f755ab7b2 | [
"BSD-3-Clause"
] | 3 | 2021-04-20T04:28:51.000Z | 2021-05-24T05:14:31.000Z | tabla/tabla/simulation/pu.py | ziqingzeng/public | 4102b3bd42f43b49cf74599492d52d4f755ab7b2 | [
"BSD-3-Clause"
] | 4 | 2021-04-08T16:38:46.000Z | 2021-04-30T05:51:30.000Z | from .pe import PE
from .bus import PENB, PEGB
from .buffer import Buffer
from .bus_arbiter import PEGBArbiter
from .defaults import DEFAULT_NAMESPACE_BUFFER_SIZE, DEFAULT_BUS_BUFFER_SIZE, DEFAULT_INPUT_BITWIDTH, DEFAULT_INTERIM_BITWIDTH, DEFAULT_BUS_BITWIDTH
"""
PU has PEs, buses, bus arbiter.
"""
class PU(object):
... | 31.887097 | 148 | 0.588771 |
01b75982886769bd5d645ae0ccd934107bff44d0 | 3,062 | py | Python | aliyun-python-sdk-polardb/aliyunsdkpolardb/request/v20170801/CreateAccountRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-polardb/aliyunsdkpolardb/request/v20170801/CreateAccountRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-polardb/aliyunsdkpolardb/request/v20170801/CreateAccountRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.022222 | 80 | 0.775963 |
7e688f50c310fd3ce74bede2c94b02e5f65457f7 | 587 | py | Python | portafolio/core/migrations/0011_auto_20200805_2059.py | jhonfmg7/portafolioDjango | 64db6a371a84dcad4f22dd7cdeb598c7c2db124e | [
"Apache-2.0"
] | null | null | null | portafolio/core/migrations/0011_auto_20200805_2059.py | jhonfmg7/portafolioDjango | 64db6a371a84dcad4f22dd7cdeb598c7c2db124e | [
"Apache-2.0"
] | null | null | null | portafolio/core/migrations/0011_auto_20200805_2059.py | jhonfmg7/portafolioDjango | 64db6a371a84dcad4f22dd7cdeb598c7c2db124e | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.5 on 2020-08-05 20:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0010_choose'),
]
operations = [
migrations.AlterModelOptions(
name='choose',
options={'verbose_name': 'Elecc... | 25.521739 | 107 | 0.592845 |
d5bd8f9a6dc790e0cebf906d0a89d51949efdbbd | 11,259 | py | Python | config/settings/base.py | Dimercel/feedz | d1f0ab1558b6df63452d1ac12847e3e816c83c31 | [
"MIT"
] | null | null | null | config/settings/base.py | Dimercel/feedz | d1f0ab1558b6df63452d1ac12847e3e816c83c31 | [
"MIT"
] | null | null | null | config/settings/base.py | Dimercel/feedz | d1f0ab1558b6df63452d1ac12847e3e816c83c31 | [
"MIT"
] | null | null | null | """
Base settings to build other settings files upon.
"""
from datetime import timedelta
from pathlib import Path
import environ
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
# feedz/
APPS_DIR = ROOT_DIR / "feedz"
env = environ.Env()
# READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", de... | 39.644366 | 93 | 0.629363 |
9f68312a6499a1fbd9410df34a1ef90165da765d | 2,580 | py | Python | app/nlp_v2/bulk_predict.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 5 | 2020-04-02T12:03:57.000Z | 2020-10-18T19:29:15.000Z | app/nlp_v2/bulk_predict.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 22 | 2020-03-31T02:00:34.000Z | 2021-06-30T17:59:01.000Z | app/nlp_v2/bulk_predict.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 3 | 2020-04-04T16:08:08.000Z | 2020-10-20T01:32:46.000Z | import os
from pandas import DataFrame, read_csv
from app import seek_confirmation, DATA_DIR
from app.job import Job
from app.bq_service import BigQueryService
from app.nlp.model_storage import ModelStorage
LIMIT = os.getenv("LIMIT")
BATCH_SIZE = int(os.getenv("BATCH_SIZE", default="100000"))
CSV_FILEPATH = os.path... | 33.947368 | 140 | 0.654651 |
ad4a625aa0bdf56bb8c5082a559dc4b1a5b97e2f | 10,790 | gyp | Python | ThirdParty/webrtc/src/webrtc/voice_engine/voice_engine.gyp | JokeJoe8806/licode-windows | 2bfdaf6e87669df2b9960da50c6800bc3621b80b | [
"MIT"
] | 8 | 2018-12-27T14:57:13.000Z | 2021-04-07T07:03:15.000Z | ThirdParty/webrtc/src/webrtc/voice_engine/voice_engine.gyp | JokeJoe8806/licode-windows | 2bfdaf6e87669df2b9960da50c6800bc3621b80b | [
"MIT"
] | 1 | 2019-03-13T01:35:03.000Z | 2020-10-08T04:13:04.000Z | ThirdParty/webrtc/src/webrtc/voice_engine/voice_engine.gyp | JokeJoe8806/licode-windows | 2bfdaf6e87669df2b9960da50c6800bc3621b80b | [
"MIT"
] | 9 | 2018-12-28T11:45:12.000Z | 2021-05-11T02:15:31.000Z | # Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | 38.673835 | 89 | 0.573401 |
8644d354b4b477854096a57ec7de1118e66f6672 | 9,785 | py | Python | tests/unit/config_test.py | btaitelb/compose | 43369cda9ce5f0fe4860c7160cfa6550d31e2417 | [
"Apache-2.0"
] | null | null | null | tests/unit/config_test.py | btaitelb/compose | 43369cda9ce5f0fe4860c7160cfa6550d31e2417 | [
"Apache-2.0"
] | null | null | null | tests/unit/config_test.py | btaitelb/compose | 43369cda9ce5f0fe4860c7160cfa6550d31e2417 | [
"Apache-2.0"
] | null | null | null | import os
import mock
from .. import unittest
from compose import config
class ConfigTest(unittest.TestCase):
def test_from_dictionary(self):
service_dicts = config.from_dictionary({
'foo': {'image': 'busybox'},
'bar': {'environment': ['FOO=1']},
})
self.assertEqu... | 33.057432 | 102 | 0.529688 |
d1d75a411667690e14f6c98857abdac4851dab9b | 2,430 | py | Python | lib/pycoin/tests/parse_block_test.py | AYCHDO/Dominus | d7065816febafb6cf0fb1142ff7dc7e454c835ad | [
"MIT"
] | 68 | 2015-08-30T13:23:12.000Z | 2022-02-26T06:59:15.000Z | lib/pycoin/tests/parse_block_test.py | AYCHDO/Dominus | d7065816febafb6cf0fb1142ff7dc7e454c835ad | [
"MIT"
] | 44 | 2016-02-14T02:08:00.000Z | 2020-11-11T09:03:55.000Z | lib/pycoin/tests/parse_block_test.py | AYCHDO/Dominus | d7065816febafb6cf0fb1142ff7dc7e454c835ad | [
"MIT"
] | 56 | 2015-08-26T12:49:20.000Z | 2022-02-17T19:06:36.000Z | #!/usr/bin/env python
import io
import unittest
from pycoin.block import Block
from pycoin.serialize import b2h_rev, h2b
class BlockTest(unittest.TestCase):
def test_block(self):
expected_checksum = '0000000000089F7910F6755C10EA2795EC368A29B435D80770AD78493A6FECF1'.lower()
block_data = h2b('0100... | 46.730769 | 103 | 0.795473 |
42f06361a6a2115a42a1e83547ec4c64b12fa35b | 3,293 | py | Python | bitjam/__init__.py | jalvz/bitjam | 3abc7839b8552e1148f77a9c566c5b4b8e7fcd44 | [
"MIT"
] | null | null | null | bitjam/__init__.py | jalvz/bitjam | 3abc7839b8552e1148f77a9c566c5b4b8e7fcd44 | [
"MIT"
] | null | null | null | bitjam/__init__.py | jalvz/bitjam | 3abc7839b8552e1148f77a9c566c5b4b8e7fcd44 | [
"MIT"
] | null | null | null | import threading
class CongestionMonitor(object):
def __init__(self, capacity, duration=60):
"""
Monitor to detect traffic congestion
:param capacity: saturation point; ie. how many `allows(obj)` operations
are allowed per time interval
:param duration: time interval; ie. ... | 35.031915 | 80 | 0.568175 |
6634590cee5bdcf7fd53f6393946c601c7e242ce | 2,039 | py | Python | venv/Lib/site-packages/sklearn/decomposition/__init__.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | 2 | 2021-05-02T07:59:56.000Z | 2021-12-14T19:53:13.000Z | venv/Lib/site-packages/sklearn/decomposition/__init__.py | Jos33y/student-performance-knn | 4e965434f52dd6a1380904aa257df1edfaebb3c4 | [
"MIT"
] | 7 | 2021-06-08T21:46:24.000Z | 2022-03-12T00:35:31.000Z | my_env/Lib/site-packages/sklearn/decomposition/__init__.py | obulrdy6881/Drowsinss | 61cb9281d7dd22aee282b517e2fbf500f0ff9935 | [
"MIT"
] | 1 | 2021-05-02T07:59:59.000Z | 2021-05-02T07:59:59.000Z | """
The :mod:`sklearn.decomposition` module includes matrix decomposition
algorithms, including among others PCA, NMF or ICA. Most of the algorithms of
this module can be regarded as dimensionality reduction techniques.
"""
# TODO: remove me in 0.24 (as well as the noqa markers) and
# import the dict_learning f... | 37.759259 | 79 | 0.673369 |
27e9935118cf633c5ae460e16296f55adb0b1439 | 285 | py | Python | GUI/21 - keyboard events.py | PedroHAlvesS/Exercicios-Python-Curso-em-video | 7ab187d65ddada252450b048608dc4898e5c67c8 | [
"MIT"
] | null | null | null | GUI/21 - keyboard events.py | PedroHAlvesS/Exercicios-Python-Curso-em-video | 7ab187d65ddada252450b048608dc4898e5c67c8 | [
"MIT"
] | null | null | null | GUI/21 - keyboard events.py | PedroHAlvesS/Exercicios-Python-Curso-em-video | 7ab187d65ddada252450b048608dc4898e5c67c8 | [
"MIT"
] | null | null | null | from tkinter import *
def aleatorio(event):
evento_label.config(text=event.keysym)
janela = Tk()
evento_label = Label(janela, text="aperte qualquer coisa",
font=("Helvetica", 100))
evento_label.pack()
janela.bind("<Key>", aleatorio)
janela.mainloop()
| 15 | 58 | 0.663158 |
db080d1741d35d2f18122f4a5df25bf505f93ce1 | 19,479 | py | Python | panels/options.py | bennettdc/MCEdit-Unified | 90abfb170c65b877ac67193e717fa3a3ded635dd | [
"0BSD"
] | 237 | 2018-02-04T19:13:31.000Z | 2022-03-26T03:06:07.000Z | panels/options.py | bennettdc/MCEdit-Unified | 90abfb170c65b877ac67193e717fa3a3ded635dd | [
"0BSD"
] | 551 | 2015-01-01T02:36:53.000Z | 2018-02-01T00:03:12.000Z | panels/options.py | bennettdc/MCEdit-Unified | 90abfb170c65b877ac67193e717fa3a3ded635dd | [
"0BSD"
] | 97 | 2015-01-02T01:31:12.000Z | 2018-01-22T05:37:47.000Z | from __future__ import unicode_literals
import albow
from albow.dialogs import Dialog
from config import config
import pygame
from albow.translate import _, buildTemplate
import sys
import os
import logging
import traceback
import directories
old_lang = None
old_fprop = None
class OptionsPanel(Dialog):
anchor = '... | 47.742647 | 163 | 0.565378 |
ba71228db39bb8282dd7b52a781c7a844d53e9b1 | 61,527 | py | Python | salt/modules/win_iis.py | ipmb/salt | 699912ef9cde28040378aa53d6c7a12d8af756b1 | [
"Apache-2.0"
] | null | null | null | salt/modules/win_iis.py | ipmb/salt | 699912ef9cde28040378aa53d6c7a12d8af756b1 | [
"Apache-2.0"
] | null | null | null | salt/modules/win_iis.py | ipmb/salt | 699912ef9cde28040378aa53d6c7a12d8af756b1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Microsoft IIS site management via WebAdministration powershell module
:maintainer: Shane Lee <slee@saltstack.com>, Robert Booth <rbooth@saltstack.com>
:platform: Windows
:depends: PowerShell
:depends: WebAdministration module (PowerShell) (IIS)
.. versionadded:: 2016.3.... | 31.200304 | 205 | 0.610512 |
47d7a553f57d4a538ba839c30285fbc10c0ce27c | 6,588 | py | Python | x10mqtt/data/x10mqtt.py | mmotley999/addons | a12b79a0204495c15a55833a89a21ef362d95fa3 | [
"Unlicense"
] | 1 | 2021-05-12T01:00:18.000Z | 2021-05-12T01:00:18.000Z | x10mqtt/data/x10mqtt.py | mmotley999/addons | a12b79a0204495c15a55833a89a21ef362d95fa3 | [
"Unlicense"
] | 1 | 2022-02-21T05:09:44.000Z | 2022-03-16T05:31:13.000Z | x10mqtt/data/x10mqtt.py | mmotley999/addons | a12b79a0204495c15a55833a89a21ef362d95fa3 | [
"Unlicense"
] | 1 | 2021-02-28T18:29:39.000Z | 2021-02-28T18:29:39.000Z | # -------------------------------------------------------------------------------
#
# X10mqtt Home Assistant Addon
#
# This script allows for bridging between MQTT and X10.
#
# It utilizes the 'heyu' command (https://www.heyu.org) for X10 control
# and monitoring.
#
# This was written and tested using a CM11a ... | 26.457831 | 118 | 0.67881 |
5308107fed4b6c700ddd72b7307b7462d656039d | 6,030 | py | Python | IRIS_data_download/IRIS_download_support/obspy/io/wav/core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-03-05T01:03:01.000Z | 2020-12-17T05:04:07.000Z | IRIS_data_download/IRIS_download_support/obspy/io/wav/core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 4 | 2021-03-31T19:25:55.000Z | 2021-12-13T20:32:46.000Z | IRIS_data_download/IRIS_download_support/obspy/io/wav/core.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-09-08T19:33:40.000Z | 2021-04-05T09:47:50.000Z | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Filename: core.py
# Purpose: Python Class for transforming seismograms to audio WAV files
# Author: Moritz Beyreuther
# Email: moritz.beyreuther@geophysik.uni-muenchen.de
#
# Copyright (C) 2009-2012 Moritz Beyreuther
... | 33.687151 | 79 | 0.605307 |
3badf1a62191f84d908e681928a6410286bbc214 | 13,529 | py | Python | mitmproxy/tools/console/grideditor/base.py | 0x7c48/mitmproxy | f9d8f3bae3f4e681d5f4d406b7e06b099e60ecba | [
"MIT"
] | 74 | 2016-03-20T17:39:26.000Z | 2020-05-12T13:53:23.000Z | mitmproxy/tools/console/grideditor/base.py | 0x7c48/mitmproxy | f9d8f3bae3f4e681d5f4d406b7e06b099e60ecba | [
"MIT"
] | 2 | 2021-05-11T22:12:31.000Z | 2022-02-10T23:49:01.000Z | mitmproxy/tools/console/grideditor/base.py | 0x7c48/mitmproxy | f9d8f3bae3f4e681d5f4d406b7e06b099e60ecba | [
"MIT"
] | 5 | 2016-12-14T14:56:57.000Z | 2020-03-08T20:58:31.000Z | import abc
import copy
import os
import typing
import urwid
from mitmproxy.utils import strutils
from mitmproxy import exceptions
from mitmproxy.tools.console import signals
from mitmproxy.tools.console import layoutwidget
import mitmproxy.tools.console.master # noqa
def read_file(filename: str, escaped: bool) -> ty... | 28.422269 | 99 | 0.541873 |
148c3ff3dc4f27f4e66cc0026a89a1ad41d67887 | 11,156 | py | Python | code/python/FactSetNER/v1/fds/sdk/FactSetNER/model/request.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/FactSetNER/v1/fds/sdk/FactSetNER/model/request.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/FactSetNER/v1/fds/sdk/FactSetNER/model/request.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
NER API
Extract named entities and their FactSet entity IDs from given document text. # noqa: E501
The version of the OpenAPI document: 1.5.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.FactSetNER.model_utils import ( # noqa: ... | 42.580153 | 121 | 0.568932 |
1d818cdbaca29dbb439ba6f5e05ebb782668ae68 | 118 | py | Python | example/__init__.py | theo-l/py_settings | 8780161d4f633b480bc5e834f72f11e8e1460268 | [
"Apache-2.0"
] | null | null | null | example/__init__.py | theo-l/py_settings | 8780161d4f633b480bc5e834f72f11e8e1460268 | [
"Apache-2.0"
] | null | null | null | example/__init__.py | theo-l/py_settings | 8780161d4f633b480bc5e834f72f11e8e1460268 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Creation: 22/06/2020 22:08
@Author: liang
@File: __init__.py
""" | 16.857143 | 28 | 0.610169 |
6f2195d168660866fcd344ff054f461cfe16a2f2 | 4,568 | py | Python | object_detection/serve_model.py | moxel/tf-models | 0a8758e091ed3773d0ba6650bcf895aa0596fa81 | [
"Apache-2.0"
] | null | null | null | object_detection/serve_model.py | moxel/tf-models | 0a8758e091ed3773d0ba6650bcf895aa0596fa81 | [
"Apache-2.0"
] | null | null | null | object_detection/serve_model.py | moxel/tf-models | 0a8758e091ed3773d0ba6650bcf895aa0596fa81 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
sys.path.append('..')
from collections import defaultdict
from io import StringIO, BytesIO
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from PIL import Image... | 34.345865 | 122 | 0.676226 |
d18486a4801d70a1fa822e69a774f4c70cd790a3 | 272 | py | Python | util/__init__.py | garion9013/shrinkbench | c460cbc371ef2673b2a3f8498ca7a8aeb60d78bb | [
"MIT"
] | null | null | null | util/__init__.py | garion9013/shrinkbench | c460cbc371ef2673b2a3f8498ca7a8aeb60d78bb | [
"MIT"
] | null | null | null | util/__init__.py | garion9013/shrinkbench | c460cbc371ef2673b2a3f8498ca7a8aeb60d78bb | [
"MIT"
] | null | null | null | from .automap import AutoMap
from .color import printc, highlight, colors
from .csvlogger import CSVLogger
from .online import OnlineStats, OnlineStatsMap
import json
def is_jsonable(x):
try:
json.dumps(x)
return True
except:
return False
| 20.923077 | 47 | 0.713235 |
f705a8ee33fb9360f9cccd2c289e63ed88006920 | 6,249 | py | Python | applications/welcome/models/menu.py | Gorang-Maniar/DGD | c7b2624c0d0bb0127214ec3804acbe2cc70f8ce0 | [
"BSD-3-Clause"
] | 8 | 2018-04-13T14:54:02.000Z | 2021-03-04T10:58:09.000Z | webui/applications/grid/models/menu.py | pouyana/teireader | ac0a92d8b2e570eae1c0a03fd35a7b281eccd250 | [
"MIT"
] | 39 | 2018-03-23T09:25:38.000Z | 2022-03-23T15:22:15.000Z | webui/applications/grid/models/menu.py | pouyana/teireader | ac0a92d8b2e570eae1c0a03fd35a7b281eccd250 | [
"MIT"
] | 3 | 2019-04-09T03:49:21.000Z | 2020-03-05T03:51:25.000Z | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## Customize your APP title, subtitle and menus here
#########################################################################
response.logo... | 44.319149 | 79 | 0.478957 |
57a0d5307d414a79430cf94b3c5be2d1bef4c583 | 450 | py | Python | examples/python/cpu/tensors/ocean_fmod_01.py | kant/ocean-tensor-package | fb3fcff8bba7f4ef6cd8b8d02f0e1be1258da02d | [
"Apache-2.0"
] | 27 | 2018-08-16T21:32:49.000Z | 2021-11-30T10:31:08.000Z | examples/python/cpu/tensors/ocean_fmod_01.py | kant/ocean-tensor-package | fb3fcff8bba7f4ef6cd8b8d02f0e1be1258da02d | [
"Apache-2.0"
] | null | null | null | examples/python/cpu/tensors/ocean_fmod_01.py | kant/ocean-tensor-package | fb3fcff8bba7f4ef6cd8b8d02f0e1be1258da02d | [
"Apache-2.0"
] | 13 | 2018-08-17T17:33:16.000Z | 2021-11-30T10:31:09.000Z | import pyOcean_cpu as ocean
a = [-20,20,-20,20]
b = [3,3,-3,-3]
c = [1,2,-2,-1]
print(ocean.mod(ocean.int64(a),ocean.int64(b)))
print(ocean.mod(ocean.float(a),ocean.float(b)))
print(ocean.mod(ocean.double(a),ocean.double(b)))
print(ocean.int64(c))
print("")
c = [-2,2,-2,2]
print(ocean.fmod(ocean.int64(a), ocean.int64... | 23.684211 | 50 | 0.671111 |
b095a08f365591c8db07615a90cf461d3879dce2 | 7,829 | py | Python | tools/convert_vgm_to_pvm.py | c64scene-ar/64k-ought-to-be-enough | d97997ecd5ddb598bd58fa61da76e4b0c10c5bc1 | [
"MIT"
] | 4 | 2018-09-27T06:44:33.000Z | 2019-03-16T13:37:01.000Z | tools/convert_vgm_to_pvm.py | c64scene-ar/64k-ought-to-be-enough | d97997ecd5ddb598bd58fa61da76e4b0c10c5bc1 | [
"MIT"
] | null | null | null | tools/convert_vgm_to_pvm.py | c64scene-ar/64k-ought-to-be-enough | d97997ecd5ddb598bd58fa61da76e4b0c10c5bc1 | [
"MIT"
] | 2 | 2018-10-16T01:49:09.000Z | 2020-08-11T12:35:55.000Z | #!/usr/bin/env python3
# -----------------------------------------------------------------------------
# converts VGM files to a more compact file format (optimized format for Tandy)
# -----------------------------------------------------------------------------
"""
Tool to convert VGM (Video Game Music) to PVM (Player... | 34.03913 | 85 | 0.544897 |
c75bfcbc0e16be2452d3047d1c4377b1784e0540 | 4,725 | py | Python | core/python/setup.py | Zeleznyj/spirit | 5e23bf3be5aa4bacf5aae24514b0b22cbd395619 | [
"MIT"
] | null | null | null | core/python/setup.py | Zeleznyj/spirit | 5e23bf3be5aa4bacf5aae24514b0b22cbd395619 | [
"MIT"
] | null | null | null | core/python/setup.py | Zeleznyj/spirit | 5e23bf3be5aa4bacf5aae24514b0b22cbd395619 | [
"MIT"
] | null | null | null | import codecs
import os
import platform
import re
import shutil
import stat
import subprocess
import sys
import datetime
from distutils.util import get_platform
from setuptools import setup, Command
from wheel.bdist_wheel import bdist_wheel as bdist_wheel_
NAME = "spirit"
PACKAGES = ['spirit', 'spirit.parameters']
M... | 33.992806 | 152 | 0.622011 |
bdfe8d6a5a1ce8d9ef1c9f18994293f52515480e | 5,862 | py | Python | venv/lib/python3.7/site-packages/rqdatac/services/orm/balance_sheet_sql.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/rqdatac/services/orm/balance_sheet_sql.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | 1 | 2020-04-21T02:42:32.000Z | 2020-04-21T02:42:32.000Z | venv/lib/python3.7/site-packages/rqdatac/services/orm/balance_sheet_sql.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | null | null | null | # coding: utf-8
from sqlalchemy import Numeric, Column
from .fundamental_base_sql import FundamentalBase
class StkBalaGen(FundamentalBase):
cash = Column(Numeric(18, 2))
financial_asset_held_for_trading = Column(Numeric(18, 2))
cash_equivalent = Column(Numeric(18, 2))
current_investment = Column(Numer... | 47.658537 | 63 | 0.723303 |
c874b7005c5e7428d6b8beb0cf111141c0c4f533 | 231 | py | Python | sql-alchemy/sql_alchemy/models.py | ChristopherNothmann-lab/SqlAlchemy | ac9d0e86335a41a88981742cac1f0fbf089be032 | [
"MIT"
] | null | null | null | sql-alchemy/sql_alchemy/models.py | ChristopherNothmann-lab/SqlAlchemy | ac9d0e86335a41a88981742cac1f0fbf089be032 | [
"MIT"
] | null | null | null | sql-alchemy/sql_alchemy/models.py | ChristopherNothmann-lab/SqlAlchemy | ac9d0e86335a41a88981742cac1f0fbf089be032 | [
"MIT"
] | null | null | null | from sql_alchemy.database import Database
db = Database().get_db()
class Student(db.Model):
__table_name__ = 'student'
id = db.Column('id', db.Integer, primary_key=True)
full_name = db.Column('full_name', db.Unicode)
| 25.666667 | 54 | 0.709957 |
41c807b482df716f38993d239fca06e8ff3a70fb | 1,850 | py | Python | Microsoft.ML.TensorFlow.TestModels/model_types_test/type_test.py | terrajobst/machinelearning-testdata | 296625f4e49d50fcd6a48a0d92bea7584e198c0f | [
"MIT"
] | 6 | 2019-03-02T18:54:43.000Z | 2021-12-28T13:23:25.000Z | Microsoft.ML.TensorFlow.TestModels/model_types_test/type_test.py | terrajobst/machinelearning-testdata | 296625f4e49d50fcd6a48a0d92bea7584e198c0f | [
"MIT"
] | 7 | 2018-08-28T22:28:19.000Z | 2022-03-14T19:53:27.000Z | Microsoft.ML.TensorFlow.TestModels/model_types_test/type_test.py | terrajobst/machinelearning-testdata | 296625f4e49d50fcd6a48a0d92bea7584e198c0f | [
"MIT"
] | 12 | 2018-08-28T21:25:42.000Z | 2022-02-27T17:06:46.000Z | import tensorflow as tf
f64 = tf.placeholder(dtype=tf.float64, shape=[None,2], name="f64")
f32 = tf.placeholder(dtype=tf.float32, shape=[None,2], name="f32")
i64 = tf.placeholder(dtype=tf.int64, shape=[None,2], name="i64")
i32 = tf.placeholder(dtype=tf.int32, shape=[None,2], name="i32")
i16 = tf.placeholder(dtype=tf.... | 39.361702 | 88 | 0.658378 |
d8a4e0eaa50ce42d4a14b9ba2c949b54e41f1cbb | 4,441 | py | Python | Deep_Q_Learning/gridworld.py | leonardoaraujosantos/Learn_RL | da87bfd1346f9b7795df1197458b802cbc03c52d | [
"MIT"
] | 1 | 2018-05-25T21:51:57.000Z | 2018-05-25T21:51:57.000Z | Deep_Q_Learning/gridworld.py | leonardoaraujosantos/Learn_RL | da87bfd1346f9b7795df1197458b802cbc03c52d | [
"MIT"
] | null | null | null | Deep_Q_Learning/gridworld.py | leonardoaraujosantos/Learn_RL | da87bfd1346f9b7795df1197458b802cbc03c52d | [
"MIT"
] | null | null | null | import numpy as np
import random
import itertools
import scipy.misc
import matplotlib.pyplot as plt
class gameOb():
def __init__(self, coordinates, size, intensity, channel, reward, name):
self.x = coordinates[0]
self.y = coordinates[1]
self.size = size
self.intensity = intensity
... | 34.695313 | 114 | 0.525332 |
67374ee28806cf7ee7a8ab8b0ec7a3d1e36c3f38 | 73 | py | Python | 26.py | fptitsyn/ben | 460e6a32897076913a43160261af2dd3cca851c8 | [
"MIT"
] | null | null | null | 26.py | fptitsyn/ben | 460e6a32897076913a43160261af2dd3cca851c8 | [
"MIT"
] | null | null | null | 26.py | fptitsyn/ben | 460e6a32897076913a43160261af2dd3cca851c8 | [
"MIT"
] | null | null | null | f = 5
g = 21 - f
t = g // 3
f = (2 * f) % t
g = g + f + t
print(g)
| 10.428571 | 16 | 0.315068 |
977fc0bdab21302c0d9717d120d924e3fce57920 | 2,556 | py | Python | cistrome_processing/motif_pipeline/bin/add_motifs_to_h5.py | Wang-Cankun/lisa2 | 2407cc3c12f43bf41f0e14b2a8a5fcdfe07ff310 | [
"MIT"
] | 17 | 2020-09-21T20:04:43.000Z | 2022-01-15T11:25:41.000Z | cistrome_processing/motif_pipeline/bin/add_motifs_to_h5.py | Wang-Cankun/lisa2 | 2407cc3c12f43bf41f0e14b2a8a5fcdfe07ff310 | [
"MIT"
] | 1 | 2021-10-04T22:39:05.000Z | 2021-10-04T22:39:05.000Z | cistrome_processing/motif_pipeline/bin/add_motifs_to_h5.py | Wang-Cankun/lisa2 | 2407cc3c12f43bf41f0e14b2a8a5fcdfe07ff310 | [
"MIT"
] | 5 | 2021-02-16T13:16:34.000Z | 2022-03-08T16:15:25.000Z |
from lisa.core.data_interface import DataInterface
import argparse
import os
import numpy as np
import pandas as pd
from scipy import sparse
TECHNOLOGY = 'Motifs'
def main(species, window_size, motif_metadata, bin_sorted_hits, group_loci = 100000):
motif_metadata = pd.read_csv(motif_metadata, sep = '\t', header... | 36 | 180 | 0.650626 |
d88413f70c9b7ee39e0a2e33ad9f44fb4ba3acee | 525 | py | Python | account/forms.py | alexalvarex/CentroPlanificacion | b1ec85a5bbdfcf91a2cc9afbb0f5b213d4e09169 | [
"Apache-2.0"
] | null | null | null | account/forms.py | alexalvarex/CentroPlanificacion | b1ec85a5bbdfcf91a2cc9afbb0f5b213d4e09169 | [
"Apache-2.0"
] | null | null | null | account/forms.py | alexalvarex/CentroPlanificacion | b1ec85a5bbdfcf91a2cc9afbb0f5b213d4e09169 | [
"Apache-2.0"
] | null | null | null | #coding: utf8
from django.contrib.auth.forms import AuthenticationForm
class MyAuthenticationForm(AuthenticationForm):
def __init__(self, *args, **kwargs):
super(MyAuthenticationForm, self).__init__(*args, **kwargs)
self.base_fields['username'].widget.attrs['class'] = 'form-control mr-sm-2'
self.base_fields['p... | 37.5 | 78 | 0.744762 |
6253ba916d662ef96b7960af245f7602536cc918 | 2,158 | py | Python | tests/buckets/test_bucket_authorization.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 3 | 2019-05-04T02:07:28.000Z | 2020-10-16T17:47:44.000Z | tests/buckets/test_bucket_authorization.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 604 | 2019-02-21T18:14:51.000Z | 2022-02-10T08:13:54.000Z | tests/buckets/test_bucket_authorization.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | null | null | null | import pytest
from graphql_relay import to_global_id
from creator.buckets.factories import BucketFactory
@pytest.mark.parametrize("resource", ["bucket"])
@pytest.mark.parametrize(
"user_group,allowed",
[
("Administrators", True),
("Services", False),
("Developers", False),
("In... | 29.561644 | 79 | 0.610287 |
e6157612d3ddcf5e709c92316be5666e13bad4af | 342 | py | Python | urbarium/title/migrations/0007_auto_20200910_1752.py | nikerzetic/zacasno-ime | 7ca42665a0f64cae7233c994c879f2d81502efec | [
"MIT"
] | null | null | null | urbarium/title/migrations/0007_auto_20200910_1752.py | nikerzetic/zacasno-ime | 7ca42665a0f64cae7233c994c879f2d81502efec | [
"MIT"
] | 5 | 2021-03-30T14:18:31.000Z | 2021-09-22T19:35:18.000Z | urbarium/title/migrations/0007_auto_20200910_1752.py | nikerzetic/zacasno-ime | 7ca42665a0f64cae7233c994c879f2d81502efec | [
"MIT"
] | 1 | 2020-09-08T10:38:54.000Z | 2020-09-08T10:38:54.000Z | # Generated by Django 3.0.7 on 2020-09-10 15:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('title', '0006_auto_20200713_1412'),
]
operations = [
migrations.AlterModelOptions(
name='title',
options={'ordering': ['name... | 19 | 47 | 0.584795 |
dc50d34c7bbe0c67f0fd60cc52ca656cc9aef838 | 2,084 | py | Python | proj/config.py | SD2E/uploads-agent | a26885f82c30f14b742396646e1d38eba345b259 | [
"BSD-3-Clause"
] | null | null | null | proj/config.py | SD2E/uploads-agent | a26885f82c30f14b742396646e1d38eba345b259 | [
"BSD-3-Clause"
] | null | null | null | proj/config.py | SD2E/uploads-agent | a26885f82c30f14b742396646e1d38eba345b259 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Configuration loader from YML files with
# optional ENV-based overrides
# Usage: from config import settings
import os
import yaml
settings = {}
HERE = os.path.dirname(os.path.abspath(__file__))
PWD = os.getcwd()
ROOT = '/'
'''
Implements some configuration conventions:
1. A Reactor can be ... | 30.202899 | 73 | 0.607006 |
bb24d9d052b41dc5e6d3d0e94a9dcf94c8a367dd | 5,624 | py | Python | pglet/linechart.py | MrHemlock/pglet-python | 0d8dd2bb07effdd1a09836641ffa9c7e4271b907 | [
"MIT"
] | null | null | null | pglet/linechart.py | MrHemlock/pglet-python | 0d8dd2bb07effdd1a09836641ffa9c7e4271b907 | [
"MIT"
] | 4 | 2022-01-14T19:30:49.000Z | 2022-01-19T15:59:03.000Z | pglet/linechart.py | MrHemlock/pglet-python | 0d8dd2bb07effdd1a09836641ffa9c7e4271b907 | [
"MIT"
] | null | null | null | from typing import Literal, Optional, Union
from beartype import beartype
from pglet.control import Control
X_TYPE = Literal[None, "number", "date"]
class LineChart(Control):
def __init__(
self,
id=None,
legend=None,
tooltips=None,
stroke_width=None,
y_min=None,
... | 20.752768 | 70 | 0.573969 |
2abdf17f5ba0153d902622d4b340aca21b266023 | 9,467 | py | Python | test_tools/onnx_pytorch/common/parser.py | cirvine-MSFT/reinforcement_learning | c006b21d0a027b78d9285bf2597b503669bac82c | [
"MIT"
] | 63 | 2018-10-22T17:11:02.000Z | 2021-12-08T17:26:41.000Z | test_tools/onnx_pytorch/common/parser.py | cirvine-MSFT/reinforcement_learning | c006b21d0a027b78d9285bf2597b503669bac82c | [
"MIT"
] | 160 | 2018-10-09T02:34:57.000Z | 2022-03-31T15:43:48.000Z | test_tools/onnx_pytorch/common/parser.py | cirvine-MSFT/reinforcement_learning | c006b21d0a027b78d9285bf2597b503669bac82c | [
"MIT"
] | 36 | 2018-10-08T21:44:05.000Z | 2022-03-22T16:20:03.000Z | import struct
from reinforcement_learning.messages.flatbuff.v2.EventBatch import EventBatch
from reinforcement_learning.messages.flatbuff.v2.Event import Event
from reinforcement_learning.messages.flatbuff.v2.EventEncoding import EventEncoding
from reinforcement_learning.messages.flatbuff.v2.LearningModeType import Lea... | 39.777311 | 119 | 0.64371 |
ded52f147325f3bb21f1ca4b8c36c6dbbd446ea8 | 3,418 | py | Python | great_expectations/types/__init__.py | denimalpaca/great_expectations | 0f28f3c2b3cc6fae3bc5d257c6d4d13dbcf37df0 | [
"Apache-2.0"
] | null | null | null | great_expectations/types/__init__.py | denimalpaca/great_expectations | 0f28f3c2b3cc6fae3bc5d257c6d4d13dbcf37df0 | [
"Apache-2.0"
] | null | null | null | great_expectations/types/__init__.py | denimalpaca/great_expectations | 0f28f3c2b3cc6fae3bc5d257c6d4d13dbcf37df0 | [
"Apache-2.0"
] | null | null | null | import copy
from enum import Enum
from .configurations import ClassConfig
class DictDot:
"""A convenience class for migrating away from untyped dictionaries to stronger typed objects.
Can be instantiated with arguments:
my_A = MyClassA(
foo="a string",
bar=1,
... | 28.247934 | 116 | 0.587771 |
6077da341a91bf58961a82639c5582444b79e7ab | 9,495 | py | Python | heap/commands.py | dsanders11/gdb-heapanalyzer | f512f63387d589504e646dfcce56e5d220ce73d0 | [
"MIT"
] | 1 | 2016-12-10T14:46:19.000Z | 2016-12-10T14:46:19.000Z | heap/commands.py | dsanders11/gdb-heapanalyzer | f512f63387d589504e646dfcce56e5d220ce73d0 | [
"MIT"
] | null | null | null | heap/commands.py | dsanders11/gdb-heapanalyzer | f512f63387d589504e646dfcce56e5d220ce73d0 | [
"MIT"
] | null | null | null | """Common GDB commands for heap analysis. Once a heap implementation is identified
further commands are registered.
"""
import _gdb as gdb
import functools
from _heap import UnsupportedHeap
# Always import any non-standard GDB helpers from _gdb
from _gdb import is_debuginfo_loaded, is_inferior_running, is_inferior_... | 35.561798 | 99 | 0.658031 |
ea8589626c03fecd4df2b76dc2d824c5e67fdbdd | 1,673 | py | Python | logsandra/controllers/error.py | thobbs/logsandra | a17abc995dcb0573f3db2f714c1b47d3aff8b20a | [
"MIT"
] | 7 | 2015-05-18T13:00:54.000Z | 2018-08-06T08:27:57.000Z | logsandra/controllers/error.py | thobbs/logsandra | a17abc995dcb0573f3db2f714c1b47d3aff8b20a | [
"MIT"
] | null | null | null | logsandra/controllers/error.py | thobbs/logsandra | a17abc995dcb0573f3db2f714c1b47d3aff8b20a | [
"MIT"
] | 4 | 2015-06-16T11:09:53.000Z | 2020-04-27T19:25:57.000Z | import cgi
from paste.urlparser import PkgResourcesParser
from pylons.middleware import error_document_template
from webhelpers.html.builder import literal
from logsandra.lib.base import BaseController
class ErrorController(BaseController):
"""Generates error documents as and when they are required.
The Err... | 37.177778 | 91 | 0.674238 |
e10e27f7612e63183206990e6da0c8d17021f668 | 22,181 | py | Python | sklearn/gaussian_process/_gpr.py | lacrosse91/scikit-learn | 2325b19a86bd5b6e4b0bfb4eff4ee46a3343cf65 | [
"BSD-3-Clause"
] | 27 | 2015-01-22T22:30:09.000Z | 2022-02-15T07:33:06.000Z | sklearn/gaussian_process/_gpr.py | lacrosse91/scikit-learn | 2325b19a86bd5b6e4b0bfb4eff4ee46a3343cf65 | [
"BSD-3-Clause"
] | 5 | 2015-02-24T14:57:35.000Z | 2018-07-04T19:00:24.000Z | sklearn/gaussian_process/_gpr.py | lacrosse91/scikit-learn | 2325b19a86bd5b6e4b0bfb4eff4ee46a3343cf65 | [
"BSD-3-Clause"
] | 25 | 2015-07-30T13:47:25.000Z | 2021-08-03T07:48:38.000Z | """Gaussian processes regression."""
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Modified by: Pete Green <p.l.green@liverpool.ac.uk>
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve
import scipy.optimize
from .... | 41.228625 | 88 | 0.612281 |
8dc438c9ee12b80ab3e54f0dae398b63d390490a | 15,559 | py | Python | tests/stores/test_mongolike.py | munrojm/maggma | baff06b1682d82f7275d6fba9495c50f5f28ebb1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/stores/test_mongolike.py | munrojm/maggma | baff06b1682d82f7275d6fba9495c50f5f28ebb1 | [
"BSD-3-Clause-LBNL"
] | 69 | 2020-09-10T22:09:46.000Z | 2021-05-24T05:40:52.000Z | tests/stores/test_mongolike.py | munrojm/maggma | baff06b1682d82f7275d6fba9495c50f5f28ebb1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | import os
import shutil
from datetime import datetime
from unittest import mock
import mongomock.collection
from monty.tempfile import ScratchDir
import pymongo.collection
import pytest
from pymongo.errors import ConfigurationError, DocumentTooLarge, OperationFailure
import maggma.stores
from maggma.core import Store... | 32.347193 | 95 | 0.616299 |
346372c31f3fa9f756c1c33d566eda7a0f6a083d | 1,038 | py | Python | MC simulation/mcdose/test/test_weights.py | qihuilyu/P2T | 6b8a24a632354d70c8ba44df717291573a5e0bd2 | [
"MIT"
] | null | null | null | MC simulation/mcdose/test/test_weights.py | qihuilyu/P2T | 6b8a24a632354d70c8ba44df717291573a5e0bd2 | [
"MIT"
] | null | null | null | MC simulation/mcdose/test/test_weights.py | qihuilyu/P2T | 6b8a24a632354d70c8ba44df717291573a5e0bd2 | [
"MIT"
] | null | null | null | import unittest
import os
from os.path import join as pjoin
from collections import namedtuple
import numpy as np
from setup_tests import test_data
from mcdose import weights
DataPair = namedtuple('DataPair', ('inputs', 'labels'))
class TestWeights(unittest.TestCase):
@classmethod
def setUpClass(cls):
... | 28.833333 | 101 | 0.654143 |
e387da4e30e76372a170e4a41496314b4ffd808e | 5,020 | py | Python | barbican/api/controllers/quotas.py | dmend/barbican | 5ff7b4ca1474225acabc36acedcf70a41946e6d0 | [
"Apache-2.0"
] | 177 | 2015-01-02T09:35:53.000Z | 2022-02-26T01:43:55.000Z | barbican/api/controllers/quotas.py | kkutysllb/barbican | 7b14d983e0dce6dcffe9781b05c52335b8203fc7 | [
"Apache-2.0"
] | 3 | 2015-06-23T19:07:31.000Z | 2017-08-19T04:38:11.000Z | barbican/api/controllers/quotas.py | kkutysllb/barbican | 7b14d983e0dce6dcffe9781b05c52335b8203fc7 | [
"Apache-2.0"
] | 87 | 2015-01-13T17:33:40.000Z | 2021-11-09T05:30:36.000Z | # Copyright (c) 2015 Cisco Systems
#
# 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 ... | 36.911765 | 76 | 0.686454 |
3ca3011b66b53e0f0b1cf41b924a0020eb37f8a8 | 2,626 | py | Python | tests/utils/bq_test.py | scottaubrey/data-science-dags | f45c4e1bb8e538da57161c20953edca2e66ffd4f | [
"MIT"
] | 1 | 2021-09-15T04:47:25.000Z | 2021-09-15T04:47:25.000Z | tests/utils/bq_test.py | scottaubrey/data-science-dags | f45c4e1bb8e538da57161c20953edca2e66ffd4f | [
"MIT"
] | 39 | 2021-06-21T05:52:43.000Z | 2022-03-29T18:39:06.000Z | tests/utils/bq_test.py | scottaubrey/data-science-dags | f45c4e1bb8e538da57161c20953edca2e66ffd4f | [
"MIT"
] | 1 | 2021-12-23T15:36:54.000Z | 2021-12-23T15:36:54.000Z | import gzip
import json
from pathlib import Path
import pandas as pd
import numpy as np
from data_science_pipeline.utils.bq import (
df_as_jsonl_file_without_null
)
class TestDfAsJsonlFileWithoutNull:
def test_should_remove_null_value(self, temp_dir: Path):
jsonl_file = temp_dir / 'data.jsonl'
... | 38.617647 | 81 | 0.586443 |
b60de7d7a66462a79602e147c76c1b90c78a0c69 | 24,891 | py | Python | jcvi/formats/vcf.py | fossabot/jcvi | 86948affd63e94c8327cf117c47d36940b508b68 | [
"BSD-2-Clause"
] | 1 | 2020-10-04T13:21:24.000Z | 2020-10-04T13:21:24.000Z | jcvi/formats/vcf.py | Wangjien/jcvi | 6732285f62dcbd7f3878e5017c3350124530c796 | [
"BSD-2-Clause"
] | null | null | null | jcvi/formats/vcf.py | Wangjien/jcvi | 6732285f62dcbd7f3878e5017c3350124530c796 | [
"BSD-2-Clause"
] | 1 | 2020-11-16T19:25:30.000Z | 2020-11-16T19:25:30.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Variant call format.
"""
from __future__ import print_function
import os.path as op
import sys
import logging
from collections import defaultdict
from itertools import groupby
from pyfaidx import Fasta
from pyliftover import LiftOver
from jcvi.formats.base import mu... | 32.36801 | 118 | 0.563175 |
d895fabe825603a86c6accc1659113141f6bb4d0 | 2,940 | py | Python | tests/mac/models/test_henke_winxray.py | drix00/pyxraymac | f9e2c4e073ff1f5d9fbfaa58b3b66c041433896a | [
"Apache-2.0"
] | null | null | null | tests/mac/models/test_henke_winxray.py | drix00/pyxraymac | f9e2c4e073ff1f5d9fbfaa58b3b66c041433896a | [
"Apache-2.0"
] | null | null | null | tests/mac/models/test_henke_winxray.py | drix00/pyxraymac | f9e2c4e073ff1f5d9fbfaa58b3b66c041433896a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: tests.mac.models.test_henke_winxray
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Tests for the :py:mod:`xray.mac.models.henke_winxray` module.
"""
##############################################################################... | 29.69697 | 88 | 0.660204 |
15971d62b823e11d2f9734ca3d3a8b732a0a65a9 | 4,825 | py | Python | src/python/components/left_panel.py | UBC-MDS/DSCI_532_Group_12 | 135b8544c19b7c90128d2241d7425f14beeb314a | [
"MIT"
] | 1 | 2021-02-21T09:46:24.000Z | 2021-02-21T09:46:24.000Z | src/python/components/left_panel.py | lephanthuymai/DSCI_532_Group_12 | de6fe6ebcb0ceccc2eb2c0aefb057fd485c4324e | [
"MIT"
] | 44 | 2021-01-13T03:03:06.000Z | 2021-02-13T20:19:24.000Z | src/python/components/left_panel.py | lephanthuymai/DSCI_532_Group_12 | de6fe6ebcb0ceccc2eb2c0aefb057fd485c4324e | [
"MIT"
] | 12 | 2021-01-14T03:24:23.000Z | 2021-09-28T12:37:24.000Z | import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
import dash_bootstrap_components as dbc
import locale
import altair as alt
from panel import panel
from decimal import *
locale.setlocale(locale.LC_ALL, "")
import os, sys, inspect
currentd... | 32.166667 | 87 | 0.521865 |
d3e9dbba139f17e1b43489435dfd6ee16ffe799d | 12,317 | py | Python | scripts/merge_tract_cat.py | LSSTDESC/SSim_DC2 | a6ff636ea6f779edc7ddf7b91449336e10e14b4a | [
"BSD-3-Clause"
] | 6 | 2018-08-02T18:29:14.000Z | 2020-08-05T04:00:01.000Z | scripts/merge_tract_cat.py | LSSTDESC/SSim_DC2 | a6ff636ea6f779edc7ddf7b91449336e10e14b4a | [
"BSD-3-Clause"
] | 232 | 2018-07-30T19:05:24.000Z | 2022-02-24T06:14:42.000Z | scripts/merge_tract_cat.py | LSSTDESC/SSim_DC2 | a6ff636ea6f779edc7ddf7b91449336e10e14b4a | [
"BSD-3-Clause"
] | 3 | 2018-10-04T11:52:52.000Z | 2019-05-25T04:28:31.000Z | import os
import re
import sys
import numpy as np
import pandas as pd
from lsst.daf.persistence import Butler
from lsst.daf.persistence.butlerExceptions import NoResults
def valid_identifier_name(name):
"""Return a valid Python identifier name from input string.
For now just strips commas and spaces
Th... | 36.657738 | 117 | 0.610701 |
8c47e28d244db64aa55f7d7324f5a81a24f70942 | 189 | py | Python | app/v1/messages.py | speduardo/flask-boilerplate | d50d8d0f15a08c4905a2029b0ae9637489624c9a | [
"MIT"
] | 1 | 2020-05-26T01:53:58.000Z | 2020-05-26T01:53:58.000Z | app/v1/messages.py | speduardo/flask-boilerplate | d50d8d0f15a08c4905a2029b0ae9637489624c9a | [
"MIT"
] | null | null | null | app/v1/messages.py | speduardo/flask-boilerplate | d50d8d0f15a08c4905a2029b0ae9637489624c9a | [
"MIT"
] | null | null | null | MSG_TOKEN_CREATED = 'Token criado.'
MSG_INVALID_CREDENTIALS = 'As credenciais estão inválidas para log in.'
MSG_TOKEN_EXPIRED = 'Token expirou.'
MSG_PERMISSION_DENIED = 'Permissão negada.'
| 37.8 | 71 | 0.804233 |
d7a64608b886a6e985e00b6ab207c9d259e3633a | 44,287 | py | Python | tests/auth_tests/test_views.py | alvra/django | 4a7b58210defea33a428b748ccbc97ae8fd49838 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/auth_tests/test_views.py | alvra/django | 4a7b58210defea33a428b748ccbc97ae8fd49838 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/auth_tests/test_views.py | alvra/django | 4a7b58210defea33a428b748ccbc97ae8fd49838 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2016-09-02T01:22:19.000Z | 2016-09-02T01:22:19.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib.admin.models import LogEntry
from django.contrib.auth import REDIRECT_FIELD_NAME, S... | 43.333659 | 119 | 0.642649 |
d631f51bc460e99575bc7a98d8a4603fc927194d | 661 | py | Python | src/Lagrange/Lagrange.py | Roseck16/Interpolation | 20513e02241824e37c9eab6642fc2f3139dd8e00 | [
"MIT"
] | 1 | 2021-07-14T03:33:57.000Z | 2021-07-14T03:33:57.000Z | src/Lagrange/Lagrange.py | Roseck16/Interpolation | 20513e02241824e37c9eab6642fc2f3139dd8e00 | [
"MIT"
] | null | null | null | src/Lagrange/Lagrange.py | Roseck16/Interpolation | 20513e02241824e37c9eab6642fc2f3139dd8e00 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def lagrange(x, y, p):
n = len(x)
sum = 0
for k in range(n):
prod = product(x, p, k)
sum += y[k] * prod
return sum
def product(vec, p, i):
n = len(vec)
prod = 1
for index in range(n):
if index != i:
num ... | 22.033333 | 43 | 0.511346 |
3b2c5732c57b83242a12293f9d9eadfc9811e42e | 1,289 | py | Python | wikiup/utils.py | boweeb/wikiup | 2694a8a9bc3914507803abc0540850e25ec64fd2 | [
"ISC"
] | null | null | null | wikiup/utils.py | boweeb/wikiup | 2694a8a9bc3914507803abc0540850e25ec64fd2 | [
"ISC"
] | null | null | null | wikiup/utils.py | boweeb/wikiup | 2694a8a9bc3914507803abc0540850e25ec64fd2 | [
"ISC"
] | null | null | null | #!/usr/bin/env python3.6
# vim: set fileencoding=utf-8 tabstop=8 expandtab shiftwidth=4 softtabstop=4 smarttab autoindent:
# -*- coding: utf-8 -*-
"""wikiup.utils"""
import os
import getpass
from bs4.dammit import EntitySubstitution
def get_shell_username(username):
if not username:
return_ = os.enviro... | 23.436364 | 101 | 0.656323 |
a3224b5252f9be2811512b9383ee6d5b4422d8b8 | 2,942 | py | Python | checker/admin.py | uktrade/url-protection-checker | 6d5a3e1d450b6dfde8e5bb1d1af93846f440a3d5 | [
"MIT"
] | null | null | null | checker/admin.py | uktrade/url-protection-checker | 6d5a3e1d450b6dfde8e5bb1d1af93846f440a3d5 | [
"MIT"
] | 1 | 2022-02-15T10:06:14.000Z | 2022-02-15T10:06:14.000Z | checker/admin.py | uktrade/url-protection-checker | 6d5a3e1d450b6dfde8e5bb1d1af93846f440a3d5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Spaces, ApplicationsItem, NonPaasSites
from django.forms import ValidationError, ModelForm
class CheckForm(ModelForm):
class Meta:
model = ApplicationsItem
exclude = []
def clean(self):
data = super().clean()
if not data['... | 28.288462 | 87 | 0.653637 |
251ffcead117cc333fa504a74eae6024f6120cb1 | 9,342 | py | Python | nova/scheduler/filters/trusted_filter.py | windskyer/nova | df485344dfd0f9e927e51273a3aaa71d948f2980 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/filters/trusted_filter.py | windskyer/nova | df485344dfd0f9e927e51273a3aaa71d948f2980 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/filters/trusted_filter.py | windskyer/nova | df485344dfd0f9e927e51273a3aaa71d948f2980 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 Intel, Inc.
# Copyright (c) 2011-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | 36.924901 | 79 | 0.634447 |
7d10ef1fabbe1543a4fd557a1b1b6c90a876924d | 2,013 | py | Python | var/spack/repos/builtin/packages/arborx/package.py | asmaahassan90/spack | b6779d2e31170eb77761f59bed640afbc469e4ec | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-05-24T15:23:12.000Z | 2020-05-24T15:23:12.000Z | var/spack/repos/builtin/packages/arborx/package.py | asmaahassan90/spack | b6779d2e31170eb77761f59bed640afbc469e4ec | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 6 | 2022-02-26T11:44:34.000Z | 2022-03-12T12:14:50.000Z | var/spack/repos/builtin/packages/arborx/package.py | asmaahassan90/spack | b6779d2e31170eb77761f59bed640afbc469e4ec | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2021-01-06T18:58:26.000Z | 2021-01-06T18:58:26.000Z | # Copyright 2013-2020 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 Arborx(CMakePackage):
"""ArborX is a performance-portable library for geometric search"""
... | 39.470588 | 99 | 0.670144 |
6aa497822c82716b9b8ce1f7ba832e46d424073c | 8,176 | py | Python | activitysim/abm/models/accessibility.py | SEMCOG/SEMCOG_ActSim | cc18cce84b2e4b5f380f58c7919953d2cd03ee73 | [
"BSD-3-Clause"
] | null | null | null | activitysim/abm/models/accessibility.py | SEMCOG/SEMCOG_ActSim | cc18cce84b2e4b5f380f58c7919953d2cd03ee73 | [
"BSD-3-Clause"
] | 1 | 2021-06-30T23:39:37.000Z | 2021-06-30T23:39:37.000Z | activitysim/abm/models/accessibility.py | SEMCOG/SEMCOG_ActSim | cc18cce84b2e4b5f380f58c7919953d2cd03ee73 | [
"BSD-3-Clause"
] | null | null | null | # ActivitySim
# See full license in LICENSE.txt.
import logging
import pandas as pd
import numpy as np
from activitysim.core import assign
from activitysim.core import tracing
from activitysim.core import config
from activitysim.core import inject
from activitysim.core import pipeline
from activitysim.core import mem... | 38.748815 | 118 | 0.658268 |
2f47750b7fe5e85c1d2741bbe7e61cb19bb2195e | 1,602 | py | Python | setup.py | elehcimd/metacash | 3681df7d14d656ffb30d4b8720368845f99cce58 | [
"MIT"
] | 1 | 2021-03-31T13:59:42.000Z | 2021-03-31T13:59:42.000Z | setup.py | elehcimd/metacash | 3681df7d14d656ffb30d4b8720368845f99cce58 | [
"MIT"
] | 2 | 2021-03-31T14:28:11.000Z | 2021-03-31T15:31:32.000Z | setup.py | elehcimd/metacash | 3681df7d14d656ffb30d4b8720368845f99cce58 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from version import __version__
# Get the long description from the README file
with open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(
name='metacash',
version=__version__,
author='Michele Dallachiesa',
author_email='michele.... | 29.127273 | 77 | 0.613608 |
6d4f52c300778a43df6e86dd8de635f134b7a8ee | 1,597 | py | Python | plenum/test/view_change/test_view_change_start_without_primary.py | spivachuk/plenum | 05123166e8ffa89520541ea3b59b20390aaf92a4 | [
"Apache-2.0"
] | null | null | null | plenum/test/view_change/test_view_change_start_without_primary.py | spivachuk/plenum | 05123166e8ffa89520541ea3b59b20390aaf92a4 | [
"Apache-2.0"
] | null | null | null | plenum/test/view_change/test_view_change_start_without_primary.py | spivachuk/plenum | 05123166e8ffa89520541ea3b59b20390aaf92a4 | [
"Apache-2.0"
] | null | null | null | import pytest
from plenum.test.helper import stopNodes
from plenum.test.test_node import checkProtocolInstanceSetup, getRequiredInstances, \
checkNodesConnected
from plenum.test import waits
VIEW_CHANGE_TIMEOUT = 10
def test_view_change_without_primary(txnPoolNodeSet, looper,
... | 32.591837 | 98 | 0.733876 |
809941f37570d418a7b38de2b38c5d2800e58837 | 1,535 | py | Python | azure-mgmt-batchai/azure/mgmt/batchai/models/clusters_list_by_resource_group_options_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-batchai/azure/mgmt/batchai/models/clusters_list_by_resource_group_options_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-batchai/azure/mgmt/batchai/models/clusters_list_by_resource_group_options_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"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 ... | 38.375 | 103 | 0.614984 |
92d39e65546fd95f0e25143ca60d41bceefe2836 | 1,174 | py | Python | saleor/graphql/attribute/bulk_mutations.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 15,337 | 2015-01-12T02:11:52.000Z | 2021-10-05T19:19:29.000Z | saleor/graphql/attribute/bulk_mutations.py | fairhopeweb/saleor | 9ac6c22652d46ba65a5b894da5f1ba5bec48c019 | [
"CC-BY-4.0"
] | 7,486 | 2015-02-11T10:52:13.000Z | 2021-10-06T09:37:15.000Z | saleor/graphql/attribute/bulk_mutations.py | aminziadna/saleor | 2e78fb5bcf8b83a6278af02551a104cfa555a1fb | [
"CC-BY-4.0"
] | 5,864 | 2015-01-16T14:52:54.000Z | 2021-10-05T23:01:15.000Z | import graphene
from ...attribute import models
from ...core.permissions import PageTypePermissions
from ..core.mutations import ModelBulkDeleteMutation
from ..core.types.common import AttributeError
class AttributeBulkDelete(ModelBulkDeleteMutation):
class Arguments:
ids = graphene.List(
gra... | 31.72973 | 86 | 0.701022 |
9bb3d44fe5cf97bc78c4cef236104297ded650d1 | 3,450 | py | Python | src/collectors/flume/flume.py | devanshukoyalkar-rubrik/Diamond | c4c3f2e4723c2e4381b7bf5348cc3a25f321315d | [
"MIT"
] | null | null | null | src/collectors/flume/flume.py | devanshukoyalkar-rubrik/Diamond | c4c3f2e4723c2e4381b7bf5348cc3a25f321315d | [
"MIT"
] | null | null | null | src/collectors/flume/flume.py | devanshukoyalkar-rubrik/Diamond | c4c3f2e4723c2e4381b7bf5348cc3a25f321315d | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Collect statistics from Flume
#### Dependencies
* urllib2
* json or simplejson
"""
import urllib.request, urllib.error, urllib.parse
import diamond.collector
try:
import simplejson as json
except ImportError:
import json
class FlumeCollector(diamond.collector.Collector):
# item... | 30 | 75 | 0.543478 |
4ee92b3494a6ef5a001d49e45fb1d8a1365e69a0 | 3,044 | py | Python | Algorithm.Python/BasicTemplateFrameworkAlgorithm.py | BlackBoxAM/Lean | 5ea9f04b104d27f0fcfe3a383a3a60ca12206d99 | [
"Apache-2.0"
] | 6,580 | 2015-01-12T16:48:44.000Z | 2022-03-31T22:05:09.000Z | Algorithm.Python/BasicTemplateFrameworkAlgorithm.py | BlackBoxAM/Lean | 5ea9f04b104d27f0fcfe3a383a3a60ca12206d99 | [
"Apache-2.0"
] | 3,392 | 2015-01-12T17:44:07.000Z | 2022-03-30T20:34:03.000Z | Algorithm.Python/BasicTemplateFrameworkAlgorithm.py | BlackBoxAM/Lean | 5ea9f04b104d27f0fcfe3a383a3a60ca12206d99 | [
"Apache-2.0"
] | 3,354 | 2015-01-12T16:58:31.000Z | 2022-03-31T00:56:03.000Z | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 49.901639 | 152 | 0.725033 |
d1f1b7b35eb764d2bea2a2fdecccb30a7b84a852 | 7,203 | py | Python | cgt_calc/parsers/schwab.py | danielkza/capital-gains-calculator | 70a2a5bd107311e26c5b82b5218cb569a8ee52a6 | [
"MIT"
] | null | null | null | cgt_calc/parsers/schwab.py | danielkza/capital-gains-calculator | 70a2a5bd107311e26c5b82b5218cb569a8ee52a6 | [
"MIT"
] | null | null | null | cgt_calc/parsers/schwab.py | danielkza/capital-gains-calculator | 70a2a5bd107311e26c5b82b5218cb569a8ee52a6 | [
"MIT"
] | null | null | null | """Charles Schwab parser."""
from __future__ import annotations
from collections import defaultdict
import csv
from dataclasses import dataclass
import datetime
from decimal import Decimal
import itertools
from pathlib import Path
from cgt_calc.exceptions import (
ExchangeRateMissingError,
ParsingError,
S... | 32.013333 | 88 | 0.597945 |
6725d61a3855f7577f59bd2dc2056c63f50df8e0 | 3,124 | py | Python | code/gan/mygan.py | T-tssxuan/machine_learning_step | 113d0b1a2cacd2b03aa06c0c2bae7d65f05ac0ce | [
"MIT"
] | 7 | 2017-12-27T08:45:20.000Z | 2020-07-15T11:51:32.000Z | code/gan/mygan.py | T-tssxuan/machine_learning_step | 113d0b1a2cacd2b03aa06c0c2bae7d65f05ac0ce | [
"MIT"
] | null | null | null | code/gan/mygan.py | T-tssxuan/machine_learning_step | 113d0b1a2cacd2b03aa06c0c2bae7d65f05ac0ce | [
"MIT"
] | 3 | 2018-07-09T12:11:11.000Z | 2020-06-28T13:57:08.000Z | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
def xavier_init(size):
in_dim = size[0]
xavier_stddev = 1. / tf.sqrt(in_dim / 2)
return tf.random_normal(shape=size, stddev... | 32.884211 | 125 | 0.693662 |
044a268ee23605a26f987412aded5ecc5675c175 | 962 | py | Python | posts/models.py | mmanchev23/network | 248a23089640096fe866abc4557e82383768b5bc | [
"MIT"
] | null | null | null | posts/models.py | mmanchev23/network | 248a23089640096fe866abc4557e82383768b5bc | [
"MIT"
] | null | null | null | posts/models.py | mmanchev23/network | 248a23089640096fe866abc4557e82383768b5bc | [
"MIT"
] | null | null | null | from datetime import datetime
from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
pass
class Profile(models.Model):
target = models.ForeignKey('User', on_delete=models.CASCADE, related_name='folowers')
follower = models.ForeignKey('User', on_delete=... | 29.151515 | 95 | 0.72973 |
d87c076859b67b7a3efc53e2bacdc3b9c5f61080 | 3,965 | py | Python | ml-agents/mlagents/trainers/tests/torch/test_sac.py | LoopySantos27/ml-agents | 2b175c8ea65d75814654812e1357d15be8b40d3f | [
"Apache-2.0"
] | 13,653 | 2017-09-19T15:56:02.000Z | 2022-03-31T18:55:07.000Z | ml-agents/mlagents/trainers/tests/torch/test_sac.py | LoopySantos27/ml-agents | 2b175c8ea65d75814654812e1357d15be8b40d3f | [
"Apache-2.0"
] | 3,623 | 2017-09-20T02:50:20.000Z | 2022-03-31T06:37:25.000Z | ml-agents/mlagents/trainers/tests/torch/test_sac.py | LoopySantos27/ml-agents | 2b175c8ea65d75814654812e1357d15be8b40d3f | [
"Apache-2.0"
] | 4,130 | 2017-09-19T17:36:34.000Z | 2022-03-31T12:54:55.000Z | import pytest
from mlagents.torch_utils import torch
from mlagents.trainers.buffer import BufferKey, RewardSignalUtil
from mlagents.trainers.sac.optimizer_torch import TorchSACOptimizer
from mlagents.trainers.policy.torch_policy import TorchPolicy
from mlagents.trainers.tests import mock_brain as mb
from mlagents.trai... | 34.181034 | 88 | 0.729887 |
5d29496bcbbfa93ae251ca14537f02c619db56ad | 21,069 | py | Python | skipgrammar/datasets/common.py | eifuentes/seqems | 73b51e9eaa68b23b615d90d73e3f2184b9d783a0 | [
"MIT"
] | null | null | null | skipgrammar/datasets/common.py | eifuentes/seqems | 73b51e9eaa68b23b615d90d73e3f2184b9d783a0 | [
"MIT"
] | null | null | null | skipgrammar/datasets/common.py | eifuentes/seqems | 73b51e9eaa68b23b615d90d73e3f2184b9d783a0 | [
"MIT"
] | 1 | 2021-09-17T22:27:15.000Z | 2021-09-17T22:27:15.000Z | """
Common utilities for datasets.
References:
- [Keras utils](https://github.com/keras-team/keras/tree/34231971fa47cb2477b357c1a368978de4128294/keras/utils)
- [Lenskit datasets](https://github.com/lenskit/lkpy/blob/master/lenskit/datasets.py)
"""
import collections
import hashlib
import logging
import os
import shuti... | 36.138937 | 110 | 0.568323 |
3cd9d390b25ff5f54acd42dcde90eab9f963ea7a | 1,085 | py | Python | registry/migrations/0001_initial.py | jhonssegura/django-issuing-system | 5b8ceb177edbe5a966e41a618c14b425d653ba0c | [
"Apache-2.0"
] | null | null | null | registry/migrations/0001_initial.py | jhonssegura/django-issuing-system | 5b8ceb177edbe5a966e41a618c14b425d653ba0c | [
"Apache-2.0"
] | null | null | null | registry/migrations/0001_initial.py | jhonssegura/django-issuing-system | 5b8ceb177edbe5a966e41a618c14b425d653ba0c | [
"Apache-2.0"
] | null | null | null | # Generated by Django 4.0 on 2021-12-18 20:19
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Event',
fields=[
('id', models.BigAutoField(a... | 40.185185 | 121 | 0.62765 |
32c73d64227e70662fed045d2fbdc56d7cfea9af | 4,042 | py | Python | annolid/data/augmentation.py | jeremyforest/annolid | 88bb528ee5a39a84a08631b27b934191a8822048 | [
"MIT"
] | 9 | 2020-09-12T00:12:06.000Z | 2022-03-25T19:16:17.000Z | annolid/data/augmentation.py | jeremyforest/annolid | 88bb528ee5a39a84a08631b27b934191a8822048 | [
"MIT"
] | 34 | 2020-09-07T20:25:46.000Z | 2022-02-28T19:36:54.000Z | annolid/data/augmentation.py | jeremyforest/annolid | 88bb528ee5a39a84a08631b27b934191a8822048 | [
"MIT"
] | 3 | 2020-09-18T03:06:41.000Z | 2021-10-14T22:52:49.000Z | import imageio
import json
from pathlib import Path
import pandas as pd
import collections
import numpy as np
from imgaug import augmenters as iaa
import imgaug as ia
from imgaug.augmentables.polys import Polygon, PolygonsOnImage
class LabelStats:
def __init__(self, anno_dir):
self.anno_dir = anno_dir
... | 37.775701 | 97 | 0.540327 |
258fab533f732784b24fd33c973697688ca0c86a | 1,857 | py | Python | example.py | fgaim/artext | 88d8a27180aabe949eb18c287100de95d894fe53 | [
"MIT"
] | 3 | 2018-11-23T19:37:18.000Z | 2020-07-26T16:51:08.000Z | example.py | fgaim/artext | 88d8a27180aabe949eb18c287100de95d894fe53 | [
"MIT"
] | 1 | 2020-03-08T18:59:17.000Z | 2020-03-08T18:59:17.000Z | example.py | fgaim/artext | 88d8a27180aabe949eb18c287100de95d894fe53 | [
"MIT"
] | null | null | null | import sys
from artext import config, utils, Artext
if __name__ == "__main__":
parser = utils.arg_parser()
args = parser.parse_args('-src test -out test -n 5'.split() + sys.argv[1:])
conf = config.Config()
conf.error_rate = args.error_rate
conf.path_protected_tokens = args.protected_tokens
con... | 41.266667 | 118 | 0.683899 |
7a70ca90c80fc5a2ba9d9cedad86d6f25d3b6cdf | 1,112 | py | Python | share/rpcauth/rpcauth.py | 1515295/Iridium | 694c388b85680629364f683d8dd401c68975b900 | [
"MIT"
] | null | null | null | share/rpcauth/rpcauth.py | 1515295/Iridium | 694c388b85680629364f683d8dd401c68975b900 | [
"MIT"
] | null | null | null | share/rpcauth/rpcauth.py | 1515295/Iridium | 694c388b85680629364f683d8dd401c68975b900 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(sys... | 26.47619 | 79 | 0.728417 |
0a1915ce3a21366fe733a220393b2121d0069398 | 5,662 | py | Python | openaerostruct/tests/test_aero_analysis_Sref.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | null | null | null | openaerostruct/tests/test_aero_analysis_Sref.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | null | null | null | openaerostruct/tests/test_aero_analysis_Sref.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | 1 | 2021-04-09T16:45:27.000Z | 2021-04-09T16:45:27.000Z | from openmdao.utils.assert_utils import assert_rel_error
import unittest
import numpy as np
from openaerostruct.geometry.utils import generate_mesh
from openaerostruct.geometry.geometry_group import Geometry
from openaerostruct.aerodynamics.aero_groups import AeroPoint
import openmdao.api as om
class Test(unittest.... | 41.940741 | 103 | 0.557753 |
aad19ee81c99fd8c11f864ff05b67c8cfc3e4a57 | 11,299 | py | Python | nuplan/common/maps/nuplan_map/test/test_nuplan_map.py | motional/nuplan-devkit | e39029e788b17f47f2fcadb774098ef8fbdd0d67 | [
"Apache-2.0"
] | 128 | 2021-12-06T15:41:14.000Z | 2022-03-29T13:16:32.000Z | nuplan/common/maps/nuplan_map/test/test_nuplan_map.py | motional/nuplan-devkit | e39029e788b17f47f2fcadb774098ef8fbdd0d67 | [
"Apache-2.0"
] | 28 | 2021-12-11T08:11:31.000Z | 2022-03-25T02:35:43.000Z | nuplan/common/maps/nuplan_map/test/test_nuplan_map.py | motional/nuplan-devkit | e39029e788b17f47f2fcadb774098ef8fbdd0d67 | [
"Apache-2.0"
] | 14 | 2021-12-11T04:12:26.000Z | 2022-03-24T06:38:30.000Z | from typing import Any, Dict
import numpy as np
import pytest
from nuplan.common.actor_state.state_representation import Point2D
from nuplan.common.maps.abstract_map import SemanticMapLayer
from nuplan.common.maps.abstract_map_objects import Lane
from nuplan.common.maps.nuplan_map.map_factory import NuPlanMapFactory
... | 35.531447 | 118 | 0.695991 |
4305b3c230dca277292bd605d994cd3fae7cfcc9 | 286 | py | Python | codingame/practice/15_temperatures.py | thanosa/coding-challenges | a10b0de51da076a4bcc798b4a3d5a08e29c5af01 | [
"MIT"
] | null | null | null | codingame/practice/15_temperatures.py | thanosa/coding-challenges | a10b0de51da076a4bcc798b4a3d5a08e29c5af01 | [
"MIT"
] | null | null | null | codingame/practice/15_temperatures.py | thanosa/coding-challenges | a10b0de51da076a4bcc798b4a3d5a08e29c5af01 | [
"MIT"
] | null | null | null | '''
https://www.codingame.com/training/easy/temperatures
'''
n = int(input())
b = 999999999
for i in input().split():
t = int(i)
if abs(t) < abs(b):
b = t
elif abs(t) == abs(b):
b = max(t, b)
if b == 999999999:
b = 0
print(b)
| 13 | 53 | 0.468531 |
2a811f83f3af87ef39d8dbe576a3120b9b9ec07d | 1,355 | py | Python | pl_examples/basic_examples/gpu_template.py | cmpute/pytorch-lightning | 695e0514f8e60a88f49786c33311f223be2e7357 | [
"Apache-2.0"
] | 1 | 2020-09-18T04:30:37.000Z | 2020-09-18T04:30:37.000Z | pl_examples/basic_examples/gpu_template.py | cmpute/pytorch-lightning | 695e0514f8e60a88f49786c33311f223be2e7357 | [
"Apache-2.0"
] | null | null | null | pl_examples/basic_examples/gpu_template.py | cmpute/pytorch-lightning | 695e0514f8e60a88f49786c33311f223be2e7357 | [
"Apache-2.0"
] | null | null | null | """
Runs a model on a single node across multiple gpus.
"""
import os
from argparse import ArgumentParser
from pytorch_lightning import Trainer, seed_everything
from pl_examples.models.lightning_template import LightningTemplateModel
seed_everything(234)
def main(args):
"""
Main training routine specific fo... | 24.196429 | 84 | 0.566052 |
3e1c80b5a8f5755276d67dcd9cf66dc8966c215d | 5,081 | py | Python | ribbon/eureka/discovery_enabled_niws_server_list.py | haribo0915/Spring-Cloud-in-Python | 0bcd7093869c797df14428bf2d1b0a779f96e573 | [
"Apache-2.0"
] | 5 | 2020-10-06T09:48:23.000Z | 2020-10-07T13:19:46.000Z | ribbon/eureka/discovery_enabled_niws_server_list.py | haribo0915/Spring-Cloud-in-Python | 0bcd7093869c797df14428bf2d1b0a779f96e573 | [
"Apache-2.0"
] | 5 | 2020-10-05T09:57:01.000Z | 2020-10-12T19:52:48.000Z | ribbon/eureka/discovery_enabled_niws_server_list.py | haribo0915/Spring-Cloud-in-Python | 0bcd7093869c797df14428bf2d1b0a779f96e573 | [
"Apache-2.0"
] | 8 | 2020-10-05T06:34:49.000Z | 2020-10-07T13:19:46.000Z | # -*- coding: utf-8 -*-
# scip plugin
from spring_cloud.utils import logging
__author__ = "MJ (tsngmj@gmail.com)"
__license__ = "Apache 2.0"
# standard library
from typing import List
# scip plugin
from eureka.client.app_info import InstanceInfo
from ribbon.client.config.client_config import ClientConfig
from ribbon... | 35.284722 | 113 | 0.687069 |
7d366f10479bd25b550df21dd8eaebaa8126c618 | 6,523 | py | Python | siteblog/siteblog/settings.py | vladislavnet/siteblog | f8e0b139c974a78d5de17671768c34d214c025fe | [
"Unlicense"
] | null | null | null | siteblog/siteblog/settings.py | vladislavnet/siteblog | f8e0b139c974a78d5de17671768c34d214c025fe | [
"Unlicense"
] | null | null | null | siteblog/siteblog/settings.py | vladislavnet/siteblog | f8e0b139c974a78d5de17671768c34d214c025fe | [
"Unlicense"
] | null | null | null | """
Django settings for siteblog project.
Generated by 'django-admin startproject' using Django 3.1.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathli... | 30.914692 | 120 | 0.591906 |
ff2ceb747ca71d64418c2e8493b9663f3437dd91 | 4,243 | py | Python | odoo-13.0/addons/website_sale_delivery/models/sale_order.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/website_sale_delivery/models/sale_order.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/website_sale_delivery/models/sale_order.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
class SaleOrder(models.Model):
_inherit = 'sale.order'
amount_delivery = fields.Monetary(
compute='_compute_am... | 45.623656 | 121 | 0.64412 |
8a0493ac922e49cea2a3731cd878aa4ecd143e37 | 544 | py | Python | tests/macros/test_tag_macros.py | woodrush/hy | d9a5acbcc93114031c70fd7ea497e4e59c868e25 | [
"MIT"
] | 4 | 2017-08-09T01:31:56.000Z | 2022-01-17T01:11:23.000Z | tests/macros/test_tag_macros.py | woodrush/hy | d9a5acbcc93114031c70fd7ea497e4e59c868e25 | [
"MIT"
] | null | null | null | tests/macros/test_tag_macros.py | woodrush/hy | d9a5acbcc93114031c70fd7ea497e4e59c868e25 | [
"MIT"
] | null | null | null | # Copyright 2017 the authors.
# This file is part of Hy, which is free software licensed under the Expat
# license. See the LICENSE.
from hy.macros import macroexpand
from hy.compiler import HyTypeError, HyASTCompiler
from hy.lex import tokenize
def test_tag_macro_error():
"""Check if we get correct error with w... | 32 | 74 | 0.698529 |
2d05d3b9a7428af870534a96c9e8d64aab701b5f | 8,037 | py | Python | examples/rsa/search_inference.py | fluffybird2323/pyro | 9e74e499dbda76c28f12528235dac25bd17f0b1b | [
"MIT"
] | 2 | 2019-01-26T01:53:31.000Z | 2020-02-26T17:39:17.000Z | examples/rsa/search_inference.py | fluffybird2323/pyro | 9e74e499dbda76c28f12528235dac25bd17f0b1b | [
"MIT"
] | null | null | null | examples/rsa/search_inference.py | fluffybird2323/pyro | 9e74e499dbda76c28f12528235dac25bd17f0b1b | [
"MIT"
] | 1 | 2019-02-06T14:39:57.000Z | 2019-02-06T14:39:57.000Z | """
Inference algorithms and utilities used in the RSA example models.
Adapted from: http://dippl.org/chapters/03-enumeration.html
"""
from __future__ import absolute_import, division, print_function
import torch
import pyro
import pyro.distributions as dist
import pyro.poutine as poutine
from pyro.infer.abstract_... | 35.25 | 106 | 0.596491 |
64dcf1dfc12f629488ffc1f1a1160660890b59ee | 7,999 | py | Python | distributed/diskutils.py | hmaarrfk/distributed | 6caa30896e66501483416812d44c861da75ceab6 | [
"BSD-3-Clause"
] | null | null | null | distributed/diskutils.py | hmaarrfk/distributed | 6caa30896e66501483416812d44c861da75ceab6 | [
"BSD-3-Clause"
] | null | null | null | distributed/diskutils.py | hmaarrfk/distributed | 6caa30896e66501483416812d44c861da75ceab6 | [
"BSD-3-Clause"
] | null | null | null | import errno
import glob
import logging
import os
import shutil
import stat
import tempfile
import weakref
import dask
from . import locket
logger = logging.getLogger(__name__)
DIR_LOCK_EXT = ".dirlock"
def is_locking_enabled():
return dask.config.get("distributed.worker.use-file-locking")
def safe_unlink(... | 32.782787 | 88 | 0.566821 |
e00c3d9b73c517defcaf3728489be68f62c670a4 | 566 | py | Python | backend/src/gql/query/get_user.py | spiritutumduo/spiritumDuo | 987785906cd504f46ccebe3bbfe0e81cbf02bf7c | [
"MIT"
] | 1 | 2022-03-11T14:07:16.000Z | 2022-03-11T14:07:16.000Z | backend/src/gql/query/get_user.py | spiritutumduo/spiritumDuo | 987785906cd504f46ccebe3bbfe0e81cbf02bf7c | [
"MIT"
] | 3 | 2022-02-25T22:46:46.000Z | 2022-03-30T08:19:41.000Z | backend/src/gql/query/get_user.py | spiritutumduo/spiritumDuo | 987785906cd504f46ccebe3bbfe0e81cbf02bf7c | [
"MIT"
] | 1 | 2022-03-31T14:35:51.000Z | 2022-03-31T14:35:51.000Z | from .query_type import query
from dataloaders import UserByIdLoader, UserByUsernameLoader
from authentication.authentication import needsAuthorization
from SdTypes import Permissions
@query.field("getUser")
@needsAuthorization([Permissions.USER_READ])
async def resolve_get_user(
obj=None,
info=None,
id: ... | 26.952381 | 78 | 0.749117 |
d291d1d151be262e4188105f73bd16f48b353d81 | 2,031 | py | Python | docs/conf.py | kacperstyslo/subnet-info | 8899203f7d1c3ac858fa923aee6d0b1b1f59cbc7 | [
"MIT"
] | null | null | null | docs/conf.py | kacperstyslo/subnet-info | 8899203f7d1c3ac858fa923aee6d0b1b1f59cbc7 | [
"MIT"
] | null | null | null | docs/conf.py | kacperstyslo/subnet-info | 8899203f7d1c3ac858fa923aee6d0b1b1f59cbc7 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.295082 | 79 | 0.666174 |
242acab459481f6b3a5313494374afd52670a33a | 7,763 | py | Python | test/test_vlib.py | halvors/vpp | fdc17b1ae7743bc37d4e08467d0295d6f277ec12 | [
"Apache-2.0"
] | null | null | null | test/test_vlib.py | halvors/vpp | fdc17b1ae7743bc37d4e08467d0295d6f277ec12 | [
"Apache-2.0"
] | null | null | null | test/test_vlib.py | halvors/vpp | fdc17b1ae7743bc37d4e08467d0295d6f277ec12 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import unittest
import pexpect
import time
import signal
from config import config
from framework import VppTestCase, VppTestRunner
from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
@unittest.skipUnless(config.gcov, "part of code coverage tests")
class TestVlib(VppTestCase):
""... | 35.447489 | 75 | 0.473786 |
849bf8bffd92dcce816daaa0f8a55c62d57eea49 | 521 | py | Python | src/cloudlight/__init__.py | joigno/cloudlight | 8a6510047abd97e0bf3a568322205beb56fa5260 | [
"BSD-3-Clause"
] | 3 | 2020-08-21T00:18:50.000Z | 2020-10-21T17:40:47.000Z | src/cloudlight/__init__.py | joigno/cloudlight | 8a6510047abd97e0bf3a568322205beb56fa5260 | [
"BSD-3-Clause"
] | null | null | null | src/cloudlight/__init__.py | joigno/cloudlight | 8a6510047abd97e0bf3a568322205beb56fa5260 | [
"BSD-3-Clause"
] | null | null | null | '''
Created on Mar 26, 2010
@author: jose
'''
from classes.graph import *
from classes.big_graph import *
from classes.big_digraph import *
from nodes.node import *
from nodes.search import *
from nodes.facebook import *
from nodes.twitter import *
from algorithms.plot import *
from algorithms.privacy import *
from a... | 21.708333 | 39 | 0.775432 |
8233e9b2d95d8c01071143aa0854b14dccccbb37 | 7,083 | py | Python | voyager/client/models/v1beta1_certificate_details.py | voyager-client/python | d30de935c9cf30fa9e9e4c90714f3868767f4065 | [
"Apache-2.0"
] | null | null | null | voyager/client/models/v1beta1_certificate_details.py | voyager-client/python | d30de935c9cf30fa9e9e4c90714f3868767f4065 | [
"Apache-2.0"
] | 1 | 2018-06-24T20:33:11.000Z | 2018-06-24T20:33:11.000Z | voyager/client/models/v1beta1_certificate_details.py | voyager-client/python | d30de935c9cf30fa9e9e4c90714f3868767f4065 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Voyager
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v7.1.1
Contact: hello@appscode.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six imp... | 27.560311 | 131 | 0.599181 |
2d94fc5df32994f8a14bd92135a0a05aae4e1e67 | 2,139 | py | Python | actions/build_manylinux.py | chryswoods/python_pack_and_doc | 6d63d4e91dd93abf8f618d75c161ab65f943dadd | [
"Apache-2.0"
] | 5 | 2020-09-23T14:04:39.000Z | 2020-10-02T14:01:16.000Z | actions/build_manylinux.py | chryswoods/python_pack_and_doc | 6d63d4e91dd93abf8f618d75c161ab65f943dadd | [
"Apache-2.0"
] | null | null | null | actions/build_manylinux.py | chryswoods/python_pack_and_doc | 6d63d4e91dd93abf8f618d75c161ab65f943dadd | [
"Apache-2.0"
] | 1 | 2020-09-25T16:25:24.000Z | 2020-09-25T16:25:24.000Z |
import sys
import os
import subprocess
import shlex
import glob
def run_command(cmd, dry=False):
"""Run the passed shell command"""
if dry:
print(f"[DRY-RUN] {cmd}")
return
print(f"[EXECUTE] {cmd}")
try:
args = shlex.split(cmd)
subprocess.run(args).check_returncode()... | 25.771084 | 74 | 0.591865 |
12892a7394c07e0c73c98f0762038bd53c40fb80 | 2,128 | py | Python | equineclinic/src/webapps/web/wsgi.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | equineclinic/src/webapps/web/wsgi.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | 1 | 2015-11-08T11:49:35.000Z | 2015-11-08T11:49:43.000Z | equineclinic/src/webapps/web/wsgi.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | """
WSGI Utilities
(from web.py)
"""
import os, sys
import http
import webapi as web
from utils import listget
from net import validaddr, validip
import httpserver
def runfcgi(func, addr=('localhost', 8000)):
"""Runs a WSGI function as a FastCGI server."""
#import flup.server.fcgi as flups
#return fl... | 30.84058 | 76 | 0.641447 |
16aa68757a7a727bd115d11ed5071f8a7b22b8c5 | 1,542 | py | Python | source/database.py | FroggedTV/grenouilleDISCORD | bf0dd1004ed0c0eb794896e6f48263b647036617 | [
"MIT"
] | null | null | null | source/database.py | FroggedTV/grenouilleDISCORD | bf0dd1004ed0c0eb794896e6f48263b647036617 | [
"MIT"
] | null | null | null | source/database.py | FroggedTV/grenouilleDISCORD | bf0dd1004ed0c0eb794896e6f48263b647036617 | [
"MIT"
] | null | null | null | from threading import Lock
import sqlite3
import config
import logging
from time import time as current_time
LOGGER = logging.getLogger(__name__)
class Database(object):
def __init__(self):
LOGGER.debug("Initializing Database object")
self.database_path = config.database_path
self.lock = ... | 30.235294 | 99 | 0.588846 |
984fa43367f697857f003286e10ce3717f663f9d | 2,198 | py | Python | flaskblog/models.py | oecorrechag/Block | b65152dc768ece64ea93535ade5e8c66c3ab9de4 | [
"MIT"
] | null | null | null | flaskblog/models.py | oecorrechag/Block | b65152dc768ece64ea93535ade5e8c66c3ab9de4 | [
"MIT"
] | null | null | null | flaskblog/models.py | oecorrechag/Block | b65152dc768ece64ea93535ade5e8c66c3ab9de4 | [
"MIT"
] | 1 | 2021-01-04T20:13:06.000Z | 2021-01-04T20:13:06.000Z | from datetime import datetime
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
from flaskblog import db, login_manager
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(db.Model,... | 37.896552 | 129 | 0.684258 |
5514ccd3fbf17b760414beb73ebb3b9a603b6beb | 1,362 | bzl | Python | tensorflow/core/platform/build_config_root.bzl | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 57 | 2017-09-03T07:08:31.000Z | 2022-02-28T04:33:42.000Z | tensorflow/core/platform/build_config_root.bzl | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 203 | 2019-06-14T23:53:10.000Z | 2022-02-10T02:27:23.000Z | tensorflow/core/platform/build_config_root.bzl | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 66 | 2020-05-15T10:05:12.000Z | 2022-02-14T07:28:18.000Z | """Provides a redirection point for platform specific implementations of starlark utilities."""
load(
"//tensorflow/core/platform/default:build_config_root.bzl",
_if_dynamic_kernels = "if_dynamic_kernels",
_if_static = "if_static",
_if_static_and_not_mobile = "if_static_and_not_mobile",
_register_e... | 43.935484 | 95 | 0.839207 |
862fd7bc00c84c2491fe78077bc4c94dc3c96519 | 475 | py | Python | tests/python/inheritance_shadow.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | null | null | null | tests/python/inheritance_shadow.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | 1 | 2021-06-10T23:42:13.000Z | 2021-06-10T23:42:13.000Z | tests/python/inheritance_shadow.py | jlmaurer/pyre | 6af38a83621d7d6228d147b4bb94f97fbb10f6e2 | [
"BSD-3-Clause"
] | 2 | 2020-08-31T18:07:52.000Z | 2021-12-10T08:54:39.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2020 all rights reserved
#
"""
Verify that we understand how multiple inheritance shadows duplicate attribute names
"""
class Base1(object):
name = "base1"
class Base2(object):
name = "base2"
class Derived(Base... | 12.837838 | 84 | 0.631579 |
bb23a006d2da5148fed4918d4cec6935fdbaeb15 | 2,995 | py | Python | tpdatasrc/tpgamefiles/scr/tpModifiers/practiced_spellcaster.py | dolio/TemplePlus | 37446bb3d1fcbf460e611a4fcb2caff167e9ac08 | [
"MIT"
] | 69 | 2015-05-05T14:09:25.000Z | 2022-02-15T06:13:04.000Z | tpdatasrc/tpgamefiles/scr/tpModifiers/practiced_spellcaster.py | anatoliy-savchak/TemplePlus | 50922bb14cc2d7dcf8fceeccf45c3b905c1b512f | [
"MIT"
] | 457 | 2015-05-01T22:07:45.000Z | 2022-03-31T02:19:10.000Z | tpdatasrc/tpgamefiles/scr/tpModifiers/practiced_spellcaster.py | anatoliy-savchak/TemplePlus | 50922bb14cc2d7dcf8fceeccf45c3b905c1b512f | [
"MIT"
] | 25 | 2016-02-04T21:19:53.000Z | 2021-11-15T23:14:51.000Z | from templeplus.pymod import PythonModifier
from toee import *
import tpdp
import char_class_utils
print "Registering Practiced Spellcaster"
### Moved to new event type so that it can modify caster level without a specific spell
### This will be used e.g. for crafting
# def PracticedSpellcasterLevelModArcane(attachee... | 36.52439 | 109 | 0.75626 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.