hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f724d089bc635ac3025f0392ab99da036fdef499 | 3,249 | py | Python | main.py | deeso/slow-hitter | 1fd3c7effaf532a828f30908715157b188ef5884 | [
"Apache-2.0"
] | null | null | null | main.py | deeso/slow-hitter | 1fd3c7effaf532a828f30908715157b188ef5884 | [
"Apache-2.0"
] | null | null | null | main.py | deeso/slow-hitter | 1fd3c7effaf532a828f30908715157b188ef5884 | [
"Apache-2.0"
] | null | null | null | import logging
import argparse
import sys
from slow.hitter import HitterService as Hitter
from slow.hitter import KnownHosts
from slow.etl import ETL, DEFAULT_NAMES, DEFAULT_PATTERNS, DEFAULT_CONFIG
from slow.mongo_backend import MongoConnection
parser = argparse.ArgumentParser(description='Start syslog-grok-mongo ... | 39.621951 | 81 | 0.634349 | import logging
import argparse
import sys
from slow.hitter import HitterService as Hitter
from slow.hitter import KnownHosts
from slow.etl import ETL, DEFAULT_NAMES, DEFAULT_PATTERNS, DEFAULT_CONFIG
from slow.mongo_backend import MongoConnection
parser = argparse.ArgumentParser(description='Start syslog-grok-mongo ... | true | true |
f724d09925aef79360ace23f3ceeeecc66e5dc5d | 21,173 | py | Python | infra/libs/gerrit_api/test/gerrit_api_test.py | eunchong/infra | ce3728559112bfb3e8b32137eada517aec6d22f9 | [
"BSD-3-Clause"
] | null | null | null | infra/libs/gerrit_api/test/gerrit_api_test.py | eunchong/infra | ce3728559112bfb3e8b32137eada517aec6d22f9 | [
"BSD-3-Clause"
] | null | null | null | infra/libs/gerrit_api/test/gerrit_api_test.py | eunchong/infra | ce3728559112bfb3e8b32137eada517aec6d22f9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 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.
"""Tests for gerrit_api.py"""
import copy
import json
import mock
import requests
import tempfile
import time
import unittest
from infra.libs import gerrit... | 39.064576 | 80 | 0.654277 |
import copy
import json
import mock
import requests
import tempfile
import time
import unittest
from infra.libs import gerrit_api
GERRIT_JSON_HEADER = ')]}\'\n'
HEADERS = {
'Accept': 'application/json',
'Accept-encoding': 'gzip',
'Authorization': 'Basic Z2l0LWNvbW1pdC1ib3RAY2hyb21pdW0ub3JnOnNlY3Jld... | true | true |
f724d0f2012370079322010867b41194ad671123 | 330 | py | Python | Python-3/basic_examples/strings/trim-string.py | ghiloufibelgacem/jornaldev | b9b27f9f7da595892520314b4ed1d2675556310a | [
"MIT"
] | 1,139 | 2018-05-09T11:54:36.000Z | 2022-03-31T06:52:50.000Z | Python-3/basic_examples/strings/trim-string.py | ghiloufibelgacem/jornaldev | b9b27f9f7da595892520314b4ed1d2675556310a | [
"MIT"
] | 56 | 2018-06-20T03:52:53.000Z | 2022-02-09T22:57:41.000Z | Python-3/basic_examples/strings/trim-string.py | ghiloufibelgacem/jornaldev | b9b27f9f7da595892520314b4ed1d2675556310a | [
"MIT"
] | 2,058 | 2018-05-09T09:32:17.000Z | 2022-03-29T13:19:42.000Z | s1 = ' abc '
print(f'String =\'{s1}\'')
print(f'After Removing Leading Whitespaces String =\'{s1.lstrip()}\'')
print(f'After Removing Trailing Whitespaces String =\'{s1.rstrip()}\'')
print(f'After Trimming Whitespaces String =\'{s1.strip()}\'')
# string with new line
s1 = ' X\n Y \nZ \t'
print(s1)
print(s1.... | 19.411765 | 71 | 0.633333 | s1 = ' abc '
print(f'String =\'{s1}\'')
print(f'After Removing Leading Whitespaces String =\'{s1.lstrip()}\'')
print(f'After Removing Trailing Whitespaces String =\'{s1.rstrip()}\'')
print(f'After Trimming Whitespaces String =\'{s1.strip()}\'')
s1 = ' X\n Y \nZ \t'
print(s1)
print(s1.strip())
| true | true |
f724d12f6d6351caa87e074ea046e25613b6fe8c | 413 | py | Python | Task1E.py | ginnylaw/138-floodwarningsystem | dc9b674c5517761904062c5b35729d8f14504c48 | [
"MIT"
] | null | null | null | Task1E.py | ginnylaw/138-floodwarningsystem | dc9b674c5517761904062c5b35729d8f14504c48 | [
"MIT"
] | 1 | 2022-01-21T22:07:02.000Z | 2022-01-22T11:19:31.000Z | Task1E.py | ginnylaw/138-floodwarningsystem | dc9b674c5517761904062c5b35729d8f14504c48 | [
"MIT"
] | null | null | null | # Not Copyright (¬C) 2022 Greg S. Kurzepa
from floodsystem.geo import rivers_by_station_number
from floodsystem.stationdata import build_station_list
def run():
"""Requirements for Task 1E"""
station_list = build_station_list()
output = rivers_by_station_number(station_list, 9)
print(output)
if __na... | 27.533333 | 63 | 0.72155 |
from floodsystem.geo import rivers_by_station_number
from floodsystem.stationdata import build_station_list
def run():
station_list = build_station_list()
output = rivers_by_station_number(station_list, 9)
print(output)
if __name__ == "__main__":
print("*** Task 1E: CUED Part IA Flood Warning Syste... | true | true |
f724d145f5fb4bdcfe48b20384224152e82d9a51 | 127 | py | Python | oss4blog/__init__.py | JianxunRao/oss4blog | 9e328ad5d2bc23806ef1c4d149f0bcc916674d03 | [
"MIT"
] | 3 | 2019-01-02T03:00:17.000Z | 2021-06-06T02:00:44.000Z | oss4blog/__init__.py | JianxunRao/oss4blog | 9e328ad5d2bc23806ef1c4d149f0bcc916674d03 | [
"MIT"
] | null | null | null | oss4blog/__init__.py | JianxunRao/oss4blog | 9e328ad5d2bc23806ef1c4d149f0bcc916674d03 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/2/5 0005 上午 8:56
# @Author : Trojx
# @File : __init__.py.py | 25.4 | 34 | 0.559055 | true | true | |
f724d19652f09efe12713994a7c76259c5afea06 | 3,189 | py | Python | ParlAI/parlai/tasks/mutualfriends/agents.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 163 | 2019-06-23T14:07:57.000Z | 2022-02-25T23:06:07.000Z | ParlAI/parlai/tasks/mutualfriends/agents.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 8 | 2019-07-24T12:41:31.000Z | 2022-02-10T00:17:20.000Z | ParlAI/parlai/tasks/mutualfriends/agents.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 31 | 2019-06-26T01:21:07.000Z | 2021-09-06T17:23:24.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.
from parlai.core.teachers import DialogTeacher
from .build import build
import json
import os
class DefaultTeacher(Di... | 39.37037 | 90 | 0.461587 |
from parlai.core.teachers import DialogTeacher
from .build import build
import json
import os
class DefaultTeacher(DialogTeacher):
def __init__(self, opt, shared=None):
self.datatype = opt['datatype']
build(opt)
if not opt['datatype'].startswith('train'):
raise Runtime... | true | true |
f724d1efb6cc2a309577cdfab02d22ed387da3a1 | 6,306 | py | Python | py-polars/polars/utils.py | JakobGM/polars | fe10d4a180e59e5e34f4ab17303f12f1cd64e6c8 | [
"MIT"
] | null | null | null | py-polars/polars/utils.py | JakobGM/polars | fe10d4a180e59e5e34f4ab17303f12f1cd64e6c8 | [
"MIT"
] | null | null | null | py-polars/polars/utils.py | JakobGM/polars | fe10d4a180e59e5e34f4ab17303f12f1cd64e6c8 | [
"MIT"
] | null | null | null | import ctypes
import os
import sys
from datetime import date, datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple, Type, Union
import numpy as np
from polars.datatypes import DataType, Date, Datetime
if sys.version_info >= (3, 10):
from t... | 29.605634 | 98 | 0.64288 | import ctypes
import os
import sys
from datetime import date, datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple, Type, Union
import numpy as np
from polars.datatypes import DataType, Date, Datetime
if sys.version_info >= (3, 10):
from t... | true | true |
f724d251d69499fc6e1ec87430fba69964909b5d | 2,310 | py | Python | tests/test_datasets/test_dataset_wrapper.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | 1 | 2022-02-13T12:27:40.000Z | 2022-02-13T12:27:40.000Z | tests/test_datasets/test_dataset_wrapper.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | tests/test_datasets/test_dataset_wrapper.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from mmcv import Config
from mmpose.datasets.builder import build_dataset
def test_concat_dataset():
# build COCO-like dataset config
dataset_info = Config.fromfile(
'configs/_base_/datasets/coco.py').dataset_info
channel_cfg = dict(
num_ou... | 33.970588 | 71 | 0.646753 |
from mmcv import Config
from mmpose.datasets.builder import build_dataset
def test_concat_dataset():
dataset_info = Config.fromfile(
'configs/_base_/datasets/coco.py').dataset_info
channel_cfg = dict(
num_output_channels=17,
dataset_joints=17,
dataset_channel=[
... | true | true |
f724d3be4fab7267380619189339e046a243a317 | 741 | py | Python | face_recon_deform/PhotoAvatarLib_exe/run.py | halfjoe/3D-Portrait-Stylization | ccf0edd5cf7764d67d2740aa0e2cd18cc503c937 | [
"MIT"
] | 38 | 2022-01-12T14:17:25.000Z | 2022-03-23T06:34:23.000Z | face_recon_deform/PhotoAvatarLib_exe/run.py | halfjoe/3D-Portrait-Stylization | ccf0edd5cf7764d67d2740aa0e2cd18cc503c937 | [
"MIT"
] | 5 | 2022-01-19T12:14:45.000Z | 2022-03-22T15:59:12.000Z | face_recon_deform/PhotoAvatarLib_exe/run.py | halfjoe/3D-Portrait-Stylization | ccf0edd5cf7764d67d2740aa0e2cd18cc503c937 | [
"MIT"
] | 6 | 2022-01-14T06:59:37.000Z | 2022-03-15T03:58:54.000Z | import os
for file in os.listdir("upload"):
if file.endswith(".jpg"):
print(file.rsplit('.', 1)[0])
os.system('PhotoAvatarLib.exe ' + file.rsplit('.', 1)[0])
fp = open(os.path.join('result', file.rsplit('.', 1)[0] + '.mtl'), "w")
fp.write('newmtl material_1\nmap_Kd %s_face.... | 35.285714 | 95 | 0.522267 | import os
for file in os.listdir("upload"):
if file.endswith(".jpg"):
print(file.rsplit('.', 1)[0])
os.system('PhotoAvatarLib.exe ' + file.rsplit('.', 1)[0])
fp = open(os.path.join('result', file.rsplit('.', 1)[0] + '.mtl'), "w")
fp.write('newmtl material_1\nmap_Kd %s_face.... | true | true |
f724d762255165511edcd4f30973356a4b81b6a1 | 964 | py | Python | tests/test_main.py | thorgate/pyevr | 168f2e9459020212213ed0291882a285ebb53839 | [
"MIT"
] | 3 | 2020-04-18T19:45:51.000Z | 2022-03-01T19:48:11.000Z | tests/test_main.py | thorgate/pyevr | 168f2e9459020212213ed0291882a285ebb53839 | [
"MIT"
] | 39 | 2019-11-16T01:35:35.000Z | 2021-11-18T12:58:41.000Z | tests/test_main.py | thorgate/pyevr | 168f2e9459020212213ed0291882a285ebb53839 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `pyevr.main`."""
import pytest
from click.testing import CliRunner
from pyevr.main import main
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
#... | 25.368421 | 78 | 0.690871 |
import pytest
from click.testing import CliRunner
from pyevr.main import main
@pytest.fixture
def response():
def test_content(response):
def test_command_line_interface():
runner = CliRunner()
result = runner.invoke(main)
assert result.exit_code == 0
assert 'pyevr.cli.ma... | true | true |
f724d7d23d4236fb0d0aeead2ccfc8a44b4b705c | 17,325 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/ios/ios_user.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/ios/ios_user.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/ios/ios_user.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | 31.847426 | 110 | 0.633709 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = """
---
module: ios_user
version_added: "2.4"
author: "Trishna Guha (@trishnaguha)"
short_description: Manage the aggregate of local users on Cis... | true | true |
f724d87fd763688168a55ea7c5a6817849d45718 | 125 | py | Python | src/hist/numpy.py | andrzejnovak/hist | 15a41565ac9a3683bff74b98803c4b88ad8a19ae | [
"BSD-3-Clause"
] | null | null | null | src/hist/numpy.py | andrzejnovak/hist | 15a41565ac9a3683bff74b98803c4b88ad8a19ae | [
"BSD-3-Clause"
] | null | null | null | src/hist/numpy.py | andrzejnovak/hist | 15a41565ac9a3683bff74b98803c4b88ad8a19ae | [
"BSD-3-Clause"
] | null | null | null | from boost_histogram.numpy import histogram, histogram2d, histogramdd
__all__ = ("histogram", "histogram2d", "histogramdd")
| 31.25 | 69 | 0.792 | from boost_histogram.numpy import histogram, histogram2d, histogramdd
__all__ = ("histogram", "histogram2d", "histogramdd")
| true | true |
f724d8ab5bf6fadc70a44f28e9bffcf70edecf16 | 1,732 | py | Python | tools/randomData.py | Tandelajr/mr.tandela | 096cce682de58f2a7035d3e114787a78a1015a9b | [
"MIT"
] | 3 | 2020-06-23T11:59:14.000Z | 2020-12-03T15:20:18.000Z | tools/randomData.py | Tandelajr/mr.tandela | 096cce682de58f2a7035d3e114787a78a1015a9b | [
"MIT"
] | 1 | 2020-06-23T12:01:41.000Z | 2020-06-23T12:01:41.000Z | tools/randomData.py | Tandelajr/mr.tandela | 096cce682de58f2a7035d3e114787a78a1015a9b | [
"MIT"
] | 1 | 2020-12-03T15:20:26.000Z | 2020-12-03T15:20:26.000Z | #!/usr/bin/env https://github.com/Tandelajr/mr.tandela
# MIT License
#
# Copyright (C) 2020, Entynetproject. All Rights Reserved.
#
# 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 re... | 37.652174 | 80 | 0.741917 |
import json
import random
def random_IP():
ip = []
for _ in range(0, 4):
ip.append(str(random.randint(1,255)))
return ".".join(ip)
def random_referer():
with open("tools/other/referers.txt", 'r') as referers:
referers = referers.readlines()
return random.choi... | true | true |
f724d950f3f0f4ab4df0111f810aec962a3b5e21 | 149,021 | py | Python | scipy/stats/stats.py | Dapid/scipy | dde07a64407ffaa9442b3d8298c6c26ff91fb384 | [
"BSD-3-Clause"
] | null | null | null | scipy/stats/stats.py | Dapid/scipy | dde07a64407ffaa9442b3d8298c6c26ff91fb384 | [
"BSD-3-Clause"
] | null | null | null | scipy/stats/stats.py | Dapid/scipy | dde07a64407ffaa9442b3d8298c6c26ff91fb384 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Gary Strangman. All rights reserved
#
# Disclaimer
#
# This software is provided "as-is". There are no expressed or implied
# warranties of any kind, including, but not limited to, the warranties
# of merchantability and fitness for a given application. In no event
# shall Gary Strangman be liable fo... | 31.699851 | 95 | 0.597949 |
from __future__ import division, print_function, absolute_import
import warnings
import math
from collections import namedtuple
from scipy._lib.six import xrange
from scipy._lib.six import callable, string_types
from numpy import array, asarray, ma, zeros
import scipy.special as special
import sc... | true | true |
f724da7af2704b4ffec5878bcac55c4bb2e57d18 | 4,446 | py | Python | models/experimental/mnist_keras_ds/mnist.py | cs-gn/tpu | fadb409b8dae2385191050aa5c901d9084d8bb8c | [
"Apache-2.0"
] | 1 | 2020-08-27T18:52:09.000Z | 2020-08-27T18:52:09.000Z | models/experimental/mnist_keras_ds/mnist.py | omar16100/tpu | 4727594874e8587a60cb088627d46f73a1769823 | [
"Apache-2.0"
] | null | null | null | models/experimental/mnist_keras_ds/mnist.py | omar16100/tpu | 4727594874e8587a60cb088627d46f73a1769823 | [
"Apache-2.0"
] | 1 | 2019-03-25T07:50:04.000Z | 2019-03-25T07:50:04.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.531915 | 80 | 0.703554 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
import numpy as np
import tensorflow as tf
flags.DEFINE_bool('use_tpu', True, 'Use TPU model instead of CPU.')
flags.DEFINE_string('tpu', None, 'Name... | true | true |
f724dabdf285c5d14bf55e9bd7e21f067f7b0934 | 403 | py | Python | award_project/wsgi.py | Esther-Anyona/Developer-Awards | 64030da79cc1ed993b1bc4420725b2a996be84da | [
"MIT"
] | null | null | null | award_project/wsgi.py | Esther-Anyona/Developer-Awards | 64030da79cc1ed993b1bc4420725b2a996be84da | [
"MIT"
] | null | null | null | award_project/wsgi.py | Esther-Anyona/Developer-Awards | 64030da79cc1ed993b1bc4420725b2a996be84da | [
"MIT"
] | null | null | null | """
WSGI config for award_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'award_project.settings')
application = get_wsgi_application()
| true | true |
f724db24b2380e8d19e2fcdab914785ada4e9c4a | 854 | py | Python | buildlib/helpers/events.py | ForwardLine/backup-nanny | 67c687f43d732c60ab2e569e50bc40cc5e696b25 | [
"Apache-2.0"
] | 1 | 2019-11-13T04:15:41.000Z | 2019-11-13T04:15:41.000Z | buildlib/helpers/events.py | ForwardLine/backup-nanny | 67c687f43d732c60ab2e569e50bc40cc5e696b25 | [
"Apache-2.0"
] | null | null | null | buildlib/helpers/events.py | ForwardLine/backup-nanny | 67c687f43d732c60ab2e569e50bc40cc5e696b25 | [
"Apache-2.0"
] | 1 | 2019-10-25T21:24:20.000Z | 2019-10-25T21:24:20.000Z | import logging
from troposphere.events import Rule, Target
from buildlib.helpers.client_helper import ClientHelper
class EventsHelper(object):
def __init__(self, template, project, session=None):
self.client = ClientHelper.get_client('events', session)
self.project = project
self.templat... | 29.448276 | 104 | 0.637002 | import logging
from troposphere.events import Rule, Target
from buildlib.helpers.client_helper import ClientHelper
class EventsHelper(object):
def __init__(self, template, project, session=None):
self.client = ClientHelper.get_client('events', session)
self.project = project
self.templat... | true | true |
f724db442a0f5748c892e969a3bc7eed6d4c5a14 | 16,050 | py | Python | pybvc/netconfdev/vrouter/interfaces.py | brocade/pybvc | 316e8cb79ecbeb3670276afd43286e57897bc8ba | [
"BSD-3-Clause"
] | 1 | 2015-11-22T15:53:00.000Z | 2015-11-22T15:53:00.000Z | pybvc/netconfdev/vrouter/interfaces.py | brocade/pybvc | 316e8cb79ecbeb3670276afd43286e57897bc8ba | [
"BSD-3-Clause"
] | null | null | null | pybvc/netconfdev/vrouter/interfaces.py | brocade/pybvc | 316e8cb79ecbeb3670276afd43286e57897bc8ba | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2015
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in ... | 35.666667 | 98 | 0.406417 |
import json
from pybvc.common.utils import strip_none, remove_empty_from_dict, dict_keys_underscored_to_dashed
class DataPlaneInterface():
def __init__(self, name):
self.tagnode = name
self.description = None
self.dhcpv6_options = None
self.ip = None
... | true | true |
f724dbc632ab957d93fb0b05c7dd5db1e521ac4b | 1,048 | py | Python | RosViewer.py | MikeHallettUK/RosRobotics | 953486cfd042d6adec1edaf425243eac0f473571 | [
"CC0-1.0"
] | null | null | null | RosViewer.py | MikeHallettUK/RosRobotics | 953486cfd042d6adec1edaf425243eac0f473571 | [
"CC0-1.0"
] | null | null | null | RosViewer.py | MikeHallettUK/RosRobotics | 953486cfd042d6adec1edaf425243eac0f473571 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
# RosViewer.py = node that listens to a ROS image message topic,
# and displays the image using OpenCV.
import rospy
import cv2
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class image_viewer: # "/camera/color/image_raw" or "/camera/color... | 36.137931 | 117 | 0.676527 |
import rospy
import cv2
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class image_viewer:
def __init__(self):
self.bridge = CvBridge()
self.image_sub = rospy.Subscriber("/camera/color/image_raw", Image, self.ros_cb, queue_size=1, buff_size=2 ** 24)
def... | true | true |
f724dd1a39a7f175e46aa6568a64a8dd26d6775b | 251 | py | Python | temboo/core/Library/OneLogin/Roles/__init__.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/OneLogin/Roles/__init__.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/OneLogin/Roles/__init__.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | from temboo.Library.OneLogin.Roles.ListAll import ListAll, ListAllInputSet, ListAllResultSet, ListAllChoreographyExecution
from temboo.Library.OneLogin.Roles.ShowRole import ShowRole, ShowRoleInputSet, ShowRoleResultSet, ShowRoleChoreographyExecution
| 83.666667 | 127 | 0.888446 | from temboo.Library.OneLogin.Roles.ListAll import ListAll, ListAllInputSet, ListAllResultSet, ListAllChoreographyExecution
from temboo.Library.OneLogin.Roles.ShowRole import ShowRole, ShowRoleInputSet, ShowRoleResultSet, ShowRoleChoreographyExecution
| true | true |
f724dd6c5a854504a4b01aac06593f75753a45b0 | 4,911 | py | Python | ttt.py | JotaGo/tic-tac-toe | 237288f84bf388c219f6b5cf6cbae6334bfddb26 | [
"MIT"
] | null | null | null | ttt.py | JotaGo/tic-tac-toe | 237288f84bf388c219f6b5cf6cbae6334bfddb26 | [
"MIT"
] | null | null | null | ttt.py | JotaGo/tic-tac-toe | 237288f84bf388c219f6b5cf6cbae6334bfddb26 | [
"MIT"
] | null | null | null | import random
#GLOBAL VARIABLE
ttt = [[1,2,3],[4,5,6],[7,8,9]]
#PRINTING THE BOARD FUNCTION
def printing():
print()
for i , j in enumerate(ttt):
if i > 0:
print('---------')
print(j[0],'|',j[1],'|',j[2])
print()
#RESET THE BOARD
## WITH THIS FUNCTION THE USER CAN RESET BOARD ... | 27.283333 | 85 | 0.476074 | import random
ttt = [[1,2,3],[4,5,6],[7,8,9]]
def printing():
print()
for i , j in enumerate(ttt):
if i > 0:
print('---------')
print(j[0],'|',j[1],'|',j[2])
print()
nav2] != cnt:
ttt[nav1][nav2] = cnt
cnt += 1
nav2 +=1
nav2 ... | true | true |
f724dd876dd86bd7229b96394df79995ae66159a | 2,035 | py | Python | test/TestShellWithoutPipefail.py | chilicheech/ansible-lint | 57d4d3346179bb4142aeb7218dbf5f91befcab72 | [
"MIT"
] | null | null | null | test/TestShellWithoutPipefail.py | chilicheech/ansible-lint | 57d4d3346179bb4142aeb7218dbf5f91befcab72 | [
"MIT"
] | null | null | null | test/TestShellWithoutPipefail.py | chilicheech/ansible-lint | 57d4d3346179bb4142aeb7218dbf5f91befcab72 | [
"MIT"
] | null | null | null | # pylint: disable=preferred-module # FIXME: remove once migrated per GH-725
import unittest
from ansiblelint.rules import RulesCollection
from ansiblelint.rules.ShellWithoutPipefail import ShellWithoutPipefail
from ansiblelint.testing import RunFromText
FAIL_TASKS = '''
---
- hosts: localhost
become: no
tasks:
... | 22.865169 | 76 | 0.633907 | import RulesCollection
from ansiblelint.rules.ShellWithoutPipefail import ShellWithoutPipefail
from ansiblelint.testing import RunFromText
FAIL_TASKS = '''
---
- hosts: localhost
become: no
tasks:
- name: pipeline without pipefail
shell: false | cat
- name: pipeline with or and pipe, no pipefail
... | true | true |
f724de43aa9b83eb0afc55ae9f946720ab6db30a | 38,330 | py | Python | tests/system/robot/chromeTests.py | krzysz00/nvda | d34444242a529098499131165a3e60d5a05ac96f | [
"bzip2-1.0.6"
] | 1,592 | 2015-11-10T12:05:44.000Z | 2022-03-31T11:50:40.000Z | tests/system/robot/chromeTests.py | krzysz00/nvda | d34444242a529098499131165a3e60d5a05ac96f | [
"bzip2-1.0.6"
] | 9,479 | 2015-11-10T20:56:48.000Z | 2022-03-31T23:51:30.000Z | tests/system/robot/chromeTests.py | TheQuinbox/nvda | 9c7b763a2428b43802758a3859de8708cefcd4a0 | [
"bzip2-1.0.6"
] | 682 | 2015-11-10T11:19:23.000Z | 2022-03-31T07:51:29.000Z | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2020-2021 NV Access Limited, Leonard de Ruijter
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
"""Logic for NVDA + Google Chrome tests
"""
... | 28.776276 | 109 | 0.688469 |
import os
from robot.libraries.BuiltIn import BuiltIn
from SystemTestSpy import (
_getLib,
)
# Imported for type information
from ChromeLib import ChromeLib as _ChromeLib
from AssertsLib import AssertsLib as _AssertsLib
import NvdaLib as _NvdaLib
_builtIn: BuiltIn = BuiltIn()
_chrome: _ChromeLib... | true | true |
f724de73bfb07fa9766f490a464f1f8eb216b233 | 738 | py | Python | tags/migrations/0002_auto_20160704_1112.py | making3/summonerqa | 7ab8472b2d24236ba1e6919fa0f00881f4a3e633 | [
"MIT"
] | null | null | null | tags/migrations/0002_auto_20160704_1112.py | making3/summonerqa | 7ab8472b2d24236ba1e6919fa0f00881f4a3e633 | [
"MIT"
] | null | null | null | tags/migrations/0002_auto_20160704_1112.py | making3/summonerqa | 7ab8472b2d24236ba1e6919fa0f00881f4a3e633 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-04 16:12
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tags', '0001_initial'),
]
operations = [
mi... | 26.357143 | 124 | 0.611111 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tags', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='tag',
name='Cat... | true | true |
f724ded074f8fa3a1a1d5041388c8593fb112856 | 924 | py | Python | cogs/slashes.py | mallusrgreatv2/PyHDISCORD | e414976441cbdb3a57b2c545ab164810bebe2e4b | [
"MIT"
] | 2 | 2021-07-05T12:00:39.000Z | 2021-07-05T12:00:49.000Z | cogs/slashes.py | mallusrgreatv2/PyHDISCORD | e414976441cbdb3a57b2c545ab164810bebe2e4b | [
"MIT"
] | null | null | null | cogs/slashes.py | mallusrgreatv2/PyHDISCORD | e414976441cbdb3a57b2c545ab164810bebe2e4b | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from discord.ext.commands import cog
import discord_slash
from discord_slash import cog_ext
class Slashes(commands.Cog):
def __init__(self, client) -> None:
self.client: commands.Bot = client
@commands.Cog.listener()
async def on_ready(self):
... | 35.538462 | 108 | 0.676407 | import discord
from discord.ext import commands
from discord.ext.commands import cog
import discord_slash
from discord_slash import cog_ext
class Slashes(commands.Cog):
def __init__(self, client) -> None:
self.client: commands.Bot = client
@commands.Cog.listener()
async def on_ready(self):
... | true | true |
f724dee757778c7059a8bbb1f08fe86a9affccc9 | 652 | py | Python | manage_index.py | jdoiro3/myPersonalSite | a61245cfdc497a864c58fd0d9eee27a35f0b52f3 | [
"MIT"
] | 2 | 2021-10-05T03:03:34.000Z | 2022-03-15T12:38:07.000Z | manage_index.py | jdoiro3/myPersonalSite | a61245cfdc497a864c58fd0d9eee27a35f0b52f3 | [
"MIT"
] | null | null | null | manage_index.py | jdoiro3/myPersonalSite | a61245cfdc497a864c58fd0d9eee27a35f0b52f3 | [
"MIT"
] | null | null | null | from modules import index
import argparse
commands = ["cleanup", "re-index"]
parser = argparse.ArgumentParser(description='Manager for the Inverted Index.')
parser.add_argument('command', choices=commands, help='Command to perform on index.')
parser.add_argument('--in_s3', action='store_true', help='If passed, the in... | 46.571429 | 114 | 0.753067 | from modules import index
import argparse
commands = ["cleanup", "re-index"]
parser = argparse.ArgumentParser(description='Manager for the Inverted Index.')
parser.add_argument('command', choices=commands, help='Command to perform on index.')
parser.add_argument('--in_s3', action='store_true', help='If passed, the in... | true | true |
f724df091556b7dbed963d14802c99783e73424c | 4,049 | py | Python | pajbot/modules/top.py | Troy-Bot/pajbot | 11b7e86ca270d57d4f35226effc3eb16250e2dfc | [
"MIT"
] | null | null | null | pajbot/modules/top.py | Troy-Bot/pajbot | 11b7e86ca270d57d4f35226effc3eb16250e2dfc | [
"MIT"
] | null | null | null | pajbot/modules/top.py | Troy-Bot/pajbot | 11b7e86ca270d57d4f35226effc3eb16250e2dfc | [
"MIT"
] | null | null | null | import logging
from pajbot.managers.db import DBManager
from pajbot.models.command import Command
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
from pajbot.utils import time_since
log = logging.getLogger(__name__)
class TopModule(BaseModule):
... | 37.841121 | 138 | 0.605829 | import logging
from pajbot.managers.db import DBManager
from pajbot.models.command import Command
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
from pajbot.utils import time_since
log = logging.getLogger(__name__)
class TopModule(BaseModule):
... | true | true |
f724df327e8441ac179a887f4d64a5bd5eb292a3 | 3,207 | py | Python | jigs/hpcc/source/lysozyme_we.py | gitter-badger/wepy-1 | 9bc619aeae178ad5d10f658fae2abfd2c7aeb18a | [
"MIT"
] | 35 | 2017-08-22T15:39:06.000Z | 2022-03-20T15:17:52.000Z | jigs/hpcc/source/lysozyme_we.py | gitter-badger/wepy-1 | 9bc619aeae178ad5d10f658fae2abfd2c7aeb18a | [
"MIT"
] | 33 | 2017-10-02T22:04:45.000Z | 2022-03-02T22:19:08.000Z | jigs/hpcc/source/lysozyme_we.py | stxinsite/wepy | 352d4c1316b20e839aae8824eedd66f0f2d0b456 | [
"MIT"
] | 17 | 2018-07-14T15:33:30.000Z | 2022-01-18T16:30:55.000Z | from pympler.asizeof import asizeof
def get_size(obj):
"""get the size in units of Mb"""
return asizeof(obj) / 1000000
if __name__ == "__main__":
# prom.start_http_server(9001)
import os
import shutil
import sys
import logging
from pathlib import Path
# from multiprocessing_lo... | 28.633929 | 106 | 0.565326 | from pympler.asizeof import asizeof
def get_size(obj):
return asizeof(obj) / 1000000
if __name__ == "__main__":
import os
import shutil
import sys
import logging
from pathlib import Path
from wepy_tools.monitoring.prometheus import SimMonitor
from wepy_tools.sim_makers.... | true | true |
f724e052a84d5bf01809f05e2ce2708627528d63 | 6,634 | py | Python | sendSMSSkillLambda/package/ask_sdk_model/session_ended_request.py | shneydor/aws-alexa-lambda-workshop | 0fa6b7067b04fc85c46b9ce1c2cc04554ed5baf4 | [
"Apache-2.0"
] | null | null | null | sendSMSSkillLambda/package/ask_sdk_model/session_ended_request.py | shneydor/aws-alexa-lambda-workshop | 0fa6b7067b04fc85c46b9ce1c2cc04554ed5baf4 | [
"Apache-2.0"
] | null | null | null | sendSMSSkillLambda/package/ask_sdk_model/session_ended_request.py | shneydor/aws-alexa-lambda-workshop | 0fa6b7067b04fc85c46b9ce1c2cc04554ed5baf4 | [
"Apache-2.0"
] | 1 | 2019-10-11T17:15:20.000Z | 2019-10-11T17:15:20.000Z | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 47.385714 | 527 | 0.668074 |
import pprint
import re
import six
import typing
from enum import Enum
from ask_sdk_model.request import Request
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union
from datetime import datetime
from ask_sdk_model.session_ended_error import SessionEndedError
from a... | true | true |
f724e0dae8457b34df64dc725e37573bd868d2fc | 1,108 | py | Python | gym-unity/setup.py | alexcercos/ML-Agents | c096c36b0348e3673b687499e17891cd35168939 | [
"Apache-2.0"
] | 1 | 2019-12-29T13:40:16.000Z | 2019-12-29T13:40:16.000Z | gym-unity/setup.py | alexcercos/ML-Agents | c096c36b0348e3673b687499e17891cd35168939 | [
"Apache-2.0"
] | null | null | null | gym-unity/setup.py | alexcercos/ML-Agents | c096c36b0348e3673b687499e17891cd35168939 | [
"Apache-2.0"
] | 2 | 2020-08-16T14:18:16.000Z | 2022-03-18T12:22:54.000Z | #!/usr/bin/env python
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.install import install
VERSION = "0.11.0"
class VerifyVersionCommand(install):
"""
Custom command to verify that the git tag matches our version
See https://circleci.com/blog/continuously-deplo... | 27.02439 | 95 | 0.666968 |
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.install import install
VERSION = "0.11.0"
class VerifyVersionCommand(install):
description = "verify that the git tag matches our version"
def run(self):
tag = os.getenv("CIRCLE_TAG")
if tag != VERSI... | true | true |
f724e1095b8e197a2c35d40a6c7744239f4d58e6 | 2,426 | py | Python | webapp/web_app.py | baishalidutta/Comments-Toxicity-Detection | c56cd2eb02983c418cbe91fc4a2a257067cdcb89 | [
"Apache-2.0"
] | 7 | 2021-01-11T05:57:18.000Z | 2022-01-14T21:51:54.000Z | webapp/web_app.py | baishalidutta/Comments-Toxicity-Detection | c56cd2eb02983c418cbe91fc4a2a257067cdcb89 | [
"Apache-2.0"
] | 1 | 2021-04-09T17:00:57.000Z | 2021-04-09T17:00:57.000Z | webapp/web_app.py | baishalidutta/Comments-Toxicity-Detection | c56cd2eb02983c418cbe91fc4a2a257067cdcb89 | [
"Apache-2.0"
] | 1 | 2021-02-20T23:47:26.000Z | 2021-02-20T23:47:26.000Z | __author__ = "Baishali Dutta"
__copyright__ = "Copyright (C) 2021 Baishali Dutta"
__license__ = "Apache License 2.0"
__version__ = "0.1"
# -------------------------------------------------------------------------
# Import Libraries
# -----------------------------------------------------------... | 33.694444 | 117 | 0.528854 | __author__ = "Baishali Dutta"
__copyright__ = "Copyright (C) 2021 Baishali Dutta"
__license__ = "Apache License 2.0"
__version__ = "0.1"
import pickle
import gradio as gr
from keras.models import load_model
from keras.preprocessing.sequence import pad_sequences
from source.config import *
from source.data_cleanin... | true | true |
f724e1cf06b432b67c696656847168d974deac36 | 2,657 | py | Python | test/programytest/parser/template/graph_tests/test_eval.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 5 | 2018-08-21T00:13:45.000Z | 2018-09-01T20:00:55.000Z | test/programytest/parser/template/graph_tests/test_eval.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 1 | 2018-09-12T18:30:17.000Z | 2018-09-12T18:30:17.000Z | test/programytest/parser/template/graph_tests/test_eval.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 5 | 2018-08-21T00:08:36.000Z | 2018-09-23T06:11:04.000Z | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.word import TemplateWordNode
from programy.parser.template.nodes.get import TemplateGetNode
from programy.parser.template.nodes.eval import TemplateEvalNode
from programytest.parser.temp... | 36.39726 | 94 | 0.705307 | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.word import TemplateWordNode
from programy.parser.template.nodes.get import TemplateGetNode
from programy.parser.template.nodes.eval import TemplateEvalNode
from programytest.parser.temp... | true | true |
f724e27067df0d8b936028ff1d33b38c5cfba530 | 462 | py | Python | djangoapp_cloudedbats_bat_activity/urls.py | cloudedbats/cloudedbats_web_archive | 39e571aa88efd149fd07b4ecc33207af44276c9b | [
"MIT"
] | null | null | null | djangoapp_cloudedbats_bat_activity/urls.py | cloudedbats/cloudedbats_web_archive | 39e571aa88efd149fd07b4ecc33207af44276c9b | [
"MIT"
] | null | null | null | djangoapp_cloudedbats_bat_activity/urls.py | cloudedbats/cloudedbats_web_archive | 39e571aa88efd149fd07b4ecc33207af44276c9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Project: http://cloudedbats.org
# Copyright (c) 2016 Arnold Andreasson
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
from django.conf.urls import url, include
# import cloudedbats_django.djangoapp_cloudedbats_species.views as species_vie... | 28.875 | 80 | 0.772727 |
from django.conf.urls import url, include
import djangoapp_cloudedbats_bat_activity.views as bat_activity_views
urlpatterns = [
url(r'^', bat_activity_views.bat_activity),
]
| true | true |
f724e28c80153996114878fb2122ab04143fb7c4 | 5,426 | py | Python | tests/opentracer/core/test_span.py | brettlangdon/dd-trace-py | 95e2641d734669719ca07841de58e233cb0f49e9 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/opentracer/core/test_span.py | brettlangdon/dd-trace-py | 95e2641d734669719ca07841de58e233cb0f49e9 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2021-10-07T02:22:59.000Z | 2021-12-15T02:15:48.000Z | tests/opentracer/core/test_span.py | depop/dd-trace-py | 95e2641d734669719ca07841de58e233cb0f49e9 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-28T06:20:53.000Z | 2020-09-28T06:20:53.000Z | import pytest
from ddtrace.opentracer.span import Span
from tests.utils import DummyTracer
@pytest.fixture
def nop_tracer():
from ddtrace.opentracer import Tracer
tracer = Tracer(service_name="mysvc", config={})
# use the same test tracer used by the primary tests
tracer._tracer = DummyTracer()
... | 33.9125 | 83 | 0.653336 | import pytest
from ddtrace.opentracer.span import Span
from tests.utils import DummyTracer
@pytest.fixture
def nop_tracer():
from ddtrace.opentracer import Tracer
tracer = Tracer(service_name="mysvc", config={})
tracer._tracer = DummyTracer()
return tracer
@pytest.fixture
def nop_span_ctx():
... | true | true |
f724e2e16afd314dfd71391ec47943c9a4b364d9 | 7,749 | py | Python | src/shimoku_api_python/configuration.py | shimoku-tech/shimoku-api-python | de26e7d80631647e68794277b15397403336f252 | [
"MIT"
] | 4 | 2021-12-23T15:51:21.000Z | 2022-01-25T08:55:31.000Z | src/shimoku_api_python/configuration.py | shimoku-tech/shimoku-api-python | de26e7d80631647e68794277b15397403336f252 | [
"MIT"
] | null | null | null | src/shimoku_api_python/configuration.py | shimoku-tech/shimoku-api-python | de26e7d80631647e68794277b15397403336f252 | [
"MIT"
] | 1 | 2022-03-02T01:13:04.000Z | 2022-03-02T01:13:04.000Z | """"""
import copy
import logging
import multiprocessing
import sys
import urllib3
class Configuration(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
"""
_default = None
... | 34.748879 | 80 | 0.599303 |
import copy
import logging
import multiprocessing
import sys
import urllib3
class Configuration(object):
_default = None
def __init__(self):
if self._default:
for key in self._default.__dict__.keys():
self.__dict__[key] = copy.copy(self._default.__dict__[key])
... | true | true |
f724e4bc2f3b9f7eafff6e16166f0dbe55dce02c | 1,138 | py | Python | send_msg.py | nocholasrift/wordlebot | c97576697c47a1f5a35722af78a6758ba9a325bf | [
"MIT"
] | null | null | null | send_msg.py | nocholasrift/wordlebot | c97576697c47a1f5a35722af78a6758ba9a325bf | [
"MIT"
] | null | null | null | send_msg.py | nocholasrift/wordlebot | c97576697c47a1f5a35722af78a6758ba9a325bf | [
"MIT"
] | null | null | null | import os
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
client = WebClient(token="xoxb-435046985394-3004455722741-fpIQQHskeFNILHcT3hGoPIF7");
channel_id="wordle"
is_solved = True
guesses = []
with open("tmp", "r") as f:
for line in f:
line = line.strip()
if line == "IMP... | 22.313725 | 95 | 0.655536 | import os
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
client = WebClient(token="xoxb-435046985394-3004455722741-fpIQQHskeFNILHcT3hGoPIF7");
channel_id="wordle"
is_solved = True
guesses = []
with open("tmp", "r") as f:
for line in f:
line = line.strip()
if line == "IMP... | true | true |
f724e6dae565bcc5a26d05bdb7f2553473458a1f | 1,242 | py | Python | tests/test_project_setups.py | insspb/python3-boilerplate | 7d70cd8a7bbbe2805ae5f4cb538996a30b96c736 | [
"MIT"
] | 3 | 2020-04-22T04:09:18.000Z | 2021-12-20T08:44:44.000Z | tests/test_project_setups.py | insspb/python3-boilerplate | 7d70cd8a7bbbe2805ae5f4cb538996a30b96c736 | [
"MIT"
] | 11 | 2019-08-31T08:37:40.000Z | 2019-08-31T11:25:29.000Z | tests/test_project_setups.py | insspb/python3-boilerplate | 7d70cd8a7bbbe2805ae5f4cb538996a30b96c736 | [
"MIT"
] | 1 | 2020-11-24T11:18:50.000Z | 2020-11-24T11:18:50.000Z | import pytest
"""
This file include several configuration of answers to setup file.
Each configuration should be completed without errors to pass this tests.
"""
@pytest.mark.skip
def test_all_python_versions_deploy():
"""Test setup.py format correct for all Python versions support."""
pass
@pytest.mark.s... | 16.342105 | 77 | 0.750403 | import pytest
@pytest.mark.skip
def test_all_python_versions_deploy():
pass
@pytest.mark.skip
def test_2x_only_python_version_deploy():
pass
@pytest.mark.skip
def test_3x_only_python_versions_deploy():
pass
@pytest.mark.skip
def test_markdown_documentation():
pass
@pytest.mark.skip
def test_... | true | true |
f724e874d78e8be3faac5983bcecca02a0597e59 | 4,291 | py | Python | benchmark/startQiskit_QC2348.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC2348.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC2348.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=36
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... | 35.172131 | 165 | 0.655558 |
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np... | true | true |
f724e8a3de033be4e0d6edde1760bbeabfca72f8 | 1,538 | py | Python | clients/python-legacy/generated/test/test_queue_item_impl.py | cliffano/jenkins-api-clients-generator | 522d02b3a130a29471df5ec1d3d22c822b3d0813 | [
"MIT"
] | null | null | null | clients/python-legacy/generated/test/test_queue_item_impl.py | cliffano/jenkins-api-clients-generator | 522d02b3a130a29471df5ec1d3d22c822b3d0813 | [
"MIT"
] | null | null | null | clients/python-legacy/generated/test/test_queue_item_impl.py | cliffano/jenkins-api-clients-generator | 522d02b3a130a29471df5ec1d3d22c822b3d0813 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unitte... | 26.982456 | 85 | 0.641743 |
from __future__ import absolute_import
import unittest
import datetime
import openapi_client
from openapi_client.models.queue_item_impl import QueueItemImpl
from openapi_client.rest import ApiException
class TestQueueItemImpl(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
... | true | true |
f724e8d11edae12200491270eda330db309592bd | 927 | py | Python | test/test_create_records.py | Borye/vika.py | 7b4ac29d308e00e2bbfc37dbcaa3f6c7a4a2236f | [
"MIT"
] | 39 | 2020-10-27T13:17:37.000Z | 2022-03-17T11:04:39.000Z | test/test_create_records.py | Borye/vika.py | 7b4ac29d308e00e2bbfc37dbcaa3f6c7a4a2236f | [
"MIT"
] | 9 | 2020-10-27T14:44:48.000Z | 2022-01-19T04:46:58.000Z | test/test_create_records.py | Borye/vika.py | 7b4ac29d308e00e2bbfc37dbcaa3f6c7a4a2236f | [
"MIT"
] | 8 | 2020-10-27T15:12:34.000Z | 2022-01-19T14:23:15.000Z | import unittest
import time
from vika import Vika
from . import TEST_TABLE, TEST_API_BASE, TEST_API_TOKEN
class TestCreateRecords(unittest.TestCase):
def setUp(self):
vika = Vika(TEST_API_TOKEN)
vika.set_api_base(TEST_API_BASE)
self.dst = vika.datasheet(TEST_TABLE)
def test_record_cre... | 24.394737 | 55 | 0.577131 | import unittest
import time
from vika import Vika
from . import TEST_TABLE, TEST_API_BASE, TEST_API_TOKEN
class TestCreateRecords(unittest.TestCase):
def setUp(self):
vika = Vika(TEST_API_TOKEN)
vika.set_api_base(TEST_API_BASE)
self.dst = vika.datasheet(TEST_TABLE)
def test_record_cre... | true | true |
f724e8e9d1a8e16562e5a832d20c371877bd9ce1 | 17,324 | py | Python | openmaptiles/mbtile_tools.py | smellman/openmaptiles-tools | c310d1a57d60477c0452575c5b1983bce3fffac2 | [
"MIT"
] | 3 | 2021-02-02T10:16:43.000Z | 2021-06-14T20:00:06.000Z | openmaptiles/mbtile_tools.py | smellman/openmaptiles-tools | c310d1a57d60477c0452575c5b1983bce3fffac2 | [
"MIT"
] | 1 | 2021-02-23T17:02:14.000Z | 2021-02-23T17:02:14.000Z | openmaptiles/mbtile_tools.py | isabella232/openmaptiles-tools | 84e76e7dd5e7118de8dd11f1945607de04d3ea0e | [
"MIT"
] | 1 | 2020-08-13T09:01:10.000Z | 2020-08-13T09:01:10.000Z | import json
import os
import sqlite3
from datetime import datetime
from pathlib import Path
import asyncpg
from tabulate import tabulate
from typing import Dict
from openmaptiles.pgutils import get_postgis_version, get_vector_layers
from openmaptiles.sqlite_utils import query
from openmaptiles.sqltomvt import MvtGene... | 40.571429 | 90 | 0.510102 | import json
import os
import sqlite3
from datetime import datetime
from pathlib import Path
import asyncpg
from tabulate import tabulate
from typing import Dict
from openmaptiles.pgutils import get_postgis_version, get_vector_layers
from openmaptiles.sqlite_utils import query
from openmaptiles.sqltomvt import MvtGene... | true | true |
f724e92c199fe24cf4485298fdf880c51432d6c6 | 6,498 | py | Python | onnx_chainer/functions/__init__.py | blakexu/chainer | f3c2948af2796bb5096f628220fd7321120e1a75 | [
"MIT"
] | 1 | 2019-10-30T06:43:45.000Z | 2019-10-30T06:43:45.000Z | onnx_chainer/functions/__init__.py | blakexu/chainer | f3c2948af2796bb5096f628220fd7321120e1a75 | [
"MIT"
] | null | null | null | onnx_chainer/functions/__init__.py | blakexu/chainer | f3c2948af2796bb5096f628220fd7321120e1a75 | [
"MIT"
] | null | null | null | from onnx_chainer.functions.activation import convert_ClippedReLU # NOQA
from onnx_chainer.functions.activation import convert_ELU # NOQA
from onnx_chainer.functions.activation import convert_HardSigmoid # NOQA
from onnx_chainer.functions.activation import convert_LeakyReLU # NOQA
from onnx_chainer.functions.activa... | 62.480769 | 91 | 0.851185 | from onnx_chainer.functions.activation import convert_ClippedReLU
from onnx_chainer.functions.activation import convert_ELU
from onnx_chainer.functions.activation import convert_HardSigmoid
from onnx_chainer.functions.activation import convert_LeakyReLU
from onnx_chainer.functions.activation import convert_LogS... | true | true |
f724eb2bf2b936eabc0cf6b12314246ce61bb4cc | 244 | py | Python | crypten/common/__init__.py | vreis/CrypTen-2 | 839a751277a901e4edd9166a720fb3a29deac641 | [
"MIT"
] | 2 | 2020-03-23T18:32:13.000Z | 2020-12-11T10:54:08.000Z | crypten/common/__init__.py | vreis/CrypTen-2 | 839a751277a901e4edd9166a720fb3a29deac641 | [
"MIT"
] | null | null | null | crypten/common/__init__.py | vreis/CrypTen-2 | 839a751277a901e4edd9166a720fb3a29deac641 | [
"MIT"
] | 2 | 2020-04-15T19:28:02.000Z | 2020-04-16T01:59:30.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.
__all__ = ["rng", "tensor_types", "util"]
| 27.111111 | 65 | 0.721311 |
__all__ = ["rng", "tensor_types", "util"]
| true | true |
f724ebf9502cb921a15388d5af77f9d5423ced5c | 104,651 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_firewall_policy6.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_firewall_policy6.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortios/plugins/modules/fortios_firewall_policy6.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | 32.230059 | 144 | 0.32553 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_firewall_policy6
short_description:... | true | true |
f724ef7c58e53166da599152abac034e13800121 | 368 | py | Python | copyspecial/my_test.py | rayedbar/google_python_exercises | 9b0903ab9acd91ca82d9568725139cfbb43edae6 | [
"Apache-2.0"
] | null | null | null | copyspecial/my_test.py | rayedbar/google_python_exercises | 9b0903ab9acd91ca82d9568725139cfbb43edae6 | [
"Apache-2.0"
] | null | null | null | copyspecial/my_test.py | rayedbar/google_python_exercises | 9b0903ab9acd91ca82d9568725139cfbb43edae6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys
import os
import subprocess
filename = 'haha.txt'
try:
f = open(filename, 'rU')
text = f.read()
f.close()
except IOError:
## Control jumps directly to here if any of the above lines throws IOError.
sys.stderr.write('problem reading:' + filename)
## In any case, the code th... | 21.647059 | 79 | 0.701087 |
import sys
import os
import subprocess
filename = 'haha.txt'
try:
f = open(filename, 'rU')
text = f.read()
f.close()
except IOError:
| true | true |
f724efb25c23769a08c939a3c661b1d41864648b | 7,801 | py | Python | laser-chess-backend/app/core/routers/users.py | tojatos/laser-tactics | 538bef7ab03bf35c0ef27e195001f6f7f12c1ba4 | [
"MIT"
] | 2 | 2021-12-12T03:45:18.000Z | 2021-12-21T03:53:23.000Z | laser-chess-backend/app/core/routers/users.py | tojatos/laser-tactics | 538bef7ab03bf35c0ef27e195001f6f7f12c1ba4 | [
"MIT"
] | 1 | 2022-03-26T15:13:29.000Z | 2022-03-26T15:13:29.000Z | laser-chess-backend/app/core/routers/users.py | tojatos/laser-tactics | 538bef7ab03bf35c0ef27e195001f6f7f12c1ba4 | [
"MIT"
] | null | null | null | from fastapi import Depends, HTTPException
from fastapi import status, APIRouter
from jose import JWTError, jwt
from sqlalchemy.orm import Session
from app.core.dependecies import get_db, SECRET_KEY, ALGORITHM, TokenPurpose, get_current_active_user, get_current_user, \
verify_password
from app.core.internal import... | 46.159763 | 122 | 0.735419 | from fastapi import Depends, HTTPException
from fastapi import status, APIRouter
from jose import JWTError, jwt
from sqlalchemy.orm import Session
from app.core.dependecies import get_db, SECRET_KEY, ALGORITHM, TokenPurpose, get_current_active_user, get_current_user, \
verify_password
from app.core.internal import... | true | true |
f724f1291e5caf124dff577988cb066ae98c82f0 | 22,034 | py | Python | tests/gcp/hooks/test_bigtable.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-09-19T15:22:15.000Z | 2019-09-19T15:22:15.000Z | tests/gcp/hooks/test_bigtable.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2017-05-11T22:57:49.000Z | 2017-05-11T22:57:49.000Z | tests/gcp/hooks/test_bigtable.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-11-16T09:03:58.000Z | 2020-11-16T09:03:58.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 49.626126 | 102 | 0.745983 |
import unittest
import google
from google.cloud.bigtable import Client
from google.cloud.bigtable.instance import Instance
from tests.contrib.utils.base_gcp_mock import mock_base_gcp_hook_no_default_project_id, \
mock_base_gcp_hook_default_project_id, GCP_PROJECT_ID_HOOK_UNIT_TEST
from tests.c... | true | true |
f724f160afc41ed74cc89d83afb1c22e3d02f806 | 3,920 | py | Python | example.py | byu-dml/d3m-profiler | 9a3bc45061267091b0109f2159648785e370a18b | [
"MIT"
] | null | null | null | example.py | byu-dml/d3m-profiler | 9a3bc45061267091b0109f2159648785e370a18b | [
"MIT"
] | 5 | 2020-04-22T19:15:06.000Z | 2021-03-25T15:28:30.000Z | example.py | byu-dml/d3m-profiler | 9a3bc45061267091b0109f2159648785e370a18b | [
"MIT"
] | null | null | null | import numpy as np
import multiprocessing as mp
import pathlib as pl
import pandas as pd
import pickle
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC as SupportVectorClassifier
from sklearn.metrics import accuracy_score, f1_score
from sklearn.model_selection import train_test_split
fro... | 36.981132 | 152 | 0.685969 | import numpy as np
import multiprocessing as mp
import pathlib as pl
import pandas as pd
import pickle
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC as SupportVectorClassifier
from sklearn.metrics import accuracy_score, f1_score
from sklearn.model_selection import train_test_split
fro... | true | true |
f724f1b8cc56dd4a31f3d47d459ebef89ff7cdca | 21,725 | py | Python | mmdet/datasets/coco.py | YunongPan/swin_gui | 52adc917d3413781e76609d021c6a2579fdf44d1 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/coco.py | YunongPan/swin_gui | 52adc917d3413781e76609d021c6a2579fdf44d1 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/coco.py | YunongPan/swin_gui | 52adc917d3413781e76609d021c6a2579fdf44d1 | [
"Apache-2.0"
] | null | null | null | import itertools
import logging
import os.path as osp
import tempfile
from collections import OrderedDict
import mmcv
import numpy as np
import pycocotools
from mmcv.utils import print_log
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from mmdet.core... | 40.683521 | 79 | 0.529758 | import itertools
import logging
import os.path as osp
import tempfile
from collections import OrderedDict
import mmcv
import numpy as np
import pycocotools
from mmcv.utils import print_log
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from mmdet.core... | true | true |
f724f1c71834d7b7a9d035b610d98d0f0773158a | 1,933 | py | Python | website/migrations/0005_auto_20191213_1623.py | mwalsh161/iquise-website | ab674d7881e418fe02b533ae477982e328e8fec7 | [
"MIT"
] | 1 | 2021-12-19T01:05:26.000Z | 2021-12-19T01:05:26.000Z | website/migrations/0005_auto_20191213_1623.py | iQuISE/iquise-website | e6125fe938c549e020cd53a5aa718de101e972e9 | [
"MIT"
] | 16 | 2020-07-29T14:12:30.000Z | 2021-08-24T13:00:48.000Z | website/migrations/0005_auto_20191213_1623.py | mwalsh161/iquise-website | ab674d7881e418fe02b533ae477982e328e8fec7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-12-13 21:23
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('website', '0004_presenter_profile_image_thumb'),
]
... | 39.44898 | 144 | 0.608381 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('website', '0004_presenter_profile_image_thumb'),
]
operations = [
migrations.CreateModel(
name='Embed... | true | true |
f724f2e2d80fad9431aae8674677cf6022972166 | 7,735 | py | Python | telepresence/proxy/remote.py | Nesurion/telepresence | cfe60eb91b42345ff890b7726c6388e923bc441a | [
"Apache-2.0"
] | null | null | null | telepresence/proxy/remote.py | Nesurion/telepresence | cfe60eb91b42345ff890b7726c6388e923bc441a | [
"Apache-2.0"
] | null | null | null | telepresence/proxy/remote.py | Nesurion/telepresence | cfe60eb91b42345ff890b7726c6388e923bc441a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Datawire. 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 agr... | 35.645161 | 78 | 0.587589 |
import json
from subprocess import STDOUT, CalledProcessError
from typing import Dict, Optional
from telepresence import image_version
from telepresence.runner import Runner
class RemoteInfo(object):
def __init__(
self,
runner: Runner,
deployment_name: str,
pod_name... | true | true |
f724f33ecccdbc81d47a05655141217459e84376 | 3,882 | py | Python | src/simulate.py | ElanVB/noisy_signal_prop | 3ad81e15f02a92b3a669c9b81c8b2f12f331a1b6 | [
"MIT"
] | 5 | 2018-10-31T08:55:37.000Z | 2020-01-14T08:18:22.000Z | src/simulate.py | ElanVB/noisy_signal_prop | 3ad81e15f02a92b3a669c9b81c8b2f12f331a1b6 | [
"MIT"
] | null | null | null | src/simulate.py | ElanVB/noisy_signal_prop | 3ad81e15f02a92b3a669c9b81c8b2f12f331a1b6 | [
"MIT"
] | null | null | null |
# imports
import numpy as np
import os, sys, pickle
file_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(file_dir)
# custom import
from theory import depth
from viz import get_colours
from numpy_simulation import *
from utils import load_experiment
from theory import critical_point
def perform_exp... | 44.62069 | 89 | 0.519578 |
import numpy as np
import os, sys, pickle
file_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(file_dir)
from theory import depth
from viz import get_colours
from numpy_simulation import *
from utils import load_experiment
from theory import critical_point
def perform_experiment(experiments):
... | true | true |
f724f3b40f32d0b3f43e1e0eb69678d13e641ccd | 872 | py | Python | python-threatexchange/threatexchange/extensions/text_tlsh/tests/test_tlsh_hash_and_match.py | dxdc/ThreatExchange | f9aff6dd0c90e6c47ffe4151bced4de1676d84f6 | [
"BSD-3-Clause"
] | null | null | null | python-threatexchange/threatexchange/extensions/text_tlsh/tests/test_tlsh_hash_and_match.py | dxdc/ThreatExchange | f9aff6dd0c90e6c47ffe4151bced4de1676d84f6 | [
"BSD-3-Clause"
] | null | null | null | python-threatexchange/threatexchange/extensions/text_tlsh/tests/test_tlsh_hash_and_match.py | dxdc/ThreatExchange | f9aff6dd0c90e6c47ffe4151bced4de1676d84f6 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import unittest
from threatexchange.extensions.text_tlsh.text_tlsh import TextTLSHSignal
try:
import tlsh
_DISABLED = False
except ImportError:
_DISABLED = True
@unittest.skipIf(_DISABLED, "tlsh not installed")
class TLSHHasherModul... | 31.142857 | 79 | 0.681193 |
import unittest
from threatexchange.extensions.text_tlsh.text_tlsh import TextTLSHSignal
try:
import tlsh
_DISABLED = False
except ImportError:
_DISABLED = True
@unittest.skipIf(_DISABLED, "tlsh not installed")
class TLSHHasherModuleUnitTest(unittest.TestCase):
def test_tlsh_from_string(self):
... | true | true |
f724f5a468382942a4bfe330e8981878747ab446 | 342 | py | Python | backend/rumergy_backend/rumergy/serializers/data_log_measures_serializer.py | Firefly-Tech/rumergy-webapp | 859054bd9ee710a11b393027bb9cb1bad55d0f00 | [
"MIT"
] | 1 | 2021-11-08T00:28:37.000Z | 2021-11-08T00:28:37.000Z | backend/rumergy_backend/rumergy/serializers/data_log_measures_serializer.py | Firefly-Tech/rumergy-webapp | 859054bd9ee710a11b393027bb9cb1bad55d0f00 | [
"MIT"
] | 1 | 2021-11-02T02:17:37.000Z | 2021-11-02T02:17:37.000Z | backend/rumergy_backend/rumergy/serializers/data_log_measures_serializer.py | Firefly-Tech/rumergy-webapp | 859054bd9ee710a11b393027bb9cb1bad55d0f00 | [
"MIT"
] | 1 | 2021-10-18T22:27:04.000Z | 2021-10-18T22:27:04.000Z | from rumergy_backend.rumergy.models import DataLogMeasures
from rest_framework import serializers
class DataLogMeasuresSerializer(serializers.ModelSerializer):
"""Serializer for data log measures model"""
class Meta:
model = DataLogMeasures
fields = ["id", "data_log", "data_point", "value", "... | 31.090909 | 81 | 0.736842 | from rumergy_backend.rumergy.models import DataLogMeasures
from rest_framework import serializers
class DataLogMeasuresSerializer(serializers.ModelSerializer):
class Meta:
model = DataLogMeasures
fields = ["id", "data_log", "data_point", "value", "timestamp", "status"]
| true | true |
f724f7cfee52c3eaa2ba94c61fd8676dd873a730 | 56,226 | py | Python | python/paddle/nn/layer/conv.py | SmirnovKol/Paddle | a3730dc87bc61593514b830727e36e5d19e753cd | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/nn/layer/conv.py | SmirnovKol/Paddle | a3730dc87bc61593514b830727e36e5d19e753cd | [
"Apache-2.0"
] | null | null | null | python/paddle/nn/layer/conv.py | SmirnovKol/Paddle | a3730dc87bc61593514b830727e36e5d19e753cd | [
"Apache-2.0"
] | 1 | 2021-09-24T11:23:36.000Z | 2021-09-24T11:23:36.000Z | # Copyright (c) 2020 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... | 47.974403 | 417 | 0.571426 |
import numpy as np
from paddle import get_flags
from ...device import get_cudnn_version
from .. import Layer
from ..initializer import Normal
from .. import functional as F
from ...fluid.layers import utils
from ..functional.conv import _update_padding_nd
from ...device import is_compiled_with_cuda
fro... | true | true |
f724fa482a2e003d04725bb8120a96a0f5ea185d | 232 | py | Python | torpedo/dialects/torpedo-vertica/tests/connection_config.py | darKoram/torpedo | fbda29225044e946465bae3782a3071d0d1a2fe3 | [
"MIT"
] | 1 | 2015-02-28T14:42:57.000Z | 2015-02-28T14:42:57.000Z | torpedo/dialects/torpedo-vertica/tests/connection_config.py | darKoram/torpedo | fbda29225044e946465bae3782a3071d0d1a2fe3 | [
"MIT"
] | null | null | null | torpedo/dialects/torpedo-vertica/tests/connection_config.py | darKoram/torpedo | fbda29225044e946465bae3782a3071d0d1a2fe3 | [
"MIT"
] | null | null | null | drivername = 'vertica+pyodbc'
username = 'your_name'
host = 'your_host_ip_or_hostname'
database = 'your_db_name'
# odbcinst.ini entry [vertica_deploy_test_db]
odbcpath = '/path/to/your/odbc.ini'
datasource = 'your_odbc.ini_section'
| 29 | 45 | 0.780172 | drivername = 'vertica+pyodbc'
username = 'your_name'
host = 'your_host_ip_or_hostname'
database = 'your_db_name'
odbcpath = '/path/to/your/odbc.ini'
datasource = 'your_odbc.ini_section'
| true | true |
f724fa517398283eeaa453c0a6afffa1631cdf46 | 3,846 | py | Python | TA-linode/bin/ta_linode/aob_py3/splunktalib/common/log.py | jriddle-linode/splunk-addon-linode | 5954acd12ef88ab991365ef51072db68aed46aa1 | [
"Apache-2.0"
] | 11 | 2020-01-23T11:32:26.000Z | 2021-09-23T09:24:02.000Z | TA-linode/bin/ta_linode/aob_py3/splunktalib/common/log.py | jriddle-linode/splunk-addon-linode | 5954acd12ef88ab991365ef51072db68aed46aa1 | [
"Apache-2.0"
] | 26 | 2019-07-15T02:38:22.000Z | 2021-12-01T04:14:17.000Z | TA-linode/bin/ta_linode/aob_py3/splunktalib/common/log.py | jriddle-linode/splunk-addon-linode | 5954acd12ef88ab991365ef51072db68aed46aa1 | [
"Apache-2.0"
] | 6 | 2019-07-14T17:44:06.000Z | 2020-11-17T17:33:23.000Z | # SPDX-FileCopyrightText: 2020 Splunk Inc.
#
# SPDX-License-Identifier: Apache-2.0
"""
Copyright (C) 2005-2019 Splunk Inc. All Rights Reserved.
log utility for TA
"""
from builtins import object
import logging
import logging.handlers as handlers
import os.path as op
from splunktalib.splunk_platform import make_splun... | 28.488889 | 98 | 0.608684 |
from builtins import object
import logging
import logging.handlers as handlers
import os.path as op
from splunktalib.splunk_platform import make_splunkhome_path
import splunktalib.common.util as cutil
from splunktalib.common.pattern import singleton
import time
logging.Formatter.converter = time.gmtime
def log... | true | true |
f724fb20745e78bebd0c20e4126667f97df1a297 | 1,882 | py | Python | toontown/chat/ToonChatGarbler.py | philicheese2003/ToontownProjectAltisServer | cfa225d1bdddacdbd29b621382347fce17e1dc66 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/chat/ToonChatGarbler.py | kool601/Project-Altis-Educational-Source | 0a74999fb52d4e690a41b984703119f63c372d20 | [
"Apache-2.0"
] | null | null | null | toontown/chat/ToonChatGarbler.py | kool601/Project-Altis-Educational-Source | 0a74999fb52d4e690a41b984703119f63c372d20 | [
"Apache-2.0"
] | 2 | 2017-12-20T17:46:56.000Z | 2021-06-25T02:56:36.000Z | import string
import random
from toontown.toonbase import TTLocalizer
from otp.otpbase import OTPLocalizer
from otp.chat import ChatGarbler
class ToonChatGarbler(ChatGarbler.ChatGarbler):
animalSounds = {'dog': TTLocalizer.ChatGarblerDog,
'cat': TTLocalizer.ChatGarblerCat,
'mouse': TTLocalizer.ChatGarble... | 36.901961 | 63 | 0.652497 | import string
import random
from toontown.toonbase import TTLocalizer
from otp.otpbase import OTPLocalizer
from otp.chat import ChatGarbler
class ToonChatGarbler(ChatGarbler.ChatGarbler):
animalSounds = {'dog': TTLocalizer.ChatGarblerDog,
'cat': TTLocalizer.ChatGarblerCat,
'mouse': TTLocalizer.ChatGarble... | true | true |
f724fb8f9f9d4d1e3c0793409f6c05445f76ed63 | 5,652 | py | Python | xscale/signal/tests/test_fitting.py | serazing/xscale | a804866aa6f6a5a0f293a7f6765ea17403159134 | [
"Apache-2.0"
] | 24 | 2017-02-28T15:01:29.000Z | 2022-02-22T08:26:23.000Z | xscale/signal/tests/test_fitting.py | serazing/xscale | a804866aa6f6a5a0f293a7f6765ea17403159134 | [
"Apache-2.0"
] | 19 | 2017-02-24T12:30:26.000Z | 2022-02-25T04:57:32.000Z | xscale/signal/tests/test_fitting.py | serazing/xscale | a804866aa6f6a5a0f293a7f6765ea17403159134 | [
"Apache-2.0"
] | 10 | 2017-03-04T02:59:42.000Z | 2021-11-14T12:40:54.000Z | # Python 2/3 compatibility
from __future__ import absolute_import, division, print_function
import xarray as xr
import numpy as np
import pandas as pd
import xscale.signal.fitting as xfit
def test_polyfit():
Nt, Nx, Ny = 100, 128, 128
rand = xr.DataArray(np.random.rand(Nt, Nx, Ny), dims=['time', 'x', 'y'])
slopes =... | 43.476923 | 77 | 0.607396 |
from __future__ import absolute_import, division, print_function
import xarray as xr
import numpy as np
import pandas as pd
import xscale.signal.fitting as xfit
def test_polyfit():
Nt, Nx, Ny = 100, 128, 128
rand = xr.DataArray(np.random.rand(Nt, Nx, Ny), dims=['time', 'x', 'y'])
slopes = 0.02 * xr.DataArray(np.co... | true | true |
f724fdc85b1773dff69d97659ac96bcf9ba268b2 | 937 | py | Python | sql/hive/src/test/resources/data/scripts/dumpdata_script.py | OlegPt/spark | c79fd911ca85f883c493c5e888f7690868d7b5ea | [
"Apache-2.0"
] | 35,083 | 2015-01-01T03:05:13.000Z | 2022-03-31T21:57:40.000Z | sql/hive/src/test/resources/data/scripts/dumpdata_script.py | OlegPt/spark | c79fd911ca85f883c493c5e888f7690868d7b5ea | [
"Apache-2.0"
] | 32,117 | 2015-01-01T00:00:24.000Z | 2022-03-31T23:54:58.000Z | sql/hive/src/test/resources/data/scripts/dumpdata_script.py | OlegPt/spark | c79fd911ca85f883c493c5e888f7690868d7b5ea | [
"Apache-2.0"
] | 29,687 | 2015-01-01T02:40:43.000Z | 2022-03-31T16:49:33.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.464286 | 61 | 0.736393 |
import sys
for i in range(50):
for j in range(5):
for k in range(20022):
print(20000 * i + k)
for line in sys.stdin:
pass
| true | true |
f724feb3c1b587e44e19364e647668548b195782 | 860 | py | Python | grnglow/glow/views/home.py | xiaokai111/green-glow | 19e399c32ee4d3cfc026684b06f49df9b7dd10d5 | [
"MIT"
] | 18 | 2016-03-19T10:57:43.000Z | 2021-10-10T07:52:51.000Z | grnglow/glow/views/home.py | xiaokai111/green-glow | 19e399c32ee4d3cfc026684b06f49df9b7dd10d5 | [
"MIT"
] | 3 | 2019-06-13T03:15:11.000Z | 2020-06-05T18:16:52.000Z | grnglow/glow/views/home.py | xiaokai111/green-glow | 19e399c32ee4d3cfc026684b06f49df9b7dd10d5 | [
"MIT"
] | 11 | 2017-05-15T14:24:17.000Z | 2021-10-10T07:52:56.000Z | # -*- encoding: utf-8 -*-
'''
Created on 2012-3-23
@author: Neil
'''
from django.shortcuts import render_to_response
from grnglow.glow.views import people
from grnglow.glow.models.photo import Photo
def base(request):
return render_to_response('base.html')
def index(request):
if request.user.is_authenticat... | 28.666667 | 89 | 0.660465 |
from django.shortcuts import render_to_response
from grnglow.glow.views import people
from grnglow.glow.models.photo import Photo
def base(request):
return render_to_response('base.html')
def index(request):
if request.user.is_authenticated():
return people.home(request, str(request.user.i... | true | true |
f72500addb9c5aa51a6fb2310b80123201744064 | 5,721 | py | Python | parsers/file_name_validators.py | ddexnet/dsrf | 1dc231ef911e9ee4fbf2fae77ceaef08755f3f7e | [
"Apache-2.0"
] | 34 | 2016-04-28T13:35:50.000Z | 2022-02-21T08:25:21.000Z | parsers/file_name_validators.py | ddexnet/dsrf | 1dc231ef911e9ee4fbf2fae77ceaef08755f3f7e | [
"Apache-2.0"
] | 2 | 2020-02-07T16:37:19.000Z | 2021-01-13T16:57:40.000Z | parsers/file_name_validators.py | ddexnet/dsrf | 1dc231ef911e9ee4fbf2fae77ceaef08755f3f7e | [
"Apache-2.0"
] | 16 | 2016-05-20T12:30:20.000Z | 2022-03-24T13:44:16.000Z | # Lint as: python2, python3
# Copyright 2015 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 req... | 38.918367 | 80 | 0.707394 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import zip
from dsrf import constants
from dsrf import error
class FileNameValidator(object):
def __init__(self, expected_components):
self.expected_components = expected... | true | true |
f725013d099dbb0b8a35ade5b1cc606b7b8eb889 | 3,373 | py | Python | webcams/eye_status.py | OlegBezverhii/python-notebooks | 5d4b501173a2f3519bff9a085c3d2190ce6cf808 | [
"MIT"
] | null | null | null | webcams/eye_status.py | OlegBezverhii/python-notebooks | 5d4b501173a2f3519bff9a085c3d2190ce6cf808 | [
"MIT"
] | null | null | null | webcams/eye_status.py | OlegBezverhii/python-notebooks | 5d4b501173a2f3519bff9a085c3d2190ce6cf808 | [
"MIT"
] | null | null | null | import os
from PIL import Image
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import AveragePooling2D
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import mod... | 26.769841 | 103 | 0.731693 | import os
from PIL import Image
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import AveragePooling2D
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import mod... | true | true |
f7250248eaa636892462bb0e99e0d5df70467f27 | 22,991 | py | Python | flaski/apps/main/ihistogram.py | mpg-age-bioinformatics/flaski | f56e00dd80d8706ecb8593ba6585a97eed881896 | [
"MIT"
] | 9 | 2020-08-03T01:22:59.000Z | 2022-03-03T02:02:04.000Z | flaski/apps/main/ihistogram.py | mpg-age-bioinformatics/flaski | f56e00dd80d8706ecb8593ba6585a97eed881896 | [
"MIT"
] | 79 | 2020-06-03T06:34:46.000Z | 2021-09-22T13:31:43.000Z | flaski/apps/main/ihistogram.py | mpg-age-bioinformatics/flaski | f56e00dd80d8706ecb8593ba6585a97eed881896 | [
"MIT"
] | 5 | 2020-10-05T10:20:23.000Z | 2022-03-01T14:23:12.000Z | #from matplotlib.figure import Figure
import plotly.express as px
import plotly.graph_objects as go
import plotly.figure_factory as ff
from collections import OrderedDict
import numpy as np
import sys
def GET_COLOR(x):
if str(x)[:3].lower() == "rgb":
vals=x.split("rgb(")[-1].split(")")[0].split(",")
... | 42.108059 | 170 | 0.610587 |
import plotly.express as px
import plotly.graph_objects as go
import plotly.figure_factory as ff
from collections import OrderedDict
import numpy as np
import sys
def GET_COLOR(x):
if str(x)[:3].lower() == "rgb":
vals=x.split("rgb(")[-1].split(")")[0].split(",")
vals=[ float(s.strip(" ")) for s i... | true | true |
f72502fa59d5dbbaf1359af738eaf27afc125199 | 2,374 | py | Python | .history/spider/pokemon_spider_20201213130808.py | KustomApe/ksie | d6f97d0298d04d06788563546c66ff50c6bb2d31 | [
"MIT"
] | 1 | 2021-12-11T04:50:25.000Z | 2021-12-11T04:50:25.000Z | .history/spider/pokemon_spider_20201213130808.py | KustomApe/ksie | d6f97d0298d04d06788563546c66ff50c6bb2d31 | [
"MIT"
] | null | null | null | .history/spider/pokemon_spider_20201213130808.py | KustomApe/ksie | d6f97d0298d04d06788563546c66ff50c6bb2d31 | [
"MIT"
] | null | null | null | from selenium import webdriver
import pandas as pd
import time
"""[注意事項]
robot.txtを必ず読んで、ルールに沿った形でクローリングするように気をつけてください。
あくまで自己責任でお願いできればと思います。
"""
"""[Initial Setting]
初期設定
"""
options = webdriver.ChromeOptions()
options.add_argument('--headeless')
options.add_argument('--disable-gpu')
options.add_argument('--lang-ja... | 33.43662 | 121 | 0.655013 | from selenium import webdriver
import pandas as pd
import time
options = webdriver.ChromeOptions()
options.add_argument('--headeless')
options.add_argument('--disable-gpu')
options.add_argument('--lang-ja')
browser = webdriver.Chrome(chrome_options=options, executable_path='./chromedriver')
df = pd.DataFrame(columns=... | true | true |
f72503d39b41bc560c31dfc0d1965fa96e277d2c | 2,467 | py | Python | data/image_folder.py | OnizukaLab/pytorch-CycleGAN-and-pix2pix | 95b8dfe8bba43ae5ec9d7b299107fc155e7939c0 | [
"BSD-3-Clause"
] | null | null | null | data/image_folder.py | OnizukaLab/pytorch-CycleGAN-and-pix2pix | 95b8dfe8bba43ae5ec9d7b299107fc155e7939c0 | [
"BSD-3-Clause"
] | 2 | 2019-07-30T09:02:40.000Z | 2019-08-01T11:36:44.000Z | data/image_folder.py | OnizukaLab/pytorch-CycleGAN-and-pix2pix | 95b8dfe8bba43ae5ec9d7b299107fc155e7939c0 | [
"BSD-3-Clause"
] | null | null | null | """A modified image folder class
We modify the official PyTorch image folder (https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py)
so that this class can load images from both current directory and its subdirectories.
"""
import torch.utils.data as data
from PIL import Image
import os
import... | 29.369048 | 122 | 0.602756 |
import torch.utils.data as data
from PIL import Image
import os
import os.path
import re
IMG_EXTENSIONS = [
'.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP',
]
PATTERN = re.compile(r".*?([0-9]+)\.(jpg|JPG|jpeg|JPEG|png|PNG|ppm|PPM|bmp|BMP)$")
def is_image_file(filename):
... | true | true |
f725054c84988206eb2120605f89dfc44d68a15d | 8,431 | py | Python | recipes/libxslt/all/conanfile.py | aapng/conan-center-index | d68a8fbb938402a5a53fa6b0214c49ccf878f8a9 | [
"MIT"
] | null | null | null | recipes/libxslt/all/conanfile.py | aapng/conan-center-index | d68a8fbb938402a5a53fa6b0214c49ccf878f8a9 | [
"MIT"
] | 1 | 2021-05-12T10:46:25.000Z | 2021-05-13T06:12:41.000Z | recipes/libxslt/all/conanfile.py | aapng/conan-center-index | d68a8fbb938402a5a53fa6b0214c49ccf878f8a9 | [
"MIT"
] | 2 | 2020-10-24T00:42:55.000Z | 2021-01-26T09:01:14.000Z | import glob
import os
from conans import ConanFile, tools, AutoToolsBuildEnvironment, VisualStudioBuildEnvironment
class LibxsltConan(ConanFile):
name = "libxslt"
url = "https://github.com/conan-io/conan-center-index"
description = "libxslt is a software library implementing XSLT processor, based on libxm... | 45.572973 | 134 | 0.562448 | import glob
import os
from conans import ConanFile, tools, AutoToolsBuildEnvironment, VisualStudioBuildEnvironment
class LibxsltConan(ConanFile):
name = "libxslt"
url = "https://github.com/conan-io/conan-center-index"
description = "libxslt is a software library implementing XSLT processor, based on libxm... | true | true |
f72505f9706d238ac6c8305129e9adec3227f5ac | 2,455 | py | Python | Software for Proof of Work/SourceCode.py | fkerem/Cryptocurrency-Blockchain | 965268a09a6f8b3e700e8bbc741e49a4d54805c6 | [
"MIT"
] | null | null | null | Software for Proof of Work/SourceCode.py | fkerem/Cryptocurrency-Blockchain | 965268a09a6f8b3e700e8bbc741e49a4d54805c6 | [
"MIT"
] | null | null | null | Software for Proof of Work/SourceCode.py | fkerem/Cryptocurrency-Blockchain | 965268a09a6f8b3e700e8bbc741e49a4d54805c6 | [
"MIT"
] | null | null | null | """
Readme.txt:
Required modules: random, sys, hashlib, sha3
Please read the comments below for further explanation.
"""
from random import *
import sys
import hashlib
if sys.version_info < (3, 6):
import sha3
def serialnoncegenerator(): # To generate uniformly randomly 128-bit integer
serial... | 33.175676 | 129 | 0.61833 |
from random import *
import sys
import hashlib
if sys.version_info < (3, 6):
import sha3
def serialnoncegenerator():
serial = str(randint(0, 2**128 - 1))
return serial
def payee():
payee = ""
for i in range(10):
num = randint(48, 90)
while(num > 57 and num < 65):
... | true | true |
f725069e16f136f40e31fccafac67c140404d6b4 | 59,971 | py | Python | flash/core/data/data_module.py | sumanmichael/lightning-flash | 4c69c1bf49fa74d0f2fdb9c4dbdcdfd5942352db | [
"Apache-2.0"
] | null | null | null | flash/core/data/data_module.py | sumanmichael/lightning-flash | 4c69c1bf49fa74d0f2fdb9c4dbdcdfd5942352db | [
"Apache-2.0"
] | null | null | null | flash/core/data/data_module.py | sumanmichael/lightning-flash | 4c69c1bf49fa74d0f2fdb9c4dbdcdfd5942352db | [
"Apache-2.0"
] | 1 | 2021-07-14T09:17:46.000Z | 2021-07-14T09:17:46.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... | 48.402744 | 119 | 0.644712 |
import os
import platform
from typing import Any, Callable, Collection, Dict, Iterable, List, Optional, Sequence, Tuple, TYPE_CHECKING, Union
import numpy as np
import pytorch_lightning as pl
import torch
from pytorch_lightning.trainer.states import RunningStage
from pytorch_lightning.utilities.exceptions... | true | true |
f72506abcd96241b0e568bab11db58147f3f22c6 | 13,446 | py | Python | source/rttov_test/profile-datasets-py/div83/028.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | null | null | null | source/rttov_test/profile-datasets-py/div83/028.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | 1 | 2022-03-12T12:19:59.000Z | 2022-03-12T12:19:59.000Z | source/rttov_test/profile-datasets-py/div83/028.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | null | null | null | """
Profile ../profile-datasets-py/div83/028.py
file automaticaly created by prof_gen.py script
"""
self["ID"] = "../profile-datasets-py/div83/028.py"
self["Q"] = numpy.array([ 2.70658300e+00, 2.88421200e+00, 3.36234900e+00,
4.31645100e+00, 5.09368400e+00, 5.28904200e+00,
5.1902... | 57.956897 | 92 | 0.566711 |
self["ID"] = "../profile-datasets-py/div83/028.py"
self["Q"] = numpy.array([ 2.70658300e+00, 2.88421200e+00, 3.36234900e+00,
4.31645100e+00, 5.09368400e+00, 5.28904200e+00,
5.19020300e+00, 5.37709100e+00, 5.81179600e+00,
6.08195300e+00, 6.10215300e+00, 6.10604300e+00,
... | true | true |
f725070abe59440c81ec609b73017feaae140853 | 4,547 | py | Python | mkt/home/tests/test_views.py | oremj/zamboni | a751dc6d22f7af947da327b0a091cbab0a999f49 | [
"BSD-3-Clause"
] | null | null | null | mkt/home/tests/test_views.py | oremj/zamboni | a751dc6d22f7af947da327b0a091cbab0a999f49 | [
"BSD-3-Clause"
] | null | null | null | mkt/home/tests/test_views.py | oremj/zamboni | a751dc6d22f7af947da327b0a091cbab0a999f49 | [
"BSD-3-Clause"
] | null | null | null | import datetime
from django.conf import settings
from nose.tools import eq_
from pyquery import PyQuery as pq
from amo.tests import app_factory, mock_es
from amo.urlresolvers import reverse
import mkt
from mkt.browse.tests.test_views import BrowseBase
from mkt.webapps.models import Webapp
from mkt.zadmin.models imp... | 35.248062 | 77 | 0.610073 | import datetime
from django.conf import settings
from nose.tools import eq_
from pyquery import PyQuery as pq
from amo.tests import app_factory, mock_es
from amo.urlresolvers import reverse
import mkt
from mkt.browse.tests.test_views import BrowseBase
from mkt.webapps.models import Webapp
from mkt.zadmin.models imp... | true | true |
f725072ba5ab89efad25c3839e4eab5683dd5e8a | 9,159 | py | Python | epgbackup/src/plugin.py | builder08/enigma2-plugins_2 | f8f08b947e23c1c86b011492a7323125774c3482 | [
"OLDAP-2.3"
] | null | null | null | epgbackup/src/plugin.py | builder08/enigma2-plugins_2 | f8f08b947e23c1c86b011492a7323125774c3482 | [
"OLDAP-2.3"
] | null | null | null | epgbackup/src/plugin.py | builder08/enigma2-plugins_2 | f8f08b947e23c1c86b011492a7323125774c3482 | [
"OLDAP-2.3"
] | null | null | null | # for localized messages
from . import _
# Config
from Components.config import config, ConfigYesNo, ConfigNumber, ConfigSelection, \
ConfigSubsection, ConfigSelectionNumber, ConfigDirectory, NoSave
from Screens.MessageBox import MessageBox
from Screens.Standby import TryQuitMainloop
from Tools.BoundFunction import b... | 39.821739 | 259 | 0.780653 |
from . import _
from Components.config import config, ConfigYesNo, ConfigNumber, ConfigSelection, \
ConfigSubsection, ConfigSelectionNumber, ConfigDirectory, NoSave
from Screens.MessageBox import MessageBox
from Screens.Standby import TryQuitMainloop
from Tools.BoundFunction import boundFunction
from EPGBackupToo... | true | true |
f725089c2e562403e45979d33cb8bab9a94933e2 | 6,399 | py | Python | OMG/env/random_load.py | Webbah/sec-for-reinforcement-learning | 19db622dce4963d25cb1b6e4ae12ddf98b6d27d2 | [
"MIT"
] | 2 | 2021-12-16T12:49:26.000Z | 2022-01-28T19:18:43.000Z | OMG/env/random_load.py | Webbah/sec-for-reinforcement-learning | 19db622dce4963d25cb1b6e4ae12ddf98b6d27d2 | [
"MIT"
] | null | null | null | OMG/env/random_load.py | Webbah/sec-for-reinforcement-learning | 19db622dce4963d25cb1b6e4ae12ddf98b6d27d2 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from openmodelica_microgrid_gym.util import RandProcess
class RandomLoad:
def __init__(self, train_episode_length: int, ts: float, rand_process: RandProcess, loadstep_time: int = None,
load_curve: pd.DataFrame = None, bounds=None, bounds_std=None):
... | 41.823529 | 119 | 0.609314 | import numpy as np
import pandas as pd
from openmodelica_microgrid_gym.util import RandProcess
class RandomLoad:
def __init__(self, train_episode_length: int, ts: float, rand_process: RandProcess, loadstep_time: int = None,
load_curve: pd.DataFrame = None, bounds=None, bounds_std=None):
... | true | true |
f72508f773fd8c5c239a480ae2c67e066c971dd2 | 1,265 | py | Python | api/migrations/0022_auto_20150222_0024.py | eiling/SchoolIdolAPI | a05980fdb33b143dbe2febfc1ad6cf723f025c8d | [
"Apache-2.0"
] | 65 | 2017-12-29T12:28:11.000Z | 2022-03-15T06:42:26.000Z | api/migrations/0022_auto_20150222_0024.py | eiling/SchoolIdolAPI | a05980fdb33b143dbe2febfc1ad6cf723f025c8d | [
"Apache-2.0"
] | 31 | 2017-12-18T02:03:09.000Z | 2022-01-13T00:43:35.000Z | api/migrations/0022_auto_20150222_0024.py | eiling/SchoolIdolAPI | a05980fdb33b143dbe2febfc1ad6cf723f025c8d | [
"Apache-2.0"
] | 7 | 2018-08-27T15:11:01.000Z | 2021-08-16T05:15:13.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('api', '0021_card_video_story'),
]
... | 30.853659 | 96 | 0.611858 |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('api', '0021_card_video_story'),
]
operations = [
... | true | true |
f725091c50677d690c2ec6cbbf02012349ecebe0 | 109,596 | py | Python | numpy/core/tests/test_datetime.py | kurtamohler/numpy | 73157efcd17da95ce984d1595ac4907233b9dbf5 | [
"BSD-3-Clause"
] | 1 | 2022-02-27T15:07:29.000Z | 2022-02-27T15:07:29.000Z | numpy/core/tests/test_datetime.py | kurtamohler/numpy | 73157efcd17da95ce984d1595ac4907233b9dbf5 | [
"BSD-3-Clause"
] | 41 | 2019-04-01T15:52:29.000Z | 2021-09-07T00:15:51.000Z | numpy/core/tests/test_datetime.py | kurtamohler/numpy | 73157efcd17da95ce984d1595ac4907233b9dbf5 | [
"BSD-3-Clause"
] | 4 | 2021-06-25T08:40:39.000Z | 2021-08-08T09:52:42.000Z |
import numpy
import numpy as np
import datetime
import pytest
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_warns, suppress_warnings,
assert_raises_regex,
)
from numpy.compat import pickle
# Use pytz to test out various time zones if available
try:
from pytz import timezone ... | 45.494396 | 101 | 0.53845 |
import numpy
import numpy as np
import datetime
import pytest
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_warns, suppress_warnings,
assert_raises_regex,
)
from numpy.compat import pickle
try:
from pytz import timezone as tz
_has_pytz = True
except ImportError:
_ha... | true | true |
f7250920aa8cce465657186e7f5d41dd1494786a | 2,066 | py | Python | azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-05-10T19:58:09.000Z | 2019-05-10T19:58:09.000Z | azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-datamigration/azure/mgmt/datamigration/models/project_file_properties_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-07-28T14:50:54.000Z | 2021-07-28T14:50:54.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 ... | 36.892857 | 108 | 0.616167 |
from msrest.serialization import Model
class ProjectFileProperties(Model):
_validation = {
'last_modified': {'readonly': True},
'size': {'readonly': True},
}
_attribute_map = {
'extension': {'key': 'extension', 'type': 'str'},
'file_path': {'key': 'filePath', '... | true | true |
f72509bc9ac00b2ac21743261ec417182f6782d1 | 6,683 | py | Python | code/gtp/gtp.py | Go-Trojans/trojan-go | bf1160120e79fbb1cdd37fa08f17160fb133aa40 | [
"Artistic-1.0-cl8"
] | null | null | null | code/gtp/gtp.py | Go-Trojans/trojan-go | bf1160120e79fbb1cdd37fa08f17160fb133aa40 | [
"Artistic-1.0-cl8"
] | null | null | null | code/gtp/gtp.py | Go-Trojans/trojan-go | bf1160120e79fbb1cdd37fa08f17160fb133aa40 | [
"Artistic-1.0-cl8"
] | 1 | 2021-08-28T20:31:01.000Z | 2021-08-28T20:31:01.000Z | # GTP for Trojan-go
# Helper file
import re
def pre_engine(s):
s = re.sub("[^\t\n -~]", "", s)
s = s.split("#")[0]
s = s.replace("\t", " ")
return s
def pre_controller(s):
s = re.sub("[^\t\n -~]", "", s)
s = s.replace("\t", " ")
return s
def gtp_boolean(b):
return "true" if b else "... | 25.029963 | 77 | 0.572497 |
import re
def pre_engine(s):
s = re.sub("[^\t\n -~]", "", s)
s = s.split("#")[0]
s = s.replace("\t", " ")
return s
def pre_controller(s):
s = re.sub("[^\t\n -~]", "", s)
s = s.replace("\t", " ")
return s
def gtp_boolean(b):
return "true" if b else "false"
def gtp_list(l):
re... | true | true |
f7250ab88692dbc04fa8a5fc7d974f0ae2eb1e02 | 2,352 | py | Python | model-optimizer/mo/front/kaldi/extractors/normalize_component_ext.py | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 2 | 2020-11-18T14:14:06.000Z | 2020-11-28T04:55:57.000Z | model-optimizer/mo/front/kaldi/extractors/normalize_component_ext.py | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 30 | 2020-11-13T11:44:07.000Z | 2022-02-21T13:03:16.000Z | model-optimizer/mo/front/kaldi/extractors/normalize_component_ext.py | mmakridi/openvino | 769bb7709597c14debdaa356dd60c5a78bdfa97e | [
"Apache-2.0"
] | 3 | 2021-03-09T08:27:29.000Z | 2021-04-07T04:58:54.000Z | """
Copyright (C) 2018-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 32.219178 | 115 | 0.65051 |
import numpy as np
from extensions.ops.normalize import NormalizeOp
from mo.front.caffe.extractors.utils import embed_input
from mo.front.extractor import FrontExtractorOp
from mo.front.kaldi.loader.utils import collect_until_token, read_binary_bool_token, read_binary_integer32_token, \
read_binary_float_token
fr... | true | true |
f7250ae4fa8e806718a9b01881b2da9dab3d34a5 | 6,708 | py | Python | aclhound/targets/arista.py | gdelaney/aclhound | 417a4ad788e886ce78a9527222e2ab4609c20d23 | [
"BSD-2-Clause"
] | 13 | 2015-01-10T16:42:07.000Z | 2018-07-12T01:53:21.000Z | aclhound/targets/arista.py | gdelaney/aclhound | 417a4ad788e886ce78a9527222e2ab4609c20d23 | [
"BSD-2-Clause"
] | 31 | 2015-01-02T21:42:00.000Z | 2016-04-13T21:31:52.000Z | aclhound/targets/arista.py | gdelaney/aclhound | 417a4ad788e886ce78a9527222e2ab4609c20d23 | [
"BSD-2-Clause"
] | 15 | 2015-01-17T20:09:01.000Z | 2020-09-23T09:06:07.000Z | #!/usr/bin/env python2.7
# Copyright (C) 2014-2015 Job Snijders <job@instituut.net>
#
# This file is part of ACLHound
#
# 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... | 41.153374 | 78 | 0.45319 |
from ipaddr import IPNetwork
from grako.contexts import Closure
def render(self, **kwargs):
policy = self.data
afi = kwargs['afi']
config_blob = []
def afi_match(host):
if host == "any":
return True
elif IPNetwork(host).version == afi:
... | true | true |
f7250b0e5c4a53b9bd86487a7b9aa16553365458 | 3,463 | py | Python | deepgram/_utils.py | jeremycline/python-sdk | 5847241be8585982673b6f21080c3f5b921123e4 | [
"MIT"
] | null | null | null | deepgram/_utils.py | jeremycline/python-sdk | 5847241be8585982673b6f21080c3f5b921123e4 | [
"MIT"
] | null | null | null | deepgram/_utils.py | jeremycline/python-sdk | 5847241be8585982673b6f21080c3f5b921123e4 | [
"MIT"
] | null | null | null | from ._constants import DEFAULT_ENDPOINT
from ._types import Options
from ._version import __version__
from typing import Any, Union, Optional, IO, Mapping, Tuple, List
import aiohttp, urllib.parse, json, re, platform
import websockets, websockets.client
Payload = Optional[Union[dict, str, bytes, IO]]
def _prepare_he... | 50.926471 | 155 | 0.67687 | from ._constants import DEFAULT_ENDPOINT
from ._types import Options
from ._version import __version__
from typing import Any, Union, Optional, IO, Mapping, Tuple, List
import aiohttp, urllib.parse, json, re, platform
import websockets, websockets.client
Payload = Optional[Union[dict, str, bytes, IO]]
def _prepare_he... | true | true |
f7250ba98072e446898a6e4e1a69f331c437a919 | 215,396 | py | Python | hydrus/client/gui/ClientGUITags.py | bbappserver/hydrus-build-test | de7868c2f549faaf4a189b120cddcb39d16a64ba | [
"WTFPL"
] | null | null | null | hydrus/client/gui/ClientGUITags.py | bbappserver/hydrus-build-test | de7868c2f549faaf4a189b120cddcb39d16a64ba | [
"WTFPL"
] | null | null | null | hydrus/client/gui/ClientGUITags.py | bbappserver/hydrus-build-test | de7868c2f549faaf4a189b120cddcb39d16a64ba | [
"WTFPL"
] | null | null | null | import collections
import itertools
import os
import random
import time
import typing
from qtpy import QtCore as QC
from qtpy import QtWidgets as QW
from qtpy import QtGui as QG
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core i... | 39.888148 | 356 | 0.521286 | import collections
import itertools
import os
import random
import time
import typing
from qtpy import QtCore as QC
from qtpy import QtWidgets as QW
from qtpy import QtGui as QG
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core i... | true | true |
f7250c8113f5c4b5fe8357a30be38ead88265b94 | 139 | py | Python | aos_sw_api/globel_models/network_host.py | KennethSoelberg/AOS-Switch | a5a2c54917bbb69fab044bf0b313bcf795642d30 | [
"MIT"
] | null | null | null | aos_sw_api/globel_models/network_host.py | KennethSoelberg/AOS-Switch | a5a2c54917bbb69fab044bf0b313bcf795642d30 | [
"MIT"
] | 1 | 2020-12-24T15:36:56.000Z | 2021-01-28T23:19:57.000Z | aos_sw_api/globel_models/network_host.py | KennethSoelberg/AOS-Switch | a5a2c54917bbb69fab044bf0b313bcf795642d30 | [
"MIT"
] | 1 | 2021-02-16T23:26:28.000Z | 2021-02-16T23:26:28.000Z | from pydantic import BaseModel
from .ip_address import IpAddressModel
class NetworkHostModel(BaseModel):
ip_address: IpAddressModel
| 17.375 | 38 | 0.827338 | from pydantic import BaseModel
from .ip_address import IpAddressModel
class NetworkHostModel(BaseModel):
ip_address: IpAddressModel
| true | true |
f7250f700383b7cc2166cc898173234aba8a6194 | 301 | py | Python | photo/urls.py | firdausa7/MY-GALLERY | 5d2fe2727d760929800c14c11b0ff4c6d081584b | [
"MIT"
] | null | null | null | photo/urls.py | firdausa7/MY-GALLERY | 5d2fe2727d760929800c14c11b0ff4c6d081584b | [
"MIT"
] | 3 | 2020-06-05T23:24:25.000Z | 2021-06-10T22:02:41.000Z | photo/urls.py | firdausa7/MY-GALLERY | 5d2fe2727d760929800c14c11b0ff4c6d081584b | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns=[
#index path
url('^$', views.index,name='index'),
url('location/', views.category, name='location'),
url('category', views.category, name='category'),
url('search/', views.search_results, name='search_results'),
]
| 27.363636 | 64 | 0.671096 | from django.conf.urls import url
from . import views
urlpatterns=[
url('^$', views.index,name='index'),
url('location/', views.category, name='location'),
url('category', views.category, name='category'),
url('search/', views.search_results, name='search_results'),
]
| true | true |
f7250ff72bb64a4cd0a0a78f2a6db54775d4f74e | 3,253 | py | Python | Python/Police_Car_Game/Main.py | wilsonandusa/wilsonwu | 512214c187550f05497732e943f3323c15caeee0 | [
"Unlicense"
] | null | null | null | Python/Police_Car_Game/Main.py | wilsonandusa/wilsonwu | 512214c187550f05497732e943f3323c15caeee0 | [
"Unlicense"
] | null | null | null | Python/Police_Car_Game/Main.py | wilsonandusa/wilsonwu | 512214c187550f05497732e943f3323c15caeee0 | [
"Unlicense"
] | null | null | null | '''copyright Xiaosheng Wu Python game 12/31/2015'''
import pygame, sys
from classes import *
from process import *
pygame.init()
SCREENWIDTH,SCREENHEIGHT = 767,1257
screen = pygame.display.set_mode((SCREENWIDTH,SCREENHEIGHT)) #zero for the flag 32 for color
BackGround = pygame.image.load("images/bg.png")
Header = p... | 37.390805 | 93 | 0.748232 | import pygame, sys
from classes import *
from process import *
pygame.init()
SCREENWIDTH,SCREENHEIGHT = 767,1257
screen = pygame.display.set_mode((SCREENWIDTH,SCREENHEIGHT))
BackGround = pygame.image.load("images/bg.png")
Header = pygame.image.load("images/Header.png")
clock = pygame.time.Clock()
FPS = 24
flag = 2... | true | true |
f7251086cbee9232ee1a4c2ae76bb737b8cda266 | 1,378 | py | Python | backend-project/small_eod/letters/migrations/0004_auto_20200221_1956.py | WlodzimierzKorza/small_eod | 027022bd71122a949a2787d0fb86518df80e48cd | [
"MIT"
] | 64 | 2019-12-30T11:24:03.000Z | 2021-06-24T01:04:56.000Z | backend-project/small_eod/letters/migrations/0004_auto_20200221_1956.py | WlodzimierzKorza/small_eod | 027022bd71122a949a2787d0fb86518df80e48cd | [
"MIT"
] | 465 | 2018-06-13T21:43:43.000Z | 2022-01-04T23:33:56.000Z | backend-project/small_eod/letters/migrations/0004_auto_20200221_1956.py | WlodzimierzKorza/small_eod | 027022bd71122a949a2787d0fb86518df80e48cd | [
"MIT"
] | 72 | 2018-12-02T19:47:03.000Z | 2022-01-04T22:54:49.000Z | # Generated by Django 3.0.3 on 2020-02-21 19:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('letters', '0003_auto_202... | 37.243243 | 199 | 0.659652 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('letters', '0003_auto_20200110_0200'),
]
operations = [
... | true | true |
f725114cc0cb5e35486379975f0d3386787546b9 | 1,736 | py | Python | Labs/Lab 1 Midway RCC and mpi4py/mpi_rand_walk.py | cindychu/LargeScaleComputing_S20 | 913b0155f47914c258b503df677067a510dd23f5 | [
"MIT"
] | null | null | null | Labs/Lab 1 Midway RCC and mpi4py/mpi_rand_walk.py | cindychu/LargeScaleComputing_S20 | 913b0155f47914c258b503df677067a510dd23f5 | [
"MIT"
] | null | null | null | Labs/Lab 1 Midway RCC and mpi4py/mpi_rand_walk.py | cindychu/LargeScaleComputing_S20 | 913b0155f47914c258b503df677067a510dd23f5 | [
"MIT"
] | null | null | null |
from mpi4py import MPI
import matplotlib.pyplot as plt
import numpy as np
import time
def sim_rand_walks_parallel(n_runs):
# Get rank of process and overall size of communicator:
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
# Start time:
t0 = time.time()
# Evenly d... | 30.45614 | 77 | 0.645161 |
from mpi4py import MPI
import matplotlib.pyplot as plt
import numpy as np
import time
def sim_rand_walks_parallel(n_runs):
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
t0 = time.time()
N = int(n_runs/size)
r_walks = []
for i in range(N):
... | true | true |
f72511a3099af2e0476081a70e6b3d479159a8c0 | 1,950 | py | Python | tests/testhelpers/override_testhelper_err2.py | dbarnett/pytypes | da056359a8d1dad174316195830a1cb0574893af | [
"Apache-2.0"
] | 189 | 2016-09-17T13:45:58.000Z | 2022-03-12T10:53:42.000Z | tests/testhelpers/override_testhelper_err2.py | dbarnett/pytypes | da056359a8d1dad174316195830a1cb0574893af | [
"Apache-2.0"
] | 104 | 2017-02-23T16:43:18.000Z | 2022-03-17T17:36:18.000Z | tests/testhelpers/override_testhelper_err2.py | dbarnett/pytypes | da056359a8d1dad174316195830a1cb0574893af | [
"Apache-2.0"
] | 21 | 2017-02-17T08:05:12.000Z | 2021-12-08T11:22:15.000Z | # Copyright 2017 Stefan Richthofer
#
# 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 ... | 21.428571 | 74 | 0.606667 |
from pytypes import override
class TestClass():
def test_meth0(self, a):
pass
def test_meth1(self, a):
pass
def test_meth2(self, a):
pass
class TestClass2(TestClass):
@override
def test_meth0(self, a):
pass
... | true | true |
f72512165bd2c1034b3a55e9374f6cdaed5ced1b | 2,873 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/LinkClickedEventHandler.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/Windows/Forms/__init___parts/LinkClickedEventHandler.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/Windows/Forms/__init___parts/LinkClickedEventHandler.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class LinkClickedEventHandler(MulticastDelegate,ICloneable,ISerializable):
"""
Represents the method that will handle the System.Windows.Forms.RichTextBox.LinkClicked event of a System.Windows.Forms.RichTextBox.
LinkClickedEventHandler(object: object,method: IntPtr)
"""
def BeginInvoke(self,sender,e,ca... | 30.242105 | 215 | 0.719457 | class LinkClickedEventHandler(MulticastDelegate,ICloneable,ISerializable):
def BeginInvoke(self,sender,e,callback,object):
pass
def CombineImpl(self,*args):
pass
def DynamicInvokeImpl(self,*args):
pass
def EndInvoke(self,result):
pass
def GetMethodImpl(self,*args):
pass
def Invoke(self,sender... | true | true |
f72513565d42f73aae9ae75dc0d14b21b6416c46 | 318 | py | Python | hossein/university/595/595_v2.py | mhdehghan/quera-answers | 28dc0a9dbe3697593d7cbe05c9f05db2d3b01790 | [
"MIT"
] | null | null | null | hossein/university/595/595_v2.py | mhdehghan/quera-answers | 28dc0a9dbe3697593d7cbe05c9f05db2d3b01790 | [
"MIT"
] | null | null | null | hossein/university/595/595_v2.py | mhdehghan/quera-answers | 28dc0a9dbe3697593d7cbe05c9f05db2d3b01790 | [
"MIT"
] | null | null | null | plus = lambda x, y: x + y
current_list = [0, 1]
next_list = []
n = int(input())
if n > 0: print(1)
for i in range(n-1):
current_list.append(0)
next_list = list(map(plus, current_list[1:], current_list))
print(*next_list,sep=' ')
current_list = next_list
current_list.insert(0, 0)
next_list = [] | 26.5 | 63 | 0.628931 | plus = lambda x, y: x + y
current_list = [0, 1]
next_list = []
n = int(input())
if n > 0: print(1)
for i in range(n-1):
current_list.append(0)
next_list = list(map(plus, current_list[1:], current_list))
print(*next_list,sep=' ')
current_list = next_list
current_list.insert(0, 0)
next_list = [] | true | true |
f7251431a4069a8242c3b58bab2e52b693aa37b9 | 810 | py | Python | safe_transaction_service/tokens/tasks.py | cryptopossum/safe-transaction-service | 38069e5f4514be51c6f14e395a135d03f0c03887 | [
"MIT"
] | null | null | null | safe_transaction_service/tokens/tasks.py | cryptopossum/safe-transaction-service | 38069e5f4514be51c6f14e395a135d03f0c03887 | [
"MIT"
] | null | null | null | safe_transaction_service/tokens/tasks.py | cryptopossum/safe-transaction-service | 38069e5f4514be51c6f14e395a135d03f0c03887 | [
"MIT"
] | 1 | 2021-06-09T06:20:49.000Z | 2021-06-09T06:20:49.000Z | from typing import Optional
from celery import app
from celery.utils.log import get_task_logger
from gnosis.eth import EthereumClientProvider
from gnosis.eth.ethereum_client import EthereumNetwork
from safe_transaction_service.history.utils import close_gevent_db_connection
from .models import Token
logger = get_t... | 28.928571 | 77 | 0.738272 | from typing import Optional
from celery import app
from celery.utils.log import get_task_logger
from gnosis.eth import EthereumClientProvider
from gnosis.eth.ethereum_client import EthereumNetwork
from safe_transaction_service.history.utils import close_gevent_db_connection
from .models import Token
logger = get_t... | true | true |
f7251634c09abfd3f03813bfef073fd95ca209ef | 9,885 | py | Python | amqpstorm/tests/functional/management/test_queue.py | ZygusPatryk/amqpstorm | 0f3ad84a529f12769d34638a88c38f3055cb05cd | [
"MIT"
] | 140 | 2016-06-07T18:53:57.000Z | 2022-03-23T01:50:15.000Z | amqpstorm/tests/functional/management/test_queue.py | ZygusPatryk/amqpstorm | 0f3ad84a529f12769d34638a88c38f3055cb05cd | [
"MIT"
] | 85 | 2016-04-11T23:32:32.000Z | 2022-03-19T07:21:21.000Z | amqpstorm/tests/functional/management/test_queue.py | ZygusPatryk/amqpstorm | 0f3ad84a529f12769d34638a88c38f3055cb05cd | [
"MIT"
] | 38 | 2016-04-20T20:21:13.000Z | 2022-03-23T05:31:58.000Z | from amqpstorm.management import ApiError
from amqpstorm.management import ManagementApi
from amqpstorm.tests import HTTP_URL
from amqpstorm.tests import PASSWORD
from amqpstorm.tests import USERNAME
from amqpstorm.tests.functional.utility import TestFunctionalFramework
from amqpstorm.tests.functional.utility import se... | 36.884328 | 79 | 0.628123 | from amqpstorm.management import ApiError
from amqpstorm.management import ManagementApi
from amqpstorm.tests import HTTP_URL
from amqpstorm.tests import PASSWORD
from amqpstorm.tests import USERNAME
from amqpstorm.tests.functional.utility import TestFunctionalFramework
from amqpstorm.tests.functional.utility import se... | true | true |
f72516a6c5f55d8207f7aef5e97d7acd0c0e1e7d | 350 | py | Python | BOOK/MAIN/05-file-handling/chapter-5-examples/07-count-vowels-consonants.py | kabirsrivastava3/python-practice | f56a4a0764031d3723b0ba4cd1418a1a83b1e4f5 | [
"MIT"
] | null | null | null | BOOK/MAIN/05-file-handling/chapter-5-examples/07-count-vowels-consonants.py | kabirsrivastava3/python-practice | f56a4a0764031d3723b0ba4cd1418a1a83b1e4f5 | [
"MIT"
] | null | null | null | BOOK/MAIN/05-file-handling/chapter-5-examples/07-count-vowels-consonants.py | kabirsrivastava3/python-practice | f56a4a0764031d3723b0ba4cd1418a1a83b1e4f5 | [
"MIT"
] | null | null | null |
fileObj = open('answer.txt',"r")
ch = ""
vCount = 0
cCount = 0
while ch:
ch = fileObj.read(1) #one character read from file
if ch in ['A','a','E','e','I','i','O','o','U','u']:
vCount+=1
else:
cCount+=1
print("Vowels in the file: ", vCount)
print("Consonants in the file: ",cCount)
#... | 21.875 | 55 | 0.56 |
fileObj = open('answer.txt',"r")
ch = ""
vCount = 0
cCount = 0
while ch:
ch = fileObj.read(1)
if ch in ['A','a','E','e','I','i','O','o','U','u']:
vCount+=1
else:
cCount+=1
print("Vowels in the file: ", vCount)
print("Consonants in the file: ",cCount)
fileObj.close() | true | true |
f72517727d88232198a9d0d468e299f69e2a632b | 4,416 | py | Python | venv/Lib/site-packages/ipyparallel/controller/mongodb.py | BoxicaLion/BasicMathFormulas | 4d9782f2c0c75ecccf4c0ea995f324f93e4fb6e2 | [
"MIT"
] | 69 | 2019-02-18T12:07:35.000Z | 2022-03-12T10:38:32.000Z | ipyparallel/controller/mongodb.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 12 | 2018-12-06T22:06:49.000Z | 2022-02-25T17:40:44.000Z | ipyparallel/controller/mongodb.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 28 | 2019-03-22T01:07:13.000Z | 2022-02-21T16:38:27.000Z | """A TaskRecord backend using mongodb
Authors:
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of t... | 35.047619 | 100 | 0.585824 |
try:
from pymongo import MongoClient
except ImportError:
from pymongo import Connection as MongoClient
try:
from bson.binary import Binary
except ImportError:
from bson import Binary
from traitlets import Dict, List, Unicode, Instance
from .dictdb import BaseDB
class MongoDB(BaseDB):
... | true | true |
f7251940c8d1976a314e9a83de4640eaf7110298 | 1,134 | py | Python | tools/gen_shake_256_sum.py | dpensi/insights-data-schemas | a60d673ce4053b8554e09b7bd08e518f9546727c | [
"Apache-2.0"
] | 1 | 2020-12-07T09:19:32.000Z | 2020-12-07T09:19:32.000Z | tools/gen_shake_256_sum.py | dpensi/insights-data-schemas | a60d673ce4053b8554e09b7bd08e518f9546727c | [
"Apache-2.0"
] | 36 | 2020-12-31T10:02:44.000Z | 2022-02-21T12:09:56.000Z | tools/gen_shake_256_sum.py | dpensi/insights-data-schemas | a60d673ce4053b8554e09b7bd08e518f9546727c | [
"Apache-2.0"
] | 6 | 2020-12-07T09:19:35.000Z | 2022-02-01T14:39:22.000Z | #!/usr/bin/env python3
# Copyright © 2021 Pavel Tisnovsky
#
# 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... | 32.4 | 84 | 0.689594 |
import hashlib
with open("input.txt", "r") as fin:
for input_string in fin:
input_string = input_string[:-1]
shake_256_sum = hashlib.shake_256()
shake_256_sum.update(input_string.encode("UTF-8"))
input_string = input_string.replace("\t",... | true | true |
f725194997751cabcf7176a1909560de88b4ee0e | 8,176 | py | Python | src/train.py | ahernandez1801/donkey_rl_mqtt | 02bbfc3d036220a4061b95e50780984e657aff43 | [
"BSD-3-Clause"
] | null | null | null | src/train.py | ahernandez1801/donkey_rl_mqtt | 02bbfc3d036220a4061b95e50780984e657aff43 | [
"BSD-3-Clause"
] | null | null | null | src/train.py | ahernandez1801/donkey_rl_mqtt | 02bbfc3d036220a4061b95e50780984e657aff43 | [
"BSD-3-Clause"
] | null | null | null | '''
Train
Train your nerual network
Author: Tawn Kramer
'''
from __future__ import print_function
import os
import sys
import glob
import time
import fnmatch
import argparse
import numpy as np
from PIL import Image
import keras
import conf
import random
import augment
import models
'''
matplotlib can be a pain to set... | 32.316206 | 143 | 0.632583 | from __future__ import print_function
import os
import sys
import glob
import time
import fnmatch
import argparse
import numpy as np
from PIL import Image
import keras
import conf
import random
import augment
import models
try:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
... | true | true |
f7251a2ca8385d7a240cf8759dc50191209cbf05 | 2,647 | py | Python | frappe/website/context.py | gangadhar-kadam/lgnlvefrape | 6c72c134d358030d3737ff63e5a4b8187e802f17 | [
"MIT"
] | 1 | 2022-03-05T16:02:39.000Z | 2022-03-05T16:02:39.000Z | frappe/website/context.py | gangadhar-kadam/lgnlvefrape | 6c72c134d358030d3737ff63e5a4b8187e802f17 | [
"MIT"
] | null | null | null | frappe/website/context.py | gangadhar-kadam/lgnlvefrape | 6c72c134d358030d3737ff63e5a4b8187e802f17 | [
"MIT"
] | null | null | null | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.doctype.website_settings.website_settings import get_website_settings
from frappe.website.template import render_blocks
from frappe.website.r... | 28.771739 | 107 | 0.735172 |
from __future__ import unicode_literals
import frappe
from frappe.website.doctype.website_settings.website_settings import get_website_settings
from frappe.website.template import render_blocks
from frappe.website.router import get_route_info
from frappe.website.utils import can_cache
from frappe.website.permission... | true | true |
f7251ad863b8884ed1b5f58106eecd8cd3a5a1ce | 2,503 | py | Python | tomodachi/protocol/json_base.py | 0x1EE7/tomodachi | 8147b16d8be19b80b3bd7c5d8ed21c9863eaaa83 | [
"MIT"
] | null | null | null | tomodachi/protocol/json_base.py | 0x1EE7/tomodachi | 8147b16d8be19b80b3bd7c5d8ed21c9863eaaa83 | [
"MIT"
] | null | null | null | tomodachi/protocol/json_base.py | 0x1EE7/tomodachi | 8147b16d8be19b80b3bd7c5d8ed21c9863eaaa83 | [
"MIT"
] | null | null | null | import ujson
import uuid
import time
import zlib
import base64
from typing import Any, Dict, Tuple, Union
PROTOCOL_VERSION = 'tomodachi-json-base--1.0.0'
class JsonBase(object):
@classmethod
async def build_message(cls, service: Any, topic: str, data: Any, **kwargs: Any) -> str:
data_encoding = 'raw'... | 39.730159 | 118 | 0.548542 | import ujson
import uuid
import time
import zlib
import base64
from typing import Any, Dict, Tuple, Union
PROTOCOL_VERSION = 'tomodachi-json-base--1.0.0'
class JsonBase(object):
@classmethod
async def build_message(cls, service: Any, topic: str, data: Any, **kwargs: Any) -> str:
data_encoding = 'raw'... | true | true |
f7251c3cfff5728cee204b97993228189eefc64e | 2,801 | py | Python | planning/path_generator/search_path_generator.py | HybridRobotics/cbf | d8a1b376e7e910de71df60cdf3619f68c40ab3ed | [
"Apache-2.0"
] | 9 | 2022-03-07T09:12:29.000Z | 2022-03-25T01:41:49.000Z | planning/path_generator/search_path_generator.py | HybridRobotics/cbf | d8a1b376e7e910de71df60cdf3619f68c40ab3ed | [
"Apache-2.0"
] | null | null | null | planning/path_generator/search_path_generator.py | HybridRobotics/cbf | d8a1b376e7e910de71df60cdf3619f68c40ab3ed | [
"Apache-2.0"
] | null | null | null | import sys
import numpy as np
from planning.path_generator.astar import *
def plot_global_map(path, obstacles):
fig, ax = plt.subplots()
for o in obstacles:
patch = o.get_plot_patch()
ax.add_patch(patch)
ax.plot(path[:, 0], path[:, 1])
plt.xlim([-1 * 0.15, 11 * 0.15])
plt.ylim([0... | 33.345238 | 87 | 0.633345 | import sys
import numpy as np
from planning.path_generator.astar import *
def plot_global_map(path, obstacles):
fig, ax = plt.subplots()
for o in obstacles:
patch = o.get_plot_patch()
ax.add_patch(patch)
ax.plot(path[:, 0], path[:, 1])
plt.xlim([-1 * 0.15, 11 * 0.15])
plt.ylim([0... | true | true |
f7251d422b29b0275ce1c312bda2c4763835c059 | 33,303 | py | Python | pytorch/pytorchcv/models/common.py | HyperGAN/imgclsmob | 88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3 | [
"MIT"
] | null | null | null | pytorch/pytorchcv/models/common.py | HyperGAN/imgclsmob | 88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3 | [
"MIT"
] | null | null | null | pytorch/pytorchcv/models/common.py | HyperGAN/imgclsmob | 88b9776a5a927dc9a54e85e31978c4a9ec5ecbf3 | [
"MIT"
] | null | null | null | """
Common routines for models in PyTorch.
"""
__all__ = ['HSwish', 'get_activation_layer', 'conv1x1', 'conv3x3', 'depthwise_conv3x3', 'ConvBlock', 'conv1x1_block',
'conv3x3_block', 'conv7x7_block', 'dwconv3x3_block', 'dwconv5x5_block', 'PreConvBlock', 'pre_conv1x1_block',
'pre_conv3x3_block'... | 30.111212 | 120 | 0.58283 |
__all__ = ['HSwish', 'get_activation_layer', 'conv1x1', 'conv3x3', 'depthwise_conv3x3', 'ConvBlock', 'conv1x1_block',
'conv3x3_block', 'conv7x7_block', 'dwconv3x3_block', 'dwconv5x5_block', 'PreConvBlock', 'pre_conv1x1_block',
'pre_conv3x3_block', 'ChannelShuffle', 'ChannelShuffle2', 'SEBlock', '... | true | true |
f7251e850c38e0f28697e00d751ee3f8dca92056 | 7,888 | py | Python | dynamic_image_networks/hmdb51/training_scripts/train_resnext50_hmdb51.py | DoranLyong/dynamic-images-for-action-recognition | 06a68c2337b45c44a8c7ec50e94585a9b9615ad0 | [
"MIT"
] | 22 | 2018-09-14T00:32:41.000Z | 2020-10-23T11:19:12.000Z | dynamic_image_networks/hmdb51/training_scripts/train_resnext50_hmdb51.py | DoranLyong/dynamic-images-for-action-recognition | 06a68c2337b45c44a8c7ec50e94585a9b9615ad0 | [
"MIT"
] | 1 | 2021-04-30T04:09:40.000Z | 2021-04-30T04:09:40.000Z | dynamic_image_networks/hmdb51/training_scripts/train_resnext50_hmdb51.py | DoranLyong/dynamic-images-for-action-recognition | 06a68c2337b45c44a8c7ec50e94585a9b9615ad0 | [
"MIT"
] | 7 | 2018-11-01T02:32:09.000Z | 2020-10-03T12:19:02.000Z | # import apex - !!!! INCLUDE THIS IMPORT IF YOU WANT TO USE MIXED PRECISION TRAINING !!!!
import torch
import os
import sys
import torch.optim as optim
import torch.nn as nn
from datetime import datetime
from tqdm import tqdm
from pathlib import Path
# Make sure that the project root is in your PATH (i.e., the parent ... | 41.083333 | 112 | 0.439021 |
import torch
import os
import sys
import torch.optim as optim
import torch.nn as nn
from datetime import datetime
from tqdm import tqdm
from pathlib import Path
sys.path.append(str(Path('../../..').resolve()))
from dynamic_image_networks.hmdb51.models.resnext50_temppool import get_model
from dynamic_image_networ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.