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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6216dbe811b9da54b54ab8eeebd5ca2f9b122ecf | 3,566 | py | Python | tests/test_importers/test_pysswords_importer.py | bcfurtado/passpie | 421c40a57ad5f55e3f14b323c929a2c41dfb5527 | [
"MIT"
] | 700 | 2015-05-02T20:58:37.000Z | 2022-01-20T18:49:17.000Z | tests/test_importers/test_pysswords_importer.py | bcfurtado/passpie | 421c40a57ad5f55e3f14b323c929a2c41dfb5527 | [
"MIT"
] | 108 | 2015-05-02T02:56:39.000Z | 2021-07-01T21:46:10.000Z | tests/test_importers/test_pysswords_importer.py | bcfurtado/passpie | 421c40a57ad5f55e3f14b323c929a2c41dfb5527 | [
"MIT"
] | 72 | 2015-05-03T02:50:24.000Z | 2021-06-09T03:38:51.000Z | from collections import namedtuple
import os
import shutil
import sys
import tempfile
import yaml
from passpie.importers import find_importer, BaseImporter, get_instances
from passpie.importers.default_importer import DefaultImporter
from passpie.importers.pysswords_importer import PysswordsImporter
def mock_open()... | 35.306931 | 76 | 0.764722 |
6216df5323d2f91e99de9b750389a90d4980ce7d | 21,578 | py | Python | trac/dist.py | arielnetworks/trac | 1a96a3c39961a8952358cb8c64ccf9e94079c26b | [
"BSD-3-Clause"
] | null | null | null | trac/dist.py | arielnetworks/trac | 1a96a3c39961a8952358cb8c64ccf9e94079c26b | [
"BSD-3-Clause"
] | null | null | null | trac/dist.py | arielnetworks/trac | 1a96a3c39961a8952358cb8c64ccf9e94079c26b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists o... | 40.40824 | 79 | 0.537909 |
62170b734f26e23f1c9948ce450a17de52355d3e | 22,206 | py | Python | src/robot/rebot.py | DirkRichter/robotframework | ae5c931834e56c195e76e5d6bcdfcd6a73babaf2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/rebot.py | DirkRichter/robotframework | ae5c931834e56c195e76e5d6bcdfcd6a73babaf2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/rebot.py | DirkRichter/robotframework | ae5c931834e56c195e76e5d6bcdfcd6a73babaf2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | 55.79397 | 80 | 0.592047 |
62171a80e2ea87c67ab571f0f68be10d31ff315f | 13,166 | py | Python | tests/unit/task/test_hook.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | tests/unit/task/test_hook.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | tests/unit/task/test_hook.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | 1 | 2015-02-07T09:44:47.000Z | 2015-02-07T09:44:47.000Z | # Copyright 2016: Mirantis 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 b... | 38.837758 | 79 | 0.547319 |
621721b96d35733eb6860074f06de77565adcb54 | 1,347 | py | Python | tests/h/services/groupfinder_test.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | tests/h/services/groupfinder_test.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | 4 | 2020-03-24T17:38:24.000Z | 2022-03-02T05:45:01.000Z | tests/h/services/groupfinder_test.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from h.services.groupfinder import groupfinder_service_factory
from h.services.groupfinder import GroupfinderService
class TestGroupfinderService:
def test_returns_correct_group(self, svc, factories):
group = factories.Group(... | 28.659574 | 65 | 0.738679 |
621727805fd89fbbc8f6081573de8611a10454ae | 895 | py | Python | data/transcoder_evaluation_gfg/python/N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/N_TH_NUMBER_WHOSE_SUM_OF_DIGITS_IS_TEN.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import itertools
def f_gold ( n ) :
count = 0
for curr in itertools.count ( ) :
sum = 0
x = curr
... | 20.813953 | 64 | 0.497207 |
6217476b7de4aa326f8578cd708f110f6a744642 | 863 | py | Python | run_electiondemo.py | jonathanHuwP/PyQtDemoElection | 015cbe6562e8f19c5e2c5b9b523964111eae6d06 | [
"Apache-2.0"
] | null | null | null | run_electiondemo.py | jonathanHuwP/PyQtDemoElection | 015cbe6562e8f19c5e2c5b9b523964111eae6d06 | [
"Apache-2.0"
] | null | null | null | run_electiondemo.py | jonathanHuwP/PyQtDemoElection | 015cbe6562e8f19c5e2c5b9b523964111eae6d06 | [
"Apache-2.0"
] | null | null | null | ## -*- coding: utf-8 -*-
"""
Created on Tue 27 Oct 2020
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 ... | 31.962963 | 80 | 0.76825 |
62175abc7a7b21e67ae3a619275ec84fb3545914 | 947 | py | Python | msdsl/templates/uniform.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 15 | 2019-05-14T10:12:23.000Z | 2022-03-29T15:29:52.000Z | msdsl/templates/uniform.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 19 | 2020-01-22T21:44:33.000Z | 2021-06-05T02:10:41.000Z | msdsl/templates/uniform.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 5 | 2019-10-21T09:53:17.000Z | 2021-08-10T17:32:20.000Z | from msdsl import MixedSignalModel
class UniformRandom(MixedSignalModel):
def __init__(self, seed=None, width=32, min_val='min_val', max_val='max_val', out='out',
clk=None, rst=None, ce=None, **kwargs):
# call the super constructor
super().__init__(**kwargs)
# create IOs
... | 39.458333 | 92 | 0.609293 |
6217689450fdaf2ecedadc5a431227d7b721b761 | 180 | py | Python | wc_model_gen/__init__.py | KarrLab/model_generator | b2735391545bcd5f21faaa1ceaa1949e53497378 | [
"MIT"
] | 6 | 2018-12-24T16:20:11.000Z | 2022-01-26T23:38:25.000Z | wc_model_gen/__init__.py | KarrLab/model_generator | b2735391545bcd5f21faaa1ceaa1949e53497378 | [
"MIT"
] | 15 | 2018-08-08T20:34:40.000Z | 2021-10-31T20:08:40.000Z | wc_model_gen/__init__.py | KarrLab/model_generator | b2735391545bcd5f21faaa1ceaa1949e53497378 | [
"MIT"
] | 2 | 2019-04-05T16:11:57.000Z | 2020-04-29T14:14:30.000Z | from ._version import __version__
# :obj:`str`: version
# API
from .core import (ModelGenerator,
ModelComponentGenerator,
SubmodelGenerator)
| 22.5 | 43 | 0.627778 |
62176c0a0e7b9fd83f53cca9fc922a20685881b4 | 3,691 | py | Python | examples/ensemble/plot_comparison_bagging_classifier.py | rasbt/imbalanced-learn | 96b4c3131668e928ab8bb3cf95ceeb5de8510564 | [
"MIT"
] | 4 | 2017-10-02T05:54:52.000Z | 2021-09-25T09:01:43.000Z | examples/ensemble/plot_comparison_bagging_classifier.py | DunZhang/imbalanced-learn | 69a80c09d3bb52f265afab5464fc904321640fea | [
"MIT"
] | null | null | null | examples/ensemble/plot_comparison_bagging_classifier.py | DunZhang/imbalanced-learn | 69a80c09d3bb52f265afab5464fc904321640fea | [
"MIT"
] | 5 | 2017-09-07T14:03:48.000Z | 2022-02-11T08:40:06.000Z | """
=========================================================
Comparison of balanced and imbalanced bagging classifiers
=========================================================
This example shows the benefit of balancing the training set when using a
bagging classifier. ``BalancedBaggingClassifier`` chains a
``Random... | 35.152381 | 79 | 0.712273 |
62179316d58c6e4638305a63280d9a5054fc46c4 | 536 | py | Python | q19.py | jsdnhk/recursion-exercise | 87c4320adcc6ef5545b7f56614ca0a2171d811ab | [
"MIT"
] | null | null | null | q19.py | jsdnhk/recursion-exercise | 87c4320adcc6ef5545b7f56614ca0a2171d811ab | [
"MIT"
] | null | null | null | q19.py | jsdnhk/recursion-exercise | 87c4320adcc6ef5545b7f56614ca0a2171d811ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#Find the binary from the decimal
import sys
def main():
int_dec = eval(input("Enter the decimal number: "))
if not (type(int_dec) == int and int_dec >= 0):
sys.stderr.write("Please input a +ve decimal number")
exit(1)
print("The binary from the decimal[%s] is: %s" % ... | 29.777778 | 89 | 0.636194 |
6217944a2bc923559982c54e59829bdadfe4a036 | 6,344 | py | Python | asposewordscloud/models/fields_response.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | asposewordscloud/models/fields_response.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | asposewordscloud/models/fields_response.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="fields_response.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of t... | 34.666667 | 85 | 0.579445 |
6217947d2c75c2d663330fa443c54bebc1421b33 | 7,128 | py | Python | detection/YOLO_pytorch/yolo_net.py | lhq1208/object_detection | ab3265e0f09b78415299c1a0b38254176a0565ed | [
"Apache-2.0"
] | null | null | null | detection/YOLO_pytorch/yolo_net.py | lhq1208/object_detection | ab3265e0f09b78415299c1a0b38254176a0565ed | [
"Apache-2.0"
] | null | null | null | detection/YOLO_pytorch/yolo_net.py | lhq1208/object_detection | ab3265e0f09b78415299c1a0b38254176a0565ed | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Variable
from torchvision import models
from YOLO import config as cfg
import numpy as np
class YOLO():
def __init__(self, is_training=False, use_gpu=True):
self.classes = cfg.CLASSES
self.num_classes = len(self.classes)
self.im... | 47.52 | 116 | 0.604798 |
6217b490e1792d15fca97e3d647d53e7f246f41c | 2,790 | py | Python | flagging_site/data/usgs.py | danivalades/flagging | b1a097594e9b7d9e101edef9bb6abf98a333383c | [
"MIT"
] | null | null | null | flagging_site/data/usgs.py | danivalades/flagging | b1a097594e9b7d9e101edef9bb6abf98a333383c | [
"MIT"
] | null | null | null | flagging_site/data/usgs.py | danivalades/flagging | b1a097594e9b7d9e101edef9bb6abf98a333383c | [
"MIT"
] | null | null | null | """
This file handles connections to the USGS API to retrieve data from the Waltham
gauge.
Link to the web interface (not the api)
https://waterdata.usgs.gov/nwis/uv?site_no=01104500
"""
import os
import pandas as pd
import requests
from flask import abort
from flask import current_app
# Constants
USGS_URL = 'https... | 26.571429 | 109 | 0.632616 |
621800d278f9a59c3bdcd80b352cbb01c2973422 | 1,088 | py | Python | outsource/shell_safe.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 941 | 2021-05-10T08:14:14.000Z | 2022-03-31T11:40:24.000Z | outsource/shell_safe.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 4 | 2021-12-22T22:34:51.000Z | 2022-03-31T07:34:19.000Z | outsource/shell_safe.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 122 | 2021-05-10T08:21:23.000Z | 2022-03-25T20:34:12.000Z | import base64
import json
from typing import List
from typing import Union
Command = Union[str, List[str]]
def encode(obj: Command) -> str:
"""
Encode a string in a shell-safe way.
The resulting string is a representation of a python value that is:
* json encoded, then
* utf-8 encoded, then
... | 27.897436 | 76 | 0.644301 |
62180bd57981233769272c1b78b15d80f45a158a | 16,517 | py | Python | goal_prox/envs/hand/manipulate.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | 4 | 2021-11-17T20:19:34.000Z | 2022-03-31T04:21:26.000Z | goal_prox/envs/hand/manipulate.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | null | null | null | goal_prox/envs/hand/manipulate.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | null | null | null | import os
import numpy as np
from gym import utils, error
from gym.envs.robotics import rotations
from gym.envs.robotics.utils import robot_get_obs
from goal_prox.envs import hand_env
try:
import mujoco_py
except ImportError as e:
raise error.DependencyNotInstalled("{}. (HINT: you need to install mujoco_py, a... | 47.736994 | 178 | 0.637828 |
62184da9d73416f7cdfd276268911c2156c31aa7 | 4,507 | py | Python | src/stk/molecular/topology_graphs/topology_graph/optimizers/spinner.py | stevenkbennett/stk | a8311fa6110adc0ea593a24d9a0c064597b1b174 | [
"MIT"
] | null | null | null | src/stk/molecular/topology_graphs/topology_graph/optimizers/spinner.py | stevenkbennett/stk | a8311fa6110adc0ea593a24d9a0c064597b1b174 | [
"MIT"
] | null | null | null | src/stk/molecular/topology_graphs/topology_graph/optimizers/spinner.py | stevenkbennett/stk | a8311fa6110adc0ea593a24d9a0c064597b1b174 | [
"MIT"
] | null | null | null | """
Spinner
=======
"""
import spindry as spd
from ..construction_state import ConstructionState
from .optimizer import Optimizer
class Spinner(Optimizer):
"""
Performs Monte Carlo optimisation of host-guest complexes [1]_.
Examples:
*Structure Optimization*
Using :class:`.Spinner` wi... | 31.298611 | 71 | 0.55558 |
62188d8385b9f3d721e5bb0b7174f59e6d75320a | 121 | py | Python | reliabilly/tests/__init__.py | corpseware/reliabilly | e8d310d43478407e2cf8b45cc746362124140385 | [
"MIT"
] | 1 | 2018-11-24T02:07:37.000Z | 2018-11-24T02:07:37.000Z | reliabilly/tests/__init__.py | corpseware/reliabilly | e8d310d43478407e2cf8b45cc746362124140385 | [
"MIT"
] | 1 | 2019-01-23T07:12:30.000Z | 2019-01-23T07:12:30.000Z | reliabilly/tests/__init__.py | corpseware/reliabilly | e8d310d43478407e2cf8b45cc746362124140385 | [
"MIT"
] | 1 | 2019-01-16T05:30:49.000Z | 2019-01-16T05:30:49.000Z | import json
import logging
import warnings
from unittest import TestCase, skipUnless
from unittest.mock import MagicMock
| 20.166667 | 41 | 0.859504 |
62189b6dffb24282d6b3f6a7a6bd44d55026ce09 | 16,553 | py | Python | LR/lr/tests/functional/test_harvest.py | LearningRegistry/LearningRegistry | d9f0a8117a4adb8fcf6bf101d3d58d799463a2e2 | [
"Apache-2.0"
] | 26 | 2015-04-14T03:11:58.000Z | 2022-01-06T14:31:07.000Z | LR/lr/tests/functional/test_harvest.py | LearningRegistry/LearningRegistry | d9f0a8117a4adb8fcf6bf101d3d58d799463a2e2 | [
"Apache-2.0"
] | 11 | 2015-04-03T21:54:03.000Z | 2017-05-02T17:20:03.000Z | LR/lr/tests/functional/test_harvest.py | LearningRegistry/LearningRegistry | d9f0a8117a4adb8fcf6bf101d3d58d799463a2e2 | [
"Apache-2.0"
] | 16 | 2015-02-11T09:30:18.000Z | 2020-11-20T02:06:24.000Z | from datetime import datetime
from lr.lib.harvest import harvest
from lr.tests import *
from lr.util.decorators import ForceCouchDBIndexing, ModifiedServiceDoc, update_authz
from pylons import config
from urllib import unquote_plus,quote_plus
import logging,json
import threading
import time
import time
log = logging.ge... | 51.089506 | 143 | 0.671842 |
6218b8ada5f1f29beb258a8f31c8df8414e4209b | 36,556 | py | Python | Selenium_PhantomJS/source/botocore/utils.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2019-06-27T12:09:44.000Z | 2019-06-27T12:09:44.000Z | Selenium_PhantomJS/source/botocore/utils.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | Selenium_PhantomJS/source/botocore/utils.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | # Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | 36.519481 | 84 | 0.632947 |
6218f201d3a9d191327a41d93cf076d047b8aa24 | 4,332 | py | Python | clif/testing/python/nested_fields_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/nested_fields_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/nested_fields_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 29.27027 | 79 | 0.649815 |
621911876fc502ece76b08eb6c28697b3c12c863 | 4,110 | py | Python | tensorflow/contrib/kafka/python/kernel_tests/kafka_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/kafka/python/kernel_tests/kafka_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/kafka/python/kernel_tests/kafka_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 35.431034 | 80 | 0.635766 |
62195c5deeb70aefd05b74f8ad17e1d0ec240005 | 2,757 | py | Python | fedot/core/optimisers/timer.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 358 | 2020-06-11T09:34:53.000Z | 2022-03-31T12:56:22.000Z | fedot/core/optimisers/timer.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 467 | 2020-06-11T13:49:45.000Z | 2022-03-31T14:19:48.000Z | fedot/core/optimisers/timer.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 48 | 2020-07-13T14:50:45.000Z | 2022-03-26T09:37:13.000Z | import datetime
from abc import ABC
from fedot.core.log import Log, default_log
class Timer(ABC):
def __init__(self, timeout: datetime.timedelta = None, log: Log = None):
self.process_terminated = False
if not log:
self.log = default_log(__name__)
else:
self.log = ... | 33.216867 | 102 | 0.624229 |
62196a283c5d47cfe84cb22e6ac3eed599f2448d | 5,546 | py | Python | src/pykeen/models/unimodal/quate.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | src/pykeen/models/unimodal/quate.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | src/pykeen/models/unimodal/quate.py | Rodrigo-A-Pereira/pykeen | 76c5acb707faa524b5951b0d1d85ab1afe806462 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Implementation of the QuatE model."""
from typing import Any, ClassVar, Mapping, Optional, Type
import torch
from torch.nn import functional
from ..nbase import ERModel
from ...constants import DEFAULT_EMBEDDING_HPO_EMBEDDING_DIM_RANGE
from ...losses import BCEWithLogitsLoss, Loss
from ..... | 36.973333 | 109 | 0.660115 |
62199857f7b9640d30856799c6986e4761e7cba3 | 17,032 | py | Python | rat-sql-gap/seq2struct/datasets/spider_lib/process_sql.py | JuruoMP/gap-exp | 2d7af8a1da2f0ff8f9d3a2c6e15cc6383c716c05 | [
"Apache-2.0"
] | null | null | null | rat-sql-gap/seq2struct/datasets/spider_lib/process_sql.py | JuruoMP/gap-exp | 2d7af8a1da2f0ff8f9d3a2c6e15cc6383c716c05 | [
"Apache-2.0"
] | null | null | null | rat-sql-gap/seq2struct/datasets/spider_lib/process_sql.py | JuruoMP/gap-exp | 2d7af8a1da2f0ff8f9d3a2c6e15cc6383c716c05 | [
"Apache-2.0"
] | null | null | null | ################################
# Assumptions:
# 1. sql is correct
# 2. only table name has alias
# 3. only one intersect/union/except
#
# val: number(float)/string(str)/sql(dict)
# col_unit: (agg_id, col_id, isDistinct(bool))
# val_unit: (unit_op, col_unit1, col_unit2)
# table_unit: (table_type, col_unit/sql)
#... | 29.62087 | 123 | 0.587189 |
6219c39534d69c07446c7d5511c6b46c7545412b | 1,340 | py | Python | stoq/plugins/base.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 385 | 2015-11-20T02:21:18.000Z | 2022-03-24T09:38:24.000Z | stoq/plugins/base.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 127 | 2016-07-08T20:23:20.000Z | 2022-02-23T13:52:19.000Z | stoq/plugins/base.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 68 | 2015-11-20T12:51:44.000Z | 2022-01-25T04:35:54.000Z | #!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
# 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
#
# Un... | 40.606061 | 87 | 0.716418 |
6219dfee37e355bc59fc293707c9608cd540d3d7 | 279 | py | Python | terrascript/elasticsearch/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/elasticsearch/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/elasticsearch/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/elasticsearch/__init__.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class elasticsearch(terrascript.Provider):
pass
| 18.6 | 79 | 0.781362 |
6219edf5f8696e2a3e025f09f59c67446de336a8 | 831 | py | Python | constants.py | Batlin/NestTweaks | 0ab833d68f20be078b0e06a2658b9ba3c55e4e99 | [
"MIT"
] | null | null | null | constants.py | Batlin/NestTweaks | 0ab833d68f20be078b0e06a2658b9ba3c55e4e99 | [
"MIT"
] | null | null | null | constants.py | Batlin/NestTweaks | 0ab833d68f20be078b0e06a2658b9ba3c55e4e99 | [
"MIT"
] | null | null | null | from enum import Enum
import apikeys
# Endpoints
SPREADSHEET = 'https://script.google.com/macros/s/' + apikeys.GS_ID + '/exec'
SPREADSHEET_DEV = 'https://script.google.com/macros/s/' + apikeys.GS_ID + '/dev'
# Open Weather
OWM_API_KEY = apikeys.OWM
OWM_CITY = 'Madrid, Spain'
OWM_UNITS = 'celsius'
# Google Assistant ... | 23.083333 | 80 | 0.731649 |
6219f426cd71a2c2bf12b887d4539ee4ec6c5616 | 34,530 | py | Python | src/confidentialledger/azext_confidentialledger/vendored_sdks/confidentialledger/operations/_ledger_operations.py | saisankargochhayat/azure-cli-extensions | f89443a766961f984977a2cf1b682973fcb61edd | [
"MIT"
] | null | null | null | src/confidentialledger/azext_confidentialledger/vendored_sdks/confidentialledger/operations/_ledger_operations.py | saisankargochhayat/azure-cli-extensions | f89443a766961f984977a2cf1b682973fcb61edd | [
"MIT"
] | null | null | null | src/confidentialledger/azext_confidentialledger/vendored_sdks/confidentialledger/operations/_ledger_operations.py | saisankargochhayat/azure-cli-extensions | f89443a766961f984977a2cf1b682973fcb61edd | [
"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 ... | 41.502404 | 184 | 0.606284 |
621a0b187dad1e9191e10f0847749cd1d9f6fc87 | 8,905 | py | Python | datasketch/minhash.py | yrik/datasketch | 82d9639bc0011932a952bbae1d4b5bd5ac03c7c8 | [
"MIT"
] | null | null | null | datasketch/minhash.py | yrik/datasketch | 82d9639bc0011932a952bbae1d4b5bd5ac03c7c8 | [
"MIT"
] | null | null | null | datasketch/minhash.py | yrik/datasketch | 82d9639bc0011932a952bbae1d4b5bd5ac03c7c8 | [
"MIT"
] | null | null | null | import random, copy, struct
from hashlib import sha1
import numpy as np
# The size of a hash value in number of bytes
hashvalue_byte_size = len(bytes(np.int64(42).data))
# http://en.wikipedia.org/wiki/Mersenne_prime
_mersenne_prime = (1 << 61) - 1
_max_hash = (1 << 32) - 1
_hash_range = (1 << 32)
class MinHash(objec... | 40.112613 | 98 | 0.606513 |
621a117db9a1856435803b759c32dcb592c78618 | 19,887 | py | Python | src/sardana/sardanadefs.py | marc2332/sardana | 48dc9191baaa63f6c714d8c025e8f3f96548ad26 | [
"CC-BY-3.0"
] | 43 | 2016-11-25T15:21:23.000Z | 2021-08-20T06:09:40.000Z | src/sardana/sardanadefs.py | marc2332/sardana | 48dc9191baaa63f6c714d8c025e8f3f96548ad26 | [
"CC-BY-3.0"
] | 1,263 | 2016-11-25T15:58:37.000Z | 2021-11-02T22:23:47.000Z | src/sardana/sardanadefs.py | marc2332/sardana | 48dc9191baaa63f6c714d8c025e8f3f96548ad26 | [
"CC-BY-3.0"
] | 58 | 2016-11-21T11:33:55.000Z | 2021-09-01T06:21:21.000Z | #!/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... | 36.027174 | 108 | 0.647609 |
621a2af4e6fcb4488dceeb0855d36ae152228b24 | 3,136 | py | Python | ExtentionPackages/pysnmp/smi/indices.py | hongsofwing/PyQYT-master | 9a112d9adbf9885a8b7535b7ef7759b60a0f9a29 | [
"CNRI-Python"
] | null | null | null | ExtentionPackages/pysnmp/smi/indices.py | hongsofwing/PyQYT-master | 9a112d9adbf9885a8b7535b7ef7759b60a0f9a29 | [
"CNRI-Python"
] | null | null | null | ExtentionPackages/pysnmp/smi/indices.py | hongsofwing/PyQYT-master | 9a112d9adbf9885a8b7535b7ef7759b60a0f9a29 | [
"CNRI-Python"
] | null | null | null | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysnmp.sf.net/license.html
#
from bisect import bisect
class OrderedDict(dict):
"""Ordered dictionary used for indices"""
def __init__(self, **kwargs):
self.__keys = []
self.__d... | 27.034483 | 77 | 0.571747 |
621a2e88f9e6f3837b206030025162e6bdd8c06e | 1,641 | py | Python | python-code/opencv-learning/tiny-apps/handgesture/hand_pose.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 13 | 2018-09-07T02:29:07.000Z | 2021-06-18T08:40:09.000Z | python-code/opencv-learning/tiny-apps/handgesture/hand_pose.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | null | null | null | python-code/opencv-learning/tiny-apps/handgesture/hand_pose.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 4 | 2019-06-20T00:09:39.000Z | 2021-07-15T10:14:36.000Z | """
#Author : Arijit Mukherjee
#Date : June 2016
#B.P. Poddar Institute of Management and Technology
#Inteligent Human-Computer Interaction with depth prediction using normal webcam and IR leds
#Inspired by : http://research.microsoft.com/pubs/220845/depth4free_SIGGRAPH.pdf
Demo application to predict hand-pose from a... | 28.789474 | 120 | 0.717246 |
621a53d282fae5160a6a94d10b907fe4b822a6e0 | 4,201 | py | Python | cartridge/shop/payment/authorizenet.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/payment/authorizenet.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/payment/authorizenet.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import unicode_literals
from future.builtins import str
try:
from urllib.request import Request, urlopen
from urllib.error import URLError
except ImportError:
from urllib2 import Request, urlopen, URLError
from django.core.exceptions import ImproperlyConfigured
from django.utils.http impor... | 37.508929 | 78 | 0.666746 |
621a5f0777e1bae0f536bef572cd8bd84efb9613 | 1,323 | py | Python | item.py | bkosciow/piader | 81ca2c8a4bd4a834fb460b5306fca0c5ce0584c4 | [
"MIT"
] | null | null | null | item.py | bkosciow/piader | 81ca2c8a4bd4a834fb460b5306fca0c5ce0584c4 | [
"MIT"
] | null | null | null | item.py | bkosciow/piader | 81ca2c8a4bd4a834fb460b5306fca0c5ce0584c4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#pylint: disable=I0011,R0921
"""Item interface"""
from builtins import object
class Item(object):
"""Base class for all elements in game"""
sprite = "*"
def __init__(self, x, y):
"""init function"""
self.pos_x = x
self.pos_y = y
def ... | 23.210526 | 66 | 0.582766 |
621a687bf699ec34f3ff299de2f72cdbe93bb119 | 374 | py | Python | exercises/general/inherit.py | angelptli/my_kivy_journey | 2718e3ef22f67a71e89cf297a34cb12825a2c3da | [
"MIT"
] | null | null | null | exercises/general/inherit.py | angelptli/my_kivy_journey | 2718e3ef22f67a71e89cf297a34cb12825a2c3da | [
"MIT"
] | null | null | null | exercises/general/inherit.py | angelptli/my_kivy_journey | 2718e3ef22f67a71e89cf297a34cb12825a2c3da | [
"MIT"
] | null | null | null | # File: inherit.py
# Desc: Accommodate python code for inherit colors exercise.
import kivy
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.lang import Builder
Builder.load_file('inherit.kv')
class MyLayout(Widget):
pass
class NiceApp(App):
def build(self):
return MyLayo... | 15.583333 | 60 | 0.703209 |
621a9ec6690e40f99f46d2402203c976ffe84108 | 3,258 | py | Python | examples/batch_mode/08-run_perturb_DEM.py | GBillotey/Fractal-shades | 99c690cb1114ab7edcbfd9836af585fed2b133e8 | [
"MIT"
] | 3 | 2021-03-06T18:32:51.000Z | 2021-07-07T01:35:21.000Z | examples/batch_mode/08-run_perturb_DEM.py | GBillotey/Fractal-shades | 99c690cb1114ab7edcbfd9836af585fed2b133e8 | [
"MIT"
] | null | null | null | examples/batch_mode/08-run_perturb_DEM.py | GBillotey/Fractal-shades | 99c690cb1114ab7edcbfd9836af585fed2b133e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
=============================
DEM example with perturbation
=============================
This example shows how to create a color layer, displaying the
distance estimation for Mandelbrot (power 2) fractal.
The location, at 16.e-22, is below the reach of double, pertubation theory must
be... | 26.92562 | 79 | 0.605586 |
621aa77336e90a50bbf4e093d0a3cd4beaa2d4c2 | 101,934 | py | Python | pytorch/test/distributed/test_distributed.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/test/distributed/test_distributed.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/test/distributed/test_distributed.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import errno
import fcntl
import math
import os
import random
import sys
import time
import tempfile
import unittest
from contextlib import contextmanager
from datetime import timedelta
from functools import reduce, wraps
fro... | 36.223881 | 125 | 0.59824 |
621aaa659092228a130f70fc3451ca03fad5a60c | 5,511 | py | Python | pyVmomi/clone_vm_annotation_added.py | Zhe-Shen/CloudTides | edf51534f62901dcc2e69cbf3fea76e5652b5d17 | [
"Apache-2.0"
] | 3 | 2019-12-07T17:14:39.000Z | 2022-03-31T06:41:51.000Z | pyVmomi/clone_vm_annotation_added.py | Zhe-Shen/CloudTides | edf51534f62901dcc2e69cbf3fea76e5652b5d17 | [
"Apache-2.0"
] | 10 | 2019-12-08T06:37:55.000Z | 2022-02-10T11:41:09.000Z | pyVmomi/clone_vm_annotation_added.py | Zhe-Shen/CloudTides | edf51534f62901dcc2e69cbf3fea76e5652b5d17 | [
"Apache-2.0"
] | 9 | 2020-06-28T01:08:35.000Z | 2020-07-26T03:51:47.000Z | '''
Written by Zhe Shen, 19-11-2
Deploy a VM from a specified template.
'''
from pyVmomi import vim
from pyVim.connect import SmartConnect, SmartConnectNoSSL, Disconnect
import atexit
import argparse
import getpass
def get_args():
""" Get arguments from CLI """
parser = argparse.ArgumentParser(
desc... | 28.703125 | 85 | 0.529668 |
621ac247261c5b804beae2f6f9e9e5e89a517ee1 | 4,999 | py | Python | examples/scripts/ppp/ppp_admm_dmsc.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 217 | 2016-06-13T16:41:26.000Z | 2022-03-22T06:31:05.000Z | examples/scripts/ppp/ppp_admm_dmsc.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 21 | 2016-06-13T23:28:35.000Z | 2022-02-17T23:20:01.000Z | examples/scripts/ppp/ppp_admm_dmsc.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 47 | 2016-12-14T13:08:33.000Z | 2021-12-12T01:59:49.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""
Plug-and-Play ADMM Demosaicing
==============================
This example demonstrates the use of class :clas... | 27.772222 | 244 | 0.664133 |
621aeb804ee38cee30565d0a0fc2bbb5d18734e6 | 1,803 | py | Python | cinderclient/tests/unit/v3/test_default_types.py | deepanshhu/python-cinderclient | 2c0f74c708fd09c5ae813255aaa671073f2fe250 | [
"Apache-1.1"
] | 74 | 2015-01-29T20:10:47.000Z | 2022-03-03T05:09:00.000Z | cinderclient/tests/unit/v3/test_default_types.py | deepanshhu/python-cinderclient | 2c0f74c708fd09c5ae813255aaa671073f2fe250 | [
"Apache-1.1"
] | 6 | 2015-08-10T10:23:42.000Z | 2022-02-16T02:28:22.000Z | cinderclient/tests/unit/v3/test_default_types.py | deepanshhu/python-cinderclient | 2c0f74c708fd09c5ae813255aaa671073f2fe250 | [
"Apache-1.1"
] | 125 | 2015-02-24T11:04:51.000Z | 2021-12-23T01:28:05.000Z | # 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 law or agreed to in... | 38.361702 | 78 | 0.685524 |
621afdf832cb37b0e68e70a3cc779c1f9391c354 | 3,795 | py | Python | keystone/service.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/service.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/service.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | 1 | 2020-07-02T09:12:28.000Z | 2020-07-02T09:12:28.000Z | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 31.890756 | 79 | 0.659289 |
621b16af29898d27543960f86577dba9401e7ee8 | 3,104 | py | Python | sanity/search.py | TIBHannover/arxiv_preserver | aefdacaa9d1c4c13b51e1812e6218c0025ab0a11 | [
"MIT"
] | null | null | null | sanity/search.py | TIBHannover/arxiv_preserver | aefdacaa9d1c4c13b51e1812e6218c0025ab0a11 | [
"MIT"
] | null | null | null | sanity/search.py | TIBHannover/arxiv_preserver | aefdacaa9d1c4c13b51e1812e6218c0025ab0a11 | [
"MIT"
] | null | null | null | from elasticsearch_dsl.connections import connections
from elasticsearch_dsl import Document, Text, Date, Nested, InnerDoc, Q
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
from arxiv_makeover.settings import ES_INDEX
import re
connections.create_connection()
class AuthorIndex(InnerDo... | 22.656934 | 114 | 0.503222 |
621b1f4d39a45147ec88c2deff21a90325cd692d | 47,961 | py | Python | tasks/R2R/follower.py | shuheikurita/glgp | dcd2f261887829fa9a4b96ca56049afd21434674 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2021-11-30T03:49:23.000Z | 2021-11-30T03:49:23.000Z | tasks/R2R/follower.py | shuheikurita/glgp | dcd2f261887829fa9a4b96ca56049afd21434674 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | tasks/R2R/follower.py | shuheikurita/glgp | dcd2f261887829fa9a4b96ca56049afd21434674 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | ''' Agents: stop/random/shortest/seq2seq '''
import json
import sys
import numpy as np
import random
from collections import namedtuple
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.distributions as D
from utils import vocab_pad_idx, vocab_eos_id... | 46.249759 | 234 | 0.58631 |
621b391448dfc714c414cf42f23528daa2de736c | 1,865 | py | Python | Tools/resultsdbpy/resultsdbpy/model/archiver.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/resultsdbpy/resultsdbpy/model/archiver.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/resultsdbpy/resultsdbpy/model/archiver.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (C) 2020 Apple Inc. 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, this list of conditions and the f... | 40.543478 | 79 | 0.741019 |
621b7530d17f1288699044c09e5ffd924bd100fe | 1,501 | py | Python | server/project/api/models.py | charlesfranciscodev/todo-list-flask | 6c9472d071ce76969ccfc1a84dc0057514e1ebd9 | [
"MIT"
] | null | null | null | server/project/api/models.py | charlesfranciscodev/todo-list-flask | 6c9472d071ce76969ccfc1a84dc0057514e1ebd9 | [
"MIT"
] | null | null | null | server/project/api/models.py | charlesfranciscodev/todo-list-flask | 6c9472d071ce76969ccfc1a84dc0057514e1ebd9 | [
"MIT"
] | null | null | null | from project import db
class Todo(db.Model):
__tablename__ = "todos"
todo_id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(255), nullable=False)
content = db.Column(db.Text, nullable=False)
completed = db.Column(db.Boolean, default=False, nullable=False)
due_date = db.C... | 34.113636 | 69 | 0.618254 |
621b85c1af332ef98cec1dc0ce256e10cbdb34b3 | 18,973 | py | Python | tools/pytexttable/texttable.py | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 12 | 2017-06-08T14:19:57.000Z | 2022-03-09T02:48:59.000Z | tools/pytexttable/texttable.py | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 6 | 2017-06-08T13:13:50.000Z | 2020-05-15T09:32:43.000Z | tools/pytexttable/texttable.py | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 3 | 2017-06-30T14:05:06.000Z | 2022-02-17T12:20:45.000Z | #!/usr/bin/env python
#
# texttable - module for creating simple ASCII tables
# Copyright (C) 2003-2015 Gerome Fournier <jef(at)foutaise.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundat... | 31.257002 | 111 | 0.520687 |
621bc765392fbc8049806d3baedb15e8e5aa9c8b | 7,050 | py | Python | anasymod/templates/execute_FPGA_sim.py | SubjeBilisim/anasymod | d93f656c21e2aa238f7a5ada50955cc7dc615df1 | [
"BSD-3-Clause"
] | 20 | 2019-05-14T10:13:44.000Z | 2022-03-29T14:34:50.000Z | anasymod/templates/execute_FPGA_sim.py | SubjeBilisim/anasymod | d93f656c21e2aa238f7a5ada50955cc7dc615df1 | [
"BSD-3-Clause"
] | 43 | 2019-07-16T20:54:22.000Z | 2021-08-10T07:06:48.000Z | anasymod/templates/execute_FPGA_sim.py | SubjeBilisim/anasymod | d93f656c21e2aa238f7a5ada50955cc7dc615df1 | [
"BSD-3-Clause"
] | 5 | 2019-10-21T09:53:38.000Z | 2021-09-29T18:08:59.000Z | from anasymod.templates.templ import JinjaTempl
from anasymod.config import EmuConfig
from anasymod.util import back2fwd
from anasymod.targets import FPGATarget
class TemplEXECUTE_FPGA_SIM(JinjaTempl):
def __init__(self, target: FPGATarget, start_time: float, stop_time: float, server_addr: str):
'''... | 39.606742 | 138 | 0.704113 |
621bc82a2072cad421650a4a88fc9080e26e652b | 17,732 | py | Python | mccd/proxs.py | aziz-ayed/mccd | 8bfd090981360761f607040167bff87e46e3d5bc | [
"MIT"
] | 1 | 2021-02-10T13:34:34.000Z | 2021-02-10T13:34:34.000Z | mccd/proxs.py | aziz-ayed/mccd | 8bfd090981360761f607040167bff87e46e3d5bc | [
"MIT"
] | 2 | 2021-04-30T10:14:34.000Z | 2021-05-18T14:01:31.000Z | mccd/proxs.py | aziz-ayed/mccd | 8bfd090981360761f607040167bff87e46e3d5bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
r"""PROXIMAL OPERATORS.
Defines proximal operators to be fed to ModOpt algorithm that are
specific to MCCD(or rather, not currently in ``modopt.opt.proximity``).
: Authors: Tobias Liaudat <tobiasliaudat@gmail.com>,
Morgan Schmitz <github @MorganSchmitz>
"""
from __future__ import... | 33.775238 | 125 | 0.60388 |
621bd238ca81536d23da656131a8e06329ec5d43 | 1,178 | py | Python | cadnano/fileio/decode.py | sherwoodyao/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 69 | 2015-01-13T02:54:40.000Z | 2022-03-27T14:25:51.000Z | cadnano/fileio/decode.py | scholer/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 127 | 2015-01-01T06:26:34.000Z | 2022-03-02T12:48:05.000Z | cadnano/fileio/decode.py | scholer/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 48 | 2015-01-22T19:57:49.000Z | 2022-03-27T14:27:53.000Z | # -*- coding: utf-8 -*-
import json
import io
import os.path
import cadnano.fileio.v2decode as v2decode
import cadnano.fileio.c25decode as c25decode
import cadnano.fileio.v3decode as v3decode
from cadnano.cntypes import (
DocT
)
def decodeFile( filename: str,
document: DocT = None,
... | 28.731707 | 75 | 0.66893 |
621bf324946a88ea230470aebae89b1a6b20f6b0 | 2,795 | py | Python | tests/integration/pipeline/test_init_command.py | elbayaaa/aws-sam-cli | f8f65f8601116e0c8d2570ed75359be57e86b207 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | tests/integration/pipeline/test_init_command.py | elbayaaa/aws-sam-cli | f8f65f8601116e0c8d2570ed75359be57e86b207 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | tests/integration/pipeline/test_init_command.py | elbayaaa/aws-sam-cli | f8f65f8601116e0c8d2570ed75359be57e86b207 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | from pathlib import Path
from tests.integration.pipeline.base import InitIntegBase
from tests.testing_utils import run_command_with_inputs
QUICK_START_JENKINS_INPUTS = [
"1", # quick start
"1", # jenkins, this depends on the template repo.
"credential-id",
"main",
"template.yaml",
"test",
... | 35.833333 | 120 | 0.702683 |
621bf568a533473e6b9c5466a67e2443bb33f17f | 536 | py | Python | test/dom/html/test_script.py | jkloth/pyxml | de15b3ad0fe095f6ce36b1c5ad7438046aae8d3d | [
"MIT"
] | 2 | 2018-05-28T23:01:20.000Z | 2018-05-29T03:59:38.000Z | test/dom/html/test_script.py | jkloth/pyxml | de15b3ad0fe095f6ce36b1c5ad7438046aae8d3d | [
"MIT"
] | null | null | null | test/dom/html/test_script.py | jkloth/pyxml | de15b3ad0fe095f6ce36b1c5ad7438046aae8d3d | [
"MIT"
] | null | null | null | from util import testAttribute
from util import testIntAttribute
def test():
print 'testing source code syntax'
from xml.dom.html import HTMLScriptElement
from xml.dom import implementation
doc = implementation.createHTMLDocument('Title')
s = doc.createElement('SCRIPT')
print "testing get/set"... | 22.333333 | 52 | 0.697761 |
621c02b038bd6c9fe4e036bfc6962c43d04aa933 | 7,750 | py | Python | mogp_emulator/linalg/cholesky.py | alan-turing-institute/mogp-emulator | 41c3615dd2b51222b00f1e85c48f82d128c99003 | [
"MIT"
] | 21 | 2021-01-20T07:02:12.000Z | 2022-03-30T21:09:04.000Z | mogp_emulator/linalg/cholesky.py | alan-turing-institute/mogp_emulator | 41c3615dd2b51222b00f1e85c48f82d128c99003 | [
"MIT"
] | 114 | 2019-04-25T14:53:11.000Z | 2021-01-06T17:07:41.000Z | mogp_emulator/linalg/cholesky.py | alan-turing-institute/mogp-emulator | 41c3615dd2b51222b00f1e85c48f82d128c99003 | [
"MIT"
] | 8 | 2021-02-02T08:56:12.000Z | 2022-02-15T10:03:15.000Z | import numpy as np
from scipy import linalg
from scipy.linalg import lapack, cho_solve
def _check_cholesky_inputs(A):
"""
Check inputs to cholesky routines
This function is used by both specialized Cholesky routines to check inputs. It verifies
that the input is a 2D square matrix and that all diagona... | 41.005291 | 102 | 0.67871 |
621c3a91f4ae5ca9471bb5c2fe9a90cf90270ca0 | 446 | py | Python | alipay/aop/api/response/AlipayIserviceCcmRoleDeleteResponse.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/response/AlipayIserviceCcmRoleDeleteResponse.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/response/AlipayIserviceCcmRoleDeleteResponse.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.response.AlipayResponse import AlipayResponse
class AlipayIserviceCcmRoleDeleteResponse(AlipayResponse):
def __init__(self):
super(AlipayIserviceCcmRoleDeleteResponse, self).__init__()
def parse_response_content(self, re... | 27.875 | 108 | 0.782511 |
621c4eab2f71f128a2647e1b037af415852652be | 2,453 | py | Python | src/morphforge/core/__init__.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | 1 | 2021-01-21T11:31:59.000Z | 2021-01-21T11:31:59.000Z | src/morphforge/core/__init__.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | src/morphforge/core/__init__.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | 36.61194 | 73 | 0.717081 |
621c7c74b3c9330384e4e488d0bb3c7d55a38a37 | 10,403 | py | Python | doc/conf.py | alpinedatalabs/python-alpine-api | 2f74e4eeb7cb6d2b4f2d73db90e8c4afc552d1e7 | [
"MIT"
] | null | null | null | doc/conf.py | alpinedatalabs/python-alpine-api | 2f74e4eeb7cb6d2b4f2d73db90e8c4afc552d1e7 | [
"MIT"
] | 8 | 2017-03-07T01:23:22.000Z | 2019-10-24T22:45:46.000Z | doc/conf.py | alpinedatalabs/python-alpine-api | 2f74e4eeb7cb6d2b4f2d73db90e8c4afc552d1e7 | [
"MIT"
] | 3 | 2017-03-13T11:15:19.000Z | 2019-03-24T21:47:05.000Z | #import sphinx_bootstrap_theme
# -*- coding: utf-8 -*-
#
# Alpine SDK documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 26 11:36:41 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present ... | 28.897222 | 80 | 0.697779 |
621ca4aedb2ee14eed995a2d303c762e785899e5 | 4,125 | py | Python | test/sumo/test_modes/test_prepare/test_similarity.py | ratan-lab/sumo | 61fd9513ed486f255906ee800d2825a8d89ddfac | [
"MIT"
] | 7 | 2019-11-08T00:31:05.000Z | 2021-06-14T13:44:22.000Z | test/sumo/test_modes/test_prepare/test_similarity.py | ratan-lab/sumo | 61fd9513ed486f255906ee800d2825a8d89ddfac | [
"MIT"
] | 16 | 2019-09-16T21:38:43.000Z | 2021-06-04T16:09:31.000Z | test/sumo/test_modes/test_prepare/test_similarity.py | ratan-lab/sumo | 61fd9513ed486f255906ee800d2825a8d89ddfac | [
"MIT"
] | null | null | null | from numba.core.errors import TypingError
from sumo.modes.prepare import similarity
from sumo.utils import check_matrix_symmetry
from sumo.constants import SIMILARITY_METHODS
import numpy as np
import pytest
def _test_assumptions_no_numba(func):
with pytest.raises(AssertionError):
func(np.array([1]), np.a... | 37.844037 | 119 | 0.682424 |
621cb8d2008cae241e1635728186b3a59f8e1269 | 2,205 | py | Python | nbiapi/project.py | 5g-media/mape-executor | bac6509acbb98c15c9295b5da67435a8528cccd8 | [
"Apache-2.0"
] | null | null | null | nbiapi/project.py | 5g-media/mape-executor | bac6509acbb98c15c9295b5da67435a8528cccd8 | [
"Apache-2.0"
] | 2 | 2020-04-14T20:22:38.000Z | 2020-04-14T20:22:39.000Z | nbiapi/project.py | 5g-media/mape-executor | bac6509acbb98c15c9295b5da67435a8528cccd8 | [
"Apache-2.0"
] | null | null | null | from settings import OSM_COMPONENTS, LOGGING
from httpclient.client import Client
import logging.config
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
logging.config.dictConfig(LOGGING)
logger = logging.getLogger("osm")
class Project(object):
"""Description of Project class"""... | 38.017241 | 114 | 0.634921 |
621cbb6a35724ffc7740103dd0d643137ee97400 | 4,100 | py | Python | alipay/aop/api/request/AlipayFinanceQuotationQuotetradeSnapshotBatchqueryRequest.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/AlipayFinanceQuotationQuotetradeSnapshotBatchqueryRequest.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/AlipayFinanceQuotationQuotetradeSnapshotBatchqueryRequest.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.AlipayFinanceQuotationQuotetradeSnapshotBatchqueryModel import AlipayFinanceQuotationQuotetradeSnapshotBatchqueryModel
class AlipayF... | 28.275862 | 148 | 0.65561 |
621cc05488eeb5336ca8390f3728ba305072eb2c | 11,403 | py | Python | plugin/core/sessions.py | mrbrian/LSP | 72ea25a57fe31eed1466a610ac59be9cac105793 | [
"MIT"
] | null | null | null | plugin/core/sessions.py | mrbrian/LSP | 72ea25a57fe31eed1466a610ac59be9cac105793 | [
"MIT"
] | null | null | null | plugin/core/sessions.py | mrbrian/LSP | 72ea25a57fe31eed1466a610ac59be9cac105793 | [
"MIT"
] | null | null | null | from .types import ClientConfig, ClientStates, Settings
from .protocol import Request, Notification
from .transports import start_tcp_transport, start_tcp_listener, TCPTransport, Transport
from .rpc import Client, attach_stdio_client, Response
from .process import start_server
from .logging import debug
import os
impor... | 40.43617 | 109 | 0.574059 |
621cc108c92e3fdca872c42c222359defb9753e5 | 1,938 | py | Python | nova/scheduler/filters/pci_passthrough_filter.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/scheduler/filters/pci_passthrough_filter.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 1 | 2016-04-04T18:41:59.000Z | 2016-04-04T18:41:59.000Z | nova/scheduler/filters/pci_passthrough_filter.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Copyright (c) 2013 ISP RAS.
# 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 ... | 35.888889 | 78 | 0.672859 |
621cca97d1fdde2f807635c560a5bd206138dc6f | 1,374 | py | Python | app/data/db.py | admiralobvious/falcon-boilerplate | eb076ff9e1d6fb1e537b18f86d2228afbf123e19 | [
"MIT"
] | 34 | 2016-10-26T17:19:23.000Z | 2020-04-30T09:12:34.000Z | app/data/db.py | admiralobvious/falcon-boilerplate | eb076ff9e1d6fb1e537b18f86d2228afbf123e19 | [
"MIT"
] | 2 | 2019-04-09T11:50:38.000Z | 2019-07-05T03:31:57.000Z | app/data/db.py | admiralobvious/falcon-boilerplate | eb076ff9e1d6fb1e537b18f86d2228afbf123e19 | [
"MIT"
] | 12 | 2017-01-14T09:40:24.000Z | 2020-04-16T07:40:56.000Z | from __future__ import annotations
from datetime import datetime
from typing import Any, Dict, List
from xid import XID
def setup(clear: bool = False) -> _InMemDB:
if clear is True:
global _data
_data = {}
return _InMemDB()
_data = {
"users": [
{
"id": XID("bsqoofff... | 23.689655 | 67 | 0.555313 |
621cd3116a536339950f2faf14bf5f01f5f8f95c | 5,111 | py | Python | feincms3/regions.py | fabiangermann/feincms3 | 568ffd1fa939071a4d6dfae0a70568d1522aaa9e | [
"BSD-3-Clause"
] | null | null | null | feincms3/regions.py | fabiangermann/feincms3 | 568ffd1fa939071a4d6dfae0a70568d1522aaa9e | [
"BSD-3-Clause"
] | null | null | null | feincms3/regions.py | fabiangermann/feincms3 | 568ffd1fa939071a4d6dfae0a70568d1522aaa9e | [
"BSD-3-Clause"
] | null | null | null | from collections import deque
from functools import wraps
from django.core.cache import cache
from django.utils.functional import SimpleLazyObject
from django.utils.html import mark_safe
from content_editor.contents import contents_for_item
__all__ = ("Regions", "matches", "cached_render")
def cached_render(fn):
... | 35.741259 | 85 | 0.63647 |
621cd85f7d487593a9508c650a8134fba8c0c54d | 10,722 | py | Python | myia/pipeline/resources.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 222 | 2019-02-13T07:56:28.000Z | 2022-03-28T07:07:54.000Z | myia/pipeline/resources.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 107 | 2019-02-12T21:56:39.000Z | 2022-03-12T01:08:03.000Z | myia/pipeline/resources.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 27 | 2017-11-14T17:58:15.000Z | 2019-01-14T01:36:09.000Z | """Pipeline resources."""
from types import FunctionType
import numpy as np
from ovld import ovld
from .. import parser, xtype
from ..abstract import InferenceEngine, LiveInferenceEngine, type_to_abstract
from ..compile import load_backend
from ..ir import Graph, clone
from ..monomorphize import Monomorphizer
from .... | 29.53719 | 79 | 0.595505 |
621cf66a00c93a928e91b25a0faf73859a9c5765 | 1,445 | py | Python | custom_components/script_engine/decorator/default/if_state.py | jkCXf9X4/hass_script_engine | d2a64071eaa484478fc862cbdab147af6b4381a6 | [
"Apache-2.0"
] | null | null | null | custom_components/script_engine/decorator/default/if_state.py | jkCXf9X4/hass_script_engine | d2a64071eaa484478fc862cbdab147af6b4381a6 | [
"Apache-2.0"
] | 4 | 2021-12-14T08:12:01.000Z | 2022-02-01T13:53:41.000Z | custom_components/script_engine/decorator/default/if_state.py | jkCXf9X4/hass_script_engine | d2a64071eaa484478fc862cbdab147af6b4381a6 | [
"Apache-2.0"
] | null | null | null |
from typing import Any, Callable, Optional
from custom_components.script_engine.decorator.abc.state import State
from custom_components.script_engine.hass.extension.state import StateExt
class IfState(State):
"""
Decorator that checks if a state is valid
"""
def __init__(self,
id: str,
... | 32.111111 | 73 | 0.605536 |
621cfa171b334ba4a0b127190dd5a464d072b6d3 | 11,620 | py | Python | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_models.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_models.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_models.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from ._shared import parse_key_vault_id
try:
from typing import TYPE_CHECKING
except ImportError:
TYPE_CHECKING = False
if TYPE_CHECKING:
# pylint:disable=... | 29.56743 | 119 | 0.610069 |
621d0f3e2584f5fbf37c729c4e00477cec532f7a | 60,634 | py | Python | aftltool_test.py | TinkerBoard2-Android/external-avb | 5a2b0ed1b6e360303642ee05e970373fb86ca253 | [
"MIT"
] | null | null | null | aftltool_test.py | TinkerBoard2-Android/external-avb | 5a2b0ed1b6e360303642ee05e970373fb86ca253 | [
"MIT"
] | null | null | null | aftltool_test.py | TinkerBoard2-Android/external-avb | 5a2b0ed1b6e360303642ee05e970373fb86ca253 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright 2019, The Android Open Source Project
#
# 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 us... | 39.423927 | 84 | 0.697975 |
621d5f5337c047e7cafe78bec0e319fbeb9bcbe3 | 1,906 | py | Python | alipay/aop/api/domain/AlipayOpenSpIsvRelationQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOpenSpIsvRelationQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOpenSpIsvRelationQueryModel.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 AlipayOpenSpIsvRelationQueryModel(object):
def __init__(self):
self._commodity_id = None
self._page_num = None
self._page_size = None
@property
def commodity_id(s... | 26.84507 | 75 | 0.591815 |
621d6894aef5f25ba77bd82e9a98b014fe05ab02 | 2,032 | py | Python | chaospy/distributions/collection/__init__.py | lblonk/chaospy | 1759a4307c6134b74ce63ff44973195f1e185f94 | [
"MIT"
] | null | null | null | chaospy/distributions/collection/__init__.py | lblonk/chaospy | 1759a4307c6134b74ce63ff44973195f1e185f94 | [
"MIT"
] | null | null | null | chaospy/distributions/collection/__init__.py | lblonk/chaospy | 1759a4307c6134b74ce63ff44973195f1e185f94 | [
"MIT"
] | null | null | null | from .alpha import Alpha
from .anglit import Anglit
from .beta import Beta, ArcSinus, PowerLaw, Wigner, PERT
from .binomial import Binomial
from .bradford import Bradford
from .burr import Burr
from .cauchy import Cauchy
from .chi import Chi, Maxwell, Rayleigh
from .chi_squared import ChiSquared
from .discrete_uniform ... | 35.649123 | 62 | 0.854331 |
621d7205df90b78876ac2e6a9c7c4d3aee600214 | 9,605 | py | Python | TA-zscaler-api/bin/ta_zscaler_api/aob_py3/splunktaucclib/alert_actions_base.py | LetMeR00t/TA-zscaler-api | 9a2cee3954bf75a814bb057cf36eb2b2b4c093f6 | [
"MIT"
] | 4 | 2022-03-04T11:11:30.000Z | 2022-03-07T09:55:07.000Z | TA-zscaler-api/bin/ta_zscaler_api/aob_py3/splunktaucclib/alert_actions_base.py | LetMeR00t/TA-zscaler-api | 9a2cee3954bf75a814bb057cf36eb2b2b4c093f6 | [
"MIT"
] | null | null | null | TA-zscaler-api/bin/ta_zscaler_api/aob_py3/splunktaucclib/alert_actions_base.py | LetMeR00t/TA-zscaler-api | 9a2cee3954bf75a814bb057cf36eb2b2b4c093f6 | [
"MIT"
] | null | null | null | #
# Copyright 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 32.559322 | 87 | 0.569703 |
621d77f100d11bd8e82276b844e46d38a73ef807 | 8,787 | py | Python | lampe/data.py | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 | [
"MIT"
] | 3 | 2022-03-20T19:23:27.000Z | 2022-03-25T06:55:28.000Z | lampe/data.py | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 | [
"MIT"
] | null | null | null | lampe/data.py | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 | [
"MIT"
] | null | null | null | r"""Datasets and data loaders."""
import h5py
import numpy as np
import random
import torch
from bisect import bisect
from numpy import ndarray as Array
from pathlib import Path
from torch import Tensor, Size
from torch.distributions import Distribution
from torch.utils.data import DataLoader, Dataset, IterableDatase... | 32.305147 | 87 | 0.571412 |
621dc09930d99f439c71413b6f2aa2e9de54331a | 1,466 | py | Python | homeassistant/components/vera/binary_sensor.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/vera/binary_sensor.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | homeassistant/components/vera/binary_sensor.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """Support for Vera binary sensors."""
import logging
from typing import Callable, List
from homeassistant.components.binary_sensor import (
DOMAIN as PLATFORM_DOMAIN,
ENTITY_ID_FORMAT,
BinarySensorDevice,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
f... | 28.192308 | 70 | 0.706685 |
621dc8596c76518595563f28ae758fc0a5abae37 | 2,534 | py | Python | src/modules/udp/tftp.py | The-Cracker-Technology/nullscan | 47fb41f17c59201a0d65a14705b4ff95fcc50a03 | [
"MIT"
] | 46 | 2020-04-18T16:42:59.000Z | 2022-01-31T22:08:52.000Z | src/modules/udp/tftp.py | The-Cracker-Technology/nullscan | 47fb41f17c59201a0d65a14705b4ff95fcc50a03 | [
"MIT"
] | null | null | null | src/modules/udp/tftp.py | The-Cracker-Technology/nullscan | 47fb41f17c59201a0d65a14705b4ff95fcc50a03 | [
"MIT"
] | 11 | 2020-04-23T12:46:18.000Z | 2022-02-04T12:53:50.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*- ########################################################
# ____ _ __ #
# ___ __ __/ / /__ ___ ______ ______(_) /___ __ #
# / _ \/ // / / (_-</ -_) __/ // / __/ / __/ // / ... | 30.166667 | 80 | 0.348066 |
621ddbf432b876e81ea76b37909e732140ac18bf | 4,214 | py | Python | dopamine/thesis/memory/offline_memory.py | xqz-u/dopamine | d562750a58bcf681a6f8b590f4e4dfb263654b5e | [
"Apache-2.0"
] | null | null | null | dopamine/thesis/memory/offline_memory.py | xqz-u/dopamine | d562750a58bcf681a6f8b590f4e4dfb263654b5e | [
"Apache-2.0"
] | null | null | null | dopamine/thesis/memory/offline_memory.py | xqz-u/dopamine | d562750a58bcf681a6f8b590f4e4dfb263654b5e | [
"Apache-2.0"
] | null | null | null | from concurrent import futures
from typing import List
import numpy as np
from dopamine.replay_memory.circular_replay_buffer import OutOfGraphReplayBuffer
from thesis import utils
# NOTE the idea behind creating a new class for offline memory was
# originally that it could share some core functionality with its
# pr... | 37.963964 | 135 | 0.662791 |
621de39e5c0553fe1244ff996c6ccdba30813907 | 19,990 | py | Python | server/routes/api/landing_page.py | chejennifer/website | b7589f1fa288e0e4e12cd97a6bbbcb9f3fd3d833 | [
"Apache-2.0"
] | null | null | null | server/routes/api/landing_page.py | chejennifer/website | b7589f1fa288e0e4e12cd97a6bbbcb9f3fd3d833 | [
"Apache-2.0"
] | null | null | null | server/routes/api/landing_page.py | chejennifer/website | b7589f1fa288e0e4e12cd97a6bbbcb9f3fd3d833 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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, ... | 37.575188 | 126 | 0.588544 |
621e3c1d2364c0ef8637ba110943428e17c2813f | 680 | py | Python | helpsocial/routing/worker.py | helpsocial/API_Scripts | 8ca7e08d2be0691e8ae21937c1423831e5caac91 | [
"MIT"
] | null | null | null | helpsocial/routing/worker.py | helpsocial/API_Scripts | 8ca7e08d2be0691e8ae21937c1423831e5caac91 | [
"MIT"
] | null | null | null | helpsocial/routing/worker.py | helpsocial/API_Scripts | 8ca7e08d2be0691e8ae21937c1423831e5caac91 | [
"MIT"
] | null | null | null | # Author: Jacob Schofield <jacob@helpsocial.com>
# Copyright (c) 2017 HelpSocial, Inc.
# See LICENSE for details
import json
import os
class Worker(object):
"""
TODO
"""
def __init__(self, name=None):
if name is None:
name = 'Worker-' + os.urandom(4).hex()
self.name = name... | 17.894737 | 60 | 0.527941 |
621e44a19e68e2570951c42074d1b322a3a32afa | 1,631 | py | Python | algorithm/python/heap_sort.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | algorithm/python/heap_sort.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | null | null | null | algorithm/python/heap_sort.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | #################################################################
# ALGORITHM DEMO : HEAP SORT
#################################################################
# V0
# V1
def heapify(unsorted, index, heap_size):
largest = index
left_index = 2 * index + 1
right_index = 2 * index + 2
if left_index < he... | 31.365385 | 79 | 0.560392 |
621e4e4c0b57fb1b425c98a15789298004d4d688 | 1,951 | py | Python | scripts/dtriac-534/build_vnc_dict.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | null | null | null | scripts/dtriac-534/build_vnc_dict.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | 26 | 2019-09-16T16:17:52.000Z | 2020-02-21T18:19:26.000Z | scripts/dtriac-534/build_vnc_dict.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
import os
import sys
import json
import lif
def create_dict(lif_dir):
"""
Create a verbnet class dictionary, given a directory of LIF json files
The dictionary will record all verb instances annotated with
"SemanticTag (type: VerbNetClass)" in *.lif files inside the directory.
... | 43.355556 | 119 | 0.617119 |
621e733d5fc53410b65087214cb210ba83a3eb36 | 11,755 | py | Python | moma_django/query.py | gadio/moma-django | 13265379be1dbab18697e5f42f38b3b37f928aa9 | [
"Apache-2.0"
] | 12 | 2015-03-29T05:31:25.000Z | 2019-06-13T16:17:37.000Z | moma_django/query.py | antoniotaranto/moma-django | 13265379be1dbab18697e5f42f38b3b37f928aa9 | [
"Apache-2.0"
] | 8 | 2015-09-04T21:00:50.000Z | 2021-06-10T17:39:44.000Z | moma_django/query.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://... | 36.506211 | 125 | 0.58758 |
621e78f09f0d9999400c11b98e508cc8877b2ede | 8,338 | py | Python | databricks/final - simple steps to distributed deep learning.py | j143/notebooks | 1e0d101bd1028c7243c961e6392012e398b48b85 | [
"Apache-2.0"
] | 1 | 2022-01-01T15:52:37.000Z | 2022-01-01T15:52:37.000Z | databricks/final - simple steps to distributed deep learning.py | j143/notebooks | 1e0d101bd1028c7243c961e6392012e398b48b85 | [
"Apache-2.0"
] | 18 | 2020-06-15T03:27:36.000Z | 2022-01-27T17:27:13.000Z | databricks/final - simple steps to distributed deep learning.py | j143/notebooks | 1e0d101bd1028c7243c961e6392012e398b48b85 | [
"Apache-2.0"
] | null | null | null | # Databricks notebook source
# MAGIC %md
# MAGIC ##### This notebook has the following requirements:
# MAGIC * Use a DBR 5.2 ML cluster.
# MAGIC * Install pyarrow v0.12 on the cluster. Pyarrow is available as a pypi package which can be installed using [workspace libraries](https://docs.databricks.com/user-guide/librar... | 32.698039 | 375 | 0.700648 |
621e8f5588b1a4cfc0817d201cc23308c57297bc | 64,617 | py | Python | qcdb/libmintsbasisset.py | nuwandesilva/qcdb | b47fb2ed550fc4176198ddb1dbea3724d6704d23 | [
"BSD-3-Clause"
] | null | null | null | qcdb/libmintsbasisset.py | nuwandesilva/qcdb | b47fb2ed550fc4176198ddb1dbea3724d6704d23 | [
"BSD-3-Clause"
] | null | null | null | qcdb/libmintsbasisset.py | nuwandesilva/qcdb | b47fb2ed550fc4176198ddb1dbea3724d6704d23 | [
"BSD-3-Clause"
] | null | null | null | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | 40.974635 | 175 | 0.556742 |
621eb5f16ee87b78cf73270aeea63d0712784ea0 | 2,540 | py | Python | scripts/plotting/vehicles_churn_plot.py | dcs-chalmers/dataloc_vn | 3c4244a1ea41125c80756a7c8f4789c92fdba694 | [
"Apache-2.0"
] | null | null | null | scripts/plotting/vehicles_churn_plot.py | dcs-chalmers/dataloc_vn | 3c4244a1ea41125c80756a7c8f4789c92fdba694 | [
"Apache-2.0"
] | null | null | null | scripts/plotting/vehicles_churn_plot.py | dcs-chalmers/dataloc_vn | 3c4244a1ea41125c80756a7c8f4789c92fdba694 | [
"Apache-2.0"
] | null | null | null | from latexify import latexify
latexify(columns = 1)
from matplotlib import pyplot as plt
def load_dat(filename, axis=1):
with open(filename, "r") as f:
return [float(line.split()[axis]) for line in f.readlines()]
def moving_average(data, m=5):
return [sum(data[i:i+m])/len(data[i:i+m]) for i in range(... | 27.912088 | 91 | 0.580709 |
621eca52bc55ef7a86b27309643c17ad2468f0aa | 1,402 | py | Python | src/python/scraper/__init__.py | rockmind/LoveAndMarriage | 2877d6af626eff2a3134a05ab7f03c52f14fde5c | [
"Apache-2.0"
] | null | null | null | src/python/scraper/__init__.py | rockmind/LoveAndMarriage | 2877d6af626eff2a3134a05ab7f03c52f14fde5c | [
"Apache-2.0"
] | 1 | 2021-12-18T16:07:39.000Z | 2021-12-18T16:07:39.000Z | src/python/scraper/__init__.py | rockmind/LoveAndMarriage | 2877d6af626eff2a3134a05ab7f03c52f14fde5c | [
"Apache-2.0"
] | null | null | null | import uvicorn
from jsonrpcserver import Result, Success, method, Error
from os import getenv
from services.base_app.base_app import get_base_rpc_app
from scraper.scrapers import scrap_historical_data as historical_data_scrap
from scraper.scrapers import scrap_actual_data as actual_data_scrap
from scraper.scrapers imp... | 29.829787 | 95 | 0.719686 |
621eed0eeffa955e7957b75cec60af0f4f5f05d4 | 5,146 | py | Python | biostar/recipes/management/commands/api.py | Abhijitpatil19/biostar-central | 69c5a1b8296d0d1f9c9b23ecef011595fcd3d485 | [
"MIT"
] | null | null | null | biostar/recipes/management/commands/api.py | Abhijitpatil19/biostar-central | 69c5a1b8296d0d1f9c9b23ecef011595fcd3d485 | [
"MIT"
] | null | null | null | biostar/recipes/management/commands/api.py | Abhijitpatil19/biostar-central | 69c5a1b8296d0d1f9c9b23ecef011595fcd3d485 | [
"MIT"
] | null | null | null | import hjson
import logging
import sys
import os
from urllib.parse import urljoin
import requests
from django.core.management.base import BaseCommand
from django.shortcuts import reverse
from biostar.recipes.api import tabular_list
from biostar.recipes import auth
from biostar.recipes.models import Project, Analysis
... | 28.274725 | 86 | 0.608434 |
621f15458bdac40c1ad7c8565856ce037dbf135d | 7,299 | py | Python | src/python/pants/help/help_info_extracter_test.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | src/python/pants/help/help_info_extracter_test.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | null | null | null | src/python/pants/help/help_info_extracter_test.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import unittest
from enum import Enum
from pants.help.help_info_extracter import HelpInfoExtracter
from pants.option.config import Config
from pants.option.global_options import GlobalOpt... | 42.190751 | 100 | 0.530347 |
621f2aa1f2d94ef716a4031335360bf03112ac3a | 3,322 | py | Python | experiments/train/TUM-GAID/train_155.py | rubende/mupeg | e10a3a890d7ce78593ed2775a482e9d023af350e | [
"MIT"
] | 2 | 2020-03-20T11:46:51.000Z | 2021-06-21T16:00:24.000Z | experiments/train/TUM-GAID/train_155.py | rubende/mupeg | e10a3a890d7ce78593ed2775a482e9d023af350e | [
"MIT"
] | 3 | 2020-11-13T17:45:36.000Z | 2022-02-09T23:36:40.000Z | experiments/train/TUM-GAID/train_155.py | rubende/mupeg | e10a3a890d7ce78593ed2775a482e9d023af350e | [
"MIT"
] | 2 | 2021-02-04T11:43:57.000Z | 2021-11-29T18:10:25.000Z | import tensorflow as tf
from keras.callbacks import ReduceLROnPlateau
import os
import random
from numpy.random import seed
from tensorflow import set_random_seed
import math
import importlib
ModelTUM = importlib.import_module('common.Model')
createDatasetRecordTUM = importlib.import_module('common.createDatasetRecord... | 34.247423 | 199 | 0.65894 |
621f4ae8730ba84428e8ec49c471fd86d9b0cf3f | 4,897 | py | Python | hiicart/gateway/amazon/views.py | kbourgoin/hiicart | 151d64be60ffa5e09b4abc21bf42fd235bf87eea | [
"MIT"
] | null | null | null | hiicart/gateway/amazon/views.py | kbourgoin/hiicart | 151d64be60ffa5e09b4abc21bf42fd235bf87eea | [
"MIT"
] | 5 | 2020-10-29T01:05:05.000Z | 2020-10-29T01:05:19.000Z | hiicart/gateway/amazon/views.py | kbourgoin/hiicart | 151d64be60ffa5e09b4abc21bf42fd235bf87eea | [
"MIT"
] | null | null | null | import logging
import pprint
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_view_exempt
from hiicart.gateway.amazon.ipn import AmazonIPN
from hiicart.gateway.base import GatewayError
f... | 47.543689 | 105 | 0.706963 |
621f52305a4680d6d0776dda39e45ba9471d3227 | 1,032 | py | Python | src/event_stream/event_stream.py | hvuhsg/yoyocoin | aad0f413479728dc4e0842447cf1910e5dff1418 | [
"MIT"
] | 11 | 2021-05-25T07:42:27.000Z | 2022-01-03T07:46:38.000Z | src/event_stream/event_stream.py | hvuhsg/yoyocoin | aad0f413479728dc4e0842447cf1910e5dff1418 | [
"MIT"
] | 18 | 2021-05-25T17:42:46.000Z | 2021-09-13T15:14:38.000Z | src/event_stream/event_stream.py | hvuhsg/yoyocoin | aad0f413479728dc4e0842447cf1910e5dff1418 | [
"MIT"
] | 5 | 2021-06-23T17:38:51.000Z | 2022-03-03T12:40:53.000Z | from collections import defaultdict
from .multi_subscribers_queue import MultiSubscribersQueue
from .event import Event
class EventStream:
_instance = None
@classmethod
def get_instance(cls):
if cls._instance is None:
raise RuntimeError(f"{cls.__name__} is not initialized.")
... | 25.8 | 88 | 0.662791 |
621f7e6f034efbeb5d6dbfadb1ac2bc4400f4e6a | 276 | py | Python | setup.py | vrtsig/hashsplit | ae4ec0395efc48b2bdc9543e44ce4a20102f9dc4 | [
"MIT"
] | null | null | null | setup.py | vrtsig/hashsplit | ae4ec0395efc48b2bdc9543e44ce4a20102f9dc4 | [
"MIT"
] | null | null | null | setup.py | vrtsig/hashsplit | ae4ec0395efc48b2bdc9543e44ce4a20102f9dc4 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='HashSplit',
version='0.1.0',
author='Fabian Peters',
author_email='vrtsig@users.noreply.github.com',
packages=['hashsplit'],
license='LICENSE',
description='hash-based cross validators for sklearn',
)
| 23 | 58 | 0.684783 |
621f8f47225d01c0d7412e3e66d838f1c50be9f6 | 2,429 | py | Python | installer/core/commands/install.py | Diffblue-benchmarks/pacbot | 4709eb11f87636bc42a52e7a76b740f9d76d156d | [
"Apache-2.0"
] | 1 | 2019-10-03T09:55:00.000Z | 2019-10-03T09:55:00.000Z | installer/core/commands/install.py | Diffblue-benchmarks/pacbot | 4709eb11f87636bc42a52e7a76b740f9d76d156d | [
"Apache-2.0"
] | 38 | 2020-03-04T23:28:22.000Z | 2021-12-14T21:33:30.000Z | installer/core/commands/install.py | Diffblue-benchmarks/pacbot | 4709eb11f87636bc42a52e7a76b740f9d76d156d | [
"Apache-2.0"
] | 1 | 2020-01-14T09:10:10.000Z | 2020-01-14T09:10:10.000Z | from core.commands import BaseCommand
from core.config import Settings
from core import constants as K
import importlib
class Install(BaseCommand):
"""
Base install class which identify actual provide install class and execute installation
Attributes:
terraform_with_targets (Boolean): Identify wh... | 36.80303 | 116 | 0.656649 |
621f94dff4b4196dc738a1e89812b075757b78fd | 3,531 | py | Python | jina/helloworld/multimodal/app.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | null | null | null | jina/helloworld/multimodal/app.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | null | null | null | jina/helloworld/multimodal/app.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | null | null | null | import os
import urllib.request
import webbrowser
import zipfile
from pathlib import Path
from jina import Flow
from jina.importer import ImportExtensions
from jina.logging.predefined import default_logger
from jina.logging.profile import ProgressBar
from jina.parsers.helloworld import set_hw_multimodal_parser
from ji... | 31.526786 | 86 | 0.640329 |
621f988a1076098e2a1ca17520e29c06af0ad5d6 | 895 | py | Python | atom/nucleus/python/test/test_page_application.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_page_application.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_page_application.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.5
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nucleus_api
from nu... | 21.829268 | 85 | 0.706145 |
621fa4fd6c77128b4efab15903ce6e446ef82f41 | 6,006 | py | Python | tests/test_multiprocess.py | tanbro/sqlalchemy-dlock | 9deadeb89f90d2a7512e9de8b038e0261604ba20 | [
"BSD-3-Clause"
] | null | null | null | tests/test_multiprocess.py | tanbro/sqlalchemy-dlock | 9deadeb89f90d2a7512e9de8b038e0261604ba20 | [
"BSD-3-Clause"
] | 2 | 2022-03-14T08:56:06.000Z | 2022-03-23T06:57:03.000Z | tests/test_multiprocess.py | tanbro/sqlalchemy-dlock | 9deadeb89f90d2a7512e9de8b038e0261604ba20 | [
"BSD-3-Clause"
] | null | null | null | from contextlib import closing
from multiprocessing import Barrier, Process
from time import sleep, time
from unittest import TestCase
from uuid import uuid4
from sqlalchemy_dlock import sadlock
from .engines import ENGINES
class MultiProcessTestCase(TestCase):
def test_non_blocking_success(self):
key ... | 32.117647 | 71 | 0.482184 |
621fdf1b099305536647ca23e3039b048166f7ee | 2,217 | py | Python | neutron/plugins/ml2/drivers/type_geneve.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | 4 | 2018-08-05T00:43:03.000Z | 2021-10-13T00:45:45.000Z | neutron/plugins/ml2/drivers/type_geneve.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | 8 | 2018-06-14T14:50:16.000Z | 2018-11-13T16:30:42.000Z | neutron/plugins/ml2/drivers/type_geneve.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | 7 | 2018-06-12T18:57:04.000Z | 2019-05-09T15:42:30.000Z | # Copyright (c) 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 36.344262 | 78 | 0.712675 |
621fe904bf8e8568a600f7b2cd4df0f192f7208a | 6,101 | py | Python | tests/test_europarl.py | strfx/deep-neural-transcriber | 7ca422a226d544b6b93fe6aca31ac0ce9c727667 | [
"MIT"
] | 4 | 2021-11-17T10:17:18.000Z | 2022-03-12T15:13:32.000Z | tests/test_europarl.py | strfx/deep-neural-transcriber | 7ca422a226d544b6b93fe6aca31ac0ce9c727667 | [
"MIT"
] | 1 | 2021-11-19T11:56:40.000Z | 2022-03-07T17:38:16.000Z | tests/test_europarl.py | strfx/deep-neural-transcriber | 7ca422a226d544b6b93fe6aca31ac0ce9c727667 | [
"MIT"
] | 1 | 2022-03-02T07:15:01.000Z | 2022-03-02T07:15:01.000Z | """
Test the handling of the Europarl-ST dataset.
The dataset has a specific format which needs to be unpacked before we can
perform any processing on it. See the module docstring of dnt.datasets.europarl
for a detailed description.
We are using a small fraction of the original dataset, stored under
`tests/data`.
""... | 36.753012 | 275 | 0.694149 |
621ffd98d6069d6032fe934bede1bb6fd4f3c74f | 4,410 | py | Python | models/preact_resnet.py | JiarunLiu/Co-correcting | 4e3ca4951de5d73ca812bbbcfe666273082ff2fd | [
"Apache-2.0"
] | 19 | 2020-10-29T14:22:58.000Z | 2022-03-31T13:45:56.000Z | models/preact_resnet.py | JiarunLiu/Co-correcting | 4e3ca4951de5d73ca812bbbcfe666273082ff2fd | [
"Apache-2.0"
] | null | null | null | models/preact_resnet.py | JiarunLiu/Co-correcting | 4e3ca4951de5d73ca812bbbcfe666273082ff2fd | [
"Apache-2.0"
] | 7 | 2021-09-15T05:16:32.000Z | 2022-02-02T01:31:07.000Z | '''Pre-activation ResNet in PyTorch.
Reference:
[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Identity Mappings in Deep Residual Networks. arXiv:1603.05027
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class PreActBlock(nn.Module):
'''Pre-activation version of the BasicBlock.... | 38.684211 | 102 | 0.650113 |
62200e6fb5b795575706595f0f10b593ad1d6e59 | 1,908 | py | Python | experiments/ashvin/vae/fixed3/pointmass/vae_dense2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/vae/fixed3/pointmass/vae_dense2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/vae/fixed3/pointmass/vae_dense2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | from rlkit.envs.multitask.point2d import MultitaskImagePoint2DEnv
from rlkit.envs.multitask.pusher2d import FullPusher2DEnv
from rlkit.launchers.arglauncher import run_variants
import rlkit.misc.hyperparameter as hyp
from rlkit.torch.vae.relabeled_vae_experiment import experiment
if __name__ == "__main__":
# noin... | 29.8125 | 73 | 0.601677 |
622018027e2d05df3fb6da0bd3a1b2ca539ca225 | 9,177 | py | Python | atom/nucleus/python/nucleus_api/models/page_account_permission_vo.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/nucleus_api/models/page_account_permission_vo.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/nucleus_api/models/page_account_permission_vo.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.5
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from nucleus_api.configuration i... | 27.641566 | 194 | 0.595619 |
62201c6a10329d1db4c003872b0dc593c26dd3a5 | 3,411 | py | Python | components/server/tests/external/data_model/meta/test_parameter.py | ICTU/quality-time | 88d80ea30e35bd5f0bf5cce7cb43dc9f439e91f5 | [
"Apache-2.0"
] | 33 | 2016-01-20T07:35:48.000Z | 2022-03-14T09:20:51.000Z | components/server/tests/external/data_model/meta/test_parameter.py | ICTU/quality-time | 88d80ea30e35bd5f0bf5cce7cb43dc9f439e91f5 | [
"Apache-2.0"
] | 2,410 | 2016-01-22T18:13:01.000Z | 2022-03-31T16:57:34.000Z | components/server/tests/external/data_model/meta/test_parameter.py | ICTU/quality-time | 88d80ea30e35bd5f0bf5cce7cb43dc9f439e91f5 | [
"Apache-2.0"
] | 21 | 2016-01-16T11:49:23.000Z | 2022-01-14T21:53:22.000Z | """Unit tests for the parameter model."""
from external.data_model.meta.parameter import Parameter
from .base import MetaModelTestCase
class ParameterTest(MetaModelTestCase):
"""Parameter unit tests."""
MODEL = Parameter
TOO_FEW_VALUES = "Parameter Parameter is multiple choice but has fewer than two v... | 50.910448 | 120 | 0.725594 |
622035036e35713ddc2aa28ebf983712251d864a | 3,232 | py | Python | homeassistant/components/ebusd/sensor.py | andr2000/home-assistant | b4cd29f7ac2036b93664aa82380234d5565d8b0e | [
"Apache-2.0"
] | null | null | null | homeassistant/components/ebusd/sensor.py | andr2000/home-assistant | b4cd29f7ac2036b93664aa82380234d5565d8b0e | [
"Apache-2.0"
] | null | null | null | homeassistant/components/ebusd/sensor.py | andr2000/home-assistant | b4cd29f7ac2036b93664aa82380234d5565d8b0e | [
"Apache-2.0"
] | null | null | null | """Support for Ebusd sensors."""
import logging
import datetime
from homeassistant.helpers.entity import Entity
import homeassistant.util.dt as dt_util
from homeassistant.util import Throttle
from .const import DOMAIN, MIN_TIME_BETWEEN_UPDATES
TIME_FRAME1_BEGIN = "time_frame1_begin"
TIME_FRAME1_END = "time_frame1_en... | 31.378641 | 83 | 0.621906 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.