hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79da034fa5d28986b2c500c63e628c6a09b7d4fc | 24,445 | py | Python | discord/voice_client.py | CuzImSyntax/dis.py | 2f56d546f2594e1dbb6955c8b13b3a884a04eca6 | [
"MIT"
] | 1 | 2021-09-11T13:39:44.000Z | 2021-09-11T13:39:44.000Z | discord/voice_client.py | CuzImSyntax/discordIO | 47cd508ed48004aa61a41a5b196d3ff003456219 | [
"MIT"
] | null | null | null | discord/voice_client.py | CuzImSyntax/discordIO | 47cd508ed48004aa61a41a5b196d3ff003456219 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz 2021-present CuzImSyntax
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | 36.107829 | 148 | 0.630477 |
79da250af1256aca79474cdd2b0d0b5821887700 | 1,212 | py | Python | NEMbox/__main__.py | hyskyder/musicbox | ec06a49cc59c683f7f5e69fad5097c34a8a7984c | [
"MIT"
] | null | null | null | NEMbox/__main__.py | hyskyder/musicbox | ec06a49cc59c683f7f5e69fad5097c34a8a7984c | [
"MIT"
] | null | null | null | NEMbox/__main__.py | hyskyder/musicbox | ec06a49cc59c683f7f5e69fad5097c34a8a7984c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
网易云音乐 Entry
'''
from __future__ import (
print_function, unicode_literals, division, absolute_import
)
import curses
import traceback
import argparse
from future.builtins import str
from .menu import Menu
from .__version__ import __version__ as version
def start... | 23.764706 | 67 | 0.626238 |
79da290911f22ef15389f2517e683ff8a9033401 | 1,852 | py | Python | src/focus_stack/utilities.py | noah-peeters/python-focus-stacking | 394a8f1676466be8baefcc3ffadc26bdad729db6 | [
"MIT"
] | 1 | 2021-01-22T13:32:18.000Z | 2021-01-22T13:32:18.000Z | src/focus_stack/utilities.py | noah-peeters/python-focus-stacking | 394a8f1676466be8baefcc3ffadc26bdad729db6 | [
"MIT"
] | 9 | 2021-01-22T16:35:20.000Z | 2021-03-27T12:18:36.000Z | src/focus_stack/utilities.py | noah-peeters/python-focus-stacking | 394a8f1676466be8baefcc3ffadc26bdad729db6 | [
"MIT"
] | 1 | 2021-01-22T16:27:45.000Z | 2021-01-22T16:27:45.000Z | import psutil, os, ntpath
import PyQt5.QtGui as qtg
from datetime import timedelta
import qimage2ndarray
class Utilities:
# Correctly format seconds to HH:MM:SS
def format_seconds(self, s):
return str(timedelta(seconds=s))
# Get only filename from file's path
def get_file_name(self, path):
... | 30.866667 | 76 | 0.539957 |
79da29f01e1327c8997c7d4b0a8a6ac899f5bb9f | 438 | py | Python | setup.py | rerobins/rho_timeline | 2b3a1ea58f1d86d99f66aef9a176ac53fdfb9577 | [
"BSD-3-Clause"
] | null | null | null | setup.py | rerobins/rho_timeline | 2b3a1ea58f1d86d99f66aef9a176ac53fdfb9577 | [
"BSD-3-Clause"
] | null | null | null | setup.py | rerobins/rho_timeline | 2b3a1ea58f1d86d99f66aef9a176ac53fdfb9577 | [
"BSD-3-Clause"
] | null | null | null | from distutils.core import setup
setup(
name='timeline_bot',
version='1.1.0.dev1',
packages=['timeline_bot',
'timeline_bot.components',
'timeline_bot.components.commands',
],
url='',
license='BSD',
author='Robert Robinson',
author_email='rerobins@me... | 25.764706 | 54 | 0.623288 |
79da307ac8f0f6be737302d714696d1e720bab04 | 390 | py | Python | docs/source/play/string.py | ydcjeff/sphinxcontrib-playground | d7bbb52d05e09b78d02cecde0b16f63f8a2c909a | [
"MIT"
] | 1 | 2021-06-21T18:37:17.000Z | 2021-06-21T18:37:17.000Z | docs/source/play/string.py | ydcjeff/sphinxcontrib-playground | d7bbb52d05e09b78d02cecde0b16f63f8a2c909a | [
"MIT"
] | 1 | 2022-02-06T02:21:17.000Z | 2022-02-06T02:21:17.000Z | docs/source/play/string.py | ydcjeff/sphinxcontrib-playground | d7bbb52d05e09b78d02cecde0b16f63f8a2c909a | [
"MIT"
] | null | null | null | # This prints out "Hello, John!"
name = 'John'
print('Hello, %s!' % name)
# This prints out "John is 23 years old."
name = 'John'
age = 23
print('%s is %d years old.' % (name, age))
# This prints out: A list: [1, 2, 3]
mylist = [1, 2, 3]
print('A list: %s' % mylist)
data = ('John', 'Doe', 53.44)
format_string = 'He... | 20.526316 | 59 | 0.605128 |
79da79fe235b6fb3e750d09b0a79c0c872d3d396 | 22,047 | py | Python | src/sentry/digests/backends/redis.py | NetEaseGame/Sentry | b2804c3e4b7fea61294e12d9b608b5fbdeeac5a3 | [
"BSD-3-Clause"
] | 20 | 2016-10-01T04:29:24.000Z | 2020-10-09T07:23:34.000Z | src/sentry/digests/backends/redis.py | NetEaseGame/Sentry | b2804c3e4b7fea61294e12d9b608b5fbdeeac5a3 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/digests/backends/redis.py | NetEaseGame/Sentry | b2804c3e4b7fea61294e12d9b608b5fbdeeac5a3 | [
"BSD-3-Clause"
] | 7 | 2016-10-27T05:12:45.000Z | 2021-05-01T14:29:53.000Z | from __future__ import absolute_import
import itertools
import logging
import random
import time
from contextlib import contextmanager
from django.conf import settings
from redis.exceptions import (
ResponseError,
WatchError,
)
from sentry.digests import (
Record,
ScheduleEntry,
)
from sentry.digests... | 43.314342 | 131 | 0.576269 |
79da9269120276d84e0446c202a17e9865608c5f | 3,428 | py | Python | data/esc_dataset.py | hackerekcah/ESRelation | 6aa1e4bcb04c90fca79a125cc128481155da54a1 | [
"MIT"
] | null | null | null | data/esc_dataset.py | hackerekcah/ESRelation | 6aa1e4bcb04c90fca79a125cc128481155da54a1 | [
"MIT"
] | null | null | null | data/esc_dataset.py | hackerekcah/ESRelation | 6aa1e4bcb04c90fca79a125cc128481155da54a1 | [
"MIT"
] | null | null | null | import torch
import os
import logging
import glob
import soundfile as sf
import resampy
import torchaudio
from data.data_transformer import FakePitchShift, Compose
from data import register_dataset
torchaudio.set_audio_backend("soundfile") # switch backend
logger = logging.getLogger(__name__)
@register_dataset
clas... | 34.28 | 117 | 0.610852 |
79dae452bc9bbbb6f6fc9f9ac50c549f90e1da6f | 4,059 | py | Python | metpy/interpolate/tests/test_interpolate_tools.py | ahuang11/MetPy | 6116ceca6c48fda7e4ead254d2a83ebf86391e7a | [
"BSD-3-Clause"
] | 1 | 2019-09-15T18:02:59.000Z | 2019-09-15T18:02:59.000Z | metpy/interpolate/tests/test_interpolate_tools.py | e-dennis/MetPy | 6529608d956039d4791a17a7bdb1a2c0bf97cd75 | [
"BSD-3-Clause"
] | null | null | null | metpy/interpolate/tests/test_interpolate_tools.py | e-dennis/MetPy | 6529608d956039d4791a17a7bdb1a2c0bf97cd75 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `tools` module."""
from __future__ import division
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
import pandas as pd
impor... | 28.384615 | 80 | 0.632422 |
79daf67317b91730c2117a444b2b828bc63e4d77 | 812 | py | Python | end_to_end_tests/golden-record-custom/custom_e2e/models/test_inline_objects_response_200.py | benchling/openapi-python-client | a755ed9dc77b7d7e394057159831fbfa327be113 | [
"MIT"
] | 2 | 2020-10-15T07:25:50.000Z | 2021-09-14T21:29:08.000Z | end_to_end_tests/golden-record-custom/custom_e2e/models/test_inline_objects_response_200.py | benchling/openapi-python-client | a755ed9dc77b7d7e394057159831fbfa327be113 | [
"MIT"
] | 79 | 2020-09-10T00:47:21.000Z | 2022-03-25T02:07:31.000Z | end_to_end_tests/golden-record/my_test_api_client/models/test_inline_objects_response_200.py | benchling/openapi-python-client | a755ed9dc77b7d7e394057159831fbfa327be113 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Union
import attr
from ..types import UNSET, Unset
@attr.s(auto_attribs=True)
class TestInlineObjectsResponse_200:
""" """
a_property: Union[Unset, str] = UNSET
def to_dict(self) -> Dict[str, Any]:
a_property = self.a_property
field_dict: Dict[str, Any] ... | 23.882353 | 79 | 0.652709 |
79db3202f3259b176e4e877558394a266b37f75c | 1,026 | py | Python | hek/image.py | greedalbadi/hek | ac9c7531ba6ce42326528945e3473fb2ff9496af | [
"MIT"
] | 8 | 2022-01-01T05:58:34.000Z | 2022-02-20T17:18:04.000Z | hek/image.py | greedalbadi/hek | ac9c7531ba6ce42326528945e3473fb2ff9496af | [
"MIT"
] | null | null | null | hek/image.py | greedalbadi/hek | ac9c7531ba6ce42326528945e3473fb2ff9496af | [
"MIT"
] | null | null | null | from PIL import Image as Im
from PIL.ExifTags import TAGS
import os.path
from .exceptions import *
class Image:
def isfile(self, filename):
result = os.path.exists(filename) # checking if file exist
if result == False:
raise FileNotFound(f"file not found: {filename}") # file except... | 33.096774 | 93 | 0.591618 |
79db3c652900a7007d8536a9af422f4bbc360123 | 6,028 | py | Python | programl/task/dataflow/lstm_batch_builder.py | island255/ProGraML | 6c4ea50639773009e7c287feb62c6994fa4f3445 | [
"Apache-2.0"
] | 1 | 2020-07-14T12:17:45.000Z | 2020-07-14T12:17:45.000Z | programl/task/dataflow/lstm_batch_builder.py | island255/ProGraML | 6c4ea50639773009e7c287feb62c6994fa4f3445 | [
"Apache-2.0"
] | null | null | null | programl/task/dataflow/lstm_batch_builder.py | island255/ProGraML | 6c4ea50639773009e7c287feb62c6994fa4f3445 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 the ProGraML authors.
#
# Contact Chris Cummins <chrisc.101@gmail.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... | 32.408602 | 82 | 0.674685 |
79db5f0267dc21d28f84a0b1b4f93c191cce5166 | 3,175 | py | Python | cm/app/api_v1/my_calculation_module_directory/CM/__delete_if_tested__/CM_TUW32/run_cm.py | HotMaps/renovation_effect | 469a01b4cc805256768d884a3a2ae4560770b734 | [
"Apache-2.0"
] | 1 | 2021-05-11T06:41:04.000Z | 2021-05-11T06:41:04.000Z | cm/app/api_v1/my_calculation_module_directory/CM/__delete_if_tested__/CM_TUW32/run_cm.py | mayr-ethink/renovation_effect | 5b1fb81102b3c6ee531b719d8136ed9a343c2598 | [
"Apache-2.0"
] | 2 | 2020-06-04T20:19:36.000Z | 2020-06-04T20:19:36.000Z | cm/app/api_v1/my_calculation_module_directory/CM/__delete_if_tested__/CM_TUW32/run_cm.py | mayr-ethink/renovation_effect | 5b1fb81102b3c6ee531b719d8136ed9a343c2598 | [
"Apache-2.0"
] | null | null | null | import os, sys
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.
abspath(__file__))))
if path not in sys.path:
sys.path.append(path)
from CM.CM_TUW32.N3scenario_to_raster import CalcEffectsAtRasterLevel
from CM.common_modules.readCsvData import RE... | 45.357143 | 114 | 0.626457 |
79db7cfa3651d6a8d0fecce9dc8fa1b571e759ca | 8,157 | py | Python | src/vivarium_gates_iv_iron/components/hemoglobin.py | ihmeuw/vivarium_gates_iv_iron | 2d22ef63101a49b8c825884537c6fc79d559ba09 | [
"BSD-3-Clause"
] | null | null | null | src/vivarium_gates_iv_iron/components/hemoglobin.py | ihmeuw/vivarium_gates_iv_iron | 2d22ef63101a49b8c825884537c6fc79d559ba09 | [
"BSD-3-Clause"
] | 1 | 2022-02-16T21:15:26.000Z | 2022-02-16T21:15:26.000Z | src/vivarium_gates_iv_iron/components/hemoglobin.py | ihmeuw/vivarium_gates_iv_iron | 2d22ef63101a49b8c825884537c6fc79d559ba09 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pandas as pd
import scipy.stats
from vivarium.framework.engine import Builder
from vivarium.framework.population import SimulantData
from vivarium_gates_iv_iron.constants.data_values import (
HEMOGLOBIN_DISTRIBUTION_PARAMETERS,
HEMOGLOBIN_THRESHOLD_DATA,
ANEMIA_DISABILITY_WEIGHTS... | 37.763889 | 114 | 0.631727 |
79db9bee14701a7f13a5c343f5c038d9537a619b | 1,928 | py | Python | google-cloud-sdk/.install/.backup/lib/surface/compute/backend_services/delete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/compute/backend_services/delete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/compute/backend_services/delete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.824561 | 74 | 0.766079 |
79dbb0a8467cafacd2a27eab9b6b6a427209e077 | 21,461 | py | Python | st2api/tests/unit/controllers/v1/test_packs.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | null | null | null | st2api/tests/unit/controllers/v1/test_packs.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | 2 | 2020-03-04T08:33:36.000Z | 2020-03-04T08:34:14.000Z | st2api/tests/unit/controllers/v1/test_packs.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 39.305861 | 94 | 0.553795 |
79dbc5398fc7df40d74354c5ad0bfb01431a9e89 | 8,903 | py | Python | keras/esim_online.py | ksboy/adversarial_attack | cb1e02b8ff31056cdd0eb1f747c1b08ed12527bc | [
"Apache-2.0"
] | 1 | 2020-05-22T02:03:34.000Z | 2020-05-22T02:03:34.000Z | keras/esim_online.py | ksboy/adversarial_attack | cb1e02b8ff31056cdd0eb1f747c1b08ed12527bc | [
"Apache-2.0"
] | null | null | null | keras/esim_online.py | ksboy/adversarial_attack | cb1e02b8ff31056cdd0eb1f747c1b08ed12527bc | [
"Apache-2.0"
] | 1 | 2019-12-04T14:29:23.000Z | 2019-12-04T14:29:23.000Z | import os
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
import pandas as pd
import numpy as np
from tqdm import tqdm
import time
import logging
from sklearn.model_selection import StratifiedKFold
from keras_bert import load_trained_model_from_checkpoint, Tokenizer
from keras.optimizers import Adam
import pandas as pd
from s... | 36.63786 | 161 | 0.633944 |
79dbd9ce5cc242c3ff738240d8465c4704d49993 | 1,967 | py | Python | multidoc-stave/simple-backend/add_corpus.py | adithya7/cdec-ann-tool | 263137960d01babdddae48faef9cfef5efef6826 | [
"Apache-2.0"
] | null | null | null | multidoc-stave/simple-backend/add_corpus.py | adithya7/cdec-ann-tool | 263137960d01babdddae48faef9cfef5efef6826 | [
"Apache-2.0"
] | null | null | null | multidoc-stave/simple-backend/add_corpus.py | adithya7/cdec-ann-tool | 263137960d01babdddae48faef9cfef5efef6826 | [
"Apache-2.0"
] | null | null | null | """
Load new packs and multipacks to the database
"""
from argparse import ArgumentParser
from pathlib import Path
import json
import logging
from db_utils import add_pack, add_multipack
if __name__ == "__main__":
logging.basicConfig(
format="%(asctime)s - %(message)s",
datefmt="%Y-%m-%d %H:%M:%... | 35.125 | 104 | 0.648704 |
79dbe041796c0948e12d6ca54f700a1f1040e50c | 2,001 | py | Python | selsum/data/doc_reducer.py | abrazinskas/SelSum | 6ed0e282cf854db7095196732e62ef8662c0daa6 | [
"MIT"
] | 34 | 2021-09-10T17:10:10.000Z | 2022-03-28T05:12:07.000Z | selsum/data/doc_reducer.py | abrazinskas/SelSum | 6ed0e282cf854db7095196732e62ef8662c0daa6 | [
"MIT"
] | null | null | null | selsum/data/doc_reducer.py | abrazinskas/SelSum | 6ed0e282cf854db7095196732e62ef8662c0daa6 | [
"MIT"
] | 3 | 2021-11-20T08:21:19.000Z | 2022-03-28T05:12:14.000Z | # 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 fairseq.data import BaseWrapperDataset
from shared_lib.utils.helpers.data import reduce_docs
import torch as T
import ... | 32.274194 | 82 | 0.645677 |
79dbe578a1e954834f8b86d107d8507c3e6eba1d | 6,063 | py | Python | docs/source/conf.py | kyzima-spb/flask-pony | 6cf28d70b7ebf415d58fa138fcc70b8dd57432c7 | [
"Apache-2.0"
] | 13 | 2016-12-03T18:13:08.000Z | 2022-02-26T12:47:42.000Z | docs/source/conf.py | kyzima-spb/flask-pony | 6cf28d70b7ebf415d58fa138fcc70b8dd57432c7 | [
"Apache-2.0"
] | 2 | 2018-03-11T15:33:12.000Z | 2018-04-01T13:55:52.000Z | docs/source/conf.py | kyzima-spb/flask-pony | 6cf28d70b7ebf415d58fa138fcc70b8dd57432c7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 29.289855 | 79 | 0.640937 |
79dbfdffe97c8a943db81017d1bc0d529eda5e67 | 6,240 | py | Python | pyglm/inference/parallel_ais.py | slinderman/theano_pyglm | c7fc11069dfe91b0eb7c96b8464fcd0f57442952 | [
"MIT"
] | 37 | 2015-04-08T15:11:51.000Z | 2022-01-05T19:32:58.000Z | pyglm/inference/parallel_ais.py | slinderman/theano_pyglm | c7fc11069dfe91b0eb7c96b8464fcd0f57442952 | [
"MIT"
] | 2 | 2016-03-08T02:39:58.000Z | 2017-03-29T08:51:08.000Z | pyglm/inference/parallel_ais.py | slinderman/theano_pyglm | c7fc11069dfe91b0eb7c96b8464fcd0f57442952 | [
"MIT"
] | 10 | 2015-02-25T21:47:50.000Z | 2020-03-06T00:21:48.000Z | """
Estimate the marginal log likelihood of the data under a given model.
"""
import sys
import numpy as np
from scipy.misc import logsumexp
from IPython.parallel.util import interactive
from pyglm.utils.parallel_util import parallel_compute_log_p
def initialize_imports(dview):
""" Import functions req'd for co... | 34.666667 | 100 | 0.576282 |
79dbff9582b8c5a482164d4b504899c24c9ce284 | 6,651 | py | Python | selim_sef/data_tools/generate_spacenet_dataset.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 27 | 2020-03-04T05:54:48.000Z | 2022-01-05T07:07:44.000Z | selim_sef/data_tools/generate_spacenet_dataset.py | CosmiQ/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 1 | 2020-07-14T10:35:50.000Z | 2020-07-14T10:35:50.000Z | selim_sef/data_tools/generate_spacenet_dataset.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 7 | 2020-03-07T21:42:57.000Z | 2022-01-07T10:49:50.000Z | import argparse
import glob
import os
import skimage.io
os.environ["MKL_NUM_THREADS"] = "1"
os.environ["NUMEXPR_NUM_THREADS"] = "1"
os.environ["OMP_NUM_THREADS"] = "1"
from scipy.spatial.distance import euclidean
from functools import partial
from multiprocessing.pool import Pool
import cv2
import pandas as pd
impo... | 34.82199 | 133 | 0.552699 |
79dc08481efd00870b9bb5e090da7920896afa3e | 14,253 | py | Python | diploshic/misc.py | peterdfields/diploSHIC | b204cc71a946be6093fab0336599ceecff04d651 | [
"MIT"
] | 21 | 2018-02-03T16:30:15.000Z | 2020-06-03T12:01:28.000Z | diploshic/misc.py | peterdfields/diploSHIC | b204cc71a946be6093fab0336599ceecff04d651 | [
"MIT"
] | 23 | 2018-05-15T01:59:53.000Z | 2020-06-02T20:04:26.000Z | diploshic/misc.py | peterdfields/diploSHIC | b204cc71a946be6093fab0336599ceecff04d651 | [
"MIT"
] | 10 | 2018-08-26T15:05:25.000Z | 2020-04-13T08:07:20.000Z | import numpy as np
from scipy.sparse import coo_matrix
"""This is all a bunch of stuff copied from sk-learn 0.24.2 but shoving it in
here for compatibility purposes. Some slight modifications were made."""
class ConfusionMatrixDisplay:
"""Confusion Matrix visualization.
It is recommend to use :func:`~sklearn... | 37.214099 | 79 | 0.610538 |
79dc0873c02e6a99c602150f18a7acd823780006 | 9,374 | py | Python | train.py | fiorenza2/ReadyPolicyOne | 975a5e31a8e8385f76f7877b1b0d691bcf530504 | [
"MIT"
] | 15 | 2020-06-23T12:20:53.000Z | 2021-08-31T21:23:45.000Z | train.py | fiorenza2/ReadyPolicyOne | 975a5e31a8e8385f76f7877b1b0d691bcf530504 | [
"MIT"
] | null | null | null | train.py | fiorenza2/ReadyPolicyOne | 975a5e31a8e8385f76f7877b1b0d691bcf530504 | [
"MIT"
] | 3 | 2020-06-23T12:20:57.000Z | 2021-08-08T10:05:49.000Z | import argparse
import os
import random
import gym
from gym.wrappers import TimeLimit
import numpy as np
import pandas as pd
import yaml
from env_aug import AntEnvAug, HalfCheetahEnvAug, HopperEnvAug, fixedSwimmerEnv
from model import EnsembleGymEnv
from ppo import PPO, Memory
from train_funcs import (collect_data, t... | 43.398148 | 155 | 0.643055 |
79dc21b8310fe99e97ffeb89da5208730ad69d0b | 2,580 | py | Python | main.py | MagicCap/i.magiccap | 5cbb008e109c105d0cb3dbc0d8316c7ac826f1e6 | [
"BSD-2-Clause"
] | 2 | 2019-03-05T08:49:56.000Z | 2019-03-07T08:58:32.000Z | main.py | MagicCap/i.magiccap | 5cbb008e109c105d0cb3dbc0d8316c7ac826f1e6 | [
"BSD-2-Clause"
] | null | null | null | main.py | MagicCap/i.magiccap | 5cbb008e109c105d0cb3dbc0d8316c7ac826f1e6 | [
"BSD-2-Clause"
] | null | null | null | from flask import Flask, redirect, send_file, request, jsonify
from models import InstallID
import requests
import boto3
import random
import string
import botocore
# Imports go here.
app = Flask(__name__)
# Defines the app.
@app.route("/")
def go_to_website():
"""Returns to magiccap.me"""
return redirect("h... | 26.326531 | 115 | 0.593411 |
79dc2df719eac37122c2edc13a6952cd3109f3c4 | 4,111 | py | Python | intersight/models/connector_fetch_stream_message.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/connector_fetch_stream_message.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/connector_fetch_stream_message.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class ConnectorFetchStreamMessage(object):
"""
NOTE... | 26.694805 | 82 | 0.574556 |
79dc74924fbe11cac138c1aa2219a3f284b2803b | 3,683 | py | Python | scripts/practice/FB/LongestArithmeticSubSequqenceWithDifference.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | scripts/practice/FB/LongestArithmeticSubSequqenceWithDifference.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | 8 | 2020-09-05T16:04:31.000Z | 2022-02-27T09:57:51.000Z | scripts/practice/FB/LongestArithmeticSubSequqenceWithDifference.py | bhimeshchauhan/competitive_programming | e0777bb0c425ffa03d8173a83e50ca55c4a3fcf5 | [
"MIT"
] | null | null | null | """
Longest Arithmetic Subsequence
Given an array nums of integers, return the length of the longest arithmetic subsequence in nums.
Recall that a subsequence of an array nums is a list nums[i1], nums[i2], ..., nums[ik] with
0 <= i1 < i2 < ... < ik <= nums.length - 1, and that a sequence seq is arithmetic
if seq[i... | 32.307018 | 150 | 0.595439 |
79dc7bd2c69d9e66f4fd41d736d650cbe8f0f3c3 | 1,701 | py | Python | burrolib/util/sampling.py | kosmitive/burro | cc6662bef8693a1c160e80d9482371620deb5304 | [
"MIT"
] | 5 | 2020-06-25T23:00:26.000Z | 2020-08-28T02:51:28.000Z | burrolib/util/sampling.py | kosmitive/burrolib | 2b1d690ec9c9371f5b455dd98439dce51d270909 | [
"MIT"
] | 5 | 2020-11-09T11:43:42.000Z | 2021-01-09T13:15:09.000Z | burrolib/util/sampling.py | kosmitive/burrolib | 2b1d690ec9c9371f5b455dd98439dce51d270909 | [
"MIT"
] | null | null | null | import torch
import torch.distributions as dist
def unif_sample(sample_shape=[1], low=0, high=1):
"""Generate a sample from U(low, high).
:param sample_shape: The shape S
:param low: Lower bound on uniform
:param high: Upper bound on uniform
:return: A matrix of shape S containg samples from the ... | 29.327586 | 86 | 0.688419 |
79dc7c69de8a84a089aea3ff21c16aeace5a2c13 | 8,154 | py | Python | simon_etsy/__init__.py | shakefu/simon-etsy | 5ac57f40317ca1f060038c2f0fd42d794bc41322 | [
"Apache-2.0"
] | null | null | null | simon_etsy/__init__.py | shakefu/simon-etsy | 5ac57f40317ca1f060038c2f0fd42d794bc41322 | [
"Apache-2.0"
] | null | null | null | simon_etsy/__init__.py | shakefu/simon-etsy | 5ac57f40317ca1f060038c2f0fd42d794bc41322 | [
"Apache-2.0"
] | 3 | 2019-08-06T21:08:24.000Z | 2021-09-05T21:53:23.000Z | import html
import nltk
import time
import logging
import itertools
from collections import defaultdict
import requests
from pytool.lang import Namespace
# API Urls for ease of maintenance and review
urls = Namespace()
urls.shop.listings = 'https://openapi.etsy.com/v2/shops/{shop}/listings/active'
# Request session... | 34.550847 | 79 | 0.59247 |
79dcba643d0f1345821cd999e67f410eb9f14d4c | 1,291 | py | Python | lucky_guess/datasets.py | mfinzi/lucky-guess-chemist | 01898b733dc7d026f70d0cb6337309cb600502fb | [
"MIT"
] | null | null | null | lucky_guess/datasets.py | mfinzi/lucky-guess-chemist | 01898b733dc7d026f70d0cb6337309cb600502fb | [
"MIT"
] | null | null | null | lucky_guess/datasets.py | mfinzi/lucky-guess-chemist | 01898b733dc7d026f70d0cb6337309cb600502fb | [
"MIT"
] | null | null | null | import os
import torch
from corm_data.utils import initialize_datasets
default_qm9_dir = '~/datasets/molecular/qm9/'
def QM9datasets(root_dir=default_qm9_dir):
root_dir = os.path.expanduser(root_dir)
filename= f"{root_dir}data_boxed.pz"
if os.path.exists(filename):
return torch.load(filename)
el... | 51.64 | 144 | 0.656081 |
79dcfe5bf62d26e1e3718376da38794585f9e09c | 214 | py | Python | src/CompartmentalSystems/bins/TsTpBin.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | src/CompartmentalSystems/bins/TsTpBin.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | src/CompartmentalSystems/bins/TsTpBin.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | # vim: set ff=unix expandtab ts=4 sw=4:
from .TimeBin import TimeBin
class TsTpBin(TimeBin):
def plot(self, ax):
super().plot(ax)
ax.set_xlabel("system age")
ax.set_ylabel("pool age")
| 21.4 | 39 | 0.626168 |
79dd36e556c6021c30df4f6e2f2bdaece75c004e | 6,720 | py | Python | alsek/core/broker.py | TariqAHassan/alsek | a0d0f44d2eea1538c9d04530ae917695f624d269 | [
"MIT"
] | 1 | 2021-08-16T02:38:40.000Z | 2021-08-16T02:38:40.000Z | alsek/core/broker.py | TariqAHassan/alsek | a0d0f44d2eea1538c9d04530ae917695f624d269 | [
"MIT"
] | null | null | null | alsek/core/broker.py | TariqAHassan/alsek | a0d0f44d2eea1538c9d04530ae917695f624d269 | [
"MIT"
] | null | null | null | """
Broker
"""
import logging
from typing import Optional
from alsek._defaults import DEFAULT_TASK_TTL
from alsek._utils.logging import magic_logger
from alsek._utils.printing import auto_repr
from alsek.core.concurrency import Lock
from alsek.core.message import Message
from alsek.exceptions import MessageAlrea... | 29.344978 | 83 | 0.594048 |
79dd370922b0306597cff2e7ae2b9893cc1dcdae | 8,426 | py | Python | mtr/sync/lib/manager.py | mtrgroup/django-mtr-import-export | b8e7a6fa1cbc58b9e2126526f418306a7490cb52 | [
"MIT"
] | null | null | null | mtr/sync/lib/manager.py | mtrgroup/django-mtr-import-export | b8e7a6fa1cbc58b9e2126526f418306a7490cb52 | [
"MIT"
] | null | null | null | mtr/sync/lib/manager.py | mtrgroup/django-mtr-import-export | b8e7a6fa1cbc58b9e2126526f418306a7490cb52 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.utils.six.moves import filterfalse
from django.utils.translation import activate
from django.http import QueryDict
from django.contrib.admin.views.main import IGNORED_PARAMS
from mtr.utils.manager import BaseManager
from .helpers import make_model_class, process_at... | 31.092251 | 74 | 0.595419 |
79dd3faa842d38ec0b0f833eea5063e195163109 | 1,929 | py | Python | alipay/aop/api/domain/AnttechBlockchainDefinAssetmanagePenetrateQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AnttechBlockchainDefinAssetmanagePenetrateQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AnttechBlockchainDefinAssetmanagePenetrateQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AnttechBlockchainDefinAssetmanagePenetrateQueryModel(object):
def __init__(self):
self._biz_params = None
self._function = None
self._request_id = None
@property
... | 27.169014 | 71 | 0.596682 |
79dd7f54f98b8f35b14dcba0b0a62839ce39fb0c | 2,418 | py | Python | textbox/module/Optimizer/optim.py | StevenTang1998/TextBox | acd8298c7e6618384d585146f799d02cc475520c | [
"MIT"
] | 347 | 2021-01-09T07:55:55.000Z | 2022-03-27T00:46:36.000Z | textbox/module/Optimizer/optim.py | StevenTang1998/TextBox | acd8298c7e6618384d585146f799d02cc475520c | [
"MIT"
] | 18 | 2021-01-12T07:37:06.000Z | 2022-01-11T02:26:49.000Z | textbox/module/Optimizer/optim.py | StevenTang1998/TextBox | acd8298c7e6618384d585146f799d02cc475520c | [
"MIT"
] | 67 | 2021-01-09T07:23:52.000Z | 2022-03-27T12:02:12.000Z | # @Time : 2020/11/14
# @Author : Junyi Li
# @Email : lijunyi@ruc.edu.cn
r"""
Optimizer
#####################
"""
import numpy as np
class ScheduledOptim():
r"""A simple wrapper class for learning rate scheduling
"""
def __init__(self, optimizer, init_lr, d_model, n_warmup_steps):
self._optim... | 27.793103 | 93 | 0.630273 |
79dd7fbf0b327b55dcb96d22ec1721209fa9ecfb | 1,721 | py | Python | sdk/eventgrid/azure-mgmt-eventgrid/tests/test_domain.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/eventgrid/azure-mgmt-eventgrid/tests/test_domain.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/eventgrid/azure-mgmt-eventgrid/tests/test_domain.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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.
# -------------------------------------------------------------------... | 33.096154 | 109 | 0.592098 |
79dd8375ef5b4420613c6c108daae102d4c4ea4c | 5,832 | py | Python | whet.py | mkgvb/whet | 1b9516131f6bfe9e3b2c3faea00a651af9f267a3 | [
"MIT"
] | null | null | null | whet.py | mkgvb/whet | 1b9516131f6bfe9e3b2c3faea00a651af9f267a3 | [
"MIT"
] | null | null | null | whet.py | mkgvb/whet | 1b9516131f6bfe9e3b2c3faea00a651af9f267a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import logging
import threading
import time
import os
import Server
import websocket
import LightSchedule
import PCA9685
import PCA9685_dummy
import Settings
import Channel
from WeatherType import WeatherType
import json
from objdict import ObjDict
from outlet import outlet
DEBUG = True
MAIN_LO... | 33.136364 | 101 | 0.561043 |
79dd8a4606858f7fca1460b4b36b5b7b6d22accf | 8,292 | py | Python | src/pyfuncs/utils.py | chrk623/pyfuncs | bf78aa716893f449cf85e3d8c16ad9eb9a52bb49 | [
"MIT"
] | null | null | null | src/pyfuncs/utils.py | chrk623/pyfuncs | bf78aa716893f449cf85e3d8c16ad9eb9a52bb49 | [
"MIT"
] | null | null | null | src/pyfuncs/utils.py | chrk623/pyfuncs | bf78aa716893f449cf85e3d8c16ad9eb9a52bb49 | [
"MIT"
] | null | null | null | import re
import os
import json
import logging
import numpy as np
import pandas as pd
import requests as rq
import multiprocessing
from datetime import datetime
HOME = os.path.expanduser("~")
_RETURN_NONE = (lambda: None).__code__.co_code
minimal_headers = {
"Connection": "keep-alive",
"Upgrade-Insecure-Reque... | 27.732441 | 143 | 0.598649 |
79dda4273265211b2f6264d83ee1e91808b3d0e3 | 167,357 | py | Python | nova/tests/unit/network/test_manager.py | windskyer/nova | df485344dfd0f9e927e51273a3aaa71d948f2980 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/network/test_manager.py | windskyer/nova | df485344dfd0f9e927e51273a3aaa71d948f2980 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/network/test_manager.py | windskyer/nova | df485344dfd0f9e927e51273a3aaa71d948f2980 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 Rackspace
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2013 IBM Corp.
# 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
#
# ... | 46.154716 | 79 | 0.560807 |
79de0a22f3d9c461e7b741fd3db1ae373b3265ae | 2,206 | py | Python | src/engine/engine.py | Wombatlord/tcod-Tutorial | 0ed0276c06ebd1836691b4017750f984eefd31f9 | [
"MIT"
] | null | null | null | src/engine/engine.py | Wombatlord/tcod-Tutorial | 0ed0276c06ebd1836691b4017750f984eefd31f9 | [
"MIT"
] | null | null | null | src/engine/engine.py | Wombatlord/tcod-Tutorial | 0ed0276c06ebd1836691b4017750f984eefd31f9 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING
from tcod.console import Console
from tcod.map import compute_fov
from src.display.messageLog import MessageLog
from src.engine.inputHandlers import MainGameEventHandler
from src.display.renderFunctions import renderBar, renderNamesAtMouseLoc... | 33.424242 | 82 | 0.613781 |
79de2ce94a0bc4c4e6dbb370fb4779b221e6adc7 | 745 | py | Python | futaba/cogs/journal/__init__.py | Hoffs/futaba | 4d07c421c4229c81ddd42da1a49594b8cf11832d | [
"MIT"
] | 23 | 2018-09-17T09:06:27.000Z | 2021-05-27T15:21:37.000Z | futaba/cogs/journal/__init__.py | Hoffs/futaba | 4d07c421c4229c81ddd42da1a49594b8cf11832d | [
"MIT"
] | 257 | 2018-08-18T21:27:54.000Z | 2020-12-29T23:27:10.000Z | futaba/cogs/journal/__init__.py | Hoffs/futaba | 4d07c421c4229c81ddd42da1a49594b8cf11832d | [
"MIT"
] | 22 | 2018-09-09T09:03:13.000Z | 2021-11-09T03:34:34.000Z | #
# cogs/journal/__init__.py
#
# futaba - A Discord Mod bot for the Programming server
# Copyright (c) 2017-2020 Jake Richardson, Ammon Smith, jackylam5
#
# futaba is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in th... | 23.28125 | 68 | 0.739597 |
79de9f1dbcd637cd59f1e2bd2a812db4a70649ed | 5,559 | py | Python | cogs/encyrpted.py | prakarsh17/tessarect-bot | 6f1f05733b33bdfbcb5adc7754a059b1c2945c12 | [
"MIT"
] | 10 | 2022-01-28T11:27:36.000Z | 2022-02-25T14:24:17.000Z | cogs/encyrpted.py | prakarsh17/tessarect-bot | 6f1f05733b33bdfbcb5adc7754a059b1c2945c12 | [
"MIT"
] | 1 | 2022-01-29T15:24:17.000Z | 2022-01-29T15:24:17.000Z | cogs/encyrpted.py | prakarsh17/tessarect-bot | 6f1f05733b33bdfbcb5adc7754a059b1c2945c12 | [
"MIT"
] | 1 | 2022-01-29T03:50:33.000Z | 2022-01-29T03:50:33.000Z | import base64
import binascii
import codecs
import secrets
import discord
from discord.ext import commands
class Encryption(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.group()
async def encode(self, ctx):
""" All encode methods """
if ctx.invoked_subcommand is... | 36.572368 | 148 | 0.576543 |
79deaa2985cd24bbf81e99fb2e7a0eb1421a4351 | 2,130 | py | Python | pylibs/unittests/OTNSTestCase.py | sbeyn/ot-ns | 94d577176ca4d4579c4e45fed52d847bebe80117 | [
"BSD-3-Clause"
] | 2 | 2021-03-31T21:16:57.000Z | 2021-11-08T11:18:27.000Z | pylibs/unittests/OTNSTestCase.py | sbeyn/ot-ns | 94d577176ca4d4579c4e45fed52d847bebe80117 | [
"BSD-3-Clause"
] | null | null | null | pylibs/unittests/OTNSTestCase.py | sbeyn/ot-ns | 94d577176ca4d4579c4e45fed52d847bebe80117 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020, The OTNS Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this... | 41.764706 | 77 | 0.750235 |
79dec96497ede65ad7fb73c9155ec23c2a585c30 | 842 | py | Python | examples/pylab_examples/dashpointlabel.py | yuvallanger/matplotlib | e0020d318a9a9685594c6bff4631f74599321459 | [
"MIT",
"BSD-3-Clause"
] | 8 | 2017-04-11T08:55:30.000Z | 2022-03-25T04:31:26.000Z | examples/pylab_examples/dashpointlabel.py | epgauss/matplotlib | c9898ea9a30c67c579ab27cd61b68e2abae0fb0e | [
"MIT",
"BSD-3-Clause"
] | null | null | null | examples/pylab_examples/dashpointlabel.py | epgauss/matplotlib | c9898ea9a30c67c579ab27cd61b68e2abae0fb0e | [
"MIT",
"BSD-3-Clause"
] | 14 | 2015-10-05T04:15:46.000Z | 2020-06-11T18:06:02.000Z | import matplotlib.pyplot as plt
DATA = ((1, 3),
(2, 4),
(3, 1),
(4, 2))
# dash_style =
# direction, length, (text)rotation, dashrotation, push
# (The parameters are varied to show their effects,
# not for visual appeal).
dash_style = (
(0, 20, -15, 30, 10),
(1, 30, 0, 15, 10),
(... | 22.157895 | 59 | 0.498812 |
79ded0c0b9cc303a44c680f0862df469c64fff08 | 1,358 | py | Python | 6.extract_entities/twitterNLP/twitter_nlp_clone/hbc/python/mallet2pr.py | esh-b/Resources-for-Twitter-related-projects | 28f2b54b47b76fdb5d4804692c13bccfef1805a0 | [
"BSD-3-Clause"
] | 2 | 2019-12-10T21:54:48.000Z | 2020-06-30T20:37:57.000Z | 6.extract_entities/twitterNLP/twitter_nlp_clone/hbc/python/mallet2pr.py | esh-b/Resources-for-Twitter-related-projects | 28f2b54b47b76fdb5d4804692c13bccfef1805a0 | [
"BSD-3-Clause"
] | null | null | null | 6.extract_entities/twitterNLP/twitter_nlp_clone/hbc/python/mallet2pr.py | esh-b/Resources-for-Twitter-related-projects | 28f2b54b47b76fdb5d4804692c13bccfef1805a0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import sys
import re
threshold = float(sys.argv[1])
tp = 0
fp = 0
fn = 0
typePr = {}
for line in sys.stdin:
if re.search(r'^\d', line):
fields = line.rstrip('\n').split(' ')
gold = fields[1]
(predicted, conf) = fields[2].split(':')
print "%s\t%s\t%s" % (gold, p... | 21.21875 | 59 | 0.42489 |
79dee499089aa207cd10b28c52c0e3c5bb2046c6 | 22,421 | py | Python | wcAnalysis.py | harrisonzhu508/Bayesian-Inference-on-Football | 08bd8bfd3aa1800ca59c7572405be2405641d881 | [
"MIT"
] | null | null | null | wcAnalysis.py | harrisonzhu508/Bayesian-Inference-on-Football | 08bd8bfd3aa1800ca59c7572405be2405641d881 | [
"MIT"
] | null | null | null | wcAnalysis.py | harrisonzhu508/Bayesian-Inference-on-Football | 08bd8bfd3aa1800ca59c7572405be2405641d881 | [
"MIT"
] | null | null | null | """
The aim of this project is to predict the scores head-to-head matches of world cup 2018 in Russia.
In particular, we work under the Bayesian framework, using the Poisson regression likelihood with a normalised Gaussian prior. Our 3
approximations will be the:
- Laplace approximation,
- Metropolis-Hastings and
-... | 28.930323 | 132 | 0.596093 |
79deefd1232720e78d87b0bccb8ca9e5fcafecce | 716 | py | Python | 1629.py | gdmanandamohon/leetcode | a691a4e37ee1fdad69c710e3710c5faf8b0a7d76 | [
"MIT"
] | null | null | null | 1629.py | gdmanandamohon/leetcode | a691a4e37ee1fdad69c710e3710c5faf8b0a7d76 | [
"MIT"
] | null | null | null | 1629.py | gdmanandamohon/leetcode | a691a4e37ee1fdad69c710e3710c5faf8b0a7d76 | [
"MIT"
] | null | null | null | '''
l4zyc0d3r /// 1629 /// Sun Oct 25, 2020
'''
class Solution:
def slowestKey(self, R: List[int], K: str) -> str:
k, t = None, 0
st = 0
for i, x in enumerate(K):
if i==0: k, t = x, R[i]
elif R[i] -R[i-1]>t:
k = x
t = R[i] -R[i-1]
... | 24.689655 | 58 | 0.392458 |
79df0925b0d86712b77f413287bbf566c9d5c29f | 29 | py | Python | util/seed.py | cooperuser/rl_ctrnn | 5f05585dc6f017de60eec9929b8523a8d4da80f7 | [
"MIT"
] | 1 | 2021-10-05T13:30:00.000Z | 2021-10-05T13:30:00.000Z | util/seed.py | cooperuser/rl_ctrnn | 5f05585dc6f017de60eec9929b8523a8d4da80f7 | [
"MIT"
] | null | null | null | util/seed.py | cooperuser/rl_ctrnn | 5f05585dc6f017de60eec9929b8523a8d4da80f7 | [
"MIT"
] | null | null | null | class Seed(object):
pass
| 9.666667 | 19 | 0.655172 |
79df13107616b53c1cb2c42c9dc7605e9cec5d31 | 5,634 | py | Python | fontFeatures/shaperLib/HangulShaper.py | simoncozens/fontFeatures | d84359016019a845bf40f13d7afdb9adf813f374 | [
"BSD-3-Clause"
] | 51 | 2020-01-15T09:28:51.000Z | 2022-03-30T06:48:36.000Z | fontFeatures/shaperLib/HangulShaper.py | simoncozens/fontFeatures | d84359016019a845bf40f13d7afdb9adf813f374 | [
"BSD-3-Clause"
] | 51 | 2020-05-11T18:51:25.000Z | 2021-12-20T12:55:08.000Z | fontFeatures/shaperLib/HangulShaper.py | simoncozens/fontFeatures | d84359016019a845bf40f13d7afdb9adf813f374 | [
"BSD-3-Clause"
] | 8 | 2020-08-28T20:03:14.000Z | 2021-12-08T01:22:28.000Z | from .BaseShaper import BaseShaper
from fontFeatures.shaperLib.Buffer import BufferItem
import unicodedata
LBase = 0x1100
VBase = 0x1161
TBase = 0x11A7
LCount = 19
VCount = 21
TCount = 28
SBase = 0xAC00
NCount = (VCount * TCount)
SCount = (LCount * NCount)
def isCombiningL(u):
return LBase <= u <= LBase+LCount-1
... | 38.589041 | 122 | 0.447284 |
79df168f9b3b35d0af2282bb6ab9d8fef81e5061 | 2,625 | py | Python | pydmrs/utils.py | vishalbelsare/pydmrs | 795b35dba4986fa9084eaa81fb16206cb131a752 | [
"MIT"
] | 14 | 2015-11-27T14:22:26.000Z | 2022-03-02T21:11:28.000Z | pydmrs/utils.py | vishalbelsare/pydmrs | 795b35dba4986fa9084eaa81fb16206cb131a752 | [
"MIT"
] | 25 | 2015-11-27T16:08:19.000Z | 2019-08-28T10:13:06.000Z | pydmrs/utils.py | vishalbelsare/pydmrs | 795b35dba4986fa9084eaa81fb16206cb131a752 | [
"MIT"
] | 8 | 2015-11-01T17:57:44.000Z | 2021-06-04T05:33:38.000Z | import os
from configparser import ConfigParser, NoSectionError, NoOptionError
import pydmrs
CONFIG_DIR = os.path.normpath(os.path.join(pydmrs.__file__, '../__config__'))
def get_config_option(config, section, option, opt_type=None, default=None):
"""
Safe read of config option that returns default va... | 32.8125 | 100 | 0.645714 |
79df2f440e115906238394c237bdddc2c9be4d07 | 2,757 | py | Python | tests/test_cm.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | null | null | null | tests/test_cm.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | 4 | 2021-06-08T20:20:08.000Z | 2022-03-11T23:30:22.000Z | tests/test_cm.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | null | null | null | """ run with
nosetests -v --nocapture test_cm.py
"""
from __future__ import print_function
from cloudmesh_base.util import HEADING
from cloudmesh_base.logger import LOGGER, LOGGING_ON, LOGGING_OFF
log = LOGGER(__file__)
import sys
import os
if os.path.isdir(os.path.expanduser("~/.cloudmesh")):
print("ERROR", ... | 24.184211 | 91 | 0.509249 |
79df44de2b6161e4de42a4ad46251220f8c3e10f | 7,529 | py | Python | docs/conf.py | HowardHu97/ZOOpt | 01568e8e6b0e65ac310d362af2da5245ac375e53 | [
"MIT"
] | 1 | 2018-11-03T12:05:00.000Z | 2018-11-03T12:05:00.000Z | docs/conf.py | HowardHu97/ZOOpt | 01568e8e6b0e65ac310d362af2da5245ac375e53 | [
"MIT"
] | null | null | null | docs/conf.py | HowardHu97/ZOOpt | 01568e8e6b0e65ac310d362af2da5245ac375e53 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 37.457711 | 121 | 0.682826 |
79df69a19c490072da8f0418c5a6812ecdc151b8 | 2,899 | py | Python | bigml/tests/create_library_steps.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:38.000Z | 2021-08-30T20:18:38.000Z | bigml/tests/create_library_steps.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | null | null | null | bigml/tests/create_library_steps.py | deven96/python | 46be8622fe58f004bdbd636a08a8904ef4134bcd | [
"Apache-2.0"
] | 1 | 2021-08-30T20:18:40.000Z | 2021-08-30T20:18:40.000Z | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015-2019 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 35.790123 | 87 | 0.701966 |
79df6e9b331c82785f2d1bd024a58b069c652229 | 1,904 | py | Python | chuckle_bot/ally_message.py | GTOliver/Chucklebot | 488ee5476a731ebc89db2ae6d69d7de2fcd76925 | [
"Apache-2.0"
] | null | null | null | chuckle_bot/ally_message.py | GTOliver/Chucklebot | 488ee5476a731ebc89db2ae6d69d7de2fcd76925 | [
"Apache-2.0"
] | null | null | null | chuckle_bot/ally_message.py | GTOliver/Chucklebot | 488ee5476a731ebc89db2ae6d69d7de2fcd76925 | [
"Apache-2.0"
] | null | null | null | """
AllyMessages are things which are said to allies
AllyMessages are said to either all, or certain specific people.
This is represented by the "target".
Types of message:
* <CHAR> SHOULD ATTACK
* <CHAR> SHOULD RETREAT
* <CHAR> SHOULD WAIT
* <CHAR_A> SHOULD SUPPORT <CHAR_B>
* <ALL> SHOULD SUPPORT <CHAR_B>... | 28.848485 | 88 | 0.697479 |
79e0064cc8a83f231ce0d3d40bd87f2a2f23df46 | 2,775 | py | Python | test/blackbox/rmq_2_sysmon/blackbox_libs.py | mjpernot/rmq-sysmon | 728f696a451b6c870feb22e53be09bfcd7ed3c77 | [
"MIT"
] | null | null | null | test/blackbox/rmq_2_sysmon/blackbox_libs.py | mjpernot/rmq-sysmon | 728f696a451b6c870feb22e53be09bfcd7ed3c77 | [
"MIT"
] | null | null | null | test/blackbox/rmq_2_sysmon/blackbox_libs.py | mjpernot/rmq-sysmon | 728f696a451b6c870feb22e53be09bfcd7ed3c77 | [
"MIT"
] | null | null | null | # Classification (U)
"""Program: blackbox_libs.py
Description: Blackbox libraries for the test testing of rmq_2_sysmon.py
program.
Usage:
test/blackbox/rmq_2_sysmon/blackbox_libs.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import os
import sys
# Third-party
import... | 23.125 | 76 | 0.64 |
79e00b2656ba77a8ea00d9e4c55b0d02495b5661 | 2,403 | py | Python | python/ray/experimental/sgd/test_sgd.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 3 | 2019-05-01T04:31:20.000Z | 2021-03-01T09:25:36.000Z | python/ray/experimental/sgd/test_sgd.py | collinswei/ray | 2e30f7ba386e716bf80f019dcd473b67d83abb95 | [
"Apache-2.0"
] | 4 | 2019-03-04T13:03:24.000Z | 2019-06-06T11:25:07.000Z | python/ray/experimental/sgd/test_sgd.py | collinswei/ray | 2e30f7ba386e716bf80f019dcd473b67d83abb95 | [
"Apache-2.0"
] | 6 | 2019-03-12T05:37:35.000Z | 2020-03-09T12:25:17.000Z | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import time
import ray
from ray.experimental.sgd.tfbench.test_model import TFBenchModel
from ray.experimental.sgd.sgd import DistributedSGD
parser = argparse.ArgumentPar... | 35.338235 | 79 | 0.686642 |
79e01a61f5236a5ca8422980a131baacb1f2e564 | 15,254 | py | Python | oscar/lib/python2.7/site-packages/pygments/lexers/idl.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pygments/lexers/idl.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pygments/lexers/idl.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pygments.lexers.idl
~~~~~~~~~~~~~~~~~~~
Lexers for IDL.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, words
from pygments.token import Text,... | 56.287823 | 82 | 0.569949 |
79e0227bae7cfa7e31c6646b4474961867fce7cb | 1,430 | py | Python | setup.py | RhinosF1/sopel-quotes | 958ce2f8886909943d3345646f4847226f3cb8fa | [
"MIT"
] | null | null | null | setup.py | RhinosF1/sopel-quotes | 958ce2f8886909943d3345646f4847226f3cb8fa | [
"MIT"
] | null | null | null | setup.py | RhinosF1/sopel-quotes | 958ce2f8886909943d3345646f4847226f3cb8fa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
from setuptools import setup, find_packages
if __name__ == '__main__':
print('Sopel does not correctly load modules installed with setup.py '
'directly. Please use "pip install .", or add {}/sopel_modules to '
'... | 31.777778 | 78 | 0.706294 |
79e0284cc738bb765b9dc97bcfd8dc8a6815ca50 | 1,118 | py | Python | tiny_classifier/utils/assign_train_test.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 923 | 2020-01-11T06:36:53.000Z | 2022-03-31T00:26:57.000Z | tiny_classifier/utils/assign_train_test.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 25 | 2020-02-27T08:35:46.000Z | 2022-01-25T08:54:19.000Z | tiny_classifier/utils/assign_train_test.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 262 | 2020-01-02T02:19:40.000Z | 2022-03-23T04:56:16.000Z | import os
import glob
import shutil
import random
root = "./ROI_data"
from_dir = os.path.join(root, "ALL")
train_dir = os.path.join(root, "train")
test_dir = os.path.join(root, "test")
def mkdir(dir):
if not os.path.exists(dir):
os.makedirs(dir)
mkdir(train_dir)
mkdir(test_dir)
ratio_train = 0.8
for... | 25.409091 | 76 | 0.660107 |
79e02ab1110084992d8fd5a57751a67bcbb974b9 | 9,639 | py | Python | arjuna-samples/arjex/test/pkg/rules/check_rules_04_priority.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna-samples/arjex/test/pkg/rules/check_rules_04_priority.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna-samples/arjex/test/pkg/rules/check_rules_04_priority.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | # This file is a part of Arjuna
# Copyright 2015-2020 Rahul Verma
# Website: www.RahulVerma.net
# 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... | 27.305949 | 74 | 0.658471 |
79e02e65634d7cd4cbb1a28503e38cb38e0979d3 | 13,856 | py | Python | main/kelvinator/tasks.py | mahkhaled/class2go | b32cb441e8d96c257f70cb61274812ebeed2649d | [
"Apache-2.0"
] | null | null | null | main/kelvinator/tasks.py | mahkhaled/class2go | b32cb441e8d96c257f70cb61274812ebeed2649d | [
"Apache-2.0"
] | null | null | null | main/kelvinator/tasks.py | mahkhaled/class2go | b32cb441e8d96c257f70cb61274812ebeed2649d | [
"Apache-2.0"
] | null | null | null | # Video handling utilities.
#
# Two things in this file
# 1. Kelvinator - simple method of extracting key frames for a video.
# 2. Resize - simple transcoder to create smaller versions of videos.
#
# Requirements:
# 1. ffmpeg
# 2. x264 for transcoding
# 3. Python Imaging: PIL, or Image
#
# For more info on transcodi... | 39.252125 | 248 | 0.65892 |
79e044aa5dacf21af42bf9b17bacfa94a8a11dd5 | 459 | py | Python | chatrooms/apps/users/tests/factories.py | EliasCampos/chatrooms_py | 9e1abaf5887293e1df6f0b91eb0f9587e8d405fc | [
"MIT"
] | null | null | null | chatrooms/apps/users/tests/factories.py | EliasCampos/chatrooms_py | 9e1abaf5887293e1df6f0b91eb0f9587e8d405fc | [
"MIT"
] | null | null | null | chatrooms/apps/users/tests/factories.py | EliasCampos/chatrooms_py | 9e1abaf5887293e1df6f0b91eb0f9587e8d405fc | [
"MIT"
] | null | null | null | import functools
from factory import Faker, LazyFunction
from chatrooms.apps.common.tests.factories import TortoiseModelFactory
from chatrooms.apps.users.models import User
from chatrooms.apps.users.security import get_password_hash
USER_PASSWORD = 'strongpassword'
class UserFactory(TortoiseModelFactory):
ema... | 24.157895 | 80 | 0.795207 |
79e04970c69a8db4a56c475d02e63c6e0beb7a66 | 461 | py | Python | scripts/reset_vendor.py | isometry/terraform-provider-zpa | 6fe10c4e7ba25e89d8a615b829d47a557eb36b72 | [
"MIT"
] | null | null | null | scripts/reset_vendor.py | isometry/terraform-provider-zpa | 6fe10c4e7ba25e89d8a615b829d47a557eb36b72 | [
"MIT"
] | null | null | null | scripts/reset_vendor.py | isometry/terraform-provider-zpa | 6fe10c4e7ba25e89d8a615b829d47a557eb36b72 | [
"MIT"
] | null | null | null | """Script to update vendor dependencies"""
import os
def main():
"""Main function"""
gopath = os.environ["GOPATH"]
terraform_path = os.path.join(*[gopath, "src", "github.com", "willguibr",
"terraform-provider-zpa"])
os.chdir(terraform_path)
os.system("git reset ... | 25.611111 | 77 | 0.592191 |
79e04a2db77faf8ffe382095af4991d84cbeed75 | 11,006 | py | Python | mtp_noms_ops/apps/security/export.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | null | null | null | mtp_noms_ops/apps/security/export.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | null | null | null | mtp_noms_ops/apps/security/export.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-noms-ops | eb537fb8a8e3adc588d50af1b000402c957b32a7 | [
"MIT"
] | null | null | null | import datetime
import re
from django.http import HttpResponse
from django.utils.dateparse import parse_datetime
from openpyxl import Workbook
from security.models import credit_sources, disbursement_methods
from security.templatetags.security import (
currency, format_card_number, format_sort_code,
format_re... | 40.315018 | 108 | 0.607759 |
79e04e11d47c84dde40c1199857bed8416469532 | 5,010 | py | Python | train.py | justinbellucci/DL-image-classifier-app | 9f883384e8d4b5603dfd9441c306d30e2b8d72ac | [
"MIT"
] | null | null | null | train.py | justinbellucci/DL-image-classifier-app | 9f883384e8d4b5603dfd9441c306d30e2b8d72ac | [
"MIT"
] | null | null | null | train.py | justinbellucci/DL-image-classifier-app | 9f883384e8d4b5603dfd9441c306d30e2b8d72ac | [
"MIT"
] | null | null | null | # PROGRAMMER: Justin Bellucci
# DATE CREATED: 04_18_2020
# REVISED DATE:
# Imports python modules
import torch
# import torch.nn.functional as F
from torch import nn, optim
# from collections import OrderedDict
from torchvision import models
from workspace_utils import active_sessio... | 38.837209 | 102 | 0.603992 |
79e0587d73d32a1cc9b3f3720f685a7eac6030d9 | 1,454 | py | Python | platon/tools/pytest_platon/deployer.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platon/tools/pytest_platon/deployer.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platon/tools/pytest_platon/deployer.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | from typing import (
Any,
Callable,
Dict,
Tuple,
)
from platon_typing import (
ContractName,
)
from platonpm import (
Package,
)
from platon.tools.pytest_platon.exceptions import (
DeployerError,
)
from platon.tools.pytest_platon.linker import (
deploy,
linker,
)
class Deployer:
... | 27.961538 | 81 | 0.63205 |
79e06cb78914a656ade966a498b0cb476c07702a | 3,431 | py | Python | examples/launch.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | examples/launch.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | examples/launch.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | """
Usage:
launch.py <init_filename>
launch.py <init_filename> <zip_path> [--noS3 | --noupload]
Arguments:
initExp_path (required) : path to a YAML file for arguments to launch experiment
zip_path (optional) : zip file that contains the targets
(which are then uploaded to S3).... | 31.477064 | 95 | 0.64063 |
79e0d8cf713b13d90aeec75f7ebc94055ac85014 | 3,054 | py | Python | alipay/aop/api/domain/AlipayOpenMiniInnerappPluginuseconfigOnlineModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOpenMiniInnerappPluginuseconfigOnlineModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOpenMiniInnerappPluginuseconfigOnlineModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenMiniInnerappPluginuseconfigOnlineModel(object):
def __init__(self):
self._app_origin = None
self._bundle_id = None
self._mini_app_id = None
self._plugin_... | 30.237624 | 87 | 0.609037 |
79e0fe165c813827363bffa37ffc109c489318d6 | 1,570 | py | Python | setup.py | svenXY/prometheus-mysql-exporter | a7e5c126fee234f95a8c5b2eb2390c4f9268d5ea | [
"MIT"
] | 35 | 2017-01-25T06:50:01.000Z | 2021-12-23T15:44:46.000Z | setup.py | weiya1990/prometheus-mysql-exporter | 52f2ac4c8dfa30d9dced98a137e89441581d527c | [
"MIT"
] | 17 | 2018-01-18T09:55:45.000Z | 2021-08-03T09:08:21.000Z | setup.py | weiya1990/prometheus-mysql-exporter | 52f2ac4c8dfa30d9dced98a137e89441581d527c | [
"MIT"
] | 18 | 2017-06-12T08:44:11.000Z | 2021-12-23T15:44:58.000Z | from setuptools import setup, find_packages
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='prometheus-mysql-exporter',
version='0.5.0',
description='MySQL quer... | 31.4 | 73 | 0.618471 |
79e12e030a122b9d5f5df04e14893d4d4d4414db | 5,469 | py | Python | SCRAPE/Lib/site-packages/scrapy/spiders/feed.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1 | 2019-09-16T12:22:36.000Z | 2019-09-16T12:22:36.000Z | SCRAPE/Lib/site-packages/scrapy/spiders/feed.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1 | 2021-09-20T19:54:42.000Z | 2021-09-20T19:54:42.000Z | SCRAPE/Lib/site-packages/scrapy/spiders/feed.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1 | 2022-03-17T17:21:11.000Z | 2022-03-17T17:21:11.000Z | """
This module implements the XMLFeedSpider which is the recommended spider to use
for scraping from an XML feed.
See documentation in docs/topics/spiders.rst
"""
from scrapy.spiders import Spider
from scrapy.utils.iterators import xmliter, csviter
from scrapy.utils.spider import iterate_spider_output
from scrapy.sel... | 40.213235 | 101 | 0.676906 |
79e15273fade9833e1705ad99b5680194366d988 | 34,128 | py | Python | content/test/gpu/generate_buildbot_json.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | content/test/gpu/generate_buildbot_json.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | content/test/gpu/generate_buildbot_json.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | #!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to generate chromium.gpu.json and chromium.gpu.fyi.json in
the src/testing/buildbot directory. Maintaining these files by han... | 28.275062 | 80 | 0.56754 |
79e15ee5b07dea7cc5357383828b0267e15e6e26 | 5,373 | py | Python | image/docker/squashed.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | 1 | 2020-10-16T19:30:41.000Z | 2020-10-16T19:30:41.000Z | image/docker/squashed.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | 15 | 2020-06-18T15:32:06.000Z | 2022-03-03T23:06:24.000Z | image/docker/squashed.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | null | null | null | import copy
import json
import math
import calendar
from app import app
from image.common import TarImageFormatter
from util.registry.gzipwrap import GZIP_BUFFER_SIZE
from util.registry.streamlayerformat import StreamLayerMerger
class FileEstimationException(Exception):
"""
Exception raised by build_docker_l... | 36.80137 | 100 | 0.653452 |
79e174dc8ada0573018643143a53704d9ae57ddb | 1,859 | py | Python | venv/Lib/site-packages/pyrogram/raw/base/page_caption.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/raw/base/page_caption.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/raw/base/page_caption.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 37.18 | 90 | 0.638515 |
79e18d3a320b9d36d0cfb0b19d9adf44b484d21a | 1,136 | gyp | Python | third_party/mozilla/mozilla.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | third_party/mozilla/mozilla.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | third_party/mozilla/mozilla.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright 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.
{
'targets': [
{
'target_name': 'mozilla',
'type': '<(component)',
'sources': [
'MozillaExport.h',
'NSPasteboard+Util... | 24.695652 | 72 | 0.503521 |
79e1997e0ae37404b56abec0be572befac55bb2a | 699 | py | Python | src/hauberk/cli.py | akail/hauberk | 1fd990bdb78c78e1e8b1cee76fa8f414590fcee8 | [
"MIT"
] | null | null | null | src/hauberk/cli.py | akail/hauberk | 1fd990bdb78c78e1e8b1cee76fa8f414590fcee8 | [
"MIT"
] | 56 | 2018-07-31T01:00:54.000Z | 2020-08-06T16:00:02.000Z | src/hauberk/cli.py | akail/hauberk | 1fd990bdb78c78e1e8b1cee76fa8f414590fcee8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Console script for hauberk."""
import logging
import sys
import click
import yaml
from hauberk.log import setup_logger
logger = logging.getLogger(__name__)
@click.command()
@click.argument('input', type=click.File('rb'))
@click.option('--dry', is_flag=True, help="Dry run of rules")
@cli... | 19.971429 | 62 | 0.665236 |
79e19abf2887347e2b30c18e609bb13b0e9e969b | 57,200 | py | Python | src/buildstream/_frontend/cli.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | src/buildstream/_frontend/cli.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | src/buildstream/_frontend/cli.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | import os
import sys
from functools import partial
import shutil
import click
from .. import _yaml
from .._exceptions import BstError, LoadError, AppError, RemoteError
from .complete import main_bashcomplete, complete_path, CompleteUnhandled
from ..types import _CacheBuildTrees, _SchedulerErrorAction, _PipelineSelecti... | 35.660848 | 119 | 0.61757 |
79e1cfb2a5fc6cf1b689d8b55cfb6caa5c4c72b8 | 2,299 | py | Python | lib/validation.py | ankile/reinforcement-trading | 849ba30d8be05abf1e9eae919463c4eebe812ce8 | [
"MIT"
] | 1 | 2021-01-08T12:43:14.000Z | 2021-01-08T12:43:14.000Z | lib/validation.py | ankile/reinforcement-trading | 849ba30d8be05abf1e9eae919463c4eebe812ce8 | [
"MIT"
] | 1 | 2021-04-30T21:08:55.000Z | 2021-04-30T21:08:55.000Z | lib/validation.py | ankile/reinforcement-trading | 849ba30d8be05abf1e9eae919463c4eebe812ce8 | [
"MIT"
] | null | null | null | # Adapted from code from the book "Deep Reinforcement Learning" by Maxim Lapan
import numpy as np
import torch
from lib import environ
def validation_run(env, net, episodes=100, device="cpu", epsilon=0.02, comission=0.1):
stats = {
"episode_reward": [],
"episode_steps": [],
"order_profits... | 33.318841 | 87 | 0.525446 |
79e207e0251320d7a5bd1416e66dd7ff4a90a874 | 4,855 | py | Python | venv/lib/python3.6/site-packages/kubernetes/client/models/v1_service_reference.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1_service_reference.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1_service_reference.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1Ser... | 28.391813 | 183 | 0.576519 |
79e229aaecacda75068449f0fb4c178fa12adb60 | 936 | py | Python | setup.py | joostsijm/rival_regions_wrapper | f518ad4075b165078aee3c6dd93a0b4e8c3ba6d4 | [
"MIT"
] | 2 | 2021-04-06T15:39:52.000Z | 2021-04-09T11:37:21.000Z | setup.py | joostsijm/rival_regions_wrapper | f518ad4075b165078aee3c6dd93a0b4e8c3ba6d4 | [
"MIT"
] | 3 | 2021-03-28T10:59:49.000Z | 2021-04-02T09:43:16.000Z | setup.py | joostsijm/rival_regions_wrapper | f518ad4075b165078aee3c6dd93a0b4e8c3ba6d4 | [
"MIT"
] | 3 | 2021-03-19T13:11:47.000Z | 2021-08-28T14:16:54.000Z | """Setup file"""
import setuptools
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
setuptools.setup(
name="rival_regions_wrapper",
version="1.3.2",
author="Joost Sijm",
author_email="joostsijm@gmail.com",
description="Rival Regions API wrapper",
long_description=LONG_DESCR... | 26 | 61 | 0.619658 |
79e239eb398ce3f53f4ff9d939c4bc889909c99b | 161,860 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 49.483338 | 1,999 | 0.674645 |
79e24eb7ccca8f82c69ec0c579dfd5e21edae67e | 1,655 | py | Python | envs.py | mabirck/modular_DeepRL | 96dca56b3457ca035153287ae60897b0cb40c1b0 | [
"MIT"
] | null | null | null | envs.py | mabirck/modular_DeepRL | 96dca56b3457ca035153287ae60897b0cb40c1b0 | [
"MIT"
] | null | null | null | envs.py | mabirck/modular_DeepRL | 96dca56b3457ca035153287ae60897b0cb40c1b0 | [
"MIT"
] | null | null | null | import os
import gym, roboschool
from gym.spaces.box import Box
from baselines import bench
from baselines.common.atari_wrappers import make_atari, wrap_deepmind
try:
import pybullet_envs
import roboschool
except ImportError:
pass
def make_env(env_id, seed, rank, log_dir):
def _thunk():
pri... | 31.226415 | 110 | 0.630816 |
79e26fd82462eedd442c7a379ee4db540b9cab1a | 847 | py | Python | src/wishlist/wish/utils.py | Zeebrow/wish | 9a0efeb70e1646ed12cac03b2419cbeca10e3c1c | [
"MIT"
] | null | null | null | src/wishlist/wish/utils.py | Zeebrow/wish | 9a0efeb70e1646ed12cac03b2419cbeca10e3c1c | [
"MIT"
] | 3 | 2021-09-26T11:33:24.000Z | 2021-10-16T01:39:19.000Z | src/wishlist/wish/utils.py | Zeebrow/wish | 9a0efeb70e1646ed12cac03b2419cbeca10e3c1c | [
"MIT"
] | null | null | null | import logging
import re
from git import Repo
from . import constants as C
from . import wish
logger = logging.getLogger(__name__)
def get_wishes(wishlist_file=C.wishlist):
"""
click command 'ls'
Returns list of wishes
"""
_regex = C.wish_regex
wishlist = []
with open(wishlist_file, 'r')... | 21.717949 | 54 | 0.57497 |
79e29fb3f5dc0dc1be6b9624e2676d7eb4c79d87 | 5,401 | py | Python | src/functions/samples.py | spasmann/1DQMC | f56483428f03c63d06c16b7fd7f56231296dd940 | [
"MIT"
] | null | null | null | src/functions/samples.py | spasmann/1DQMC | f56483428f03c63d06c16b7fd7f56231296dd940 | [
"MIT"
] | null | null | null | src/functions/samples.py | spasmann/1DQMC | f56483428f03c63d06c16b7fd7f56231296dd940 | [
"MIT"
] | 1 | 2022-01-25T18:09:23.000Z | 2022-01-25T18:09:23.000Z | # -*- coding: utf-8 -*-
import numpy as np
import math
from scipy.stats.qmc import Sobol, Halton, LatinHypercube
from src.functions.particle import Particle
from src.functions.moment_matching import shift_samples
class Samples:
"""
Class for generating list of Particles given various initial conditions.
... | 33.546584 | 77 | 0.574338 |
79e2b57866e2d29bb04fda478adda88a1444e762 | 611 | py | Python | main/migrations/0032_auto_20170926_1344.py | OKThess/website | 3d5a2a125bfb48179937b058aa7180b751eb2b43 | [
"MIT"
] | 5 | 2017-08-25T16:37:18.000Z | 2019-02-25T18:26:37.000Z | main/migrations/0032_auto_20170926_1344.py | OKThess/website | 3d5a2a125bfb48179937b058aa7180b751eb2b43 | [
"MIT"
] | 43 | 2017-01-22T23:58:43.000Z | 2018-05-17T21:35:16.000Z | main/migrations/0032_auto_20170926_1344.py | OKThess/website | 3d5a2a125bfb48179937b058aa7180b751eb2b43 | [
"MIT"
] | 2 | 2017-11-05T08:36:02.000Z | 2017-12-22T17:37:19.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-26 13:44
from __future__ import unicode_literals
import ckeditor.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0031_auto_20170925_1638'),
]
operations = [
migratio... | 22.62963 | 50 | 0.592471 |
79e2b86d7c03fd1da1ab7c5e723f36fa53a5280a | 844 | py | Python | data/transcoder_evaluation_gfg/python/COUNT_NUMBER_OF_WAYS_TO_FILL_A_N_X_4_GRID_USING_1_X_4_TILES.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/COUNT_NUMBER_OF_WAYS_TO_FILL_A_N_X_4_GRID_USING_1_X_4_TILES.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/COUNT_NUMBER_OF_WAYS_TO_FILL_A_N_X_4_GRID_USING_1_X_4_TILES.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( n ) :
dp = [ 0 for _ in range ( n + 1 ) ]
for i in range ( 1 , n + 1 ) :
if i <= 3 :
dp... | 22.210526 | 64 | 0.476303 |
79e2ea50a66d3884d8c3f6ee1193dd37b1811f11 | 354 | py | Python | examples/fun.py | FusionSid/FusionSidAPI.py | e1b50622bf4fcec8265f8fd4e9b3ac79b580d286 | [
"MIT"
] | 5 | 2022-03-05T23:29:33.000Z | 2022-03-20T07:44:20.000Z | examples/fun.py | FusionSid/FusionSidAPI.py | e1b50622bf4fcec8265f8fd4e9b3ac79b580d286 | [
"MIT"
] | null | null | null | examples/fun.py | FusionSid/FusionSidAPI.py | e1b50622bf4fcec8265f8fd4e9b3ac79b580d286 | [
"MIT"
] | null | null | null | import asyncio
from fusionsid import Fun
async def main():
roast = await Fun.roast()
print(roast)
complement = await Fun.compliment()
print(complement)
fact = await Fun.fact()
print(fact)
search = await Fun.reddit_search("discord bots")
print(search)
loop = asyncio.new_event_loop(... | 16.857143 | 52 | 0.686441 |
79e2f0c1a61e8b0eb08eeec7dfd38a79936554fc | 1,631 | py | Python | salt/modules/osxdesktop.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | 1 | 2016-12-20T20:11:21.000Z | 2016-12-20T20:11:21.000Z | salt/modules/osxdesktop.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | salt/modules/osxdesktop.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | '''
Mac OS X implementations of various commands in the "desktop" interface
'''
def __virtual__():
'''
Only load on Mac systems
'''
if __grains__['os'] == 'MacOS':
return 'desktop'
return False
def get_output_volume():
'''
Get the output volume (range 0 to 100)
CLI Example:
... | 18.325843 | 108 | 0.602698 |
79e304e4ff9eb20f422dd1b99efc47120a80aba2 | 1,332 | py | Python | python-patterns-guide/creational-patterns/composition-over-inheritance/logger_decorator_pattern.py | leemengtaiwan/design-patterns | 1657caab1a5654b253e1c6f9b8c4af1017d79c4c | [
"MIT"
] | 2 | 2021-06-20T01:25:43.000Z | 2021-07-06T16:16:55.000Z | python-patterns-guide/creational-patterns/composition-over-inheritance/logger_decorator_pattern.py | leemengtaiwan/design-patterns | 1657caab1a5654b253e1c6f9b8c4af1017d79c4c | [
"MIT"
] | null | null | null | python-patterns-guide/creational-patterns/composition-over-inheritance/logger_decorator_pattern.py | leemengtaiwan/design-patterns | 1657caab1a5654b253e1c6f9b8c4af1017d79c4c | [
"MIT"
] | null | null | null | import sys
import syslog
from abc import ABC, abstractmethod
class AbstractLogger(ABC):
@abstractmethod
def log(self):
pass
class FileLogger(AbstractLogger):
def __init__(self, file):
self.file = file
def log(self, message):
self.file.write(message + '\n')
self.file.... | 22.576271 | 59 | 0.648649 |
79e3292eed20d6441e61d78d9dde6f53b9175f59 | 131,100 | py | Python | src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py | LGDoor/azure-cli-extensions | 570a7c181999c1dd160d48f8454aab6cea057a20 | [
"MIT"
] | null | null | null | src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py | LGDoor/azure-cli-extensions | 570a7c181999c1dd160d48f8454aab6cea057a20 | [
"MIT"
] | null | null | null | src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py | LGDoor/azure-cli-extensions | 570a7c181999c1dd160d48f8454aab6cea057a20 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 42.689678 | 2,472 | 0.648162 |
79e32a094aaddfa29d702d2e4e5a0ce59406ee86 | 2,307 | py | Python | python_solutions/DOUBLE_SQUARES/DOUBLE_SQUARES.py | joelstanner/codeeval | ef0591fabcad39d45f10287d7a1330f342ab96e0 | [
"MIT"
] | null | null | null | python_solutions/DOUBLE_SQUARES/DOUBLE_SQUARES.py | joelstanner/codeeval | ef0591fabcad39d45f10287d7a1330f342ab96e0 | [
"MIT"
] | null | null | null | python_solutions/DOUBLE_SQUARES/DOUBLE_SQUARES.py | joelstanner/codeeval | ef0591fabcad39d45f10287d7a1330f342ab96e0 | [
"MIT"
] | null | null | null | """
A double-square number is an integer X which can be expressed as the sum of two
perfect squares. For example, 10 is a double-square because 10 = 3^2 + 1^2.
Your task in this problem is, given X, determine the number of ways in which
it can be written as the sum of two squares.
For example, 10 can only be written a... | 25.921348 | 81 | 0.645427 |
79e463c98d124de669e579898346f8a052a03996 | 3,669 | py | Python | model/proxy.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 15 | 2018-04-18T13:25:30.000Z | 2022-03-04T09:25:41.000Z | model/proxy.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 221 | 2018-04-12T06:29:43.000Z | 2022-03-27T03:01:40.000Z | model/proxy.py | busunkim96/cc-utils | aa864b1fad3061410907d6b93b8aee8cd25f33b5 | [
"Apache-2.0"
] | 29 | 2018-04-11T14:42:23.000Z | 2021-11-09T16:26:32.000Z | # Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | 29.352 | 100 | 0.661488 |
79e48aecde3ff49dccf55e4ec209ccb0cd68bc0d | 1,271 | py | Python | config.py | jotacor/tradunio-web | 75f7893b96c11d62298ac4c06c2c244a00d6762b | [
"MIT"
] | 2 | 2016-02-23T14:50:04.000Z | 2016-02-23T14:51:57.000Z | config.py | jotacor/tradunio-web | 75f7893b96c11d62298ac4c06c2c244a00d6762b | [
"MIT"
] | null | null | null | config.py | jotacor/tradunio-web | 75f7893b96c11d62298ac4c06c2c244a00d6762b | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.environ.get('MAIL_USE... | 27.630435 | 71 | 0.692368 |
79e4b5d7744f735bc87dbe2f8b797031f5cdbd6d | 261 | py | Python | chainer/training/triggers/__init__.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | chainer/training/triggers/__init__.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | chainer/training/triggers/__init__.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | from chainer.training.triggers import interval
from chainer.training.triggers import minmax_value_trigger
IntervalTrigger = interval.IntervalTrigger
MaxValueTrigger = minmax_value_trigger.MaxValueTrigger
MinValueTrigger = minmax_value_trigger.MinValueTrigger
| 32.625 | 58 | 0.888889 |
79e4b8c110e5eb4634f8cc5d1624785cae55e4ae | 5,297 | py | Python | df_config/manage.py | d9pouces/df_conf | b905e8efea80633c3b95c22c19c0d13604a71a5b | [
"CECILL-B"
] | null | null | null | df_config/manage.py | d9pouces/df_conf | b905e8efea80633c3b95c22c19c0d13604a71a5b | [
"CECILL-B"
] | null | null | null | df_config/manage.py | d9pouces/df_conf | b905e8efea80633c3b95c22c19c0d13604a71a5b | [
"CECILL-B"
] | null | null | null | # ##############################################################################
# This file is part of df_config #
# #
# Copyright (C) 2020 Matthieu Gallet <github@19pouces.net> ... | 43.065041 | 93 | 0.58939 |
79e5211cdb3d6bf4e401728bdbce984a9b9d729b | 1,411 | py | Python | wikidump/extractors/arxiv.py | CristianCantoro/wikidump | f1d50b16c483b74a624cab38e003513df588b11b | [
"MIT"
] | 5 | 2019-02-28T13:39:30.000Z | 2021-09-13T00:42:34.000Z | wikidump/extractors/arxiv.py | Rickaphile/wikidump | 5c5af3192fa1772f0fdc8e902d7902f379d3efe9 | [
"MIT"
] | 1 | 2021-05-30T12:35:52.000Z | 2021-06-18T14:08:23.000Z | wikidump/extractors/arxiv.py | Rickaphile/wikidump | 5c5af3192fa1772f0fdc8e902d7902f379d3efe9 | [
"MIT"
] | 3 | 2020-04-07T01:27:12.000Z | 2021-05-29T16:03:42.000Z | """Extractor for "arxiv" identifiers.
Regular expressions taken from `python-mwcites` by Aaron Halfaker.
See https://github.com/mediawiki-utilities/python-mwcites
"""
import regex as re
from typing import Iterator
from .common import CaptureResult, Identifier, Span
__all__ = ('extract',)
# From http://arxiv.org/hel... | 32.068182 | 69 | 0.581148 |
79e52324e9eb86c6e5f0f5c962c7be179eddb6dc | 1,875 | py | Python | dashboard/forms.py | riparias/early-warning-webapp | 702691a6ecbabc7865e5f232e125c8dee28a7f2e | [
"MIT"
] | null | null | null | dashboard/forms.py | riparias/early-warning-webapp | 702691a6ecbabc7865e5f232e125c8dee28a7f2e | [
"MIT"
] | 124 | 2021-09-02T06:53:33.000Z | 2022-03-31T12:46:51.000Z | dashboard/forms.py | riparias/early-warning-webapp | 702691a6ecbabc7865e5f232e125c8dee28a7f2e | [
"MIT"
] | null | null | null | from typing import Tuple
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from dashboard.models import ObservationComment, Alert, Area
class AlertForm(forms.ModelForm):
def __init__(self, for_user, *args, **kwargs):
... | 27.985075 | 86 | 0.627733 |
79e52f96fd3c29ced87b5832e007084f8aa21b54 | 3,331 | py | Python | mecano_navigation/src/high_level_planner.py | carlitomm/mecano | fbcbc786d0c9f279e57503d9f26bc88c756e4d69 | [
"MIT"
] | null | null | null | mecano_navigation/src/high_level_planner.py | carlitomm/mecano | fbcbc786d0c9f279e57503d9f26bc88c756e4d69 | [
"MIT"
] | null | null | null | mecano_navigation/src/high_level_planner.py | carlitomm/mecano | fbcbc786d0c9f279e57503d9f26bc88c756e4d69 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
import time
import actionlib
from move_base_msgs.msg import *
from nav_msgs.msg import OccupancyGrid
import matplotlib.pyplot as plt
import math
from A_star_class import AStarPlanner
from nav_msgs.msg import Odometry
from nav_msgs.srv import GetMap
from geometry_msgs.msg import Pose
f... | 26.023438 | 85 | 0.61453 |
79e5a152f15b4aa8d627588dd44af6ab9742c558 | 599 | py | Python | backend/calorie_find/calories/migrations/0001_initial.py | banjocat/calorie-find | 9b0314e3c3a5b4b4b4607ec61728e14988c8fd05 | [
"BSD-2-Clause"
] | 2 | 2016-08-10T19:54:02.000Z | 2016-10-20T00:22:19.000Z | backend/calorie_find/calories/migrations/0001_initial.py | banjocat/calorie-find | 9b0314e3c3a5b4b4b4607ec61728e14988c8fd05 | [
"BSD-2-Clause"
] | 9 | 2016-07-10T15:07:27.000Z | 2017-01-17T03:39:41.000Z | backend/calorie_find/calories/migrations/0001_initial.py | banjocat/calorie-find | 9b0314e3c3a5b4b4b4607ec61728e14988c8fd05 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-11 01:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Food',
... | 23.96 | 114 | 0.579299 |
79e5a91a064bb007be239100d7842ccf6daf38fc | 6,955 | py | Python | mysignal/bessy.py | ochurlaud/MSc_simulation-fofb | dc9a43f54bf7e570915d0360d102ad04f3cb761d | [
"WTFPL"
] | null | null | null | mysignal/bessy.py | ochurlaud/MSc_simulation-fofb | dc9a43f54bf7e570915d0360d102ad04f3cb761d | [
"WTFPL"
] | null | null | null | mysignal/bessy.py | ochurlaud/MSc_simulation-fofb | dc9a43f54bf7e570915d0360d102ad04f3cb761d | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Bessy Signal module
@author: Olivier CHURLAUD <olivier.churlaud@helmholtz-berlin.de>
"""
from __future__ import division, print_function
import math
import matplotlib.pyplot as plt
import numpy as np
import scipy.linalg
import scipy.signal as signal
import mysigna... | 31.049107 | 101 | 0.507692 |
79e615c92b16fdf54a86e138f343e51774b3dfcd | 13,246 | py | Python | vtrace.py | steffenvan/bachelor-thesis | 1472ce1ba32c107e25d4c5cc2ac64edfc04ba1ff | [
"Apache-2.0"
] | 2 | 2019-11-20T09:14:01.000Z | 2021-12-22T10:58:34.000Z | vtrace.py | steffenvan/attentive-MT | 1472ce1ba32c107e25d4c5cc2ac64edfc04ba1ff | [
"Apache-2.0"
] | null | null | null | vtrace.py | steffenvan/attentive-MT | 1472ce1ba32c107e25d4c5cc2ac64edfc04ba1ff | [
"Apache-2.0"
] | 3 | 2019-11-18T01:11:14.000Z | 2020-03-21T00:18:31.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 44.153333 | 104 | 0.732825 |
79e65b6783d52b3d45c0403fc1db48eea6c714aa | 2,535 | py | Python | alipay/aop/api/domain/AnttechBlockchainTwcUserinfoMatchModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AnttechBlockchainTwcUserinfoMatchModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AnttechBlockchainTwcUserinfoMatchModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AnttechBlockchainTwcUserinfoMatchModel(object):
def __init__(self):
self._alipay_user_id = None
self._call_no_hash = None
self._unify_no = None
self._unify_no_hash... | 29.476744 | 79 | 0.611045 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.