hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a9322a09be39e0a72be52dbf707ba16161da58c8 | 933 | py | Python | fetch_images.py | UoA-eResearch/NZTA_traffic_cameras | ceeb1d328cb17a0f57116b2b3cbdfe61bf6e7366 | [
"MIT"
] | 1 | 2021-09-29T09:39:38.000Z | 2021-09-29T09:39:38.000Z | fetch_images.py | imyhxy/NZTA_traffic_cameras | 9952774db0eda4c30286833a41022fc740c3610b | [
"MIT"
] | null | null | null | fetch_images.py | imyhxy/NZTA_traffic_cameras | 9952774db0eda4c30286833a41022fc740c3610b | [
"MIT"
] | 1 | 2021-09-29T09:39:33.000Z | 2021-09-29T09:39:33.000Z | #!/usr/bin/env python3
import os
import json
import requests
from dateutil.parser import parse as parsedate
with open("cameras.json") as f:
cameras = json.load(f)
with open("unavailable.jpg", "rb") as f:
unavailable = f.read()
camIds = sorted([int(c["properties"]["id"]) for c in cameras["features"]])
for cam... | 31.1 | 74 | 0.631297 | #!/usr/bin/env python3
import os
import json
import pprint
import requests
from dateutil.parser import parse as parsedate
with open("cameras.json") as f:
cameras = json.load(f)
with open("unavailable.jpg", "rb") as f:
unavailable = f.read()
camIds = sorted([int(c["properties"]["id"]) for c in cameras["featur... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
d0a01a00f070faee611561d1b2339d1a3ff3d521 | 8,322 | py | Python | tests/test_result.py | ageitgey/pyflight | 3d1624e1455e98b011ccaba1510da818f46a6e1d | [
"MIT"
] | 4 | 2018-01-19T07:24:25.000Z | 2021-05-01T04:45:36.000Z | tests/test_result.py | ageitgey/pyflight | 3d1624e1455e98b011ccaba1510da818f46a6e1d | [
"MIT"
] | null | null | null | tests/test_result.py | ageitgey/pyflight | 3d1624e1455e98b011ccaba1510da818f46a6e1d | [
"MIT"
] | 2 | 2018-04-02T04:10:35.000Z | 2019-08-13T13:51:26.000Z | # Tests the various Containers / Classes found in results.py
import util
# Test the FlightData Container
# Test the Airport Container
first_result = Result(util.download_file_if_not_exists(
url="https://developers.google.com/qpx-express/v1/json.samples/SFOLAX.out.json",
filename="response_1.json"
))
seco... | 35.412766 | 108 | 0.696467 | # Tests the various Containers / Classes found in results.py
import os
import sys
import util
from pyflight.result import *
from pyflight.models.flight_data import FlightData
# Test the FlightData Container
def test_flight_data():
first_data = FlightData('9B1', 'Example Data')
second_data = FlightData('7B3... | 0 | 0 | 0 | 0 | 0 | 7,051 | 0 | 14 | 354 |
c62dc71cf1abc0549697f8aa7b80d4482d3dc8b5 | 413 | py | Python | authentise_services/errors.py | DoWhileGeek/authentise-services | ee32bd7f7de15d3fb24c0a6374640d3a1ec8096d | [
"MIT"
] | 3 | 2015-10-06T21:07:33.000Z | 2015-12-31T21:33:52.000Z | authentise_services/errors.py | DoWhileGeek/authentise-services | ee32bd7f7de15d3fb24c0a6374640d3a1ec8096d | [
"MIT"
] | 5 | 2015-06-21T03:45:09.000Z | 2015-08-15T17:00:30.000Z | authentise_services/errors.py | DoWhileGeek/authentise-services | ee32bd7f7de15d3fb24c0a6374640d3a1ec8096d | [
"MIT"
] | null | null | null | """Error classes for authentise_services"""
| 31.769231 | 94 | 0.743341 | """Error classes for authentise_services"""
class ResourceError(Exception):
"""arbitrary error whenever a call to a authentise resource doesnt go according to plan"""
pass
class ResourceStillProcessing(Exception):
"""most authentise resources have a status property to tell the user what state its in
... | 0 | 0 | 0 | 321 | 0 | 0 | 0 | 0 | 46 |
7e51fad58a661946b39af373553cbe440b365721 | 3,535 | py | Python | corehq/apps/users/middleware.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T23:26:39.000Z | 2015-02-10T23:26:39.000Z | corehq/apps/users/middleware.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/users/middleware.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | from dimagi.utils.couch.cache import cache_core
rcache = cache_core.get_redis_default_cache()
############################################################################################################
SESSION_USER_KEY_PREFIX = "session_user_doc_%s"
############################################################... | 44.746835 | 108 | 0.539745 | from redis_cache.exceptions import ConnectionInterrumped
from django.conf import settings
import django.core.exceptions
from dimagi.utils.couch.cache import cache_core
rcache = cache_core.get_redis_default_cache()
#######################################################################################################... | 0 | 0 | 0 | 2,906 | 0 | 0 | 0 | 127 | 133 |
0ec83fe7fc7dd6e6e433cfe711c2b981da1ad9e9 | 1,003 | py | Python | tests/fixtures/noqa/noqa_pre38.py | Kvm99/wemake-python-styleguide | a415339ed47de3ff03754bddd9b57316f494dfb1 | [
"MIT"
] | 1 | 2020-02-21T18:58:44.000Z | 2020-02-21T18:58:44.000Z | tests/fixtures/noqa/noqa_pre38.py | Kvm99/wemake-python-styleguide | a415339ed47de3ff03754bddd9b57316f494dfb1 | [
"MIT"
] | 15 | 2020-02-22T11:09:46.000Z | 2020-02-27T16:36:54.000Z | tests/fixtures/noqa/noqa_pre38.py | Kvm99/wemake-python-styleguide | a415339ed47de3ff03754bddd9b57316f494dfb1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This file represents how AST worked before python3.8 release.
We used to have violations on the first decorator
that wraps function, method, or a class.
We also store here things that are ``SyntaxError`` in python3.8 and above.
"""
iters = list((yield letter) for letter in 'ab') # no... | 20.06 | 75 | 0.642074 | # -*- coding: utf-8 -*-
"""
This file represents how AST worked before python3.8 release.
We used to have violations on the first decorator
that wraps function, method, or a class.
We also store here things that are ``SyntaxError`` in python3.8 and above.
"""
class WithStatic(object):
@staticmethod # noqa: WP... | 0 | 218 | 0 | 4 | 0 | 303 | 0 | 0 | 145 |
cbf5c9870a2ba2de6edbbfa1dd3821eaa4520ae8 | 368 | py | Python | dataentry/migrations/0006_alter_user_content.py | abrehman90/Integrate-SummerNote-in-Django | a588578f007e153b85e1b18e71fa37d05bdef7ef | [
"MIT"
] | 1 | 2021-12-15T03:47:19.000Z | 2021-12-15T03:47:19.000Z | dataentry/migrations/0006_alter_user_content.py | abrehman90/Integrate-SummerNote-in-Django | a588578f007e153b85e1b18e71fa37d05bdef7ef | [
"MIT"
] | null | null | null | dataentry/migrations/0006_alter_user_content.py | abrehman90/Integrate-SummerNote-in-Django | a588578f007e153b85e1b18e71fa37d05bdef7ef | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-12 15:38
| 19.368421 | 47 | 0.581522 | # Generated by Django 3.2.6 on 2021-08-12 15:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dataentry', '0005_user_content'),
]
operations = [
migrations.AlterField(
model_name='user',
name='content',
... | 0 | 0 | 0 | 254 | 0 | 0 | 0 | 19 | 46 |
6831d22807efd0f098528d5f871a514617ea8537 | 34,692 | py | Python | vibro_estparam/mixednoise.py | VibroSim/vibro_estparam | 1c1c4cadeee4fbe38bb153161ebd62ba7a137111 | [
"MIT"
] | null | null | null | vibro_estparam/mixednoise.py | VibroSim/vibro_estparam | 1c1c4cadeee4fbe38bb153161ebd62ba7a137111 | [
"MIT"
] | null | null | null | vibro_estparam/mixednoise.py | VibroSim/vibro_estparam | 1c1c4cadeee4fbe38bb153161ebd62ba7a137111 | [
"MIT"
] | null | null | null | import os
import scipy.integrate
use_accel = True
if use_accel:
pass
#import pandas as pd
if __name__=="__main__":
pass
| 59.813793 | 510 | 0.633143 | import sys
import os
import os.path
import glob
import collections
import re
import numpy as np
import scipy as sp
import scipy.integrate
import scipy.special
import theano
import theano.tensor as tt
from theano.printing import Print
from theano import gof
use_accel = True
if use_accel:
from . import mixednoise_... | 0 | 18,916 | 0 | 14,211 | 0 | 956 | 0 | 8 | 403 |
31d053562a5479ed0dba3716178c09ed5e5ad9ba | 11,337 | py | Python | evernode/bin/create.py | AtomHash/evernode | f70d82e78cf9f6d58208438e26485e9565abd875 | [
"MIT"
] | 1 | 2017-09-23T16:44:10.000Z | 2017-09-23T16:44:10.000Z | evernode/bin/create.py | AtomHash/evernode | f70d82e78cf9f6d58208438e26485e9565abd875 | [
"MIT"
] | 9 | 2017-09-25T14:44:17.000Z | 2020-09-16T01:47:43.000Z | evernode/bin/create.py | AtomHash/evernode | f70d82e78cf9f6d58208438e26485e9565abd875 | [
"MIT"
] | 1 | 2020-10-05T20:36:24.000Z | 2020-10-05T20:36:24.000Z | #!/usr/bin/env python
| 44.11284 | 80 | 0.538061 | #!/usr/bin/env python
import os
import sys
import click
import yaml
from urllib import request
from evernode.classes import Json, Security
class Create:
""" Easy evernode app creation"""
app_name = None
dir_name = None
config_file = None
uwsgi_file = None
app_file = None
... | 0 | 0 | 0 | 11,162 | 0 | 0 | 0 | -15 | 165 |
08c10500fbb3553cf3932a78df86b5fb9fbfa9be | 522 | py | Python | models/constants.py | couatl/http-server | 8fe92f4fa556d966cc3942ccea6a89a32af70962 | [
"MIT"
] | null | null | null | models/constants.py | couatl/http-server | 8fe92f4fa556d966cc3942ccea6a89a32af70962 | [
"MIT"
] | null | null | null | models/constants.py | couatl/http-server | 8fe92f4fa556d966cc3942ccea6a89a32af70962 | [
"MIT"
] | null | null | null |
ServerName = 'Http Technopark Highload server'
HttpVersion = '1.1'
| 20.076923 | 46 | 0.626437 | from enum import Enum
ServerName = 'Http Technopark Highload server'
HttpVersion = '1.1'
class ContentTypes(Enum):
html = 'text/html'
css = 'text/css'
js = 'text/javascript'
txt = 'text/txt'
plain = 'text/plain'
jpg = 'image/jpeg'
jpeg = 'image/jpeg'
png = 'image/png'
gif = 'image... | 0 | 0 | 0 | 385 | 0 | 0 | 0 | 0 | 68 |
4c23ae3939c5011c19cd5681cefa7780e4551346 | 12,680 | py | Python | tests/unit/stream_alert_rule_processor/test_firehose.py | opsbay/streamalert | 557fb3f604661cdd9bd36486cccc8ce3a34bd1f1 | [
"Apache-2.0"
] | null | null | null | tests/unit/stream_alert_rule_processor/test_firehose.py | opsbay/streamalert | 557fb3f604661cdd9bd36486cccc8ce3a34bd1f1 | [
"Apache-2.0"
] | 1 | 2020-02-07T18:08:22.000Z | 2020-02-07T18:08:22.000Z | tests/unit/stream_alert_rule_processor/test_firehose.py | opsbay/streamalert | 557fb3f604661cdd9bd36486cccc8ce3a34bd1f1 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-present, Airbnb Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 37.40413 | 100 | 0.568375 | """
Copyright 2017-present, Airbnb Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 0 | 11,856 | 0 | 0 | 0 | 0 | 0 | 121 | 134 |
bf46b0f8d343d438e6b89354701e2ac2d3c1bca7 | 655 | py | Python | netdevice/migrations/0002_auto_20180511_0619.py | lkmhaqer/gtools-python | cff6d80525b78a4fadfb686566489fbe1687d889 | [
"MIT"
] | 5 | 2016-10-31T17:46:17.000Z | 2022-02-02T00:40:49.000Z | netdevice/migrations/0002_auto_20180511_0619.py | lkmhaqer/gtools-python | cff6d80525b78a4fadfb686566489fbe1687d889 | [
"MIT"
] | 33 | 2018-05-09T06:07:50.000Z | 2021-09-22T17:39:56.000Z | netdevice/migrations/0002_auto_20180511_0619.py | lkmhaqer/gtools-python | cff6d80525b78a4fadfb686566489fbe1687d889 | [
"MIT"
] | 1 | 2020-05-14T21:44:25.000Z | 2020-05-14T21:44:25.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-05-11 06:19
from __future__ import unicode_literals
| 21.833333 | 46 | 0.564885 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-05-11 06:19
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('netdevice', '0001_initial'),
]
operations = [
migrations.RemoveField(
mod... | 0 | 0 | 0 | 486 | 0 | 0 | 0 | 11 | 46 |
b1d6075f1cad4b78485b993cebfa8d98fe3abffb | 2,167 | py | Python | tests/test_utilities.py | yohokuno/dl4nlp | 818db943835195397cd999e98806cabdc3499c19 | [
"MIT"
] | 41 | 2016-08-10T11:26:10.000Z | 2020-02-13T19:01:12.000Z | tests/test_utilities.py | nokuno/dl4nlp | 818db943835195397cd999e98806cabdc3499c19 | [
"MIT"
] | null | null | null | tests/test_utilities.py | nokuno/dl4nlp | 818db943835195397cd999e98806cabdc3499c19 | [
"MIT"
] | 8 | 2016-02-21T17:40:10.000Z | 2016-06-24T03:23:27.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 38.696429 | 85 | 0.601754 | import unittest
import numpy as np
from math import exp
from scipy.special import expit
from dl4nlp.utilities import sigmoid_gradient, softmax
class TestUtilities(unittest.TestCase):
def assertDistribution(self, distribution):
self.assertTrue(all(distribution >= 0.0))
self.assertTrue(all(distribut... | 0 | 0 | 0 | 1,952 | 0 | 0 | 0 | 39 | 111 |
84fce317899af0d32f08b19c33ca9515797bc5c0 | 7,563 | py | Python | bleu/bleu.py | SnehaMondal/bleu | dddeac9bddf5f3eca98d7e68f16870eee5e2bfbf | [
"BSD-3-Clause"
] | 4 | 2019-11-25T06:22:50.000Z | 2019-12-24T06:27:44.000Z | bleu/bleu.py | SnehaMondal/bleu | dddeac9bddf5f3eca98d7e68f16870eee5e2bfbf | [
"BSD-3-Clause"
] | 3 | 2019-12-24T13:19:12.000Z | 2021-03-16T11:53:19.000Z | bleu/bleu.py | zhijing-jin/nlp-evaluation | a129eb67ec844cdbf0e6c7bc0ab8a611b07ef667 | [
"BSD-3-Clause"
] | 2 | 2020-03-12T10:42:29.000Z | 2020-06-20T07:22:45.000Z | '''
author = Zhijing Jin (zhijing.jin@connect.hku.hk)
date = Aug 24, 2019
How to Run:
python bleu.py \
-refs data/ref0.txt data/ref1.txt -hyps data/hyp0.txt
'''
from __future__ import print_function, division
import os
import argparse
from .download import TMP_DIR, DETOK_FILE, BLEU_DETOK_FILE, BLEU_FILE
def mult... | 33.171053 | 133 | 0.622108 | '''
author = Zhijing Jin (zhijing.jin@connect.hku.hk)
date = Aug 24, 2019
How to Run:
python bleu.py \
-refs data/ref0.txt data/ref1.txt -hyps data/hyp0.txt
'''
from __future__ import print_function, division
import os
import json
import argparse
from .download import TMP_DIR, DETOK_FILE, BLEU_DETOK_FILE, BLEU_FILE... | 0 | 0 | 0 | 0 | 0 | 4,325 | 0 | -10 | 160 |
21c669d69edbbac66ebd85a74a2aa9f1421d4b4a | 170 | py | Python | pages/PendingPage.py | jasonlfchen/python_framework | b174cb02fe0b62e872e2f3bffed834d9f89e5584 | [
"MIT"
] | 1 | 2019-05-15T05:57:29.000Z | 2019-05-15T05:57:29.000Z | pages/PendingPage.py | jasonlfchen/python_framework | b174cb02fe0b62e872e2f3bffed834d9f89e5584 | [
"MIT"
] | null | null | null | pages/PendingPage.py | jasonlfchen/python_framework | b174cb02fe0b62e872e2f3bffed834d9f89e5584 | [
"MIT"
] | null | null | null | __author__ = 'Yunxi Lin' | 28.333333 | 50 | 0.747059 | __author__ = 'Yunxi Lin'
from pages.BasePage import BasePage
class PendingPage(BasePage):
def print_display(self):
self.logger.info('Pending Page Displayed') | 0 | 0 | 0 | 87 | 0 | 0 | 0 | 14 | 45 |
7ce271ff191ba5eeb0e9f491ae0a3c57439fec19 | 7,467 | py | Python | venv/Lib/site-packages/PySide6/examples/widgets/state-machine/rogue.py | gabrielcervante/live-sharer | 6fb33d5663849734caddcba8d439244c03693e63 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PySide6/examples/widgets/state-machine/rogue.py | gabrielcervante/live-sharer | 6fb33d5663849734caddcba8d439244c03693e63 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PySide6/examples/widgets/state-machine/rogue.py | gabrielcervante/live-sharer | 6fb33d5663849734caddcba8d439244c03693e63 | [
"MIT"
] | null | null | null | #############################################################################
##
## Copyright (C) 2010 velociraptor Genjix <aphidia@hotmail.com>
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICE... | 36.783251 | 87 | 0.602384 | #############################################################################
##
## Copyright (C) 2010 velociraptor Genjix <aphidia@hotmail.com>
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICE... | 0 | 0 | 0 | 5,146 | 0 | 0 | 0 | 23 | 136 |
c17238e3ea6d5c3bbcb53e0f74878691432e6488 | 617 | py | Python | Auto Correct/image.py | uttamkeshri786/Communication-and-Education-Hub-For-Specially-Abled | d20f1f0c0c7fb367267643e702b9f3c5d70e9004 | [
"MIT"
] | null | null | null | Auto Correct/image.py | uttamkeshri786/Communication-and-Education-Hub-For-Specially-Abled | d20f1f0c0c7fb367267643e702b9f3c5d70e9004 | [
"MIT"
] | null | null | null | Auto Correct/image.py | uttamkeshri786/Communication-and-Education-Hub-For-Specially-Abled | d20f1f0c0c7fb367267643e702b9f3c5d70e9004 | [
"MIT"
] | null | null | null | from google_images_download import google_images_download
# creating object
response = google_images_download.googleimagesdownload()
search_queries =['apple','cat','appropriate','exorbitant']
for query in search_queries:
downloadimages(query)
print()
| 24.68 | 60 | 0.589951 | from google_images_download import google_images_download
# creating object
response = google_images_download.googleimagesdownload()
search_queries =['apple','cat','appropriate','exorbitant']
def downloadimages(query):
arguments = {"keywords": query}
try:
response.downloa... | 0 | 0 | 0 | 0 | 0 | 299 | 0 | 0 | 27 |
d2c270b297614b45177ca27bf5f9f77a7a6584d4 | 6,825 | py | Python | indy_node/test/auth_rule/test_auth_txn_with_deprecated_key.py | Rob-S/indy-node | 0aefbda62c5a7412d7e03b2fb9795c500ea67e9f | [
"Apache-2.0"
] | 627 | 2017-07-06T12:38:08.000Z | 2022-03-30T13:18:43.000Z | indy_node/test/auth_rule/test_auth_txn_with_deprecated_key.py | Rob-S/indy-node | 0aefbda62c5a7412d7e03b2fb9795c500ea67e9f | [
"Apache-2.0"
] | 580 | 2017-06-29T17:59:57.000Z | 2022-03-29T21:37:52.000Z | indy_node/test/auth_rule/test_auth_txn_with_deprecated_key.py | Rob-S/indy-node | 0aefbda62c5a7412d7e03b2fb9795c500ea67e9f | [
"Apache-2.0"
] | 704 | 2017-06-29T17:45:34.000Z | 2022-03-30T07:08:58.000Z | import shutil
import pytest
from indy_common.config_helper import NodeConfigHelper
from indy_node.test.helper import TestNode
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from plenum.test.test_node import ensureElectionsDone, ensure_node_disconnected, checkNodesConnected
from indy_node.... | 45.198675 | 122 | 0.606886 | import shutil
from contextlib import contextmanager
import pytest
from indy_common.config_helper import NodeConfigHelper
from indy_node.test.helper import TestNode
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from plenum.test.test_node import ensureElectionsDone, ensure_node_disconnecte... | 0 | 479 | 0 | 0 | 0 | 0 | 0 | 16 | 45 |
09849d19c6f8c069a16069f6143c86c920b9a180 | 1,304 | py | Python | src/unordered_pair.py | martgarden/pp-time-analysis | 6cf0e03b0d2d9039cc200c831ee171022cea4e26 | [
"MIT"
] | null | null | null | src/unordered_pair.py | martgarden/pp-time-analysis | 6cf0e03b0d2d9039cc200c831ee171022cea4e26 | [
"MIT"
] | null | null | null | src/unordered_pair.py | martgarden/pp-time-analysis | 6cf0e03b0d2d9039cc200c831ee171022cea4e26 | [
"MIT"
] | 1 | 2019-12-12T15:01:05.000Z | 2019-12-12T15:01:05.000Z | # -*- coding: utf-8 -*-
| 24.148148 | 78 | 0.509202 | # -*- coding: utf-8 -*-
class upair:
# If y != None, constructs the unordered pair (x, y)
# If y == None, constructs an unordered pair from iterable x, e.g. a tuple
def __init__(self, x, y=None):
if y is not None:
self._x = x
self._y = y
else:
self._x, sel... | 6 | 0 | 0 | 1,256 | 0 | 0 | 0 | 0 | 22 |
f08712809580ee92fb03e643dd9e48ab44d626b8 | 1,288 | py | Python | lib/python2.7/site-packages/leginon/checkapps.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/leginon/checkapps.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/leginon/checkapps.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | 1 | 2019-09-05T20:58:37.000Z | 2019-09-05T20:58:37.000Z | #!/usr/bin/env python
import leginon.leginondata
import sys
import getpass
import sets
days = int(raw_input('Days: '))
## make set of all application names
appquery = leginon.leginondata.ApplicationData()
apps = appquery.query()
print 'APPS', len(apps)
allapps = sets.Set()
allappsdict = {}
for app in apps:
appname ... | 24.769231 | 81 | 0.733696 | #!/usr/bin/env python
import leginon.leginondata
import sys
import getpass
import sets
days = int(raw_input('Days: '))
## make set of all application names
appquery = leginon.leginondata.ApplicationData()
apps = appquery.query()
print 'APPS', len(apps)
allapps = sets.Set()
allappsdict = {}
for app in apps:
appname ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1b7001b06418ddc532a256eb22664ba369d7d7e4 | 291 | py | Python | test/scripts/testSubMatrix.py | Gibbsdavidl/miergolf | 1728bd9459d6067fb45d777d06ad440ab603d2e7 | [
"BSD-3-Clause"
] | 8 | 2016-03-04T07:51:43.000Z | 2018-09-19T03:18:45.000Z | test/scripts/testSubMatrix.py | Gibbsdavidl/miergolf | 1728bd9459d6067fb45d777d06ad440ab603d2e7 | [
"BSD-3-Clause"
] | null | null | null | test/scripts/testSubMatrix.py | Gibbsdavidl/miergolf | 1728bd9459d6067fb45d777d06ad440ab603d2e7 | [
"BSD-3-Clause"
] | 3 | 2017-03-24T02:52:38.000Z | 2022-01-22T00:14:55.000Z | import timeit
setup = '''
import scipy.sparse as sp
import numpy as np
from bisect import bisect
from numpy.random import rand, randint
import submatrix as s
r = [10,20,30]
A = s.randomMatrix()
'''
t = timeit.Timer("s.subMatrix(r,r,A)", setup).repeat(3, 10)
print t
#print t.timeit()
| 17.117647 | 59 | 0.697595 | import timeit
setup = '''
import scipy.sparse as sp
import numpy as np
from bisect import bisect
from numpy.random import rand, randint
import submatrix as s
r = [10,20,30]
A = s.randomMatrix()
'''
t = timeit.Timer("s.subMatrix(r,r,A)", setup).repeat(3, 10)
print t
#print t.timeit()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
937d699f29de9bf65385d4f5c1da52e203206dc2 | 4,595 | py | Python | services/traction/acapy_wrapper/apis/wallet_api.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 12 | 2022-01-29T20:30:03.000Z | 2022-03-29T11:46:14.000Z | services/traction/acapy_wrapper/apis/wallet_api.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 38 | 2021-11-22T17:52:50.000Z | 2022-03-31T17:52:00.000Z | services/traction/acapy_wrapper/apis/wallet_api.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 9 | 2021-11-22T18:05:48.000Z | 2022-03-29T11:25:08.000Z | # coding: utf-8
from fastapi import (APIRouter)
router = APIRouter()
| 26.715116 | 171 | 0.666376 | # coding: utf-8
from typing import Dict, List # noqa: F401
from fastapi import ( # noqa: F401
APIRouter,
Body,
Cookie,
Depends,
Form,
Header,
Path,
Query,
Request,
Response,
Security,
status,
)
from acapy_wrapper.models.extra_models import TokenModel # noqa: F401
fr... | 0 | 3,759 | 0 | 0 | 0 | 0 | 0 | 389 | 368 |
2ab8baacea67bdd028c291e9f1cb7d788577d7fe | 128 | py | Python | Desafios/desafio014.py | MaxGabrielima/Python-Codes | 195c13821a937f0b792b0d214d19840d57068279 | [
"MIT"
] | 3 | 2021-07-31T21:10:32.000Z | 2021-11-17T02:21:28.000Z | Desafios/desafio014.py | MaxGabrielima/Python-Codes | 195c13821a937f0b792b0d214d19840d57068279 | [
"MIT"
] | null | null | null | Desafios/desafio014.py | MaxGabrielima/Python-Codes | 195c13821a937f0b792b0d214d19840d57068279 | [
"MIT"
] | null | null | null | c = float(input('Digite a temperatura em C: '))
f = c * 1.8 + 32
print('{:.0f} C igual a {:.0f} Fahrenheight'.format(c, f)) | 42.666667 | 62 | 0.585938 | c = float(input('Digite a temperatura em C°: '))
f = c * 1.8 + 32
print('{:.0f} C° é igual a {:.0f}° Fahrenheight'.format(c, f)) | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e1f67f7b91bd8c32c0cfdb45a2077ae8c8ff3cd8 | 2,272 | py | Python | sleeplog/tests.py | jepaynedev/sleeplog | 7e79e9d36521ac03b49bf5984bb4a2759d8015ca | [
"MIT"
] | null | null | null | sleeplog/tests.py | jepaynedev/sleeplog | 7e79e9d36521ac03b49bf5984bb4a2759d8015ca | [
"MIT"
] | null | null | null | sleeplog/tests.py | jepaynedev/sleeplog | 7e79e9d36521ac03b49bf5984bb4a2759d8015ca | [
"MIT"
] | null | null | null | import unittest.mock as mock
| 32 | 121 | 0.629842 | import transaction
import unittest
import unittest.mock as mock
from pyramid import testing
from .models import User
class SleepLogViewTests(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
def tearDown(self):
testing.tearDown()
def test_default(self):
from .v... | 0 | 657 | 0 | 1,448 | 0 | 0 | 0 | 0 | 136 |
afc39d0c21a7cdf47359b933ab387e9408704987 | 23,211 | py | Python | catkin_ws/src/folding_control/src/moveit_interface.py | roop-pal/robotic-folding | a0e062ac6d23cd07fe10e3f45abc4ba50e533141 | [
"RSA-MD"
] | 17 | 2015-10-21T16:09:18.000Z | 2021-07-23T03:15:55.000Z | catkin_ws/src/folding_control/src/moveit_interface.py | roop-pal/robotic-folding | a0e062ac6d23cd07fe10e3f45abc4ba50e533141 | [
"RSA-MD"
] | 1 | 2017-12-17T04:39:38.000Z | 2017-12-17T04:39:38.000Z | catkin_ws/src/folding_control/src/moveit_interface.py | roop-pal/robotic-folding | a0e062ac6d23cd07fe10e3f45abc4ba50e533141 | [
"RSA-MD"
] | 8 | 2016-03-18T14:13:58.000Z | 2020-01-15T15:03:51.000Z | #!/usr/bin/env python
import sys
import signal
import math
signal.signal(signal.SIGINT, signal_handler)
pose_list = \
{
'left_open': [0.6451299414163874, 0.48308154941436016, 0.688241579565718, 0.11442618882303603, 0.9926119706997465, 0.028043380270852243, 0.02901192441022871],
'right_open': [0.6462863106297506, -0.... | 37.437097 | 162 | 0.563827 | #!/usr/bin/env python
import sys
import copy
import rospy
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
import signal
import math
import tf
from copy import deepcopy
import transformation
def signal_handler(signal, frame):
print("Disabling robot... ")
moveit_commander.roscpp_shutdown... | 0 | 0 | 0 | 19,331 | 0 | 2,614 | 0 | -21 | 245 |
09fb9853e9aa2a1bb1aebfc5a5e2fef2ea69bb92 | 376 | py | Python | test.py | FRC1076/2019-wapur | e872489792e9573b7205eccde55be21705af6e3c | [
"MIT"
] | 2 | 2018-11-15T23:22:31.000Z | 2019-11-28T23:58:34.000Z | test.py | FRC1076/2019-wapur | e872489792e9573b7205eccde55be21705af6e3c | [
"MIT"
] | 1 | 2018-11-06T03:50:27.000Z | 2018-11-06T03:54:35.000Z | test.py | FRC1076/2019-wapur | e872489792e9573b7205eccde55be21705af6e3c | [
"MIT"
] | null | null | null | """
Hi!
I intentionally wrote this script sort of weird so that it will
only work in Python 3.7+, to make sure that you're using
the right Python. Don't worry if you don't understand it!
If you're curious, I'm happy to explain anything in it.
-- C
"""
from __future__ import annotations
print("Hello, ", end='World!\n'... | 17.904762 | 63 | 0.68883 | """
Hi!
I intentionally wrote this script sort of weird so that it will
only work in Python 3.7+, to make sure that you're using
the right Python. Don't worry if you don't understand it!
If you're curious, I'm happy to explain anything in it.
-- C
"""
from __future__ import annotations
print("Hello, ", end='World!\n'... | 0 | 0 | 0 | -4 | 0 | 10 | 0 | 0 | 46 |
8fab9a0e60252075d7e70d644b34510e8b6ba206 | 102 | py | Python | gm2m/signals.py | mikewolfd/django-gm2m | a8cecc4d6d56c83e8d9c623888f5d07cb6ad8771 | [
"MIT"
] | 24 | 2019-07-24T14:31:48.000Z | 2022-02-19T23:30:37.000Z | gm2m/signals.py | mikewolfd/django-gm2m | a8cecc4d6d56c83e8d9c623888f5d07cb6ad8771 | [
"MIT"
] | 15 | 2019-07-24T11:07:34.000Z | 2022-01-05T04:16:34.000Z | gm2m/signals.py | mikewolfd/django-gm2m | a8cecc4d6d56c83e8d9c623888f5d07cb6ad8771 | [
"MIT"
] | 20 | 2019-09-18T09:45:33.000Z | 2022-02-25T14:49:04.000Z | from django.core.signals import Signal
deleting = Signal(providing_args=['del_objs', 'rel_objs'])
| 25.5 | 59 | 0.754902 | from django.core.signals import Signal
deleting = Signal(providing_args=['del_objs', 'rel_objs'])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d4b98b76fe624baafc9de081109a4e9e4e43d434 | 12,333 | py | Python | sensorFlightTest/MCv8.py | AllenRing/ProjectTabulas | 2ad4c7d17a8c5ae3bae7f984ff599b2b5a990ffa | [
"MIT"
] | 1 | 2016-02-05T14:40:20.000Z | 2016-02-05T14:40:20.000Z | sensorFlightTest/MCv8.py | AllenRing/ProjectTabulas | 2ad4c7d17a8c5ae3bae7f984ff599b2b5a990ffa | [
"MIT"
] | 1 | 2016-02-05T14:05:43.000Z | 2016-02-05T18:10:30.000Z | sensorFlightTest/MCv8.py | AllenRing/ProjectTabulas | 2ad4c7d17a8c5ae3bae7f984ff599b2b5a990ffa | [
"MIT"
] | null | null | null | #---------------------------------------------------------------------------------------------------------------|
# Organization: AllenRing |
# -- Created by Ritch ... | 34.449721 | 167 | 0.498662 | #---------------------------------------------------------------------------------------------------------------|
# Organization: AllenRing |
# -- Created by Ritch ... | 0 | 0 | 0 | 0 | 0 | 1,683 | 0 | 0 | 200 |
98f8a7366a54f5a00a6a3578b72a35407085c33f | 739 | py | Python | code/split_output_manifest.py | linuxus/ground-truth | ff849233187301b2c19040077f2802128503fc61 | [
"MIT"
] | null | null | null | code/split_output_manifest.py | linuxus/ground-truth | ff849233187301b2c19040077f2802128503fc61 | [
"MIT"
] | null | null | null | code/split_output_manifest.py | linuxus/ground-truth | ff849233187301b2c19040077f2802128503fc61 | [
"MIT"
] | null | null | null | import json
import numpy as np
with open('../manifest/output.manifest', 'r') as f:
output = [json.loads(line) for line in f.readlines()]
# Shuffle output in place.
np.random.shuffle(output)
dataset_size = len(output)
train_test_split_index = round(dataset_size*0.8)
train_data = output[:int(train_test_split_... | 25.482759 | 57 | 0.688769 | import os
import json
import random
import time
import numpy as np
with open('../manifest/output.manifest', 'r') as f:
output = [json.loads(line) for line in f.readlines()]
# Shuffle output in place.
np.random.shuffle(output)
dataset_size = len(output)
train_test_split_index = round(dataset_size*0.8)
train_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -30 | 66 |
a001ce47dfba472c5f1d59e9b2f19b59e9e3dbad | 645 | py | Python | exercicios-python/ex037.py | DaviStalleiken/codigos-de-desafios | e9ec388022b5f4bb2a5ab170c17969154ceaece3 | [
"MIT"
] | null | null | null | exercicios-python/ex037.py | DaviStalleiken/codigos-de-desafios | e9ec388022b5f4bb2a5ab170c17969154ceaece3 | [
"MIT"
] | null | null | null | exercicios-python/ex037.py | DaviStalleiken/codigos-de-desafios | e9ec388022b5f4bb2a5ab170c17969154ceaece3 | [
"MIT"
] | null | null | null | num = int(input('Digite um nmero inteiro: '))
print('''Escolha uma das bases para convert-lo:
[1] Converter para \033[34mBinrio\033[m
[2] Convertar para \033[34mOctal\033[m
[3] Converter para \033[34mHexadecimal\033[m ''')
opao = int(input('Sua opo: '))
if opao == 1:
print(f'{num} convertido para \033[31mBinrio\03... | 43 | 86 | 0.672868 | num = int(input('Digite um número inteiro: '))
print('''Escolha uma das bases para convertê-lo:
[1] Converter para \033[34mBinário\033[m
[2] Convertar para \033[34mOctal\033[m
[3] Converter para \033[34mHexadecimal\033[m ''')
opçao = int(input('Sua opção: '))
if opçao == 1:
print(f'{num} convertido para \033[31mBi... | 34 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
69d827e655244788f40f241b562e81329d616cac | 2,019 | py | Python | examples/python/simple_scene/simple_scene.py | LightEngineProject/light-engine | 5a343dd0b4c58ff77e29c1c31ff8e7d7d16dce66 | [
"MIT"
] | null | null | null | examples/python/simple_scene/simple_scene.py | LightEngineProject/light-engine | 5a343dd0b4c58ff77e29c1c31ff8e7d7d16dce66 | [
"MIT"
] | 2 | 2019-02-24T16:52:34.000Z | 2019-02-28T10:41:22.000Z | examples/python/simple_scene/simple_scene.py | LightEngineProjects/light-engine | 5a343dd0b4c58ff77e29c1c31ff8e7d7d16dce66 | [
"MIT"
] | null | null | null | from PySide2Wrapper.PySide2Wrapper.window import MainWindow
from PySide2Wrapper.PySide2Wrapper.widget import OpenGLWidget
from PySide2Wrapper.PySide2Wrapper.app import Application
if __name__ == "__main__":
simple_scene = SimpleScene()
app = Application()
gl_widget = OpenGLWidget(simple_scene.init, sim... | 32.564516 | 114 | 0.685983 | from random import uniform
import lepy
from PySide2Wrapper.PySide2Wrapper.window import MainWindow
from PySide2Wrapper.PySide2Wrapper.widget import OpenGLWidget
from PySide2Wrapper.PySide2Wrapper.app import Application
class SimpleScene:
def __init__(self):
self.engine = None
self.user_camera = N... | 0 | 0 | 0 | 1,170 | 0 | 0 | 0 | -5 | 68 |
767f2421702adb529b5f2bf1c70e81884cc41af1 | 140 | py | Python | manage_web.py | zakharovadaria/receipts | a1ac0936d8df4191c5500b605341e6380276595d | [
"MIT"
] | 2 | 2020-02-01T17:42:23.000Z | 2020-02-01T18:09:00.000Z | manage_web.py | zakharovadaria/receipts | a1ac0936d8df4191c5500b605341e6380276595d | [
"MIT"
] | null | null | null | manage_web.py | zakharovadaria/receipts | a1ac0936d8df4191c5500b605341e6380276595d | [
"MIT"
] | null | null | null | from dotenv import load_dotenv
load_dotenv()
from app.web import create_app
app = create_app()
if __name__ == '__main__':
app.run()
| 12.727273 | 30 | 0.721429 | from dotenv import load_dotenv
load_dotenv()
from app.web import create_app
app = create_app()
if __name__ == '__main__':
app.run()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8f56893a2eca8a9c660dd465aecbdf31e87e9548 | 664 | py | Python | app/src/main/python/a.py | piyushagr00786/Document-Scanner | d9ace813badbffe9af3c3e0627bf00dc0a3ebc50 | [
"MIT"
] | null | null | null | app/src/main/python/a.py | piyushagr00786/Document-Scanner | d9ace813badbffe9af3c3e0627bf00dc0a3ebc50 | [
"MIT"
] | null | null | null | app/src/main/python/a.py | piyushagr00786/Document-Scanner | d9ace813badbffe9af3c3e0627bf00dc0a3ebc50 | [
"MIT"
] | null | null | null |
import numpy as np
#from StringIO import StringIO
# if(img):
#img=cv2.imread(np1,cv2.IMREAD_UNCHANGED)
| 17.025641 | 92 | 0.698795 |
import numpy as np
import base64
from PIL import Image
import cv2
#from StringIO import StringIO
import numpy as np
import io
from io import BytesIO
def aa(bmp):
# cvimg = readb64(bmp)
d=base64.b64decode(bmp)
np_data = np.fromstring(d,np.uint8)
img = cv2.imdecode(np_data, cv2.IMREAD_UNCHANGED)
... | 0 | 0 | 0 | 0 | 0 | 426 | 0 | -33 | 155 |
e62a17e95e6e39bf9f63dc1a369e8d2b82925165 | 5,298 | py | Python | st2api/st2api/controllers/exp/actionalias.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2020-11-21T10:11:25.000Z | 2020-11-21T10:11:25.000Z | st2api/st2api/controllers/exp/actionalias.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2015-06-08T15:27:11.000Z | 2015-06-08T15:27:11.000Z | st2api/st2api/controllers/exp/actionalias.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 13 | 2017-01-12T11:07:20.000Z | 2019-04-19T09:55:49.000Z | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 42.725806 | 100 | 0.687618 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 0 | 3,583 | 0 | 397 | 0 | 0 | 0 | 217 | 201 |
66de7b576236c5ad0aa8c5332d138cfa2e2d1325 | 3,989 | py | Python | rogal/term/ansi.py | kosciak/ecs-rogal | d553104e0ea350d11272d274a900419620b9389e | [
"MIT"
] | 4 | 2021-01-23T13:25:46.000Z | 2021-03-19T03:08:05.000Z | rogal/term/ansi.py | kosciak/ecs-rogal | d553104e0ea350d11272d274a900419620b9389e | [
"MIT"
] | null | null | null | rogal/term/ansi.py | kosciak/ecs-rogal | d553104e0ea350d11272d274a900419620b9389e | [
"MIT"
] | null | null | null |
from .escape_seq import csi
from .escape_seq import CSI
"""Rudimentary ANSI support.
See: https://en.wikipedia.org/wiki/ANSI_escape_code
"""
def cursor_position(n=1, m=1):
"""Move cursor to row n, column m (1-indexed from top-left)."""
return csi(CSI.CUP, n, m)
| 20.668394 | 67 | 0.607671 | import sys
from .escape_seq import csi
from .escape_seq import CSI, SGR, ColorsMode, Color
"""Rudimentary ANSI support.
See: https://en.wikipedia.org/wiki/ANSI_escape_code
"""
def cursor_up(n=1):
return csi(CSI.CUU, n)
def cursor_down(n=1):
return csi(CSI.CUD, n)
def cursor_forward(n=1):
return csi... | 0 | 0 | 0 | 0 | 0 | 2,838 | 0 | 13 | 850 |
f7706ebd4ccc61b41b8d11296f2650beee97c144 | 270 | py | Python | exercicios curso em video/ex037.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | exercicios curso em video/ex037.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | exercicios curso em video/ex037.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | n = int(input('digite um nmero inteiro: '))
op = int(input('''escolha uma opo de converso:
[ 1 ] Binrio
[ 2 ] Octal
[ 3 ] Hexadecimal'''))
if op == 1:
print(bin(n)[2:])
elif op == 2:
print(oct(n)[2:])
elif op == 3:
print(hex(n)[2:])
| 16.875 | 51 | 0.522222 | n = int(input('digite um número inteiro: '))
op = int(input('''escolha uma opção de conversão:
[ 1 ] Binário
[ 2 ] Octal
[ 3 ] Hexadecimal'''))
if op == 1:
print(bin(n)[2:])
elif op == 2:
print(oct(n)[2:])
elif op == 3:
print(hex(n)[2:])
| 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c78003c24de1301b0b4edcdeab9519a097f9d2ee | 106 | py | Python | loader/__init__.py | bsbateam/genoxs | 3df0c07211e1adb3f58fab9231d4aaa8a89ebbb8 | [
"BSD-3-Clause"
] | 3 | 2020-05-04T00:33:57.000Z | 2021-01-10T04:42:07.000Z | loader/__init__.py | genemators/genoxs | 3df0c07211e1adb3f58fab9231d4aaa8a89ebbb8 | [
"BSD-3-Clause"
] | null | null | null | loader/__init__.py | genemators/genoxs | 3df0c07211e1adb3f58fab9231d4aaa8a89ebbb8 | [
"BSD-3-Clause"
] | 1 | 2020-07-22T00:35:01.000Z | 2020-07-22T00:35:01.000Z | try:
except ImportError as err:
print(f"Import failed, {err}") | 26.5 | 37 | 0.698113 | try:
from loader.loader import loader
except ImportError as err:
print(f"Import failed, {err}") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 27 |
943bd3612c05eea98e46831925b8384fd666a02a | 1,444 | py | Python | msibi/tutorials/propane/opt.py | jennyfothergill/msibi | 0e309eff836dc13016d87889fe8d8f6960a13599 | [
"MIT"
] | 7 | 2021-03-24T17:01:09.000Z | 2022-01-03T21:53:26.000Z | msibi/tutorials/propane/opt.py | jennyfothergill/msibi | 0e309eff836dc13016d87889fe8d8f6960a13599 | [
"MIT"
] | 22 | 2021-03-24T18:09:57.000Z | 2022-02-24T18:36:49.000Z | msibi/tutorials/propane/opt.py | jennyfothergill/msibi | 0e309eff836dc13016d87889fe8d8f6960a13599 | [
"MIT"
] | 2 | 2021-03-24T16:19:56.000Z | 2021-03-24T17:04:48.000Z | import itertools
import os
import numpy as np
from msibi import MSIBI, Pair, State, mie
os.system("rm rdfs/pair_C3*_state*-step*.txt f_fits.log")
os.system("rm state_*/*.txt state*/run.py state*/*query.dcd")
# Set up global parameters.
rdf_cutoff = 5.0
opt = MSIBI(
rdf_cutoff=rdf_cutoff, n_rdf_points=201, pot_... | 23.290323 | 80 | 0.677285 | import itertools
import os
import string
import numpy as np
from msibi import MSIBI, Pair, State, mie
os.system("rm rdfs/pair_C3*_state*-step*.txt f_fits.log")
os.system("rm state_*/*.txt state*/run.py state*/*query.dcd")
# Set up global parameters.
rdf_cutoff = 5.0
opt = MSIBI(
rdf_cutoff=rdf_cutoff, n_rdf_po... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
39d3099d8f0fde6079c4fd1c75d9c16f70c2a453 | 1,742 | py | Python | Lib/site-packages/twisted/web2/dav/method/delete.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | Lib/site-packages/twisted/web2/dav/method/delete.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | Lib/site-packages/twisted/web2/dav/method/delete.py | raychorn/svn_Python-2.5.1 | 425005b1b489ba44ec0bb989e077297e8953d9be | [
"PSF-2.0"
] | null | null | null | # -*- test-case-name: twisted.web2.dav.test.test_delete -*-
##
# Copyright (c) 2005 Apple Computer, Inc. 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 restric... | 36.291667 | 80 | 0.740528 | # -*- test-case-name: twisted.web2.dav.test.test_delete -*-
##
# Copyright (c) 2005 Apple Computer, Inc. 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 restric... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
21af1df38dea7e7f28c08382f2e782d58bc43cd9 | 201 | py | Python | medvision/visualization/__init__.py | kyle0x54/medvision | a634208fe9b2dff13e54b28fa024a31328a78431 | [
"Apache-2.0"
] | 6 | 2019-02-06T15:27:53.000Z | 2021-08-20T03:19:13.000Z | medvision/visualization/__init__.py | kyle0x54/medvision | a634208fe9b2dff13e54b28fa024a31328a78431 | [
"Apache-2.0"
] | 2 | 2019-08-05T11:08:02.000Z | 2019-09-23T09:15:33.000Z | medvision/visualization/__init__.py | kyle0x54/medvision | a634208fe9b2dff13e54b28fa024a31328a78431 | [
"Apache-2.0"
] | 2 | 2019-02-19T06:48:14.000Z | 2019-08-05T08:40:45.000Z | # flake8: noqa
__all__ = [k for k in globals().keys() if not k.startswith("_")]
| 28.714286 | 70 | 0.761194 | # flake8: noqa
from .draw_curve import draw_froc_curve, draw_roc_curve, draw_pr_curve
from .image import Color, imshow, imshow_bboxes
__all__ = [k for k in globals().keys() if not k.startswith("_")]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 75 | 45 |
08930887731f54d32baa46295d141d583dcbce59 | 1,644 | py | Python | libs/plotutils.py | SebaDro/ST-DeepHydro | 98cf8c1fabd9098c34f486655cc608383db36eaa | [
"Apache-2.0"
] | null | null | null | libs/plotutils.py | SebaDro/ST-DeepHydro | 98cf8c1fabd9098c34f486655cc608383db36eaa | [
"Apache-2.0"
] | null | null | null | libs/plotutils.py | SebaDro/ST-DeepHydro | 98cf8c1fabd9098c34f486655cc608383db36eaa | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
import tensorflow as tf
def plot_loss(history: tf.keras.callbacks.History):
"""
Visualizes the progress of a trained model by plotting the loss per epoch
Parameters
----------
history: tf.keras.callbacks.History
A Tensorflow history object that holds inform... | 34.25 | 90 | 0.677007 | import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import tensorflow as tf
import xarray as xr
def plot_loss(history: tf.keras.callbacks.History):
"""
Visualizes the progress of a trained model by plotting the loss per epoch
Parameters
----------
history: tf.keras.callbacks.History... | 0 | 0 | 0 | 0 | 0 | 981 | 0 | 10 | 90 |
92bc4aa01ffafb6b30b47395867329fa36246ca5 | 1,822 | py | Python | python/spi/token.py | montreal91/jolly-jay | 7a2e145658177abc109b9f8f3787b8197f4ce7b5 | [
"BSD-3-Clause"
] | null | null | null | python/spi/token.py | montreal91/jolly-jay | 7a2e145658177abc109b9f8f3787b8197f4ce7b5 | [
"BSD-3-Clause"
] | null | null | null | python/spi/token.py | montreal91/jolly-jay | 7a2e145658177abc109b9f8f3787b8197f4ce7b5 | [
"BSD-3-Clause"
] | null | null | null |
# Maps token symbol to the token type
ONE_SYMBOL_TOKENS = {
"+": TokenType.PLUS,
"-": TokenType.MINUS,
"*": TokenType.MULTIPLY,
"/": TokenType.REAL_DIV,
"(": TokenType.LPAR,
")": TokenType.RPAR,
";": TokenType.SEMI,
":": TokenType.COLON,
",": TokenType.COMMA,
".": TokenType.D... | 21.951807 | 100 | 0.597146 | from enum import Enum
class TokenType(Enum):
ASSIGN = "ASSIGN"
BEGIN = "BEGIN"
COLON = "COLON"
COMMA = "COMMA"
DOT = "DOT"
END = "END"
ID = "ID"
INTEGER = "INTEGER"
INTEGER_DIV = "INT_DIV"
INTEGER_LITERAL = "INTEGER_LITERAL"
LPAR = "LPAR"
MINUS = "MINUS"
MULTIPLY = ... | 0 | 0 | 0 | 1,118 | 0 | 0 | 0 | 0 | 68 |
99e3887f57aecf09193e7c848f0d73ac30999a95 | 10,712 | py | Python | compiler.py | reidrac/jtc | bd9f90bf767cc1c05050ec0d4ddf2b6c22a54b31 | [
"MIT"
] | 2 | 2016-05-12T19:29:21.000Z | 2020-03-19T16:14:32.000Z | compiler.py | reidrac/jtc | bd9f90bf767cc1c05050ec0d4ddf2b6c22a54b31 | [
"MIT"
] | null | null | null | compiler.py | reidrac/jtc | bd9f90bf767cc1c05050ec0d4ddf2b6c22a54b31 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from sys import exit, stdin
from os import environ, path, unlink
from tempfile import NamedTemporaryFile
from subprocess import Popen, PIPE
from argparse import ArgumentParser
import parser
import lexer
__author__ = "Juan J. Martinez <jjm@usebox.net>"
__version__ = "0.6.3"
app_name = "JTC"
proj... | 30.605714 | 122 | 0.537901 | #!/usr/bin/env python
from sys import exit, stdin
from os import environ, path, unlink
from tempfile import NamedTemporaryFile
from subprocess import Popen, PIPE
from argparse import ArgumentParser
import parser
import lexer
__author__ = "Juan J. Martinez <jjm@usebox.net>"
__version__ = "0.6.3"
app_name = "JTC"
proj... | 0 | 476 | 0 | 552 | 0 | 5,606 | 0 | 0 | 253 |
1bbb3e688bbd4f3f08603ebe45c56d6a8f3a3d1a | 1,547 | py | Python | setup.py | jasonkatz/py-graphql-client | 9f938f3d379a8f4d8810961c87baf25dbe35889d | [
"BSD-3-Clause"
] | 38 | 2019-03-22T16:27:08.000Z | 2022-03-30T11:07:55.000Z | setup.py | anthonyhiga/py-graphql-client | 9c59b32bae5c5c6a12634b2bd6353f76328aa31a | [
"BSD-3-Clause"
] | 31 | 2019-03-25T20:28:40.000Z | 2022-01-26T21:22:47.000Z | setup.py | anthonyhiga/py-graphql-client | 9c59b32bae5c5c6a12634b2bd6353f76328aa31a | [
"BSD-3-Clause"
] | 11 | 2019-03-25T18:54:32.000Z | 2021-09-11T17:00:27.000Z | # -*- coding: utf-8 -*-
from setuptools import find_packages, setup
__version__ = "0.1.1"
__desc__ = "A dead-simple GraphQL client that supports subscriptions over websockets"
with open('README.md') as readme_file:
readme = readme_file.read()
requirements = [
'websocket-client==0.54.0'
]
test_requirements ... | 30.333333 | 85 | 0.652877 | # -*- coding: utf-8 -*-
from setuptools import find_packages, setup
__version__ = "0.1.1"
__desc__ = "A dead-simple GraphQL client that supports subscriptions over websockets"
with open('README.md') as readme_file:
readme = readme_file.read()
requirements = [
'websocket-client==0.54.0'
]
test_requirements ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9bbff3893e5f96c2c392c4af0b4ffa7ea128b58e | 1,686 | py | Python | src/error_correction/dataset_utils/describe_masks.py | gruentee/acl2021-factual-error-correction | b500f589cc3e73ffa6958c7dab8c07f2535a448f | [
"Apache-2.0"
] | 5 | 2021-06-12T14:24:22.000Z | 2021-06-15T02:03:44.000Z | src/error_correction/dataset_utils/describe_masks.py | gruentee/acl2021-factual-error-correction | b500f589cc3e73ffa6958c7dab8c07f2535a448f | [
"Apache-2.0"
] | 5 | 2021-06-14T14:52:17.000Z | 2021-07-04T13:18:03.000Z | src/error_correction/dataset_utils/describe_masks.py | gruentee/acl2021-factual-error-correction | b500f589cc3e73ffa6958c7dab8c07f2535a448f | [
"Apache-2.0"
] | 4 | 2021-07-10T13:40:37.000Z | 2022-01-20T08:50:05.000Z | #
# Copyright (c) 2019-2021 James Thorne.
#
# This file is part of factual error correction.
# See https://jamesthorne.co.uk for further info.
#
# 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
... | 33.72 | 78 | 0.662515 | #
# Copyright (c) 2019-2021 James Thorne.
#
# This file is part of factual error correction.
# See https://jamesthorne.co.uk for further info.
#
# 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
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
177d200a81abac306eaa75a289ef7f0959cc6176 | 12,021 | py | Python | BiGI_src/utils/loader.py | caojiangxia/BiGI | ed54c20523a5b3f295b90a9c08f7c54e8258d04a | [
"MIT"
] | 57 | 2020-10-19T08:54:57.000Z | 2022-03-19T12:20:43.000Z | BiGI_src/utils/loader.py | caojiangxia/BiGI | ed54c20523a5b3f295b90a9c08f7c54e8258d04a | [
"MIT"
] | 6 | 2020-12-01T02:31:56.000Z | 2021-10-10T06:15:13.000Z | BiGI_src/utils/loader.py | caojiangxia/BiGI | ed54c20523a5b3f295b90a9c08f7c54e8258d04a | [
"MIT"
] | 9 | 2021-05-15T03:29:31.000Z | 2022-03-14T20:28:44.000Z | """
Data loader for TACRED json files.
"""
| 44.032967 | 373 | 0.556776 | """
Data loader for TACRED json files.
"""
import json
import random
import torch
import numpy as np
class DataLoader(object):
"""
Load data from json files, preprocess and prepare batches.
"""
def __init__(self, filename, batch_size, opt, user_real_dict, user_fake_dict, item_real_dict, item_fake_dic... | 0 | 0 | 0 | 11,869 | 0 | 0 | 0 | -30 | 135 |
eca444c0f5a1e8f5a0116943df0c1cf53f8f4460 | 1,001 | py | Python | import/jsonify.py | 18F/NRM-Grants-Agreements | 7b9016e034b75a2237f7c70ba539b542108c335e | [
"CC0-1.0"
] | 5 | 2020-11-18T20:00:02.000Z | 2021-04-16T23:50:07.000Z | import/jsonify.py | USDAForestService/NRM-Grants-Agreements | 7b9016e034b75a2237f7c70ba539b542108c335e | [
"CC0-1.0"
] | 210 | 2021-04-28T16:26:34.000Z | 2022-03-14T16:31:21.000Z | import/jsonify.py | USDAForestService/NRM-Grants-Agreements | 7b9016e034b75a2237f7c70ba539b542108c335e | [
"CC0-1.0"
] | 2 | 2021-07-06T20:57:27.000Z | 2021-07-07T13:06:46.000Z | import csv
import json
import sys
def make_json(args):
"""
Pretty simple and somewhat naive script that =takes a `.xsv` file as an argument,
converts it to JSON, and outputs it as a json file of the same name as the original csv.
It can handle .csv or .tsv files.
It does, however, make a lot of ... | 31.28125 | 92 | 0.62038 | import csv
import json
import sys
def make_json(args):
"""
Pretty simple and somewhat naive script that =takes a `.xsv` file as an argument,
converts it to JSON, and outputs it as a json file of the same name as the original csv.
It can handle .csv or .tsv files.
It does, however, make a lot of ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
46877eeab023b042935d4a1583c595ecfe184fe7 | 3,012 | py | Python | tests/test_ddem.py | erikmannerfelt/xdem | 725a216f576642f2af4ac3228c9290cd85e47e17 | [
"MIT"
] | 12 | 2021-03-05T22:40:49.000Z | 2022-03-25T14:01:54.000Z | tests/test_ddem.py | erikmannerfelt/xdem | 725a216f576642f2af4ac3228c9290cd85e47e17 | [
"MIT"
] | 205 | 2021-03-04T13:07:15.000Z | 2022-02-02T18:02:14.000Z | tests/test_ddem.py | erikmannerfelt/xdem | 725a216f576642f2af4ac3228c9290cd85e47e17 | [
"MIT"
] | 12 | 2021-03-10T09:27:51.000Z | 2022-03-28T12:29:53.000Z | """Functions to test the difference of DEMs tools."""
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
| 32.042553 | 93 | 0.648406 | """Functions to test the difference of DEMs tools."""
import warnings
import geoutils as gu
import numpy as np
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import xdem
class TestdDEM:
dem_2009 = xdem.DEM(xdem.examples.get_path("longyearbyen_ref_dem"))
dem_1990 = xdem.DEM(xdem.exam... | 0 | 0 | 0 | 2,791 | 0 | 0 | 0 | -13 | 94 |
a41283ee12db1520d638c091b84a0d30196b74db | 719 | py | Python | docs/command_interface/src/resources/source/sample.py | CoderSong2015/Apache-Trafodion | 889631aae9cdcd38fca92418d633f2dedc0be619 | [
"Apache-2.0"
] | 148 | 2015-06-18T21:26:04.000Z | 2017-12-25T01:47:01.000Z | docs/command_interface/src/resources/source/sample.py | CoderSong2015/Apache-Trafodion | 889631aae9cdcd38fca92418d633f2dedc0be619 | [
"Apache-2.0"
] | 1,352 | 2015-06-20T03:05:01.000Z | 2017-12-25T14:13:18.000Z | docs/command_interface/src/resources/source/sample.py | CoderSong2015/Apache-Trafodion | 889631aae9cdcd38fca92418d633f2dedc0be619 | [
"Apache-2.0"
] | 166 | 2015-06-19T18:52:10.000Z | 2017-12-27T06:19:32.000Z | import os import sys
## Modify this path
sys.path.append("C:\\Program Files (x86)\\Apache Software Foundation\\Trafodion Command Interface\\lib\\python")
import Session
# create a new session
sess = Session.Session()
# Connect to the database
x=sess. connect ("user1","password","16.123.456.78","23400")
# Execute sa... | 23.966667 | 112 | 0.751043 | import os import sys
## Modify this path
sys.path.append("C:\\Program Files (x86)\\Apache Software Foundation\\Trafodion Command Interface\\lib\\python")
import Session
# create a new session
sess = Session.Session()
# Connect to the database
x=sess. connect ("user1","password","16.123.456.78","23400")
# Execute sa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
168adf574b0816d2f1731870f4b134622f8eeccc | 9,276 | py | Python | tests/test_nasbench.py | Harald-R/aw_nas | 8cf0cf48f7bcfd7893e6355dcc3ccbc83fd39783 | [
"MIT"
] | 195 | 2020-08-15T17:39:23.000Z | 2022-02-28T07:48:03.000Z | tests/test_nasbench.py | Harald-R/aw_nas | 8cf0cf48f7bcfd7893e6355dcc3ccbc83fd39783 | [
"MIT"
] | 22 | 2020-08-16T01:44:48.000Z | 2022-03-12T00:46:54.000Z | tests/test_nasbench.py | Harald-R/aw_nas | 8cf0cf48f7bcfd7893e6355dcc3ccbc83fd39783 | [
"MIT"
] | 27 | 2020-08-16T06:34:56.000Z | 2022-03-06T18:16:52.000Z | import os
AWNAS_TEST_NASBENCH = os.environ.get("AWNAS_TEST_NASBENCH", None)
| 43.549296 | 109 | 0.579452 | import os
import pytest
import numpy as np
AWNAS_TEST_NASBENCH = os.environ.get("AWNAS_TEST_NASBENCH", None)
@pytest.mark.skipif(
not AWNAS_TEST_NASBENCH, reason="do not test the nasbench BTC by default.")
@pytest.mark.parametrize("case", [
{"cls": "nasbench-101", "load_nasbench": False, "validate_spec": Fals... | 0 | 9,051 | 0 | 0 | 0 | 0 | 0 | -11 | 159 |
2806076df6167d2584f2050dbeef65e5995f6784 | 536 | py | Python | tests/r/test_forbes2000.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 199 | 2017-07-24T01:34:27.000Z | 2022-01-29T00:50:55.000Z | tests/r/test_forbes2000.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 46 | 2017-09-05T19:27:20.000Z | 2019-01-07T09:47:26.000Z | tests/r/test_forbes2000.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 45 | 2017-07-26T00:10:44.000Z | 2022-03-16T20:44:59.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import tempfile
from observations.r.forbes2000 import forbes2000
def test_forbes2000():
"""Test module forbes2000.py by downloading
forbes2000.csv and testing shape of
extracted data ha... | 22.333333 | 48 | 0.76306 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.forbes2000 import forbes2000
def test_forbes2000():
"""Test module forbes2000.py by downloading
forbes2000.csv and testing shape of
extrac... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
5f61a50e6cd2506d053464655ef7fe7163ee3ba2 | 9,604 | py | Python | pytorch_lightning/metrics/metric.py | GimmickNG/pytorch-lightning | b36c5e86d014671b0fa922d750b27420bc73b6f9 | [
"Apache-2.0"
] | 2 | 2020-08-28T12:11:59.000Z | 2020-09-27T09:44:04.000Z | pytorch_lightning/metrics/metric.py | GimmickNG/pytorch-lightning | b36c5e86d014671b0fa922d750b27420bc73b6f9 | [
"Apache-2.0"
] | 8 | 2021-01-15T13:15:09.000Z | 2021-04-04T19:52:25.000Z | pytorch_lightning/metrics/metric.py | GimmickNG/pytorch-lightning | b36c5e86d014671b0fa922d750b27420bc73b6f9 | [
"Apache-2.0"
] | 1 | 2020-10-19T03:52:27.000Z | 2020-10-19T03:52:27.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.117241 | 107 | 0.619429 | # 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... | 0 | 3,744 | 0 | 4,733 | 0 | 0 | 0 | 244 | 293 |
8e9143d76b7e83ec39ca81333f61c41cbb0b5da7 | 3,637 | py | Python | test/test_basic_style.py | jarret/bitcoin_helpers | 4b6155ea3b004ad58a717b36cd58138d058281b1 | [
"MIT"
] | null | null | null | test/test_basic_style.py | jarret/bitcoin_helpers | 4b6155ea3b004ad58a717b36cd58138d058281b1 | [
"MIT"
] | null | null | null | test/test_basic_style.py | jarret/bitcoin_helpers | 4b6155ea3b004ad58a717b36cd58138d058281b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import argparse
from framework.argparse.option import add_tmp_directory_option
from framework.bitcoin.setup im... | 35.31068 | 79 | 0.648337 | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import os
import argparse
from framework.argparse.option import add_tmp_directory_option
from framework.bitco... | 0 | 0 | 0 | 175 | 0 | 1,819 | 0 | 200 | 315 |
79b61d44ff4d004fe8be95d305b19b4d67cb1470 | 2,068 | py | Python | conftest.py | zodman/gotrue-py | 2f94bfdbc2cf20ef50ec777bbda03face1da3e85 | [
"MIT"
] | 13 | 2021-10-06T08:50:55.000Z | 2022-03-29T18:21:12.000Z | conftest.py | zodman/gotrue-py | 2f94bfdbc2cf20ef50ec777bbda03face1da3e85 | [
"MIT"
] | 82 | 2021-09-29T11:50:29.000Z | 2022-03-24T07:27:33.000Z | conftest.py | zodman/gotrue-py | 2f94bfdbc2cf20ef50ec777bbda03face1da3e85 | [
"MIT"
] | 4 | 2021-09-15T07:33:22.000Z | 2022-01-13T22:53:01.000Z | from typing import Dict, Tuple
# store history of failures per test class name and per index
# in parametrize (if parametrize used)
_test_failed_incremental: Dict[str, Dict[Tuple[int, ...], str]] = {}
| 39.769231 | 87 | 0.60735 | from typing import Dict, Tuple
import pytest
# store history of failures per test class name and per index
# in parametrize (if parametrize used)
_test_failed_incremental: Dict[str, Dict[Tuple[int, ...], str]] = {}
def pytest_runtest_makereport(item, call):
if "incremental" in item.keywords:
# increment... | 0 | 0 | 0 | 0 | 0 | 1,803 | 0 | -8 | 69 |
ebc98c9be150485094483d351832f5f41ddeb341 | 3,760 | py | Python | Table Objects/Striker.py | rval002/Air-Hockey-Table-Project-UCR | babc11637d0db89c012205e0c2ad1a608d1c54e3 | [
"MIT"
] | 1 | 2021-06-08T05:22:55.000Z | 2021-06-08T05:22:55.000Z | Table Objects/Striker.py | rval002/Air-Hockey-Table-Project-UCR | babc11637d0db89c012205e0c2ad1a608d1c54e3 | [
"MIT"
] | null | null | null | Table Objects/Striker.py | rval002/Air-Hockey-Table-Project-UCR | babc11637d0db89c012205e0c2ad1a608d1c54e3 | [
"MIT"
] | 1 | 2021-01-11T04:48:08.000Z | 2021-01-11T04:48:08.000Z | # **************************************************************************** #
# Air Hockey Table Project
# Author: Ricardo Valverde
# -------------------------
#This Code is Created for UCR's EE175 Senior Design Project
# This Code contains The Puck Object Striker
#For Pygame Documentation please see:
#https://w... | 30.819672 | 118 | 0.588564 | # **************************************************************************** #
# Air Hockey Table Project
# Author: Ricardo Valverde
# -------------------------
#This Code is Created for UCR's EE175 Senior Design Project
# This Code contains The Puck Object Striker
#For Pygame Documentation please see:
#https://w... | 0 | 0 | 0 | 3,205 | 0 | 0 | 0 | -10 | 133 |
e67cc3f77e80a72454938caa03121621ff00417a | 19,307 | py | Python | BUtils.py | joacocruz6/cc3501-tarea2 | e6560b007a377769ef27d2b128a4dce560568542 | [
"MIT"
] | null | null | null | BUtils.py | joacocruz6/cc3501-tarea2 | e6560b007a377769ef27d2b128a4dce560568542 | [
"MIT"
] | null | null | null | BUtils.py | joacocruz6/cc3501-tarea2 | e6560b007a377769ef27d2b128a4dce560568542 | [
"MIT"
] | null | null | null | import pygame
import random as rand
#################################################################
#######MODULO DE FUNCIONES AUXILIARES PARA EL BOMBERMAN
#################################################################
###################
######choques######
###################
def chocaPared(p,l_pared,l_des... | 29.033083 | 168 | 0.545346 |
from CC3501Utils import *
from Bombs import *
from Vista import *
from Pared import *
from Player import *
from Explosion import *
from PDes import *
from Enemy import *
from Win import *
from Power import *
import pygame
import math as m
import random as rand
#########################################################... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -17 | 243 |
48f7268c6405c1a34b2e0c7b8c22e043eb5b6d4b | 102 | py | Python | myint.py | codes-by-kiwi/defining-an-int-py | 793a781f650b2ef38d429a1dc25c0e4a15997889 | [
"MIT"
] | null | null | null | myint.py | codes-by-kiwi/defining-an-int-py | 793a781f650b2ef38d429a1dc25c0e4a15997889 | [
"MIT"
] | null | null | null | myint.py | codes-by-kiwi/defining-an-int-py | 793a781f650b2ef38d429a1dc25c0e4a15997889 | [
"MIT"
] | null | null | null | myint = 7
print(myint)
# the below way is another way to do the above
print(7)
# This will print 7.
| 12.75 | 46 | 0.696078 | myint = 7
print(myint)
# the below way is another way to do the above
print(7)
# This will print 7.
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
872444167ede318f2615a3163f3e50610c67b32d | 18,222 | py | Python | passglm/data.py | bccho/pass-glm | 4ad14dd043532419dc413c509672b54d1eb8d516 | [
"MIT"
] | null | null | null | passglm/data.py | bccho/pass-glm | 4ad14dd043532419dc413c509672b54d1eb8d516 | [
"MIT"
] | null | null | null | passglm/data.py | bccho/pass-glm | 4ad14dd043532419dc413c509672b54d1eb8d516 | [
"MIT"
] | null | null | null | # Authors: Jonathan Huggins <jhuggins@mit.edu>
# Trevor Campbell <tdjc@mit.edu>
from __future__ import absolute_import, print_function
import sys
import csv
import pickle
import numpy as np
import numpy.random as npr
import scipy.sparse as sp
from sklearn import preprocessing
# based on: http://stackoverfl... | 32.539286 | 83 | 0.573922 | # Authors: Jonathan Huggins <jhuggins@mit.edu>
# Trevor Campbell <tdjc@mit.edu>
from __future__ import absolute_import, print_function
import sys
import csv
import hashlib
import pickle
from warnings import warn
import numpy as np
import numpy.random as npr
import scipy.sparse as sp
import sklearn.datasets... | 0 | 0 | 0 | 0 | 0 | 2,840 | 0 | 46 | 318 |
d99dd7e522294f090a9fa1d9c4391cc83cffcaf6 | 2,776 | py | Python | test_settings.py | holvi/django-waffle | 46442854e7eb76959c684037e92c4a4fb925cf0c | [
"BSD-3-Clause"
] | null | null | null | test_settings.py | holvi/django-waffle | 46442854e7eb76959c684037e92c4a4fb925cf0c | [
"BSD-3-Clause"
] | 4 | 2016-06-17T06:24:55.000Z | 2022-01-04T14:50:00.000Z | test_settings.py | holvi/django-waffle | 46442854e7eb76959c684037e92c4a4fb925cf0c | [
"BSD-3-Clause"
] | 2 | 2016-03-08T07:51:34.000Z | 2019-06-19T12:52:22.000Z | import os
import django
from distutils.version import StrictVersion
DJANGO_VERSION = StrictVersion(django.get_version())
# Make filepaths relative to settings.
ROOT = os.path.dirname(os.path.abspath(__file__))
path = lambda *a: os.path.join(ROOT, *a)
DEBUG = True
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
J... | 25.009009 | 78 | 0.631484 | import os
import django
from distutils.version import StrictVersion
DJANGO_VERSION = StrictVersion(django.get_version())
# Make filepaths relative to settings.
ROOT = os.path.dirname(os.path.abspath(__file__))
path = lambda *a: os.path.join(ROOT, *a)
DEBUG = True
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
J... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -6 | 30 |
edac1439062883480f7c1b6aaac384f6716d8bc2 | 2,443 | py | Python | apphub/image_classification/lenet_mnist/tensorflow/lenet_mnist.py | vbvg2008/fastestimator-future | dbf7d597d1f97140f837345f6b06f1773d4fa299 | [
"Apache-1.1"
] | null | null | null | apphub/image_classification/lenet_mnist/tensorflow/lenet_mnist.py | vbvg2008/fastestimator-future | dbf7d597d1f97140f837345f6b06f1773d4fa299 | [
"Apache-1.1"
] | null | null | null | apphub/image_classification/lenet_mnist/tensorflow/lenet_mnist.py | vbvg2008/fastestimator-future | dbf7d597d1f97140f837345f6b06f1773d4fa299 | [
"Apache-1.1"
] | null | null | null | """This example showcase FastEstimator usage for tensorflow users. In this file, we use tf.dataset as data input.
"""
if __name__ == "__main__":
est = get_estimator()
est.fit() | 35.405797 | 115 | 0.639787 | """This example showcase FastEstimator usage for tensorflow users. In this file, we use tf.dataset as data input.
"""
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import Sequential, layers
import fastestimator as fe
from fastestimator.op.tensorop.loss import CrossEntropy
from fastestimator.o... | 0 | 0 | 0 | 0 | 0 | 1,875 | 0 | 137 | 247 |
8264cd116ef797f808fc0878529023592ab0d01d | 1,267 | py | Python | CalliopeAPI/decode_labels.py | RoZvEr/Calliope | 4ef5a71f0d2788508d6fef00ee98932e27b85105 | [
"MIT"
] | 1 | 2020-06-11T11:02:03.000Z | 2020-06-11T11:02:03.000Z | CalliopeAPI/decode_labels.py | RoZvEr/Calliope | 4ef5a71f0d2788508d6fef00ee98932e27b85105 | [
"MIT"
] | null | null | null | CalliopeAPI/decode_labels.py | RoZvEr/Calliope | 4ef5a71f0d2788508d6fef00ee98932e27b85105 | [
"MIT"
] | 1 | 2020-10-12T06:25:42.000Z | 2020-10-12T06:25:42.000Z | from tensorflow.keras.applications import InceptionV3
from tensorflow.keras.applications.imagenet_utils import decode_predictions
import numpy as np
import cv2
images = np.load('dataset/LLD_icon_numpy/dataset1.npy')
model = InceptionV3(include_top=True, weights='imagenet')
start_index = 0
end_index = 2000
count = 0
... | 28.795455 | 93 | 0.764799 | from tensorflow.keras.applications import InceptionV3
from tensorflow.keras.applications.imagenet_utils import preprocess_input, decode_predictions
import numpy as np
from tensorflow import keras
from matplotlib import pyplot as plt
from tensorflow.keras.preprocessing import image
from tensorflow.keras import Input
fro... | 0 | 0 | 0 | 0 | 0 | 77 | 0 | 96 | 155 |
a6e51f3033941c14b71a08068bf7b30507da8fc4 | 695 | py | Python | docker/random_secret.py | davewalker5/NatureRecorderPy | 53b3c2a589986f91bc78999f40a6dc55f61afe36 | [
"MIT"
] | null | null | null | docker/random_secret.py | davewalker5/NatureRecorderPy | 53b3c2a589986f91bc78999f40a6dc55f61afe36 | [
"MIT"
] | null | null | null | docker/random_secret.py | davewalker5/NatureRecorderPy | 53b3c2a589986f91bc78999f40a6dc55f61afe36 | [
"MIT"
] | null | null | null | import os
import sys
def get_project_path():
"""
Return the path to the project root folder
:return: The path to the project root folder
"""
return os.path.dirname(os.path.dirname(__file__))
def set_web_app_secret():
"""
Replace the secret key in the web application Python source file
... | 21.060606 | 68 | 0.6 | import os
import sys
def get_project_path():
"""
Return the path to the project root folder
:return: The path to the project root folder
"""
return os.path.dirname(os.path.dirname(__file__))
def set_web_app_secret():
"""
Replace the secret key in the web application Python source file
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6229ff03ea610788af9d49dae4964428e3f65918 | 2,978 | py | Python | resources/lib/service.py | fatshotty/kodi.simple.vocal.service | a4676b8df403034481c7d02ee927b64e63d0ea42 | [
"Apache-2.0"
] | null | null | null | resources/lib/service.py | fatshotty/kodi.simple.vocal.service | a4676b8df403034481c7d02ee927b64e63d0ea42 | [
"Apache-2.0"
] | null | null | null | resources/lib/service.py | fatshotty/kodi.simple.vocal.service | a4676b8df403034481c7d02ee927b64e63d0ea42 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import xbmcaddon
ADDON = xbmcaddon.Addon()
logger = logging.getLogger(ADDON.getAddonInfo('id'))
| 30.387755 | 157 | 0.658496 | # -*- coding: utf-8 -*-
from resources.lib import kodiutils
from resources.lib import kodilogging
from resources.lib.messenger.socketclient import SockClient as SocketClient
import logging
import time
import xbmc
import xbmcaddon
from resources.lib.actions import execute
ADDON = xbmcaddon.Addon()
logg... | 0 | 0 | 0 | 0 | 0 | 2,448 | 0 | 84 | 290 |
cdf2573b00d17bc3a744d21d10c588b5f6b6c208 | 3,999 | py | Python | player.py | Ming-desu/POKEMING | 2def3b47e7c08b71885f14944bffe105a63cc12a | [
"MIT"
] | null | null | null | player.py | Ming-desu/POKEMING | 2def3b47e7c08b71885f14944bffe105a63cc12a | [
"MIT"
] | null | null | null | player.py | Ming-desu/POKEMING | 2def3b47e7c08b71885f14944bffe105a63cc12a | [
"MIT"
] | null | null | null |
# POKEMING - GON'NA CATCH 'EM ALL
# -- A simple hack 'n slash game in console
# -- This class is handles all player related things
| 41.226804 | 132 | 0.615904 | import random
from inventory import Inventory
from skill import Skill
from utility import Utility
# POKEMING - GON'NA CATCH 'EM ALL
# -- A simple hack 'n slash game in console
# -- This class is handles all player related things
class Player:
# Default Constructor
def __init__(self):
# Publi... | 0 | 0 | 0 | 3,740 | 0 | 0 | 0 | 10 | 114 |
f67bf9264ba8ea478956a636d641726ab2253966 | 1,932 | py | Python | client demo/python/client.py | ConanYu/CrawlService | 35af986f7d7360f2e7a6bdc02c2836e3c7cb4094 | [
"MIT"
] | 1 | 2021-10-19T01:14:19.000Z | 2021-10-19T01:14:19.000Z | client demo/python/client.py | ConanYu/CrawlService | 35af986f7d7360f2e7a6bdc02c2836e3c7cb4094 | [
"MIT"
] | 1 | 2022-03-04T04:17:13.000Z | 2022-03-04T04:17:13.000Z | client demo/python/client.py | ConanYu/CrawlService | 35af986f7d7360f2e7a6bdc02c2836e3c7cb4094 | [
"MIT"
] | 1 | 2021-06-05T09:17:10.000Z | 2021-06-05T09:17:10.000Z | import time
if __name__ == '__main__':
start_new_thread(f, 'codeforces', 'ConanYu')
start_new_thread(f, 'codeforces', 'ConanYu')
start_new_thread(f, 'codeforces', 'ConanYu')
start_new_thread(f, 'codeforces', '????????')
start_new_thread(g, 'vjudge', 'ConanYu')
start_new_thread(f, 'atcoder'... | 30.666667 | 86 | 0.659938 | import time
import grpc
import threading
from crawl_service import crawl_service_pb2
from crawl_service import crawl_service_pb2_grpc
def start_new_thread(func, *args, **kwargs):
class MyThead(threading.Thread):
def __init__(self):
super().__init__()
self.setDaemon(False)
... | 0 | 0 | 0 | 265 | 0 | 906 | 0 | 34 | 180 |
71f51f6bfca2916922e19760b83e5bc05244f4b1 | 465 | py | Python | dftparse/wien2k/scf2_parser.py | CitrineInformatics/dft-parser | 539fbdafe4d6c6c6aa2434fdf93206d012f75dfc | [
"Apache-2.0"
] | 1 | 2021-04-10T13:09:30.000Z | 2021-04-10T13:09:30.000Z | dftparse/wien2k/scf2_parser.py | CitrineInformatics/dft-parser | 539fbdafe4d6c6c6aa2434fdf93206d012f75dfc | [
"Apache-2.0"
] | 1 | 2021-01-16T01:05:30.000Z | 2021-01-16T01:05:30.000Z | dftparse/wien2k/scf2_parser.py | CitrineInformatics/dft-parser | 539fbdafe4d6c6c6aa2434fdf93206d012f75dfc | [
"Apache-2.0"
] | null | null | null |
base_rules = [
(lambda x: ":GAP (global)" in x, _parse_bandgap)
]
| 19.375 | 52 | 0.608602 | from ..core import BlockParser
def _parse_bandgap(line, lines):
bandgap = float(line.split()[6])
return {
'band gap': bandgap,
'band gap units': "eV"
}
base_rules = [
(lambda x: ":GAP (global)" in x, _parse_bandgap)
]
class Scf2Parser(BlockParser):
"""Parser for Wien2k's .scf2 ... | 0 | 0 | 0 | 187 | 0 | 127 | 0 | 9 | 68 |
6956e46dc35096b15353d8f7265d6a463913c523 | 157 | py | Python | pdtimeout/__init__.py | hugo-quantmetry/pandas-timeout | bc7e94afa1e533b7cd1472f455587436fea30855 | [
"Apache-2.0"
] | 2 | 2019-11-11T17:51:59.000Z | 2021-03-26T10:00:43.000Z | pdtimeout/__init__.py | hugo-quantmetry/pandas-timeout | bc7e94afa1e533b7cd1472f455587436fea30855 | [
"Apache-2.0"
] | null | null | null | pdtimeout/__init__.py | hugo-quantmetry/pandas-timeout | bc7e94afa1e533b7cd1472f455587436fea30855 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for pdtimeout."""
__author__ = """Hugo Perrier"""
__email__ = 'hperrier@quantmetry.com'
__version__ = '0.1.0'
| 19.625 | 38 | 0.649682 | # -*- coding: utf-8 -*-
"""Top-level package for pdtimeout."""
__author__ = """Hugo Perrier"""
__email__ = 'hperrier@quantmetry.com'
__version__ = '0.1.0'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2c1c949ef37005780640391e2f7ed9a5ed3c4b38 | 6,015 | py | Python | lib/modules/SQLMapInjector/__init__.py | mukeran/dinlas | bab6149fd69f3c12fd67ad03281b59182054fad6 | [
"MIT"
] | 2 | 2019-11-28T09:59:34.000Z | 2019-12-10T05:29:00.000Z | lib/modules/SQLMapInjector/__init__.py | mukeran/dinlas | bab6149fd69f3c12fd67ad03281b59182054fad6 | [
"MIT"
] | null | null | null | lib/modules/SQLMapInjector/__init__.py | mukeran/dinlas | bab6149fd69f3c12fd67ad03281b59182054fad6 | [
"MIT"
] | null | null | null | # coding:utf-8
DEFAULT_LEVEL = 1
| 38.557692 | 117 | 0.510557 | # coding:utf-8
import time
from urllib import parse
import logging
from .SQLMap import SQLMap, CONTENT_STATUS, CONTENT_TYPE
DEFAULT_LEVEL = 1
class SQLMapInjector:
def __init__(self, results, reports, **kwargs):
report = {'title': 'SQL Injection',
'overview': 'SQL injection vulnerabil... | 0 | 108 | 0 | 5,738 | 0 | 0 | 0 | 21 | 113 |
97f49bfaccfe12bd9aa576beff581a747854924c | 544 | py | Python | 1348A Phoenix and Balance.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | 1 | 2021-01-29T16:30:09.000Z | 2021-01-29T16:30:09.000Z | 1348A Phoenix and Balance.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | null | null | null | 1348A Phoenix and Balance.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | null | null | null | for _ in range(int(input())):
n=int(input())
L=[2**(i+1) for i in range(n)] #I want an extra 1 @l[0] to make it less
w=[0,0]
L=[2**(i+1) for i in range(n)]
L[n//2 -1],L[-1]=L[-1],L[n//2 -1]
for i in range(n):
if i<(n//2):
w[0]+=L[i]
else:
w[1]+=... | 25.904762 | 76 | 0.420956 | for _ in range(int(input())):
n=int(input())
L=[2**(i+1) for i in range(n)] #I want an extra 1 @l[0] to make it less
w=[0,0]
L=[2**(i+1) for i in range(n)]
L[n//2 -1],L[-1]=L[-1],L[n//2 -1]
for i in range(n):
if i<(n//2):
w[0]+=L[i]
else:
w[1]+=... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
17a8f2bfba5059763f22ff7512e75cf2117b306d | 1,176 | py | Python | pushpy_examples/client/web/c_module.py | briangu/push-examples | 3acf00d9f63523010ee3b70f3117d1be686c3335 | [
"MIT"
] | null | null | null | pushpy_examples/client/web/c_module.py | briangu/push-examples | 3acf00d9f63523010ee3b70f3117d1be686c3335 | [
"MIT"
] | null | null | null | pushpy_examples/client/web/c_module.py | briangu/push-examples | 3acf00d9f63523010ee3b70f3117d1be686c3335 | [
"MIT"
] | null | null | null |
from pushpy_examples.client.ex_push_manager import ExamplePushManager
from client.simple_interpreter import Interpreter, Adder, Multiplier
m = ExamplePushManager()
m.connect()
repl_code_store = m.repl_code_store()
repl_code_store.update({
"interpreter.Interpreter": Interpreter,
"interpreter.math.Adder": Add... | 30.153846 | 109 | 0.684524 | import tornado.web
from pushpy_examples.client.ex_push_manager import ExamplePushManager
from client.simple_interpreter import Interpreter, Adder, Multiplier
m = ExamplePushManager()
m.connect()
repl_code_store = m.repl_code_store()
repl_code_store.update({
"interpreter.Interpreter": Interpreter,
"interpret... | 0 | 0 | 0 | 580 | 0 | 0 | 0 | -3 | 44 |
c01980284e1fbdf9e095dced754b4ee3129e556e | 6,427 | py | Python | scheduler-bot.py | alexdiem/odp-scheduler | 440ce83d5b2416722218aff265df1e49aba3a714 | [
"MIT"
] | null | null | null | scheduler-bot.py | alexdiem/odp-scheduler | 440ce83d5b2416722218aff265df1e49aba3a714 | [
"MIT"
] | null | null | null | scheduler-bot.py | alexdiem/odp-scheduler | 440ce83d5b2416722218aff265df1e49aba3a714 | [
"MIT"
] | null | null | null | import json
import logger
import os
from datetime import date
from dotenv import load_dotenv
from sys import exit
from discord.ext import commands
log = logger.setup_applevel_logger(file_name = 'app_debug.log')
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
CHANNEL = os.getenv(... | 27.702586 | 87 | 0.641046 | import json
import logger
import os
import random
from datetime import date
from dotenv import load_dotenv
from sys import exit
import discord
from discord.ext import commands, tasks
from discord.utils import get
log = logger.setup_applevel_logger(file_name = 'app_debug.log')
load_dotenv()
TOKEN = os.getenv('DISC... | 0 | 603 | 3,461 | 0 | 0 | 0 | 0 | 0 | 182 |
6a9980ccddb6716529146982c0896ecad8ea967a | 4,833 | py | Python | aperturedb/ImageDownloader.py | aperture-data/aperturedb-python | 186ae09a474df8e2d90ecdc7ba81e81879cef3ea | [
"Apache-2.0"
] | 1 | 2022-01-12T17:46:20.000Z | 2022-01-12T17:46:20.000Z | aperturedb/ImageDownloader.py | aperture-data/aperturedb-python | 186ae09a474df8e2d90ecdc7ba81e81879cef3ea | [
"Apache-2.0"
] | 11 | 2021-07-14T16:54:05.000Z | 2022-03-30T14:34:34.000Z | aperturedb/ImageDownloader.py | aperture-data/aperturedb-python | 186ae09a474df8e2d90ecdc7ba81e81879cef3ea | [
"Apache-2.0"
] | null | null | null |
HEADER_PATH = "filename"
HEADER_URL = "url"
| 27.617143 | 93 | 0.564039 | import time
import requests
import os
from os import path
import cv2
import numpy as np
from aperturedb import ParallelLoader
from aperturedb import CSVParser
from aperturedb import ProgressBar
HEADER_PATH = "filename"
HEADER_URL = "url"
class ImageDownloaderCSV(CSVParser.CSVParser):
'''
ApertureDB Im... | 0 | 0 | 0 | 4,545 | 0 | 0 | 0 | -4 | 246 |
21747df07c549e19382c22288039d178658f37f2 | 656 | py | Python | artssat/utils/plots.py | simonpf/pARTS | b4d9f4c2ceac594273c5589e44fe6a3a4f8d7028 | [
"MIT"
] | 3 | 2020-09-02T08:20:42.000Z | 2020-12-18T17:19:38.000Z | artssat/utils/plots.py | simonpf/pARTS | b4d9f4c2ceac594273c5589e44fe6a3a4f8d7028 | [
"MIT"
] | null | null | null | artssat/utils/plots.py | simonpf/pARTS | b4d9f4c2ceac594273c5589e44fe6a3a4f8d7028 | [
"MIT"
] | null | null | null | import seaborn as sns
sns.reset_orig()
| 25.230769 | 66 | 0.53811 | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.reset_orig()
def plot_psds(x, y, z, dz = None, chs = 0, ax = None):
if ax is None:
ax = plt.gca()
n = y.shape[1]
pal = sns.cubehelix_palette(n, start = chs)
if dz is None:
dz = np.diff(z).mean() / 8.0
... | 0 | 0 | 0 | 0 | 0 | 543 | 0 | 7 | 67 |
12d931fb7f1b8dc76f52075e42fed7c7e04ddcf6 | 1,601 | py | Python | custom_components/xplora_watch/entity.py | Ludy87/xplora_watch | 85050d1bec061d7e6d11dd63e36fbddb296a0c12 | [
"MIT"
] | 7 | 2022-01-17T10:07:44.000Z | 2022-03-29T17:33:23.000Z | custom_components/xplora_watch/entity.py | Ludy87/xplora_watch | 85050d1bec061d7e6d11dd63e36fbddb296a0c12 | [
"MIT"
] | 17 | 2022-01-14T13:22:06.000Z | 2022-03-31T15:43:23.000Z | custom_components/xplora_watch/entity.py | Ludy87/xplora_watch | 85050d1bec061d7e6d11dd63e36fbddb296a0c12 | [
"MIT"
] | 4 | 2022-01-16T08:46:42.000Z | 2022-02-04T12:29:07.000Z | """Entity Xplora Watch."""
from __future__ import annotations
import logging
_LOGGER = logging.getLogger(__name__)
| 29.648148 | 72 | 0.637726 | """Entity Xplora® Watch."""
from __future__ import annotations
import logging
from datetime import timedelta
from typing import Any, Dict
from homeassistant.components.switch import SwitchEntity
from homeassistant.helpers.restore_state import RestoreEntity
from .helper import XploraUpdateTime
from pyxplora_api imp... | 2 | 387 | 0 | 801 | 0 | 0 | 0 | 135 | 159 |
d4b4eb82d35cd281ad2c2012dc1cb465e3c69183 | 14,389 | py | Python | tests/apptrace/events_test.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 2 | 2017-03-20T07:13:33.000Z | 2017-05-03T03:39:53.000Z | tests/apptrace/events_test.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 12 | 2017-07-10T07:04:06.000Z | 2017-07-26T09:32:54.000Z | tests/apptrace/events_test.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 2 | 2017-05-04T11:25:32.000Z | 2017-07-11T09:10:01.000Z | """
Unit test for Treadmill apptrace events module.
"""
import unittest
if __name__ == '__main__':
unittest.main()
| 28.493069 | 75 | 0.420738 | """
Unit test for Treadmill apptrace events module.
"""
import unittest
import mock
from treadmill.apptrace import events
class AppTraceEventsTest(unittest.TestCase):
"""Test all event classes operations.
"""
@mock.patch('treadmill.apptrace.events.AbortedTraceEvent.from_data',
mock.Moc... | 0 | 2,174 | 0 | 12,017 | 0 | 0 | 0 | 6 | 69 |
8afd7dfb3a0429d776c6f9286411c593352a5aeb | 1,382 | py | Python | texext/tests/test_custom_plotdirective.py | ddeka2910/texext | 2e99f513b188468c9ec356a0ea1fe0622c5caab2 | [
"BSD-2-Clause"
] | 4 | 2015-10-10T05:12:58.000Z | 2020-06-26T11:54:34.000Z | texext/tests/test_custom_plotdirective.py | ddeka2910/texext | 2e99f513b188468c9ec356a0ea1fe0622c5caab2 | [
"BSD-2-Clause"
] | 10 | 2018-04-16T23:06:04.000Z | 2021-02-19T23:53:56.000Z | texext/tests/test_custom_plotdirective.py | ddeka2910/texext | 2e99f513b188468c9ec356a0ea1fe0622c5caab2 | [
"BSD-2-Clause"
] | 5 | 2019-10-23T21:14:31.000Z | 2020-12-11T16:11:16.000Z | """ Tests for plotdirective build using sphinx extensions
Test ability to combine plot_directive with mathcode
"""
from os.path import dirname, join as pjoin
import sphinx
SPHINX_1p8 = sphinx.version_info[:2] >= (1, 8)
PAGES = pjoin(dirname(__file__), 'plotdirective')
| 30.043478 | 74 | 0.692475 | """ Tests for plotdirective build using sphinx extensions
Test ability to combine plot_directive with mathcode
"""
from os.path import dirname, join as pjoin
import re
import sphinx
SPHINX_1p8 = sphinx.version_info[:2] >= (1, 8)
from sphinxtesters import PageBuilder
from texext.tests.test_plotdirective import EXP_... | 0 | 520 | 0 | 453 | 0 | 0 | 0 | 44 | 91 |
8d2a862b1850a0c56f325abe1d1cac2277162762 | 800 | py | Python | src/sprites/grouping.py | mgear2/undervoid | 6c91a5786d29d766223831190952fd90ddc6a1e8 | [
"MIT"
] | 1 | 2020-08-29T06:41:03.000Z | 2020-08-29T06:41:03.000Z | src/sprites/grouping.py | mgear2/undervoid | 6c91a5786d29d766223831190952fd90ddc6a1e8 | [
"MIT"
] | 10 | 2019-07-15T05:15:38.000Z | 2020-11-25T03:14:03.000Z | src/sprites/grouping.py | mgear2/undervoid | 6c91a5786d29d766223831190952fd90ddc6a1e8 | [
"MIT"
] | 1 | 2020-11-22T08:25:26.000Z | 2020-11-22T08:25:26.000Z | # Copyright (c) 2020
# [This program is licensed under the "MIT License"]
# Please see the file LICENSE in the source
# distribution of this software for license terms.
| 33.333333 | 53 | 0.64875 | # Copyright (c) 2020
# [This program is licensed under the "MIT License"]
# Please see the file LICENSE in the source
# distribution of this software for license terms.
import pygame as pg
class Grouping:
def __init__(self):
self.all_sprites = pg.sprite.LayeredUpdates()
self.legs_sprite = pg.spri... | 0 | 0 | 0 | 586 | 0 | 0 | 0 | -2 | 46 |
99b51af7c93df2be5b309b548a2ceb77eedf5aaa | 2,090 | py | Python | aroma/tests/test_features.py | matthewcarlucci/aroma | 51664dcc01caef42124e11bc3c334078fed749a3 | [
"Apache-2.0"
] | 5 | 2021-08-31T17:36:59.000Z | 2021-12-13T04:51:56.000Z | aroma/tests/test_features.py | matthewcarlucci/aroma | 51664dcc01caef42124e11bc3c334078fed749a3 | [
"Apache-2.0"
] | 33 | 2020-11-10T15:50:41.000Z | 2021-01-15T17:10:46.000Z | aroma/tests/test_features.py | matthewcarlucci/aroma | 51664dcc01caef42124e11bc3c334078fed749a3 | [
"Apache-2.0"
] | 6 | 2021-02-09T22:39:43.000Z | 2021-12-08T15:13:17.000Z | """Tests for the features module."""
import numpy as np
from aroma import features
def test_feature_time_series(mel_mix, mc, max_correls):
"""Test the feature_time_series feature against pre-calculated values."""
np.random.seed(1)
# Read mel_mix
mel_mix = np.loadtxt(mel_mix)
# Run feature_time_s... | 27.866667 | 88 | 0.709569 | """Tests for the features module."""
import numpy as np
from aroma import features
def test_feature_time_series(mel_mix, mc, max_correls):
"""Test the feature_time_series feature against pre-calculated values."""
np.random.seed(1)
# Read mel_mix
mel_mix = np.loadtxt(mel_mix)
# Run feature_time_s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9501241ca2ec8a93143bf2872026829d759bcb38 | 4,938 | py | Python | static/jmeter/libs/zpjUtils.py | huqiliang/yapi | 775205457c5ef92531f3b3fd7480ad62a1746f52 | [
"Apache-2.0"
] | null | null | null | static/jmeter/libs/zpjUtils.py | huqiliang/yapi | 775205457c5ef92531f3b3fd7480ad62a1746f52 | [
"Apache-2.0"
] | null | null | null | static/jmeter/libs/zpjUtils.py | huqiliang/yapi | 775205457c5ef92531f3b3fd7480ad62a1746f52 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
| 33.821918 | 133 | 0.518631 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import logging
import datetime
import smtplib
import os
import subprocess
class ZpjUtils(object):
'''
一个工具类
'''
def __init__(self):
'''
Constructor
'''
begin_work_time = datetime.datetime.now()
smtp = None
... | 414 | 0 | 0 | 4,648 | 0 | 0 | 0 | -36 | 142 |
04223732d716dc0152494f443b0133702feca9d3 | 1,133 | py | Python | scriptable/ast/expression/concat_expression.py | c7nw3r/scriptable | b285d865da41774c8321ebf51f5a468ef1c92402 | [
"Apache-2.0"
] | null | null | null | scriptable/ast/expression/concat_expression.py | c7nw3r/scriptable | b285d865da41774c8321ebf51f5a468ef1c92402 | [
"Apache-2.0"
] | null | null | null | scriptable/ast/expression/concat_expression.py | c7nw3r/scriptable | b285d865da41774c8321ebf51f5a468ef1c92402 | [
"Apache-2.0"
] | null | null | null | from typing import Union
DataType = Union[int, float]
| 29.815789 | 86 | 0.630185 | from typing import Union, List
from scriptable.api import AST
from scriptable.api.ast_binding import ASTBinding
DataType = Union[int, float]
class ConcatExpression(AST[str]):
def __init__(self, branch: List[AST]):
self.operand_stack = [branch[x] for x in range(0, len(branch), 2)]
self.operator_s... | 0 | 66 | 0 | 900 | 0 | 0 | 0 | 43 | 68 |
f3e306054f7264645b0dd28832dc9b6f41c24dd9 | 1,604 | py | Python | goal_tracker/__init__.py | kaloyan-marinov/goal-tracker | 91dbdfab44912c3690f71d0fac197864c56bcce2 | [
"MIT"
] | null | null | null | goal_tracker/__init__.py | kaloyan-marinov/goal-tracker | 91dbdfab44912c3690f71d0fac197864c56bcce2 | [
"MIT"
] | null | null | null | goal_tracker/__init__.py | kaloyan-marinov/goal-tracker | 91dbdfab44912c3690f71d0fac197864c56bcce2 | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
# Create instances of necessary Flask extensions.
db = SQLAlchemy()
migrate = Migrate()
# Import the models so that they are registered with SQLAlchemy.
| 30.846154 | 93 | 0.743142 | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from config import config
# Create instances of necessary Flask extensions.
db = SQLAlchemy()
migrate = Migrate()
# Import the models s... | 0 | 0 | 0 | 0 | 0 | 1,184 | 0 | 53 | 135 |
a5eee884f0ad6b513aab63d677e2f3fb20324a62 | 3,576 | py | Python | testing/components/functions/function_evaluation_test.py | JeremiasKnoblauch/MXFusion | af6223e9636b055d029d136dd7ae023b210b4560 | [
"Apache-2.0"
] | 2 | 2019-05-31T09:50:47.000Z | 2021-03-06T09:38:47.000Z | testing/components/functions/function_evaluation_test.py | JeremiasKnoblauch/MXFusion | af6223e9636b055d029d136dd7ae023b210b4560 | [
"Apache-2.0"
] | null | null | null | testing/components/functions/function_evaluation_test.py | JeremiasKnoblauch/MXFusion | af6223e9636b055d029d136dd7ae023b210b4560 | [
"Apache-2.0"
] | 1 | 2019-05-30T09:39:46.000Z | 2019-05-30T09:39:46.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in th... | 44.148148 | 99 | 0.590884 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in th... | 0 | 2,727 | 0 | 0 | 0 | 0 | 0 | 63 | 112 |
a2817df3a138e0f2a7e0d54aff30a42f28c91d0a | 42,649 | py | Python | synthetic-data-generator/hello/data_generator.py | skyu0221/660-iot | d31f973c93871bfa8122f1b83364d0147d402e9e | [
"Apache-2.0"
] | null | null | null | synthetic-data-generator/hello/data_generator.py | skyu0221/660-iot | d31f973c93871bfa8122f1b83364d0147d402e9e | [
"Apache-2.0"
] | 8 | 2021-03-19T01:36:06.000Z | 2022-03-12T00:22:43.000Z | synthetic-data-generator/hello/data_generator.py | skyu0221/660-iot | d31f973c93871bfa8122f1b83364d0147d402e9e | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
import json
start_work = 9 * 60 * 60 # Work start from 9:00. unit: second
end_work = 17 * 60 * 60 # Work end at 17:00. unit: second
daily_report = 16 * 60 * 60 # Daily progress report at 16:00, in meeting room
daily_report_mean = 15 * 60 # Daily progress report average leng... | 58.184175 | 137 | 0.445778 | import numpy as np
from datetime import datetime, timedelta
import json
import os
start_work = 9 * 60 * 60 # Work start from 9:00. unit: second
end_work = 17 * 60 * 60 # Work end at 17:00. unit: second
daily_report = 16 * 60 * 60 # Daily progress report at 16:00, in meeting room
daily_report_mean = 15 * 60 # Daily... | 0 | 0 | 0 | 33,223 | 0 | 3,366 | 0 | -15 | 228 |
51925404b642feba98f6462a0b576d07f825f428 | 5,994 | py | Python | analysis/evalHyperWords.py | tlranda/FULL-W2V | 66189559387ec1d94e1f489942159874785c4c05 | [
"Apache-2.0"
] | null | null | null | analysis/evalHyperWords.py | tlranda/FULL-W2V | 66189559387ec1d94e1f489942159874785c4c05 | [
"Apache-2.0"
] | null | null | null | analysis/evalHyperWords.py | tlranda/FULL-W2V | 66189559387ec1d94e1f489942159874785c4c05 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from os import path
import subprocess, argparse
parser = argparse.ArgumentParser(description='Automates the process of evaluating a word embedding.')
parser.add_argument('file', type=str, help='Word embedding file.')
parser.add_argument('-skip-regen', '--skip-regen', action='store_false', help=... | 47.19685 | 184 | 0.702703 | #!/usr/bin/env python3
from os import path
import sys, subprocess, argparse
parser = argparse.ArgumentParser(description='Automates the process of evaluating a word embedding.')
parser.add_argument('file', type=str, help='Word embedding file.')
parser.add_argument('-skip-regen', '--skip-regen', action='store_false', ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 |
d097bc591f4b95b5d080c39a0bdd791b5d42748d | 6,713 | py | Python | module1-introduction-to-sql/rpg_queries1.py | bs3537/DS-Unit-3-Sprint-2-SQL-and-Databases | 7020d2a957bf7fcb150228ce9926dc9d59e252f0 | [
"MIT"
] | null | null | null | module1-introduction-to-sql/rpg_queries1.py | bs3537/DS-Unit-3-Sprint-2-SQL-and-Databases | 7020d2a957bf7fcb150228ce9926dc9d59e252f0 | [
"MIT"
] | null | null | null | module1-introduction-to-sql/rpg_queries1.py | bs3537/DS-Unit-3-Sprint-2-SQL-and-Databases | 7020d2a957bf7fcb150228ce9926dc9d59e252f0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""rpg_queries.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ufwd5h-epfNkHGiNJTkFTDQsbupk24Ld
"""
#How many total characters are there?
import sqlite3
conn = sqlite3.connect('rpg_db.sqlite3')
curs = conn.cursor()
#How... | 34.425641 | 90 | 0.768807 | # -*- coding: utf-8 -*-
"""rpg_queries.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ufwd5h-epfNkHGiNJTkFTDQsbupk24Ld
"""
#How many total characters are there?
import sqlite3
conn = sqlite3.connect('rpg_db.sqlite3')
curs = conn.cursor()
#How... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7fefb6f60e2cc185f3cede33e1e7a8d888d88ccb | 6,011 | py | Python | pmdarima/arima/approx.py | Juanlu001/pmdarima | e504247e9a8900e848e7cbf38ef67d179881a644 | [
"MIT"
] | null | null | null | pmdarima/arima/approx.py | Juanlu001/pmdarima | e504247e9a8900e848e7cbf38ef67d179881a644 | [
"MIT"
] | null | null | null | pmdarima/arima/approx.py | Juanlu001/pmdarima | e504247e9a8900e848e7cbf38ef67d179881a644 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Author: Taylor Smith <taylor.smith@alkaline-ml.com>
#
# R approx function
from __future__ import absolute_import
from sklearn.utils.validation import check_array, column_or_1d
import numpy as np
from ..utils.array import c
from ..utils import get_callable
from ..compat.numpy import DTYPE
... | 32.317204 | 79 | 0.618865 | # -*- coding: utf-8 -*-
#
# Author: Taylor Smith <taylor.smith@alkaline-ml.com>
#
# R approx function
from __future__ import absolute_import
from sklearn.utils.validation import check_array, column_or_1d
import numpy as np
from ..utils.array import c
from ..utils import get_callable
from ..compat.numpy import DTYPE
... | 0 | 0 | 0 | 0 | 0 | 109 | 0 | 0 | 34 |
2c7fe0e587563e12e640e93436de71b423c3ba01 | 337 | py | Python | model/model.py | madtyn/mvcPython | 7377bc5e4eec058ff098b850159971f4830c0488 | [
"MIT"
] | null | null | null | model/model.py | madtyn/mvcPython | 7377bc5e4eec058ff098b850159971f4830c0488 | [
"MIT"
] | null | null | null | model/model.py | madtyn/mvcPython | 7377bc5e4eec058ff098b850159971f4830c0488 | [
"MIT"
] | null | null | null | from pathlib import Path
if __name__ == '__main__':
m = Model()
test_path = Path.home().resolve()
m.collect_metrics(str(test_path), [str(Path('.').resolve())], 'test.json')
| 22.466667 | 78 | 0.655786 | from pathlib import Path
from common.observer import Observable
class Model(Observable):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if __name__ == '__main__':
m = Model()
test_path = Path.home().resolve()
m.collect_metrics(str(test_path), [str(Path('.').resolve()... | 0 | 0 | 0 | 86 | 0 | 0 | 0 | 17 | 46 |
497b14452dfa29906a0b0faa661efbca15094cbc | 859 | py | Python | {{cookiecutter.service_name}}/{{cookiecutter.service_slug}}/schemas.py | zeel-dev/zebuker-cookiecutter | 31d25321b6dca8e3207f60da907e5a7996860308 | [
"BSD-2-Clause"
] | null | null | null | {{cookiecutter.service_name}}/{{cookiecutter.service_slug}}/schemas.py | zeel-dev/zebuker-cookiecutter | 31d25321b6dca8e3207f60da907e5a7996860308 | [
"BSD-2-Clause"
] | null | null | null | {{cookiecutter.service_name}}/{{cookiecutter.service_slug}}/schemas.py | zeel-dev/zebuker-cookiecutter | 31d25321b6dca8e3207f60da907e5a7996860308 | [
"BSD-2-Clause"
] | null | null | null | """Schemas linked to the database models"""
| 30.678571 | 79 | 0.575087 | """Schemas linked to the database models"""
import re
from marshmallow import post_dump
from marshmallow_sqlalchemy import ModelSchema
class BaseSchema(ModelSchema):
"""
Custom base schema class that serializes datetime strings without the
timezone offset.
"""
def __init__(self, strict=True, **kw... | 0 | 440 | 0 | 261 | 0 | 0 | 0 | 25 | 89 |
69957d6ab0eb1f7ead9b6b0190af524dec2bfe3a | 53 | py | Python | data/__init__.py | SparkJiao/pytorch-transformers-template | c64d55f346534b204ac35e814db03221a0856d84 | [
"MIT"
] | 1 | 2022-03-04T08:27:52.000Z | 2022-03-04T08:27:52.000Z | data/__init__.py | SparkJiao/pytorch-transformers-template | c64d55f346534b204ac35e814db03221a0856d84 | [
"MIT"
] | null | null | null | data/__init__.py | SparkJiao/pytorch-transformers-template | c64d55f346534b204ac35e814db03221a0856d84 | [
"MIT"
] | null | null | null | """
Write your own datasets under this directory.
""" | 17.666667 | 45 | 0.716981 | """
Write your own datasets under this directory.
""" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
03ff9706fddfab3e358c77794e9b1dc5caf1ec05 | 9,470 | py | Python | python/mpopt/qap/solver.py | vislearn/libmpopt | 11c9e99bedc7fb5dd2e11bff69c60d4ce974f525 | [
"MIT"
] | 1 | 2021-03-23T06:45:42.000Z | 2021-03-23T06:45:42.000Z | python/mpopt/qap/solver.py | vislearn/libmpopt | 11c9e99bedc7fb5dd2e11bff69c60d4ce974f525 | [
"MIT"
] | 1 | 2022-01-18T03:17:09.000Z | 2022-01-18T03:17:09.000Z | python/mpopt/qap/solver.py | vislearn/libmpopt | 11c9e99bedc7fb5dd2e11bff69c60d4ce974f525 | [
"MIT"
] | 2 | 2021-03-03T14:01:52.000Z | 2022-01-18T02:45:55.000Z | from . primals import Primals
DEFAULT_GREEDY_GENERATIONS = 10
INFINITY_COST = 1e99
| 41.902655 | 139 | 0.67434 | from ..common.solver import BaseSolver, DEFAULT_BATCH_SIZE, DEFAULT_MAX_BATCHES
from . import libmpopt_qap as lib
from . primals import Primals
import numpy
DEFAULT_GREEDY_GENERATIONS = 10
INFINITY_COST = 1e99
class ModelDecomposition:
def __init__(self, model, with_uniqueness, unary_side='left'):
"""... | 0 | 1,125 | 0 | 5,245 | 0 | 2,743 | 0 | 61 | 205 |
212c2bff91064b6f0d6c65cfcbed0e0e93656577 | 2,016 | py | Python | homeassistant/util/async_.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | homeassistant/util/async_.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 9 | 2022-01-27T06:32:10.000Z | 2022-03-31T07:07:51.000Z | homeassistant/util/async_.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 10 | 2018-01-01T00:12:51.000Z | 2021-12-21T23:08:05.000Z | """Asyncio backports for Python 3.6 compatibility."""
from asyncio import coroutines, ensure_future
from asyncio.events import AbstractEventLoop
import concurrent.futures
import logging
import threading
from typing import Any, Callable, Coroutine
_LOGGER = logging.getLogger(__name__)
def fire_coroutine_threadsafe(co... | 34.758621 | 80 | 0.699405 | """Asyncio backports for Python 3.6 compatibility."""
from asyncio import coroutines, ensure_future
from asyncio.events import AbstractEventLoop
import concurrent.futures
import logging
import threading
from typing import Any, Callable, Coroutine
_LOGGER = logging.getLogger(__name__)
def fire_coroutine_threadsafe(co... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e1dd7ede6c94f72ccac6e9c9d45c7d3d3ef460e1 | 376 | py | Python | tests/test_hangman.py | daryavasilyeva/hangman | d0f1eaca4764c70ee9f5977bc4bdeca3c0ed67c2 | [
"MIT"
] | null | null | null | tests/test_hangman.py | daryavasilyeva/hangman | d0f1eaca4764c70ee9f5977bc4bdeca3c0ed67c2 | [
"MIT"
] | null | null | null | tests/test_hangman.py | daryavasilyeva/hangman | d0f1eaca4764c70ee9f5977bc4bdeca3c0ed67c2 | [
"MIT"
] | null | null | null | """Tests"""
from hangman import check_letter, reveal_letter, print_result
def test_check_letter():
"""check_letter"""
assert check_letter("world", "a") == 0
def test_reveal_letter():
"""reveal_letter"""
assert reveal_letter("te", ['*', 'e'], "t") == ['t', 'e']
def test_print_result():
"""test ... | 20.888889 | 61 | 0.62234 | """Tests"""
from hangman import check_letter, reveal_letter, print_result
def test_check_letter():
"""check_letter"""
assert check_letter("world", "a") == 0
def test_reveal_letter():
"""reveal_letter"""
assert reveal_letter("te", ['*', 'e'], "t") == ['t', 'e']
def test_print_result():
"""test ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2498fa119bb7a0d039236056c6f620bb91e0ce55 | 6,570 | py | Python | code/deepdetect/py/train_hard_negative.py | omidroshani/DeepDIA | 2af96056a62a49ff6ff10b6e176f0fba3f495843 | [
"BSD-3-Clause"
] | 25 | 2020-01-09T18:30:57.000Z | 2021-12-25T20:09:40.000Z | code/deepdetect/py/train_hard_negative.py | omidroshani/DeepDIA | 2af96056a62a49ff6ff10b6e176f0fba3f495843 | [
"BSD-3-Clause"
] | 2 | 2020-10-19T14:28:41.000Z | 2021-11-15T18:46:15.000Z | code/deepdetect/py/train_hard_negative.py | omidroshani/DeepDIA | 2af96056a62a49ff6ff10b6e176f0fba3f495843 | [
"BSD-3-Clause"
] | 14 | 2020-01-24T14:44:46.000Z | 2022-02-24T12:37:33.000Z | # coding: utf-8
from __future__ import print_function
import numpy as np
import pandas as pd
import os
import re
from pep_detectability import PeptideDetectabilityTrainer
working_dir = '.'
filenames_positive = [
f for f in os.listdir(working_dir)
if f.endswith(".detectability.csv") and \
... | 34.397906 | 96 | 0.624201 | # coding: utf-8
from __future__ import print_function
import numpy as np
import pandas as pd
import os
import json
import re
from pep_detectability import PeptideDetectabilityTrainer
from pep_detectability import PeptideDetectabilityPredictor
def load_data(file):
with open(file, 'r') as f:
data = pd.read... | 0 | 0 | 0 | 0 | 0 | 2,410 | 0 | 28 | 159 |
9e0c31f3ec48056ceb415af9faf04e77f34f0cd0 | 48 | py | Python | tests/data_loader/__init__.py | usert5432/lstm_ee | 342ed4f5245311924d6a06b38c4f28eac77778e9 | [
"MIT"
] | 3 | 2020-06-04T17:00:26.000Z | 2022-02-22T16:56:09.000Z | tests/data_loader/__init__.py | usert5432/lstm_ee | 342ed4f5245311924d6a06b38c4f28eac77778e9 | [
"MIT"
] | null | null | null | tests/data_loader/__init__.py | usert5432/lstm_ee | 342ed4f5245311924d6a06b38c4f28eac77778e9 | [
"MIT"
] | 1 | 2021-01-17T04:19:41.000Z | 2021-01-17T04:19:41.000Z | """Various `lstm_ee.data.data_loader` tests"""
| 16 | 46 | 0.708333 | """Various `lstm_ee.data.data_loader` tests"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d203c9d71c48c60eb3ec646a3694c4aec573963 | 1,218 | py | Python | companies/migrations/0004_companynamechange.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | 1 | 2015-09-28T17:11:12.000Z | 2015-09-28T17:11:12.000Z | companies/migrations/0004_companynamechange.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | 4 | 2020-02-11T22:59:54.000Z | 2021-06-10T17:55:15.000Z | companies/migrations/0004_companynamechange.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 36.909091 | 146 | 0.559934 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('companies', '0003_auto_20150526_1255'),
]
operations = [
migrations.CreateModel(
name='CompanyNameChange',
... | 0 | 0 | 0 | 1,088 | 0 | 0 | 0 | 19 | 46 |
29fa2e9e8a9f4bead992c5e3ca0253fe77c94c60 | 566 | py | Python | python/0104.py | garywei944/LeetCode | 77453b6e3329f3309ad61fe578cb7b608317ba1b | [
"MIT"
] | null | null | null | python/0104.py | garywei944/LeetCode | 77453b6e3329f3309ad61fe578cb7b608317ba1b | [
"MIT"
] | null | null | null | python/0104.py | garywei944/LeetCode | 77453b6e3329f3309ad61fe578cb7b608317ba1b | [
"MIT"
] | null | null | null | from leetcode_tester import Tester
from src.binary_tree import TreeNode, null
if __name__ == '__main__':
solution = Solution()
test = Tester(solution.maxDepth)
test.addTest(
TreeNode.from_list([3, 9, 20, null, null, 15, 7]), 3
)
test.addTest(
TreeNode.from_list([1, null, 2]), 2
... | 22.64 | 67 | 0.628975 | from leetcode_tester import Tester
from src.binary_tree import TreeNode, null
from typing import Optional, List
class Solution:
def maxDepth(self, root: Optional[TreeNode]) -> int:
if root is None:
return 0
return max(map(self.maxDepth, (root.left, root.right))) + 1
if __name__ == '... | 0 | 0 | 0 | 165 | 0 | 0 | 0 | 12 | 46 |
6c023fb1f27e6d7a5b2543f14e1f14e2952ae907 | 34,866 | py | Python | src/CKANData.py | bdolor/bcdc2bcdc | 7802e75d6595f89a80765b331b06f59122e5a866 | [
"Apache-2.0"
] | null | null | null | src/CKANData.py | bdolor/bcdc2bcdc | 7802e75d6595f89a80765b331b06f59122e5a866 | [
"Apache-2.0"
] | null | null | null | src/CKANData.py | bdolor/bcdc2bcdc | 7802e75d6595f89a80765b331b06f59122e5a866 | [
"Apache-2.0"
] | null | null | null | """CKAN module is a wrapper around API calls. All of these methods will return
raw json objects. The JSON that is returned can be used to construct CKANData
objects.
CKANData objects can be compared with one another. They will use the
CKANTransform methods to identify fields that should and should not be
used to co... | 41.507143 | 117 | 0.64246 | """CKAN module is a wrapper around API calls. All of these methods will return
raw json objects. The JSON that is returned can be used to construct CKANData
objects.
CKANData objects can be compared with one another. They will use the
CKANTransform methods to identify fields that should and should not be
used to co... | 0 | 0 | 0 | 32,884 | 0 | 0 | 0 | -20 | 364 |
3b63cd4e1e16948b5cafa357994d2747e7cf0d6c | 2,458 | py | Python | packages/mccomponents/python/mccomponents/sample/phonon/obsolete/register_LinearlyInterpolatedDOS.py | mcvine/mcvine | 42232534b0c6af729628009bed165cd7d833789d | [
"BSD-3-Clause"
] | 5 | 2017-01-16T03:59:47.000Z | 2020-06-23T02:54:19.000Z | packages/mccomponents/python/mccomponents/sample/phonon/obsolete/register_LinearlyInterpolatedDOS.py | mcvine/mcvine | 42232534b0c6af729628009bed165cd7d833789d | [
"BSD-3-Clause"
] | 293 | 2015-10-29T17:45:52.000Z | 2022-01-07T16:31:09.000Z | packages/mccomponents/python/mccomponents/sample/phonon/obsolete/register_LinearlyInterpolatedDOS.py | mcvine/mcvine | 42232534b0c6af729628009bed165cd7d833789d | [
"BSD-3-Clause"
] | 1 | 2019-05-25T00:53:31.000Z | 2019-05-25T00:53:31.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2007 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 26.430108 | 81 | 0.616355 | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2007 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 0 | 0 | 0 | 258 | 0 | 792 | 0 | 22 | 88 |
7fccc3ed20ff70caf1f3b1b885d87d0a061db7f8 | 549 | py | Python | python/stringio_user.py | seckcoder/lang-learn | 1e0d6f412bbd7f89b1af00293fd907ddb3c1b571 | [
"Unlicense"
] | 1 | 2017-10-14T04:23:45.000Z | 2017-10-14T04:23:45.000Z | python/stringio_user.py | seckcoder/lang-learn | 1e0d6f412bbd7f89b1af00293fd907ddb3c1b571 | [
"Unlicense"
] | null | null | null | python/stringio_user.py | seckcoder/lang-learn | 1e0d6f412bbd7f89b1af00293fd907ddb3c1b571 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
#-*- coding=utf-8 -*-
#
# Copyright 2012 Jike Inc. All Rights Reserved.
# Author: liwei@jike.com
from StringIO import StringIO
file = '/etc/passwd'
lines = open(file, 'r').readlines()
text = open(file, 'r').read()
f = StringIO()
for line in lines[:-2]:
f.writelines(line)
f.writelines(lines[-2... | 21.96 | 47 | 0.655738 | #!/usr/bin/env python
#-*- coding=utf-8 -*-
#
# Copyright 2012 Jike Inc. All Rights Reserved.
# Author: liwei@jike.com
from StringIO import StringIO
file = '/etc/passwd'
lines = open(file, 'r').readlines()
text = open(file, 'r').read()
f = StringIO()
for line in lines[:-2]:
f.writelines(line)
f.writelines(lines[-2... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
17ca753f935c10af5ae4ce9a89cd6e2d15fc1486 | 441 | py | Python | stockserver.py | cnu/zeromq-talk | b090ed8be7e7ea6a1c71664e052e2ba91587f9ef | [
"MIT"
] | 2 | 2016-02-09T17:41:55.000Z | 2020-11-02T15:37:01.000Z | stockserver.py | cnu/zeromq-talk | b090ed8be7e7ea6a1c71664e052e2ba91587f9ef | [
"MIT"
] | null | null | null | stockserver.py | cnu/zeromq-talk | b090ed8be7e7ea6a1c71664e052e2ba91587f9ef | [
"MIT"
] | null | null | null | #
# Stock Ticker server
# Binds PUB socket to tcp://*:5556
# Publishes random stock updates
#
import zmq
import time
import random
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind("tcp://*:5556")
scrips = ['AAPL', 'GOOG', 'MSFT', 'AMZN']
while True:
scrip = random.choice(scrips)
pri... | 19.173913 | 41 | 0.641723 | #
# Stock Ticker server
# Binds PUB socket to tcp://*:5556
# Publishes random stock updates
#
import zmq
import time
import random
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind("tcp://*:5556")
scrips = ['AAPL', 'GOOG', 'MSFT', 'AMZN']
while True:
scrip = random.choice(scrips)
pri... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4251f1c6adc55b7041994a2cbbc15c3c8fc6f74d | 22,510 | py | Python | wampnado/messages.py | rexlunae/tornwamp | 881538c6ae7909e06a15a838a0d84ebb94a2aed2 | [
"Apache-2.0"
] | null | null | null | wampnado/messages.py | rexlunae/tornwamp | 881538c6ae7909e06a15a838a0d84ebb94a2aed2 | [
"Apache-2.0"
] | null | null | null | wampnado/messages.py | rexlunae/tornwamp | 881538c6ae7909e06a15a838a0d84ebb94a2aed2 | [
"Apache-2.0"
] | null | null | null | """
WAMP messages definitions and serializers.
Compatible with WAMP Document Revision: RC3, 2014/08/25, available at:
https://github.com/tavendo/WAMP/blob/master/spec/basic.md
"""
import uuid
from enum import Enum
from base64 import b64encode, standard_b64decode
PUBLISHER_NODE_ID = uuid.uuid4()
def decode_b64(s):
... | 33.447251 | 143 | 0.649445 | """
WAMP messages definitions and serializers.
Compatible with WAMP Document Revision: RC3, 2014/08/25, available at:
https://github.com/tavendo/WAMP/blob/master/spec/basic.md
"""
import json
import msgpack
import uuid
from copy import deepcopy
from enum import IntEnum, Enum
from io import BytesIO
from base64 import ... | 0 | 3,036 | 0 | 15,601 | 0 | 0 | 0 | 57 | 639 |