hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
344e54e490f2768644b1bab87e5d4d21e99bcac3 | 8,244 | py | Python | tests/extras/datasets/pandas/test_feather_dataset.py | andmikey/kedro | 9b4e4135720609d44ffdf5248246fe805f0b5469 | [
"Apache-2.0"
] | null | null | null | tests/extras/datasets/pandas/test_feather_dataset.py | andmikey/kedro | 9b4e4135720609d44ffdf5248246fe805f0b5469 | [
"Apache-2.0"
] | null | null | null | tests/extras/datasets/pandas/test_feather_dataset.py | andmikey/kedro | 9b4e4135720609d44ffdf5248246fe805f0b5469 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... | 40.811881 | 88 | 0.700631 |
16c621a7ecc71bf0a69eed6a66559507064bdc34 | 650 | py | Python | scripts/python/genjson.py | akvo/flowvis | 9dae54992cf8bda9e172fbf0eefcf172607746c9 | [
"Unlicense"
] | null | null | null | scripts/python/genjson.py | akvo/flowvis | 9dae54992cf8bda9e172fbf0eefcf172607746c9 | [
"Unlicense"
] | null | null | null | scripts/python/genjson.py | akvo/flowvis | 9dae54992cf8bda9e172fbf0eefcf172607746c9 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# Parses data in csv form to json
import sys
import csv
import json
filename = "data/liberia-data.csv"
count = 10
if len(sys.argv) > 1:
filename = sys.argv[1]
if len(sys.argv) > 2:
count = int(sys.argv[2])
f = open(filename, "r")
fieldnames = [n.lstrip('"').rstrip().rstrip('"') for n i... | 21.666667 | 82 | 0.578462 |
0d3638c02eea8f2809c3acc0d4c649140584b12b | 3,508 | py | Python | parlai/scripts/token_stats.py | terrorizer1980/ParlAI | f8fda24bd11804104b0a91aa84e170d3efbd8983 | [
"MIT"
] | 2 | 2020-08-27T05:21:14.000Z | 2020-09-29T14:34:09.000Z | parlai/scripts/token_stats.py | terrorizer1980/ParlAI | f8fda24bd11804104b0a91aa84e170d3efbd8983 | [
"MIT"
] | 316 | 2021-03-19T14:53:31.000Z | 2022-03-27T03:36:51.000Z | parlai/scripts/token_stats.py | terrorizer1980/ParlAI | f8fda24bd11804104b0a91aa84e170d3efbd8983 | [
"MIT"
] | 2 | 2020-10-29T18:14:33.000Z | 2020-11-07T09:46:23.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
from parlai.core.script import ParlaiScript
from parlai.core.agents import create_agent
from parlai.c... | 36.164948 | 85 | 0.595496 |
429096d51d979797728e3645332676cc03000395 | 4,511 | py | Python | nova/tests/unit/api/openstack/compute/test_console_auth_tokens.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 1,874 | 2015-01-04T05:18:34.000Z | 2022-03-31T03:30:28.000Z | nova/tests/unit/api/openstack/compute/test_console_auth_tokens.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 40 | 2015-04-13T02:32:42.000Z | 2022-02-16T02:28:06.000Z | nova/tests/unit/api/openstack/compute/test_console_auth_tokens.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 1,996 | 2015-01-04T15:11:51.000Z | 2022-03-31T11:03:13.000Z | # Copyright 2013 Cloudbase Solutions Srl
# 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 r... | 46.030612 | 79 | 0.685879 |
784a30f2da2aba495b231252bbdab44f5b31a20b | 17,069 | py | Python | python/connect_c.py | goten-team/Goten | 690f1429b62c70caec72f4010ee5b7a9786f0d25 | [
"MIT"
] | 17 | 2020-04-28T09:18:28.000Z | 2021-12-28T08:38:00.000Z | python/connect_c.py | goten-team/Goten | 690f1429b62c70caec72f4010ee5b7a9786f0d25 | [
"MIT"
] | 2 | 2021-09-26T04:10:51.000Z | 2022-03-31T05:28:25.000Z | python/connect_c.py | goten-team/Goten | 690f1429b62c70caec72f4010ee5b7a9786f0d25 | [
"MIT"
] | 2 | 2021-09-26T05:06:17.000Z | 2021-12-14T16:25:06.000Z | #!usr/bin/env python
from __future__ import print_function
from multiprocessing.pool import ThreadPool
import numpy as np
import torch
from python.basic_utils import str_hash
from python.enclave_interfaces import GlobalTensor, SecretEnum
from python.quantize_net import swalp_quantize, NamedParam, dequantize_op
from p... | 40.447867 | 113 | 0.62593 |
769859119bdc741f843ae4af0e7a80cb38a9c0e9 | 1,067 | py | Python | Notebooks/SentinelUtilities/SentinelAzure/azure_loganalytics_helper.py | ytognder/Azure-Sentinel | 7345560f178e731d7ba5a5541fd3383bca285311 | [
"MIT"
] | 266 | 2019-10-18T00:41:39.000Z | 2022-03-18T05:44:01.000Z | Notebooks/SentinelUtilities/SentinelAzure/azure_loganalytics_helper.py | ytognder/Azure-Sentinel | 7345560f178e731d7ba5a5541fd3383bca285311 | [
"MIT"
] | 113 | 2020-03-10T16:56:10.000Z | 2022-03-28T21:54:26.000Z | Notebooks/SentinelUtilities/SentinelAzure/azure_loganalytics_helper.py | ytognder/Azure-Sentinel | 7345560f178e731d7ba5a5541fd3383bca285311 | [
"MIT"
] | 93 | 2020-01-07T20:28:43.000Z | 2022-03-23T04:09:39.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
Azure ... | 36.793103 | 100 | 0.614808 |
1f157a1a1574e6c798f2785076b4810fb58e20ec | 9,147 | py | Python | fastai/layers.py | joel-odlund/fastai | a76d611932eb68c8974e50be943f1becaf60fe62 | [
"Apache-2.0"
] | null | null | null | fastai/layers.py | joel-odlund/fastai | a76d611932eb68c8974e50be943f1becaf60fe62 | [
"Apache-2.0"
] | null | null | null | fastai/layers.py | joel-odlund/fastai | a76d611932eb68c8974e50be943f1becaf60fe62 | [
"Apache-2.0"
] | null | null | null | "`fastai.layers` provides essential functions to building and modifying `model` architectures"
from .torch_core import *
__all__ = ['AdaptiveConcatPool2d', 'MSELossFlat', 'CrossEntropyFlat', 'Debugger', 'Flatten', 'Lambda', 'PoolFlatten', 'ResizeBatch',
'bn_drop_lin', 'conv2d', 'conv2d_trans', 'conv_layer',... | 45.282178 | 134 | 0.66776 |
dae8c963c62e79b26738992540c20882887a2399 | 3,876 | py | Python | africastalking/SMS.py | RawPlutonium/africastalking-python | 753e8974913ed7707f6d8a7c6520ecaa96cc25d9 | [
"MIT"
] | 12 | 2019-08-02T07:58:16.000Z | 2022-01-31T23:45:08.000Z | africastalking/SMS.py | RawPlutonium/africastalking-python | 753e8974913ed7707f6d8a7c6520ecaa96cc25d9 | [
"MIT"
] | 8 | 2019-08-02T08:06:18.000Z | 2022-03-11T23:45:17.000Z | africastalking/SMS.py | RawPlutonium/africastalking-python | 753e8974913ed7707f6d8a7c6520ecaa96cc25d9 | [
"MIT"
] | 11 | 2019-07-31T16:23:36.000Z | 2022-01-29T08:30:07.000Z | from . Service import APIService, validate_phone
class SMSService(APIService):
def __init__(self, username, api_key):
super(SMSService, self).__init__(username, api_key)
def _init_service(self):
super(SMSService, self)._init_service()
self._baseUrl = self._baseUrl + '/version1'
d... | 34 | 113 | 0.610681 |
9f75c48ba36b6a7803bd6b088fc90ac06de47dd8 | 1,247 | py | Python | jitlog/constants.py | NyanKiyoshi/vmprof-python | 8e58464956e1553ebafacb0afc5de9dd08c197e3 | [
"MIT"
] | 430 | 2015-01-31T13:41:07.000Z | 2022-01-24T02:04:23.000Z | jitlog/constants.py | NyanKiyoshi/vmprof-python | 8e58464956e1553ebafacb0afc5de9dd08c197e3 | [
"MIT"
] | 202 | 2015-02-06T19:01:38.000Z | 2022-03-22T15:15:20.000Z | jitlog/constants.py | NyanKiyoshi/vmprof-python | 8e58464956e1553ebafacb0afc5de9dd08c197e3 | [
"MIT"
] | 59 | 2015-02-08T16:06:28.000Z | 2022-01-11T00:12:37.000Z | # generated constants from rpython/rlib/jitlog.py
import struct
MARK_JITLOG_START = struct.pack("b", 0x10)
MARK_INPUT_ARGS = struct.pack("b", 0x11)
MARK_RESOP_META = struct.pack("b", 0x12)
MARK_RESOP = struct.pack("b", 0x13)
MARK_RESOP_DESCR = struct.pack("b", 0x14)
MARK_ASM_ADDR = struct.pack("b", 0x15)
MARK_ASM = str... | 31.974359 | 49 | 0.700882 |
11d9c0ffdd5848652dc7d5ab81ae7d83f66c3c57 | 4,021 | py | Python | tests/test_django_configurations.py | cornershop/pytest-django | 6c51fe31a9cc31a0816785dc4f40114dff56da7b | [
"BSD-3-Clause"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | tests/test_django_configurations.py | cornershop/pytest-django | 6c51fe31a9cc31a0816785dc4f40114dff56da7b | [
"BSD-3-Clause"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | tests/test_django_configurations.py | cornershop/pytest-django | 6c51fe31a9cc31a0816785dc4f40114dff56da7b | [
"BSD-3-Clause"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | """Tests which check the various ways you can set DJANGO_SETTINGS_MODULE
If these tests fail you probably forgot to install django-configurations.
"""
import pytest
pytest.importorskip("configurations")
BARE_SETTINGS = """
from configurations import Configuration
class MySettings(Configuration):
# At least one... | 28.51773 | 95 | 0.643372 |
88efe309d60ec4abb9c8fb37ab4b3d1729f7483e | 1,775 | py | Python | browserexport/model.py | seanbreckenridge/browserexport | 24166a6704f6ac65d66383b1dd73ea7096859e32 | [
"MIT"
] | 32 | 2021-05-17T18:24:15.000Z | 2022-03-29T20:14:51.000Z | browserexport/model.py | seanbreckenridge/ffexport | 24166a6704f6ac65d66383b1dd73ea7096859e32 | [
"MIT"
] | 17 | 2020-08-31T23:35:55.000Z | 2021-04-18T21:56:21.000Z | browserexport/model.py | seanbreckenridge/ffexport | 24166a6704f6ac65d66383b1dd73ea7096859e32 | [
"MIT"
] | 1 | 2022-02-11T23:35:16.000Z | 2022-02-11T23:35:16.000Z | """
A namedtuple representaton for the extracted info
"""
from datetime import datetime
from typing import Optional, NamedTuple, Dict, Any
Second = int
# typically isn't used complete by one browser, inludes
# partial information from browsers which supply the information
class Metadata(NamedTuple):
title: Opti... | 29.583333 | 87 | 0.64169 |
3b564517d69b4d53752bbf05e6e3ac9936e46cad | 15,796 | py | Python | distribute_setup.py | jasuca/pygrowup | 18a6e916ff1e416bbd68afd125fb982ce87091ca | [
"BSD-3-Clause"
] | null | null | null | distribute_setup.py | jasuca/pygrowup | 18a6e916ff1e416bbd68afd125fb982ce87091ca | [
"BSD-3-Clause"
] | null | null | null | distribute_setup.py | jasuca/pygrowup | 18a6e916ff1e416bbd68afd125fb982ce87091ca | [
"BSD-3-Clause"
] | 1 | 2021-12-28T13:19:52.000Z | 2021-12-28T13:19:52.000Z | #!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... | 32.435318 | 80 | 0.619714 |
0b3430d61a7094503857360630edc741f602d028 | 24,641 | py | Python | examples/navier-stokes/single_instance/b1_stokes_ns_resmin_base.py | adityabalu/DiffNet | a21e024ad9948fa76fe73796e216a0a6601f2c7c | [
"MIT"
] | 1 | 2021-12-02T06:42:38.000Z | 2021-12-02T06:42:38.000Z | examples/navier-stokes/single_instance/b1_stokes_ns_resmin_base.py | adityabalu/DiffNet | a21e024ad9948fa76fe73796e216a0a6601f2c7c | [
"MIT"
] | null | null | null | examples/navier-stokes/single_instance/b1_stokes_ns_resmin_base.py | adityabalu/DiffNet | a21e024ad9948fa76fe73796e216a0a6601f2c7c | [
"MIT"
] | 2 | 2021-12-01T20:53:24.000Z | 2021-12-02T06:42:39.000Z | import os
import sys
import math
import json
import torch
import numpy as np
import scipy.io
from scipy import ndimage
import matplotlib
# from skimage import io
# matplotlib.use("pgf")
matplotlib.rcParams.update({
# 'font.family': 'serif',
'font.size':8,
})
from matplotlib import pyplot as plt
import pytorch... | 40.461412 | 184 | 0.60444 |
f7bd804d2a4e919321cad80c6b2174a0dbedda7f | 504 | py | Python | rapdevpy/database/sql_alchemy_tables.py | MislavJaksic/rapdevpy | bf03c151ed00b88f89d3f6fbfaeed2348fe1e9f7 | [
"MIT"
] | null | null | null | rapdevpy/database/sql_alchemy_tables.py | MislavJaksic/rapdevpy | bf03c151ed00b88f89d3f6fbfaeed2348fe1e9f7 | [
"MIT"
] | null | null | null | rapdevpy/database/sql_alchemy_tables.py | MislavJaksic/rapdevpy | bf03c151ed00b88f89d3f6fbfaeed2348fe1e9f7 | [
"MIT"
] | null | null | null | from typing import Dict
from sqlalchemy import MetaData, Table
class SqlAlchemyTables:
metadata: MetaData
tables: Dict[str, Table]
def __init__(self, metadata: MetaData):
self.metadata = metadata
self.tables = {}
def __getitem__(self, key: str) -> Table:
return self.tables[k... | 22.909091 | 63 | 0.646825 |
6f6a9d02a9b5e98208206d279fa0e2f5e072f4bb | 22,688 | py | Python | samsungctl/application.py | xxKeoxx/samsungctl | 3fe02e20e7d2fb322a41b537f0f7cc7935d8c44d | [
"MIT"
] | null | null | null | samsungctl/application.py | xxKeoxx/samsungctl | 3fe02e20e7d2fb322a41b537f0f7cc7935d8c44d | [
"MIT"
] | null | null | null | samsungctl/application.py | xxKeoxx/samsungctl | 3fe02e20e7d2fb322a41b537f0f7cc7935d8c44d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import threading
import base64
import requests
# {
# "isLock": false,
# "name": "Deezer",
# "appType": "web_app",
# "position": 13,
# "appId": 3201608010191,
# "launcherType": "launcher",
# ... | 43.883946 | 162 | 0.403914 |
8d7cad9cdc8441245df53fdda021a080aa9cafb2 | 218 | py | Python | cyder/cydns/tests/all.py | ngokevin/cyder | 8bc0e4aea9ec4b7ac9260b083839bbb1174441d3 | [
"BSD-3-Clause"
] | 1 | 2016-07-06T13:00:53.000Z | 2016-07-06T13:00:53.000Z | cyder/cydns/tests/all.py | ngokevin/cyder | 8bc0e4aea9ec4b7ac9260b083839bbb1174441d3 | [
"BSD-3-Clause"
] | null | null | null | cyder/cydns/tests/all.py | ngokevin/cyder | 8bc0e4aea9ec4b7ac9260b083839bbb1174441d3 | [
"BSD-3-Clause"
] | null | null | null | from cyder.cydns.tests.model_tests import *
from cyder.cydns.domain.view_tests import *
from cyder.cydns.reverse_domain.view_tests import *
from cyder.cydns.soa.view_tests import *
from cyder.cydns.view_tests import *
| 36.333333 | 51 | 0.821101 |
8f2e11ee08f5deb7d04487792cb63a10d9c21c09 | 1,175 | py | Python | MyTuts/String.py | OmkarPathak/My-Personal-Website | 45df735662f45f6d5ad8bbbcbbb4ae31134fb86b | [
"MIT"
] | 9 | 2018-01-26T19:52:55.000Z | 2021-03-19T02:50:43.000Z | MyTuts/String.py | OmkarPathak/My-Personal-Website | 45df735662f45f6d5ad8bbbcbbb4ae31134fb86b | [
"MIT"
] | 1 | 2020-10-02T03:34:08.000Z | 2020-10-02T03:34:08.000Z | MyTuts/String.py | OmkarPathak/My-Personal-Website | 45df735662f45f6d5ad8bbbcbbb4ae31134fb86b | [
"MIT"
] | 14 | 2018-01-18T13:02:37.000Z | 2021-06-16T16:12:43.000Z | # Author: OMKAR PATHAK
# NOTE: This tutorial is based for Python 3
# In this example we would see some operations that can be performed
# on Python data type: Strings
myString = 'hello' # Assigning a string to a variable
# h => 0
# e => 1
# l => 2
# l => 3
# o => 4
print(myString[0], myString[1])
print(myStri... | 26.704545 | 83 | 0.690213 |
d59726787c8859dacebe118cdc4606bde8efda40 | 9,326 | py | Python | tests/integration/modules/test_ssh.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | tests/integration/modules/test_ssh.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/integration/modules/test_ssh.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
Test the ssh module
'''
# Import python libs
from __future__ import absolute_import, unicode_literals, print_function
import os
import shutil
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.support.case import ModuleCase
from tests.support.helpers impo... | 36.716535 | 118 | 0.577204 |
b26e41ea6547663ef3b8200cd514d9483dbabf45 | 14,189 | py | Python | src/robotframework_ls/impl/ast_utils.py | Snooz82/robotframework-lsp | 5f6666968f59111a5c478afd54df055d23d7274c | [
"Apache-2.0"
] | null | null | null | src/robotframework_ls/impl/ast_utils.py | Snooz82/robotframework-lsp | 5f6666968f59111a5c478afd54df055d23d7274c | [
"Apache-2.0"
] | null | null | null | src/robotframework_ls/impl/ast_utils.py | Snooz82/robotframework-lsp | 5f6666968f59111a5c478afd54df055d23d7274c | [
"Apache-2.0"
] | null | null | null | import ast as ast_module
from robotframework_ls.lsp import Error
import sys
from collections import namedtuple
from robotframework_ls.robotframework_log import get_logger
log = get_logger(__name__)
class _NodesProviderVisitor(ast_module.NodeVisitor):
def __init__(self, on_node=lambda node: None):
ast_mod... | 31.885393 | 86 | 0.58045 |
de1d858ce6ceb0afac552cf2587e2a247d876af8 | 1,015 | py | Python | stocks_api/__init__.py | IndigoShock/stocks_api | 8d0b1fea8fc9637d9580e0f69d9a6585c04472d8 | [
"MIT"
] | null | null | null | stocks_api/__init__.py | IndigoShock/stocks_api | 8d0b1fea8fc9637d9580e0f69d9a6585c04472d8 | [
"MIT"
] | null | null | null | stocks_api/__init__.py | IndigoShock/stocks_api | 8d0b1fea8fc9637d9580e0f69d9a6585c04472d8 | [
"MIT"
] | null | null | null | from pyramid.config import Configurator
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.security import Allow, ALL_PERMISSIONS
class RootACL:
__acl__ = [
(Allow, 'admin', ALL_PERMISSIONS),
(Allow, 'view', ['read']),
]
def __init__(self, request):
pass
def a... | 27.432432 | 64 | 0.698522 |
5e56f3f582abfff11a2e752521ca54038cadfaea | 312 | py | Python | 002/inout.py | sauhor/miniprocon | 841ffcc50f7955cba9f9dd45a405d55928a61fec | [
"MIT"
] | null | null | null | 002/inout.py | sauhor/miniprocon | 841ffcc50f7955cba9f9dd45a405d55928a61fec | [
"MIT"
] | null | null | null | 002/inout.py | sauhor/miniprocon | 841ffcc50f7955cba9f9dd45a405d55928a61fec | [
"MIT"
] | null | null | null | # inout.py
#coding: utf-8
import sys
from solve import solve
argvs=sys.argv
argc=len(argvs)
if argc >= 2:
f=open(argvs[1],"r")
else:
f=open("problem.txt","r")
noshi=[line.strip('\n') for line in f]
spam=noshi[0].split(' ')
n=spam[0]
m=spam[1]
noshimochi=noshi[1:]
print solve(int(n),int(m),noshimochi)
| 16.421053 | 38 | 0.657051 |
a072403754baa0e13a154ef04a852ecffdb553db | 2,719 | py | Python | projects/migrations/0001_initial.py | Tajeu2001/awwards | 3a7b068f5d66336d4881a91b6a49338dc6f900d6 | [
"MIT"
] | null | null | null | projects/migrations/0001_initial.py | Tajeu2001/awwards | 3a7b068f5d66336d4881a91b6a49338dc6f900d6 | [
"MIT"
] | null | null | null | projects/migrations/0001_initial.py | Tajeu2001/awwards | 3a7b068f5d66336d4881a91b6a49338dc6f900d6 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.24 on 2021-07-17 12:02
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
op... | 50.351852 | 166 | 0.568959 |
37cc1be23a9035756296bad2fb4f0904b191e62f | 5,133 | py | Python | ezo/tests/test_ezo.py | robinagist/ezo | fae896daa1c896c7c50f2c9cfe3f7f9cdb3fc986 | [
"MIT"
] | 6 | 2018-06-17T13:11:25.000Z | 2021-02-22T08:54:31.000Z | ezo/tests/test_ezo.py | robinagist/ezo | fae896daa1c896c7c50f2c9cfe3f7f9cdb3fc986 | [
"MIT"
] | 53 | 2018-05-31T06:43:27.000Z | 2021-06-11T17:45:29.000Z | ezo/tests/test_ezo.py | robinagist/ezo | fae896daa1c896c7c50f2c9cfe3f7f9cdb3fc986 | [
"MIT"
] | null | null | null |
from cli.ezo_cli import EZOApp
from core.lib import EZO
import pytest
'''
Ezo full integration test
'''
class EZOTestApp(EZOApp):
class Meta:
argv = []
config_files = []
### compiles and deploys
def test_01_ezo_compile_contract(capsys):
with EZOTestApp(argv=['compile', 'time_oracle.sol', '... | 33.993377 | 131 | 0.653419 |
82b5fcd7828d1faccfae99477f8a44449ca4c9c1 | 2,811 | py | Python | working_example/python/hello_serverless/hello_serverless/hello_serverless_stack.py | darko-mesaros/workshop-serverless-with-cdk | bbfd30de43d01251565c019a8ac259706bd6f1d0 | [
"MIT"
] | 33 | 2020-08-12T08:08:08.000Z | 2022-03-20T20:32:18.000Z | working_example/python/hello_serverless/hello_serverless/hello_serverless_stack.py | darko-mesaros/workshop-serverless-with-cdk | bbfd30de43d01251565c019a8ac259706bd6f1d0 | [
"MIT"
] | 2 | 2020-08-12T09:54:53.000Z | 2020-08-12T13:37:22.000Z | working_example/python/hello_serverless/hello_serverless/hello_serverless_stack.py | darko-mesaros/workshop-serverless-with-cdk | bbfd30de43d01251565c019a8ac259706bd6f1d0 | [
"MIT"
] | 17 | 2020-08-12T08:09:46.000Z | 2021-07-18T19:52:50.000Z | from aws_cdk import (
aws_lambda as _lambda,
aws_apigateway as apigw,
aws_dynamodb as dynamodb,
core
)
class HelloServerlessStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, prod: bool, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
... | 36.986842 | 100 | 0.566702 |
2f6d6395b4f58fd85e8d0c680c7895d49a4fa92e | 13,305 | py | Python | keras_retinanet/bin/train_com.py | FMsunyh/keras-retinanet | cb86a987237d3f6bd504004e2b186cf65606c890 | [
"Apache-2.0"
] | null | null | null | keras_retinanet/bin/train_com.py | FMsunyh/keras-retinanet | cb86a987237d3f6bd504004e2b186cf65606c890 | [
"Apache-2.0"
] | null | null | null | keras_retinanet/bin/train_com.py | FMsunyh/keras-retinanet | cb86a987237d3f6bd504004e2b186cf65606c890 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicabl... | 39.954955 | 187 | 0.672905 |
0d9d187a5c96b509aed8671ca1f4460cfbe61cff | 2,108 | py | Python | nylon/supplementaries/main.py | caiogasparine/nylon | af3413932216a3ca76afaff7820d9211b7f3b7ef | [
"MIT"
] | 1 | 2022-01-27T05:33:27.000Z | 2022-01-27T05:33:27.000Z | nylon/supplementaries/main.py | caiogasparine/nylon | af3413932216a3ca76afaff7820d9211b7f3b7ef | [
"MIT"
] | null | null | null | nylon/supplementaries/main.py | caiogasparine/nylon | af3413932216a3ca76afaff7820d9211b7f3b7ef | [
"MIT"
] | null | null | null | from nylon.data.reader import DataReader
import json
from sklearn.metrics import accuracy_score
from sklearn.linear_model import LinearRegression
from sklearn.impute import SimpleImputer
import shutil
import sys
from sklearn.model_selection import cross_val_score
from sklearn.preprocessing import (OneHotEncoder,
... | 31.939394 | 98 | 0.665085 |
0b77d8e3c4af70b67f4316de05be04db80e3a162 | 884 | py | Python | NeuroDash/scripts/app.py | brainhack-school2020/maellef_IDK_project | ac2aec66b7c6ec557716269ab9aaab97905b694c | [
"MIT"
] | null | null | null | NeuroDash/scripts/app.py | brainhack-school2020/maellef_IDK_project | ac2aec66b7c6ec557716269ab9aaab97905b694c | [
"MIT"
] | 2 | 2020-05-20T20:05:39.000Z | 2020-05-26T19:52:58.000Z | NeuroDash/scripts/app.py | brainhack-school2020/maellef_IDK_project | ac2aec66b7c6ec557716269ab9aaab97905b694c | [
"MIT"
] | null | null | null | import dash
import dash_html_components as html
import os
import bids_reader as br
import dash_utils as du
def show_bids_layout(input_value):
if not os.path.lexists(input_value):
return 'this path isn\'t correct. Please enter a real path.'
return '{}'.format(br.read_layout_from_dataset(input_valu... | 25.257143 | 70 | 0.687783 |
b7815e2751a39aa2ce678f9f73ead3112221bacb | 774 | py | Python | examples/neural.py | HelloChatterbox/simple_NER | 678f0003030c9158583122e8b818a3b4e4ba3ea1 | [
"MIT"
] | 25 | 2019-12-26T14:10:47.000Z | 2022-03-16T02:17:16.000Z | examples/neural.py | HelloChatterbox/simple_NER | 678f0003030c9158583122e8b818a3b4e4ba3ea1 | [
"MIT"
] | null | null | null | examples/neural.py | HelloChatterbox/simple_NER | 678f0003030c9158583122e8b818a3b4e4ba3ea1 | [
"MIT"
] | 5 | 2020-08-16T16:38:09.000Z | 2022-03-21T16:59:16.000Z | from simple_NER.rules.neural import NeuralNER
ner = NeuralNER()
ner.add_rule("name", "my name is {person}")
for ent in ner.extract_entities("the name is jarbas"):
assert ent.as_json()["value"] == 'jarbas'
for ent in ner.extract_entities("name is kevin"):
# {'confidence': 0.8363423970007801,
# ... | 40.736842 | 81 | 0.431525 |
6b1e2cddb53f6078fbe564d7ef4c9254656af189 | 418 | py | Python | 01_Natural_Language_Processing/cha01/show_spiral_dataset.py | ROY-SNN/NLP_GOGO | 89e6f98335c0b160c275f8a3752639727fc7439a | [
"Apache-2.0"
] | 2 | 2021-05-23T09:35:07.000Z | 2021-12-27T05:16:52.000Z | 01_Natural_Language_Processing/cha01/show_spiral_dataset.py | ROY-SNN/NLP_GOGO | 89e6f98335c0b160c275f8a3752639727fc7439a | [
"Apache-2.0"
] | null | null | null | 01_Natural_Language_Processing/cha01/show_spiral_dataset.py | ROY-SNN/NLP_GOGO | 89e6f98335c0b160c275f8a3752639727fc7439a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import sys
sys.path.append('..') # 为了引入父目录的文件而进行的设定
from Natural_Language_Processing.dataset import spiral
import matplotlib.pyplot as plt
x, t = spiral.load_data()
print('x', x.shape) # (300, 2)
print('t', t.shape) # (300, 3)
# 绘制数据点
N = 100
CLS_NUM = 3
markers = ['o', 'x', '^']
for i in range(CL... | 22 | 78 | 0.636364 |
fa9676138276feb6126ca746f385cc233d16d6f5 | 773 | py | Python | source/pkgsrc/editors/medit/patches/patch-tools_xml2h.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/editors/medit/patches/patch-tools_xml2h.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/editors/medit/patches/patch-tools_xml2h.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-tools_xml2h.py,v 1.1 2021/04/11 00:58:16 tsutsui Exp $
- mechanical python3 support
--- tools/xml2h.py.orig 2012-12-16 23:55:32.000000000 +0000
+++ tools/xml2h.py
@@ -11,13 +11,13 @@ tmp_output = output + '.tmp'
varname = sys.argv[3]
outfile = open(tmp_output, 'w')
-print >> outfile, '/* -*- C -*- ... | 30.92 | 69 | 0.558862 |
8e2ce3426dfcaf0925aefdffb9e41b1725a04c54 | 8,514 | py | Python | packages/python/plotly/plotly/tests/test_core/test_figure_messages/test_on_change.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | packages/python/plotly/plotly/tests/test_core/test_figure_messages/test_on_change.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | packages/python/plotly/plotly/tests/test_core/test_figure_messages/test_on_change.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import sys
from unittest import TestCase
import pytest
import plotly.graph_objs as go
if sys.version_info >= (3, 3):
from unittest.mock import MagicMock
else:
from mock import MagicMock
class TestOnChangeCallbacks(TestCase):
def setUp(self):
# Construct initial scatter object
self.figure... | 37.672566 | 87 | 0.624501 |
86a56b73d47c23a31cf48c2b59563c094d1eb902 | 1,097 | py | Python | classes/marker_class.py | tum-phoenix/drive_ros_marker_detection | 63ca42b87499d530ab91a0ee812e55faa47ffb14 | [
"BSD-3-Clause"
] | null | null | null | classes/marker_class.py | tum-phoenix/drive_ros_marker_detection | 63ca42b87499d530ab91a0ee812e55faa47ffb14 | [
"BSD-3-Clause"
] | 1 | 2018-11-29T14:21:36.000Z | 2018-11-29T14:21:36.000Z | classes/marker_class.py | tum-phoenix/drive_ros_marker_detection | 63ca42b87499d530ab91a0ee812e55faa47ffb14 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# mapping: id (as int) to sign description (string)
import pickle
# all carolo cup signs currently in use
marker_name_dict = {
0: '10_speed_limit',
1: '20_speed_limit',
2: '30_speed_limit',
3: '40_speed_limit',
4: '50_speed_limit',
5: '60_speed_li... | 28.868421 | 51 | 0.58979 |
b25d3d4097ea668ca229cf25cfcdac1207e5eca9 | 1,912 | py | Python | src/polydev/github/zest_hooks.py | Polyconseil/polydev-github | db2c49a8347bc7e3049fe234086676179dfc55b4 | [
"BSD-3-Clause"
] | null | null | null | src/polydev/github/zest_hooks.py | Polyconseil/polydev-github | db2c49a8347bc7e3049fe234086676179dfc55b4 | [
"BSD-3-Clause"
] | null | null | null | src/polydev/github/zest_hooks.py | Polyconseil/polydev-github | db2c49a8347bc7e3049fe234086676179dfc55b4 | [
"BSD-3-Clause"
] | null | null | null | import re
import subprocess
import github_release
def format_changelog(data):
lines = data['history_last_release'].splitlines()
last_line = data['history_insert_line_here']
lines = ['## Changelog'] + lines[2:last_line]
return '\n'.join(lines)
def get_github_repositories():
remotes = subprocess.... | 28.969697 | 89 | 0.562762 |
d631725e320080cb2cfa8d4df3b68390768ef92f | 2,044 | py | Python | python/001_Two_Sum.py | xiyuansun/leetcode | a65a536017f9583b2479c90634bf140a36f70727 | [
"MIT"
] | null | null | null | python/001_Two_Sum.py | xiyuansun/leetcode | a65a536017f9583b2479c90634bf140a36f70727 | [
"MIT"
] | null | null | null | python/001_Two_Sum.py | xiyuansun/leetcode | a65a536017f9583b2479c90634bf140a36f70727 | [
"MIT"
] | null | null | null | class Solution(object):
# def twoSum(self, nums, target):
# """
# :type nums: List[int]
# :type target: int
# :rtype: List[int]
# """
# #n^2
# ls = len(nums)
# for i in range(ls):
# for j in range(i + 1, ls):
# if nums[i] + ... | 29.2 | 74 | 0.419276 |
c25e6cede5d999193f57d9ad15a1cdad066042c1 | 2,942 | py | Python | leetcode/network_delay_time.py | zhangao0086/Python-Algorithm | 981c875b2e0f30619bd3d44e1f2bd0c47d1464a2 | [
"MIT"
] | 3 | 2021-05-21T12:55:14.000Z | 2022-02-01T16:21:30.000Z | leetcode/network_delay_time.py | zhangao0086/Python-Algorithm | 981c875b2e0f30619bd3d44e1f2bd0c47d1464a2 | [
"MIT"
] | null | null | null | leetcode/network_delay_time.py | zhangao0086/Python-Algorithm | 981c875b2e0f30619bd3d44e1f2bd0c47d1464a2 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*-coding:utf-8-*-
__author__ = "Bannings"
import collections, heapq
from typing import List
class Solution:
def networkDelayTime(self, times: List[List[int]], N: int, K: int) -> int:
queue, graph, dt = [(0, K)], collections.defaultdict(list), {}
for u, v, w in times:
... | 31.978261 | 81 | 0.459551 |
7009dc662e1860f414e7a311daabca07e82e945f | 2,885 | py | Python | SplitPDF.py | sambbhavgarg/SplitPDF | bf850d322db815491491e6f784fc588f6925aca2 | [
"MIT"
] | null | null | null | SplitPDF.py | sambbhavgarg/SplitPDF | bf850d322db815491491e6f784fc588f6925aca2 | [
"MIT"
] | null | null | null | SplitPDF.py | sambbhavgarg/SplitPDF | bf850d322db815491491e6f784fc588f6925aca2 | [
"MIT"
] | null | null | null | from PyPDF2 import PdfFileWriter, PdfFileReader
import pandas as pd
import os
class SplitPDF:
def __init__(self, config):
#path to excel data file
self.excel_file_path = os.path.join(config['data_dir'], config['excel_data_file_name'])
#path to all certificates file created from Ma... | 47.295082 | 140 | 0.611438 |
b8a7b35603cb78071bdbe4ebe09c1c213091c4da | 1,790 | py | Python | scripts/artifacts/healthDistance.py | mastenp/iLEAPP | ee40ef7505b36d0b9b04131f284a9d4d036514a5 | [
"MIT"
] | 1 | 2020-10-06T20:28:03.000Z | 2020-10-06T20:28:03.000Z | scripts/artifacts/healthDistance.py | mastenp/iLEAPP | ee40ef7505b36d0b9b04131f284a9d4d036514a5 | [
"MIT"
] | null | null | null | scripts/artifacts/healthDistance.py | mastenp/iLEAPP | ee40ef7505b36d0b9b04131f284a9d4d036514a5 | [
"MIT"
] | null | null | null | import glob
import os
import pathlib
import plistlib
import sqlite3
import json
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows
def get_healthDistance(files_found, report_folder, seeker):
file_found = str(files_found[0])
db = sqlite3... | 29.833333 | 125 | 0.730168 |
617b1aed8f9ede10a27d4f14e2db17ce46e92bf7 | 4,623 | py | Python | Augmentor/Augmentor_phase1.py | AsherYartsevTech/Mask_RCNN | 7e267c73b6eecc5b3c13392c434dbfca1a68ac34 | [
"MIT"
] | 1 | 2019-01-07T17:48:13.000Z | 2019-01-07T17:48:13.000Z | Augmentor/Augmentor_phase1.py | AsherYartsevTech/Mask_RCNN | 7e267c73b6eecc5b3c13392c434dbfca1a68ac34 | [
"MIT"
] | 24 | 2018-12-05T09:51:06.000Z | 2019-03-10T18:49:33.000Z | Augmentor/Augmentor_phase1.py | AsherYartsevTech/Mask_RCNN | 7e267c73b6eecc5b3c13392c434dbfca1a68ac34 | [
"MIT"
] | null | null | null | import numpy
from PIL import Image, ImageDraw
from pycocotools.coco import COCO
import os.path
import json
# dataDir = '/Users/orshemesh/Desktop/Project/augmented_leaves/origin/'
# annFile = dataDir + 'leaves.json'
# output_dir = dataDir + 'output_phase1/'
def create_categories_map(annFile):
with open(annFile) as... | 38.848739 | 131 | 0.600476 |
e6133811f0f8edb0d7ae8aae3b0a15a4447e5d74 | 6,141 | py | Python | src/cogent3/align/dp_calculation.py | jamesmartini/cogent3 | 5d0aab1871561aa3d4cd6b629be6cc7a23f15c49 | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/align/dp_calculation.py | jamesmartini/cogent3 | 5d0aab1871561aa3d4cd6b629be6cc7a23f15c49 | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/align/dp_calculation.py | jamesmartini/cogent3 | 5d0aab1871561aa3d4cd6b629be6cc7a23f15c49 | [
"BSD-3-Clause"
] | null | null | null | from cogent3.align import indel_model, pairwise
from cogent3.maths.markov import SiteClassTransitionMatrix
from cogent3.recalculation.definition import (
CalcDefn,
CalculationDefn,
NonParamDefn,
PartitionDefn,
ProbabilityParamDefn,
)
__author__ = "Gavin Huttley and Peter Maxwell"
__copyright__ = "... | 30.40099 | 76 | 0.657222 |
594189ee7806cb600de0ca3f91a067be6b83729d | 1,257 | py | Python | invenio_app_ils/records/loaders/schemas/changed_by.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 41 | 2018-09-04T13:00:46.000Z | 2022-03-24T20:45:56.000Z | invenio_app_ils/records/loaders/schemas/changed_by.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 720 | 2017-03-10T08:02:41.000Z | 2022-01-14T15:36:37.000Z | invenio_app_ils/records/loaders/schemas/changed_by.py | NRodriguezcuellar/invenio-app-ils | 144a25a6c56330b214c6fd0b832220fa71f2e68a | [
"MIT"
] | 54 | 2017-03-09T16:05:29.000Z | 2022-03-17T08:34:51.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""ChangedBy schema for marshmallow loader."""
from flask import has_request_context
from flask_login import curr... | 26.744681 | 76 | 0.683373 |
ec676d475342bac95532015233470777bd59873c | 398 | py | Python | 2019/04/program.py | Zargath/AdventOfCode | 863d2e05d3571d0a60f802f32a0faeeaef04e9af | [
"MIT"
] | null | null | null | 2019/04/program.py | Zargath/AdventOfCode | 863d2e05d3571d0a60f802f32a0faeeaef04e9af | [
"MIT"
] | null | null | null | 2019/04/program.py | Zargath/AdventOfCode | 863d2e05d3571d0a60f802f32a0faeeaef04e9af | [
"MIT"
] | null | null | null | limits = (147981, 691423)
#limits = (100, 120)
pwds = []
for pwd in range(*limits):
hasPair = False
isInc = True
spwd = str(pwd)
for i, d in enumerate(spwd):
if i + 1 < len(spwd):
if spwd[i + 1] == spwd[i]:
hasPair = True
if int(spwd[i + 1]) < int(spwd[i]):
isInc = ... | 20.947368 | 42 | 0.527638 |
ad07a8549a76d2dbff1249c28752ee09e73de7c2 | 3,626 | py | Python | commonlibs/math_tools/IOU.py | floatingstarZ/loc_cls_exp | 8b971db671753d3571914aaa760cc13ac47018e8 | [
"Apache-2.0"
] | null | null | null | commonlibs/math_tools/IOU.py | floatingstarZ/loc_cls_exp | 8b971db671753d3571914aaa760cc13ac47018e8 | [
"Apache-2.0"
] | null | null | null | commonlibs/math_tools/IOU.py | floatingstarZ/loc_cls_exp | 8b971db671753d3571914aaa760cc13ac47018e8 | [
"Apache-2.0"
] | null | null | null | import torch
def singleIOU(gt, bboxes):
"""
:param gt: left top right down
:param bboxes: N * 4
:return:
"""
[x1, y1, x2, y2] = gt
inter_lt = (gt[0].max(bboxes[:, 0]), gt[1].max(bboxes[:, 1]))
inter_rd = (gt[2].min(bboxes[:, 2]), gt[3].min(bboxes[:, 3]))
z = torch.Tensor([0.0]... | 26.859259 | 79 | 0.488969 |
d35a681e3717e8bb5e70b8f8d6876277ca2015be | 678 | py | Python | codigo/Live184/ajuda.py | BrunoPontesLira/live-de-python | da6e463a89ed90d9efaa1c34088ab6460e949de1 | [
"MIT"
] | 2 | 2017-06-05T23:32:00.000Z | 2017-06-08T01:01:35.000Z | codigo/Live184/ajuda.py | BrunoPontesLira/live-de-python | da6e463a89ed90d9efaa1c34088ab6460e949de1 | [
"MIT"
] | null | null | null | codigo/Live184/ajuda.py | BrunoPontesLira/live-de-python | da6e463a89ed90d9efaa1c34088ab6460e949de1 | [
"MIT"
] | null | null | null | from rich.console import Console
console = Console()
console.print("\npra rodar comandos: [bold]make alvo[/bold]")
with open("./Makefile", "r") as file:
for line in file.readlines():
if line.find("##") >= 0:
if line.find("@") >= 0:
to_print = line.split("@")[-1].strip().capital... | 37.666667 | 73 | 0.514749 |
ebe7308a7589fe600641317f73be652b6fa9d3db | 671 | py | Python | src/arg_pools/ssp_finetuning_imbalanced_cifar10_imb_0_01.py | zeyademam/active_learning | fc90eaed32ba5aeb88542fa4f6e8fa9d4fdd80ee | [
"MIT"
] | 41 | 2021-11-25T02:58:56.000Z | 2022-03-21T02:44:58.000Z | src/arg_pools/ssp_finetuning_imbalanced_cifar10_imb_0_01.py | zeyademam/active_learning | fc90eaed32ba5aeb88542fa4f6e8fa9d4fdd80ee | [
"MIT"
] | 1 | 2021-12-01T07:46:44.000Z | 2021-12-08T02:07:10.000Z | src/arg_pools/ssp_finetuning_imbalanced_cifar10_imb_0_01.py | zeyademam/active_learning | fc90eaed32ba5aeb88542fa4f6e8fa9d4fdd80ee | [
"MIT"
] | 2 | 2021-11-29T06:09:56.000Z | 2021-12-12T10:35:58.000Z | import os
dirname = os.path.dirname
args_pool = {
"imbalanced_cifar10": {
"eval_split": 0.1,
"loader_tr_args": {"batch_size": 128, "num_workers": 2},
"loader_te_args": {"batch_size": 100, "num_workers": 2},
"optimizer": "SGD",
"optimizer_args": {"lr": 0.002, "weight_decay": ... | 31.952381 | 94 | 0.593145 |
28d72b343274d84329834121e804cf171e40bdcf | 1,761 | py | Python | app.py | Chenhuping/flask-restful-example | 8ddbca623e80684ea7fd9fce851b2c9251601dcc | [
"MIT"
] | 1 | 2019-06-27T01:03:38.000Z | 2019-06-27T01:03:38.000Z | app.py | Chenhuping/flask-restful-example | 8ddbca623e80684ea7fd9fce851b2c9251601dcc | [
"MIT"
] | null | null | null | app.py | Chenhuping/flask-restful-example | 8ddbca623e80684ea7fd9fce851b2c9251601dcc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import string
import flask_restful
from flask import Flask, abort, jsonify
from hashids import Hashids
from models import db
from common import Code, pretty_result
app = Flask(__name__)
hash_ids = Hashids(salt='hvwptlmj129d5quf', min_length=8, alphabet=string.ascii_lowercase + string.digits)
... | 27.952381 | 106 | 0.69222 |
01602f6207598871f8f56ba7059ca42759f3a103 | 3,279 | py | Python | postProcessor.py | QuMuLab/temporal-nl-to-pddl | 61899bac8608baa719687adbbf0a9928fc06a106 | [
"MIT"
] | null | null | null | postProcessor.py | QuMuLab/temporal-nl-to-pddl | 61899bac8608baa719687adbbf0a9928fc06a106 | [
"MIT"
] | null | null | null | postProcessor.py | QuMuLab/temporal-nl-to-pddl | 61899bac8608baa719687adbbf0a9928fc06a106 | [
"MIT"
] | null | null | null | # This class provides methods to process the output of the LLM before it is returned to the user.
class PostProcessor:
# takes a PDDL condition or effect statement and makes it into a string that can be converted to
# a list using the 'eval' function
def listify(result):
result = "['" + result + "'... | 39.506024 | 100 | 0.534614 |
374b7123b4cf00fa24766050084ef175aeadf06c | 6,164 | py | Python | var/spack/repos/builtin/packages/py-pillow/package.py | mtmiller/spack | c97c135f1dbe24955048fcc4f0f98281ef0c9300 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-10-04T20:05:45.000Z | 2021-10-04T20:05:45.000Z | var/spack/repos/builtin/packages/py-pillow/package.py | mtmiller/spack | c97c135f1dbe24955048fcc4f0f98281ef0c9300 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2021-05-12T05:53:01.000Z | 2022-03-18T17:30:25.000Z | var/spack/repos/builtin/packages/py-pillow/package.py | mtmiller/spack | c97c135f1dbe24955048fcc4f0f98281ef0c9300 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 7 | 2018-09-13T18:04:56.000Z | 2020-03-18T20:52:06.000Z | # Copyright 2013-2021 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)
class PyPillowBase(PythonPackage):
"""Base class for Pillow and its fork Pillow-SIMD."""
maintainers = ['adamjste... | 48.15625 | 95 | 0.655419 |
3593e7a5f7f3830e4b786b7f4775df1e5c2a79c2 | 1,232 | py | Python | consoletests.py | theflyingfire/random_python_scripts | 6eaf902c983cfdbd50f5c61b3d8a89bb789c9c26 | [
"MIT"
] | null | null | null | consoletests.py | theflyingfire/random_python_scripts | 6eaf902c983cfdbd50f5c61b3d8a89bb789c9c26 | [
"MIT"
] | null | null | null | consoletests.py | theflyingfire/random_python_scripts | 6eaf902c983cfdbd50f5c61b3d8a89bb789c9c26 | [
"MIT"
] | null | null | null | #print("hello", end="")
#print("\b\b\b\b\b\btest")
import time
sleep_time = 0.05
print("loading... ", end="")
def print_processing_indicator(num):
for i in range(num):
print("\b\\", end="")
#time.sleep(sleep_time)
print("\b|", end="")
#time.sleep(sleep_time)
pr... | 25.142857 | 162 | 0.491071 |
aaa94d58ef441f09bf64a392dc25f64fac8c4134 | 3,024 | py | Python | pretend.py | di/pretend | 614a3d5ee6320d319d57193ae585d8a72d1ae315 | [
"BSD-3-Clause"
] | 2 | 2016-08-24T22:20:20.000Z | 2022-01-24T12:15:43.000Z | pretend.py | di/pretend | 614a3d5ee6320d319d57193ae585d8a72d1ae315 | [
"BSD-3-Clause"
] | null | null | null | pretend.py | di/pretend | 614a3d5ee6320d319d57193ae585d8a72d1ae315 | [
"BSD-3-Clause"
] | null | null | null | import functools
import sys
PY3K = sys.version_info >= (3,)
methods = set([
"__iter__",
"__len__",
"__contains__",
"__getitem__",
"__setitem__",
"__delitem__",
"__enter__",
"__exit__",
"__lt__",
"__le__",
"__eq__",
"__ne__",
"__gt__",
"__ge__",
"__add__... | 22.736842 | 77 | 0.570437 |
3396d4fe6cee8cda4077cb07fa66505e0178bc41 | 2,612 | py | Python | 6_binary_search_tree.py | inidal/break | 225b12db51b06b4b5e8314f6016ba8824e7faa01 | [
"MIT"
] | null | null | null | 6_binary_search_tree.py | inidal/break | 225b12db51b06b4b5e8314f6016ba8824e7faa01 | [
"MIT"
] | null | null | null | 6_binary_search_tree.py | inidal/break | 225b12db51b06b4b5e8314f6016ba8824e7faa01 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, value):
self.left = None
self.right = None
self.value = value
class BinarySearchTree:
def __init__(self):
self.root = None
def insert(self, value):
# If tree is empty
if self.root is None:
new_node = Node(value)
... | 28.703297 | 103 | 0.437213 |
6ba170a327e54572409cc3c0cca9d2d1516a6166 | 1,509 | py | Python | libraries/botbuilder-azure/setup.py | PrettyWood/botbuilder-python | ab79f6b60066b05a00f729d6cb1d8bee30a786e2 | [
"MIT"
] | null | null | null | libraries/botbuilder-azure/setup.py | PrettyWood/botbuilder-python | ab79f6b60066b05a00f729d6cb1d8bee30a786e2 | [
"MIT"
] | null | null | null | libraries/botbuilder-azure/setup.py | PrettyWood/botbuilder-python | ab79f6b60066b05a00f729d6cb1d8bee30a786e2 | [
"MIT"
] | 1 | 2022-02-24T10:23:28.000Z | 2022-02-24T10:23:28.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
from setuptools import setup
REQUIRES = [
"azure-cosmos==3.2.0",
"azure-storage-blob==2.1.0",
"botbuilder-schema==4.11.0",
"botframework-connector==4.11.2",
"jsonpickle",
]
TEST_REQUIRES = ["aio... | 31.4375 | 86 | 0.671306 |
a2d63b0105e5662fd8f9e2cc2b23b450966c468d | 11,856 | py | Python | scripts/FPS2ARB.py | Ecotrust/ARBcarbon | 110f0d009fa6bb57d3667ebe6d414adbed2e87ab | [
"BSD-3-Clause"
] | 5 | 2020-02-28T12:58:26.000Z | 2021-09-15T06:15:34.000Z | scripts/FPS2ARB.py | Ecotrust/ARBcarbon | 110f0d009fa6bb57d3667ebe6d414adbed2e87ab | [
"BSD-3-Clause"
] | 24 | 2016-05-13T17:55:22.000Z | 2021-11-09T15:18:56.000Z | scripts/FPS2ARB.py | Ecotrust/ARBcarbon | 110f0d009fa6bb57d3667ebe6d414adbed2e87ab | [
"BSD-3-Clause"
] | 4 | 2016-09-08T21:10:15.000Z | 2020-02-28T12:58:30.000Z | """
FPS2ARB.
FPS-to-ARB Carbon Calculation.
Takes two CSV files in current working directory that were exported from FPS
(Forest Planning and Projection System) database containing forest inventory
data, calculates carbon storage for each tree, and documents the calculation
parameters and writes outputs to a new ... | 49.606695 | 185 | 0.70555 |
8bac06e0e9a31fbf3d73ca7b63c6a5687ad2c9a3 | 133 | py | Python | examples/multiple_dirs.py | pushkarkadam/autodirs | 0ca5d7fcac6390c19c122e347ffa235b5e9cdb78 | [
"MIT"
] | null | null | null | examples/multiple_dirs.py | pushkarkadam/autodirs | 0ca5d7fcac6390c19c122e347ffa235b5e9cdb78 | [
"MIT"
] | null | null | null | examples/multiple_dirs.py | pushkarkadam/autodirs | 0ca5d7fcac6390c19c122e347ffa235b5e9cdb78 | [
"MIT"
] | null | null | null | import sys
sys.path.append('../')
from autodirs import directories as di
di.group_by_text_files("text_files", path="sub/hogwarts")
| 19 | 57 | 0.759398 |
a44842a4f0d0203b5fdf19a898c5ebeb2d0b1d11 | 1,841 | py | Python | iper/urls.py | edumorris/iper | c3dbb4127529e0b4f82a16c845ba3bc9b6646a35 | [
"MIT"
] | null | null | null | iper/urls.py | edumorris/iper | c3dbb4127529e0b4f82a16c845ba3bc9b6646a35 | [
"MIT"
] | null | null | null | iper/urls.py | edumorris/iper | c3dbb4127529e0b4f82a16c845ba3bc9b6646a35 | [
"MIT"
] | null | null | null | """iper URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... | 42.813953 | 94 | 0.726779 |
03328a3ee79d9d1cb28a74be8146fb39da4b945d | 1,587 | py | Python | interview_challenges/landg/censor_serial.py | noelevans/playground | da529e967a15bcb217fff091ac0ec5c4dc1821ce | [
"MIT"
] | 1 | 2015-04-28T20:36:57.000Z | 2015-04-28T20:36:57.000Z | interview_challenges/landg/censor_serial.py | noelevans/playground | da529e967a15bcb217fff091ac0ec5c4dc1821ce | [
"MIT"
] | 2 | 2021-02-03T21:05:54.000Z | 2021-03-23T09:25:43.000Z | interview_challenges/landg/censor_serial.py | noelevans/playground | da529e967a15bcb217fff091ac0ec5c4dc1821ce | [
"MIT"
] | null | null | null | import argparse
import io
from typing import Iterator, TextIO
"""Censor a document of words passed in a separate text file.
Pass a file path for words to be removed and a second path which
is to be censored.
Usage:
python censor.py banned_words.txt prose.txt
"""
def censor_line(banned_words: {str}, line: str) ... | 28.339286 | 82 | 0.650914 |
5df5e6d8838261350d301d370571c136bc697d38 | 2,061 | py | Python | tools/shaders-gen.py | andoma/rainbow | ed1e70033217450457e52b90276e41a746d5086a | [
"MIT"
] | null | null | null | tools/shaders-gen.py | andoma/rainbow | ed1e70033217450457e52b90276e41a746d5086a | [
"MIT"
] | null | null | null | tools/shaders-gen.py | andoma/rainbow | ed1e70033217450457e52b90276e41a746d5086a | [
"MIT"
] | 1 | 2018-09-20T19:34:36.000Z | 2018-09-20T19:34:36.000Z | #!/usr/bin/python
# Copyright (c) 2010-present Bifrost Entertainment AS and Tommy Nguyen
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)
from datetime import date
import os
import re
import sys
shaders_dir = os.path.join(sys.path[0], "..", "src", "G... | 36.803571 | 108 | 0.518195 |
634eba1cbbec299e8ecb7785377c6bedf03bf674 | 27,054 | py | Python | magenta/models/score2perf/datagen_beam.py | Ali-Tahir/magenta | f2e6c55a841e7b60462606dced553f335771df1f | [
"Apache-2.0"
] | null | null | null | magenta/models/score2perf/datagen_beam.py | Ali-Tahir/magenta | f2e6c55a841e7b60462606dced553f335771df1f | [
"Apache-2.0"
] | null | null | null | magenta/models/score2perf/datagen_beam.py | Ali-Tahir/magenta | f2e6c55a841e7b60462606dced553f335771df1f | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Magenta 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 applicable law or agreed to in ... | 43.011129 | 80 | 0.689843 |
b72abe75e3722a3483ad2f4e12d86cf8fd2a32d6 | 4,090 | py | Python | main.py | TaigaOsguthorpe/PySide2-Multiple-Windows | 2d2574288f290f50fcf7f908103ebe1d525395c9 | [
"CC0-1.0"
] | null | null | null | main.py | TaigaOsguthorpe/PySide2-Multiple-Windows | 2d2574288f290f50fcf7f908103ebe1d525395c9 | [
"CC0-1.0"
] | null | null | null | main.py | TaigaOsguthorpe/PySide2-Multiple-Windows | 2d2574288f290f50fcf7f908103ebe1d525395c9 | [
"CC0-1.0"
] | null | null | null | import sys
from PySide2.QtWidgets import QApplication, QMainWindow
from PySide2.QtCore import QFile
from PySide2 import QtCore
from PySide2.QtGui import QPixmap
from ui_files.main_gui import Ui_MainWindow
from ui_files.image_window_gui import Ui_MainWindow as Ui_ImageWindow
from pathlib import Path
class MainWindow(Q... | 36.19469 | 156 | 0.647433 |
09ef6f7a073082dc8065ba5663bc548a90966222 | 3,659 | py | Python | modules/rnn.py | JZX555/FineGrainedDomainAdaption | 3873a7af9475d4fd3c1cc3c676ad3153fc3ce698 | [
"Apache-2.0"
] | null | null | null | modules/rnn.py | JZX555/FineGrainedDomainAdaption | 3873a7af9475d4fd3c1cc3c676ad3153fc3ce698 | [
"Apache-2.0"
] | 2 | 2021-11-12T08:01:06.000Z | 2021-11-13T08:18:18.000Z | modules/rnn.py | JZX555/FineGrainedDomainAdaption | 3873a7af9475d4fd3c1cc3c676ad3153fc3ce698 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from utils import init, nest
def sort_batch(seq_len):
"""Sorts torch tensor of integer indices by decreasing order."""
with torch.no_grad():
slens, sidxs = torch.sort(seq_len, descending=True)
... | 31.543103 | 77 | 0.565455 |
99a2df053f6f4b192d7d85ef7b8b59046e3c19ea | 1,023 | py | Python | tests/kubernetes/checks/test_ApiServerAuditLog.py | kylelaker/checkov | 6eada26030a87f397a6bf1831827b3dc6c5dad2d | [
"Apache-2.0"
] | 5 | 2021-07-29T18:08:40.000Z | 2022-03-21T04:39:32.000Z | tests/kubernetes/checks/test_ApiServerAuditLog.py | kylelaker/checkov | 6eada26030a87f397a6bf1831827b3dc6c5dad2d | [
"Apache-2.0"
] | 16 | 2021-03-09T07:38:38.000Z | 2021-06-09T03:53:55.000Z | tests/kubernetes/checks/test_ApiServerAuditLog.py | kylelaker/checkov | 6eada26030a87f397a6bf1831827b3dc6c5dad2d | [
"Apache-2.0"
] | 2 | 2021-08-23T13:25:36.000Z | 2021-11-05T21:44:52.000Z | import os
import unittest
from checkov.kubernetes.checks.ApiServerAuditLog import check
from checkov.kubernetes.runner import Runner
from checkov.runner_filter import RunnerFilter
class TestApiServerProfiling(unittest.TestCase):
def test_summary(self):
runner = Runner()
current_dir = os.path.dir... | 31.96875 | 101 | 0.7087 |
9014e9069133afbc4d79b03f3ee353b50458535e | 7,599 | py | Python | bokeh/charts/utils.py | timelyportfolio/bokeh | a976a85535cf137c6238ce9e90b41ab14ae8ce22 | [
"BSD-3-Clause"
] | 1 | 2021-11-07T18:55:59.000Z | 2021-11-07T18:55:59.000Z | bokeh/charts/utils.py | timelyportfolio/bokeh | a976a85535cf137c6238ce9e90b41ab14ae8ce22 | [
"BSD-3-Clause"
] | null | null | null | bokeh/charts/utils.py | timelyportfolio/bokeh | a976a85535cf137c6238ce9e90b41ab14ae8ce22 | [
"BSD-3-Clause"
] | 1 | 2021-08-01T08:38:53.000Z | 2021-08-01T08:38:53.000Z | """ This is the utils module that collects convenience functions and code that are
useful for charts ecosystem.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# Th... | 33.475771 | 87 | 0.588893 |
4efe4cfd75bb872c29f4bdaf5748efa9414f11a9 | 1,996 | py | Python | storage/models.py | bopopescu/storyboard | 0258fd6f80b6bbd9d0ca493cbaaae87c3a6d16e2 | [
"MIT"
] | null | null | null | storage/models.py | bopopescu/storyboard | 0258fd6f80b6bbd9d0ca493cbaaae87c3a6d16e2 | [
"MIT"
] | null | null | null | storage/models.py | bopopescu/storyboard | 0258fd6f80b6bbd9d0ca493cbaaae87c3a6d16e2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
models.py
Created by Darcy Liu on 2012-04-02.
Copyright (c) 2012 Close To U. All rights reserved.
"""
from django.db import models
from django.contrib.auth.models import User
class Storage(models.Model):
key = models.AutoField(primary_key=True)
storage = models.Cha... | 41.583333 | 82 | 0.705411 |
58f732764c1a1fbb05be04f75f9ea606993a7cdb | 8,574 | py | Python | tools/clang/scripts/test_tool.py | mtk-watch/android_external_v8 | 29eb30806a59123b1f9faf9083a12d26fa418fad | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | tools/clang/scripts/test_tool.py | mtk-watch/android_external_v8 | 29eb30806a59123b1f9faf9083a12d26fa418fad | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | tools/clang/scripts/test_tool.py | mtk-watch/android_external_v8 | 29eb30806a59123b1f9faf9083a12d26fa418fad | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""Test harness for chromium clang tools."""
import argparse
import difflib
import glob
import json
import os
import os.path
impor... | 36.641026 | 80 | 0.630394 |
8be1268f37effd125a92af9cff1c78332fa26064 | 2,073 | py | Python | day02/4-post.py | Mhh123/spider | fe4410f9f3b4a9c0a5dac51bd93a1434aaa4f888 | [
"Apache-2.0"
] | null | null | null | day02/4-post.py | Mhh123/spider | fe4410f9f3b4a9c0a5dac51bd93a1434aaa4f888 | [
"Apache-2.0"
] | null | null | null | day02/4-post.py | Mhh123/spider | fe4410f9f3b4a9c0a5dac51bd93a1434aaa4f888 | [
"Apache-2.0"
] | null | null | null | import urllib.request
import urllib.parse
post_url = 'http://fanyi.baidu.com/v2transapi'
data = {
'from': 'en',
'to': 'zh',
'query': 'baby',
'transtype': 'realtime',
'simple_means_flag': '3',
'sign': '814534.560887',
'token': '7518ccf005e3eeba364707e08b4e1140',
}
# 处理data
... | 51.825 | 784 | 0.693681 |
16f21a5b193c8b9d79a1801505d260ca35da3824 | 5,743 | py | Python | tsut/tests/test_delete_users_and_groups.py | MishaThoughtSpot/user_tools | cf32a067af007c002fb62b5c26ee4a2afd6cccaf | [
"MIT"
] | 3 | 2020-04-28T15:43:03.000Z | 2021-01-07T23:04:28.000Z | tsut/tests/test_delete_users_and_groups.py | MishaThoughtSpot/user_tools | cf32a067af007c002fb62b5c26ee4a2afd6cccaf | [
"MIT"
] | 3 | 2019-10-21T16:03:19.000Z | 2021-01-21T01:26:40.000Z | tsut/tests/test_delete_users_and_groups.py | MishaThoughtSpot/user_tools | cf32a067af007c002fb62b5c26ee4a2afd6cccaf | [
"MIT"
] | 4 | 2019-09-30T19:49:32.000Z | 2021-04-22T18:49:17.000Z | import unittest
from tsut.api import SyncUserAndGroups
from tsut.model import UsersAndGroups, Group, User, Visibility
"""
Copyright 2018 ThoughtSpot
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Softwa... | 33.196532 | 120 | 0.591154 |
bce7dd666a020a2ae8670a108ae53836525c9298 | 275 | py | Python | instagram/users/apps.py | xodus889/instagram | 69b3daf591a6e63ee4edfeb7bacce6276868fa93 | [
"MIT"
] | 1 | 2018-10-17T18:06:10.000Z | 2018-10-17T18:06:10.000Z | instagram/users/apps.py | xodus889/instagram | 69b3daf591a6e63ee4edfeb7bacce6276868fa93 | [
"MIT"
] | null | null | null | instagram/users/apps.py | xodus889/instagram | 69b3daf591a6e63ee4edfeb7bacce6276868fa93 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'instagram.users'
verbose_name = "Users"
def ready(self):
"""Override this to put in:
Users system checks
Users signal registration
"""
pass
| 19.642857 | 37 | 0.596364 |
715e66d82c7ba44a94cff229dab27e4733b509bf | 2,276 | py | Python | homework-6-s21-malwake-git/problems.py | malwake-git/ECE20875 | 2348f638088359af962bc0d98e965c1ec0132686 | [
"Apache-2.0"
] | null | null | null | homework-6-s21-malwake-git/problems.py | malwake-git/ECE20875 | 2348f638088359af962bc0d98e965c1ec0132686 | [
"Apache-2.0"
] | null | null | null | homework-6-s21-malwake-git/problems.py | malwake-git/ECE20875 | 2348f638088359af962bc0d98e965c1ec0132686 | [
"Apache-2.0"
] | null | null | null | import re
def problem1(searchstring):
"""
Match phone numbers.
:param searchstring: string
:return: True or False
"""
str_search = re.search(r'^(\S?\d+\W?)\W?(\d+)\-(\d+)',searchstring)
#str_search1 = re.search(r'^(\S\d+\W)(?=(\s|\d)\d+)',searchstring)
#print(str_search)
... | 22.989899 | 80 | 0.568102 |
6df2a32d595f4e44dcbf8e0ec337c155e10f6e8d | 1,181 | py | Python | tests/test_imr/test_farms.py | pnsaevik/imr_farms | a92b3540d20f32475b7a85894e1bd737706a0a2c | [
"MIT"
] | null | null | null | tests/test_imr/test_farms.py | pnsaevik/imr_farms | a92b3540d20f32475b7a85894e1bd737706a0a2c | [
"MIT"
] | null | null | null | tests/test_imr/test_farms.py | pnsaevik/imr_farms | a92b3540d20f32475b7a85894e1bd737706a0a2c | [
"MIT"
] | null | null | null | import pytest
from imr.maps import farms
class Test_locations:
@pytest.fixture(scope='class')
def locations(self):
with farms.locations() as dset:
yield dset
def test_correct_name_and_location(self, locations):
a = locations.sel(record=23015)
assert a.navn.values.item(... | 34.735294 | 74 | 0.635055 |
db83255c83c8c1f9f6cc6b3c241faf71adcd4fd0 | 1,076 | py | Python | manager.py | herryben/bcc-minitor | 3b9b13550adbad2edff450c5e37e3482d8fd63f5 | [
"MIT"
] | null | null | null | manager.py | herryben/bcc-minitor | 3b9b13550adbad2edff450c5e37e3482d8fd63f5 | [
"MIT"
] | null | null | null | manager.py | herryben/bcc-minitor | 3b9b13550adbad2edff450c5e37e3482d8fd63f5 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
#-*- coding: UTF-8 -*-
import requests
import json
import re
import pickle
from common.emailhelper import MailHelper
from config import app_config
def get_yun_bi_market_info():
r = requests.get('https://yunbi.com/markets/bcccny')
s = r.text
rgx = re.compile(r'''"bcccny":{"name":"BCC... | 28.315789 | 115 | 0.658922 |
c4ed28daad61fb66ea36937b9317e1701e7aeacf | 2,136 | py | Python | examples/slicer_with_1_plus_2_views.py | rafmudaf/dash-slicer | e959f1ea94f3bb1d061acd3f18727227a08144ed | [
"MIT"
] | 18 | 2020-12-16T09:49:00.000Z | 2022-03-18T11:38:32.000Z | examples/slicer_with_1_plus_2_views.py | rafmudaf/dash-slicer | e959f1ea94f3bb1d061acd3f18727227a08144ed | [
"MIT"
] | 43 | 2020-11-05T13:54:34.000Z | 2022-01-14T08:45:54.000Z | examples/slicer_with_1_plus_2_views.py | rafmudaf/dash-slicer | e959f1ea94f3bb1d061acd3f18727227a08144ed | [
"MIT"
] | 3 | 2020-12-15T21:20:36.000Z | 2021-07-26T17:40:02.000Z | """
An example with two slicers at the same axis, and one on another axis.
This demonstrates how multiple indicators can be shown per axis.
Sharing the same scene_id is enough for the slicers to show each-others
position. If the same volume object would be given, it works by default,
because the default scene_id... | 28.48 | 88 | 0.595037 |
fabf3a8b721a4d13deec71303d01919ee0d079d2 | 6,575 | py | Python | pytorch_lightning/trainer/logging.py | GimmickNG/pytorch-lightning | b36c5e86d014671b0fa922d750b27420bc73b6f9 | [
"Apache-2.0"
] | 1 | 2021-03-10T20:13:50.000Z | 2021-03-10T20:13:50.000Z | pytorch_lightning/trainer/logging.py | GimmickNG/pytorch-lightning | b36c5e86d014671b0fa922d750b27420bc73b6f9 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/logging.py | GimmickNG/pytorch-lightning | b36c5e86d014671b0fa922d750b27420bc73b6f9 | [
"Apache-2.0"
] | 1 | 2020-09-11T22:53:18.000Z | 2020-09-11T22:53:18.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.891753 | 98 | 0.582662 |
646dadcfa4c4a4376475989afe66d4d884d91cf9 | 416 | py | Python | app/core/migrations/0008_auto_20200105_1716.py | Raysultan/roscosmos-stats | 8931ee824c4e4cd67ae4f86ce221515b00d9e872 | [
"MIT"
] | 5 | 2020-11-24T09:57:36.000Z | 2021-11-17T08:02:29.000Z | app/core/migrations/0008_auto_20200105_1716.py | raisultan/roscosmos-api | 8931ee824c4e4cd67ae4f86ce221515b00d9e872 | [
"MIT"
] | null | null | null | app/core/migrations/0008_auto_20200105_1716.py | raisultan/roscosmos-api | 8931ee824c4e4cd67ae4f86ce221515b00d9e872 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-01-05 17:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20200104_1358'),
]
operations = [
migrations.AlterField(
model_name='launchvehicle',
name='space_t... | 21.894737 | 72 | 0.612981 |
82ade38974e40cd46dd2f0bf2e37e99e412dd7e2 | 7,050 | py | Python | PaddleNLP/pretrain_language_models/BERT/optimization.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | 6 | 2021-06-08T13:19:35.000Z | 2021-06-24T15:08:54.000Z | legacy/pretrain_language_models/BERT/optimization.py | xihuanafeng/PaddleNLP | 14c3209118b2cadcce9a8f66b760c9cddb3a02ad | [
"Apache-2.0"
] | 1 | 2021-11-22T08:11:08.000Z | 2021-11-22T08:11:08.000Z | legacy/pretrain_language_models/BERT/optimization.py | xihuanafeng/PaddleNLP | 14c3209118b2cadcce9a8f66b760c9cddb3a02ad | [
"Apache-2.0"
] | 4 | 2021-08-23T07:46:06.000Z | 2021-09-23T08:37:03.000Z | # Copyright (c) 2019 PaddlePaddle 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 app... | 39.606742 | 106 | 0.603121 |
89e99878b1c9b7c8f91ea887ec09119b70a47a56 | 1,420 | py | Python | data/external/repositories_2to3/103259/Kaggle_The_Hunt_for_Prohibited_Content-master/Python/generate_weighted_sample.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/103259/Kaggle_The_Hunt_for_Prohibited_Content-master/Python/generate_weighted_sample.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/103259/Kaggle_The_Hunt_for_Prohibited_Content-master/Python/generate_weighted_sample.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | # -*- coding: UTF-8 -*-
"""
Python version: 2.7.6
Version: 1.0 at Sep 01 2014
Author: Chenglong Chen < yr@Kaggle >
Email: c.chenglong@gmail.com
"""
import re
import argparse
def getWeightedVWFile(vwFileTrain, vwWeightedFileTrain, posWeight, negWeight):
"""
"""
print(" Weight for positi... | 33.023256 | 79 | 0.569014 |
980a4934525325196216b42827d5c1164a6d0ba7 | 987 | py | Python | u2net_portrait-keras.py | Voinic/u2net-keras | 857b465940ef098d3abc2648d2454832065cc132 | [
"MIT"
] | 5 | 2021-02-25T19:39:07.000Z | 2021-09-14T14:46:52.000Z | u2net_portrait-keras.py | Voinic/u2net-keras | 857b465940ef098d3abc2648d2454832065cc132 | [
"MIT"
] | null | null | null | u2net_portrait-keras.py | Voinic/u2net-keras | 857b465940ef098d3abc2648d2454832065cc132 | [
"MIT"
] | null | null | null | from keras.models import load_model
import cv2
import numpy as np
import sys
input = sys.argv[1]
output = sys.argv[2]
model = './u2net_portrait_keras.h5'
# load model
u2netp_keras = load_model(model, compile=False)
# load image
image = cv2.imread(input)
# normalize input image
input = cv2.resize(image, (512, 512... | 19.74 | 73 | 0.666667 |
64ec6e59e9cd04839c4b2d75000d618984364fb9 | 1,394 | py | Python | minos/cli/api/new.py | Clariteia/minos | 49dc01dfd7972b192ce84636c11c6b9255f19d0f | [
"MIT"
] | 7 | 2022-01-29T11:51:55.000Z | 2022-03-05T12:22:11.000Z | minos/cli/api/new.py | minos-framework/minos-cli | 49dc01dfd7972b192ce84636c11c6b9255f19d0f | [
"MIT"
] | 35 | 2022-01-31T10:27:49.000Z | 2022-03-16T15:22:56.000Z | minos/cli/api/new.py | Clariteia/minos | 49dc01dfd7972b192ce84636c11c6b9255f19d0f | [
"MIT"
] | 1 | 2022-03-03T10:32:44.000Z | 2022-03-03T10:32:44.000Z | from pathlib import (
Path,
)
import typer
from ..consoles import (
console,
)
from ..pathlib import (
get_microservices_directory,
)
from ..templating import (
TemplateFetcher,
TemplateProcessor,
)
app = typer.Typer(add_completion=False)
@app.command("project")
def new_project(path: Path) -> N... | 25.814815 | 110 | 0.705882 |
11f5474cf06aa06243fdab79a0081811a1acd30c | 9,798 | py | Python | 002-pyopengl/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/NeHe/lesson48/ArcBall.py | lhl/vrdev | fc1a9af2b51d159c99c8779349ef3392a70ed9ed | [
"Apache-2.0"
] | 12 | 2015-12-02T02:36:36.000Z | 2020-09-20T17:14:24.000Z | 002-pyopengl/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/NeHe/lesson48/ArcBall.py | lhl/vrdev | fc1a9af2b51d159c99c8779349ef3392a70ed9ed | [
"Apache-2.0"
] | null | null | null | 002-pyopengl/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/NeHe/lesson48/ArcBall.py | lhl/vrdev | fc1a9af2b51d159c99c8779349ef3392a70ed9ed | [
"Apache-2.0"
] | 8 | 2016-11-02T11:17:04.000Z | 2021-10-21T07:42:19.000Z | """
ArcBall.py -- Math utilities, vector, matrix types and ArcBall quaternion rotation class
>>> unit_test_ArcBall_module ()
unit testing ArcBall
Quat for first drag
[ 0.08438914 -0.08534209 -0.06240178 0.99080837]
First transform
[[ 0.97764552 -0.1380603 0.15858325 0. ]
[ 0.10925253 0.97796899 0.1778779... | 30.240741 | 111 | 0.654317 |
8f2adec8b2388a8ba1e95922a961e0f34e2392fc | 1,208 | py | Python | conferencio/speaker/models.py | hotsyk/conferencio | 56ff18aa22a1bd55a42ef740e2190240b29a38c7 | [
"BSD-3-Clause"
] | null | null | null | conferencio/speaker/models.py | hotsyk/conferencio | 56ff18aa22a1bd55a42ef740e2190240b29a38c7 | [
"BSD-3-Clause"
] | 6 | 2015-01-10T11:34:34.000Z | 2015-01-10T11:35:41.000Z | conferencio/speaker/models.py | hotsyk/conferencio | 56ff18aa22a1bd55a42ef740e2190240b29a38c7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from postgres.fields import json_field
from event.models import Event
from users.models import User
class Speaker(models.Model):
"""
Model to keep speakers data
"""
user = models.ForeignKey(U... | 25.702128 | 74 | 0.686258 |
b24c2182c697ba856d1d59fdcff0abf1ed0bd859 | 4,448 | py | Python | WeeklyActivityChrome.py | samratpodder/MakautWeeklyActivityFillFormAutomated | 7ec7200cd73cdfd69fd0e2b6f48dc2e959523f7f | [
"MIT"
] | 3 | 2020-05-03T07:49:50.000Z | 2021-07-02T15:13:08.000Z | WeeklyActivityChrome.py | samratpodder/MakautWeeklyActivityFillFormAutomated | 7ec7200cd73cdfd69fd0e2b6f48dc2e959523f7f | [
"MIT"
] | null | null | null | WeeklyActivityChrome.py | samratpodder/MakautWeeklyActivityFillFormAutomated | 7ec7200cd73cdfd69fd0e2b6f48dc2e959523f7f | [
"MIT"
] | null | null | null | import pandas as pd
from selenium import webdriver
from datetime import datetime, timedelta
from selenium.webdriver.support.ui import Select
import math
from time import sleep
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver... | 35.301587 | 117 | 0.680081 |
e2640507f059cea54e6b96d6d00fe143752846e9 | 30,565 | py | Python | sdk/storage/azure-storage-blob/tests/test_blob_client_async.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1 | 2021-08-14T04:33:48.000Z | 2021-08-14T04:33:48.000Z | sdk/storage/azure-storage-blob/tests/test_blob_client_async.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2 | 2021-08-24T15:32:30.000Z | 2021-08-24T23:21:34.000Z | sdk/storage/azure-storage-blob/tests/test_blob_client_async.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1 | 2016-04-19T22:15:47.000Z | 2016-04-19T22:15:47.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import uni... | 51.543002 | 152 | 0.686995 |
f8ab051cab50552100db92944c0acf147f588ac1 | 9,948 | py | Python | docs/samples/specification/multiapi/generated/azure/multiapi/sample/_operations_mixin.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | docs/samples/specification/multiapi/generated/azure/multiapi/sample/_operations_mixin.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | docs/samples/specification/multiapi/generated/azure/multiapi/sample/_operations_mixin.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 51.278351 | 122 | 0.687073 |
f796c97fcca65f3daa866dc57b27f44fdeba4191 | 948 | py | Python | output/models/sun_data/stype/st_facets/st_facets00401m/st_facets00401m7_xsd/st_facets00401m7.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/sun_data/stype/st_facets/st_facets00401m/st_facets00401m7_xsd/st_facets00401m7.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/sun_data/stype/st_facets/st_facets00401m/st_facets00401m7_xsd/st_facets00401m7.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from enum import Enum
from typing import List
__NAMESPACE__ = "SType/ST_facets"
class S(Enum):
VALUE_00 = "এ00"
VALUE_0 = "এ-0"
A0 = "ঐa0"
VALUE_01 = "ও01"
VALUE_1 = "ঝ-1"
A1 = "নa1"
VALUE_02 = "প02"
VALUE_2 = "ভ-2"
A2 = "রa2"
VALUE_03 ... | 17.886792 | 40 | 0.503165 |
b76b06cc014577545e6e3539c34ca3debbfbb1f7 | 4,585 | py | Python | src/pathfinder.py | mikeboy91/poe-currency-flip-planner | 130aa7123a390b2f658ebbb46696ec8f9ad37802 | [
"MIT"
] | null | null | null | src/pathfinder.py | mikeboy91/poe-currency-flip-planner | 130aa7123a390b2f658ebbb46696ec8f9ad37802 | [
"MIT"
] | null | null | null | src/pathfinder.py | mikeboy91/poe-currency-flip-planner | 130aa7123a390b2f658ebbb46696ec8f9ad37802 | [
"MIT"
] | null | null | null | import logging
import time
from datetime import datetime
from typing import Dict, List
import jsonpickle
from src.config.user_config import UserConfig
from src.core import graph
from src.core.backends.backend_pool import BackendPool
from src.core.offer import Offer
from src.trading import ItemList
def format_convers... | 33.713235 | 100 | 0.598037 |
e091312bf6e9475368fe7732765c9335b250d7c2 | 398 | py | Python | guidance_and_support/views.py | IATI/new-website | b90783e32d19ac4c821c5ea018a52997a11b5286 | [
"MIT"
] | 4 | 2019-03-28T06:42:17.000Z | 2021-06-06T13:10:51.000Z | guidance_and_support/views.py | IATI/new-website | b90783e32d19ac4c821c5ea018a52997a11b5286 | [
"MIT"
] | 177 | 2018-09-28T14:21:56.000Z | 2022-03-30T21:45:26.000Z | guidance_and_support/views.py | IATI/new-website | b90783e32d19ac4c821c5ea018a52997a11b5286 | [
"MIT"
] | 8 | 2018-10-25T20:43:10.000Z | 2022-03-17T14:19:27.000Z | """View definitions for the guidance_and_support app."""
from django.shortcuts import render
def guidance_and_support(request):
"""Render the guidance and support page."""
return render(request, "guidance_and_support/guidance_and_support.html", {})
def community(request):
"""Render the community page."... | 28.428571 | 80 | 0.746231 |
2bb55992ed6b8fcd4497d7c9d45d6e1a6b19d46a | 5,692 | py | Python | fcos_core/modeling/roi_heads/box_head/roi_box_feature_extractors.py | amsword/FCOS | 310867ad36714d55f3cc4ee592eab046e8a515c2 | [
"BSD-2-Clause"
] | null | null | null | fcos_core/modeling/roi_heads/box_head/roi_box_feature_extractors.py | amsword/FCOS | 310867ad36714d55f3cc4ee592eab046e8a515c2 | [
"BSD-2-Clause"
] | null | null | null | fcos_core/modeling/roi_heads/box_head/roi_box_feature_extractors.py | amsword/FCOS | 310867ad36714d55f3cc4ee592eab046e8a515c2 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
from torch import nn
from torch.nn import functional as F
from fcos_core.modeling import registry
from fcos_core.modeling.backbone import resnet
from fcos_core.modeling.poolers import Pooler
from fcos_core.modeling.make_layers import ... | 36.025316 | 81 | 0.653197 |
f79325eca2efa0587d5978375557c1242b881222 | 1,066 | py | Python | setup.py | serverlessplus/py | 17acf7af8e6484a2c9844ca9fd28ae54e52ee1b5 | [
"Apache-2.0"
] | 10 | 2019-04-16T09:57:57.000Z | 2021-08-01T15:33:28.000Z | setup.py | serverlessplus/py | 17acf7af8e6484a2c9844ca9fd28ae54e52ee1b5 | [
"Apache-2.0"
] | null | null | null | setup.py | serverlessplus/py | 17acf7af8e6484a2c9844ca9fd28ae54e52ee1b5 | [
"Apache-2.0"
] | 4 | 2019-12-03T01:44:27.000Z | 2021-08-08T08:33:30.000Z | from setuptools import setup
with open('README.md', 'r') as file:
long_description = file.read()
setup(
name='serverlessplus',
packages=['serverlessplus'],
version='0.0.8',
license='Apache-2.0',
author='chenhengqi',
author_email='ritchiechen@tencent.com',
description='serverless your d... | 34.387097 | 79 | 0.634146 |
11b8e48631ebdd6827b1f64e14411f9a63f5186f | 2,645 | py | Python | rhasspytts_wavenet_hermes/__main__.py | digitalfiz/rhasspy-tts-wavenet-hermes | 7744e9b266a9a25b70197970cb104751acea58ff | [
"MIT"
] | null | null | null | rhasspytts_wavenet_hermes/__main__.py | digitalfiz/rhasspy-tts-wavenet-hermes | 7744e9b266a9a25b70197970cb104751acea58ff | [
"MIT"
] | null | null | null | rhasspytts_wavenet_hermes/__main__.py | digitalfiz/rhasspy-tts-wavenet-hermes | 7744e9b266a9a25b70197970cb104751acea58ff | [
"MIT"
] | null | null | null | """Hermes MQTT service for Rhasspy TTS with Google Wavenet."""
import argparse
import asyncio
import logging
from pathlib import Path
import paho.mqtt.client as mqtt
import rhasspyhermes.cli as hermes_cli
from . import TtsHermesMqtt
_LOGGER = logging.getLogger("rhasspytts_wavenet_hermes")
# ------------------------... | 27.842105 | 83 | 0.609074 |
3325c34eed3f38633028b097c43646c5615e6ce8 | 4,034 | py | Python | benchmark/startQiskit_noisy2314.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2314.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2314.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=33
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 34.186441 | 140 | 0.652702 |
d43535cf2ff4f6c984969cd50485decb32188fc8 | 607 | py | Python | tests/float/float_format.py | MakeItZone/circuitpython | 7f803c0b51c333210ed267502422ed7bb28b9be7 | [
"Unlicense",
"BSD-3-Clause",
"MIT-0",
"MIT"
] | 198 | 2017-03-24T23:23:54.000Z | 2022-01-07T07:14:00.000Z | tests/float/float_format.py | MakeItZone/circuitpython | 7f803c0b51c333210ed267502422ed7bb28b9be7 | [
"Unlicense",
"BSD-3-Clause",
"MIT-0",
"MIT"
] | 509 | 2017-03-28T19:37:18.000Z | 2022-03-31T20:31:43.000Z | tests/float/float_format.py | MakeItZone/circuitpython | 7f803c0b51c333210ed267502422ed7bb28b9be7 | [
"Unlicense",
"BSD-3-Clause",
"MIT-0",
"MIT"
] | 187 | 2017-03-24T23:23:58.000Z | 2022-02-25T01:48:45.000Z | # test float formatting
# general rounding
for val in (116, 1111, 1234, 5010, 11111):
print('%.0f' % val)
print('%.1f' % val)
print('%.3f' % val)
# make sure rounding is done at the correct precision
for prec in range(8):
print(('%%.%df' % prec) % 6e-5)
# check certain cases that had a digit value of... | 30.35 | 76 | 0.635914 |
c14c8461772ff65036188ac2237a0299aa57965e | 276 | py | Python | test/test_toolbar.py | defuz/flask-debugtoolbar | b08fe477b6b796c808c0b3bfcaafa893974c676d | [
"BSD-3-Clause"
] | null | null | null | test/test_toolbar.py | defuz/flask-debugtoolbar | b08fe477b6b796c808c0b3bfcaafa893974c676d | [
"BSD-3-Clause"
] | null | null | null | test/test_toolbar.py | defuz/flask-debugtoolbar | b08fe477b6b796c808c0b3bfcaafa893974c676d | [
"BSD-3-Clause"
] | null | null | null | def load_app(name):
app = __import__(name).app
app.config['TESTING'] = True
return app.test_client()
def test_basic_app():
app = load_app('basic_app')
index = app.get('/')
assert index.status_code == 200
assert b'<div id="flDebug"' in index.data
| 23 | 45 | 0.644928 |
38986f7a3db60c98dd8f31a54929e2879862727f | 17,882 | py | Python | pyenzyme/restful/template.py | HannahDi/PyEnzyme | afbd03ab65445b2411307613c9a3cd7ab8ea4ae7 | [
"BSD-2-Clause"
] | 7 | 2020-10-28T22:04:56.000Z | 2022-03-01T12:23:57.000Z | pyenzyme/restful/template.py | HannahDi/PyEnzyme | afbd03ab65445b2411307613c9a3cd7ab8ea4ae7 | [
"BSD-2-Clause"
] | 33 | 2021-05-18T15:17:05.000Z | 2022-03-29T13:59:57.000Z | pyenzyme/restful/template.py | HannahDi/PyEnzyme | afbd03ab65445b2411307613c9a3cd7ab8ea4ae7 | [
"BSD-2-Clause"
] | 8 | 2020-10-27T13:31:06.000Z | 2022-03-20T10:40:56.000Z | '''
File: template.py
Project: restful
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Wednesday June 23rd 2021 9:57:02 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
'''
from flask import request, se... | 31.932143 | 81 | 0.443686 |
af9ac0dd6172439349e499ca7c97b8942892ae3c | 1,009 | py | Python | rally/common/objects/__init__.py | lolwww/rally | fcb1fb6c608e29dd62549cf6b3cec2e90529932f | [
"Apache-2.0"
] | 263 | 2015-04-26T16:05:34.000Z | 2022-02-28T11:17:07.000Z | rally/common/objects/__init__.py | lolwww/rally | fcb1fb6c608e29dd62549cf6b3cec2e90529932f | [
"Apache-2.0"
] | 19 | 2015-04-23T11:53:10.000Z | 2019-02-20T11:23:09.000Z | rally/common/objects/__init__.py | lolwww/rally | fcb1fb6c608e29dd62549cf6b3cec2e90529932f | [
"Apache-2.0"
] | 287 | 2015-04-23T11:28:03.000Z | 2021-09-16T13:05:53.000Z | # Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 43.869565 | 78 | 0.75223 |
e400025548a71e8814de001af196838bbd528db5 | 1,039 | py | Python | runstat.py | commaai/comma10k | c48d22c608539728d7b8db6e818823b88f69a073 | [
"MIT"
] | 567 | 2020-02-28T20:00:31.000Z | 2022-03-30T16:31:19.000Z | runstat.py | commaai/comma10k | c48d22c608539728d7b8db6e818823b88f69a073 | [
"MIT"
] | 1,404 | 2020-03-03T07:35:08.000Z | 2022-03-28T00:14:40.000Z | runstat.py | commaai/comma10k | c48d22c608539728d7b8db6e818823b88f69a073 | [
"MIT"
] | 718 | 2020-02-28T20:29:36.000Z | 2022-03-19T18:17:01.000Z | #!/usr/bin/env python3
import os
import subprocess
def tx(x):
if b"/sa" in x:
b,e = x.split(b'/sa')
ret = b"%s/%04d%s" % (b,int(e[0:5])+5000, e[5:])
return ret
return x
# https://stackoverflow.com/questions/5669621/git-find-out-which-files-have-had-the-most-commits
out = subprocess.check_output("git ... | 25.975 | 139 | 0.620789 |
6f358779d9fec79c82c180da4284e30f0efdcda9 | 836 | py | Python | hbmqtt_broker/__init__.py | thingsroot/power_vsp | fae50959b859a4562ac90167531a7a617025643a | [
"MIT"
] | 3 | 2020-04-27T08:27:31.000Z | 2021-04-26T14:58:50.000Z | hbmqtt_broker/__init__.py | thingsroot/power_vsp | fae50959b859a4562ac90167531a7a617025643a | [
"MIT"
] | 1 | 2020-06-03T09:40:17.000Z | 2020-06-04T07:47:31.000Z | hbmqtt_broker/__init__.py | thingsroot/power_vsp | fae50959b859a4562ac90167531a7a617025643a | [
"MIT"
] | 3 | 2020-06-02T08:59:10.000Z | 2021-04-26T14:58:54.000Z | import logging
import asyncio
import threading
from hbmqtt.broker import Broker
from hbmqtt_broker.conf import broker_config
@asyncio.coroutine
def broker_coro(config):
broker = Broker(config)
yield from broker.start()
class MQTTBroker(threading.Thread):
def __init__(self, config=None):
threading... | 28.827586 | 75 | 0.726077 |
701bfaf627d63b365b5f42a392f467e0a87e10fc | 359 | py | Python | thaniya_server/src/thaniya_server/flask/FlaskFilter_toStr.py | jkpubsrc/Thaniya | 4ebdf2854e3d7888af7396adffa22628b4ab2267 | [
"Apache-1.1"
] | 1 | 2021-01-20T18:27:22.000Z | 2021-01-20T18:27:22.000Z | thaniya_server/src/thaniya_server/flask/FlaskFilter_toStr.py | jkpubsrc/Thaniya | 4ebdf2854e3d7888af7396adffa22628b4ab2267 | [
"Apache-1.1"
] | null | null | null | thaniya_server/src/thaniya_server/flask/FlaskFilter_toStr.py | jkpubsrc/Thaniya | 4ebdf2854e3d7888af7396adffa22628b4ab2267 | [
"Apache-1.1"
] | null | null | null |
from .AbstractFlaskTemplateFilter import AbstractFlaskTemplateFilter
#
# Creates a canonical string represetation of data.
#
class FlaskFilter_toStr(AbstractFlaskTemplateFilter):
def __call__(self, data):
if data is None:
return ""
elif data is True:
return "true"
elif data is False:
return "f... | 10.257143 | 68 | 0.710306 |
de1e15b055c5fb7fd5e7278bd01f1daffef57889 | 5,630 | py | Python | RedLionfishDeconv/RLDeconvolve.py | DragaDoncila/RedLionfish | f7661aa85c3f92f799cb3402c237cb6ea9146f10 | [
"Apache-2.0"
] | 4 | 2021-11-20T07:51:40.000Z | 2022-01-28T21:11:50.000Z | RedLionfishDeconv/RLDeconvolve.py | DragaDoncila/RedLionfish | f7661aa85c3f92f799cb3402c237cb6ea9146f10 | [
"Apache-2.0"
] | 3 | 2021-11-20T16:15:55.000Z | 2022-02-01T22:00:44.000Z | RedLionfishDeconv/RLDeconvolve.py | DragaDoncila/RedLionfish | f7661aa85c3f92f799cb3402c237cb6ea9146f10 | [
"Apache-2.0"
] | 1 | 2021-12-21T02:55:06.000Z | 2021-12-21T02:55:06.000Z | '''
Copyright 2021 Rosalind Franklin Institute
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... | 43.643411 | 203 | 0.649911 |
d093af07aa060b38370d58195b8b4de05100ea4a | 3,656 | py | Python | kivy/uix/camera.py | ableity/kivy_android_camera_fix | 2a54ea17143111af3e46d46f6756e880c4d91f54 | [
"MIT"
] | null | null | null | kivy/uix/camera.py | ableity/kivy_android_camera_fix | 2a54ea17143111af3e46d46f6756e880c4d91f54 | [
"MIT"
] | null | null | null | kivy/uix/camera.py | ableity/kivy_android_camera_fix | 2a54ea17143111af3e46d46f6756e880c4d91f54 | [
"MIT"
] | null | null | null | '''
Camera
======
The :class:`Camera` widget is used to capture and display video from a camera.
Once the widget is created, the texture inside the widget will be automatically
updated. Our :class:`~kivy.core.camera.CameraBase` implementation is used under
the hood::
cam = Camera()
By default, the first camera f... | 29.967213 | 135 | 0.638676 |
6c0c35a0db658b16b266d03ab38f688faa4007b9 | 1,036 | py | Python | bfc/codegen/base.py | staceb/esotope-bfc | 0f4992cce44f3fbf1046ec1c6c981bc4fad023f7 | [
"MIT"
] | 25 | 2015-08-24T11:40:10.000Z | 2022-03-24T03:11:25.000Z | bfc/codegen/base.py | staceb/esotope-bfc | 0f4992cce44f3fbf1046ec1c6c981bc4fad023f7 | [
"MIT"
] | 30 | 2017-11-22T16:01:15.000Z | 2017-11-22T16:10:27.000Z | bfc/codegen/base.py | staceb/esotope-bfc | 0f4992cce44f3fbf1046ec1c6c981bc4fad023f7 | [
"MIT"
] | 2 | 2018-11-08T15:04:11.000Z | 2021-01-26T17:24:13.000Z | # This is a part of Esotope Brainfuck Compiler.
import bfc.nodes
class BaseGenerator(object):
def __init__(self, compiler):
self.compiler = compiler
self.nindents = 0
self.genmap = {}
for name in dir(self):
if not name.startswith('generate_'): continue
try:... | 23.022222 | 79 | 0.580116 |
b3f3f74c09d4fefdd72645fa263c6dc3d1e290e7 | 714 | py | Python | stor/types/name_puzzle_condition.py | Stor-Network/stor-blockchain | 3c3cd1a3b99592e88160107ca5b81afc0937b992 | [
"Apache-2.0"
] | 19 | 2021-06-29T20:06:09.000Z | 2022-02-09T04:33:00.000Z | stor/types/name_puzzle_condition.py | Stor-Network/stor-blockchain | 3c3cd1a3b99592e88160107ca5b81afc0937b992 | [
"Apache-2.0"
] | 8 | 2021-07-04T03:21:51.000Z | 2021-12-27T07:56:09.000Z | stor/types/name_puzzle_condition.py | Stor-Network/stor-blockchain | 3c3cd1a3b99592e88160107ca5b81afc0937b992 | [
"Apache-2.0"
] | 6 | 2021-10-04T17:15:30.000Z | 2022-03-15T08:40:01.000Z | from dataclasses import dataclass
from typing import Dict, List, Tuple
from stor.types.blockchain_format.sized_bytes import bytes32
from stor.types.condition_with_args import ConditionWithArgs
from stor.types.condition_opcodes import ConditionOpcode
from stor.util.streamable import Streamable, streamable
@dataclass(... | 29.75 | 69 | 0.745098 |
76bf4af665530d02683507fcf3348742c4f60f95 | 12,787 | py | Python | clinicaml/pipelines/t1_volume_dartel2mni/t1_volume_dartel2mni_pipeline.py | HorlavaNastassya/clinica | 65424423e319f981f0b20ebd6bb82060aab271c2 | [
"MIT"
] | null | null | null | clinicaml/pipelines/t1_volume_dartel2mni/t1_volume_dartel2mni_pipeline.py | HorlavaNastassya/clinica | 65424423e319f981f0b20ebd6bb82060aab271c2 | [
"MIT"
] | null | null | null | clinicaml/pipelines/t1_volume_dartel2mni/t1_volume_dartel2mni_pipeline.py | HorlavaNastassya/clinica | 65424423e319f981f0b20ebd6bb82060aab271c2 | [
"MIT"
] | null | null | null | # coding: utf8
import clinicaml.pipelines.engine as cpe
class T1VolumeDartel2MNI(cpe.Pipeline):
"""T1VolumeDartel2MNI - Dartel template to MNI.
Returns:
A clinicaml pipeline object containing the T1VolumeDartel2MNI pipeline.
"""
def check_pipeline_parameters(self):
"""Check pipeline... | 39.466049 | 122 | 0.561117 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.