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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9e57c0494d446a01a099f02b17612f592cb2957d | 1,022 | py | Python | demo.py | damnkk/cycle-GAN | fbf84eb67ef0a1ba909e95c6862f72419c6f4185 | [
"MIT"
] | null | null | null | demo.py | damnkk/cycle-GAN | fbf84eb67ef0a1ba909e95c6862f72419c6f4185 | [
"MIT"
] | null | null | null | demo.py | damnkk/cycle-GAN | fbf84eb67ef0a1ba909e95c6862f72419c6f4185 | [
"MIT"
] | null | null | null | import numpy
import numpy as np
import tensorflow.compat.v1 as tf
"""
a = np.array([[0.13, 0.45, 0.64, 0.13],
[0.78, 0.89, 0.95, 0.37],
[0.45, 0.98, 0.11, 0.58]])
a.astype(list)
print(a.dtype)
b = 0
for i in range(3):
for j in range(4):
d = a[i,j] ** 2
b = b + d
print(d)
... | 18.25 | 68 | 0.574364 |
9e57f8c761ac873133513d1dd446781fb5717413 | 30,875 | py | Python | src/doc/common/conf.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/doc/common/conf.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/doc/common/conf.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | import sys, os, sphinx
from sage.env import SAGE_DOC_SRC, SAGE_DOC, SAGE_SRC, THEBE_DIR, SAGE_SHARE
import sage.version
import dateutil.parser
from six import iteritems
# If your extensions are in another directory, add it here.
sys.path.append(os.path.join(SAGE_SRC, "sage_setup", "docbuild", "ext"))
# General config... | 38.59375 | 224 | 0.683304 |
9e58240d0ada805f84fcab2ab2e201cd7de9f434 | 4,978 | py | Python | sendim/tests/client.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | 1 | 2017-12-13T20:28:32.000Z | 2017-12-13T20:28:32.000Z | sendim/tests/client.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | null | null | null | sendim/tests/client.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | null | null | null | """
"""
from django.utils import unittest
from django.test.utils import override_settings
from django.test.client import Client
from django.core import management
from django.conf import settings
from django.contrib.auth.models import User
if 'djcelery' in settings.INSTALLED_APPS :
from djcelery.models import TaskMet... | 33.409396 | 94 | 0.70008 |
9e586209e4892ad4f2f9672d79c80f8bd7607cb3 | 736 | py | Python | doc/examples/plot_shapes.py | jaberg/scikits-image | 2ab3e2dfb341189ef2ff9370c6cf3d33ef6ec88d | [
"BSD-3-Clause"
] | 2 | 2019-01-17T22:10:17.000Z | 2020-02-22T04:20:38.000Z | doc/examples/plot_shapes.py | teoliphant/scikit-image | d0415e6df475157705fd1ef2af69b16e4f7e38cc | [
"BSD-3-Clause"
] | 1 | 2020-03-30T12:31:55.000Z | 2020-03-30T12:31:55.000Z | doc/examples/plot_shapes.py | emmanuelle/scikit-image | eccc41907135cf81b99c4be18a480a9bc705485d | [
"BSD-3-Clause"
] | 1 | 2019-12-20T19:19:59.000Z | 2019-12-20T19:19:59.000Z | """
===========
Fill shapes
===========
This example shows how to fill several different shapes:
* line
* polygon
* circle
* ellipse
"""
import matplotlib.pyplot as plt
from skimage.draw import line, polygon, circle, ellipse
import numpy as np
img = np.zeros((500, 500, 3), 'uint8')
# draw line
rr, cc = line(120,... | 16 | 56 | 0.601902 |
9e58634e5673549fd5e41b9ab6f54c8feee8e3d8 | 468 | py | Python | comps/migrations/0033_auto_20200530_0205.py | dlanghorne0428/dancesport-tracker-projec | e55d91a4f03c26d6ee8c28846a809064adfdb158 | [
"MIT"
] | null | null | null | comps/migrations/0033_auto_20200530_0205.py | dlanghorne0428/dancesport-tracker-projec | e55d91a4f03c26d6ee8c28846a809064adfdb158 | [
"MIT"
] | 87 | 2020-04-15T22:29:03.000Z | 2022-01-02T02:21:28.000Z | comps/migrations/0033_auto_20200530_0205.py | dlanghorne0428/dancesport-tracker-projec | e55d91a4f03c26d6ee8c28846a809064adfdb158 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-05-30 02:05
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('comps', '0032_auto_20200530_0203'),
]
operations = [
migrations.AlterField(
model_name='comp',
name... | 23.4 | 111 | 0.647436 |
9e587f6e6869a2aa69476c18b364f0025e06485c | 2,136 | py | Python | tests/components/test_visibility.py | StephenOrJames/aviation-weather | 35594cc1ba448acdea9123380cc47ac96d2107c8 | [
"MIT"
] | 2 | 2017-03-14T23:28:28.000Z | 2020-01-10T23:04:30.000Z | tests/components/test_visibility.py | aviationweather/aviation_weather | 35594cc1ba448acdea9123380cc47ac96d2107c8 | [
"MIT"
] | null | null | null | tests/components/test_visibility.py | aviationweather/aviation_weather | 35594cc1ba448acdea9123380cc47ac96d2107c8 | [
"MIT"
] | null | null | null | import unittest
from aviation_weather import Visibility
from aviation_weather.exceptions import VisibilityDecodeError
class TestVisibility(unittest.TestCase):
"""Unit tests for aviation_weather.components.visibility.Visibility"""
def _test_valid(self, raw, cavok, less_than, greater_than, distance, unit):
... | 30.956522 | 79 | 0.672285 |
9e58899cee29b60a6a5b04f4d7af81805c89ccd3 | 5,522 | py | Python | examples/sd_hybrid_MMAS.py | FernandoGaGu/Ant-Colony-Optimisation | e1a1ee27f55c63c768964e80f38020f1aef664d7 | [
"BSD-3-Clause"
] | 1 | 2021-09-09T04:14:06.000Z | 2021-09-09T04:14:06.000Z | examples/sd_hybrid_MMAS.py | FernandoGaGu/Ant-Colony-Optimisation | e1a1ee27f55c63c768964e80f38020f1aef664d7 | [
"BSD-3-Clause"
] | null | null | null | examples/sd_hybrid_MMAS.py | FernandoGaGu/Ant-Colony-Optimisation | e1a1ee27f55c63c768964e80f38020f1aef664d7 | [
"BSD-3-Clause"
] | null | null | null | """
The problem presented consists of finding the sub-graph that maximises the mean of the values in a
given group (denoted as Gmax) by minimising the mean of the values in another group (denoted as
Gmin), in essence maximising the difference between Gmax and Gmin subjected to a graph structure.
This script uses the b... | 38.887324 | 101 | 0.692865 |
9e58d02b21933cfa1c97b45b6064484a2f6d7ba4 | 40,639 | py | Python | appengine/monorail/tracker/test/issueentry_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | appengine/monorail/tracker/test/issueentry_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | appengine/monorail/tracker/test/issueentry_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Unittests for the issueentry servlet."""
from __future__ import print_function
from __future... | 40.517448 | 80 | 0.671227 |
9e58e2d2540ae8338374d1e1d485d90e27522120 | 3,693 | py | Python | hek/network.py | greedalbadi/hek | ac9c7531ba6ce42326528945e3473fb2ff9496af | [
"MIT"
] | 8 | 2022-01-01T05:58:34.000Z | 2022-02-20T17:18:04.000Z | hek/network.py | greedalbadi/hek | ac9c7531ba6ce42326528945e3473fb2ff9496af | [
"MIT"
] | null | null | null | hek/network.py | greedalbadi/hek | ac9c7531ba6ce42326528945e3473fb2ff9496af | [
"MIT"
] | null | null | null | import subprocess
import os
from .info import Tools
from .exceptions import *
class Net_info: # info container
op = ["nt"]
# thous who contain monitor_ are for monitor functions
monitor_shell = True # is shell
monitor_stdout = subprocess.PIPE # being able to read response
monitor_stderr = subproce... | 34.514019 | 132 | 0.65746 |
9e58e683562b79427861987445d64bb4cd6da64e | 220,158 | py | Python | mlvajra/model/DSL.py | rajagurunath/mlvajra | abaa40717342cecc785144700884e1c9d5910c43 | [
"Apache-2.0"
] | 2 | 2019-04-22T12:25:05.000Z | 2019-05-05T16:49:12.000Z | mlvajra/model/DSL.py | rajagurunath/mlvajra | abaa40717342cecc785144700884e1c9d5910c43 | [
"Apache-2.0"
] | 9 | 2019-04-06T14:27:22.000Z | 2021-04-30T20:42:19.000Z | mlvajra/model/DSL.py | rajagurunath/mlvajra | abaa40717342cecc785144700884e1c9d5910c43 | [
"Apache-2.0"
] | null | null | null | """
Command Line Interface
======================
Ludwig provides six command line interface entry points
- train
- predict
- experiment
- visualize
- collect_weights
- collect_activations
They are described in detail below.
train
-----
This command lets you train a model from your data.
You c... | 80.37897 | 1,528 | 0.734023 |
9e58fb0063c04d00e43948d8e93023d5a08fd51f | 852 | py | Python | LC/393.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | 2 | 2018-02-24T17:20:02.000Z | 2018-02-24T17:25:43.000Z | LC/393.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | LC/393.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | class Solution(object):
def validUtf8(self, data):
"""
:type data: List[int]
:rtype: bool
"""
data_bin=map(lambda a: bin(a%2**8)[2:].zfill(8), data)
# print data_bin
k=0
while k<len(data_bin):
num=data_bin[k]
# print nu... | 27.483871 | 62 | 0.373239 |
9e59318bc0d2ca332b5b72c5ba4be9ba4c7d1cf5 | 533 | py | Python | bin/build_summary.py | dmitry-kabanov/fickettmodel | 255b1e9cae1cfb7a6b914ad61a17288d52215cc4 | [
"MIT"
] | null | null | null | bin/build_summary.py | dmitry-kabanov/fickettmodel | 255b1e9cae1cfb7a6b914ad61a17288d52215cc4 | [
"MIT"
] | null | null | null | bin/build_summary.py | dmitry-kabanov/fickettmodel | 255b1e9cae1cfb7a6b914ad61a17288d52215cc4 | [
"MIT"
] | null | null | null | import argparse
import sys
from fickettmodel.action.summarybuilder import SummaryBuilder
prog = 'python ' + sys.argv[0]
parser = argparse.ArgumentParser(
prog=prog,
description='Build summary table. Namely, combine the results '
'of the numerical simulations in a table with columns '
... | 29.611111 | 74 | 0.692308 |
9e594603bbabe0ae94100a19447f254d093617da | 3,284 | py | Python | plastering/inferencers/algorithm/GeneticAlgorithm/analyze_output/accurate_room_pattern.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | null | null | null | plastering/inferencers/algorithm/GeneticAlgorithm/analyze_output/accurate_room_pattern.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | null | null | null | plastering/inferencers/algorithm/GeneticAlgorithm/analyze_output/accurate_room_pattern.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | null | null | null | """Find patterns of rooms that lead to higher accuracy.
"""
import argparse
import pathlib
import sys
import numpy as np
import matplotlib.pyplot as plt
__ROOM_NAMES__ = ['413', '415', '417', '419', '421', '422', '423', '424',
'442', '446', '448', '452', '454', '456', '458', '462',
... | 35.311828 | 83 | 0.623021 |
9e595b1454e553915388c1f5b570f912c89e84a7 | 2,603 | py | Python | setup.py | loynoir/python-fire | 1f99e282f079bea992105f609ad1a70ed60d6635 | [
"Apache-2.0"
] | null | null | null | setup.py | loynoir/python-fire | 1f99e282f079bea992105f609ad1a70ed60d6635 | [
"Apache-2.0"
] | null | null | null | setup.py | loynoir/python-fire | 1f99e282f079bea992105f609ad1a70ed60d6635 | [
"Apache-2.0"
] | 1 | 2021-04-10T14:17:27.000Z | 2021-04-10T14:17:27.000Z | # Copyright (C) 2018 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, ... | 34.25 | 80 | 0.675759 |
9e59922b4ea142def1416e498671330bb5a3df3e | 14,805 | py | Python | truffleHog/regexChecks.py | unk1nd0n3/bitbucket-creds-checker | 5e13b65f606ef15f310086d896cf3caab80cdaee | [
"MIT"
] | 14 | 2018-05-22T16:39:29.000Z | 2022-03-09T09:47:11.000Z | truffleHog/regexChecks.py | unk1nd0n3/bitbucket-creds-checker | 5e13b65f606ef15f310086d896cf3caab80cdaee | [
"MIT"
] | 2 | 2018-05-22T14:02:19.000Z | 2020-06-16T05:40:34.000Z | truffleHog/regexChecks.py | unk1nd0n3/bitbucket-creds-checker | 5e13b65f606ef15f310086d896cf3caab80cdaee | [
"MIT"
] | 3 | 2019-04-05T10:23:12.000Z | 2020-12-30T14:12:18.000Z | import re
regexes_txt = {
# Compnay internal domains
"Internal Dev subdomain": re.compile('([a-z0-9]+[.]*[.]addyourDEVdomain[.]com)'),
"Internal MGMT subdomain": re.compile('([a-z0-9]+[.]*[.]addyourMGMTdomain[.]com)'),
"Internal PROD subdomain": re.compile('([a-z0-9]+[.]*[.]addyourPRODdomain[.]com)'),
... | 61.6875 | 147 | 0.633232 |
9e59990209257b3db2c1739eee702084f54aa935 | 1,671 | py | Python | py/29. Divide Two Integers.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/29. Divide Two Integers.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/29. Divide Two Integers.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/divide-two-integers/
# Given two integers dividend and divisor, divide two integers without using
# multiplication, division, and mod operator.
# Return the quotient after dividing dividend by divisor.
# The integer division should truncate toward zero, which means losing its
# fracti... | 33.42 | 80 | 0.571514 |
9e59af0787390f8bf5b0327e89bce908eca7d304 | 791 | py | Python | facexlib/assessment/__init__.py | spy14414/facexlib | 6be8bdcfe32198374c17588132a72022ad88ae3b | [
"MIT"
] | 164 | 2021-05-15T20:15:42.000Z | 2022-03-25T19:39:24.000Z | facexlib/assessment/__init__.py | spy14414/facexlib | 6be8bdcfe32198374c17588132a72022ad88ae3b | [
"MIT"
] | 7 | 2021-08-03T15:56:49.000Z | 2022-02-24T13:50:33.000Z | facexlib/assessment/__init__.py | daobook/facexlib | e5768d1722a3fddc6ccd1b91a6a17f432ed149b4 | [
"MIT"
] | 32 | 2021-05-16T03:10:24.000Z | 2022-03-19T12:02:00.000Z | import torch
from facexlib.utils import load_file_from_url
from .hyperiqa_net import HyperIQA
def init_assessment_model(model_name, half=False, device='cuda'):
if model_name == 'hypernet':
model = HyperIQA(16, 112, 224, 112, 56, 28, 14, 7)
model_url = 'https://github.com/xinntao/facexlib/releases... | 39.55 | 120 | 0.737042 |
9e59c254ed0c33f95debe73883e6c41b5bb7533a | 181 | py | Python | tests/__main__.py | TylerLiuAIrobotics/lifelines | a4ce565b17ebdaf5c0049750b7b3f94b41d6b404 | [
"MIT"
] | 1 | 2020-03-07T07:39:07.000Z | 2020-03-07T07:39:07.000Z | tests/__main__.py | TylerLiuAIrobotics/lifelines | a4ce565b17ebdaf5c0049750b7b3f94b41d6b404 | [
"MIT"
] | null | null | null | tests/__main__.py | TylerLiuAIrobotics/lifelines | a4ce565b17ebdaf5c0049750b7b3f94b41d6b404 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import pytest
if __name__ == "__main__":
# Exit with correct code
sys.exit(pytest.main(["--pyargs", "lifelines.tests"] + sys.argv[1:]))
| 20.111111 | 73 | 0.624309 |
9e59c624820e0113052238d7a94bc934aff344b1 | 31,323 | py | Python | references/biosppy/biosppy/plotting.py | DeepPSP/cpsc2020 | 47acb884ea1f2f819e564d8a17ad37001ed0df27 | [
"BSD-3-Clause"
] | 1 | 2021-12-07T11:44:48.000Z | 2021-12-07T11:44:48.000Z | references/biosppy/biosppy/plotting.py | wenh06/cpsc2020 | 47acb884ea1f2f819e564d8a17ad37001ed0df27 | [
"BSD-3-Clause"
] | null | null | null | references/biosppy/biosppy/plotting.py | wenh06/cpsc2020 | 47acb884ea1f2f819e564d8a17ad37001ed0df27 | [
"BSD-3-Clause"
] | 1 | 2021-05-25T14:56:02.000Z | 2021-05-25T14:56:02.000Z | # -*- coding: utf-8 -*-
"""
biosppy.plotting
----------------
This module provides utilities to plot data.
:copyright: (c) 2015-2018 by Instituto de Telecomunicacoes
:license: BSD 3-clause, see LICENSE for more details.
"""
# Imports
# compat
from __future__ import absolute_import, division, print_function
from six.... | 25.383306 | 79 | 0.538039 |
9e59f485ec3e6f2ffec23c2d773b576b65ca5b16 | 30 | py | Python | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/ChallengeEditor/ChallengeInfoPanel/challenge_info_panel.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/ChallengeEditor/ChallengeInfoPanel/challenge_info_panel.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/ChallengeEditor/ChallengeInfoPanel/challenge_info_panel.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class ChallengeInfoPanel: pass | 30 | 30 | 0.9 |
9e59fd30c1bb7dffd747987baa164e57c6970b24 | 9,613 | py | Python | alphastarmini/core/arch/action_type_head.py | liuruoze/mini-AlphaStar | cf9de2507d526a5fb8ef67676aab2ffb92738640 | [
"Apache-2.0"
] | 108 | 2021-02-10T13:24:56.000Z | 2022-03-21T09:58:28.000Z | alphastarmini/core/arch/action_type_head.py | liuruoze/mini-AlphaStar | cf9de2507d526a5fb8ef67676aab2ffb92738640 | [
"Apache-2.0"
] | 21 | 2021-04-09T18:46:05.000Z | 2022-03-29T02:44:15.000Z | alphastarmini/core/arch/action_type_head.py | liuruoze/mini-AlphaStar | cf9de2507d526a5fb8ef67676aab2ffb92738640 | [
"Apache-2.0"
] | 19 | 2021-08-03T01:49:02.000Z | 2022-03-30T10:21:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
" Action Type Head."
import torch
import torch.nn as nn
import torch.nn.functional as F
from alphastarmini.core.arch.spatial_encoder import ResBlock1D
from alphastarmini.lib.glu import GLU
from alphastarmini.lib.multinomial import stable_multinomial
from al... | 49.045918 | 127 | 0.687715 |
9e5a0d58f57e3271ca632382d36ae4eee13df525 | 18,442 | py | Python | tensorpack/train/trainers.py | YongyiTang92/tensorpack | fed46d9186450d9d3764231e5bdf0bbc4a173c15 | [
"Apache-2.0"
] | 1 | 2019-01-17T03:40:31.000Z | 2019-01-17T03:40:31.000Z | tensorpack/train/trainers.py | hcxiong/tensorpack | 61af56d979b1c62fd059d3d7d0e7f005f42115d6 | [
"Apache-2.0"
] | null | null | null | tensorpack/train/trainers.py | hcxiong/tensorpack | 61af56d979b1c62fd059d3d7d0e7f005f42115d6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File: trainers.py
import multiprocessing as mp
import os
import sys
import tensorflow as tf
from ..callbacks import CallbackFactory, RunOp
from ..graph_builder.distributed import DistributedParameterServerBuilder, DistributedReplicatedBuilder
from ..graph_builder.training import (
AsyncM... | 39.490364 | 120 | 0.657304 |
9e5a22eb271732d52ea9ec785738a1190a4a6094 | 2,392 | py | Python | csg/primitives.py | defgsus/pector | 8ac7a42030c6502b25b34133f3972ff109e34ccc | [
"MIT"
] | null | null | null | csg/primitives.py | defgsus/pector | 8ac7a42030c6502b25b34133f3972ff109e34ccc | [
"MIT"
] | null | null | null | csg/primitives.py | defgsus/pector | 8ac7a42030c6502b25b34133f3972ff109e34ccc | [
"MIT"
] | null | null | null | from .csg_base import *
from .glsl import to_glsl
class Primitive(CsgBase):
def __init__(self, name, transform=mat4()):
super(Primitive, self).__init__(name, transform=transform)
self._can_have_nodes = False
class Sphere(Primitive):
def __init__(self, radius = 1., transform = mat4()):
... | 30.666667 | 81 | 0.625836 |
9e5a3c169e2c2ce3ed35f5f7dc85f5ca0527ec1d | 16,379 | py | Python | userbot/plugins/facts.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/facts.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/facts.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | """
Say something interesting...
Syntax: .facts
by @danish_00
Quotes credits: Being logical Channel
"""
import asyncio
import random
from uniborg.util import lightning_cmd
@borg.on(lightning_cmd(pattern=r"facts"))
async def _(event):
if event.fwd_from:
return
await event... | 28.19105 | 189 | 0.552232 |
9e5a440b2824032e2837c572e61db3835dc4a9f4 | 833 | py | Python | violas_client/lbrtypes/event.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/lbrtypes/event.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/lbrtypes/event.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | 1 | 2022-01-05T06:49:42.000Z | 2022-01-05T06:49:42.000Z | from violas_client.canoser import Struct, Uint64, DelegateT, BytesT
from violas_client.move_core_types.account_address import AccountAddress
class EventKey(DelegateT):
LENGTH = AccountAddress.LENGTH + 8
delegate_type = BytesT(LENGTH)
@staticmethod
def get_creator_address(key):
return key[Event... | 26.03125 | 72 | 0.686675 |
9e5a964e9ef20a35e198d4e8614a4c9130d02a80 | 3,406 | py | Python | experiments/ashvin/icml2020/hand/pen/pretrain/sweep_mse1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/pretrain/sweep_mse1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/pretrain/sweep_mse1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
if __name__ == "__main__":
variant = dict(... | 29.111111 | 74 | 0.568115 |
9e5aa863e4a9673b6b7b4416d764ea2397b49cbe | 4,689 | py | Python | doc/conf.py | richemslie/ggplib | 8388678f311db4a9906d8a3aff71d3f0037b623b | [
"MIT"
] | 11 | 2019-03-02T13:49:07.000Z | 2021-12-21T17:03:05.000Z | doc/conf.py | ggplib/ggplib | 8388678f311db4a9906d8a3aff71d3f0037b623b | [
"MIT"
] | 2 | 2019-05-15T18:23:50.000Z | 2019-05-19T08:13:19.000Z | doc/conf.py | ggplib/ggplib | 8388678f311db4a9906d8a3aff71d3f0037b623b | [
"MIT"
] | 1 | 2020-04-02T17:35:35.000Z | 2020-04-02T17:35:35.000Z | # -*- coding: utf-8 -*-
#
# ggplib documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 21 01:58:11 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | 29.866242 | 79 | 0.678823 |
9e5aaf3118dfed4ce64dd244a915860b5a2eef44 | 54,488 | py | Python | tensorflow/contrib/learn/python/learn/estimators/estimator_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/learn/python/learn/estimators/estimator_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/learn/python/learn/estimators/estimator_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2016 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.589235 | 88 | 0.692868 |
9e5ab218882b86e3eefe9965c1221eaf368f5bfa | 3,780 | py | Python | FW.py | uclaml/Frank-Wolfe-AdvML | 068cf243cb988c9bb192cba42355d30942aa795d | [
"Apache-2.0"
] | 12 | 2018-12-03T05:47:47.000Z | 2021-11-24T05:02:47.000Z | FW.py | uclaml/Frank-Wolfe-AdvML | 068cf243cb988c9bb192cba42355d30942aa795d | [
"Apache-2.0"
] | null | null | null | FW.py | uclaml/Frank-Wolfe-AdvML | 068cf243cb988c9bb192cba42355d30942aa795d | [
"Apache-2.0"
] | 9 | 2018-12-17T01:19:09.000Z | 2021-10-05T10:33:48.000Z | import sys
import tensorflow as tf
import numpy as np
import time
from utils import *
class FW:
def __init__(self, sess, cnn_model, att_iter=20, batch_size=50, order=np.inf, eps=0.3, clip_min=0, clip_max=1,
targeted=True, lr=0.01, beta1=0.99):
image_size, num_channels, num_labels = cnn_m... | 38.181818 | 114 | 0.592593 |
9e5ac95c45debd168c7b5fdcbcc3927a2ba04cbb | 8,103 | py | Python | sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.1/async_samples/sample_differentiate_output_labeled_tables_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.1/async_samples/sample_differentiate_output_labeled_tables_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.1/async_samples/sample_differentiate_output_labeled_tables_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... | 47.946746 | 132 | 0.637418 |
9e5b230db78ea25901d2a78a874074c9d7582c86 | 25,229 | py | Python | lib/apiclient/discovery.py | alecdotico/engineauth | def523f6c0d48f346e552b6638e6f3a6a1717733 | [
"Apache-2.0"
] | 1 | 2015-12-14T10:37:52.000Z | 2015-12-14T10:37:52.000Z | lib/apiclient/discovery.py | alecdotico/engineauth | def523f6c0d48f346e552b6638e6f3a6a1717733 | [
"Apache-2.0"
] | null | null | null | lib/apiclient/discovery.py | alecdotico/engineauth | def523f6c0d48f346e552b6638e6f3a6a1717733 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2010 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 writ... | 34.846685 | 87 | 0.632764 |
9e5b407e2da4e8b8b9e9733270738eef3320af98 | 7,619 | py | Python | batchglm/train/tf/base_glm/jacobians.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/train/tf/base_glm/jacobians.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/train/tf/base_glm/jacobians.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | import abc
import logging
from typing import List
import tensorflow as tf
from .model import ModelVarsGLM
logger = logging.getLogger(__name__)
class JacobiansGLM:
"""
Wrapper to compute the Jacobian matrix for a GLM.
"""
jac: tf.Tensor
neg_jac: tf.Tensor
def __init__(
self,
... | 35.769953 | 103 | 0.58971 |
9e5b43d7536882915a6ff95c07ef831e6101e571 | 710 | py | Python | migrations/versions/160_crop_desc_notification.py | alphagov/notify-api | 16dbafbad69e5bb179ba4b2202a7afa299c88d61 | [
"MIT"
] | 12 | 2015-10-06T08:58:28.000Z | 2016-08-08T17:51:29.000Z | migrations/versions/160_crop_desc_notification.py | gds-attic/notify-api | 16dbafbad69e5bb179ba4b2202a7afa299c88d61 | [
"MIT"
] | 1 | 2015-10-27T12:01:26.000Z | 2015-10-27T12:01:26.000Z | migrations/versions/160_crop_desc_notification.py | gds-attic/notify-api | 16dbafbad69e5bb179ba4b2202a7afa299c88d61 | [
"MIT"
] | 3 | 2016-05-31T17:40:15.000Z | 2021-04-10T20:03:33.000Z | """empty message
Revision ID: 160_crop_desc_notification
Revises: 150_add_filename_to_job
Create Date: 2015-10-30 15:05:11.943803
"""
# revision identifiers, used by Alembic.
revision = '160_crop_desc_notification'
down_revision = '150_add_filename_to_job'
from alembic import op
import sqlalchemy as sa
def upgrad... | 26.296296 | 120 | 0.732394 |
9e5b43d9565fdd3864683ad2dde0ee19ba65f984 | 1,579 | py | Python | tests/Test_smooth_reservoir_model_14C.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | tests/Test_smooth_reservoir_model_14C.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | tests/Test_smooth_reservoir_model_14C.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | import unittest
from sympy import Function, Matrix, symbols, simplify
from CompartmentalSystems.smooth_reservoir_model import SmoothReservoirModel
from CompartmentalSystems.smooth_reservoir_model_14C import (
SmoothReservoirModel_14C
)
class TestSmoothReservoirModel_14C(unittest.TestCase):
def setUp(self):... | 29.240741 | 79 | 0.576947 |
9e5b4a1510b7e8ab6e703148f41ac2694278104b | 4,594 | py | Python | xos/core/xoslib/methods/sliceplus.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null | xos/core/xoslib/methods/sliceplus.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null | xos/core/xoslib/methods/sliceplus.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from core.models import *
from django.forms import widgets
from core.xoslib.objects.sliceplus import SlicePlus... | 41.017857 | 197 | 0.702003 |
9e5b5bbf984f64acc178cc16e711aa0a020f8b06 | 5,445 | py | Python | apysc/_display/flip_y_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | apysc/_display/flip_y_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | apysc/_display/flip_y_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | """Class implementation for the flip_y interface.
"""
from typing import Dict
from apysc._type.attr_linking_interface import AttrLinkingInterface
from apysc._type.boolean import Boolean
from apysc._type.revert_interface import RevertInterface
from apysc._type.variable_name_interface import VariableNameInterfa... | 34.03125 | 77 | 0.577043 |
9e5b647b6ce6b875897dc535f3a1e1f0955dcdc5 | 17,849 | py | Python | models/sandwiched_fixed_pos_emb_encoder_only_transformer.py | Khoale1096/stupidNMT | 894536c16dc7ff958aa5571828a89ecabfcb72d7 | [
"BSD-3-Clause"
] | null | null | null | models/sandwiched_fixed_pos_emb_encoder_only_transformer.py | Khoale1096/stupidNMT | 894536c16dc7ff958aa5571828a89ecabfcb72d7 | [
"BSD-3-Clause"
] | null | null | null | models/sandwiched_fixed_pos_emb_encoder_only_transformer.py | Khoale1096/stupidNMT | 894536c16dc7ff958aa5571828a89ecabfcb72d7 | [
"BSD-3-Clause"
] | null | null | null | '''
A module which implements the basic Transformer
'''
import uuid
import threading
import pdb
import torch
from torch import nn
from models.new_attention import NewAttention
from models.attention import MultiHeadedAttention
from models.embeddings import PositionEmbedding, TokenEmbedding, LearnedPositionalEmbedding
f... | 38.718004 | 134 | 0.59275 |
9e5b87f727001e8494838a50d5d1f8c237c7fb70 | 361 | py | Python | tests/test_read_write.py | JackCurragh/RDG | b37cc7a0e284e77af8facbeaf551d3b02e7df4a7 | [
"MIT"
] | 1 | 2022-02-03T11:19:28.000Z | 2022-02-03T11:19:28.000Z | tests/test_read_write.py | JackCurragh/RDG | b37cc7a0e284e77af8facbeaf551d3b02e7df4a7 | [
"MIT"
] | null | null | null | tests/test_read_write.py | JackCurragh/RDG | b37cc7a0e284e77af8facbeaf551d3b02e7df4a7 | [
"MIT"
] | null | null | null | from RDG import RDG, Node, Edge, save, load
# from RDG_to_file import save, load
def test_read_write():
dg = RDG()
dg.add_open_reading_frame(30, 90)
dg.add_open_reading_frame(131, 171)
dg.add_open_reading_frame(150,850)
save(dg, 'test_output.sqlite')
dg2 = load('', 'test_output.sqlite')
... | 25.785714 | 43 | 0.68144 |
9e5b93c0d8b8df8b88934470191387f8eae0657a | 1,362 | py | Python | ckanext/ckanext-apicatalog_scheming/ckanext/apicatalog_scheming/plugin.py | eetumans/api-catalog | a32a52c48425be8b71d83c60c93b26db7787e632 | [
"MIT"
] | null | null | null | ckanext/ckanext-apicatalog_scheming/ckanext/apicatalog_scheming/plugin.py | eetumans/api-catalog | a32a52c48425be8b71d83c60c93b26db7787e632 | [
"MIT"
] | null | null | null | ckanext/ckanext-apicatalog_scheming/ckanext/apicatalog_scheming/plugin.py | eetumans/api-catalog | a32a52c48425be8b71d83c60c93b26db7787e632 | [
"MIT"
] | null | null | null | import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckan.common import config
import validators
class Apicatalog_SchemingPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IValidators)
plugins.implements(plugins.ITemplateHelpers)
... | 34.923077 | 93 | 0.721733 |
9e5ba2cbc4ae7111297f39c61462269d5e69c892 | 665 | py | Python | osm/data_streams/windows/forgetting_strategy/abstract_selective_forgetting.py | cjneetha/osm | cc391fbfee8c89a1f15257ea36e6bbc85bbea938 | [
"MIT"
] | 1 | 2018-06-12T09:11:34.000Z | 2018-06-12T09:11:34.000Z | osm/data_streams/windows/forgetting_strategy/abstract_selective_forgetting.py | cjneetha/osm | cc391fbfee8c89a1f15257ea36e6bbc85bbea938 | [
"MIT"
] | null | null | null | osm/data_streams/windows/forgetting_strategy/abstract_selective_forgetting.py | cjneetha/osm | cc391fbfee8c89a1f15257ea36e6bbc85bbea938 | [
"MIT"
] | 2 | 2018-10-22T12:32:02.000Z | 2018-12-28T11:43:03.000Z | from abc import ABC, abstractmethod
from osm.data_streams.abstract_base_class import AbstractBaseClass
class AbstractSelectiveForgetting(AbstractBaseClass):
def __init__(self) -> None:
"""
Abstract class that implements selective forgetting strategies
"""
super().__init__()
... | 28.913043 | 78 | 0.684211 |
9e5c0cbf41027ad2a756a185e70cb9a5d6832e9b | 3,564 | py | Python | Corner-edge-line/Ransac_line.py | sudokhan112/Computer-Vision-Projects | 09b2323c536c04940787650000ce771221217a4b | [
"MIT"
] | null | null | null | Corner-edge-line/Ransac_line.py | sudokhan112/Computer-Vision-Projects | 09b2323c536c04940787650000ce771221217a4b | [
"MIT"
] | null | null | null | Corner-edge-line/Ransac_line.py | sudokhan112/Computer-Vision-Projects | 09b2323c536c04940787650000ce771221217a4b | [
"MIT"
] | null | null | null |
import numpy as np
from matplotlib import pyplot as plt
import cv2
#img = cv2.imread('/home/sayem/Desktop/cs557_project/cs557_code_project3/Lenna.pnm')
#img = cv2.imread('/home/sayem/Desktop/cs557_project/cs557_code_project3/building.pnm')
#img = cv2.imread('/home/sayem/Desktop/cs557_project/cs557_code_project3/hin... | 33.308411 | 172 | 0.726712 |
9e5c234f2a312a7be0de6ea6d369122745b27d7b | 7,524 | py | Python | maro/event_buffer/event_buffer.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | maro/event_buffer/event_buffer.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | maro/event_buffer/event_buffer.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# TODO:
# 1. priority
# 2. event object pool, this will make get_finished_events function stop working. we can enable this to disable pooling
from enum import IntEnum
from collections import defaultdict
from typing import List, Dict, Callable
... | 31.35 | 137 | 0.589846 |
9e5c3c018c438ebedc9487760c90a23968d4b0c7 | 6,984 | py | Python | imagenet_training/data/cifar10.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | imagenet_training/data/cifar10.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | imagenet_training/data/cifar10.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | """CIFAR-10 data module that downloads and saves data as .npz files if not already present."""
import argparse
import json
import os
from pathlib import Path
import pickle
import tarfile
from typing import Optional
import h5py
import numpy as np
from sklearn.model_selection import train_test_split
import toml
from to... | 41.082353 | 117 | 0.652205 |
9e5c415fd2be6ac8dcd5787fbe364d48a618384e | 2,052 | py | Python | cbrain/legacy/losses.py | GunnarBehrens/CBRAIN-CAM | 1b59b5b4731ada7c077c181b543339412d25e5c3 | [
"MIT"
] | 66 | 2018-05-25T18:36:27.000Z | 2022-03-20T15:39:54.000Z | cbrain/legacy/losses.py | GunnarBehrens/CBRAIN-CAM | 1b59b5b4731ada7c077c181b543339412d25e5c3 | [
"MIT"
] | 17 | 2019-01-08T12:41:47.000Z | 2021-09-05T01:22:04.000Z | cbrain/legacy/losses.py | GunnarBehrens/CBRAIN-CAM | 1b59b5b4731ada7c077c181b543339412d25e5c3 | [
"MIT"
] | 48 | 2018-04-04T22:42:12.000Z | 2021-03-06T06:21:39.000Z | """Define custom metrics
Author: Stephan Rasp
"""
import keras
import keras.backend as K
from keras.losses import mse
# Define custom losses
def rmse(y_true, y_pred):
"""Regular loss in tensorboard"""
return K.sqrt(mse(y_true, y_pred))
def log_loss(y_true, y_pred):
return K.log(rmse(y_true, y_pred) + ... | 24.141176 | 80 | 0.653021 |
9e5c47e775048d459d97e461bec6115d659ed800 | 390 | py | Python | app/email.py | nimowairimu/flask-week-3- | 00876bbbc5816e0fbb3f3d3556bc0c5ee76be28f | [
"MIT"
] | null | null | null | app/email.py | nimowairimu/flask-week-3- | 00876bbbc5816e0fbb3f3d3556bc0c5ee76be28f | [
"MIT"
] | null | null | null | app/email.py | nimowairimu/flask-week-3- | 00876bbbc5816e0fbb3f3d3556bc0c5ee76be28f | [
"MIT"
] | null | null | null | from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
sender_email = 'nimowairimu25@gmail.com'
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ".txt",**kwargs)
email.html... | 30 | 66 | 0.735897 |
9e5c67e1726bf46f16fa4971a488394d0a1a4b73 | 3,886 | py | Python | instana/instrumentation/asynqp.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 61 | 2017-09-27T02:50:17.000Z | 2022-03-22T12:13:37.000Z | instana/instrumentation/asynqp.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 82 | 2017-07-11T13:47:33.000Z | 2022-03-22T10:10:38.000Z | instana/instrumentation/asynqp.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 27 | 2017-09-11T16:22:32.000Z | 2022-03-11T17:21:49.000Z | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2018
from __future__ import absolute_import
import opentracing
import wrapt
from ..log import logger
from ..singletons import async_tracer
try:
import asynqp
import asyncio
@wrapt.patch_function_wrapper('asynqp.exchange', 'Exchange.publish')
... | 35.009009 | 98 | 0.574884 |
9e5c829b5b630bb75fe1e2f14387aecfadc2e332 | 1,634 | py | Python | stdplugins/fullgaali.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 1 | 2020-08-02T11:14:29.000Z | 2020-08-02T11:14:29.000Z | stdplugins/fullgaali.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | null | null | null | stdplugins/fullgaali.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 1 | 2020-05-31T07:19:52.000Z | 2020-05-31T07:19:52.000Z | """COMMAND : .gaali"""
import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins
from uniborg.util import admin_cmd
@borg.on(admin_cmd("gaali",allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "`Main roz teri behno ki banjar chut me apn... | 71.043478 | 998 | 0.761934 |
9e5c93c233ce1a0cc10cbd33751734d2492603f3 | 1,511 | py | Python | polly/plugins/maya/publish/validate_single_assembly.py | mindbender-studio/config | d12a99391afcdc1a52bc3c5d159506f2f9b348f7 | [
"MIT"
] | 5 | 2017-06-18T15:53:56.000Z | 2021-06-18T10:29:10.000Z | polly/plugins/maya/publish/validate_single_assembly.py | BigRoy/config | d12a99391afcdc1a52bc3c5d159506f2f9b348f7 | [
"MIT"
] | 12 | 2017-06-21T14:25:13.000Z | 2021-10-14T05:57:23.000Z | polly/plugins/maya/publish/validate_single_assembly.py | mindbender-studio/config | d12a99391afcdc1a52bc3c5d159506f2f9b348f7 | [
"MIT"
] | 5 | 2017-06-14T14:07:17.000Z | 2020-01-06T08:00:39.000Z | import pyblish.api
class SelectAssemblies(pyblish.api.Action):
label = "Select Assemblies"
on = "failed"
def process(self, context, plugin):
from maya import cmds
cmds.select(plugin.assemblies)
class ValidateMindbenderSingleAssembly(pyblish.api.InstancePlugin):
"""Each asset must ha... | 26.982143 | 67 | 0.603574 |
9e5cc9b85a32388c71d0d8e748af85abb93d305e | 33 | py | Python | src/visualization/visualize.py | theLongLab/phx-parameter-map | cfe96b745a32bfb97117ddb01e49f7880eb8b384 | [
"MIT"
] | null | null | null | src/visualization/visualize.py | theLongLab/phx-parameter-map | cfe96b745a32bfb97117ddb01e49f7880eb8b384 | [
"MIT"
] | null | null | null | src/visualization/visualize.py | theLongLab/phx-parameter-map | cfe96b745a32bfb97117ddb01e49f7880eb8b384 | [
"MIT"
] | 1 | 2021-04-09T02:54:00.000Z | 2021-04-09T02:54:00.000Z | # src/visualization/visualize.py
| 16.5 | 32 | 0.818182 |
9e5d047e7bf6e58b13cbfe53f840758c54e363d2 | 491 | py | Python | timeline/migrations/0002_auto_20181228_0853.py | vstasn/django-shop-schedule | e48ae78454d0e0687b96c07e4877ffacf466a8fd | [
"MIT"
] | null | null | null | timeline/migrations/0002_auto_20181228_0853.py | vstasn/django-shop-schedule | e48ae78454d0e0687b96c07e4877ffacf466a8fd | [
"MIT"
] | null | null | null | timeline/migrations/0002_auto_20181228_0853.py | vstasn/django-shop-schedule | e48ae78454d0e0687b96c07e4877ffacf466a8fd | [
"MIT"
] | null | null | null | # Generated by Django 2.1.4 on 2018-12-28 08:53
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('timeline', '0001_initial'),
]
operations = [
migrations.AlterField(
model_... | 23.380952 | 107 | 0.631365 |
9e5d2b58c739670a62b5f16d1715788027e43cd7 | 3,005 | py | Python | axonius_api_client/tests/tests_api/tests_system/test_meta.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | null | null | null | axonius_api_client/tests/tests_api/tests_system/test_meta.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | null | null | null | axonius_api_client/tests/tests_api/tests_system/test_meta.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test suite."""
import copy
import pytest
class SystemMetaBase:
@pytest.fixture(scope="class")
def apiobj(self, api_meta):
return api_meta
def val_entity_sizes(self, data):
data = copy.deepcopy(data)
avg_document_size = data("avg_document_size")
... | 30.663265 | 62 | 0.641597 |
9e5d434a3e59306c2c38c8b55ebeb53fbfe516d7 | 12,110 | py | Python | acme/agents/tf/dmpo/learning.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 1 | 2020-08-31T23:46:32.000Z | 2020-08-31T23:46:32.000Z | acme/agents/tf/dmpo/learning.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 1 | 2021-01-25T15:39:56.000Z | 2021-01-25T15:39:56.000Z | acme/agents/tf/dmpo/learning.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 2 | 2021-01-07T11:35:19.000Z | 2021-01-07T12:16:21.000Z | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | 40.366667 | 80 | 0.716598 |
9e5d5ebab869ba7f5ca643258001d43b44281177 | 9,610 | py | Python | BioNetGen-2.3.0/source_Atomizer/SBMLparser/testing/simplePrinter.py | joseph-hellerstein/RuleBasedProgramming | fb88118ab764035979dc7c2bf8c89a7b484e4472 | [
"MIT"
] | null | null | null | BioNetGen-2.3.0/source_Atomizer/SBMLparser/testing/simplePrinter.py | joseph-hellerstein/RuleBasedProgramming | fb88118ab764035979dc7c2bf8c89a7b484e4472 | [
"MIT"
] | null | null | null | BioNetGen-2.3.0/source_Atomizer/SBMLparser/testing/simplePrinter.py | joseph-hellerstein/RuleBasedProgramming | fb88118ab764035979dc7c2bf8c89a7b484e4472 | [
"MIT"
] | null | null | null | import rulifier.componentGroups as componentGroups
import argparse
import pprint
from collections import defaultdict
import itertools
from copy import copy
from utils import readBNGXML
class SimplePrinter:
def __init__(self, fileName,rawFileName=None):
self.molecules, self.rules, _ = readBNGXML.parseXML... | 48.535354 | 149 | 0.643392 |
9e5d9f9216fa1eee8d5e7b6d9626dbfc108bb33b | 2,020 | py | Python | scripts/bam2contig_relative_abundance.py | CGATOxford/proj029 | f0a8ea63b4f086e673aa3bf8b7d3b9749261b525 | [
"BSD-3-Clause"
] | 3 | 2016-04-04T22:54:14.000Z | 2017-04-01T09:37:54.000Z | scripts/bam2contig_relative_abundance.py | CGATOxford/proj029 | f0a8ea63b4f086e673aa3bf8b7d3b9749261b525 | [
"BSD-3-Clause"
] | null | null | null | scripts/bam2contig_relative_abundance.py | CGATOxford/proj029 | f0a8ea63b4f086e673aa3bf8b7d3b9749261b525 | [
"BSD-3-Clause"
] | null | null | null | '''
bam2contig_relative_abundance.py
=================================
:Author: Nick Ilott
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
Take a bam file and output a tab delimited text file of all contigs and the
% of reads that map to each.
Usage
-----
Example::
python bam2contig_relative_abundan... | 25.25 | 91 | 0.608911 |
9e5dce57d53db7dec703f442dbb8627cd03f215d | 10,857 | py | Python | modules/emulator/pytari2600/audio/testaudio.py | 5space/nesbot | 38a9e8cadf0cbe41ee25e0850c244e2834a6e12c | [
"MIT"
] | 17 | 2016-02-23T22:44:09.000Z | 2022-03-16T02:39:15.000Z | modules/emulator/pytari2600/audio/testaudio.py | 5space/nesbot | 38a9e8cadf0cbe41ee25e0850c244e2834a6e12c | [
"MIT"
] | null | null | null | modules/emulator/pytari2600/audio/testaudio.py | 5space/nesbot | 38a9e8cadf0cbe41ee25e0850c244e2834a6e12c | [
"MIT"
] | 4 | 2018-02-24T19:52:30.000Z | 2020-11-30T00:38:21.000Z | from . import tiasound
import wave
import pygame.mixer
import pygame.locals
class WAV_TIA_Sound(tiasound.TIA_Sound):
""" Capture sound (accurately) to a wav file.
pacat --format=u8 pytari.wav
"""
def __init__(self, clocks):
super(WAV_TIA_Sound, self).__init__(clocks)
# Create diag... | 74.875862 | 1,570 | 0.502625 |
9e5dd79ee8cfb4916ca770fd38d40e48bb99d7b7 | 175 | py | Python | tests/test_basics.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | 2 | 2019-12-22T13:05:08.000Z | 2020-02-02T13:05:31.000Z | tests/test_basics.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | 71 | 2016-10-31T15:41:10.000Z | 2022-03-21T14:26:22.000Z | tests/test_basics.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | null | null | null | from flask import current_app
def test_app_exist():
assert current_app is not None
def test_app_is_in_testing_mode():
assert current_app.config['TESTING'] is True
| 17.5 | 48 | 0.771429 |
9e5de65c24d6cb8d45c72de714a2cf7e9f020034 | 1,073 | py | Python | articlee/main/routes.py | danielemingolla/BLOG_WEBAPP_FLASK | 19eaad5a674ac255723e0118f5d80eefd5cb08b8 | [
"MIT"
] | 1 | 2019-09-10T14:11:40.000Z | 2019-09-10T14:11:40.000Z | articlee/main/routes.py | danielemingolla/BLOG_WEBAPP_FLASK | 19eaad5a674ac255723e0118f5d80eefd5cb08b8 | [
"MIT"
] | 7 | 2019-09-11T21:17:01.000Z | 2022-01-13T01:38:40.000Z | articlee/main/routes.py | danielemingolla/ARTICLEES_WEBAPP_FLASK | 19eaad5a674ac255723e0118f5d80eefd5cb08b8 | [
"MIT"
] | null | null | null | import json
import requests
import lxml.html
from articlee.models import Articles
from flask import Blueprint, render_template, jsonify
mainroutes = Blueprint('mainroutes', __name__)
# API
@mainroutes.route('/api/index')
def apiindex():
dict_article = []
latest_articles = Articles.query.order_by(Articles.i... | 24.953488 | 93 | 0.718546 |
9e5dfae1176854081e585f3bac4b4e17eeba0cab | 2,018 | py | Python | equirectangular_great_circle.py | srajotte/equirectangular-great-circle | 244bccb930db4b786cccdcbd26a9d7e68eed17d7 | [
"MIT"
] | 2 | 2018-11-18T10:06:00.000Z | 2020-02-21T16:36:11.000Z | equirectangular_great_circle.py | srajotte/equirectangular-great-circle | 244bccb930db4b786cccdcbd26a9d7e68eed17d7 | [
"MIT"
] | null | null | null | equirectangular_great_circle.py | srajotte/equirectangular-great-circle | 244bccb930db4b786cccdcbd26a9d7e68eed17d7 | [
"MIT"
] | null | null | null | #!python3
import numpy as np
import matplotlib.pyplot as plt
def X_rotation_matrix(angle):
""" Generated 3D rotation matrix.
angle : degrees."""
Ry = np.zeros((3,3))
angle = np.deg2rad(angle)
Ry[0,0] = 1.0
Ry[1,1] = Ry[-1,-1] = np.cos(angle)
Ry[1,-1] = -np.sin(angle)
Ry[-1,1] = np.sin(angle)
return Ry
... | 26.207792 | 77 | 0.697721 |
9e5e2943827112710b7f90a85eff8de56f882a27 | 109 | py | Python | app/api/__init__.py | sebastienlanglois/flask-hydro | 2bd399ca91fdaeea297ec5e6ee076ce1a53d0f37 | [
"MIT"
] | null | null | null | app/api/__init__.py | sebastienlanglois/flask-hydro | 2bd399ca91fdaeea297ec5e6ee076ce1a53d0f37 | [
"MIT"
] | 8 | 2020-03-24T17:16:40.000Z | 2022-03-11T23:52:59.000Z | app/api/__init__.py | sebastienlanglois/flask-hydro | 2bd399ca91fdaeea297ec5e6ee076ce1a53d0f37 | [
"MIT"
] | null | null | null | from flask import Blueprint
bp = Blueprint('api', __name__)
from app.api import users, errors, tokens, gis
| 18.166667 | 46 | 0.752294 |
9e5e294920b74e34216189227110793d00653d59 | 1,037 | py | Python | examples/example_filter/example_gte_key.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 86 | 2017-08-17T12:41:52.000Z | 2022-02-24T12:17:47.000Z | examples/example_filter/example_gte_key.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 10 | 2020-03-30T03:24:46.000Z | 2022-02-23T01:34:53.000Z | examples/example_filter/example_gte_key.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 7 | 2017-08-18T03:40:35.000Z | 2020-05-19T04:09:10.000Z | # !/usr/local/python/bin/python
# -*- coding: utf-8 -*-
# (C) Wu Dong, 2020
# All rights reserved
# @Author: 'Wu Dong <wudong@eastwu.cn>'
# @Time: '2020-04-13 10:54'
""" 演示 pre-request 框架验证不同参数联动限制禁止相等
"""
from flask import Flask
from pre_request import pre, Rule
app = Flask(__name__)
app.config["TESTING"] = True
cli... | 19.203704 | 55 | 0.605593 |
9e5e323f038acd10a90d514886add5ebcb071697 | 2,847 | py | Python | quilt/signals.py | jayvdb/python-quilt | f09799e28ac3ced07dff91b1b677b3db00781ae9 | [
"MIT"
] | 4 | 2016-12-28T23:28:02.000Z | 2022-03-15T02:46:10.000Z | quilt/signals.py | jayvdb/python-quilt | f09799e28ac3ced07dff91b1b677b3db00781ae9 | [
"MIT"
] | 17 | 2017-02-24T09:16:14.000Z | 2019-04-08T08:37:17.000Z | quilt/signals.py | jayvdb/python-quilt | f09799e28ac3ced07dff91b1b677b3db00781ae9 | [
"MIT"
] | 2 | 2017-01-03T00:55:59.000Z | 2019-03-28T15:42:12.000Z | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 - 2017 Björn Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of python-quilt for details.
import weakref
from quilt.utils import _EqBase
class MethodRef(_Eq... | 26.119266 | 71 | 0.535652 |
9e5e49660751e6006e73ad2bc0edec6ac499347e | 1,367 | py | Python | test/test_gpu_strategy.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 358 | 2020-06-11T09:34:53.000Z | 2022-03-31T12:56:22.000Z | test/test_gpu_strategy.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 467 | 2020-06-11T13:49:45.000Z | 2022-03-31T14:19:48.000Z | test/test_gpu_strategy.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 48 | 2020-07-13T14:50:45.000Z | 2022-03-26T09:37:13.000Z | from typing import Tuple
from fedot.core.data.data import InputData, OutputData
from test.unit.models.test_split_train_test import get_synthetic_input_data
from fedot.core.operations.evaluation.gpu.common import CuMLEvaluationStrategy
from fedot.core.operations.evaluation.gpu.classification import CuMLClassificationS... | 35.973684 | 118 | 0.730066 |
9e5e5a65aa4774f066e76d4761d484b238832e2f | 1,839 | py | Python | py/123. Best Time to Buy and Sell Stock III.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/123. Best Time to Buy and Sell Stock III.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/123. Best Time to Buy and Sell Stock III.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/
# You are given an array prices where prices[i] is the price of a given stock on
# the ith day.
# Find the maximum profit you can achieve. You may complete at most two
# transactions.
# Note: You may not engage in multiple transactions simultaneous... | 39.12766 | 99 | 0.589451 |
9e5e68f878ea16980020ecb83744169970121bfb | 11,030 | py | Python | pepperoni/sysinfo.py | t3eHawk/pepperoni | 06b7ff9005bd1b7ed434ae286c2698d9205df718 | [
"MIT"
] | null | null | null | pepperoni/sysinfo.py | t3eHawk/pepperoni | 06b7ff9005bd1b7ed434ae286c2698d9205df718 | [
"MIT"
] | null | null | null | pepperoni/sysinfo.py | t3eHawk/pepperoni | 06b7ff9005bd1b7ed434ae286c2698d9205df718 | [
"MIT"
] | null | null | null | """Various system information, parameters and arguments."""
import argparse
import ast
import datetime as dt
import json
import os
import pip
import platform
import socket
import sys
# Path to user JSON file with parameters.
userprms = os.path.abspath(os.path.expanduser('~/.pepperoni/pepperoni.json'))
class Datase... | 34.576803 | 79 | 0.538985 |
9e5e73d7e0a2ea7698f7536c39209d389acb3c32 | 9,890 | py | Python | gateware/qmtech_ep4ce15_platform.py | hansfbaier/jt51-synth | 6f38fe97dcf64fcab35a0fa1a407c2b7fea32566 | [
"MIT"
] | 1 | 2021-06-16T09:01:17.000Z | 2021-06-16T09:01:17.000Z | gateware/qmtech_ep4ce15_platform.py | hansfbaier/jt51-synth | 6f38fe97dcf64fcab35a0fa1a407c2b7fea32566 | [
"MIT"
] | null | null | null | gateware/qmtech_ep4ce15_platform.py | hansfbaier/jt51-synth | 6f38fe97dcf64fcab35a0fa1a407c2b7fea32566 | [
"MIT"
] | 1 | 2021-07-03T10:20:35.000Z | 2021-07-03T10:20:35.000Z | from amaranth import *
from amaranth.build import *
from luna.gateware.platform.core import LUNAPlatform
from amaranth_boards.resources import *
from amaranth_boards.qmtech_ep4ce import QMTechEP4CEPlatform
class JT51SynthClockDomainGenerator(Elaboratable):
def __init__(self, *, clock_frequencies=None, clock_sig... | 54.043716 | 325 | 0.651567 |
9e5e7d634a5292241951b86d30c54378ca4d41b1 | 1,486 | py | Python | test/integration/test_examples.py | Omegastick/python-sdk | 568db5c5afabb3d99e2cb6be1afd69b08e2191d5 | [
"Apache-2.0"
] | 1 | 2019-06-29T19:32:38.000Z | 2019-06-29T19:32:38.000Z | test/integration/test_examples.py | SamArtGS/python-sdk | 7be6a4fe75d4a9fd365ef626d6289c0dc8457f3a | [
"Apache-2.0"
] | 5 | 2020-03-24T16:26:02.000Z | 2021-04-30T20:44:47.000Z | test/integration/test_examples.py | SamArtGS/python-sdk | 7be6a4fe75d4a9fd365ef626d6289c0dc8457f3a | [
"Apache-2.0"
] | 3 | 2019-08-20T11:37:29.000Z | 2020-07-18T11:22:14.000Z | # coding=utf-8
from __future__ import print_function
import re
import traceback
import pytest
import json as json_import
import os
from os.path import join, dirname
from glob import glob
# tests to exclude
excludes = ['authorization_v1.py', 'discovery_v1.ipynb', '__init__.py', 'microphone-speech-to-text.py']
# examp... | 33.022222 | 103 | 0.637281 |
9e5e9d7a14bc3433836d2b5bb984743a2d368624 | 13,134 | py | Python | additional_scripts/greens/disp_functions.py | rishabhdutta/nonplanar_gorkha | b0805d13a00d4a73f33110ea75c741f465f9b700 | [
"MIT"
] | null | null | null | additional_scripts/greens/disp_functions.py | rishabhdutta/nonplanar_gorkha | b0805d13a00d4a73f33110ea75c741f465f9b700 | [
"MIT"
] | null | null | null | additional_scripts/greens/disp_functions.py | rishabhdutta/nonplanar_gorkha | b0805d13a00d4a73f33110ea75c741f465f9b700 | [
"MIT"
] | null | null | null | from __future__ import division
from numpy import sin, cos, tan, pi, log
import numpy as np
def adv(y1, y2, y3, a, beta, nu, B1, B2, B3):
if (np.abs(beta) > 0.000001) and (np.abs(beta - pi) > 0.000001):
# tolerance hard-coded to match Meade
# initialize some variables
sinbeta = sin(beta)... | 48.464945 | 80 | 0.37125 |
9e5eb1243d5120caed06f788eddb17b276b1a119 | 649 | py | Python | toppra/__init__.py | indivisibleatom/toppra | a5634163c99155ae633ae399d5cac753eef4c80c | [
"MIT"
] | null | null | null | toppra/__init__.py | indivisibleatom/toppra | a5634163c99155ae633ae399d5cac753eef4c80c | [
"MIT"
] | null | null | null | toppra/__init__.py | indivisibleatom/toppra | a5634163c99155ae633ae399d5cac753eef4c80c | [
"MIT"
] | null | null | null | """
TOPP-RA
=======
Reachability-Analysis-based Time-Optimal Path Parametrization.
This package produces routines for creation and handling path constraints
using the algorithm `TOPP-RA`.
"""
# import constraint
# from .TOPP import *
from .interpolator import *
# from .constraints import *
from .utils import smooth_si... | 30.904762 | 95 | 0.816641 |
9e5ebbb1f2a9147f3787b9ee7224d09d37deda89 | 627 | py | Python | lib/vrd/cvpr/run_relation_visualization.py | yjy941124/PPR-FCN | 1eba5515b37e7b32413efdf14bb0c22a2e46fee9 | [
"MIT"
] | 20 | 2017-10-16T18:12:51.000Z | 2021-12-23T02:34:20.000Z | lib/vrd/cvpr/run_relation_visualization.py | yjy941124/PPR-FCN | 1eba5515b37e7b32413efdf14bb0c22a2e46fee9 | [
"MIT"
] | 1 | 2018-11-10T04:59:48.000Z | 2021-01-21T04:51:31.000Z | lib/vrd/cvpr/run_relation_visualization.py | yjy941124/PPR-FCN | 1eba5515b37e7b32413efdf14bb0c22a2e46fee9 | [
"MIT"
] | 5 | 2017-10-17T00:54:42.000Z | 2018-04-08T15:09:40.000Z | import _init_paths
from vrd.test import test_net
from fast_rcnn.config import cfg, cfg_from_file, cfg_from_list
from datasets.factory import get_imdb
import caffe
import argparse
import pprint
import time, os, sys
import numpy as np
import h5py
import cv2
import scipy.io as sio
from numpy.core.records import fromarray... | 20.9 | 67 | 0.84051 |
9e5eda3b6db9b8e74cf19338ac3a77a14a166b83 | 370 | py | Python | tests/testapp/tests.py | bettsmatt/django-initialcon | c66b4aa59fef6049433a8373d075b0c48eab021f | [
"MIT"
] | 1 | 2021-07-17T13:52:22.000Z | 2021-07-17T13:52:22.000Z | tests/testapp/tests.py | bettsmatt/django-initialcon | c66b4aa59fef6049433a8373d075b0c48eab021f | [
"MIT"
] | 1 | 2015-07-08T21:17:14.000Z | 2015-07-08T21:17:14.000Z | tests/testapp/tests.py | bettsmatt/django-initialcon | c66b4aa59fef6049433a8373d075b0c48eab021f | [
"MIT"
] | 2 | 2015-04-08T00:42:44.000Z | 2015-07-07T03:39:24.000Z | from django.test import TestCase
from django.core.urlresolvers import reverse
class ExampleTest(TestCase):
def test_name_with_single_space_does_not_error(self):
self.client.get(reverse('initialcon:generate', kwargs={'name': ' '}))
def test_empty_name_does_not_error(self):
self.client.get(rev... | 30.833333 | 77 | 0.737838 |
9e5edc575f76265a833ca83474f224fb43158c2a | 1,602 | py | Python | datathon/datathon_etl_pipelines/utils_test.py | kourtneyshort/healthcare | 1d1e2375304ac99f43a8b6aee7374fcdf641eb6f | [
"Apache-2.0"
] | 310 | 2018-02-23T01:40:01.000Z | 2022-03-30T12:25:56.000Z | datathon/datathon_etl_pipelines/utils_test.py | kourtneyshort/healthcare | 1d1e2375304ac99f43a8b6aee7374fcdf641eb6f | [
"Apache-2.0"
] | 189 | 2018-06-19T15:32:10.000Z | 2022-03-11T23:48:14.000Z | datathon/datathon_etl_pipelines/utils_test.py | animesh/healthcare | 7d3d4dc9deb3d31eab99035780ccb9a44f00b687 | [
"Apache-2.0"
] | 165 | 2018-03-06T19:29:18.000Z | 2022-03-21T10:53:45.000Z | import decimal
import os
from absl.testing import absltest
from absl.testing import parameterized
from datathon_etl_pipelines.utils import get_setup_file
from datathon_etl_pipelines.utils import scalar_to_feature
from enum import Enum
class GetSetupFileTest(absltest.TestCase):
def test_exists(self):
self.asse... | 30.226415 | 73 | 0.730337 |
9e5f0f47c2bdfdd0e19f4c413799ab1299738d50 | 2,213 | py | Python | taxamo/models/calculateTaxLocationOut.py | taxamo/taxamo-python | 190bdda68963860c131d2b1e9d31cd88de10d694 | [
"Apache-2.0"
] | 4 | 2016-03-14T03:59:08.000Z | 2020-06-21T07:58:38.000Z | taxamo/models/calculateTaxLocationOut.py | taxamo/taxamo-python | 190bdda68963860c131d2b1e9d31cd88de10d694 | [
"Apache-2.0"
] | 2 | 2016-03-07T13:41:23.000Z | 2017-07-11T13:39:44.000Z | taxamo/models/calculateTaxLocationOut.py | taxamo/taxamo-python | 190bdda68963860c131d2b1e9d31cd88de10d694 | [
"Apache-2.0"
] | 8 | 2016-01-13T14:32:19.000Z | 2021-08-16T11:14:06.000Z | #!/usr/bin/env python
"""
Copyright 2014-2021 by Taxamo
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... | 41.754717 | 154 | 0.666516 |
9e5f23bd87bafd1a8774ea298a741ba102c3fa9d | 2,470 | py | Python | continuum_goodness_of_fit.py | yishayv/lyacorr | deed114b4cadd4971caec68e2838a5fac39827b1 | [
"MIT"
] | 2 | 2017-03-21T14:18:35.000Z | 2020-03-30T20:51:33.000Z | continuum_goodness_of_fit.py | yishayv/lyacorr | deed114b4cadd4971caec68e2838a5fac39827b1 | [
"MIT"
] | null | null | null | continuum_goodness_of_fit.py | yishayv/lyacorr | deed114b4cadd4971caec68e2838a5fac39827b1 | [
"MIT"
] | null | null | null | import lmfit
import numpy as np
import weighted
import common_settings
import physics_functions.delta_f_snr_bins
from python_compat import range
settings = common_settings.Settings() # type: common_settings.Settings
delta_f_snr_bins_helper = physics_functions.delta_f_snr_bins.DeltaFSNRBins()
def fit_function(para... | 34.305556 | 111 | 0.687449 |
9e5f2858f6c23f3de01810aba61bc03f3bc3b525 | 388 | py | Python | src/birdhouse_toolbox/library/wordpress/save_credentials.py | alexseitsinger/birdhouse-toolbox | 2c7c725d143b02228365ed82f57f6fecca21a614 | [
"BSD-2-Clause"
] | null | null | null | src/birdhouse_toolbox/library/wordpress/save_credentials.py | alexseitsinger/birdhouse-toolbox | 2c7c725d143b02228365ed82f57f6fecca21a614 | [
"BSD-2-Clause"
] | null | null | null | src/birdhouse_toolbox/library/wordpress/save_credentials.py | alexseitsinger/birdhouse-toolbox | 2c7c725d143b02228365ed82f57f6fecca21a614 | [
"BSD-2-Clause"
] | null | null | null | import os
import json
from json import JSONDecodeError
from ..save_config import save_config
from ...settings import DEFAULT_CONFIG_FILE_NAME
def save_credentials(
site_url, username, password, config_file_name=DEFAULT_CONFIG_FILE_NAME
):
payload = {"username": username, "password": password}
save_config... | 27.714286 | 82 | 0.786082 |
9e5f2aa84a412f027d21cc5934fc196a8a55ffc3 | 77,712 | py | Python | Cogs/Music.py | ArijitTheDev/CorpBot.py | cd2e7ced54630334a85b0235a8b02ed827e03581 | [
"MIT"
] | null | null | null | Cogs/Music.py | ArijitTheDev/CorpBot.py | cd2e7ced54630334a85b0235a8b02ed827e03581 | [
"MIT"
] | null | null | null | Cogs/Music.py | ArijitTheDev/CorpBot.py | cd2e7ced54630334a85b0235a8b02ed827e03581 | [
"MIT"
] | null | null | null | import discord, wavelink, re, random, math, tempfile, json, os, shutil
from discord.ext import commands
from Cogs import Utils, Message, DisplayName, PickList, DL
# This file was originally based on Rapptz's basic_voice.py:
# https://github.com/Rapptz/discord.py/blob/master/examples/basic_voice.py
def setup(bo... | 48.66124 | 270 | 0.686535 |
9e5f43fda3d7ff54613e78f66cd47408827c1639 | 774 | py | Python | python2/tests/test_L.py | blackelk/hell | 4bb72b2efcb8c83396a95fb6b75c169e2d2315cd | [
"MIT"
] | 2 | 2017-10-01T16:50:37.000Z | 2019-07-03T21:19:09.000Z | python3/tests/test_L.py | blackelk/hell | 4bb72b2efcb8c83396a95fb6b75c169e2d2315cd | [
"MIT"
] | 3 | 2020-03-31T03:04:38.000Z | 2021-11-15T17:48:34.000Z | python3/tests/test_L.py | blackelk/hell | 4bb72b2efcb8c83396a95fb6b75c169e2d2315cd | [
"MIT"
] | null | null | null | from pytest import raises
from termcolor import colored
from hell import L
from conftest import capture_out
l = capture_out(L)
def test_arg():
assert l('') == colored('0\n')
assert l([1]) == colored('1\n')
def test_c():
assert l('A', c='green') == colored('1\n', 'green')
assert l('A', c='b') == c... | 18.878049 | 94 | 0.581395 |
9e5f5a16f32d2c7ad12cdebabca7ff18c984b6b6 | 1,221 | py | Python | cogs/testing_cog.py | Critteros/DzwoneczekBOT | 4f6100cf26f430521247f494620c9a2ceda1f362 | [
"Apache-2.0"
] | null | null | null | cogs/testing_cog.py | Critteros/DzwoneczekBOT | 4f6100cf26f430521247f494620c9a2ceda1f362 | [
"Apache-2.0"
] | null | null | null | cogs/testing_cog.py | Critteros/DzwoneczekBOT | 4f6100cf26f430521247f494620c9a2ceda1f362 | [
"Apache-2.0"
] | null | null | null | """
Extension desined to test bot functionality, just for testing
"""
# Library includes
from discord.ext import commands
# App includes
from app.client import BotClient
class TestCog(commands.Cog):
"""
Class cog for the testing_cog cog extension
"""
def __init__(self, client: BotClient):
... | 24.42 | 74 | 0.63964 |
9e5fa6e4ea46a89c6e999fbec776b9f4c67a92c7 | 1,944 | py | Python | contrib/runners/action_chain_runner/setup.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | null | null | null | contrib/runners/action_chain_runner/setup.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | 2 | 2020-03-04T08:33:36.000Z | 2020-03-04T08:34:14.000Z | contrib/runners/action_chain_runner/setup.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed to the StackStorm, Inc ('StackStorm') 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 "Licen... | 36 | 83 | 0.737654 |
9e601366dcb92a805dfbc83cfb5de25657f44976 | 2,245 | py | Python | vfio_isolate/action/irq_affinity.py | spheenik/vfio-isolate | 6d6a1f0d5e5d84a5ad9911c635a81b86710d12d5 | [
"MIT"
] | 44 | 2020-05-03T15:03:32.000Z | 2022-03-23T19:03:23.000Z | vfio_isolate/action/irq_affinity.py | spheenik/vfio-isolate | 6d6a1f0d5e5d84a5ad9911c635a81b86710d12d5 | [
"MIT"
] | 7 | 2020-08-18T10:17:14.000Z | 2022-01-14T14:18:47.000Z | vfio_isolate/action/irq_affinity.py | spheenik/vfio-isolate | 6d6a1f0d5e5d84a5ad9911c635a81b86710d12d5 | [
"MIT"
] | 6 | 2020-06-02T05:29:34.000Z | 2022-02-04T17:12:40.000Z | from dataclasses import dataclass
from enum import Enum, unique
from vfio_isolate.cpuset import CPUNodeSet
from vfio_isolate.irq import IRQ
from .action import Action, Execution
@unique
class IRQAffinityOperation(Enum):
mask = 1,
add = 2
class IRQAffinity(Action):
@dataclass
class Param:
ir... | 36.209677 | 82 | 0.528285 |
9e604a982b53a8232b418bbce07dcfdf932ced10 | 575 | py | Python | sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/eventhub/azure-eventhub/azure/eventhub/aio/_async_utils.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. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import sys
... | 35.9375 | 101 | 0.507826 |
9e605710651e31ad4b9dd56058a38f1d5b7c6d2c | 5,047 | py | Python | scripts/tp2d2.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 39 | 2021-12-14T11:05:25.000Z | 2022-03-31T18:50:58.000Z | scripts/tp2d2.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 17 | 2022-01-04T14:32:26.000Z | 2022-03-29T14:01:36.000Z | scripts/tp2d2.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 4 | 2022-01-11T16:40:17.000Z | 2022-03-30T02:09:55.000Z | # -*- coding: utf-8 -*-
# File: tp2d2.py
# Copyright 2021 Dr. Janis Meyer. 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... | 37.947368 | 128 | 0.661185 |
9e605b2283ee3b71c616f4bb86352d92ff3475bc | 3,187 | py | Python | stack/security_groups.py | caktus/aws-web-stacks | 31859d5c935653be453f97220f2e53155e23f429 | [
"MIT"
] | 83 | 2017-10-06T14:03:31.000Z | 2021-11-08T10:32:22.000Z | stack/security_groups.py | caktus/aws-web-stacks | 31859d5c935653be453f97220f2e53155e23f429 | [
"MIT"
] | 39 | 2017-09-29T13:43:30.000Z | 2022-03-22T20:35:43.000Z | stack/security_groups.py | caktus/aws-web-stacks | 31859d5c935653be453f97220f2e53155e23f429 | [
"MIT"
] | 19 | 2017-10-25T18:46:50.000Z | 2022-02-13T20:11:54.000Z | from troposphere import Join, Ref, Sub, Tag, Tags
from troposphere.ec2 import SecurityGroup, SecurityGroupRule
from . import (
USE_DOKKU,
USE_EB,
USE_EC2,
USE_ECS,
USE_EKS,
USE_GOVCLOUD,
USE_NAT_GATEWAY
)
from .common import administrator_ip_address
from .template import template
from .vpc ... | 32.520408 | 104 | 0.625039 |
9e609bc9ce178b2d70545bc7a61a2f41e79f073a | 3,006 | py | Python | Lib/site-packages/py2exe/__init__.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 1 | 2022-03-28T05:21:51.000Z | 2022-03-28T05:21:51.000Z | Lib/site-packages/py2exe/__init__.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/py2exe/__init__.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | null | null | null | """
builds windows executables from Python scripts
New keywords for distutils' setup function specify what to build:
console
list of scripts to convert into console exes
windows
list of scripts to convert into gui exes
service
list of module names containing win32 service classes... | 34.551724 | 82 | 0.713906 |
9e609fddf833e615371b10e76b6a4879e08d4ade | 242 | py | Python | custom tools/minAreaRect_func.py | junhai0428/YOLOX-OBB | 9f0d745b89ba6559e692ff06ba09b433b2f4594c | [
"Apache-2.0"
] | 36 | 2021-11-02T12:11:44.000Z | 2022-03-28T13:43:31.000Z | custom tools/minAreaRect_func.py | junhai0428/YOLOX-OBB | 9f0d745b89ba6559e692ff06ba09b433b2f4594c | [
"Apache-2.0"
] | 5 | 2021-10-05T03:33:24.000Z | 2022-02-22T06:13:46.000Z | custom tools/minAreaRect_func.py | junhai0428/YOLOX-OBB | 9f0d745b89ba6559e692ff06ba09b433b2f4594c | [
"Apache-2.0"
] | 10 | 2021-10-17T08:52:49.000Z | 2022-03-24T03:26:16.000Z | import cv2
import numpy as np
cnt = np.array([[20, 20], [20, 40], [40, 20], [40, 40]])
cnt = np.array([[20, 20], [20, 80], [21, 20], [21, 80]])
cnt = np.array([[20, 20], [20, 21], [40, 20], [40, 21]])
rect = cv2.minAreaRect(cnt)
print(rect)
| 26.888889 | 56 | 0.545455 |
9e60b9572292dcb1940584d4b45d830c0af82938 | 1,377 | py | Python | bootloader/waflib/Tools/flex.py | BA7JCM/pyinstaller | 51ff689509391921bdce42848f3a077dcbb40ca0 | [
"Apache-2.0"
] | null | null | null | bootloader/waflib/Tools/flex.py | BA7JCM/pyinstaller | 51ff689509391921bdce42848f3a077dcbb40ca0 | [
"Apache-2.0"
] | null | null | null | bootloader/waflib/Tools/flex.py | BA7JCM/pyinstaller | 51ff689509391921bdce42848f3a077dcbb40ca0 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os, re
from waflib import Task, TaskGen
from waflib.Tools import ccroot
def decide_ext(self, node):
if 'cxx' in self.features:
return ['.lex.cc']
return ['.lex.c']
def flex... | 25.5 | 78 | 0.622367 |
9e60bf0474916b2b8af874a431fedca100f27c3e | 363 | py | Python | app/recipe/urls.py | GunnJack/recipe-app-api | b1f56ec21817ef0db54921964360fe6233ebd159 | [
"MIT"
] | null | null | null | app/recipe/urls.py | GunnJack/recipe-app-api | b1f56ec21817ef0db54921964360fe6233ebd159 | [
"MIT"
] | null | null | null | app/recipe/urls.py | GunnJack/recipe-app-api | b1f56ec21817ef0db54921964360fe6233ebd159 | [
"MIT"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from recipe import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
router.register('ingredients', views.IngredientViewSet)
router.register('recipes', views.RecipeViewSet)
app_name = 'recipe'
urlpattern... | 19.105263 | 55 | 0.77135 |
9e60dd91c38280fa7c8305bbc9c876e13387246e | 9,282 | py | Python | More/E00_Publications/Magazines/TypeMagazine3/A_People_07.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-06-20T22:01:23.000Z | 2021-08-06T04:39:50.000Z | More/E00_Publications/Magazines/TypeMagazine3/A_People_07.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-05-17T09:32:27.000Z | 2021-03-15T19:45:52.000Z | More/E00_Publications/Magazines/TypeMagazine3/A_People_07.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 2 | 2021-02-25T19:07:45.000Z | 2022-01-09T21:14:06.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T E X A M P L E S
#
# Copyright (c) 2017 Thom Janssen <https://github.com/thomgb>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, ww... | 39.330508 | 116 | 0.684335 |
9e60e1d65f35a6b6d9efd29c61512bd9cc39e394 | 277 | py | Python | array/maxsubarray.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | array/maxsubarray.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | array/maxsubarray.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | class Solution:
def maxSubArray(self, nums: [int]) -> int:
max_ending = max_current = nums[0]
for i in nums[1:]:
max_ending = max(i, max_ending + i)
max_current = max(max_current, max_ending)
return max_current
| 27.7 | 54 | 0.559567 |
9e60fdce6b77291f078fce698657a6c42252178c | 2,194 | py | Python | fare/grant_roles/api.py | open-education-polito/fare-invenio | 1c3498be270b7df8ab28a80c8b890e5bb8e50c3e | [
"MIT"
] | 4 | 2019-08-24T15:36:09.000Z | 2020-03-30T12:11:07.000Z | fare/grant_roles/api.py | open-education-polito/fare-invenio | 1c3498be270b7df8ab28a80c8b890e5bb8e50c3e | [
"MIT"
] | 70 | 2019-10-22T17:10:08.000Z | 2020-04-23T17:25:14.000Z | fare/grant_roles/api.py | open-education-polito/fare-invenio | 1c3498be270b7df8ab28a80c8b890e5bb8e50c3e | [
"MIT"
] | null | null | null | """api for grant_roles module."""
from __future__ import absolute_import, print_function
from flask import current_app
from werkzeug.local import LocalProxy
_datastore = LocalProxy(lambda: current_app.extensions['security'].datastore)
def grant_staff_permission(user_email):
"""Grant staff permission to a user.... | 33.242424 | 79 | 0.610301 |
9e611f08c41432b666891b9407ea855ac7fda701 | 973 | py | Python | examples/environment.py | scartill/cmd2 | 1b4e1e25f84bcc800a5f369783c3c3448a42361e | [
"MIT"
] | 1 | 2021-07-06T23:59:46.000Z | 2021-07-06T23:59:46.000Z | examples/environment.py | scartill/cmd2 | 1b4e1e25f84bcc800a5f369783c3c3448a42361e | [
"MIT"
] | null | null | null | examples/environment.py | scartill/cmd2 | 1b4e1e25f84bcc800a5f369783c3c3448a42361e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
"""
A sample application for cmd2 demonstrating customized environment parameters
"""
import cmd2
class EnvironmentApp(cmd2.Cmd):
""" Example cmd2 application. """
degrees_c = 22
sunny = False
def __init__(self):
super().__init__()
self.settable.u... | 24.948718 | 77 | 0.59815 |
9e612408328e79a61133e2fad9e20caad8c66031 | 6,154 | py | Python | scripts/dtriac-534/create_lif.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | null | null | null | scripts/dtriac-534/create_lif.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/create_lif.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | null | null | null | """create_lif.py
Create LIF files from the Science Parse output.
Usage:
$ python create_lif.py JSON_DIR LIF_DIR TXT_DIR
The first directory is the one with JSON files created by science parse, the
second the target for LIF files and the third the target for TXT files.
Should work for both Python2 and Python3.
"""... | 33.628415 | 103 | 0.654534 |
9e6125e544a5326a2b51b6a5e3ebf58fe850f687 | 15,562 | py | Python | neutron/agent/l3/dvr_edge_router.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | null | null | null | neutron/agent/l3/dvr_edge_router.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | null | null | null | neutron/agent/l3/dvr_edge_router.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 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 ... | 44.210227 | 79 | 0.643491 |
9e61263f3416959aa32c25a1d8c393ed8fa31248 | 2,488 | py | Python | unit_tests_evolutionary.py | CLAHRCWessex/SymmetricTSP | 2cfce4146ece0c784aa62f1b0e2ac1cb2e91b6c4 | [
"MIT"
] | 1 | 2020-06-01T22:56:11.000Z | 2020-06-01T22:56:11.000Z | unit_tests_evolutionary.py | CLAHRCWessex/SymmetricTSP | 2cfce4146ece0c784aa62f1b0e2ac1cb2e91b6c4 | [
"MIT"
] | null | null | null | unit_tests_evolutionary.py | CLAHRCWessex/SymmetricTSP | 2cfce4146ece0c784aa62f1b0e2ac1cb2e91b6c4 | [
"MIT"
] | null | null | null | '''
Unit tests for evolutionary algorithms module 'evolutionary.py'
Work in progress!
'''
import numpy as np
import pytest
from evolutionary import PartiallyMappedCrossover
def test_pmx_child_a():
test_seed = 101
np.random.seed(seed=test_seed)
#sets up swap between index 1 and 3 for child a
#... | 26.189474 | 65 | 0.574357 |
9e61297859b879bbc493638ac1c74bf83a738530 | 31,905 | py | Python | tests/execution_engine/test_pandas_execution_engine.py | UtahDave/great_expectations | 99a54370f7ebeea5d95bca726200db01c7326d68 | [
"Apache-2.0"
] | 1 | 2021-11-22T12:51:08.000Z | 2021-11-22T12:51:08.000Z | tests/execution_engine/test_pandas_execution_engine.py | UtahDave/great_expectations | 99a54370f7ebeea5d95bca726200db01c7326d68 | [
"Apache-2.0"
] | null | null | null | tests/execution_engine/test_pandas_execution_engine.py | UtahDave/great_expectations | 99a54370f7ebeea5d95bca726200db01c7326d68 | [
"Apache-2.0"
] | 1 | 2021-10-08T01:24:50.000Z | 2021-10-08T01:24:50.000Z | import datetime
import os
import random
from pathlib import Path
from typing import List
from unittest import mock
import boto3
import pandas as pd
import pytest
from botocore.errorfactory import ClientError
from moto import mock_s3
try:
from azure.storage.blob import BlobServiceClient
except:
azure = None
... | 32.259858 | 106 | 0.635888 |
9e618bcfbcca619decb57d2bfcac5187c329b2c3 | 184 | py | Python | gobbli/augment/__init__.py | awesome-archive/gobbli | 71aacbdc1184871b164185dc0c9f615f07b83173 | [
"Apache-2.0"
] | 1 | 2019-10-17T17:43:26.000Z | 2019-10-17T17:43:26.000Z | gobbli/augment/__init__.py | awesome-archive/gobbli | 71aacbdc1184871b164185dc0c9f615f07b83173 | [
"Apache-2.0"
] | null | null | null | gobbli/augment/__init__.py | awesome-archive/gobbli | 71aacbdc1184871b164185dc0c9f615f07b83173 | [
"Apache-2.0"
] | 1 | 2019-10-17T17:43:27.000Z | 2019-10-17T17:43:27.000Z | from gobbli.augment.bert import BERTMaskedLM
from gobbli.augment.word2vec import Word2Vec
from gobbli.augment.wordnet import WordNet
__all__ = ["BERTMaskedLM", "Word2Vec", "WordNet"]
| 30.666667 | 49 | 0.809783 |
9e619066a6ed0b6b1294cabdb3f2d22324e498ca | 693 | py | Python | app/core/migrations/0003_tag.py | yohan-hicof/recipe-app-api | df7f763e87d992b2cc1b3be6ff7f7765b4eaea5f | [
"MIT"
] | null | null | null | app/core/migrations/0003_tag.py | yohan-hicof/recipe-app-api | df7f763e87d992b2cc1b3be6ff7f7765b4eaea5f | [
"MIT"
] | 7 | 2021-03-19T03:25:11.000Z | 2022-01-13T02:46:13.000Z | app/core/migrations/0003_tag.py | yohan-hicof/recipe-app-api | df7f763e87d992b2cc1b3be6ff7f7765b4eaea5f | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-21 09:14
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20200516_0834'),
]
operations = [
migrations.CreateModel... | 28.875 | 118 | 0.621934 |
9e61a4436a51bf1e96b8dea258a9c1a546fafa85 | 504 | py | Python | main/links/admin.py | TunedMystic/url-shortener | 6a6abc8ee2397c3d4626189fbc362232a60ddef2 | [
"MIT"
] | null | null | null | main/links/admin.py | TunedMystic/url-shortener | 6a6abc8ee2397c3d4626189fbc362232a60ddef2 | [
"MIT"
] | null | null | null | main/links/admin.py | TunedMystic/url-shortener | 6a6abc8ee2397c3d4626189fbc362232a60ddef2 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Link, Tag
class LinkAdmin(admin.ModelAdmin):
readonly_fields = ('unique_addresses',)
def unique_addresses(self, instance):
unique_ips = instance.addresses.count()
if unique_ips >= 50:
return '{} Unique IP Addresses'.format(uni... | 25.2 | 81 | 0.706349 |
9e61b5838a84032784a38b08c88b006592479ed0 | 128 | py | Python | esl/economics/cash.py | fagan2888/ESL | 24ffa903e8c5b9e725eed9861623d4b6a4a205a2 | [
"Apache-2.0"
] | 1 | 2020-04-17T18:18:08.000Z | 2020-04-17T18:18:08.000Z | esl/economics/cash.py | fagan2888/ESL | 24ffa903e8c5b9e725eed9861623d4b6a4a205a2 | [
"Apache-2.0"
] | null | null | null | esl/economics/cash.py | fagan2888/ESL | 24ffa903e8c5b9e725eed9861623d4b6a4a205a2 | [
"Apache-2.0"
] | null | null | null | from esl.economics.money import Money
from esl.economics.tangibility import Intangible
class Cash(Money, Intangible):
pass | 21.333333 | 48 | 0.804688 |
9e61fc54d10c1b75786450060e428c73974760a7 | 24,792 | py | Python | tensorflow/contrib/rnn/python/ops/lstm_ops.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/rnn/python/ops/lstm_ops.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/rnn/python/ops/lstm_ops.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2016 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... | 35.316239 | 96 | 0.650331 |
9e6203cfe95bedfb5922006cb42252451c09ac40 | 2,355 | py | Python | autotest/gcore/bmp_write.py | chambbj/gdal | 3d56aecb5b8e9890dae8f560acd099992e707d12 | [
"MIT"
] | 1 | 2015-02-16T16:51:38.000Z | 2015-02-16T16:51:38.000Z | autotest/gcore/bmp_write.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | autotest/gcore/bmp_write.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read/write functionality for Microsoft Bitmap (.bmp)
# BMP driver.
# Author: Andrey Kiselev, dron@remotesensing.org
#
#############################... | 30.584416 | 79 | 0.580042 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.