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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
043a5251d2cf80a18a96e2246c9287875ab82f96 | 15,050 | py | Python | examples/Deeplab/experiments/resnet_model_deeplabv3.py | MarcWong/tensorpack | 51ab279480dc1e3ffdc07884a9e8149dea9651e9 | [
"Apache-2.0"
] | 5 | 2018-05-04T02:04:15.000Z | 2020-04-02T05:38:48.000Z | examples/Deeplab/experiments/resnet_model_deeplabv3.py | MarcWong/tensorpack | 51ab279480dc1e3ffdc07884a9e8149dea9651e9 | [
"Apache-2.0"
] | null | null | null | examples/Deeplab/experiments/resnet_model_deeplabv3.py | MarcWong/tensorpack | 51ab279480dc1e3ffdc07884a9e8149dea9651e9 | [
"Apache-2.0"
] | 2 | 2018-04-23T13:43:10.000Z | 2019-10-30T09:56:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: resnet_model.py
import tensorflow as tf
from tensorflow.contrib.layers import variance_scaling_initializer
import numpy as np
slim = tf.contrib.slim
from tensorpack.tfutils.argscope import argscope, get_arg_scope
from tensorpack.models import (
Conv2D, Global... | 39.605263 | 134 | 0.647641 |
6a0eea1eb027672b5bf45938904b4ffdd8cc3449 | 14,093 | py | Python | tools/mountsnoop.py | Zheaoli/bcc | b768015a594e6a715a6d016682ac4ee4873d2bdc | [
"Apache-2.0"
] | 1 | 2021-10-08T03:24:45.000Z | 2021-10-08T03:24:45.000Z | tools/mountsnoop.py | Zheaoli/bcc | b768015a594e6a715a6d016682ac4ee4873d2bdc | [
"Apache-2.0"
] | null | null | null | tools/mountsnoop.py | Zheaoli/bcc | b768015a594e6a715a6d016682ac4ee4873d2bdc | [
"Apache-2.0"
] | 1 | 2021-09-28T08:41:22.000Z | 2021-09-28T08:41:22.000Z | #!/usr/bin/python
#
# mountsnoop Trace mount() and umount syscalls.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: mountsnoop [-h]
#
# Copyright (c) 2016 Facebook, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 14-Oct-2016 Omar Sandoval Created this.
from __future__ impor... | 31.110375 | 114 | 0.612574 |
9d61a3acc16b4f0294ed2ed03dc8158792924c76 | 1,033 | py | Python | test_delete.py | ArtemVavilov88/test2-Se-Python-14 | 522791b4fcde1d26b8e56244b10ebaf2e7146e57 | [
"Apache-2.0"
] | null | null | null | test_delete.py | ArtemVavilov88/test2-Se-Python-14 | 522791b4fcde1d26b8e56244b10ebaf2e7146e57 | [
"Apache-2.0"
] | null | null | null | test_delete.py | ArtemVavilov88/test2-Se-Python-14 | 522791b4fcde1d26b8e56244b10ebaf2e7146e57 | [
"Apache-2.0"
] | null | null | null | import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class php4dvd_delete_film(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(20)
def test_delete(self):
driver = self.driver
driver.g... | 33.322581 | 66 | 0.689255 |
4f9f2758c672a44d3dba717ce32a64ebcbea6d24 | 256 | py | Python | old/iq-test.py | zerexei/codewars-solutions | 0e1e9c3ce28bb8926561d5dd504f650aca47ca96 | [
"MIT"
] | null | null | null | old/iq-test.py | zerexei/codewars-solutions | 0e1e9c3ce28bb8926561d5dd504f650aca47ca96 | [
"MIT"
] | null | null | null | old/iq-test.py | zerexei/codewars-solutions | 0e1e9c3ce28bb8926561d5dd504f650aca47ca96 | [
"MIT"
] | null | null | null | def iq_test(numbers):
# convert values to boolean
e = [int(i) % 2 == 0 for i in numbers.split()]
# ternary | count all true if 1 return index of true else index of false
return e.index(True) + 1 if e.count(True) == 1 else e.index(False) + 1 | 51.2 | 76 | 0.644531 |
66f1185a3fa49e1ae57933f66abe5749fb646f91 | 11,318 | py | Python | rest_framework/filters.py | akx/django-rest-framework | c7bf99330e9fb8e44e082e86938155272c0d41e8 | [
"BSD-2-Clause"
] | null | null | null | rest_framework/filters.py | akx/django-rest-framework | c7bf99330e9fb8e44e082e86938155272c0d41e8 | [
"BSD-2-Clause"
] | null | null | null | rest_framework/filters.py | akx/django-rest-framework | c7bf99330e9fb8e44e082e86938155272c0d41e8 | [
"BSD-2-Clause"
] | 2 | 2016-09-06T16:12:47.000Z | 2018-10-10T15:33:58.000Z | """
Provides generic filtering backends that can be used to filter the results
returned by list views.
"""
from __future__ import unicode_literals
import operator
from functools import reduce
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from dja... | 35.816456 | 100 | 0.63536 |
643ac33a9a3865655030c09a303accde0a104450 | 543 | py | Python | test/units/temperature/__init__.py | gnmerritt/pyqudt | 2579e824b2e002d2e27a40eae84f1b1449006487 | [
"BSD-3-Clause"
] | 4 | 2019-07-27T22:19:26.000Z | 2022-01-19T16:36:10.000Z | test/units/temperature/__init__.py | gnmerritt/pyqudt | 2579e824b2e002d2e27a40eae84f1b1449006487 | [
"BSD-3-Clause"
] | 3 | 2021-05-28T01:18:35.000Z | 2021-12-22T01:03:39.000Z | test/units/temperature/__init__.py | gnmerritt/pyqudt | 2579e824b2e002d2e27a40eae84f1b1449006487 | [
"BSD-3-Clause"
] | 1 | 2020-06-03T20:17:41.000Z | 2020-06-03T20:17:41.000Z | ################################################################################
#
# Copyright (C) 2019 Garrett Brown
# This file is part of pyqudt - https://github.com/eigendude/pyqudt
#
# pyqudt is derived from jQUDT
# Copyright (C) 2012-2013 Egon Willighagen <egonw@users.sf.net>
#
# SPDX-License-Identifier: BS... | 33.9375 | 80 | 0.528545 |
afdf26c5d4450424a2b1b77caae58e1cf2c8febd | 6,929 | py | Python | spikeextractors/extractors/klustaextractors/klustaextractors.py | TRuikes/spikeextractors | c3cbdaa18629aeb5ecb52f648e69b503a4f091d2 | [
"MIT"
] | null | null | null | spikeextractors/extractors/klustaextractors/klustaextractors.py | TRuikes/spikeextractors | c3cbdaa18629aeb5ecb52f648e69b503a4f091d2 | [
"MIT"
] | null | null | null | spikeextractors/extractors/klustaextractors/klustaextractors.py | TRuikes/spikeextractors | c3cbdaa18629aeb5ecb52f648e69b503a4f091d2 | [
"MIT"
] | null | null | null | """
kwik structure based on:
https://github.com/kwikteam/phy-doc/blob/master/docs/kwik-format.md
cluster_group defaults based on:
https://github.com/kwikteam/phy-doc/blob/master/docs/kwik-model.md
04/08/20
"""
from spikeextractors import SortingExtractor
from spikeextractors.extractors.bindatrecordingextractor impo... | 44.993506 | 135 | 0.654784 |
8ffda39be987e3d956d6e216ca33cd6075fd1076 | 2,246 | py | Python | src/sst/elements/memHierarchy/tests/goblinCustomCmd-2.py | sudhanshu2/sst-elements | d658e5e4b26e5725488f9e93528506ddb22072ee | [
"BSD-3-Clause"
] | null | null | null | src/sst/elements/memHierarchy/tests/goblinCustomCmd-2.py | sudhanshu2/sst-elements | d658e5e4b26e5725488f9e93528506ddb22072ee | [
"BSD-3-Clause"
] | null | null | null | src/sst/elements/memHierarchy/tests/goblinCustomCmd-2.py | sudhanshu2/sst-elements | d658e5e4b26e5725488f9e93528506ddb22072ee | [
"BSD-3-Clause"
] | null | null | null | import sst
# Define SST core options
sst.setProgramOption("timebase", "1ps")
sst.setProgramOption("stopAtCycle", "0 ns")
# Define the simulation components
comp_cpu = sst.Component("cpu", "miranda.BaseCPU")
comp_cpu.addParams({
"verbose" : 0,
"generator" : "miranda.STREAMBenchGeneratorCustomCmd",
"generatorParams.... | 32.085714 | 109 | 0.689671 |
b9dd38ec3603db18300d2677f7770463bd6aa745 | 13,455 | py | Python | samples/snippets/subscriber_test.py | cclauss/python-pubsub | 4080b0ad65320965b7e6460566d39595d00674cb | [
"Apache-2.0"
] | null | null | null | samples/snippets/subscriber_test.py | cclauss/python-pubsub | 4080b0ad65320965b7e6460566d39595d00674cb | [
"Apache-2.0"
] | null | null | null | samples/snippets/subscriber_test.py | cclauss/python-pubsub | 4080b0ad65320965b7e6460566d39595d00674cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 31.584507 | 94 | 0.734077 |
4c61fe2f7645955683efee1b77ae9b5ab3f768b3 | 24,085 | py | Python | corehq/messaging/scheduling/scheduling_partitioned/models.py | akshita-sh/commcare-hq | 236b25ff9cd1a634fc5586e0f9e29473c8ac71b8 | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | corehq/messaging/scheduling/scheduling_partitioned/models.py | akshita-sh/commcare-hq | 236b25ff9cd1a634fc5586e0f9e29473c8ac71b8 | [
"BSD-3-Clause"
] | null | null | null | corehq/messaging/scheduling/scheduling_partitioned/models.py | akshita-sh/commcare-hq | 236b25ff9cd1a634fc5586e0f9e29473c8ac71b8 | [
"BSD-3-Clause"
] | null | null | null | import pytz
import sys
import uuid
from corehq.apps.casegroups.models import CommCareCaseGroup
from corehq.apps.groups.models import Group
from corehq.apps.locations.dbaccessors import get_all_users_by_location
from corehq.apps.locations.models import SQLLocation
from corehq.apps.sms.models import MessagingEvent
from c... | 37.283282 | 113 | 0.665975 |
4ef1b0b714d72de49af243020513c7d0e0214711 | 3,847 | py | Python | soc/hps_proto2_platform.py | alanvgreen/CFU-Playground | 1faba8de355e2e4d3928e648ac1b008a5ee71195 | [
"Apache-2.0"
] | 1 | 2022-02-08T01:39:29.000Z | 2022-02-08T01:39:29.000Z | soc/hps_proto2_platform.py | JosephBushagour/CFU-Playground | d4f660ad81f8807558120bbd311371eff1a0ce3b | [
"Apache-2.0"
] | null | null | null | soc/hps_proto2_platform.py | JosephBushagour/CFU-Playground | d4f660ad81f8807558120bbd311371eff1a0ce3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from migen import Module, ClockDomain, Signal, If, log2_int
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.build.generic_platform im... | 36.638095 | 94 | 0.613205 |
babfc708c15958fe7bd152a27e1914e6803726bc | 4,687 | py | Python | kNN/main.py | unbrokenguy/machine_learning | b33e41dd775eecd0c79cd287fe4f8cb0b5164b74 | [
"MIT"
] | null | null | null | kNN/main.py | unbrokenguy/machine_learning | b33e41dd775eecd0c79cd287fe4f8cb0b5164b74 | [
"MIT"
] | null | null | null | kNN/main.py | unbrokenguy/machine_learning | b33e41dd775eecd0c79cd287fe4f8cb0b5164b74 | [
"MIT"
] | null | null | null | from collections import Counter
from dataclasses import dataclass
from enum import Enum
from typing import Tuple
import numpy as np
import pygame
import random
from scipy.stats import mode
N = 3
R = 4
FPS = 5
POINTS_NUMBER = 10
MIN_NEIGHBOURS = 5
MAX_NEIGHBOURS = 15
OPTIMAL_NEIGHBOURS_COUNT = [0 for... | 32.548611 | 142 | 0.551312 |
f741d96a7be5cad77ac86ffe06f37fceec063d14 | 7,616 | py | Python | tests/sensors/test_http_sensor.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2019-10-10T23:53:01.000Z | 2019-10-10T23:53:01.000Z | tests/sensors/test_http_sensor.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 3 | 2020-07-07T20:39:24.000Z | 2021-09-29T17:34:46.000Z | tests/sensors/test_http_sensor.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2020-11-04T03:17:51.000Z | 2020-11-04T03:17:51.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 34.152466 | 88 | 0.616859 |
f9e1faaca74675111460d25b0da975abe58feee2 | 3,802 | py | Python | hedgehog/structure.py | h8hw8943/hedgehog | 8d2927604c0e9f4f0ed9dcc3a12ce7ae6638cc51 | [
"MIT"
] | 121 | 2020-05-14T14:46:35.000Z | 2022-03-21T22:34:12.000Z | hedgehog/structure.py | h8hw8943/hedgehog | 8d2927604c0e9f4f0ed9dcc3a12ce7ae6638cc51 | [
"MIT"
] | 14 | 2020-05-14T20:13:31.000Z | 2022-01-03T09:04:28.000Z | hedgehog/structure.py | h8hw8943/hedgehog | 8d2927604c0e9f4f0ed9dcc3a12ce7ae6638cc51 | [
"MIT"
] | 24 | 2020-05-15T01:37:20.000Z | 2022-03-21T22:34:14.000Z | import collections
import itertools
import numpy as np
__all__ = ['chow_liu']
def chow_liu(X, root=None):
"""Return a Chow-Liu tree.
A Chow-Liu tree takes three steps to build:
1. Compute the mutual information between each pair of variables. The values are organised in
a fully connected grap... | 29.022901 | 97 | 0.631247 |
0c7ef5151a0ac3fa82271ff21fc48486be15c89e | 170 | py | Python | dasbit/irc/message/numeric.py | DASPRiD/DASBiT | 5ce105786c3528b8611f005ac1749685be2a9ff5 | [
"BSD-3-Clause"
] | 2 | 2015-06-11T14:57:31.000Z | 2016-08-09T21:25:11.000Z | dasbit/irc/message/numeric.py | DASPRiD/DASBiT | 5ce105786c3528b8611f005ac1749685be2a9ff5 | [
"BSD-3-Clause"
] | 1 | 2015-02-12T09:29:57.000Z | 2015-02-12T10:47:13.000Z | dasbit/irc/message/numeric.py | DASPRiD/DASBiT | 5ce105786c3528b8611f005ac1749685be2a9ff5 | [
"BSD-3-Clause"
] | null | null | null | from dasbit.irc.message import Generic
class Numeric(Generic):
def __init__(self, prefix, command, args):
Generic.__init__(self, prefix, int(command), args)
| 28.333333 | 58 | 0.723529 |
6e9c127e88f9c5ec43f57b9dcc1cb4ae1f5ba725 | 9,998 | py | Python | tests/test_action_value.py | yuishihara/chainerrl | 74901712a8ed8207b9d526d3f45b04bf22996b8d | [
"MIT"
] | 18 | 2018-08-07T07:27:41.000Z | 2018-08-20T01:51:21.000Z | tests/test_action_value.py | yuishihara/chainerrl | 74901712a8ed8207b9d526d3f45b04bf22996b8d | [
"MIT"
] | null | null | null | tests/test_action_value.py | yuishihara/chainerrl | 74901712a8ed8207b9d526d3f45b04bf22996b8d | [
"MIT"
] | 2 | 2018-08-16T06:47:26.000Z | 2018-08-20T01:51:22.000Z | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import unittest
import chainer
import chainer.functions as ... | 38.453846 | 78 | 0.617824 |
5760974f74d5e5a0bc70d6da77262ea7ebb6fdfe | 7,235 | py | Python | backpack/extensions/secondorder/hbp/__init__.py | paulkogni/backpack | 3122de062d5bbcdcba8f8e02d24adb1bd2cdada6 | [
"MIT"
] | null | null | null | backpack/extensions/secondorder/hbp/__init__.py | paulkogni/backpack | 3122de062d5bbcdcba8f8e02d24adb1bd2cdada6 | [
"MIT"
] | null | null | null | backpack/extensions/secondorder/hbp/__init__.py | paulkogni/backpack | 3122de062d5bbcdcba8f8e02d24adb1bd2cdada6 | [
"MIT"
] | null | null | null | from torch.nn import (
AvgPool2d,
Conv2d,
CrossEntropyLoss,
Dropout,
Flatten,
Linear,
MaxPool2d,
MSELoss,
ReLU,
Sigmoid,
Tanh,
ZeroPad2d,
)
from backpack.extensions.backprop_extension import BackpropExtension
from backpack.extensions.curvature import Curvature
from backp... | 34.452381 | 85 | 0.683483 |
96f32a3c82523dd0aec0e0fa53cbc2dc69c64fb7 | 719 | py | Python | duendecat/dir.py | patarapolw/duen-gui | 8ad04b4346419d9bfe3cfd6fdad49ca50030d56b | [
"MIT"
] | 3 | 2019-03-18T18:34:34.000Z | 2021-09-09T07:47:59.000Z | duendecat/dir.py | patarapolw/duen-gui | 8ad04b4346419d9bfe3cfd6fdad49ca50030d56b | [
"MIT"
] | null | null | null | duendecat/dir.py | patarapolw/duen-gui | 8ad04b4346419d9bfe3cfd6fdad49ca50030d56b | [
"MIT"
] | null | null | null | import os, sys
import inspect
PROJECT_NAME = 'duendecat'
filename = os.path.dirname(inspect.getframeinfo(inspect.currentframe()).filename)
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores pat... | 28.76 | 91 | 0.734353 |
c673044bcc290180fdf452b0853301fdfcae935e | 6,163 | py | Python | env/lib/python3.9/site-packages/ansible/modules/cloud/hcloud/_hcloud_image_facts.py | unbounce/aws-name-asg-instances | e0379442e3ce71bf66ba9b8975b2cc57a2c7648d | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | env/lib/python3.9/site-packages/ansible/modules/cloud/hcloud/_hcloud_image_facts.py | unbounce/aws-name-asg-instances | e0379442e3ce71bf66ba9b8975b2cc57a2c7648d | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | env/lib/python3.9/site-packages/ansible/modules/cloud/hcloud/_hcloud_image_facts.py | unbounce/aws-name-asg-instances | e0379442e3ce71bf66ba9b8975b2cc57a2c7648d | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"met... | 29.488038 | 133 | 0.58121 |
4746727abc915d409cb606faadbf06853814d322 | 1,040 | py | Python | src/ui/main_frame.py | MAE-M/PotentiallyInactiveCpeAnalysisTool | 58f897fb45437ff72a6db4d490f364061d779c50 | [
"Apache-2.0"
] | null | null | null | src/ui/main_frame.py | MAE-M/PotentiallyInactiveCpeAnalysisTool | 58f897fb45437ff72a6db4d490f364061d779c50 | [
"Apache-2.0"
] | null | null | null | src/ui/main_frame.py | MAE-M/PotentiallyInactiveCpeAnalysisTool | 58f897fb45437ff72a6db4d490f364061d779c50 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd.
# foss@huawei.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 34.666667 | 75 | 0.736538 |
b0f6c31a7d1f60c142074dab7f762305b169bf81 | 1,670 | py | Python | GenomicData/utils/visualize.py | Zaoyee/deep-geometric-pathway | 9c1ac8a586b1e1debaedee7eff1e193396d564e4 | [
"MIT"
] | null | null | null | GenomicData/utils/visualize.py | Zaoyee/deep-geometric-pathway | 9c1ac8a586b1e1debaedee7eff1e193396d564e4 | [
"MIT"
] | null | null | null | GenomicData/utils/visualize.py | Zaoyee/deep-geometric-pathway | 9c1ac8a586b1e1debaedee7eff1e193396d564e4 | [
"MIT"
] | 2 | 2020-03-24T17:10:59.000Z | 2021-02-22T23:57:28.000Z | import networkx as nx
import matplotlib.pyplot as plt
def show_pth(pathway_obj, *argv):
"""
The simple function that print out the pathway dataset
The different node types are visualized by different color
**Inputs:** `pathway_obj`: the pathwayway `object` that called by function `cancer_data()... | 43.947368 | 153 | 0.596407 |
df276f7b4af6c28a6144450c89918d533def4837 | 1,490 | py | Python | pipeline/tasks/requirements/vgen_requirements.py | enterstudio/artman | b9b2e6c0d42a0698b6ee59f4e755e7f2e603f8aa | [
"Apache-2.0"
] | 2 | 2019-11-30T23:42:09.000Z | 2021-08-30T19:54:48.000Z | pipeline/tasks/requirements/vgen_requirements.py | enterstudio/artman | b9b2e6c0d42a0698b6ee59f4e755e7f2e603f8aa | [
"Apache-2.0"
] | null | null | null | pipeline/tasks/requirements/vgen_requirements.py | enterstudio/artman | b9b2e6c0d42a0698b6ee59f4e755e7f2e603f8aa | [
"Apache-2.0"
] | 1 | 2017-03-30T00:28:15.000Z | 2017-03-30T00:28:15.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 27.090909 | 74 | 0.71745 |
ee9885c0ba2a83cbfc2b0466a1adac416c83abdd | 484 | py | Python | main/migrations/0008_auto_20210120_1947.py | opustm/mvp-backend | 3c25d575fbd299c84df48e8448ec63d11cc08a8e | [
"MIT"
] | null | null | null | main/migrations/0008_auto_20210120_1947.py | opustm/mvp-backend | 3c25d575fbd299c84df48e8448ec63d11cc08a8e | [
"MIT"
] | null | null | null | main/migrations/0008_auto_20210120_1947.py | opustm/mvp-backend | 3c25d575fbd299c84df48e8448ec63d11cc08a8e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2021-01-21 01:47
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('main', '0007_auto_20210120_1944'),
]
operations = [
migrations.AlterField(
model_name='user',
name='id',... | 24.2 | 145 | 0.63843 |
b646db6b076130ad9fbead28c47027addfc90c02 | 61 | py | Python | gym_invaders/ai_invader/__init__.py | Jh123x/Orbital | 6f8f2da4fd26ef1d77c0c6183230c3a5e6bf0bb9 | [
"MIT"
] | 4 | 2020-05-15T11:17:09.000Z | 2020-06-30T01:11:41.000Z | gym_invaders/ai_invader/__init__.py | Jh123x/Orbital | 6f8f2da4fd26ef1d77c0c6183230c3a5e6bf0bb9 | [
"MIT"
] | 10 | 2020-05-16T10:45:32.000Z | 2020-07-27T07:17:02.000Z | gym_invaders/ai_invader/__init__.py | Jh123x/Orbital | 6f8f2da4fd26ef1d77c0c6183230c3a5e6bf0bb9 | [
"MIT"
] | null | null | null | from .util import *
from .model import *
from .agent import * | 20.333333 | 20 | 0.721311 |
724b3ca40462d94e33d95a5dd4016fa34f61daa0 | 7,941 | py | Python | methods/binary_classifier.py | aber-wgr/OD-test | 1f0836dd7a1c5ede34caca1a3492e9e7c3023538 | [
"MIT"
] | 61 | 2018-09-14T02:48:01.000Z | 2022-02-14T09:13:45.000Z | methods/binary_classifier.py | ashafaei/OD-test | 8252aace84e2ae1ab95067876985f62a1060aad6 | [
"MIT"
] | 3 | 2019-07-31T09:59:46.000Z | 2020-04-16T21:55:16.000Z | methods/binary_classifier.py | aber-wgr/OD-test | 1f0836dd7a1c5ede34caca1a3492e9e7c3023538 | [
"MIT"
] | 12 | 2018-09-25T10:36:39.000Z | 2022-03-28T18:09:00.000Z | from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from utils.iterative_trainer import IterativeTrainerConfig, IterativeTrainer
from utils.logger import Logger
import os
from os import path
from termcolor import colored
from me... | 43.157609 | 154 | 0.622718 |
8a3fa70bdde79acb6c99fe38f6f52389465d42fa | 4,584 | py | Python | tests/basepage.py | Skhsouravhalder/newbot | b3ce01dafdbdc5f93dec551449fc720572ea253d | [
"MIT"
] | null | null | null | tests/basepage.py | Skhsouravhalder/newbot | b3ce01dafdbdc5f93dec551449fc720572ea253d | [
"MIT"
] | null | null | null | tests/basepage.py | Skhsouravhalder/newbot | b3ce01dafdbdc5f93dec551449fc720572ea253d | [
"MIT"
] | null | null | null | """BasePage tests subclasses."""
#
# (C) Pywikibot team, 2015-2022
#
# Distributed under the terms of the MIT license.
#
from pywikibot.page import BasePage
from tests.aspects import TestCase
class BasePageTestBase(TestCase):
"""Base of BasePage test classes."""
_page = None
def setUp(self):
""... | 33.459854 | 75 | 0.650087 |
9e990c6b496048275dcdae9fefd8df021d093624 | 39,202 | py | Python | var/spack/repos/builtin/packages/trilinos/package.py | VladimirUspenskii/spack | 18b83c3833c0e138a7153bbb14e68b1147b3f3d1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/trilinos/package.py | VladimirUspenskii/spack | 18b83c3833c0e138a7153bbb14e68b1147b3f3d1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2022-03-01T04:35:54.000Z | 2022-03-02T04:44:21.000Z | var/spack/repos/builtin/packages/trilinos/package.py | VladimirUspenskii/spack | 18b83c3833c0e138a7153bbb14e68b1147b3f3d1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import sys
from spack import *
from spack.build_environment import dso_suffix
from spack.error import NoHeaders... | 47.63305 | 120 | 0.609714 |
2ddc83b7c23c1d027fe4230efc8692e9940aedce | 13,587 | py | Python | readthedocs/projects/views/private.py | jasongrlicky/readthedocs.org | 538e9312527c085e665c101d66d37ba44b64e88e | [
"MIT"
] | 1 | 2015-11-08T11:31:12.000Z | 2015-11-08T11:31:12.000Z | readthedocs/projects/views/private.py | jasongrlicky/readthedocs.org | 538e9312527c085e665c101d66d37ba44b64e88e | [
"MIT"
] | null | null | null | readthedocs/projects/views/private.py | jasongrlicky/readthedocs.org | 538e9312527c085e665c101d66d37ba44b64e88e | [
"MIT"
] | null | null | null | import os
import shutil
import simplejson
import zipfile
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.markup.templatetags.markup import restructuredtext
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpRespo... | 33.798507 | 112 | 0.683006 |
271e2ec24428ea72b01b8f36355208dce7fe8a8f | 2,398 | py | Python | examples/learning_feedback_example.py | BRNALX/ChatterBot | 976b60a86154bffc3c7cf2d7c51e4352bd591d74 | [
"BSD-3-Clause"
] | null | null | null | examples/learning_feedback_example.py | BRNALX/ChatterBot | 976b60a86154bffc3c7cf2d7c51e4352bd591d74 | [
"BSD-3-Clause"
] | null | null | null | examples/learning_feedback_example.py | BRNALX/ChatterBot | 976b60a86154bffc3c7cf2d7c51e4352bd591d74 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from chatterbot import ChatBot
"""
This example shows how to create a chat bot that
will learn responses based on an additional feedback
element from the user.
"""
# Uncomment the following line to enable verbose logging
# import logging
# logging.basicConfig(level=logging.INFO)
# Create a ne... | 31.973333 | 109 | 0.66764 |
b74cdb17db7b20ab4ff31a704260c2bb0cce9af5 | 1,303 | py | Python | algorithms/HeapSort.py | zhaoxinlu/leetcode-algorithms | f5e1c94c99628e7fb04ba158f686a55a8093e933 | [
"MIT"
] | null | null | null | algorithms/HeapSort.py | zhaoxinlu/leetcode-algorithms | f5e1c94c99628e7fb04ba158f686a55a8093e933 | [
"MIT"
] | null | null | null | algorithms/HeapSort.py | zhaoxinlu/leetcode-algorithms | f5e1c94c99628e7fb04ba158f686a55a8093e933 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Heap sort(堆排序)-MAX: 初始时把要排序的数的序列看作是一棵顺序存储的二叉树,调整它们的存储序,使之成为一个堆,这时堆的根节点的数最大;
然后将根节点与堆的最后一个节点交换。然后对前面(n-1)个数重新调整使之成为堆;
依此类推,直到只有两个节点的堆,并对 它们作交换,最后得到有n个节点的有序序列。
从算法描述来看,堆排序需要两个过程,一是建立堆,二是堆顶与堆的最后一个元素交换位置。
所以堆排序有两个函数组成。一是建堆的渗透函数,二是反复调用渗透函数实现排序的函数。
... | 27.145833 | 75 | 0.597851 |
53d258be23226311c9a25ad50d5c8b095827ce5e | 13,189 | py | Python | setup.py | haroldwoo/airflow | e4bf4879e17051066b5244510d8757463f971d97 | [
"Apache-2.0"
] | null | null | null | setup.py | haroldwoo/airflow | e4bf4879e17051066b5244510d8757463f971d97 | [
"Apache-2.0"
] | null | null | null | setup.py | haroldwoo/airflow | e4bf4879e17051066b5244510d8757463f971d97 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#... | 30.180778 | 90 | 0.561453 |
b143f2493d36ff05b6526d97d5b50570a7a37d62 | 341 | py | Python | stalkbroker/messages/_memos.py | peake100/stalkbroker-py | 95bed6e6d89dc00b183b71d5d3fce7908c554ed9 | [
"MIT"
] | null | null | null | stalkbroker/messages/_memos.py | peake100/stalkbroker-py | 95bed6e6d89dc00b183b71d5d3fce7908c554ed9 | [
"MIT"
] | 12 | 2020-04-25T22:13:57.000Z | 2020-05-24T16:24:59.000Z | stalkbroker/messages/_memos.py | peake100/stalkbroker-py | 95bed6e6d89dc00b183b71d5d3fce7908c554ed9 | [
"MIT"
] | null | null | null | import random
_MEMOS = [
"401K through the vegetable way.",
"Turn-up your profits.",
"Lets unearth a fortune, together.",
"Not just another piece of shovelware",
]
def random_memo() -> str:
"""
Pick a random memo to add to a report / bulletin.
:returns: random memo.
"""
return r... | 17.947368 | 53 | 0.627566 |
3dc397a0ba36facd14f9902c50054e9df7bb0252 | 1,687 | py | Python | plotter.py | hsuRush/PSO | ff537413b4f629ba8a483752bc774573eaa50e37 | [
"MIT"
] | null | null | null | plotter.py | hsuRush/PSO | ff537413b4f629ba8a483752bc774573eaa50e37 | [
"MIT"
] | null | null | null | plotter.py | hsuRush/PSO | ff537413b4f629ba8a483752bc774573eaa50e37 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
from functions import rosenbrock
ax = None
def plot3d_init():
global ax
fig = plt.figure()
ax =... | 23.109589 | 75 | 0.632484 |
b03584b93b46cb1ed78d3270f3eee0d7ec5bfa72 | 546 | py | Python | Sparrow/_const.py | eleme/Sparrow | 4fe10cb57c40dbdca9fe3645477cb7e1dc118d0b | [
"MIT"
] | 75 | 2018-10-10T02:05:16.000Z | 2021-09-09T01:38:38.000Z | Sparrow/_const.py | eleme/Sparrow | 4fe10cb57c40dbdca9fe3645477cb7e1dc118d0b | [
"MIT"
] | 2 | 2020-06-05T19:06:23.000Z | 2021-06-10T20:48:32.000Z | Sparrow/_const.py | eleme/Sparrow | 4fe10cb57c40dbdca9fe3645477cb7e1dc118d0b | [
"MIT"
] | 6 | 2018-09-29T12:07:40.000Z | 2020-05-28T03:10:38.000Z | class Const(object):
class ConstError(PermissionError):
pass
class ConstCaseError(ConstError):
pass
def __setattr__(self, name, value):
if name in self.__dict__.keys():
raise self.ConstError("Can't rebind const(%s)" % name)
self.__dict__[name] = value
def _... | 22.75 | 66 | 0.626374 |
76452416caad58c32c752ed7c073ac70221e78c5 | 2,868 | py | Python | crits/komand_crits/actions/add_email/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | crits/komand_crits/actions/add_email/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | crits/komand_crits/actions/add_email/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
FILE = "file"
PARAMS = "params"
SOURCE = "source"
TYPE = "type"
class Output:
RESPONSE = "response"
class AddEmailInput(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variabl... | 20.340426 | 83 | 0.456416 |
455868e9197549a85dcaeb96d63d41cd260d2c2e | 10,779 | py | Python | pavement.py | echevemaster/fedora-college | 55033de5dd6f3a1063bf12f0b8937b493ae07692 | [
"BSD-3-Clause"
] | 4 | 2015-05-16T09:54:18.000Z | 2016-01-08T16:52:19.000Z | pavement.py | fedora-infra/fedora-college | cf310dab2e4fea02b9ac5e7f57dc53aafb4834d8 | [
"BSD-3-Clause"
] | 1 | 2015-12-03T21:30:13.000Z | 2016-01-09T10:47:24.000Z | pavement.py | fedora-infra/fedora-college | cf310dab2e4fea02b9ac5e7f57dc53aafb4834d8 | [
"BSD-3-Clause"
] | 1 | 2020-12-07T22:14:01.000Z | 2020-12-07T22:14:01.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf-8; -*-
from __future__ import print_function
import os
import sys
import time
import subprocess
# Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill!
if 'check_output' not in dir(subprocess):
def check_output(cmd_args, *args, **... | 28.070313 | 79 | 0.638093 |
c47cb2bb475e9295615ec9281503116f8e598433 | 593 | py | Python | protector/rules/prevent_drop.py | trivago/Protector | 7ebe7bde965e27737b961a0cb5740724d174fdc7 | [
"BSD-3-Clause"
] | 54 | 2016-02-23T16:04:11.000Z | 2021-05-01T06:43:55.000Z | protector/rules/prevent_drop.py | trivago/Protector | 7ebe7bde965e27737b961a0cb5740724d174fdc7 | [
"BSD-3-Clause"
] | 1 | 2016-03-08T15:07:35.000Z | 2016-06-23T12:52:36.000Z | protector/rules/prevent_drop.py | trivago/Protector | 7ebe7bde965e27737b961a0cb5740724d174fdc7 | [
"BSD-3-Clause"
] | 4 | 2016-06-01T14:22:47.000Z | 2017-03-09T05:23:08.000Z | from result import Ok, Err
from protector.influxdb.keyword import Keyword
from protector.rules.rule import Rule
class RuleChecker(Rule):
@staticmethod
def description():
return "Prevent drop queries"
@staticmethod
def reason():
return ["Drop queries mean data loss. This is a risky op... | 24.708333 | 114 | 0.647555 |
5718fc24abddde3cd75d24a8b98a26842d6e9555 | 350 | py | Python | mesa_SIR/__init__.py | projectmesapackages/SIR | 8ed61c53aaa2e415b8259b988e88a97d646a2caa | [
"MIT"
] | 8 | 2020-04-06T12:49:04.000Z | 2021-11-26T20:17:36.000Z | mesa_SIR/__init__.py | projectmesapackages/SIR | 8ed61c53aaa2e415b8259b988e88a97d646a2caa | [
"MIT"
] | null | null | null | mesa_SIR/__init__.py | projectmesapackages/SIR | 8ed61c53aaa2e415b8259b988e88a97d646a2caa | [
"MIT"
] | 8 | 2020-04-04T16:51:49.000Z | 2021-07-31T21:46:24.000Z | """
Mesa Agent-Based Modeling Framework Extension
Core Objects: Model, and Agent.
"""
import datetime
from mesa_SIR import calculations_and_plots
from mesa_SIR import SIR
__all__ = ["Infection"]
__title__ = 'Mesa_SIR'
__version__ = '0.0.1'
__license__ = 'MIT'
__copyright__ = 'Copyright %s Mark Bailey... | 21.875 | 71 | 0.725714 |
82580356429bf62fbf0a3f75475befec07443e13 | 5,022 | py | Python | code/env/BitcoinTradingEnv.py | leokan92/Contextual-bandit-Resnet-trading | 57fa89b01ba99999b132161efa0eb16b5c32ecf8 | [
"MIT"
] | null | null | null | code/env/BitcoinTradingEnv.py | leokan92/Contextual-bandit-Resnet-trading | 57fa89b01ba99999b132161efa0eb16b5c32ecf8 | [
"MIT"
] | null | null | null | code/env/BitcoinTradingEnv.py | leokan92/Contextual-bandit-Resnet-trading | 57fa89b01ba99999b132161efa0eb16b5c32ecf8 | [
"MIT"
] | null | null | null | import gym
import numpy as np
from sklearn.preprocessing import StandardScaler
from empyrical import sortino_ratio, calmar_ratio, omega_ratio, sharpe_ratio
# Delete this if debugging
np.warnings.filterwarnings('ignore')
def calc_S(R,T = 365*24):
sumR = np.cumsum(R[::-1])[::-1]
sumR2 = np.cumsum((R**2)[::... | 36.656934 | 283 | 0.614297 |
ddb3b41f546b3b6f2103d87aabc9ccb9ae55db7e | 4,520 | py | Python | encoder.py | jojogamezHub/VideoPlayerTesting | 2bc37fbb4637a73e323a1ce843a7480ddc3c2a94 | [
"MIT"
] | null | null | null | encoder.py | jojogamezHub/VideoPlayerTesting | 2bc37fbb4637a73e323a1ce843a7480ddc3c2a94 | [
"MIT"
] | null | null | null | encoder.py | jojogamezHub/VideoPlayerTesting | 2bc37fbb4637a73e323a1ce843a7480ddc3c2a94 | [
"MIT"
] | null | null | null | import json
import cv2 as cv
import math
import numpy as np
import os
def getVideoLocation(videoName):
return "Videos/" + videoName
def rescaleFrame(frame, scale):
width = int(frame.shape[1]* scale)
height = int(frame.shape[0] * scale)
return cv.resize(frame, (width,height), interpol... | 25.977011 | 122 | 0.584513 |
ac304219a24df0676feb382070af801423957772 | 9,042 | py | Python | IMU/HAPT_Dataset.py | fcruciani/cnn_rf_har | 2a7da7ab6eafa749ebbeb7d7f880b6f4b0e9aef7 | [
"MIT"
] | 1 | 2020-10-27T02:39:18.000Z | 2020-10-27T02:39:18.000Z | IMU/HAPT_Dataset.py | fcruciani/cnn_rf_har | 2a7da7ab6eafa749ebbeb7d7f880b6f4b0e9aef7 | [
"MIT"
] | null | null | null | IMU/HAPT_Dataset.py | fcruciani/cnn_rf_har | 2a7da7ab6eafa749ebbeb7d7f880b6f4b0e9aef7 | [
"MIT"
] | null | null | null | '''
File: HAPT_Dataset.py
Author: Federico Cruciani
Date: 03/10/2019
Version: 1.0
Description:
utility functions to load the
Human Activities and Postural Transitions (HAPT) dataset
'''
import numpy as np
import pandas as pd
from os.path import expanduser
from keras.utils import to_categorical
from multiprocessi... | 31.95053 | 133 | 0.692767 |
b39d333cf510ada23673aba270752e6003731d2b | 2,963 | py | Python | tests/system/gapic/v1/test_system_speech_v1.py | zmtkr/python-speech | 6000370242a4c548a3306ae274a0302e2bbb2445 | [
"Apache-2.0"
] | 263 | 2020-02-05T08:29:22.000Z | 2022-03-28T06:29:04.000Z | tests/system/gapic/v1/test_system_speech_v1.py | zmtkr/python-speech | 6000370242a4c548a3306ae274a0302e2bbb2445 | [
"Apache-2.0"
] | 162 | 2020-02-03T23:06:13.000Z | 2022-03-30T22:42:14.000Z | tests/system/gapic/v1/test_system_speech_v1.py | zmtkr/python-speech | 6000370242a4c548a3306ae274a0302e2bbb2445 | [
"Apache-2.0"
] | 214 | 2019-12-19T00:28:52.000Z | 2022-03-27T16:11:26.000Z | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.189474 | 88 | 0.658454 |
26f33448f7d9ce6bb0cd1cb8f8cc7f82e45c314c | 3,804 | py | Python | diaparser/modules/dropout.py | zoonru/diaparser | afae32ca91b84b64c163c749599dfa264e647773 | [
"MIT"
] | 38 | 2020-10-21T17:43:19.000Z | 2022-03-01T15:15:25.000Z | diaparser/modules/dropout.py | zoonru/diaparser | afae32ca91b84b64c163c749599dfa264e647773 | [
"MIT"
] | 11 | 2020-11-01T14:55:38.000Z | 2022-02-03T19:51:06.000Z | diaparser/modules/dropout.py | zoonru/diaparser | afae32ca91b84b64c163c749599dfa264e647773 | [
"MIT"
] | 7 | 2020-12-18T10:46:51.000Z | 2022-01-11T22:03:11.000Z | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
class SharedDropout(nn.Module):
r"""
SharedDropout differs from the vanilla dropout strategy in that
the dropout mask is shared across one dimension.
Args:
p (float):
The probability of an element to be zeroed. Default: 0... | 27.970588 | 123 | 0.493954 |
a8196b30302f6ebc48587ac8a8e55828ac8e01b8 | 9,589 | py | Python | homeassistant/components/ring/__init__.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/ring/__init__.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 87 | 2020-07-06T22:22:54.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/ring/__init__.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """Support for Ring Doorbell/Chimes."""
from __future__ import annotations
import asyncio
from datetime import timedelta
from functools import partial
import logging
from pathlib import Path
from oauthlib.oauth2 import AccessDeniedError
import requests
from ring_doorbell import Auth, Ring
from homeassistant.const im... | 31.751656 | 96 | 0.601314 |
9605c31bf5982eabb5f08e48f5ef5f091d36422c | 15,358 | py | Python | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationnegotiateaction.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationnegotiateaction.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationnegotiateaction.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2008-2016 Citrix Systems, 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 l... | 35.468822 | 293 | 0.719365 |
dcc0d328db6ea81b64e1fd1fd7af946fd70cf4d5 | 15,165 | py | Python | src/solutions/common/integrations/cirklo/cirklo.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/solutions/common/integrations/cirklo/cirklo.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/solutions/common/integrations/cirklo/cirklo.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | 43.82948 | 118 | 0.696406 |
8bb927548f2ed7cda811df262fa312222a09f723 | 15,288 | py | Python | tests/functional/clients/standalone/package_list/fixtures/alpine.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 1 | 2021-09-12T07:44:44.000Z | 2021-09-12T07:44:44.000Z | tests/functional/clients/standalone/package_list/fixtures/alpine.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 3 | 2021-07-15T19:58:01.000Z | 2021-09-16T09:39:46.000Z | tests/functional/clients/standalone/package_list/fixtures/alpine.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | null | null | null | pkgfiles_all = {
"/bin": "APKFILE",
"/bin/busybox": "APKFILE",
"/bin/sh": "APKFILE",
"/dev": "APKFILE",
"/dev/pts": "APKFILE",
"/dev/shm": "APKFILE",
"/etc": "APKFILE",
"/etc/apk": "APKFILE",
"/etc/apk/keys": "APKFILE",
"/etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.r... | 35.06422 | 96 | 0.454343 |
5feb570a61e4e3a558f6f60a614d7663b8d175d3 | 12,944 | py | Python | model-optimizer/extensions/front/caffe/conv_ext_test.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | null | null | null | model-optimizer/extensions/front/caffe/conv_ext_test.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 19 | 2021-03-26T08:11:00.000Z | 2022-02-21T13:06:26.000Z | model-optimizer/extensions/front/caffe/conv_ext_test.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 1 | 2021-07-28T17:30:46.000Z | 2021-07-28T17:30:46.000Z | """
Copyright (C) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 36.982857 | 120 | 0.541023 |
cdfff9a6e3a8e5c1cefd321143fc2559e2d537f1 | 116 | py | Python | Tests/Methods/Import/__init__.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | 2 | 2020-06-29T13:48:37.000Z | 2021-06-15T07:34:05.000Z | Tests/Methods/Import/__init__.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | Tests/Methods/Import/__init__.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | from pyleecan.Tests import TEST_DIR
from os.path import join
test_file = join(TEST_DIR, "Data", "TestXlsLoad.xls")
| 23.2 | 53 | 0.775862 |
ef3cb7f3b9870012c29aa95bfc683269e2bee6be | 3,997 | py | Python | config/pk_avg_2d_desi_choices.py | nam8/Barry | 5deb15d71d620079aa46ced73e23b1da8b9c4e57 | [
"MIT"
] | 13 | 2019-07-29T20:39:20.000Z | 2021-09-26T09:20:52.000Z | config/pk_avg_2d_desi_choices.py | nam8/Barry | 5deb15d71d620079aa46ced73e23b1da8b9c4e57 | [
"MIT"
] | 1 | 2021-02-11T10:54:58.000Z | 2021-02-11T10:54:58.000Z | config/pk_avg_2d_desi_choices.py | nam8/Barry | 5deb15d71d620079aa46ced73e23b1da8b9c4e57 | [
"MIT"
] | 7 | 2019-08-26T04:54:00.000Z | 2022-01-20T14:47:47.000Z | import sys
import os
import pandas as pd
from scipy.interpolate import interp1d
from scipy.stats import norm
import numpy as np
sys.path.append("..")
from barry.datasets.dataset_power_spectrum import PowerSpectrum_DESIMockChallenge0_Z01
from barry.cosmology.camb_generator import getCambGenerator
from barry.postproces... | 44.411111 | 156 | 0.665499 |
ffc5bf66143ae0317ec7dddfe539278848efd933 | 1,130 | py | Python | setup.py | adefossez/prioheap | b60d673ad0356bd92ecddf27b3e67e33c916aebb | [
"Unlicense"
] | 1 | 2020-12-05T17:48:23.000Z | 2020-12-05T17:48:23.000Z | setup.py | adefossez/prioheap | b60d673ad0356bd92ecddf27b3e67e33c916aebb | [
"Unlicense"
] | null | null | null | setup.py | adefossez/prioheap | b60d673ad0356bd92ecddf27b3e67e33c916aebb | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# Inspired from https://github.com/kennethreitz/setup.py
from pathlib import Path
from setuptools import setup
NAME = 'prioheap'
DESCRIPTION = 'Priority queue with a sane API'
URL = 'https://github.com/adefossez/prioheap'
EMAIL = 'alexandre.defossez@gmail.com'
AUTHOR = 'Alexandre Défossez'
REQ... | 24.565217 | 76 | 0.70177 |
3cd4f23599d42d9b51adafa4ab3f2c7323301382 | 3,649 | py | Python | efficiency_statics/modified_package/torch_stat/compute_flops.py | MendelXu/ANN | f4eabeb27dbba5c9bdcf83d03776bffa34995666 | [
"Apache-2.0"
] | 308 | 2019-08-11T02:12:37.000Z | 2022-03-30T07:20:41.000Z | efficiency_statics/modified_package/torch_stat/compute_flops.py | pinglmlcv/ANN | f4eabeb27dbba5c9bdcf83d03776bffa34995666 | [
"Apache-2.0"
] | 19 | 2019-08-22T04:57:33.000Z | 2022-03-27T10:59:23.000Z | efficiency_statics/modified_package/torch_stat/compute_flops.py | pinglmlcv/ANN | f4eabeb27dbba5c9bdcf83d03776bffa34995666 | [
"Apache-2.0"
] | 64 | 2019-08-17T07:09:50.000Z | 2022-03-27T11:23:39.000Z | import torch.nn as nn
import torch
import numpy as np
def compute_flops(module, inp, out):
if isinstance(module, nn.Conv2d):
return compute_Conv2d_flops(module, inp, out)
elif isinstance(module, nn.BatchNorm2d):
return compute_BatchNorm2d_flops(module, inp, out)
elif isinstance(module, (nn.... | 32.580357 | 96 | 0.679638 |
d705d67c509c0b07fa068e7903002176ba749533 | 190 | py | Python | examples/DeepWisdom/at_speech/classifier/__init__.py | zichuan-scott-xu/automl-workflow | d108e55da943775953b9f1801311a86ac07e58a0 | [
"Apache-2.0"
] | 3 | 2020-12-15T02:40:43.000Z | 2021-01-14T02:32:13.000Z | examples/DeepWisdom/at_speech/classifier/__init__.py | zichuan-scott-xu/automl-workflow | d108e55da943775953b9f1801311a86ac07e58a0 | [
"Apache-2.0"
] | null | null | null | examples/DeepWisdom/at_speech/classifier/__init__.py | zichuan-scott-xu/automl-workflow | d108e55da943775953b9f1801311a86ac07e58a0 | [
"Apache-2.0"
] | 4 | 2021-01-07T05:41:38.000Z | 2021-04-07T08:02:22.000Z | from at_speech.classifier.sklearn_lr import SLLRLiblinear, SLLRSag
from at_speech.classifier.cnn import CNNClassifier
from at_speech.classifier.thinresnet34_cls import ThinResnet34Classifier | 63.333333 | 72 | 0.9 |
abd62581a48747855d6f8d2701f66fe4ce14c0da | 5,110 | py | Python | electrode/clients/lib/displays/display_gui_elements.py | krbjila/labrad_tools | 5c510cb35090807807bfe6bd910b9c35edce6fce | [
"MIT"
] | 1 | 2020-11-30T01:45:08.000Z | 2020-11-30T01:45:08.000Z | electrode/clients/lib/displays/display_gui_elements.py | krbjila/labrad_tools | 5c510cb35090807807bfe6bd910b9c35edce6fce | [
"MIT"
] | 8 | 2021-02-23T00:18:12.000Z | 2022-03-12T00:54:50.000Z | electrode/clients/lib/displays/display_gui_elements.py | krbjila/labrad_tools | 5c510cb35090807807bfe6bd910b9c35edce6fce | [
"MIT"
] | 1 | 2020-11-08T14:54:21.000Z | 2020-11-08T14:54:21.000Z | import json
import time
import numpy as np
import os
import sys
from PyQt4 import QtGui, QtCore, Qt
from PyQt4.QtCore import pyqtSignal
from twisted.internet.defer import inlineCallbacks
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4ag... | 26.894737 | 90 | 0.651076 |
85671b3e156793095852946fcfa8a1fa56e561bf | 2,752 | py | Python | mep/people/tests/test_people_commands.py | making-books-ren-today/test_eval_3_shxco | 5a6427abeb4aec1aa70c0d9a4b32d028012780c8 | [
"Apache-2.0"
] | 3 | 2020-05-12T19:19:41.000Z | 2021-04-07T13:56:32.000Z | mep/people/tests/test_people_commands.py | making-books-ren-today/test_eval_3_shxco | 5a6427abeb4aec1aa70c0d9a4b32d028012780c8 | [
"Apache-2.0"
] | 736 | 2017-06-21T16:24:42.000Z | 2022-02-26T17:46:10.000Z | mep/people/tests/test_people_commands.py | making-books-ren-today/test_eval_3_shxco | 5a6427abeb4aec1aa70c0d9a4b32d028012780c8 | [
"Apache-2.0"
] | null | null | null | import datetime
from io import StringIO
from django.test import TestCase
from mep.accounts.models import Event
from mep.people.management.commands import export_members
from mep.people.models import Person
class TestExportMembers(TestCase):
fixtures = ['sample_people']
def setUp(self):
self.cmd = e... | 39.314286 | 76 | 0.662427 |
ab7434daee3f5d52f82bc375044d0ccce35ac6ab | 7,368 | py | Python | pytest_cases/case_funcs_new.py | chinghwayu/python-pytest-cases | a95f2a50c201a10c6a2aa2544bd1ea39aab23a47 | [
"BSD-3-Clause"
] | null | null | null | pytest_cases/case_funcs_new.py | chinghwayu/python-pytest-cases | a95f2a50c201a10c6a2aa2544bd1ea39aab23a47 | [
"BSD-3-Clause"
] | null | null | null | pytest_cases/case_funcs_new.py | chinghwayu/python-pytest-cases | a95f2a50c201a10c6a2aa2544bd1ea39aab23a47 | [
"BSD-3-Clause"
] | null | null | null | from copy import copy
from decopatch import function_decorator, DECORATED
# try: # python 3.2+
# from functools import lru_cache as lru
# except ImportError:
# from functools32 import lru_cache as lru # noqa
try: # python 3.5+
from typing import Type, Callable, Union, Optional, Any, Tuple, Dict, Itera... | 33.339367 | 134 | 0.616042 |
1ee8bcff3db1a902043f572a4dcdc3f4697712e1 | 236 | py | Python | handbook/urls.py | UICHCC/uicCourse | 3c34d0f765e583be05f084df1e6ab63b1ed62ed6 | [
"MIT"
] | 3 | 2018-03-13T02:00:43.000Z | 2019-03-24T02:46:56.000Z | handbook/urls.py | UICHCC/uicCourse | 3c34d0f765e583be05f084df1e6ab63b1ed62ed6 | [
"MIT"
] | 65 | 2018-02-08T16:01:53.000Z | 2021-11-10T14:59:37.000Z | handbook/urls.py | UICHCC/uicCourse | 3c34d0f765e583be05f084df1e6ab63b1ed62ed6 | [
"MIT"
] | 2 | 2018-06-02T06:06:22.000Z | 2019-04-18T03:27:16.000Z | from django.urls import path
from . import views
urlpatterns = [
path('handbook/', views.handbook, name='handbook_home'),
path('handbook/<str:r_major>/<int:admission_year>/', views.handbook_content, name='handbook_content')
]
| 26.222222 | 105 | 0.728814 |
a185fc979dc20f08a08e6ec3c4ec20007ea2b21e | 467 | py | Python | src/senor_octopus/sources/static.py | betodealmeida/senor-octopus | 362d4cb8d5ac7fea620c2b4d46e807bb614a59bd | [
"MIT"
] | 7 | 2021-03-24T18:29:21.000Z | 2021-11-15T21:13:25.000Z | src/senor_octopus/sources/static.py | betodealmeida/senor-octopus | 362d4cb8d5ac7fea620c2b4d46e807bb614a59bd | [
"MIT"
] | null | null | null | src/senor_octopus/sources/static.py | betodealmeida/senor-octopus | 362d4cb8d5ac7fea620c2b4d46e807bb614a59bd | [
"MIT"
] | null | null | null | from datetime import datetime
from datetime import timezone
from senor_octopus.types import Stream
async def static(name: str, value: str) -> Stream:
"""
Generate static events.
Parameters
----------
name
Name of the event
value
Value of the event
Yields
------
E... | 16.678571 | 50 | 0.567452 |
dd6b0456350bc14aa3ae735f16460f72e02a1716 | 374 | py | Python | 30 Days of Code/26NestedLogic.py | devansh-pratap-singh/hackerrank-solutions | 227817d90846424cd3078e60b225eb201e906cf9 | [
"MIT"
] | 1 | 2020-10-15T14:03:52.000Z | 2020-10-15T14:03:52.000Z | 30 Days of Code/26NestedLogic.py | devansh-pratap-singh/HackerRank-Solutions | 227817d90846424cd3078e60b225eb201e906cf9 | [
"MIT"
] | null | null | null | 30 Days of Code/26NestedLogic.py | devansh-pratap-singh/HackerRank-Solutions | 227817d90846424cd3078e60b225eb201e906cf9 | [
"MIT"
] | null | null | null | actually = str(input()).split(" ")
da = int(actually[0])
ma = int(actually[1])
ya = int(actually[2])
expected = str(input()).split(" ")
de = int(expected[0])
me = int(expected[1])
ye = int(expected[2])
fine = 0
if ya > ye:
fine = 10000
elif ya == ye:
if ma > me:
fine = (ma - me) * 500
elif ma == me ... | 22 | 34 | 0.548128 |
fc040f7fa72d51bdc3e56c7991173ab769c2eedf | 7,446 | py | Python | hh_deep_deep/dd_crawl.py | TeamHG-Memex/hh-deep-deep | a4629392115580dec48b468850e48f53e9f3547d | [
"MIT"
] | 1 | 2017-11-14T10:13:49.000Z | 2017-11-14T10:13:49.000Z | hh_deep_deep/dd_crawl.py | afcarl/hh-deep-deep | a4629392115580dec48b468850e48f53e9f3547d | [
"MIT"
] | null | null | null | hh_deep_deep/dd_crawl.py | afcarl/hh-deep-deep | a4629392115580dec48b468850e48f53e9f3547d | [
"MIT"
] | 2 | 2018-06-14T18:32:16.000Z | 2020-05-29T14:14:30.000Z | from collections import deque
import json
import logging
from pathlib import Path
import re
import math
import multiprocessing
import subprocess
from typing import Any, Dict, Optional
from .crawl_utils import JsonLinesFollower
from .dd_utils import BaseDDPaths, BaseDDCrawlerProcess, is_running
from .deepdeep_crawl imp... | 43.54386 | 80 | 0.571985 |
076cbc86cebb590cc9686130a8c3f42a7c4485f8 | 9,524 | py | Python | sdk/python/feast/inference.py | ibnummuhammad/feast | 1fd9c2def1fbaca68e865a7c67336793ddb25582 | [
"Apache-2.0"
] | null | null | null | sdk/python/feast/inference.py | ibnummuhammad/feast | 1fd9c2def1fbaca68e865a7c67336793ddb25582 | [
"Apache-2.0"
] | null | null | null | sdk/python/feast/inference.py | ibnummuhammad/feast | 1fd9c2def1fbaca68e865a7c67336793ddb25582 | [
"Apache-2.0"
] | null | null | null | import re
from typing import List
from feast import BigQuerySource, Entity, FileSource, RedshiftSource, SnowflakeSource
from feast.data_source import DataSource, PushSource, RequestSource
from feast.errors import RegistryInferenceFailure
from feast.feature_view import FeatureView
from feast.field import Field, from_va... | 43.889401 | 119 | 0.591348 |
08f366c273224e96a8c3281648742e5f5f4d506d | 1,204 | py | Python | ciphey/basemods/Decoders/tap_code.py | AlexandruValeanu/Ciphey | 58323db4443b0d29d7797dadab88955a02da8812 | [
"MIT"
] | 9,908 | 2020-06-06T01:06:50.000Z | 2022-03-31T21:22:57.000Z | ciphey/basemods/Decoders/tap_code.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 423 | 2020-05-30T11:44:37.000Z | 2022-03-18T03:15:30.000Z | ciphey/basemods/Decoders/tap_code.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 714 | 2020-06-09T20:24:41.000Z | 2022-03-29T15:28:53.000Z | # by https://github.com/RustyDucky and https://github.com/lukasgabriel
from typing import Dict, Optional
from ciphey.iface import Config, Decoder, ParamSpec, T, Translation, U, registry
@registry.register
class Tap_code(Decoder[str]):
def decode(self, ctext: T) -> Optional[U]:
"""
Performs Tap c... | 27.363636 | 82 | 0.577243 |
cb808b5484d8346313c8c6e3b441fc243d667200 | 17,785 | py | Python | src/main/python/utils/dave_reader.py | godslayer201/dave | cc084e84327ab94dda0b2228f955d42cc152bb45 | [
"Apache-2.0"
] | null | null | null | src/main/python/utils/dave_reader.py | godslayer201/dave | cc084e84327ab94dda0b2228f955d42cc152bb45 | [
"Apache-2.0"
] | null | null | null | src/main/python/utils/dave_reader.py | godslayer201/dave | cc084e84327ab94dda0b2228f955d42cc152bb45 | [
"Apache-2.0"
] | null | null | null |
import os
import utils.dave_logger as logging
import utils.exception_helper as ExHelper
import magic
import model.dataset as DataSet
import numpy as np
from astropy.io import fits
from hendrics.io import load_events_and_gtis
from stingray.gti import get_gti_from_all_extensions
from hendrics.lcurve import lcurve_from... | 41.456876 | 176 | 0.654709 |
a6f2dac0dbbaef1cd4e79c32f4d6646abcb828bd | 9,988 | py | Python | scripts/convert_to_nwb.py | vathes/najafi-2018-nwb | 28c9deb1e8be55c8a1bbdcb2d899dae725e04534 | [
"MIT"
] | 4 | 2018-12-12T21:54:07.000Z | 2019-08-15T15:06:02.000Z | scripts/convert_to_nwb.py | deeptimittal12/najafi-2018-nwb | 28c9deb1e8be55c8a1bbdcb2d899dae725e04534 | [
"MIT"
] | 8 | 2019-01-03T00:34:51.000Z | 2020-03-23T15:10:42.000Z | scripts/convert_to_nwb.py | deeptimittal12/najafi-2018-nwb | 28c9deb1e8be55c8a1bbdcb2d899dae725e04534 | [
"MIT"
] | 8 | 2018-12-06T23:08:40.000Z | 2020-03-31T20:01:24.000Z | #!/usr/bin/env python3
import os
import sys
from datetime import datetime
from dateutil.tz import tzlocal
from pathlib import Path
import pytz
import re
import json
import numpy as np
import scipy.io as sio
import pynwb
from pynwb import NWBFile, NWBHDF5IO, ophys as nwb_ophys
from collections import defaultdict
import... | 46.02765 | 136 | 0.64998 |
572069496de1d3f36a652c763d091f904c2ec6a2 | 2,001 | py | Python | src/sources/flyinglines.py | diogenes895/lightnovel-crawler | 69162799b05c7a84845e87f4d95041715c77c2ba | [
"Apache-2.0"
] | null | null | null | src/sources/flyinglines.py | diogenes895/lightnovel-crawler | 69162799b05c7a84845e87f4d95041715c77c2ba | [
"Apache-2.0"
] | null | null | null | src/sources/flyinglines.py | diogenes895/lightnovel-crawler | 69162799b05c7a84845e87f4d95041715c77c2ba | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import logging
import re
from urllib.parse import urlparse
from ..utils.crawler import Crawler
logger = logging.getLogger('FLYING LINES')
chapter_body_url = 'https://www.flying-lines.com/h5/novel/%s/%s?accessToken=&isFirstEnter=1'
class FlyingLinesCrawler(Crawler):
base_url =... | 33.915254 | 92 | 0.586707 |
384b1e61c792199dd2f2f979a80900fb460127b5 | 4,523 | py | Python | plot/silence-attack/silence-attack.py | tncheng/bamboo | 2e52d3728733fb07f25d9ff6207cba871127af34 | [
"MIT"
] | 15 | 2020-09-29T11:30:28.000Z | 2022-03-30T07:51:39.000Z | plot/silence-attack/silence-attack.py | tncheng/bamboo | 2e52d3728733fb07f25d9ff6207cba871127af34 | [
"MIT"
] | 5 | 2020-11-09T09:22:20.000Z | 2021-11-23T02:46:24.000Z | plot/silence-attack/silence-attack.py | tncheng/bamboo | 2e52d3728733fb07f25d9ff6207cba871127af34 | [
"MIT"
] | 8 | 2020-10-26T13:11:36.000Z | 2022-02-15T19:34:55.000Z | import matplotlib.pyplot as plt
# Measurements from forking-attack.data
cgr = [
('HotStuff',[
1.0, 0.93, 0.864, 0.807, 0.738, 0.637
], '-o', 'coral'),
('2CHS',[
1.0, 0.935, 0.872, 0.810, 0.742, 0.643
], '-^', 'darkseagreen'),
('Streamlet',[
1.0, 1.0, 1.0, 1.0, 1.0, 1.0
]... | 31.193103 | 133 | 0.488835 |
1634c90e2095fffbc4b82e192c96271305556a79 | 1,165 | py | Python | tests/stream_test.py | aplanas/aioredis | be5ae76ce2c43a1316e6e86365215a0e26be49b3 | [
"MIT"
] | 18 | 2020-10-05T05:38:39.000Z | 2022-01-06T07:40:09.000Z | tests/stream_test.py | aplanas/aioredis | be5ae76ce2c43a1316e6e86365215a0e26be49b3 | [
"MIT"
] | 4 | 2020-10-22T19:27:22.000Z | 2022-03-10T02:03:40.000Z | tests/stream_test.py | aplanas/aioredis | be5ae76ce2c43a1316e6e86365215a0e26be49b3 | [
"MIT"
] | 8 | 2021-01-03T16:56:50.000Z | 2021-08-20T09:07:12.000Z | import pytest
from aioredis.stream import StreamReader
from aioredis.parser import PyReader
from aioredis.errors import (
ProtocolError,
ReplyError
)
@pytest.fixture
def reader(loop):
reader = StreamReader(loop=loop)
reader.set_parser(
PyReader(protocolError=ProtocolError, replyError=ReplyErr... | 23.3 | 68 | 0.717597 |
96d32e1db12299dccc064d49dec8f315d6dc452c | 983 | py | Python | dizoo/mujoco/entry/mujoco_cql_generation_main.py | jayyoung0802/DI-engine | efbb35ddaf184d1009291e6842fbbae09f193492 | [
"Apache-2.0"
] | 1 | 2022-03-21T16:15:39.000Z | 2022-03-21T16:15:39.000Z | dizoo/mujoco/entry/mujoco_cql_generation_main.py | jayyoung0802/DI-engine | efbb35ddaf184d1009291e6842fbbae09f193492 | [
"Apache-2.0"
] | null | null | null | dizoo/mujoco/entry/mujoco_cql_generation_main.py | jayyoung0802/DI-engine | efbb35ddaf184d1009291e6842fbbae09f193492 | [
"Apache-2.0"
] | null | null | null | from dizoo.mujoco.config.hopper_sac_data_generation_config import main_config, create_config
from ding.entry import collect_demo_data, eval
import torch
import copy
def eval_ckpt(args):
config = copy.deepcopy([main_config, create_config])
eval(config, seed=args.seed, load_path=main_config.policy.learn.learner... | 29.787879 | 102 | 0.741607 |
0e69ad2b0fdfa4c3585930246012411b66e51c4d | 1,715 | py | Python | samples/python/13.core-bot/envs/chat_bot_02/Lib/site-packages/recognizers_choice/choice/recognizers_choice.py | luzeunice/BotBuilder-Samples | b62be4e8863125a567902b736b7b74313d9d4f28 | [
"MIT"
] | 10 | 2019-05-11T18:07:14.000Z | 2021-08-20T03:02:47.000Z | samples/python/13.core-bot/envs/chat_bot_02/Lib/site-packages/recognizers_choice/choice/recognizers_choice.py | luzeunice/BotBuilder-Samples | b62be4e8863125a567902b736b7b74313d9d4f28 | [
"MIT"
] | 1 | 2020-07-10T08:25:36.000Z | 2020-07-10T08:25:36.000Z | samples/python/13.core-bot/envs/chat_bot_02/Lib/site-packages/recognizers_choice/choice/recognizers_choice.py | luzeunice/BotBuilder-Samples | b62be4e8863125a567902b736b7b74313d9d4f28 | [
"MIT"
] | 18 | 2019-08-19T12:11:00.000Z | 2021-10-12T09:36:27.000Z | from enum import IntFlag
from typing import List
from recognizers_choice.choice.extractors import BooleanExtractor
from recognizers_choice.choice.english import EnglishBooleanExtractorConfiguration
from recognizers_choice.choice.models import BooleanModel
from recognizers_choice.choice.parsers import BooleanParser
fro... | 41.829268 | 131 | 0.746356 |
57bbcccc4f66fc5ff1fc7f9accec441f1ee23f63 | 26,562 | py | Python | pyformlang/finite_automaton/tests/test_epsilon_nfa.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | null | null | null | pyformlang/finite_automaton/tests/test_epsilon_nfa.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | 1 | 2020-07-22T11:40:30.000Z | 2020-07-22T11:40:30.000Z | pyformlang/finite_automaton/tests/test_epsilon_nfa.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | null | null | null | """
Tests for epsilon NFA
"""
import unittest
import networkx
from pyformlang.finite_automaton import EpsilonNFA, State, Symbol, Epsilon
from ..regexable import Regexable
class TestEpsilonNFA(unittest.TestCase):
""" Tests epsilon NFA """
def test_eclose(self):
""" Test of the epsilon closure """
... | 39.23486 | 89 | 0.630035 |
29083c95c37c729da72bea259c7be42f433d9c31 | 1,566 | py | Python | znail/ui/api/disciplines/packet_loss.py | Zenterio/znail | 68cd3a4b5ae866f3a8846ce1d0fb5f89428a6b18 | [
"Apache-2.0"
] | 4 | 2019-02-20T09:40:49.000Z | 2019-11-19T21:18:44.000Z | znail/ui/api/disciplines/packet_loss.py | Zenterio/znail | 68cd3a4b5ae866f3a8846ce1d0fb5f89428a6b18 | [
"Apache-2.0"
] | 4 | 2019-03-11T15:24:17.000Z | 2019-06-14T14:31:01.000Z | znail/ui/api/disciplines/packet_loss.py | Zenterio/znail | 68cd3a4b5ae866f3a8846ce1d0fb5f89428a6b18 | [
"Apache-2.0"
] | 2 | 2019-03-05T19:04:06.000Z | 2019-09-08T13:53:10.000Z | import flask_restplus
import marshmallow
from znail.netem.disciplines import PacketLoss
from znail.netem.tc import Tc
from znail.ui import api
from znail.ui.util import NoneAttributes, json_request_handler
class PacketLossSchema(marshmallow.Schema):
percent = marshmallow.fields.Float(required=True, validate=lamb... | 29.54717 | 93 | 0.693487 |
8872ed7a466ebc245183bf28a4c9a492d71048d7 | 4,628 | py | Python | ckan/lib/dictization/__init__.py | derhecht/ckan | 27f0b8cf52bb2140f16e2f09f3c42ed15e7e9b99 | [
"BSD-3-Clause"
] | 6 | 2015-11-09T00:44:51.000Z | 2019-11-21T14:56:01.000Z | ckan/lib/dictization/__init__.py | derhecht/ckan | 27f0b8cf52bb2140f16e2f09f3c42ed15e7e9b99 | [
"BSD-3-Clause"
] | 39 | 2015-02-18T17:32:23.000Z | 2022-03-11T18:03:36.000Z | ckan/lib/dictization/__init__.py | derhecht/ckan | 27f0b8cf52bb2140f16e2f09f3c42ed15e7e9b99 | [
"BSD-3-Clause"
] | 17 | 2015-03-13T18:05:05.000Z | 2020-11-06T13:55:32.000Z | # encoding: utf-8
import datetime
from sqlalchemy.orm import class_mapper
import sqlalchemy
from six import text_type
from ckan.model.core import State
try:
RowProxy = sqlalchemy.engine.result.RowProxy
except AttributeError:
RowProxy = sqlalchemy.engine.base.RowProxy
try:
long # Python 2
except N... | 29.291139 | 85 | 0.638073 |
76d61acf90d2dbc79be30ebb7740d560ef46cb63 | 7,438 | py | Python | util/cpt_upgrader.py | volnxebec/CC_Fused | e2b805e3475bd275409379c41eaeeb1a565cbdef | [
"BSD-3-Clause"
] | 5 | 2017-03-11T05:02:47.000Z | 2020-10-29T07:16:33.000Z | util/cpt_upgrader.py | volnxebec/CC_Fused | e2b805e3475bd275409379c41eaeeb1a565cbdef | [
"BSD-3-Clause"
] | 4 | 2015-01-13T18:27:31.000Z | 2015-01-13T18:27:57.000Z | util/cpt_upgrader.py | volnxebec/CC_Fused | e2b805e3475bd275409379c41eaeeb1a565cbdef | [
"BSD-3-Clause"
] | 3 | 2020-01-17T02:25:00.000Z | 2021-09-18T21:51:16.000Z | #!/usr/bin/env python
# Copyright (c) 2012 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation... | 39.775401 | 85 | 0.682307 |
147baae6b02fc702c8f6b25ed2c068527a7bc888 | 689 | py | Python | setup.py | DarthQadir/cardinality_cs110 | 5593251146d08ae215f746302d981e529e799afe | [
"MIT"
] | null | null | null | setup.py | DarthQadir/cardinality_cs110 | 5593251146d08ae215f746302d981e529e799afe | [
"MIT"
] | null | null | null | setup.py | DarthQadir/cardinality_cs110 | 5593251146d08ae215f746302d981e529e799afe | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="cardinality_cs110",
version="0.0.8",
author="Abdul Qadir",
author_email="abdul.qadir@minerva.kgi",
description="A cardinality estimator using the Flajolet-Martin algorithm",
... | 32.809524 | 79 | 0.667634 |
ccdd6e81e10c818e03b2cda2a631875d2ab95b71 | 41,002 | py | Python | lib/sqlalchemy/orm/persistence.py | paylogic/sqlalchemy | 876a487bf06a038efde7d46ce09e253b9247aae5 | [
"MIT"
] | 2 | 2015-11-07T11:55:45.000Z | 2017-09-04T07:56:34.000Z | lib/sqlalchemy/orm/persistence.py | paylogic/sqlalchemy | 876a487bf06a038efde7d46ce09e253b9247aae5 | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/persistence.py | paylogic/sqlalchemy | 876a487bf06a038efde7d46ce09e253b9247aae5 | [
"MIT"
] | null | null | null | # orm/persistence.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""private module containing functions used to emit INSERT, UPDATE
and DELETE state... | 37.755064 | 84 | 0.555997 |
9e6955230140b36903b090508845f354931d67d5 | 1,476 | py | Python | monailabel/utils/scoring/dice.py | finalelement/MONAILabel | 3f63ffd4f49161076e77b7c74c733f6ce5cce78c | [
"Apache-2.0"
] | 1 | 2021-07-27T12:45:36.000Z | 2021-07-27T12:45:36.000Z | monailabel/utils/scoring/dice.py | finalelement/MONAILabel | 3f63ffd4f49161076e77b7c74c733f6ce5cce78c | [
"Apache-2.0"
] | null | null | null | monailabel/utils/scoring/dice.py | finalelement/MONAILabel | 3f63ffd4f49161076e77b7c74c733f6ce5cce78c | [
"Apache-2.0"
] | 1 | 2021-07-27T12:45:38.000Z | 2021-07-27T12:45:38.000Z | import logging
import numpy as np
from monai.transforms import LoadImage
from monailabel.interfaces.datastore import Datastore, DefaultLabelTag
from monailabel.interfaces.tasks import ScoringMethod
logger = logging.getLogger(__name__)
class Dice(ScoringMethod):
"""
Compute dice between final vs original ta... | 33.545455 | 100 | 0.640244 |
f403d9af744e172bc2d6a756449c54a23cd4542f | 426 | py | Python | Flask/app.py | Ahmad-Fahad/python-practice | bea29e1eeb691b6c457d1e47129f6c308a091f44 | [
"Apache-2.0"
] | null | null | null | Flask/app.py | Ahmad-Fahad/python-practice | bea29e1eeb691b6c457d1e47129f6c308a091f44 | [
"Apache-2.0"
] | null | null | null | Flask/app.py | Ahmad-Fahad/python-practice | bea29e1eeb691b6c457d1e47129f6c308a091f44 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, redirect, url_for
app = Flask(__name__)
@app.route("/")
def welcome():
return "<h1>Welcome to Flask Journey</h1>"
@app.route("/dashboard")
def dashboard():
return "<h2> Welcome to dashboard </h2>"
@app.route("/<name>")
def user(name):
return f"Hy {name} !"
@app.route("/admin")
... | 19.363636 | 51 | 0.638498 |
bd9c13a1b70195b31d8147cb019bbe2294c1e94b | 10,865 | py | Python | venv/Lib/site-packages/matplotlib/tests/test_tightlayout.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | 4 | 2021-09-13T07:48:44.000Z | 2021-11-03T13:41:29.000Z | venv/Lib/site-packages/matplotlib/tests/test_tightlayout.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/matplotlib/tests/test_tightlayout.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | 1 | 2021-09-27T07:12:39.000Z | 2021-09-27T07:12:39.000Z | import warnings
import numpy as np
from numpy.testing import assert_array_equal
import pytest
import matplotlib as mpl
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredOffsetbox, DrawingArea
from matplotlib.patches import Rec... | 32.725904 | 80 | 0.603682 |
ac524442cf0014ddeef356abe38adf1712ab77a2 | 2,320 | py | Python | processVideo.py | DylanGreene/working-title-ai-driving | a879f95a749d606785b3d143f7bf89de1231867b | [
"MIT"
] | null | null | null | processVideo.py | DylanGreene/working-title-ai-driving | a879f95a749d606785b3d143f7bf89de1231867b | [
"MIT"
] | null | null | null | processVideo.py | DylanGreene/working-title-ai-driving | a879f95a749d606785b3d143f7bf89de1231867b | [
"MIT"
] | null | null | null | """
processVideo.py
Date: 9 November 2018
This file will contain the entire pipeline for processing a video to determine the locations of the lane lines.
It will split the video into separate images and then determine the location of the lanes in each before regenerating a video with
the lane locations added.
"""
impor... | 30.12987 | 130 | 0.625862 |
67c1f83d13d367a603b543da266096803cfc5229 | 68,856 | py | Python | django/db/models/query.py | romulorosa/django | 12d0567aa5e82322543f0c0c126ba18c91a1e439 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2021-02-21T15:26:05.000Z | 2021-02-21T15:26:05.000Z | django/db/models/query.py | romulorosa/django | 12d0567aa5e82322543f0c0c126ba18c91a1e439 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/models/query.py | romulorosa/django | 12d0567aa5e82322543f0c0c126ba18c91a1e439 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-08-03T13:06:19.000Z | 2017-08-03T13:06:19.000Z | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import sys
import warnings
from collections import OrderedDict, deque
from django.conf import settings
from django.core import exceptions
from django.db import (
DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ... | 40.912656 | 115 | 0.613774 |
4a7036cc92df6c06944addba1db7773e8b8a3172 | 4,576 | py | Python | django_quicky/models.py | sametmax/django-quicky | 2a87dbdcc6db400aff5a9119533bd3784fc4afb4 | [
"Zlib"
] | 149 | 2015-01-02T19:48:47.000Z | 2022-02-18T15:43:34.000Z | django_quicky/models.py | keshapps/django-quicky | 2a87dbdcc6db400aff5a9119533bd3784fc4afb4 | [
"Zlib"
] | 3 | 2015-01-28T18:44:42.000Z | 2017-05-23T18:50:02.000Z | django_quicky/models.py | keshapps/django-quicky | 2a87dbdcc6db400aff5a9119533bd3784fc4afb4 | [
"Zlib"
] | 11 | 2015-01-05T19:22:16.000Z | 2021-01-25T13:06:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
import types
from random import randint
__all__ = ['get_random_objects', 'get_object_or_none', 'patch_model']
def get_random_objects(model=None, queryset=None, count=float('+inf')):
"""
Get `count` random objects for a model... | 33.40146 | 84 | 0.609484 |
3ca6cf9252efe6cebd871cf6443614eacb42b391 | 161 | py | Python | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_PolyTrend_Seasonal_MonthOfYear_LSTM.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_PolyTrend_Seasonal_MonthOfYear_LSTM.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_PolyTrend_Seasonal_MonthOfYear_LSTM.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Fisher'] , ['PolyTrend'] , ['Seasonal_MonthOfYear'] , ['LSTM'] ); | 40.25 | 88 | 0.757764 |
ac4b596a23a53e64178b9e68372b8c51f26fc7ed | 78 | py | Python | plugins/google_directory/icon_google_directory/actions/get_all_domain_users/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/google_directory/icon_google_directory/actions/get_all_domain_users/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/google_directory/icon_google_directory/actions/get_all_domain_users/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .action import GetAllDomainUsers
| 26 | 39 | 0.794872 |
3994d92dce4474c91d39918ee5459d6f697f23f1 | 6,392 | py | Python | src/organisms/curator.py | flaviuvadan/proteoglycan-pathway-evolution | 9fa9c457946eaf932860b9c0c9ab5b0b37d02e6e | [
"MIT"
] | 1 | 2020-01-12T01:42:32.000Z | 2020-01-12T01:42:32.000Z | src/organisms/curator.py | flaviuvadan/proteoglycan-pathway-evolution | 9fa9c457946eaf932860b9c0c9ab5b0b37d02e6e | [
"MIT"
] | null | null | null | src/organisms/curator.py | flaviuvadan/proteoglycan-pathway-evolution | 9fa9c457946eaf932860b9c0c9ab5b0b37d02e6e | [
"MIT"
] | null | null | null | import csv
import json
import os
from src import exceptions
class Curator:
""" Curator is responsible for loading the 51 genes of interest, reading their orthologs, and parsing their
Ensembl results with the intention to create file with unique organisms for those genes """
GENE_NAME_IDX = 0
GENE_ID... | 47.348148 | 119 | 0.63689 |
ad59d44bc3969235a7b6ebe5c48a76ec6e134f76 | 300 | wsgi | Python | SetupLab/files/helloWorld.wsgi | david618/Centos | ca88a094424a32b064107e658e8e7b6fae7619b2 | [
"Apache-2.0"
] | null | null | null | SetupLab/files/helloWorld.wsgi | david618/Centos | ca88a094424a32b064107e658e8e7b6fae7619b2 | [
"Apache-2.0"
] | null | null | null | SetupLab/files/helloWorld.wsgi | david618/Centos | ca88a094424a32b064107e658e8e7b6fae7619b2 | [
"Apache-2.0"
] | null | null | null | def application(environ, start_response):
status = '200 OK'
output = b'Hello World! Python is so easy!\n'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
| 27.272727 | 61 | 0.623333 |
f6407f344c6b5e4d60c46e055589a9fa38623765 | 56,890 | py | Python | corehq/apps/sms/tests/test_backends.py | dborowiecki/commcare-hq | f2f4fa67faec09040a98502f5657444075b63f2e | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/sms/tests/test_backends.py | dborowiecki/commcare-hq | f2f4fa67faec09040a98502f5657444075b63f2e | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/sms/tests/test_backends.py | dborowiecki/commcare-hq | f2f4fa67faec09040a98502f5657444075b63f2e | [
"BSD-3-Clause"
] | null | null | null | import json
import uuid
from datetime import datetime
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from mock import patch
from six.moves.urllib.parse import urlencode
from dimagi.utils.couch.cache.cache_core import get_redis_client
from coreh... | 36.281888 | 111 | 0.643593 |
8999893aa633a5d1bff3f32e6e34765bc4649e25 | 668 | py | Python | manage.py | Paul-Ngigi/joy-childrens-home-backend | 9a631e37724c54e008ceda7ad205e753419e873b | [
"MIT"
] | null | null | null | manage.py | Paul-Ngigi/joy-childrens-home-backend | 9a631e37724c54e008ceda7ad205e753419e873b | [
"MIT"
] | null | null | null | manage.py | Paul-Ngigi/joy-childrens-home-backend | 9a631e37724c54e008ceda7ad205e753419e873b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'joy_children.settings')
try:
from django.core.management import execute_from_command_line
except... | 29.043478 | 76 | 0.681138 |
6dbb9579710e16f33918c485420e06328b9e9ef5 | 1,650 | py | Python | code/char_rnn.py | shubhamagarwal92/deep-learning-nlp-sentiment-analysis | 527bc76a7e106071e33140d67f70500a93666326 | [
"MIT"
] | null | null | null | code/char_rnn.py | shubhamagarwal92/deep-learning-nlp-sentiment-analysis | 527bc76a7e106071e33140d67f70500a93666326 | [
"MIT"
] | null | null | null | code/char_rnn.py | shubhamagarwal92/deep-learning-nlp-sentiment-analysis | 527bc76a7e106071e33140d67f70500a93666326 | [
"MIT"
] | null | null | null |
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Flatten
from keras.layers.embeddings import Embedding
from keras.preprocessing import sequence
from keras.layers import Dropout
from keras.layers import LSTM
from keras.layers import Activation
max_features = 68
embedding_di... | 35.106383 | 97 | 0.612727 |
6db256f66c7fdbf9a6d67425101f7f8891f60f19 | 1,734 | py | Python | tensorflow/python/data/experimental/kernel_tests/serialization/unique_dataset_serialization_test.py | DanMitroshin/tensorflow | 74aa353842f1788bdb7506ecceaf6ba99140e165 | [
"Apache-2.0"
] | 2 | 2020-01-17T09:11:24.000Z | 2021-12-30T04:57:15.000Z | tensorflow/python/data/experimental/kernel_tests/serialization/unique_dataset_serialization_test.py | DanMitroshin/tensorflow | 74aa353842f1788bdb7506ecceaf6ba99140e165 | [
"Apache-2.0"
] | 7 | 2021-11-10T20:21:23.000Z | 2022-03-22T19:18:39.000Z | tensorflow/python/data/experimental/kernel_tests/serialization/unique_dataset_serialization_test.py | DanMitroshin/tensorflow | 74aa353842f1788bdb7506ecceaf6ba99140e165 | [
"Apache-2.0"
] | 3 | 2021-05-09T13:41:29.000Z | 2021-06-24T06:12:05.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.533333 | 80 | 0.745098 |
fa4177443f583329fb7186f209650d569f4973e5 | 5,132 | py | Python | nmtpytorch/models/mnmt.py | fmetze/nmtpytorch | 658a39a2c50e4e9e2fde69b520ddac7efc083257 | [
"MIT"
] | null | null | null | nmtpytorch/models/mnmt.py | fmetze/nmtpytorch | 658a39a2c50e4e9e2fde69b520ddac7efc083257 | [
"MIT"
] | null | null | null | nmtpytorch/models/mnmt.py | fmetze/nmtpytorch | 658a39a2c50e4e9e2fde69b520ddac7efc083257 | [
"MIT"
] | 1 | 2020-07-22T19:25:53.000Z | 2020-07-22T19:25:53.000Z | # -*- coding: utf-8 -*-
import torch
import logging
from .nmt import NMT
from ..layers import MultimodalTextEncoder
from ..layers import ConditionalDecoder
logger = logging.getLogger('nmtpytorch')
class MultimodalNMT(NMT):
"""A encoder/decoder enriched multimodal NMT.
Integration types (feat_fusion arg... | 43.491525 | 86 | 0.609509 |
5b99b64916d736176349d9e676591dd5ca479ce8 | 3,081 | py | Python | qa/rpc-tests/invalidateblock.py | stakecom/stakework | a2110b0ba6aa9638a18c2e7ae12f0f229e074f35 | [
"MIT"
] | null | null | null | qa/rpc-tests/invalidateblock.py | stakecom/stakework | a2110b0ba6aa9638a18c2e7ae12f0f229e074f35 | [
"MIT"
] | null | null | null | qa/rpc-tests/invalidateblock.py | stakecom/stakework | a2110b0ba6aa9638a18c2e7ae12f0f229e074f35 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test InvalidateBlock code
#
from test_framework.test_framework import StakeWorkTestFramework
from te... | 40.012987 | 95 | 0.642324 |
b7a6b27b0eb8bda8a22bd8d2ceba0c5de4d111b6 | 1,179 | py | Python | NMTK_apps/NMTK_apps/wsgi.py | jrawbits/nmtk-1 | 759781770b5f2464008ceb5376fd3922b1b877fa | [
"Unlicense"
] | null | null | null | NMTK_apps/NMTK_apps/wsgi.py | jrawbits/nmtk-1 | 759781770b5f2464008ceb5376fd3922b1b877fa | [
"Unlicense"
] | null | null | null | NMTK_apps/NMTK_apps/wsgi.py | jrawbits/nmtk-1 | 759781770b5f2464008ceb5376fd3922b1b877fa | [
"Unlicense"
] | null | null | null | """
WSGI config for NMTK_apps project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... | 39.3 | 79 | 0.810008 |
918da32e48cf3e128cfec79d4e6b97eaa9923a04 | 208 | py | Python | DIR.py | romchegue/Python | 444476088e64d5da66cb00174f3d1d30ebbe38f6 | [
"bzip2-1.0.6"
] | null | null | null | DIR.py | romchegue/Python | 444476088e64d5da66cb00174f3d1d30ebbe38f6 | [
"bzip2-1.0.6"
] | null | null | null | DIR.py | romchegue/Python | 444476088e64d5da66cb00174f3d1d30ebbe38f6 | [
"bzip2-1.0.6"
] | null | null | null |
def DIR(L): #L is dir()
D = {}
for i in L:
if i[:2] != '__':
D[i] = str(eval(i))
return(D)
for i in DIR(L):
print(i + '\t--->\t' + DIR(L)[i])
input()
| 14.857143 | 38 | 0.346154 |
d83ff78f690d2c365bbf105245407998bba506d1 | 3,004 | py | Python | tests/create-test.py | mgorny/glep63-check | 820dd55e3c667edfaeff165cd990c121f436c108 | [
"BSD-2-Clause"
] | null | null | null | tests/create-test.py | mgorny/glep63-check | 820dd55e3c667edfaeff165cd990c121f436c108 | [
"BSD-2-Clause"
] | 4 | 2018-07-21T20:04:37.000Z | 2019-05-06T12:26:56.000Z | tests/create-test.py | mgorny/glep63-check | 820dd55e3c667edfaeff165cd990c121f436c108 | [
"BSD-2-Clause"
] | 1 | 2018-07-21T19:54:38.000Z | 2018-07-21T19:54:38.000Z | #!/usr/bin/env python
# Write a test case based on key file.
# (c) 2018 Michał Górny
# Released under the terms of 2-clause BSD license.
import enum
import io
import os.path
import subprocess
import sys
sys.path.insert(0, '.')
from glep63.check import (check_key,)
from glep63.gnupg import (process_gnupg_colons,)
fro... | 27.559633 | 72 | 0.514647 |
cd536f2d215dda7d7517b6f1e00ae18e9b0770bb | 1,896 | py | Python | plugins/schnitzelplats.py | nyson/mat | d74bde5c164fdf3d387626aa1856ae70acdb1667 | [
"MIT"
] | null | null | null | plugins/schnitzelplats.py | nyson/mat | d74bde5c164fdf3d387626aa1856ae70acdb1667 | [
"MIT"
] | null | null | null | plugins/schnitzelplats.py | nyson/mat | d74bde5c164fdf3d387626aa1856ae70acdb1667 | [
"MIT"
] | null | null | null | import datetime
import json
from functools import reduce
__days = [
"Måndag",
"Tisdag",
"Onsdag",
"Torsdag",
"Fredag"
]
__weekly_headers = [
"Alltid på Platz",
"Veckans Schnitzel",
"Veckans vegetariska"
]
def name():
return "Schnitzelplatz"
def food(api, date):
def collaps... | 27.478261 | 97 | 0.552215 |
d5e39c84197c85468fbbaec022fd298d1df492f1 | 248 | py | Python | parsers/faparser.py | sWski/beerlist | 4279bd37f6ee15aadadfabe978f12af734fe12d2 | [
"Unlicense"
] | 1 | 2020-02-25T11:08:45.000Z | 2020-02-25T11:08:45.000Z | parsers/faparser.py | sWski/beerlist | 4279bd37f6ee15aadadfabe978f12af734fe12d2 | [
"Unlicense"
] | 1 | 2020-06-25T07:20:19.000Z | 2020-06-25T07:20:19.000Z | parsers/faparser.py | sWski/beerlist | 4279bd37f6ee15aadadfabe978f12af734fe12d2 | [
"Unlicense"
] | 4 | 2020-04-16T18:39:34.000Z | 2021-11-12T15:20:44.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import common as beerlib
html = beerlib.download_html('https://untappd.com/v/fa-bar-oranzova/1728532')
if not html:
exit(-1)
beerlib.process_untappd(html, 'F.A. Bar Oranžová', sys.argv)
| 20.666667 | 77 | 0.709677 |
306368ba13eac86188bc92a8cee1252afa5facb1 | 4,467 | py | Python | landlab/graph/structured_quad/tests/test_quad.py | cctrunz/landlab | 4e4ef12f4bae82bc5194f1dcc9af8ff1a7c20939 | [
"MIT"
] | null | null | null | landlab/graph/structured_quad/tests/test_quad.py | cctrunz/landlab | 4e4ef12f4bae82bc5194f1dcc9af8ff1a7c20939 | [
"MIT"
] | 1 | 2016-03-16T02:34:08.000Z | 2016-04-20T19:31:30.000Z | landlab/graph/structured_quad/tests/test_quad.py | cctrunz/landlab | 4e4ef12f4bae82bc5194f1dcc9af8ff1a7c20939 | [
"MIT"
] | null | null | null | """Test StructuredQuadGraph."""
from numpy.testing import assert_array_almost_equal, assert_array_equal
from landlab.graph import StructuredQuadGraph
def test_create():
"""Test creating a quad graph."""
y = [0, 1, 3, 0, 1, 3, 0, 1, 3]
x = [3, 3, 3, 4, 4, 4, 6, 6, 6]
graph = StructuredQuadGraph((y, x)... | 25.820809 | 88 | 0.411238 |
7636193cebdc7d67ba2e8af280e376d0c4a5c8e8 | 1,080 | py | Python | test/nlp/test_autohf_tokenclassification.py | Qiaochu-Song/FLAML | 28511340528dfc9def29862f5076b4516eb7305f | [
"MIT"
] | null | null | null | test/nlp/test_autohf_tokenclassification.py | Qiaochu-Song/FLAML | 28511340528dfc9def29862f5076b4516eb7305f | [
"MIT"
] | null | null | null | test/nlp/test_autohf_tokenclassification.py | Qiaochu-Song/FLAML | 28511340528dfc9def29862f5076b4516eb7305f | [
"MIT"
] | null | null | null | import sys
import pytest
import requests
from utils import get_toy_data_tokenclassification, get_automl_settings
@pytest.mark.skipif(sys.platform == "darwin", reason="do not run on mac os")
def test_tokenclassification():
from flaml import AutoML
X_train, y_train, X_val, y_val = get_toy_data_tokenclassificat... | 25.116279 | 101 | 0.62037 |
7e6398e6fcf9331083224124eb15efd030b7d54d | 764 | py | Python | MxShop/MxShop/urls.py | xgq07/Django | a3bfa4fa0ebfc3cdcbc59bcaa810507889050d3b | [
"MIT"
] | null | null | null | MxShop/MxShop/urls.py | xgq07/Django | a3bfa4fa0ebfc3cdcbc59bcaa810507889050d3b | [
"MIT"
] | null | null | null | MxShop/MxShop/urls.py | xgq07/Django | a3bfa4fa0ebfc3cdcbc59bcaa810507889050d3b | [
"MIT"
] | null | null | null | """MxShop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 33.217391 | 77 | 0.713351 |
17aafa3ced425f735155bc4ed9fcbe366ca25887 | 13,027 | py | Python | tests/test_service.py | frankwirgit/fhir-flask-rest | a8d72b1636a4c441e2e96a21f167fefc232c14e0 | [
"Apache-2.0"
] | null | null | null | tests/test_service.py | frankwirgit/fhir-flask-rest | a8d72b1636a4c441e2e96a21f167fefc232c14e0 | [
"Apache-2.0"
] | null | null | null | tests/test_service.py | frankwirgit/fhir-flask-rest | a8d72b1636a4c441e2e96a21f167fefc232c14e0 | [
"Apache-2.0"
] | null | null | null | # Tests for REST API Service
"""
REST API Service Test Suite
Test cases can be run with the following:
nosetests -v --with-spec --spec-color
coverage report -m
codecov --token=$CODECOV_TOKEN
While debugging just these tests it's convinient to use this:
nosetests --stop tests/test_service.py:TestPatServer... | 41.094637 | 120 | 0.624856 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.