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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7fe282e58c8917bff20aa17487b45f7e665af020 | 79,023 | py | Python | from_cpython/Lib/test/test_multiprocessing.py | jmgc/pyston | 9f672c1bbb75710ac17dd3d9107da05c8e9e8e8f | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | from_cpython/Lib/test/test_multiprocessing.py | jmgc/pyston | 9f672c1bbb75710ac17dd3d9107da05c8e9e8e8f | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | from_cpython/Lib/test/test_multiprocessing.py | jmgc/pyston | 9f672c1bbb75710ac17dd3d9107da05c8e9e8e8f | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | # - This test hangs and the tester fails to clean it up.
#
# Unit tests for the multiprocessing package
#
import unittest
import Queue
import time
import sys
import os
import gc
import signal
import array
import socket
import random
import logging
import errno
import test.script_helper
from test import test_support
fr... | 30.428571 | 88 | 0.597294 |
761c225b1eb9c337ac5cb29fc0b268101bd77117 | 4,782 | py | Python | packages/simcore-sdk/src/simcore_sdk/node_ports_v2/nodeports_v2.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | null | null | null | packages/simcore-sdk/src/simcore_sdk/node_ports_v2/nodeports_v2.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | null | null | null | packages/simcore-sdk/src/simcore_sdk/node_ports_v2/nodeports_v2.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | null | null | null | import logging
from collections import deque
from pathlib import Path
from typing import Any, Callable, Coroutine, Dict, Type
from pydantic import BaseModel, Field
from servicelib.utils import logged_gather
from ..node_ports_common.dbmanager import DBManager
from ..node_ports_common.exceptions import PortNotFound, Un... | 38.878049 | 84 | 0.669803 |
34be463f470231ab58ff3c5a1147b4a503eb97fc | 814 | py | Python | ws2122-lspm/Lib/site-packages/pm4py/algo/filtering/pandas/pd_filtering_constants.py | Malekhy/ws2122-lspm | e4dc8b801d12f862b8ef536a0f125f346f085a00 | [
"MIT"
] | 1 | 2022-01-19T04:02:46.000Z | 2022-01-19T04:02:46.000Z | ws2122-lspm/Lib/site-packages/pm4py/algo/filtering/pandas/pd_filtering_constants.py | Malekhy/ws2122-lspm | e4dc8b801d12f862b8ef536a0f125f346f085a00 | [
"MIT"
] | 1 | 2021-11-19T07:21:48.000Z | 2021-11-19T07:21:48.000Z | ws2122-lspm/Lib/site-packages/pm4py/algo/filtering/pandas/pd_filtering_constants.py | Malekhy/ws2122-lspm | e4dc8b801d12f862b8ef536a0f125f346f085a00 | [
"MIT"
] | 1 | 2022-01-14T17:15:38.000Z | 2022-01-14T17:15:38.000Z | '''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... | 42.842105 | 76 | 0.750614 |
c92f944400cc111a1e3a5c2b7a941ba7254c0ffb | 411 | py | Python | actions/migrations/0007_auto_20180216_1611.py | eric-scott-owens/loopla | 1fd5e6e7e9907198ff904111010b362a129d5e39 | [
"MIT"
] | null | null | null | actions/migrations/0007_auto_20180216_1611.py | eric-scott-owens/loopla | 1fd5e6e7e9907198ff904111010b362a129d5e39 | [
"MIT"
] | 6 | 2020-06-05T22:27:20.000Z | 2022-03-24T10:25:50.000Z | actions/migrations/0007_auto_20180216_1611.py | eric-scott-owens/loopla | 1fd5e6e7e9907198ff904111010b362a129d5e39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2018-02-16 16:11
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('actions', '0006_simpleaction'),
]
operations = [
migrations.AlterModelOptions(
... | 20.55 | 48 | 0.608273 |
35e30ed6a28c13b52f627cfe84499c17ecd8c6eb | 7,911 | py | Python | qmorph.py | jtauber/qmorph | 6a1405bd77e2835b0d9301687ddd94fdee9c6540 | [
"MIT"
] | 2 | 2015-02-05T16:08:10.000Z | 2020-03-25T03:49:07.000Z | qmorph.py | jtauber/qmorph | 6a1405bd77e2835b0d9301687ddd94fdee9c6540 | [
"MIT"
] | null | null | null | qmorph.py | jtauber/qmorph | 6a1405bd77e2835b0d9301687ddd94fdee9c6540 | [
"MIT"
] | null | null | null | from collections import defaultdict
class Rel:
def __init__(self):
self.tuples = []
# indexes only exist for load-time joins at the moment, not queries
self.indexes = defaultdict(dict)
def add(self, data_dict, index=None, join=None):
# before we add the given dictionary, let's... | 28.978022 | 111 | 0.462268 |
dae16bb75df5b3651ed411d9ba857be37a98f534 | 458 | py | Python | api/licences/migrations/0002_licence_decisions.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 3 | 2019-05-15T09:30:39.000Z | 2020-04-22T16:14:23.000Z | api/licences/migrations/0002_licence_decisions.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 85 | 2019-04-24T10:39:35.000Z | 2022-03-21T14:52:12.000Z | api/licences/migrations/0002_licence_decisions.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 1 | 2021-01-17T11:12:19.000Z | 2021-01-17T11:12:19.000Z | # Generated by Django 2.2.11 on 2020-04-01 13:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("decisions", "0001_initial"),
("licences", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="licence",
... | 22.9 | 90 | 0.604803 |
c572957f98c28af30a1d2a1244a738be8238d07c | 1,518 | py | Python | tensorflow_compression/python/ops/range_coding_ops_test.py | Faizullah877/compression | 82111a7ec61c3478f38c152ae7ec3fa61b21a530 | [
"Apache-2.0"
] | 636 | 2018-05-16T01:27:25.000Z | 2022-03-29T15:23:56.000Z | tensorflow_compression/python/ops/range_coding_ops_test.py | Faizullah877/compression | 82111a7ec61c3478f38c152ae7ec3fa61b21a530 | [
"Apache-2.0"
] | 91 | 2018-05-16T21:29:55.000Z | 2022-03-22T02:30:29.000Z | tensorflow_compression/python/ops/range_coding_ops_test.py | Faizullah877/compression | 82111a7ec61c3478f38c152ae7ec3fa61b21a530 | [
"Apache-2.0"
] | 253 | 2018-05-16T01:56:21.000Z | 2022-03-29T17:47:29.000Z | # Copyright 2018 Google LLC. 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... | 34.5 | 80 | 0.683794 |
89d047d0351595549e0b70179dfc2661672dfa97 | 2,601 | py | Python | tools/mo/unit_tests/mo/middle/PoolV2ToAttributedPool_test.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 1 | 2021-04-20T08:14:51.000Z | 2021-04-20T08:14:51.000Z | tools/mo/unit_tests/mo/middle/PoolV2ToAttributedPool_test.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 58 | 2020-11-06T12:13:45.000Z | 2022-03-28T13:20:11.000Z | tools/mo/unit_tests/mo/middle/PoolV2ToAttributedPool_test.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 2 | 2019-09-20T01:33:37.000Z | 2019-09-20T08:42:11.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
from openvino.tools.mo.middle.PoolV2ToAttributedPool import PoolV2ToAttributedPool
from openvino.tools.mo.utils.ir_engine.compare_graphs import compare_graphs
from openvino.tools.mo.utils.shape import int64_array
from un... | 47.290909 | 101 | 0.481353 |
19d75b6e899955d98c9a0e26b5dc928bd9f64fe1 | 302 | py | Python | python/anyascii/_data/_2ae.py | casept/anyascii | d4f426b91751254b68eaa84c6cd23099edd668e6 | [
"ISC"
] | null | null | null | python/anyascii/_data/_2ae.py | casept/anyascii | d4f426b91751254b68eaa84c6cd23099edd668e6 | [
"ISC"
] | null | null | null | python/anyascii/_data/_2ae.py | casept/anyascii | d4f426b91751254b68eaa84c6cd23099edd668e6 | [
"ISC"
] | null | null | null | b=' Xi Hui Yi Zhu Ta Dao Lung Qiao Cang Nu Nong Yin Cong Du Kun Gui' | 302 | 302 | 0.162252 |
16ecffef83fb9e280dc9284421d3dbe1787e6678 | 206 | py | Python | ch01/ans05.py | upura/nlp100v2020 | 37d4d208d5d527d163356793b630f36eb7595779 | [
"MIT"
] | 66 | 2020-04-07T13:27:45.000Z | 2022-01-10T10:43:08.000Z | ch01/ans05.py | upura/nlp100v2020 | 37d4d208d5d527d163356793b630f36eb7595779 | [
"MIT"
] | 2 | 2021-04-30T21:11:02.000Z | 2022-01-13T02:33:08.000Z | ch01/ans05.py | upura/nlp100v2020 | 37d4d208d5d527d163356793b630f36eb7595779 | [
"MIT"
] | 12 | 2020-04-10T16:26:10.000Z | 2022-02-06T06:17:22.000Z | def n_gram(target, n):
return [target[idx:idx + n] for idx in range(len(target) - n + 1)]
text = 'I am an NLPer'
for i in range(1, 4):
print(n_gram(text, i))
print(n_gram(text.split(' '), i))
| 22.888889 | 70 | 0.597087 |
35f6194d11fafbd1e0ff69c3a2c28ba4c3e02c27 | 6,956 | py | Python | pybind/nos/v7_1_0/hide_routemap_holder/route_map/content/match/extcommunity/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/hide_routemap_holder/route_map/content/match/extcommunity/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/hide_routemap_holder/route_map/content/match/extcommunity/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 55.648 | 655 | 0.708597 |
457c6e0af9de5ba9f8574123ebda7a66c29754f0 | 110,712 | py | Python | editing files/Portable Python 3.2.5.1/App/Lib/site-packages/matplotlib/mathtext.py | mattl1598/testing | cd8124773b83a07301c507ffbb9ccaafbfe7a274 | [
"Unlicense"
] | null | null | null | editing files/Portable Python 3.2.5.1/App/Lib/site-packages/matplotlib/mathtext.py | mattl1598/testing | cd8124773b83a07301c507ffbb9ccaafbfe7a274 | [
"Unlicense"
] | 1 | 2018-04-15T22:59:15.000Z | 2018-04-15T22:59:15.000Z | editing files/Portable Python 3.2.5.1/App/Lib/site-packages/matplotlib/mathtext.py | mattl1598/Project-Mochachino | cd8124773b83a07301c507ffbb9ccaafbfe7a274 | [
"Unlicense"
] | null | null | null | r"""
:mod:`~matplotlib.mathtext` is a module for parsing a subset of the
TeX math syntax and drawing them to a matplotlib backend.
For a tutorial of its usage see :ref:`mathtext-tutorial`. This
document is primarily concerned with implementation details.
The module uses pyparsing_ to parse the TeX expression.
.. _p... | 34.99115 | 109 | 0.537548 |
b0d5739964e08011065e7b24a56b5853c460bdf3 | 1,360 | py | Python | repono/filters/valid_extensions.py | davidstyers/repono | 454a9dc843e0b8318860f7134eb9e14ca8a21bdd | [
"MIT"
] | null | null | null | repono/filters/valid_extensions.py | davidstyers/repono | 454a9dc843e0b8318860f7134eb9e14ca8a21bdd | [
"MIT"
] | 7 | 2021-03-30T03:16:08.000Z | 2021-04-13T17:51:04.000Z | repono/filters/valid_extensions.py | davidstyers/repono | 454a9dc843e0b8318860f7134eb9e14ca8a21bdd | [
"MIT"
] | 1 | 2021-03-26T17:07:34.000Z | 2021-03-26T17:07:34.000Z | import os
from typing import List
from repono import FileItem, FilterBase
from repono.exceptions import FileExtensionNotAllowed
class ValidateExtension(FilterBase):
"""
Ensure that the file extension is valid.
Raises FileExtensionNotAllowed if check fails.
"""
async_ok = True
def __init__(s... | 28.333333 | 86 | 0.658824 |
e643c03b5df47d5f99d5f334ea8e6466fce8803d | 2,504 | py | Python | src/featurize.py | GSK-AI/meta-learning-qsar | e0fcad57a5616b4828d9b14d18cfb2dc4c8eba89 | [
"MIT"
] | 20 | 2020-07-25T07:30:05.000Z | 2022-03-12T14:28:02.000Z | src/featurize.py | TruongChien/meta-learning-qsar | e0fcad57a5616b4828d9b14d18cfb2dc4c8eba89 | [
"MIT"
] | null | null | null | src/featurize.py | TruongChien/meta-learning-qsar | e0fcad57a5616b4828d9b14d18cfb2dc4c8eba89 | [
"MIT"
] | 3 | 2021-08-04T02:34:40.000Z | 2022-03-04T00:44:20.000Z | """Featurize SMILES to chemical graphs
Usage:
python src/featurize.py --data <csv file> \\
--smiles_col <name of SMILES column> \\
--output_col <name of output columns> \\
--output_path <folder to store featurized data>
Note:
- Data is assumed to be CSV and path should not contain "." ... | 35.771429 | 117 | 0.714457 |
4084613ffebfcabfe9c0c82cbd702f22749d1179 | 7,367 | py | Python | model/paraphraser.py | graviraja/deep-paraphrase-generation | b09cfeee6b9410b60346d3851b3da440c2992cff | [
"MIT"
] | 5 | 2019-02-27T10:32:38.000Z | 2020-08-24T13:06:49.000Z | model/paraphraser.py | graviraja/deep-paraphrase-generation | b09cfeee6b9410b60346d3851b3da440c2992cff | [
"MIT"
] | null | null | null | model/paraphraser.py | graviraja/deep-paraphrase-generation | b09cfeee6b9410b60346d3851b3da440c2992cff | [
"MIT"
] | null | null | null | '''This code contains the main module of the paraphrase generator.
'''
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from .highway import Highway
from .encoder import Encoder
from .decoder import Decoder
class Paraphraser(nn.Mod... | 40.478022 | 142 | 0.637437 |
246edc13159654c2c9abeca329e888561bcf6748 | 1,223 | py | Python | examples/syllabus/plot_molecular_cloud.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | 1 | 2019-12-28T22:47:51.000Z | 2019-12-28T22:47:51.000Z | examples/syllabus/plot_molecular_cloud.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | null | null | null | examples/syllabus/plot_molecular_cloud.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | 2 | 2021-11-19T04:41:37.000Z | 2021-11-20T02:11:17.000Z | """
example of molecular cloud evolution with explictly
split SPH and grav evolution
Initial condition is a smooth spherical cloud with random velocities
as in Bonnell et al. (2003)
"""
import numpy
from matplotlib import pyplot
from amuse.lab import *
from amuse.ext.molecular_cloud import molecu... | 30.575 | 123 | 0.751431 |
22fdf496091c88262074e042933de123f471c822 | 1,953 | py | Python | rpython/jit/tl/targettlc.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2016-07-06T23:30:20.000Z | 2017-05-30T15:59:31.000Z | rpython/jit/tl/targettlc.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | null | null | null | rpython/jit/tl/targettlc.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2020-07-09T08:14:22.000Z | 2021-01-15T18:01:25.000Z | import time
import py
py.path.local(__file__)
from rpython.jit.tl.tlc import interp, interp_nonjit, ConstantPool
from rpython.jit.codewriter.policy import JitPolicy
from rpython.jit.backend.hlinfo import highleveljitinfo
def entry_point(args):
"""Main entry point of the stand-alone executable:
takes a list of... | 28.720588 | 73 | 0.666155 |
8b9f8a0e8178523fb796eb74e98bee4dd5929018 | 6,402 | py | Python | test/functional/mempool_persist.py | pavhash5/bitcoinroyale | 74711b2767e1a64cd4af172d40fada969e03505c | [
"MIT"
] | 5 | 2019-09-19T22:24:28.000Z | 2020-08-26T00:07:59.000Z | test/functional/mempool_persist.py | pavhash5/bitcoinroyale | 74711b2767e1a64cd4af172d40fada969e03505c | [
"MIT"
] | 6 | 2019-10-01T00:00:54.000Z | 2021-07-26T12:57:40.000Z | test/functional/mempool_persist.py | pavhash5/bitcoinroyale | 74711b2767e1a64cd4af172d40fada969e03505c | [
"MIT"
] | 3 | 2019-09-30T15:03:26.000Z | 2019-12-09T18:47:52.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 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 mempool persistence.
By default, broyaled will dump mempool on shutdown and
then reload it on sta... | 47.073529 | 207 | 0.698532 |
80c744038faf501a6fd999f10fef70a1e4ae214a | 782 | py | Python | tests/test_user.py | Amin1014/pitch | 38862a080a1ea183d9820b2499fab98776223799 | [
"MIT"
] | null | null | null | tests/test_user.py | Amin1014/pitch | 38862a080a1ea183d9820b2499fab98776223799 | [
"MIT"
] | null | null | null | tests/test_user.py | Amin1014/pitch | 38862a080a1ea183d9820b2499fab98776223799 | [
"MIT"
] | null | null | null | import unittest
from app.models import User
class UserModelTest(unittest.TestCase):
def setUp(self):
self.new_user = User(password = 'banana')
def test_password_setter(self):
'''
A function to assertain whether the password is being hashed.
'''
self.assertTrue(self.new_user.pass_secure is n... | 28.962963 | 105 | 0.722506 |
42998bd83dfdee6026279951177abb88fdfd0a66 | 305 | py | Python | 2015/10/table-hunger-index-20151008/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/10/table-hunger-index-20151008/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/10/table-hunger-index-20151008/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1oDBCgYU0Z8WQtu_xYBl-6Ng8SMviSNOI_Mb9HEGuqII'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.816393 |
618f9dc7542dd970f5c0173a3197e829c5b471e0 | 394 | py | Python | kyu_7/you_are_square/you_are_square.py | pedrocodacyorg2/codewars | ba3ea81125b6082d867f0ae34c6c9be15e153966 | [
"Unlicense"
] | 1 | 2022-02-12T05:56:04.000Z | 2022-02-12T05:56:04.000Z | kyu_7/you_are_square/you_are_square.py | pedrocodacyorg2/codewars | ba3ea81125b6082d867f0ae34c6c9be15e153966 | [
"Unlicense"
] | 182 | 2020-04-30T00:51:36.000Z | 2021-09-07T04:15:05.000Z | kyu_7/you_are_square/you_are_square.py | pedrocodacyorg2/codewars | ba3ea81125b6082d867f0ae34c6c9be15e153966 | [
"Unlicense"
] | 4 | 2020-04-29T22:04:20.000Z | 2021-07-13T20:04:14.000Z | import math
# Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
def is_square(n) -> bool:
"""
Given an integral number, determine if it's a square number:
:param n:
:return:
"""
if n > -1:
number = math.sqrt(n)
... | 20.736842 | 64 | 0.583756 |
dfdc2a478889a13ce97c01af4f7ad3399764b3dd | 537 | py | Python | setup.py | adamheins/starm | ff78178332140930bf46a94a0b15ee082bb92491 | [
"MIT"
] | 1 | 2020-09-18T16:07:31.000Z | 2020-09-18T16:07:31.000Z | setup.py | adamheins/starm | ff78178332140930bf46a94a0b15ee082bb92491 | [
"MIT"
] | null | null | null | setup.py | adamheins/starm | ff78178332140930bf46a94a0b15ee082bb92491 | [
"MIT"
] | null | null | null | from setuptools import setup
version = open('VERSION').read().strip()
setup(name='r12',
version=version,
description='Low-level interface for ST Robotics R12 robotic arm.',
url='https://github.com/adamheins/r12',
author='Adam Heins',
author_email='mail@adamheins.com',
license='MIT'... | 23.347826 | 73 | 0.592179 |
12ad9942ac221dc5b8ab550aa09e37842bcd58b1 | 8,445 | py | Python | retro-v1.py | wx-b/minimal_goexplore | 772c4a04234a4c0afab64998bd332fefcba8c5d1 | [
"MIT"
] | 6 | 2021-03-15T23:04:12.000Z | 2021-03-16T09:35:45.000Z | retro-v1.py | wx-b/minimal_goexplore | 772c4a04234a4c0afab64998bd332fefcba8c5d1 | [
"MIT"
] | 1 | 2021-09-23T11:00:47.000Z | 2021-09-23T11:00:47.000Z | retro-v1.py | wx-b/minimal_goexplore | 772c4a04234a4c0afab64998bd332fefcba8c5d1 | [
"MIT"
] | 3 | 2021-03-16T05:36:00.000Z | 2021-04-04T23:15:14.000Z | import retro
import cv2
import numpy as np
from hashlib import sha256
from collections import OrderedDict
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use("dark_background")
class Archive(OrderedDict):
def __init__(self):
self = OrderedDict()
def add(self, reference, score, terminal, inf... | 36.089744 | 193 | 0.696388 |
80a9f4fe2a09b7e03951f69db30ea469e91d4352 | 58 | py | Python | python/imports/as_module/p1/__init__.py | drichardson/examples | 89cd96741f6110729138f5c904317dd1a42f63ff | [
"Unlicense"
] | 33 | 2015-04-21T20:10:42.000Z | 2021-09-28T05:54:37.000Z | python/imports/as_module/p1/__init__.py | drichardson/examples | d8b285db4ad1cfd9a92091deab2eb385748f97c8 | [
"Unlicense"
] | 1 | 2020-03-15T18:54:19.000Z | 2020-03-15T18:54:19.000Z | python/imports/as_module/p1/__init__.py | drichardson/examples | 89cd96741f6110729138f5c904317dd1a42f63ff | [
"Unlicense"
] | 19 | 2015-01-09T13:39:06.000Z | 2021-09-15T05:39:33.000Z | print('as_module/p1/__init__.py __name__ is ' + __name__)
| 29 | 57 | 0.758621 |
f0048754b45829acae407571705fee30d9de63b5 | 4,573 | py | Python | platform/gsutil/gslib/commands/cat.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | platform/gsutil/gslib/commands/cat.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | platform/gsutil/gslib/commands/cat.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2011 Google Inc. All Rights Reserved.
# Copyright 2011, Nexenta 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/... | 33.137681 | 80 | 0.639405 |
91ce58592a3435ab4b25c99a021d8470dcb8c5ec | 18,328 | py | Python | apps/textureSyn/patchBasedTextureSynthesis.py | AntonBiryukovUofC/diffvg | e081098f52b82bfd0b7e91114d289d65ef969a60 | [
"Apache-2.0"
] | 488 | 2020-09-04T07:23:18.000Z | 2022-03-31T13:59:25.000Z | apps/textureSyn/patchBasedTextureSynthesis.py | AntonBiryukovUofC/diffvg | e081098f52b82bfd0b7e91114d289d65ef969a60 | [
"Apache-2.0"
] | 38 | 2020-09-04T19:27:24.000Z | 2022-03-24T01:13:45.000Z | apps/textureSyn/patchBasedTextureSynthesis.py | AntonBiryukovUofC/diffvg | e081098f52b82bfd0b7e91114d289d65ef969a60 | [
"Apache-2.0"
] | 75 | 2020-09-04T19:18:47.000Z | 2022-03-18T22:25:22.000Z | #imports
import numpy as np
import matplotlib.pyplot as plt
import os
from math import floor, ceil
from random import randint
from sklearn.neighbors import KDTree
from skimage.util.shape import view_as_windows
from skimage import io
from PIL import Image, ImageDraw
from IPython.display import clear_outp... | 47.115681 | 211 | 0.615561 |
b366c39d4522d98b9bcd5f1685ed787658402d57 | 32,760 | py | Python | ServidorPython/python32_web/Lib/site-packages/sklearn/gaussian_process/gpc.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 25 | 2019-03-08T01:03:03.000Z | 2022-02-14T17:38:32.000Z | ServidorPython/python32_web/Lib/site-packages/sklearn/gaussian_process/gpc.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 9 | 2020-09-25T22:32:02.000Z | 2022-02-09T23:45:10.000Z | ServidorPython/python32_web/Lib/site-packages/sklearn/gaussian_process/gpc.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 31 | 2019-01-15T20:16:50.000Z | 2022-03-01T05:47:38.000Z | """Gaussian processes classification."""
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve
from scipy.optimize import fmin_l_bfgs_b
from scipy.special import erf... | 43.162055 | 79 | 0.617827 |
a217ab635acf6a33301d34bad50bef5af273c209 | 1,276 | py | Python | pythonforandroid/recipes/pandas/__init__.py | syrykh/python-for-android | dea23e8c6d11cfad0554f3e846cbe245578781fd | [
"MIT"
] | 6,278 | 2015-01-02T16:34:05.000Z | 2022-03-31T10:24:45.000Z | pythonforandroid/recipes/pandas/__init__.py | syrykh/python-for-android | dea23e8c6d11cfad0554f3e846cbe245578781fd | [
"MIT"
] | 1,877 | 2015-01-01T16:16:10.000Z | 2022-03-27T17:34:34.000Z | pythonforandroid/recipes/pandas/__init__.py | syrykh/python-for-android | dea23e8c6d11cfad0554f3e846cbe245578781fd | [
"MIT"
] | 1,565 | 2015-01-02T19:35:37.000Z | 2022-03-31T15:37:06.000Z | from os.path import join
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe
class PandasRecipe(CppCompiledComponentsPythonRecipe):
version = '1.0.3'
url = 'https://github.com/pandas-dev/pandas/releases/download/v{version}/pandas-{version}.tar.gz' # noqa
depends = ['cython', 'numpy', ... | 35.444444 | 109 | 0.681034 |
f4cd80e32ad4b4315df1098654297570b0811eb1 | 4,032 | py | Python | forer.py | RSounder/DataVisualisation_Python_Dash | cf2816e574b4c2c363f60c476faaab3a05d4a5f7 | [
"MIT"
] | null | null | null | forer.py | RSounder/DataVisualisation_Python_Dash | cf2816e574b4c2c363f60c476faaab3a05d4a5f7 | [
"MIT"
] | null | null | null | forer.py | RSounder/DataVisualisation_Python_Dash | cf2816e574b4c2c363f60c476faaab3a05d4a5f7 | [
"MIT"
] | null | null | null | import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
import csv
##
text=""
#=====
with open('negative Keywords.csv', 'rU') as infile:
reader = csv.DictReader(infile)
data = {}
for row in reader:
for header, value in row.... | 19.2 | 116 | 0.53497 |
a708a27252594e3cefeb94b5b52a9a47438be917 | 6,084 | py | Python | testing/scripts/seldon_utils.py | animl-io/seldon-core | 1b9066cddf3e925f7d91b1e036bd55142e0e1491 | [
"Apache-2.0"
] | null | null | null | testing/scripts/seldon_utils.py | animl-io/seldon-core | 1b9066cddf3e925f7d91b1e036bd55142e0e1491 | [
"Apache-2.0"
] | null | null | null | testing/scripts/seldon_utils.py | animl-io/seldon-core | 1b9066cddf3e925f7d91b1e036bd55142e0e1491 | [
"Apache-2.0"
] | null | null | null | import requests
from requests.auth import HTTPBasicAuth
from seldon_core.proto import prediction_pb2
from seldon_core.proto import prediction_pb2_grpc
import grpc
import numpy as np
import random
from retrying import retry
def create_random_data(data_size,rows=1):
shape = [rows,data_size]
arr = np.random.rand(... | 43.148936 | 170 | 0.69428 |
c08cb0b41c2fd2cecde3dc0a9cb7218fb4db9b2a | 3,686 | py | Python | scholariumat/library/migrations/0001_initial.py | valuehack/scholariumat | 47c13f3429b95b9ad5ca59b45cf971895260bb5c | [
"MIT"
] | null | null | null | scholariumat/library/migrations/0001_initial.py | valuehack/scholariumat | 47c13f3429b95b9ad5ca59b45cf971895260bb5c | [
"MIT"
] | 232 | 2018-06-30T11:40:52.000Z | 2020-04-29T23:55:41.000Z | scholariumat/library/migrations/0001_initial.py | valuehack/scholariumat | 47c13f3429b95b9ad5ca59b45cf971895260bb5c | [
"MIT"
] | 3 | 2018-05-31T12:57:03.000Z | 2020-02-27T16:25:44.000Z | # Generated by Django 2.0.8 on 2018-09-24 11:51
from django.db import migrations, models
import django_extensions.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
... | 43.880952 | 140 | 0.560228 |
41157357ddbb718ad149d8203ffa3f02f65ecce6 | 19,790 | py | Python | src/sentry/web/frontend/base.py | Munyola/sentry | ab8923b2801d7d72d6903e0d9180584817bb1b9a | [
"BSD-3-Clause"
] | 1 | 2017-10-18T19:40:14.000Z | 2017-10-18T19:40:14.000Z | src/sentry/web/frontend/base.py | Munyola/sentry | ab8923b2801d7d72d6903e0d9180584817bb1b9a | [
"BSD-3-Clause"
] | null | null | null | src/sentry/web/frontend/base.py | Munyola/sentry | ab8923b2801d7d72d6903e0d9180584817bb1b9a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import logging
import six
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.middleware.csrf import CsrfViewMiddleware
from django.views.generic import View
from django.views.decor... | 36.047359 | 99 | 0.629358 |
d5af5032bb3a71c7b9c85dbb4cd32cdd5ff22038 | 18,648 | py | Python | mezzanine/core/tests.py | becomingGuru/mezzanine | 5736d67b503ef352f8838a8afaa65d768cfc01a7 | [
"BSD-2-Clause"
] | null | null | null | mezzanine/core/tests.py | becomingGuru/mezzanine | 5736d67b503ef352f8838a8afaa65d768cfc01a7 | [
"BSD-2-Clause"
] | null | null | null | mezzanine/core/tests.py | becomingGuru/mezzanine | 5736d67b503ef352f8838a8afaa65d768cfc01a7 | [
"BSD-2-Clause"
] | 1 | 2019-07-27T10:56:58.000Z | 2019-07-27T10:56:58.000Z |
import os
from shutil import rmtree
from uuid import uuid4
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.db import connection
from django.template import Context, Template, TemplateDoesNotExist
from djang... | 41.718121 | 79 | 0.637012 |
bcd5e94ee206beecd5fe7c9481720c68d47d98fa | 478 | py | Python | setup.py | VikasNeha/searcheval | 90f3be8e57dd70179f707ef73241306cdd2ec915 | [
"Apache-2.0"
] | null | null | null | setup.py | VikasNeha/searcheval | 90f3be8e57dd70179f707ef73241306cdd2ec915 | [
"Apache-2.0"
] | null | null | null | setup.py | VikasNeha/searcheval | 90f3be8e57dd70179f707ef73241306cdd2ec915 | [
"Apache-2.0"
] | null | null | null | from distutils.core import setup
setup(
name='searcheval',
version='0.2.1',
author='Tobias Guenther',
author_email='searcheval@tobigue.de',
packages=['searcheval', 'searcheval.test'],
scripts=[],
url='https://github.com/tobigue/searcheval',
license='LICENSE.txt',
description='Librar... | 29.875 | 105 | 0.692469 |
602442bf233fb98b108989adf043f92ea5479524 | 1,038 | py | Python | tellodrone_basic/image_control.py | zhz03/Tellodrone_project | 8f5309d41e79ed1edfc27f35162c03b0054135cc | [
"MIT"
] | null | null | null | tellodrone_basic/image_control.py | zhz03/Tellodrone_project | 8f5309d41e79ed1edfc27f35162c03b0054135cc | [
"MIT"
] | null | null | null | tellodrone_basic/image_control.py | zhz03/Tellodrone_project | 8f5309d41e79ed1edfc27f35162c03b0054135cc | [
"MIT"
] | null | null | null | import KeyPresscontrol as kp
from djitellopy import tello
from time import sleep
import cv2
def get_keyboard_input():
lr,fb,ud,yv = 0,0,0,0
speed = 50
if kp.get_key("LEFT"): lr = -speed
elif kp.get_key("RIGHT"): lr = speed
if kp.get_key("UP"):
fb = speed
elif kp.get_key("DOWN"):
... | 22.565217 | 72 | 0.583815 |
64d623b10f80bc606b7ec2331711c8defe35888f | 1,933 | py | Python | raidex/utils/mockrestapi.py | luehrsFred/raidex | ade805bf3aa60b8ff37f73ea4caa365de513085f | [
"MIT"
] | 6 | 2019-06-28T12:34:08.000Z | 2021-06-22T05:01:56.000Z | raidex/utils/mockrestapi.py | luehrsFred/raidex | ade805bf3aa60b8ff37f73ea4caa365de513085f | [
"MIT"
] | 3 | 2019-07-01T08:37:12.000Z | 2020-04-30T07:49:53.000Z | raidex/utils/mockrestapi.py | luehrsFred/raidex | ade805bf3aa60b8ff37f73ea4caa365de513085f | [
"MIT"
] | 3 | 2019-07-01T08:34:26.000Z | 2020-05-06T10:17:38.000Z | #!flask/bin/python
import random
from flask import Flask, jsonify, request, abort
from flask_cors import CORS
from mock import gen_orderbook_dict, gen_orderhistory
app = Flask(__name__)
CORS(app)
# global to store the Orders from the WebUI
LIMIT_ORDERS = {}
@app.route('/api/<string:version>/markets/<string:market>... | 28.850746 | 101 | 0.693223 |
1ceba872d38d316dce1f56bbeac09365f77067e3 | 2,276 | py | Python | keyboard_agent.py | Sambor123/DRL_Navigation | 3694c1e99d26e448777f12eb5afd7bf22bd2e15b | [
"MIT"
] | 21 | 2019-03-28T00:59:22.000Z | 2021-10-11T11:04:00.000Z | keyboard_agent.py | Sambor123/DRL_Navigation | 3694c1e99d26e448777f12eb5afd7bf22bd2e15b | [
"MIT"
] | null | null | null | keyboard_agent.py | Sambor123/DRL_Navigation | 3694c1e99d26e448777f12eb5afd7bf22bd2e15b | [
"MIT"
] | 14 | 2019-04-02T02:32:26.000Z | 2021-09-10T11:01:45.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import signal
import argparse
import numpy as np
from scene_loader import THORDiscreteEnvironment
from utils.tools import SimpleImageViewer
#
# Navigate the scene using your keyboard
#
def key_press(key, mod):
global h... | 24.473118 | 85 | 0.695079 |
1a78325a4335d66500bcd1275c35a95b3b026833 | 1,777 | py | Python | mpf/_version.py | garimahc15/mpf | 62acdd4110fa6bc7ac2d97ad4216fdc60076d001 | [
"MIT"
] | null | null | null | mpf/_version.py | garimahc15/mpf | 62acdd4110fa6bc7ac2d97ad4216fdc60076d001 | [
"MIT"
] | null | null | null | mpf/_version.py | garimahc15/mpf | 62acdd4110fa6bc7ac2d97ad4216fdc60076d001 | [
"MIT"
] | null | null | null | """Holds various Version strings of MPF.
This modules holds the MPF version strings, including the version of BCP it
needs and the config file version it needs.
It's used internally for all sorts of things, from printing the output of the
`mpf --version` command, to making sure any processes connected via BCP are
the... | 32.907407 | 94 | 0.67417 |
fa88b103816e0befafac028181bdf472b7a0f25b | 317 | py | Python | src/restfx/util/sha1.py | hyjiacan/restfx | 8ba70bc099e6ace0c9b3afe8909ea61a5ff82dec | [
"MIT",
"BSD-3-Clause"
] | 5 | 2021-01-25T11:09:41.000Z | 2021-04-28T07:17:21.000Z | src/restfx/util/sha1.py | mgbin088/restfx | 86a499a9a4396829e2c40428feb8b2ee13406d52 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | src/restfx/util/sha1.py | mgbin088/restfx | 86a499a9a4396829e2c40428feb8b2ee13406d52 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-01-28T00:53:37.000Z | 2021-01-28T00:53:37.000Z | import hashlib
def hash_bytes(s: (str, bytes)) -> bytes:
if isinstance(s, str):
s = s.encode(encoding='utf8')
return hashlib.sha1(s).digest()
def hash_str(s: (str, bytes)) -> str:
if isinstance(s, str):
s = s.encode(encoding='utf8')
return hashlib.sha1(s).hexdigest()
| 22.642857 | 42 | 0.586751 |
c6638c9a521776f0ecf10ed836e9e657376aa3d9 | 14,704 | py | Python | src/gluonts/gp/gaussian_process.py | guilherme-guilherme/gluon-ts | a54074612f7c8e8c7626f4edf4e88a1134fc90dc | [
"Apache-2.0"
] | null | null | null | src/gluonts/gp/gaussian_process.py | guilherme-guilherme/gluon-ts | a54074612f7c8e8c7626f4edf4e88a1134fc90dc | [
"Apache-2.0"
] | 1 | 2021-08-29T08:20:37.000Z | 2021-09-02T09:00:52.000Z | src/gluonts/gp/gaussian_process.py | guilherme-guilherme/gluon-ts | a54074612f7c8e8c7626f4edf4e88a1134fc90dc | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 37.225316 | 117 | 0.57447 |
b7dbedb3bab788eb33648d9fa503c8efede952aa | 12,695 | py | Python | examples/python/train_sptm/src/explore/beeline_navigator.py | ravi-teja-mullapudi/ViZDoom | 7aa037fc9b25aac200f4b1496f91c8d10b30703c | [
"MIT"
] | null | null | null | examples/python/train_sptm/src/explore/beeline_navigator.py | ravi-teja-mullapudi/ViZDoom | 7aa037fc9b25aac200f4b1496f91c8d10b30703c | [
"MIT"
] | null | null | null | examples/python/train_sptm/src/explore/beeline_navigator.py | ravi-teja-mullapudi/ViZDoom | 7aa037fc9b25aac200f4b1496f91c8d10b30703c | [
"MIT"
] | 1 | 2021-02-08T06:28:07.000Z | 2021-02-08T06:28:07.000Z | #!/usr/bin/env python3
from __future__ import print_function
import random
import vizdoom as vzd
import cv2
import numpy as np
import os
import math
DEFAULT_CONFIG = "./explorer.cfg"
def spin_agent(actions_num):
actions = [0.0] * actions_num
actions[8] = 1.0
return actions
def spin_beeline_agent(acti... | 35.963173 | 144 | 0.621189 |
972d37bcf19b7eff5f2a723eec2eb43524798a38 | 4,149 | py | Python | src/pymortests/block.py | mahgadalla/pymor | ee2806b4c93748e716294c42454d611415da7b5e | [
"Unlicense"
] | 1 | 2021-07-26T12:58:50.000Z | 2021-07-26T12:58:50.000Z | src/pymortests/block.py | mahgadalla/pymor | ee2806b4c93748e716294c42454d611415da7b5e | [
"Unlicense"
] | null | null | null | src/pymortests/block.py | mahgadalla/pymor | ee2806b4c93748e716294c42454d611415da7b5e | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2017 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import numpy as np
import scipy.linalg as spla
from pymor.operators.numpy import NumpyMatrixOpera... | 29.425532 | 77 | 0.651723 |
4dd0b0f092ed41380cb34e3965c5e8fdaeca098b | 53,083 | py | Python | src/sage/combinat/words/abstract_word.py | vbraun/sage | 07d6c37d18811e2b377a9689790a7c5e24da16ba | [
"BSL-1.0"
] | 3 | 2016-06-19T14:48:31.000Z | 2022-01-28T08:46:01.000Z | src/sage/combinat/words/abstract_word.py | vbraun/sage | 07d6c37d18811e2b377a9689790a7c5e24da16ba | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/words/abstract_word.py | vbraun/sage | 07d6c37d18811e2b377a9689790a7c5e24da16ba | [
"BSL-1.0"
] | 7 | 2021-11-08T10:01:59.000Z | 2022-03-03T11:25:52.000Z | r"""
Abstract word (finite or infinite)
This module gathers functions that works for both finite and infinite
words.
AUTHORS:
- Sebastien Labbe
- Franco Saliola
EXAMPLES::
sage: a = 0.618
sage: g = words.CodingOfRotationWord(alpha=a, beta=1-a, x=a)
sage: f = words.FibonacciWord()
sage: p = f.longes... | 30.542578 | 133 | 0.521165 |
29c0786903902d6a60e6d9c5ded1ff4e95d92a9f | 4,402 | py | Python | dialog/wed-stochastic/model_config.py | yq-wen/probabilistic_nlg | 545a0a82eaba005be77d50ad25c6cb7267e16676 | [
"MIT"
] | 28 | 2019-03-03T05:12:51.000Z | 2022-01-15T14:05:39.000Z | dialog/wed-stochastic/model_config.py | yq-wen/probabilistic_nlg | 545a0a82eaba005be77d50ad25c6cb7267e16676 | [
"MIT"
] | 6 | 2019-07-04T11:39:32.000Z | 2022-02-09T23:29:03.000Z | dialog/wed-stochastic/model_config.py | sndean/probabilistic_nlg | fab94d63a742951d9e198f3b2a90db87ffa23b8a | [
"MIT"
] | 8 | 2019-04-02T15:36:41.000Z | 2021-05-17T16:02:56.000Z | import argparse
import gl
import os
def model_argparse():
parser = argparse.ArgumentParser()
# parser.add_argument("--isDebug", type=bool, default=gl.isDebug, help='is debug')
parser.add_argument("--device", type=str, default="0", help='tf device') # GPU 0 or 1
parser.add_argument("--lstm_hidden_unit... | 49.460674 | 134 | 0.678101 |
704d8069c02bb4241c5c3e67ab441b175a1d5fa5 | 1,032 | py | Python | src/main.py | ParadoxPD/JustABot | bdef52473980f4c3ecef2e8316016589dc89c895 | [
"MIT"
] | null | null | null | src/main.py | ParadoxPD/JustABot | bdef52473980f4c3ecef2e8316016589dc89c895 | [
"MIT"
] | null | null | null | src/main.py | ParadoxPD/JustABot | bdef52473980f4c3ecef2e8316016589dc89c895 | [
"MIT"
] | null | null | null | import json
import requests
import os
import discord
from dotenv import load_dotenv
load_dotenv()
prefix = "$"
client = discord.Client()
def get_quote():
response = requests.get("https://zenquotes.io/api/random")
json_data = json.loads(response.text)
quote = json_data[0]['q'] + " -" + json_data[0]['a']
... | 20.235294 | 78 | 0.684109 |
c55e95310c101423b2f7f660adb2dc006586340f | 418 | py | Python | version.py | abhigyank/zulip | 9cd7f59c9b144f7ee47aad845c0623abe1fb81cc | [
"Apache-2.0"
] | null | null | null | version.py | abhigyank/zulip | 9cd7f59c9b144f7ee47aad845c0623abe1fb81cc | [
"Apache-2.0"
] | null | null | null | version.py | abhigyank/zulip | 9cd7f59c9b144f7ee47aad845c0623abe1fb81cc | [
"Apache-2.0"
] | null | null | null | ZULIP_VERSION = "1.7.1+git"
# Bump the minor PROVISION_VERSION to indicate that folks should provision
# only when going from an old version of the code to a newer version. Bump
# the major version to indicate that folks should provision in both
# directions.
# Typically, adding a dependency only requires a minor ver... | 34.833333 | 74 | 0.779904 |
837f5fe5d83e93e1eeb980a4c9b8d5775ba95a7b | 4,601 | py | Python | ui/main.py | nbrooks211/OpenPeripherals | f4924cbcbf25f8e5b6ac6284e8000868618119c9 | [
"MIT"
] | 1 | 2020-08-29T05:10:36.000Z | 2020-08-29T05:10:36.000Z | ui/main.py | nbrooks211/OpenPeripherals | f4924cbcbf25f8e5b6ac6284e8000868618119c9 | [
"MIT"
] | 2 | 2020-01-22T05:55:41.000Z | 2020-01-25T02:25:01.000Z | ui/main.py | nbrooks211/OpenPeripherals | f4924cbcbf25f8e5b6ac6284e8000868618119c9 | [
"MIT"
] | 1 | 2020-04-30T17:49:44.000Z | 2020-04-30T17:49:44.000Z | #!/usr/bin/env python3
import sys
from functools import partial
from xml.etree import ElementTree
from PyQt5.QtCore import QRect, QObject, pyqtSlot
from PyQt5.QtWidgets import QApplication, QPushButton, QColorDialog
from PyQt5.QtDBus import QDBusConnection, QDBusInterface
from PyQt5.QtGui import QPalette, QColor
from... | 33.100719 | 118 | 0.636383 |
67f0fd224422f4abbc1a8d2d440b1a897305c95c | 2,050 | py | Python | src/pretix/base/migrations/0053_auto_20170104_1252.py | pajowu/pretix | d6985123b4528f134ead71ce0a4613c9a309fd2c | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-08-31T13:16:55.000Z | 2021-08-31T13:16:55.000Z | src/pretix/base/migrations/0053_auto_20170104_1252.py | pajowu/pretix | d6985123b4528f134ead71ce0a4613c9a309fd2c | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2019-07-08T10:29:54.000Z | 2020-01-08T17:32:07.000Z | src/pretix/base/migrations/0053_auto_20170104_1252.py | pajowu/pretix | d6985123b4528f134ead71ce0a4613c9a309fd2c | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-08-09T17:11:28.000Z | 2017-08-09T17:11:28.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-04 12:52
from __future__ import unicode_literals
import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import pretix.base.validators
class Migration(migrations.Migration... | 41.836735 | 465 | 0.636098 |
b1e58eaa413e4d005efabed533e2af71e2084ea6 | 5,970 | py | Python | .history/my_classes/ScopesClosuresAndDecorators/GlobalLocalScopes_20210710152919.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/GlobalLocalScopes_20210710152919.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/GlobalLocalScopes_20210710152919.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Global and local Scopes
Scopes and Namespaces
When an object is assigned to a variable # a = 10
that variable points to some object
and we say that the variable (name) is bound to that object
That object can be accessed using that name in various parts of our code... | 29.121951 | 184 | 0.622111 |
bab94cb380c4b26ed90f285a8eda820058f7cfe5 | 9,000 | py | Python | tests/test_modeling_tf_distilbert.py | timpal0l/transformers | d86d57faa3b6511c6e4d9139535d77b695b9af8a | [
"Apache-2.0"
] | 2 | 2020-11-30T11:30:40.000Z | 2021-03-26T17:20:33.000Z | tests/test_modeling_tf_distilbert.py | timpal0l/transformers | d86d57faa3b6511c6e4d9139535d77b695b9af8a | [
"Apache-2.0"
] | 3 | 2021-06-08T23:15:29.000Z | 2022-01-13T03:40:10.000Z | tests/test_modeling_tf_distilbert.py | timpal0l/transformers | d86d57faa3b6511c6e4d9139535d77b695b9af8a | [
"Apache-2.0"
] | 1 | 2020-11-17T02:48:00.000Z | 2020-11-17T02:48:00.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | 40.358744 | 117 | 0.717 |
fed7f463bed7aa13fad9fda63c1ed3b8199447ab | 776 | py | Python | var/spack/repos/builtin/packages/ghostscript-fonts/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/ghostscript-fonts/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/ghostscript-fonts/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # 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 glob
from spack.package import *
class GhostscriptFonts(Package):
"""Ghostscript Fonts"""
homepage = "h... | 29.846154 | 94 | 0.68299 |
488539152abe9d36d3794c89a0ba406296c238a3 | 324,922 | py | Python | nova/tests/unit/compute/test_compute_api.py | congnt1705/nova | 941dc87369411c52ed8f0d57808e33b939ac081d | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/compute/test_compute_api.py | congnt1705/nova | 941dc87369411c52ed8f0d57808e33b939ac081d | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/compute/test_compute_api.py | congnt1705/nova | 941dc87369411c52ed8f0d57808e33b939ac081d | [
"Apache-2.0"
] | 1 | 2021-01-11T04:07:52.000Z | 2021-01-11T04:07:52.000Z | #
# 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, software
# ... | 48.743174 | 79 | 0.60469 |
6dfc3c56f1f4b2f8dfec584eb5e8f254e9c785dc | 5,475 | py | Python | spiketoolkit/preprocessing/filterrecording.py | luiztauffer/spiketoolkit | 209b8de26f8febbc1fa4fb1efa0ed7d6daa4d122 | [
"MIT"
] | null | null | null | spiketoolkit/preprocessing/filterrecording.py | luiztauffer/spiketoolkit | 209b8de26f8febbc1fa4fb1efa0ed7d6daa4d122 | [
"MIT"
] | null | null | null | spiketoolkit/preprocessing/filterrecording.py | luiztauffer/spiketoolkit | 209b8de26f8febbc1fa4fb1efa0ed7d6daa4d122 | [
"MIT"
] | null | null | null | from abc import abstractmethod
import numpy as np
from .transform import TransformRecording
from .basepreprocessorrecording import BasePreprocessorRecordingExtractor
from spikeextractors.extraction_tools import check_get_traces_args
class FilterRecording(BasePreprocessorRecordingExtractor):
def __init__(self, rec... | 39.673913 | 117 | 0.594521 |
a2a7ecf56031a4058ebdff7217dc1134563a13ca | 1,321 | py | Python | instagram_api/response/model/direct_thread.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | 13 | 2019-08-07T21:24:34.000Z | 2020-12-12T12:23:50.000Z | instagram_api/response/model/direct_thread.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | instagram_api/response/model/direct_thread.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | from ..mapper import PropertyMapper, ApiInterfaceBase
from ..mapper.types import Timestamp, AnyType
from .action_badge import ActionBadge
from .direct_thread_item import DirectThreadItem
from .permanent_item import PermanentItem
# from .unpredictable import DirectThreadLastSeenAtUnpredictableContainer
from .user impor... | 25.901961 | 73 | 0.759273 |
8ade2894c0919e11599d7e2ed1f0ac7f95fdf5d2 | 1,064 | py | Python | flaskapp/public/forms.py | skipallmighty/flask-app | f3d6521767a18c91090c6fc3c97ed3a445f7287f | [
"BSD-3-Clause"
] | 1 | 2015-08-25T23:10:53.000Z | 2015-08-25T23:10:53.000Z | flaskapp/public/forms.py | skipallmighty/flask-app | f3d6521767a18c91090c6fc3c97ed3a445f7287f | [
"BSD-3-Clause"
] | null | null | null | flaskapp/public/forms.py | skipallmighty/flask-app | f3d6521767a18c91090c6fc3c97ed3a445f7287f | [
"BSD-3-Clause"
] | null | null | null | from flask_wtf import Form
from wtforms import TextField, PasswordField
from wtforms.validators import DataRequired
from flaskapp.user.models import User
class LoginForm(Form):
username = TextField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
... | 33.25 | 77 | 0.663534 |
2040f078937f52717697f3192ca9eaa2253644e6 | 5,580 | py | Python | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/update_node_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/update_node_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-cce/huaweicloudsdkcce/v3/model/update_node_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class UpdateNodeRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value ... | 29.680851 | 201 | 0.598387 |
b4899b7ce49c6415c285dcafa0abd2b76bf88676 | 3,477 | py | Python | utils.py | IAWG-CSBC-PSON/hack2022-05-cross-talk | cc9dc19aa84b2fc38660a20bede6c1911a78cad1 | [
"MIT"
] | null | null | null | utils.py | IAWG-CSBC-PSON/hack2022-05-cross-talk | cc9dc19aa84b2fc38660a20bede6c1911a78cad1 | [
"MIT"
] | 1 | 2022-02-16T15:57:50.000Z | 2022-02-16T15:57:50.000Z | utils.py | IAWG-CSBC-PSON/hack2022-05-cross-talk | cc9dc19aa84b2fc38660a20bede6c1911a78cad1 | [
"MIT"
] | null | null | null |
"""
Author:
Huan Wang (whuan@broadinstitute.org)
Functions:
imshow()
intensity_change_at_cell_level()
plot_co_expression()
side_by_side()
run_mesmer()
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import glob
import pandas as pd
import seaborn as sns
i... | 31.044643 | 147 | 0.63503 |
0732c7e0e42d5f5cfc3fc8699d39266bea49e6fe | 1,790 | py | Python | _logging.py | borshpro/GDL-sublime | dd7a8362e86f3ac5a659f2afc0f795e11eaa27f0 | [
"MIT"
] | 34 | 2016-03-29T11:52:21.000Z | 2022-01-08T22:09:19.000Z | _logging.py | borshpro/GDL-sublime | dd7a8362e86f3ac5a659f2afc0f795e11eaa27f0 | [
"MIT"
] | 11 | 2015-03-10T12:29:50.000Z | 2021-03-22T22:57:11.000Z | _logging.py | borshpro/GDL-sublime | dd7a8362e86f3ac5a659f2afc0f795e11eaa27f0 | [
"MIT"
] | 6 | 2015-07-25T20:29:04.000Z | 2020-12-01T01:52:27.000Z | # logger based on <https://github.com/SublimeText/PackageDev/blob/master/_logging.py>
# Python docs <https://docs.python.org/3/library/logging.html>
import logging
import sublime
# usage in other files in package:
# log = logging.getLogger(__name__)
DEFAULT_LOG_LEVEL = logging.WARNING
DEFAULT_LOG_LEVEL_NAME = loggin... | 35.098039 | 85 | 0.788827 |
b3f342d4e325bb9049d88df3bab1b10c7e001482 | 402 | py | Python | homeassistant/components/hardware/__init__.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/hardware/__init__.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/hardware/__init__.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """The Hardware integration."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType
from . import websocket_api
from .const import DOMAIN
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up Hardware."""... | 22.333333 | 71 | 0.756219 |
b4ce6e2558206b6e79010cd55deaf3f169e3f95d | 2,859 | py | Python | light_progress/commandline.py | itkr/progress_bar | df6a9ec343580766f19f7e722703acaffaaa2ec4 | [
"MIT"
] | 4 | 2019-08-08T05:23:30.000Z | 2022-01-20T18:57:58.000Z | light_progress/commandline.py | itkr/progress_bar | df6a9ec343580766f19f7e722703acaffaaa2ec4 | [
"MIT"
] | null | null | null | light_progress/commandline.py | itkr/progress_bar | df6a9ec343580766f19f7e722703acaffaaa2ec4 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import sys
import threading
from time import sleep
from . import widget
from .core import Progress
class ProgressBar(Progress):
default_widgets = [widget.Bar(), widget.Percentage(), widget.Num(),
... | 30.741935 | 76 | 0.633088 |
a4e55ec0ac3a9c9ed569ae112778efc6c1d114bc | 18 | py | Python | jmap/__init__.py | briancline/jmap | 475198b5598c0fa4ae9c44d9dfcac88e36fe8ef1 | [
"MIT"
] | 276 | 2015-05-15T18:02:18.000Z | 2022-01-03T16:28:25.000Z | jmap/__init__.py | briancline/jmap | 475198b5598c0fa4ae9c44d9dfcac88e36fe8ef1 | [
"MIT"
] | 412 | 2016-10-12T22:32:46.000Z | 2022-03-31T22:52:29.000Z | jmap/__init__.py | briancline/jmap | 475198b5598c0fa4ae9c44d9dfcac88e36fe8ef1 | [
"MIT"
] | 111 | 2017-10-18T07:47:07.000Z | 2022-03-30T10:18:49.000Z | VERSION = '0.0.1'
| 9 | 17 | 0.555556 |
a7a904dc1837a26c3a8e0a1f5b7fce233605b282 | 6,989 | py | Python | dojo/db_migrations/0079_auto_20210309_2017.py | joebasirico/django-DefectDojo | da4ab0033329cee4108630e2b7e54a2d073932b6 | [
"BSD-3-Clause"
] | null | null | null | dojo/db_migrations/0079_auto_20210309_2017.py | joebasirico/django-DefectDojo | da4ab0033329cee4108630e2b7e54a2d073932b6 | [
"BSD-3-Clause"
] | null | null | null | dojo/db_migrations/0079_auto_20210309_2017.py | joebasirico/django-DefectDojo | da4ab0033329cee4108630e2b7e54a2d073932b6 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2.17 on 2021-03-09 20:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dojo', '0078_cvssv3_rename_verbose_name'),
]
operations = [
migrations.AddField(
model_name='finding',
name='custom... | 205.558824 | 2,033 | 0.685792 |
33c0d094937818d73871723e5ecb883162cc694f | 4,126 | py | Python | Media/standalone/Scripts/Region.py | dmacka/MultiverseClientServer | b64d7d754a0b2b1a3e5acabd4d6ebb80ab1d9379 | [
"MIT"
] | 5 | 2020-04-29T19:14:57.000Z | 2022-02-18T08:48:37.000Z | Media/standalone/Scripts/Region.py | dmacka/MultiverseClientServer | b64d7d754a0b2b1a3e5acabd4d6ebb80ab1d9379 | [
"MIT"
] | null | null | null | Media/standalone/Scripts/Region.py | dmacka/MultiverseClientServer | b64d7d754a0b2b1a3e5acabd4d6ebb80ab1d9379 | [
"MIT"
] | 2 | 2021-03-09T06:53:30.000Z | 2021-03-27T12:02:39.000Z | import ClientAPI
class RegionPoint:
def __init__(self, x, z):
self.x = x
self.z = z
def __repr__(self):
return 'RegionPoint(%f,%f)' % (self.x, self.z)
# determine if the two line segments defined by (p1, p2) and (p3,p4) intersect
def _intersectSegments(p1, p2, p3, p4):
den... | 32.746032 | 109 | 0.533446 |
e533c978f73403efd43541d19bae4965158c7261 | 10,161 | py | Python | fast_rcnn/config.py | ddbrother/faster_rcnn_tf_py3 | 4e163d58fca2fc235e29df7d148c461aa018616b | [
"MIT"
] | 3 | 2020-04-26T07:48:16.000Z | 2021-02-09T16:21:16.000Z | fast_rcnn/config.py | ddbrother/faster_rcnn_tf_py3 | 4e163d58fca2fc235e29df7d148c461aa018616b | [
"MIT"
] | null | null | null | fast_rcnn/config.py | ddbrother/faster_rcnn_tf_py3 | 4e163d58fca2fc235e29df7d148c461aa018616b | [
"MIT"
] | 1 | 2019-05-30T10:49:26.000Z | 2019-05-30T10:49:26.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Fast R-CNN config system.
This file specifies default config option... | 31.654206 | 91 | 0.694617 |
b577a57e04581c56f302285e2e21237f48f59391 | 4,829 | py | Python | predict.py | nelsonvega/ai-python-image-classifier | ae1745e7028c5da8a19ba75a6de0a31c3a27c6a5 | [
"MIT"
] | null | null | null | predict.py | nelsonvega/ai-python-image-classifier | ae1745e7028c5da8a19ba75a6de0a31c3a27c6a5 | [
"MIT"
] | null | null | null | predict.py | nelsonvega/ai-python-image-classifier | ae1745e7028c5da8a19ba75a6de0a31c3a27c6a5 | [
"MIT"
] | null | null | null |
import json
import time
import copy
import checkpoint as loader
import argparse
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
from torch.autograd import Variable
from torch import nn,optim
import torch
import torchvision
import torch.nn.functional as F
from torch import nn
from PIL impor... | 25.151042 | 109 | 0.66432 |
93354f868afa401c2402d83b5bc14f6174696424 | 35 | py | Python | lib/python/treadmill/tests/appcfg/__init__.py | vrautela/treadmill | 05e47fa8acdf8bad7af78e737efb26ea6488de82 | [
"Apache-2.0"
] | 133 | 2016-09-15T13:36:12.000Z | 2021-01-18T06:29:13.000Z | tests/appcfg/__init__.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | 108 | 2016-12-28T23:41:27.000Z | 2020-03-05T21:20:37.000Z | tests/appcfg/__init__.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | 69 | 2016-09-23T20:38:58.000Z | 2020-11-11T02:31:21.000Z | """Tests for treadmill.appcfg.*"""
| 17.5 | 34 | 0.657143 |
43bbd604ece16b04c4d10ce588858475d62a3666 | 59 | py | Python | net_test/ping.py | MikeOfNoTrades/mypynet | 0c11b2a6c3a1f6e3791ae1349f3063ddd89aa8b1 | [
"Apache-2.0"
] | null | null | null | net_test/ping.py | MikeOfNoTrades/mypynet | 0c11b2a6c3a1f6e3791ae1349f3063ddd89aa8b1 | [
"Apache-2.0"
] | null | null | null | net_test/ping.py | MikeOfNoTrades/mypynet | 0c11b2a6c3a1f6e3791ae1349f3063ddd89aa8b1 | [
"Apache-2.0"
] | null | null | null | #! /home/mmartin/applied_python/bin/python
print "ping!"
| 14.75 | 43 | 0.728814 |
fd9bbfb607c72d6869945a475d748201588d02df | 613 | py | Python | python/receive_logs.py | Diffblue-benchmarks/Rabbitmq-rabbitmq-tutorials | b887f2313a8698bd7b2eb212ea7987eb7d99b6fb | [
"Apache-2.0"
] | 2 | 2020-05-07T01:26:15.000Z | 2020-05-18T01:36:21.000Z | python/receive_logs.py | jeff9571/rabbitmq-tutorials | 180705662b16063d1983a4a82ebca3c2ec83d8d3 | [
"Apache-2.0"
] | 2 | 2021-10-06T07:20:34.000Z | 2022-02-26T20:08:47.000Z | python/receive_logs.py | jeff9571/rabbitmq-tutorials | 180705662b16063d1983a4a82ebca3c2ec83d8d3 | [
"Apache-2.0"
] | 1 | 2020-06-02T03:49:09.000Z | 2020-06-02T03:49:09.000Z | #!/usr/bin/env python
import pika
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='logs', exchange_type='fanout')
result = channel.queue_declare(queue='', exclusive=True)
queue_name = result.method.queue
channel.... | 23.576923 | 66 | 0.75367 |
0bfd7f48e9ab2ff2f409b733134c74c45892bfb2 | 1,535 | py | Python | clients/python-legacy/generated/test/test_github_scmlinks.py | cliffano/jenkins-api-clients-generator | 522d02b3a130a29471df5ec1d3d22c822b3d0813 | [
"MIT"
] | null | null | null | clients/python-legacy/generated/test/test_github_scmlinks.py | cliffano/jenkins-api-clients-generator | 522d02b3a130a29471df5ec1d3d22c822b3d0813 | [
"MIT"
] | null | null | null | clients/python-legacy/generated/test/test_github_scmlinks.py | cliffano/jenkins-api-clients-generator | 522d02b3a130a29471df5ec1d3d22c822b3d0813 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unitte... | 27.410714 | 86 | 0.646906 |
8e410fff4aaba9aa4504d63534a393f6349e1a93 | 5,477 | py | Python | misp/1.0.0/src/app.py | bhagyeshkumar/shuffle-apps | 1abf1e23ccb2ee1094ac0f2e50f31f76f56c7ece | [
"MIT"
] | 41 | 2020-05-21T17:00:46.000Z | 2021-09-23T21:24:12.000Z | misp/1.0.0/src/app.py | bhagyeshkumar/shuffle-apps | 1abf1e23ccb2ee1094ac0f2e50f31f76f56c7ece | [
"MIT"
] | 179 | 2020-05-22T08:11:39.000Z | 2021-09-22T15:48:27.000Z | misp/1.0.0/src/app.py | bhagyeshkumar/shuffle-apps | 1abf1e23ccb2ee1094ac0f2e50f31f76f56c7ece | [
"MIT"
] | 57 | 2020-07-07T10:38:16.000Z | 2021-09-21T20:43:04.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import asyncio
import urllib3
import requests
import base64
import tempfile
from walkoff_app_sdk.app_base import AppBase
class Misp(AppBase):
"""
An example of a Walkoff App.
Inherit from the AppBase class to have Redis, logging, and console logging... | 34.446541 | 104 | 0.567464 |
b4eea963a5df3a232af1f54e489493d1da8a524a | 1,715 | py | Python | adminmgr/media/code/A3/task3/BD_146_282_651_1403_WcXmdPO.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 9 | 2019-11-08T02:05:27.000Z | 2021-12-13T12:06:35.000Z | adminmgr/media/code/A3/task3/BD_146_282_651_1403_hOvcLQZ.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 6 | 2019-11-27T03:23:16.000Z | 2021-06-10T19:15:13.000Z | adminmgr/media/code/A3/task3/BD_146_282_651_1403_hOvcLQZ.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 4 | 2019-11-26T17:04:27.000Z | 2021-12-13T11:57:03.000Z | import findspark
findspark.init()
from pyspark import SparkConf,SparkContext
from pyspark.streaming import StreamingContext
from pyspark.sql import Row,SQLContext
import sys
import requests
def parseData(x):
parts = x.split(";")[7].split(",")
return list(parts)
def printfunc(rdd):
rdd1=rdd.sortBy(l... | 27.66129 | 98 | 0.638484 |
746adc74f5ca1f2fb27a58cb82e78c59bfc46b03 | 89 | py | Python | web/apis/moments/apps.py | KhomDrake/Remember-Backend | 233f72ef3a54300e25946bdc3a1baae5b56d7a25 | [
"MIT"
] | null | null | null | web/apis/moments/apps.py | KhomDrake/Remember-Backend | 233f72ef3a54300e25946bdc3a1baae5b56d7a25 | [
"MIT"
] | null | null | null | web/apis/moments/apps.py | KhomDrake/Remember-Backend | 233f72ef3a54300e25946bdc3a1baae5b56d7a25 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MomentsConfig(AppConfig):
name = 'moments'
| 14.833333 | 33 | 0.752809 |
15b032215e4e5320765b30749240de3813144896 | 1,102 | py | Python | tests/test_utils.py | osmith93/str8ts | 41e7942bdd1c3c58c81f3a9b5109a8486eb48dae | [
"MIT"
] | null | null | null | tests/test_utils.py | osmith93/str8ts | 41e7942bdd1c3c58c81f3a9b5109a8486eb48dae | [
"MIT"
] | null | null | null | tests/test_utils.py | osmith93/str8ts | 41e7942bdd1c3c58c81f3a9b5109a8486eb48dae | [
"MIT"
] | null | null | null | from utils import Utils
import pytest
class TestUtils:
@staticmethod
def test_get_numbers_in_small_blocks():
guess_union = {1, 3, 4, 5, 6, 7, 8, 9}
guess_union2 = {1, 3, 4, 7, 8, 9}
guess_union3 = {1, 3, 5, 7, 9}
assert Utils.get_numbers_in_small_blocks(Utils.get_blocks(guess_un... | 40.814815 | 102 | 0.58167 |
4ea5cf7caf08e06b22deed52ca6b84f78919e0d4 | 3,143 | py | Python | examples/simple/grid_potential.py | egpbos/amuse | 64b3bc5b7fef9496012b023578c4d71cecef92b7 | [
"Apache-2.0"
] | null | null | null | examples/simple/grid_potential.py | egpbos/amuse | 64b3bc5b7fef9496012b023578c4d71cecef92b7 | [
"Apache-2.0"
] | null | null | null | examples/simple/grid_potential.py | egpbos/amuse | 64b3bc5b7fef9496012b023578c4d71cecef92b7 | [
"Apache-2.0"
] | 2 | 2021-11-19T04:41:37.000Z | 2021-11-20T02:11:17.000Z | from __future__ import print_function
from amuse.lab import *
from matplotlib import pyplot
def hydro_grid_in_potential_well(mass = 1 | units.MSun, length = 100 | units.AU):
converter = nbody_system.nbody_to_si(mass, length)
# calculate density in field based on solar wind
# gives a very low number
... | 36.126437 | 137 | 0.697741 |
6bf0552717064cd65cc73fc4d04d2505dfa02682 | 3,362 | py | Python | insurancedb/main.py | ifr1m/insurance-db | 7394936125fecf3a598727e11076cc7152e1bd82 | [
"MIT"
] | null | null | null | insurancedb/main.py | ifr1m/insurance-db | 7394936125fecf3a598727e11076cc7152e1bd82 | [
"MIT"
] | null | null | null | insurancedb/main.py | ifr1m/insurance-db | 7394936125fecf3a598727e11076cc7152e1bd82 | [
"MIT"
] | null | null | null | import logging
import logging.config
import logging.config
import logging.handlers
import pathlib
from multiprocessing import Pool, Queue, Event, Process, cpu_count
from pathlib import Path
import click
logger = logging.getLogger(__name__)
from insurancedb.file_processor import process_paths
from insurancedb.exporte... | 39.093023 | 118 | 0.700476 |
23fd0df27f85f1aca681aff4be1e5b7ddccb6399 | 21,351 | py | Python | aup2rpp.py | nershman/audacity2reaper | 6d981d14d8387a1f02426de3d7bcd7ec9987e619 | [
"MIT"
] | 4 | 2018-08-26T15:12:08.000Z | 2021-08-25T15:08:21.000Z | aup2rpp.py | nershman/audacity2reaper | 6d981d14d8387a1f02426de3d7bcd7ec9987e619 | [
"MIT"
] | 5 | 2020-05-20T17:26:05.000Z | 2022-02-06T18:55:37.000Z | aup2rpp.py | nershman/audacity2reaper | 6d981d14d8387a1f02426de3d7bcd7ec9987e619 | [
"MIT"
] | 1 | 2020-09-12T15:43:55.000Z | 2020-09-12T15:43:55.000Z | import struct
import xml.etree.ElementTree as ET
import uuid
import math
import pprint
import os
import html
import argparse
AU_SAMPLE_FORMAT_16 = 3
AU_SAMPLE_FORMAT_24 = 4
AU_SAMPLE_FORMAT_FLOAT = 6
def load_au_file(au_fpath):
with open(au_fpath, 'rb') as f:
# See https://github.com/audacity/audacity/blob/mast... | 28.354582 | 102 | 0.663622 |
8c41b06fec0c8368806a38ea8d0c836a343ec94d | 327 | py | Python | stores/apps/users/urls.py | diassor/CollectorCity-Market-Place | 892ad220b8cf1c0fc7433f625213fe61729522b2 | [
"Apache-2.0"
] | 135 | 2015-03-19T13:28:18.000Z | 2022-03-27T06:41:42.000Z | stores/apps/users/urls.py | dfcoding/CollectorCity-Market-Place | e59acec3d600c049323397b17cae14fdcaaaec07 | [
"Apache-2.0"
] | null | null | null | stores/apps/users/urls.py | dfcoding/CollectorCity-Market-Place | e59acec3d600c049323397b17cae14fdcaaaec07 | [
"Apache-2.0"
] | 83 | 2015-01-30T01:00:15.000Z | 2022-03-08T17:25:10.000Z | from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^confirmemail/(?P<code>[\d\w\-]+)/$', 'users.views.confirmemail', name='confirmemail'),
url(r'^re_send_mail/(?P<user_id>[\d]+)/$', 'users.views.re_send_mail', name='re_send_mail'),
url(r'^welcome/$', 'users.views.welcome', name='welco... | 46.714286 | 97 | 0.654434 |
7028ea4a2552aa72adbdc3961397c326d37a3480 | 5,199 | py | Python | manimpp/once_useful_constructs/matrix_multiplication.py | yudhastyawan/manimpp | 5bcfa7ba24e368a72f55a3c69364521843b9766d | [
"MIT"
] | null | null | null | manimpp/once_useful_constructs/matrix_multiplication.py | yudhastyawan/manimpp | 5bcfa7ba24e368a72f55a3c69364521843b9766d | [
"MIT"
] | null | null | null | manimpp/once_useful_constructs/matrix_multiplication.py | yudhastyawan/manimpp | 5bcfa7ba24e368a72f55a3c69364521843b9766d | [
"MIT"
] | null | null | null | import numpy as np
from manimpp.animation.creation import ShowCreation
from manimpp.animation.fading import FadeOut
from manimpp.animation.transform import ApplyMethod
from manimpp.animation.transform import Transform
from manimpp.constants import *
from manimpp.mobject.geometry import Circle
from manimpp.mobject.geom... | 36.612676 | 76 | 0.537411 |
f7d9928a468ac09c39310baa2cdf6aa5c3501b04 | 418 | py | Python | manage.py | suad7/News-highlight | 81df62484dd121a728ae06bf7d67269db2ea6a44 | [
"Unlicense"
] | null | null | null | manage.py | suad7/News-highlight | 81df62484dd121a728ae06bf7d67269db2ea6a44 | [
"Unlicense"
] | 1 | 2021-06-02T00:53:07.000Z | 2021-06-02T00:53:07.000Z | manage.py | suad7/News-highlight | 81df62484dd121a728ae06bf7d67269db2ea6a44 | [
"Unlicense"
] | null | null | null | from app import create_app
from flask_script import Manager,Server
# Creating app instance
app = create_app('development')
manager = Manager(app)
manager.add_command('server',Server)
@manager.command
def test():
"""Run the unit tests."""
import unittest
tests = unittest.TestLoader().discover('tests')
... | 19 | 51 | 0.722488 |
d6ceec00f29c1ebfb41e7d116c15b25f1f868749 | 419 | py | Python | partner_offer_service.py | JefteLG/python-circuit-breaker | 1349d77e4498d01c75a9a4b6d097f6413487feae | [
"MIT"
] | 14 | 2021-06-18T02:46:52.000Z | 2021-07-28T21:33:30.000Z | partner_offer_service.py | JefteLG/python-circuit-breaker | 1349d77e4498d01c75a9a4b6d097f6413487feae | [
"MIT"
] | null | null | null | partner_offer_service.py | JefteLG/python-circuit-breaker | 1349d77e4498d01c75a9a4b6d097f6413487feae | [
"MIT"
] | 1 | 2022-02-14T18:31:15.000Z | 2022-02-14T18:31:15.000Z | import uvicorn
from fastapi import FastAPI, Response
import time
app = FastAPI()
@app.get("/offer/hot")
async def get_offer():
time.sleep(1)
body = "Hot offer {}:{}".format(time.localtime().tm_min,
time.localtime().tm_sec)
return Response(content=body, status_code=500)... | 23.277778 | 68 | 0.646778 |
2f31c6aa354b9602a20889bee27107f2c9d7c5f8 | 26,445 | py | Python | openstack_dashboard/dashboards/project/volumes/views.py | hemantsonawane95/horizon | 86858a0a6df367e27ac64470b5cfe6047644f296 | [
"Apache-2.0"
] | 1 | 2018-10-09T05:54:57.000Z | 2018-10-09T05:54:57.000Z | openstack_dashboard/dashboards/project/volumes/views.py | hemantsonawane95/horizon | 86858a0a6df367e27ac64470b5cfe6047644f296 | [
"Apache-2.0"
] | 3 | 2021-01-21T14:27:55.000Z | 2021-06-10T23:08:49.000Z | openstack_dashboard/dashboards/project/volumes/views.py | Surfndez/horizon | a56765b6b3dbc09fd467b83a57bea2433ae3909e | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Nebula, 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 agree... | 38.718887 | 79 | 0.611685 |
c4b79a69f10a4cb2b2f495ebd4a24ddf286f19c0 | 11,191 | py | Python | Danim/BubbleChart/BubbleChartAnimation.py | Zhangzhicheng001/Danim | c45addc3d7679b7adb4a2cfd241c2247ce0a6669 | [
"MIT"
] | 1 | 2019-09-01T12:32:44.000Z | 2019-09-01T12:32:44.000Z | Danim/BubbleChart/BubbleChartAnimation.py | Zhangzhicheng001/Danim | c45addc3d7679b7adb4a2cfd241c2247ce0a6669 | [
"MIT"
] | null | null | null | Danim/BubbleChart/BubbleChartAnimation.py | Zhangzhicheng001/Danim | c45addc3d7679b7adb4a2cfd241c2247ce0a6669 | [
"MIT"
] | null | null | null | #mainm tools
from big_ol_pile_of_manim_imports import *
#added functions
from Danim.BubbleChart.BCutils import *
from Danim.BubbleChart.bubble_constants import *
class BubbleChartAnimation(Scene):
def construct(self):
self.AllContriesComparison()
#self.TwoContriesComparison()
def AllContriesC... | 34.540123 | 123 | 0.543026 |
842d25fe0e613db146b77c07a479208ebe50b507 | 3,108 | py | Python | tests/graph/test_astar.py | aalekhpatel07/retworkx | ae93fcab17d55bc259476c65a677221b4177870a | [
"Apache-2.0"
] | 1 | 2021-11-29T23:15:07.000Z | 2021-11-29T23:15:07.000Z | tests/graph/test_astar.py | aalekhpatel07/retworkx | ae93fcab17d55bc259476c65a677221b4177870a | [
"Apache-2.0"
] | 40 | 2020-08-31T06:09:06.000Z | 2022-03-18T19:02:34.000Z | tests/graph/test_astar.py | aalekhpatel07/retworkx | ae93fcab17d55bc259476c65a677221b4177870a | [
"Apache-2.0"
] | null | null | null | # 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, software
# distributed under th... | 30.772277 | 75 | 0.524775 |
e17032a9faa4807c405438e1546e99b2da940547 | 822 | py | Python | examples/custom_main/main.py | westwardharbor0/debian-watcher | 1e7b45a1e98695f833b29a66600ed82298a46557 | [
"MIT"
] | null | null | null | examples/custom_main/main.py | westwardharbor0/debian-watcher | 1e7b45a1e98695f833b29a66600ed82298a46557 | [
"MIT"
] | null | null | null | examples/custom_main/main.py | westwardharbor0/debian-watcher | 1e7b45a1e98695f833b29a66600ed82298a46557 | [
"MIT"
] | null | null | null | from os.path import exists
from debian_watcher.packages import Packages
from debian_watcher.storage import Storage
# when defining main.py you can define your reporter inside
def custom_reporter(**kwargs):
# bla bla bla do something with problems
pass
# you can change the path to the history storage
s = St... | 28.344828 | 77 | 0.734793 |
f9851f853086971ec193a13030907628dce5edff | 288 | py | Python | databaseCreate.py | omarabdiwali/cmdline-stock-program | f69d575898a4e2eb791d8bd93924bf256a249324 | [
"MIT"
] | 1 | 2020-12-12T06:10:24.000Z | 2020-12-12T06:10:24.000Z | databaseCreate.py | omarabdiwali/cmdline-stock-program | f69d575898a4e2eb791d8bd93924bf256a249324 | [
"MIT"
] | null | null | null | databaseCreate.py | omarabdiwali/cmdline-stock-program | f69d575898a4e2eb791d8bd93924bf256a249324 | [
"MIT"
] | null | null | null | import sqlite3
#Create new database, enter the database name in name, and end it with a '.db'
name = ''
conn = sqlite3.connect(name)
c = conn.cursor()
#Create a table in the database
c.execute("""create stocks(name string, number integer, price integer)""")
conn.commit()
conn.close()
| 22.153846 | 78 | 0.71875 |
d5f9fe713766ef45b7d763dfa90768f377f21dc3 | 2,542 | py | Python | tests/unit/types/ndarray/test_generic.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | 15,179 | 2020-04-28T10:23:56.000Z | 2022-03-31T14:35:25.000Z | tests/unit/types/ndarray/test_generic.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | 3,912 | 2020-04-28T13:01:29.000Z | 2022-03-31T14:36:46.000Z | tests/unit/types/ndarray/test_generic.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | 1,955 | 2020-04-28T10:50:49.000Z | 2022-03-31T12:28:34.000Z | import pytest
import numpy as np
from jina.proto import jina_pb2
from jina.types.ndarray.generic import NdArray
from jina.types.ndarray.dense.numpy import DenseNdArray
from jina.types.ndarray.sparse.tensorflow import SparseNdArray as TFSparseNdArray
from jina.types.ndarray.sparse.pytorch import SparseNdArray as PTSpar... | 26.479167 | 85 | 0.704563 |
b2d54f4696d41b8844a97799cdff7938fc385c0c | 3,204 | py | Python | richkit/test/lookup/test_util.py | kidmose/richkit | 2575eeeeaf2151f0a4c42d4bea9caa9fcc1350c7 | [
"MIT"
] | 12 | 2020-03-18T17:13:05.000Z | 2022-03-04T15:37:20.000Z | richkit/test/lookup/test_util.py | kidmose/richkit | 2575eeeeaf2151f0a4c42d4bea9caa9fcc1350c7 | [
"MIT"
] | 65 | 2019-11-14T12:01:58.000Z | 2021-12-19T22:42:32.000Z | richkit/test/lookup/test_util.py | kidmose/richkit | 2575eeeeaf2151f0a4c42d4bea9caa9fcc1350c7 | [
"MIT"
] | 3 | 2020-04-21T10:43:33.000Z | 2021-03-08T15:32:17.000Z | import time
from datetime import datetime
from richkit.lookup import util
from richkit.lookup.util import MaxMindDB
import os
import unittest
import logging
from pathlib import Path
from requests.exceptions import ConnectionError
def rm_recursive(pth):
pth = Path(pth)
# Recurse
for child in pth.glob('*')... | 26.92437 | 69 | 0.607678 |
6f9d102ae2992a5b196f65e69f49b0dcca27861a | 3,173 | py | Python | Keras-cSAWGAN/self_attention.py | mshaikh2/sagan | c978d18b0400eddecde303e30900107093029876 | [
"MIT"
] | null | null | null | Keras-cSAWGAN/self_attention.py | mshaikh2/sagan | c978d18b0400eddecde303e30900107093029876 | [
"MIT"
] | null | null | null | Keras-cSAWGAN/self_attention.py | mshaikh2/sagan | c978d18b0400eddecde303e30900107093029876 | [
"MIT"
] | null | null | null | from keras import backend as K
from keras.layers import Layer,InputSpec
import tensorflow as tf
class Attention(Layer):
def __init__(self, ch, **kwargs):
super(Attention, self).__init__(**kwargs)
self.channels = ch
self.filters_f_g = self.channels // 8
self.filters_h = self.channel... | 42.878378 | 99 | 0.498897 |
e478f1f582f13cd1eb71132b6f4485c417007d8c | 612 | py | Python | invtasks/__init__.py | Microndgt/rfdmovies-server | de99a672f498fe5fc111620ee4f1073b9a2dc1e0 | [
"MIT"
] | null | null | null | invtasks/__init__.py | Microndgt/rfdmovies-server | de99a672f498fe5fc111620ee4f1073b9a2dc1e0 | [
"MIT"
] | null | null | null | invtasks/__init__.py | Microndgt/rfdmovies-server | de99a672f498fe5fc111620ee4f1073b9a2dc1e0 | [
"MIT"
] | null | null | null | from invoke import ctask, run
from config import PROCESSORS, RUN_PORT, FLOWER_PORT, DEBUG
@ctask
def server(ctx):
from rfdmovies import app
app.run('0.0.0.0', port=RUN_PORT, debug=DEBUG)
@ctask
def gunicorn(ctx):
port = RUN_PORT
nprocs = PROCESSORS
cmd = "gunicorn -w {} -k gevent -b 0.0.0.0:{} r... | 21.103448 | 84 | 0.660131 |
ca818154964b50a12db8ccef2387041ba37287f1 | 3,830 | py | Python | programacao_linear.py | luiztavano/Roteirizador | ec1fa731b5f334e3cfe7d56ad5032da310655299 | [
"Apache-2.0"
] | null | null | null | programacao_linear.py | luiztavano/Roteirizador | ec1fa731b5f334e3cfe7d56ad5032da310655299 | [
"Apache-2.0"
] | null | null | null | programacao_linear.py | luiztavano/Roteirizador | ec1fa731b5f334e3cfe7d56ad5032da310655299 | [
"Apache-2.0"
] | null | null | null | #importação da biblioteca pulp
from pulp import LpProblem, LpStatus, lpSum, LpVariable, LpMinimize
class Metodo_exato(object):
def __init__(self, lista_destinos, lista_distancias):
self.lista_destinos = lista_destinos
self.lista_distancias = lista_distancias
#Função par... | 34.818182 | 101 | 0.521671 |
397ab0b25a8839613046327c8efbd9ad7186437b | 3,944 | py | Python | distdeepq/static.py | Silvicek/distributional-dqn | 41a9095393dd25b7375119b4af7d2c35ee3ec6cc | [
"MIT"
] | 131 | 2017-09-16T02:06:44.000Z | 2022-03-23T08:09:56.000Z | distdeepq/static.py | Silvicek/distributional-dqn | 41a9095393dd25b7375119b4af7d2c35ee3ec6cc | [
"MIT"
] | 6 | 2017-10-26T09:36:00.000Z | 2019-03-15T06:23:17.000Z | distdeepq/static.py | Silvicek/distributional-dqn | 41a9095393dd25b7375119b4af7d2c35ee3ec6cc | [
"MIT"
] | 29 | 2017-09-16T02:30:27.000Z | 2020-04-12T03:12:39.000Z | import tensorflow as tf
import numpy as np
import os
import gym
def build_z(Vmin, Vmax, nb_atoms, numpy=False):
dz = (Vmax - Vmin) / (nb_atoms - 1)
if numpy:
z = np.arange(Vmin, Vmax + dz / 2, dz)
else:
z = tf.range(Vmin, Vmax + dz / 2, dz, dtype=tf.float32, name='z') # TODO: reuse?
... | 32.327869 | 89 | 0.60142 |
18fe2bc8f9af702a1234d293b50dbd1f7cfa82f0 | 12,424 | py | Python | zipline/finance/risk/cumulative.py | Code37/zipline | de038dbf584980af4f30822f8e5d306bac2a44cb | [
"Apache-2.0"
] | 412 | 2017-04-30T14:35:47.000Z | 2022-03-29T02:58:33.000Z | zipline/finance/risk/cumulative.py | waijay1992/zipline | 8beba055aa4211dc2debc5c3083077cbd19d0bbc | [
"Apache-2.0"
] | 116 | 2017-05-15T04:45:45.000Z | 2020-05-30T19:09:00.000Z | zipline/finance/risk/cumulative.py | waijay1992/zipline | 8beba055aa4211dc2debc5c3083077cbd19d0bbc | [
"Apache-2.0"
] | 80 | 2017-05-03T13:17:33.000Z | 2021-02-08T15:42:09.000Z | #
# Copyright 2014 Quantopian, 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 wr... | 36.327485 | 79 | 0.646088 |
afe2b93129aae02fbf5b23de2b7a84319cd1a044 | 4,512 | py | Python | fsspec/compression.py | masda70/filesystem_spec | 338d7780bb7da75f9dbd62000748fcce683d47a3 | [
"BSD-3-Clause"
] | 3 | 2020-07-21T06:30:10.000Z | 2021-01-21T21:32:21.000Z | fsspec/compression.py | masda70/filesystem_spec | 338d7780bb7da75f9dbd62000748fcce683d47a3 | [
"BSD-3-Clause"
] | 2 | 2021-05-11T16:00:55.000Z | 2021-08-23T20:45:22.000Z | fsspec/compression.py | masda70/filesystem_spec | 338d7780bb7da75f9dbd62000748fcce683d47a3 | [
"BSD-3-Clause"
] | null | null | null | """Helper functions for a standard streaming compression API"""
from bz2 import BZ2File
from gzip import GzipFile
from zipfile import ZipFile
import fsspec.utils
from fsspec.spec import AbstractBufferedFile
def noop_file(file, mode, **kwargs):
return file
# TODO: files should also be available as contexts
# sh... | 29.298701 | 86 | 0.65492 |
b3f38096ce0cb602f7e36186e9afd4dbe2d37cb2 | 5,014 | py | Python | Project 3/marketsim.py | glc12125/ML_for_trading | 29af3b0820f0d23ca483c118e123ba7899f45704 | [
"MIT"
] | null | null | null | Project 3/marketsim.py | glc12125/ML_for_trading | 29af3b0820f0d23ca483c118e123ba7899f45704 | [
"MIT"
] | null | null | null | Project 3/marketsim.py | glc12125/ML_for_trading | 29af3b0820f0d23ca483c118e123ba7899f45704 | [
"MIT"
] | null | null | null | """MC2-P1: Market simulator."""
import pandas as pd
import numpy as np
import datetime as dt
import os
from util import get_data, plot_data
def compute_portvals(orders_file = "./orders/orders.csv", start_val = 1000000, commission=9.95, impact=0.005):
# this is the function the autograder will call to test your co... | 35.309859 | 114 | 0.681292 |
d97a78990de7901205a200b6eaf9aa67e3766391 | 8,464 | py | Python | python/src/main/resources/python/zeppelin_context.py | apc999/zeppelin | fd27014b02aa9635190b2c4bb76d34589b16792c | [
"Apache-2.0"
] | null | null | null | python/src/main/resources/python/zeppelin_context.py | apc999/zeppelin | fd27014b02aa9635190b2c4bb76d34589b16792c | [
"Apache-2.0"
] | null | null | null | python/src/main/resources/python/zeppelin_context.py | apc999/zeppelin | fd27014b02aa9635190b2c4bb76d34589b16792c | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 37.617778 | 111 | 0.62311 |
7e1bb51cc551e9c5ea137e9c7774610b65a84d97 | 498 | py | Python | ABC054/ABC054b.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC054/ABC054b.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC054/ABC054b.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | #ABC054b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n, m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]
def match(x, y):
for i in range(m):
for j in range(m):
if (a[y + i][x + j] != b[i][j]):
return False
... | 20.75 | 48 | 0.491968 |
c5bf08f596a04b8be7030bf40344be20f6f647be | 7,344 | py | Python | zat/log_to_dataframe.py | SuperCowPowers/zat | 7f0de8bb052e8c84ab9bd00f195514d957eac9ec | [
"Apache-2.0"
] | 146 | 2019-11-07T20:57:27.000Z | 2022-03-24T00:03:55.000Z | zat/log_to_dataframe.py | Kitware/BroUtils | fed88c4310cf70c8b01c9a7eb0918b8c4d117e77 | [
"Apache-2.0"
] | 43 | 2017-09-18T06:22:35.000Z | 2018-09-05T19:59:43.000Z | zat/log_to_dataframe.py | Kitware/BroUtils | fed88c4310cf70c8b01c9a7eb0918b8c4d117e77 | [
"Apache-2.0"
] | 41 | 2017-09-11T09:59:47.000Z | 2018-09-01T18:36:47.000Z | """LogToDataFrame: Converts a Zeek log to a Pandas DataFrame"""
# Third Party
import pandas as pd
# Local
from zat import zeek_log_reader
class LogToDataFrame(object):
"""LogToDataFrame: Converts a Zeek log to a Pandas DataFrame
Notes:
This class has recently been overhauled from a simple l... | 41.727273 | 127 | 0.621187 |
7ba48744db5cd7a6eec1ac29be35119bc91f805d | 2,034 | py | Python | locations/spiders/skyline_chili.py | boomerwv1/alltheplaces | 731300429b2a0bab5bb704644c1413986aba56e3 | [
"MIT"
] | 297 | 2017-12-07T01:29:14.000Z | 2022-03-29T06:58:01.000Z | locations/spiders/skyline_chili.py | boomerwv1/alltheplaces | 731300429b2a0bab5bb704644c1413986aba56e3 | [
"MIT"
] | 2,770 | 2017-11-28T04:20:21.000Z | 2022-03-31T11:29:16.000Z | locations/spiders/skyline_chili.py | boomerwv1/alltheplaces | 731300429b2a0bab5bb704644c1413986aba56e3 | [
"MIT"
] | 111 | 2017-11-27T21:40:02.000Z | 2022-01-22T01:21:52.000Z | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.hours import OpeningHours, DAYS
from locations.items import GeojsonPointItem
class SkylineChiliSpider(scrapy.Spider):
name = "skyline_chili"
item_attributes = {
"name": "Skyline Chili",
"brand": "Skyline Chili",
"brand_w... | 34.474576 | 82 | 0.553589 |
96d7ca182466616930040ff35f25a183ded3905b | 583 | py | Python | utility/cog/banner/_sorted_banner.py | RvstFyth/discordballz | ada6456f434df19c74a30ec8ae5b7de248d8f79c | [
"MIT"
] | 4 | 2020-01-19T13:53:43.000Z | 2020-01-20T13:34:17.000Z | utility/cog/banner/_sorted_banner.py | RvstFyth/discordballz | ada6456f434df19c74a30ec8ae5b7de248d8f79c | [
"MIT"
] | 18 | 2020-01-19T17:52:17.000Z | 2020-02-17T15:06:13.000Z | utility/cog/banner/_sorted_banner.py | RvstFyth/discordballz | ada6456f434df19c74a30ec8ae5b7de248d8f79c | [
"MIT"
] | 1 | 2020-01-19T16:33:19.000Z | 2020-01-19T16:33:19.000Z | """
Stores the sorted list of characters
--
Author : DrLarck
Last update : 21/08/19 (DrLarck)
"""
# storage
class Sorted_banner:
"""
Store the sorted banner values
- Class attribute :
`is_sorted` bool - Determines if the banners have been sorted or not.
`basic` : dict - Represents the sort... | 19.433333 | 73 | 0.660377 |
9b1c45498a761924e3ec54768ffb3357a37153e5 | 4,720 | py | Python | symphony/bdk/core/extension.py | SymphonyOSF/symphony-api-client-python | 70137a893f4385381a3158ef80e1be156e0fc4bd | [
"Apache-2.0"
] | null | null | null | symphony/bdk/core/extension.py | SymphonyOSF/symphony-api-client-python | 70137a893f4385381a3158ef80e1be156e0fc4bd | [
"Apache-2.0"
] | null | null | null | symphony/bdk/core/extension.py | SymphonyOSF/symphony-api-client-python | 70137a893f4385381a3158ef80e1be156e0fc4bd | [
"Apache-2.0"
] | null | null | null | """Module for managing extensions.
"""
import logging
from abc import ABC, abstractmethod
from typing import Union
from symphony.bdk.core.auth.auth_session import AuthSession
from symphony.bdk.core.client.api_client_factory import ApiClientFactory
from symphony.bdk.core.config.model.bdk_config import BdkConfig
logger... | 36.307692 | 106 | 0.694703 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.