hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | 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.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b6564c976990b7fa6fc560e5b2308ec16d5f0a89 | 492 | py | Python | ABC/210/c.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/210/c.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/210/c.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | from collections import defaultdict
if __name__ == '__main__':
main()
| 18.923077 | 37 | 0.497967 | from collections import defaultdict
def main():
# input
N, K = map(int, input().split())
cs = [*map(int, input().split())]
# compute
ddict = defaultdict(int)
for i in range(K):
ddict[cs[i]] += 1
ans = len(ddict)
for i in range(N-K):
ddict[cs[i]] -= 1
if ddict[cs... | 393 | 0 | 23 |
da6567f46ca5114b211c9251f1de332e436be104 | 1,892 | py | Python | code/model/intent_classification/intent_classifier_inference.py | vipulraheja/IteraTeR | 80c1939969de909c39e41e16b8866355c038b6d2 | [
"Apache-2.0"
] | 11 | 2022-03-23T21:41:54.000Z | 2022-03-26T13:41:01.000Z | code/model/intent_classification/intent_classifier_inference.py | vipulraheja/IteraTeR | 80c1939969de909c39e41e16b8866355c038b6d2 | [
"Apache-2.0"
] | null | null | null | code/model/intent_classification/intent_classifier_inference.py | vipulraheja/IteraTeR | 80c1939969de909c39e41e16b8866355c038b6d2 | [
"Apache-2.0"
] | 1 | 2022-03-24T15:55:16.000Z | 2022-03-24T15:55:16.000Z | import json
import torch
import argparse
import numpy as np
from transformers.modeling_outputs import SequenceClassifierOutput
from transformers import Trainer, TrainingArguments, RobertaTokenizer, RobertaModel, RobertaConfig, RobertaForSequenceClassification
if __name__ == '__main__':
parser = argparse.ArgumentPa... | 35.037037 | 132 | 0.691332 | import json
import torch
import argparse
import numpy as np
from transformers.modeling_outputs import SequenceClassifierOutput
from transformers import Trainer, TrainingArguments, RobertaTokenizer, RobertaModel, RobertaConfig, RobertaForSequenceClassification
def main(args):
checkpoint = args.checkpoint
model_... | 1,370 | 0 | 23 |
740141a9f07306e45b5ebf41d61bb31b1b134c05 | 2,035 | py | Python | Forms/mengban_seed.py | UlordChain/uwallet-client | c41f89f34dd17699cb4b285dbba9053f28be5603 | [
"MIT"
] | 19 | 2018-08-21T06:25:30.000Z | 2018-08-21T12:34:14.000Z | Forms/mengban_seed.py | UlordChain/uwallet-client | c41f89f34dd17699cb4b285dbba9053f28be5603 | [
"MIT"
] | 1 | 2018-06-01T09:14:36.000Z | 2018-06-01T09:20:49.000Z | Forms/mengban_seed.py | UlordChain/uwallet-client | c41f89f34dd17699cb4b285dbba9053f28be5603 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2017/12/18
# @Author : Shu
# @Email : httpservlet@yeah.net
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from FormUI.ui_getseed import Ui_getseedWD
| 40.7 | 89 | 0.584767 | # -*- coding: utf-8 -*-
# @Time : 2017/12/18
# @Author : Shu
# @Email : httpservlet@yeah.net
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from FormUI.ui_getseed import Ui_getseedWD
class SeedWidget(QWidget, Ui_getseedWD):
def __init__(self, parent=None):
super(SeedWidget, self).__init__(par... | 637 | 1,197 | 23 |
f52c7e893c3ecdab0771489d791ee3bc29fa08c0 | 325 | py | Python | test/test_json_equal.py | dakotahawkins/MCSchematicIntersection | a5bc130c9f887ca6a253c0a6508fcbca5f164df5 | [
"MIT"
] | null | null | null | test/test_json_equal.py | dakotahawkins/MCSchematicIntersection | a5bc130c9f887ca6a253c0a6508fcbca5f164df5 | [
"MIT"
] | null | null | null | test/test_json_equal.py | dakotahawkins/MCSchematicIntersection | a5bc130c9f887ca6a253c0a6508fcbca5f164df5 | [
"MIT"
] | null | null | null | """Tests two schematic json files to ensure they're equal
"""
import json
import sys
INPUT_A: str = sys.argv[1]
INPUT_B: str = sys.argv[2]
with open(INPUT_A, 'r') as infile_a:
with open(INPUT_B, 'r') as infile_b:
if json.load(infile_a)['nbt'] != json.load(infile_b)['nbt']:
sys.exit(1)
sys.exi... | 21.666667 | 68 | 0.64 | """Tests two schematic json files to ensure they're equal
"""
import json
import sys
INPUT_A: str = sys.argv[1]
INPUT_B: str = sys.argv[2]
with open(INPUT_A, 'r') as infile_a:
with open(INPUT_B, 'r') as infile_b:
if json.load(infile_a)['nbt'] != json.load(infile_b)['nbt']:
sys.exit(1)
sys.exi... | 0 | 0 | 0 |
ae2007157bf4f09f792df527fa386d5e97a2fa2a | 54 | py | Python | kenning/resources/reports/__init__.py | antmicro/edge-ai-tester | 6b145145ed1cec206ae0229c846fb33d272f3ffa | [
"Apache-2.0"
] | 20 | 2021-06-24T13:37:21.000Z | 2022-03-25T10:50:26.000Z | kenning/resources/reports/__init__.py | antmicro/edge-ai-tester | 6b145145ed1cec206ae0229c846fb33d272f3ffa | [
"Apache-2.0"
] | null | null | null | kenning/resources/reports/__init__.py | antmicro/edge-ai-tester | 6b145145ed1cec206ae0229c846fb33d272f3ffa | [
"Apache-2.0"
] | 1 | 2021-11-09T17:23:04.000Z | 2021-11-09T17:23:04.000Z | """
Contains the templates for benchmark reports.
"""
| 13.5 | 45 | 0.722222 | """
Contains the templates for benchmark reports.
"""
| 0 | 0 | 0 |
8150d7ae07dca58de8cc781d35d56112a702254d | 20,928 | py | Python | tests/stockfish/test_models.py | guidopetri/stockfish | 8140df45cbec9a2bce41d2f71c1b7b2c9c7036a2 | [
"MIT"
] | null | null | null | tests/stockfish/test_models.py | guidopetri/stockfish | 8140df45cbec9a2bce41d2f71c1b7b2c9c7036a2 | [
"MIT"
] | null | null | null | tests/stockfish/test_models.py | guidopetri/stockfish | 8140df45cbec9a2bce41d2f71c1b7b2c9c7036a2 | [
"MIT"
] | null | null | null | import pytest
from timeit import default_timer
from stockfish import Stockfish
| 39.711575 | 113 | 0.565845 | import pytest
from timeit import default_timer
from stockfish import Stockfish
class TestStockfish:
@pytest.fixture
def stockfish(self):
return Stockfish()
def test_get_best_move_first_move(self, stockfish):
best_move = stockfish.get_best_move()
assert best_move in (
... | 17,526 | 3,298 | 23 |
ae71a18b83fe0ab9540c787415a3e73b56ccb447 | 1,884 | py | Python | fs.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | fs.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | fs.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import click
from fstmt import TableAdaptorFactory, DashboardFactory, table
@click.group()
@cli.command()
@click.argument('target')
@click.argument('market')
@click.argument('symbol')
@click.option('--year', type=int)
@click.option('--quarter', type=int, default=4)
@click.option('--... | 28.984615 | 75 | 0.685775 | # -*- coding: utf-8 -*-
import os
import click
from fstmt import TableAdaptorFactory, DashboardFactory, table
def get_data_dir():
return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
def get_database_path():
return os.path.join(get_data_dir(), 'fstmt.sqlite')
@click.group()
def cli():
... | 974 | 0 | 156 |
46a9f3dcdb026e9a896987b4bac29a4f48c1cfbc | 2,073 | py | Python | tests/ar/test_news_blockchain.py | OpenDataCordoba/whoare | e6be8c4c15239054b546c468305860265668bac9 | [
"MIT"
] | null | null | null | tests/ar/test_news_blockchain.py | OpenDataCordoba/whoare | e6be8c4c15239054b546c468305860265668bac9 | [
"MIT"
] | 5 | 2020-10-20T20:09:19.000Z | 2020-12-28T00:39:28.000Z | tests/ar/test_news_blockchain.py | OpenDataCordoba/whoare | e6be8c4c15239054b546c468305860265668bac9 | [
"MIT"
] | null | null | null | from datetime import date
from whoare.zone_parsers.ar.news_from_blockchain import NewDomains
| 28.013514 | 66 | 0.682103 | from datetime import date
from whoare.zone_parsers.ar.news_from_blockchain import NewDomains
def read_csv(dated):
nd = NewDomains()
nd.data_path = 'tests/ar/samples'
results = nd.get_from_date(dated)
urls = []
for zona, lista in results['zonas'].items():
for dom in lista:
... | 1,842 | 0 | 138 |
b3a45dcb40d939002cd6cc74fed37e8c87cd19b8 | 2,539 | py | Python | rbtools/clients/tests/test_scanning.py | fangwentong/rbtools | c09f5c93fd61d447dee19b643ddfcf00ba92f920 | [
"MIT"
] | null | null | null | rbtools/clients/tests/test_scanning.py | fangwentong/rbtools | c09f5c93fd61d447dee19b643ddfcf00ba92f920 | [
"MIT"
] | null | null | null | rbtools/clients/tests/test_scanning.py | fangwentong/rbtools | c09f5c93fd61d447dee19b643ddfcf00ba92f920 | [
"MIT"
] | 1 | 2020-06-27T23:08:47.000Z | 2020-06-27T23:08:47.000Z | """Unit tests for client scanning."""
from __future__ import unicode_literals
import os
from rbtools.clients import scan_usable_client
from rbtools.clients.git import GitClient
from rbtools.clients.svn import SVNClient
from rbtools.clients.tests import SCMClientTests
from rbtools.utils.process import execute
class... | 35.760563 | 78 | 0.648681 | """Unit tests for client scanning."""
from __future__ import unicode_literals
import os
from rbtools.clients import scan_usable_client
from rbtools.clients.git import GitClient
from rbtools.clients.svn import SVNClient
from rbtools.clients.tests import SCMClientTests
from rbtools.utils.process import execute
class... | 0 | 0 | 0 |
0662e69a71e1cc9d3473c7b9d5a6fe55d4510954 | 2,858 | py | Python | tests/test_archive.py | lgq2015/ubuntu-isign | 2b72d0c260d13e1dce4a9438a9b0cb566a0fcdaf | [
"Apache-2.0"
] | null | null | null | tests/test_archive.py | lgq2015/ubuntu-isign | 2b72d0c260d13e1dce4a9438a9b0cb566a0fcdaf | [
"Apache-2.0"
] | null | null | null | tests/test_archive.py | lgq2015/ubuntu-isign | 2b72d0c260d13e1dce4a9438a9b0cb566a0fcdaf | [
"Apache-2.0"
] | 1 | 2020-10-26T17:36:54.000Z | 2020-10-26T17:36:54.000Z | from isign_base_test import IsignBaseTest
from isign.archive import archive_factory, Archive, AppArchive, AppZipArchive, IpaArchive
from isign.utils import PY3
import logging
log = logging.getLogger(__name__)
| 32.477273 | 89 | 0.731631 | from isign_base_test import IsignBaseTest
from isign.archive import archive_factory, Archive, AppArchive, AppZipArchive, IpaArchive
from isign.utils import PY3
import logging
log = logging.getLogger(__name__)
class TestArchive(IsignBaseTest):
def _test_good(self, filename, klass):
archive = archive_fact... | 2,043 | 47 | 555 |
628390e7b0e104bdccc43edd629d89f2f161d0b5 | 4,769 | py | Python | cotrendy/lightcurves.py | PLATO-Mission/cotrendy | 31d03f0cfd8329f72d897e84d2aa6c0ca8865dfe | [
"MIT"
] | null | null | null | cotrendy/lightcurves.py | PLATO-Mission/cotrendy | 31d03f0cfd8329f72d897e84d2aa6c0ca8865dfe | [
"MIT"
] | null | null | null | cotrendy/lightcurves.py | PLATO-Mission/cotrendy | 31d03f0cfd8329f72d897e84d2aa6c0ca8865dfe | [
"MIT"
] | null | null | null | """
Light curves components for Cotrendy
"""
import sys
import logging
import numpy as np
from scipy.stats import median_absolute_deviation
import cotrendy.utils as cuts
def load_photometry(config, apply_object_mask=True):
"""
Read in a photometry file
Parameters
----------
config : dict
C... | 29.993711 | 89 | 0.585657 | """
Light curves components for Cotrendy
"""
import sys
import logging
import numpy as np
from scipy.stats import median_absolute_deviation
import cotrendy.utils as cuts
def load_photometry(config, apply_object_mask=True):
"""
Read in a photometry file
Parameters
----------
config : dict
C... | 0 | 0 | 0 |
c4d9e25825d0a67968b72afbc467451be752f281 | 1,954 | py | Python | BigQuery_Script.py | rezaho/iipp_patstat2018 | b83e913a124113052dfbfc5d43ef9d9f6a3f7af0 | [
"Apache-2.0"
] | null | null | null | BigQuery_Script.py | rezaho/iipp_patstat2018 | b83e913a124113052dfbfc5d43ef9d9f6a3f7af0 | [
"Apache-2.0"
] | null | null | null | BigQuery_Script.py | rezaho/iipp_patstat2018 | b83e913a124113052dfbfc5d43ef9d9f6a3f7af0 | [
"Apache-2.0"
] | null | null | null | # Script for creating and loading PatStat2018b dataset into Big Query tables
# coding: utf-8
###############################################
###### Importing Libraries and functions ######
from google.cloud import bigquery
from open_patstat.utils.gcp import create_table, load_gcs_file, delete_table
from open_patstat.... | 34.892857 | 97 | 0.665814 | # Script for creating and loading PatStat2018b dataset into Big Query tables
# coding: utf-8
###############################################
###### Importing Libraries and functions ######
from google.cloud import bigquery
from open_patstat.utils.gcp import create_table, load_gcs_file, delete_table
from open_patstat.... | 0 | 0 | 0 |
fc24f84cff67f66fdbc72dc2ba547c523b3814fe | 828 | py | Python | external/cclib/bridge/cclib2pyquante.py | faribas/RMG-Py | 6149e29b642bf8da9537e2db98f15121f0e040c7 | [
"MIT"
] | 1 | 2017-12-18T18:43:22.000Z | 2017-12-18T18:43:22.000Z | external/cclib/bridge/cclib2pyquante.py | speth/RMG-Py | 1d2c2b684580396e984459d9347628a5ceb80e2e | [
"MIT"
] | 72 | 2016-06-06T18:18:49.000Z | 2019-11-17T03:21:10.000Z | external/cclib/bridge/cclib2pyquante.py | speth/RMG-Py | 1d2c2b684580396e984459d9347628a5ceb80e2e | [
"MIT"
] | 3 | 2017-09-22T15:47:37.000Z | 2021-12-30T23:51:47.000Z | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision: 737 $"
from PyQuante.Molecule import Molecule
def makepyquante(atomcoords, atomnos, charge=0, mult=1):
"""Create a PyQuante Molecule.
>>... | 29.571429 | 74 | 0.621981 | """
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
"""
__revision__ = "$Revision: 737 $"
from PyQuante.Molecule import Molecule
def makepyquante(atomcoords, atomnos, charge=0, mult=1):
"""Create a PyQuante Molecule.
>>... | 0 | 0 | 0 |
f9a937ded3908623f9ea6aa4b476025ff2324f45 | 1,106 | py | Python | NBATextAlerts/Alerts.py | kevinfjiang/NBATextAlerts | 0ddd4fc0fa7a272191c422167350d8813581675b | [
"MIT"
] | 1 | 2021-03-24T04:39:40.000Z | 2021-03-24T04:39:40.000Z | NBATextAlerts/Alerts.py | kevinfjiang/NBATextAlerts | 0ddd4fc0fa7a272191c422167350d8813581675b | [
"MIT"
] | 1 | 2021-03-24T05:33:20.000Z | 2021-03-24T05:36:28.000Z | NBATextAlerts/Alerts.py | kevinfjiang/NBATextAlerts | 0ddd4fc0fa7a272191c422167350d8813581675b | [
"MIT"
] | null | null | null | """
https://www.twilio.com/
This link is the basis for the text messaging, make sure to sign up!
After registering, press the home buton and click "Dashboard", both in the top left
You will see the following lines
"cellphone" -> Paste verified Twilio number as string
"ACCOUNT SID" -> Paste that number into account as... | 30.722222 | 103 | 0.711573 | """
https://www.twilio.com/
This link is the basis for the text messaging, make sure to sign up!
After registering, press the home buton and click "Dashboard", both in the top left
You will see the following lines
"cellphone" -> Paste verified Twilio number as string
"ACCOUNT SID" -> Paste that number into account as... | 170 | 0 | 23 |
abfd30e1b28d8aa306ca97c0ff99e36c6c64c29c | 2,546 | py | Python | utils/timer.py | FanmingL/ESCP | 518f13f8b002d142f670f52d9ef34778e2c2d59f | [
"MIT"
] | null | null | null | utils/timer.py | FanmingL/ESCP | 518f13f8b002d142f670f52d9ef34778e2c2d59f | [
"MIT"
] | null | null | null | utils/timer.py | FanmingL/ESCP | 518f13f8b002d142f670f52d9ef34778e2c2d59f | [
"MIT"
] | null | null | null | import time
import inspect
import numpy as np
if __name__ == '__main__':
test_timer() | 33.064935 | 89 | 0.569521 | import time
import inspect
import numpy as np
class Timer:
def __init__(self):
self.check_points = {}
self.points_time = {}
self.need_summary = {}
self.init_time = time.time()
def reset(self):
self.check_points = {}
self.points_time = {}
self.need_summar... | 2,194 | 215 | 46 |
f7642e021866ac47a0bcd5fd062c3e4fbd79be21 | 4,042 | py | Python | src/interface_py/h2o4gpu/util/lightgbm_dynamic.py | pnijhara/h2o4gpu | 6257112c134136471420b68241f57190a445b67d | [
"Apache-2.0"
] | 458 | 2017-09-20T08:32:10.000Z | 2022-02-28T18:40:57.000Z | src/interface_py/h2o4gpu/util/lightgbm_dynamic.py | Jun-NIBS/h2o4gpu | 9885416deb3285f5d0f33023d6c07373ac4fc0b7 | [
"Apache-2.0"
] | 461 | 2017-09-20T11:39:04.000Z | 2021-11-21T15:51:42.000Z | src/interface_py/h2o4gpu/util/lightgbm_dynamic.py | Jun-NIBS/h2o4gpu | 9885416deb3285f5d0f33023d6c07373ac4fc0b7 | [
"Apache-2.0"
] | 114 | 2017-09-20T12:08:07.000Z | 2021-11-29T14:15:40.000Z | # pylint: skip-file
import os
import importlib.util
got_cpu_lgb = False
got_gpu_lgb = False
from h2o4gpu.util.gpu import device_count
_, ngpus_vis_global = device_count()
enable_lightgbm_import = True
if enable_lightgbm_import:
lgb_loader = importlib.util.find_spec('lightgbm')
lgb_found = lgb_loader is not... | 47.552941 | 222 | 0.543295 | # pylint: skip-file
import os
import importlib.util
got_cpu_lgb = False
got_gpu_lgb = False
from h2o4gpu.util.gpu import device_count
_, ngpus_vis_global = device_count()
enable_lightgbm_import = True
if enable_lightgbm_import:
lgb_loader = importlib.util.find_spec('lightgbm')
lgb_found = lgb_loader is not... | 0 | 0 | 0 |
188ee1b65907db67dfd917f80e2a5d76fdb2dca5 | 1,967 | py | Python | google-cloud-sdk/lib/surface/resource_manager/folders/undelete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/resource_manager/folders/undelete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/resource_manager/folders/undelete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.338983 | 74 | 0.744281 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 303 | 0 | 49 |
5a28b79a46e2fcfa07d776568c13a7328fded066 | 417 | py | Python | contract/tests/ownership.py | ebloc/eBlocBroker | 52d507835a0fe3c930df2e2c816724d26a3484a7 | [
"MIT"
] | 7 | 2018-02-10T22:57:28.000Z | 2020-11-20T14:46:18.000Z | contract/tests/ownership.py | ebloc/eBlocBroker | 52d507835a0fe3c930df2e2c816724d26a3484a7 | [
"MIT"
] | 5 | 2020-10-30T18:43:27.000Z | 2021-02-04T12:39:30.000Z | contract/tests/ownership.py | ebloc/eBlocBroker | 52d507835a0fe3c930df2e2c816724d26a3484a7 | [
"MIT"
] | 5 | 2017-07-06T14:14:13.000Z | 2019-02-22T14:40:16.000Z | #!/usr/bin/python3
import pytest
from utils import ZERO_ADDRESS
from brownie import accounts
def test_ownership(Ebb):
"""Get Owner"""
assert Ebb.getOwner() == accounts[0]
with pytest.reverts(): # transferOwnership should revert
Ebb.transferOwnership(ZERO_ADDRESS, {"from": accounts[0]})
Eb... | 23.166667 | 66 | 0.695444 | #!/usr/bin/python3
import pytest
from utils import ZERO_ADDRESS
from brownie import accounts
def test_ownership(Ebb):
"""Get Owner"""
assert Ebb.getOwner() == accounts[0]
with pytest.reverts(): # transferOwnership should revert
Ebb.transferOwnership(ZERO_ADDRESS, {"from": accounts[0]})
Eb... | 0 | 0 | 0 |
d4bf808de2a868ba73315da564d256636fe0b32b | 2,858 | py | Python | gd/api/_property.py | scottwedge/gd.py | 328c9833abc949b1c9ac0eabe276bd66fead4c2c | [
"MIT"
] | null | null | null | gd/api/_property.py | scottwedge/gd.py | 328c9833abc949b1c9ac0eabe276bd66fead4c2c | [
"MIT"
] | null | null | null | gd/api/_property.py | scottwedge/gd.py | 328c9833abc949b1c9ac0eabe276bd66fead4c2c | [
"MIT"
] | null | null | null | """Automatic object property code generator."""
from gd.typing import Enum, Union
from gd.api.enums import (
ColorChannelProperties,
LevelDataEnum,
LevelHeaderEnum,
ObjectDataEnum,
PlayerColor,
)
from gd.api.parser import ( # type: ignore
_INT,
_BOOL,
_FLOAT,
_HSV,
_ENUMS,
... | 23.816667 | 96 | 0.573828 | """Automatic object property code generator."""
from gd.typing import Enum, Union
from gd.api.enums import (
ColorChannelProperties,
LevelDataEnum,
LevelHeaderEnum,
ObjectDataEnum,
PlayerColor,
)
from gd.api.parser import ( # type: ignore
_INT,
_BOOL,
_FLOAT,
_HSV,
_ENUMS,
... | 1,575 | 0 | 46 |
ffc6fc0c01a161fba017b7f74580eecc40db4a94 | 286 | py | Python | test.py | picturate/picturate | 9f8e69fef7b600b6d8c1ade41a0ccfc382992e8b | [
"Apache-2.0"
] | 4 | 2020-08-03T04:16:53.000Z | 2020-11-02T20:11:16.000Z | test.py | picturate/picturate | 9f8e69fef7b600b6d8c1ade41a0ccfc382992e8b | [
"Apache-2.0"
] | 6 | 2020-09-04T12:36:08.000Z | 2021-06-18T04:31:29.000Z | test.py | picturate/picturate | 9f8e69fef7b600b6d8c1ade41a0ccfc382992e8b | [
"Apache-2.0"
] | 1 | 2020-07-24T07:29:46.000Z | 2020-07-24T07:29:46.000Z | from picturate.config import CAttnGANConfig
from picturate.nets import CAttnGAN
config = CAttnGANConfig('bird')
gan = CAttnGAN(config, pretrained=True)
caption = "This little bird is blue with short beak and white underbelly"
filename = 'bird'
gan.generate_image(caption, filename)
| 23.833333 | 73 | 0.793706 | from picturate.config import CAttnGANConfig
from picturate.nets import CAttnGAN
config = CAttnGANConfig('bird')
gan = CAttnGAN(config, pretrained=True)
caption = "This little bird is blue with short beak and white underbelly"
filename = 'bird'
gan.generate_image(caption, filename)
| 0 | 0 | 0 |
409729662516480907dfc439cb222223768f41e8 | 14,838 | py | Python | tests/unit/test_maxmin.py | mzelling/syndata | bba1c4a7b142f1da332d6613baae30b8b97c4e9b | [
"MIT"
] | null | null | null | tests/unit/test_maxmin.py | mzelling/syndata | bba1c4a7b142f1da332d6613baae30b8b97c4e9b | [
"MIT"
] | null | null | null | tests/unit/test_maxmin.py | mzelling/syndata | bba1c4a7b142f1da332d6613baae30b8b97c4e9b | [
"MIT"
] | null | null | null | import pytest
import numpy as np
from syndata.core import ClusterData
from syndata.maxmin import MaxMinClusters, MaxMinCov, MaxMinBal, maxmin_sampler
# Test Cases for maxmin_sampler
def test_maxmin_sampler():
"""
Make sure the sampling mechanism doesn't break when wrong inputs
are supplied.
"""
# Test cases th... | 33.722727 | 100 | 0.709934 | import pytest
import numpy as np
from syndata.core import ClusterData
from syndata.maxmin import MaxMinClusters, MaxMinCov, MaxMinBal, maxmin_sampler
# Test Cases for maxmin_sampler
def test_maxmin_sampler():
"""
Make sure the sampling mechanism doesn't break when wrong inputs
are supplied.
"""
# Test cases th... | 41 | 0 | 22 |
f547cb46376f6cd48fe72244973add9c82d457c0 | 122 | py | Python | configs/scheduler_cfgs/multi_step_lr_cfg.py | slothfulxtx/TransLoc3D | 0ac324b1dcec456c76d7db2f87d13c076f2d55e4 | [
"MIT"
] | 5 | 2021-09-30T08:12:26.000Z | 2022-01-19T16:20:10.000Z | configs/scheduler_cfgs/multi_step_lr_cfg.py | slothfulxtx/TransLoc3D | 0ac324b1dcec456c76d7db2f87d13c076f2d55e4 | [
"MIT"
] | null | null | null | configs/scheduler_cfgs/multi_step_lr_cfg.py | slothfulxtx/TransLoc3D | 0ac324b1dcec456c76d7db2f87d13c076f2d55e4 | [
"MIT"
] | null | null | null | scheduler_type = 'MultiStepLR'
scheduler_cfg = dict(
gamma=0.5,
milestones=(50, 100, 150, 200)
)
end_epoch = 250
| 15.25 | 34 | 0.672131 | scheduler_type = 'MultiStepLR'
scheduler_cfg = dict(
gamma=0.5,
milestones=(50, 100, 150, 200)
)
end_epoch = 250
| 0 | 0 | 0 |
517a5b82716bd7c535ee53011b12813c5f3bf87e | 392 | py | Python | back/webapi/views/SystemDateView.py | stimulee/piclodio3 | 09f23d608b36cfd0e2e4aec3310c57752e8b7c59 | [
"MIT"
] | null | null | null | back/webapi/views/SystemDateView.py | stimulee/piclodio3 | 09f23d608b36cfd0e2e4aec3310c57752e8b7c59 | [
"MIT"
] | null | null | null | back/webapi/views/SystemDateView.py | stimulee/piclodio3 | 09f23d608b36cfd0e2e4aec3310c57752e8b7c59 | [
"MIT"
] | null | null | null | from time import strftime
from rest_framework.permissions import AllowAny
from rest_framework.views import APIView
from rest_framework.response import Response
| 24.5 | 47 | 0.721939 | from time import strftime
from rest_framework.permissions import AllowAny
from rest_framework.views import APIView
from rest_framework.response import Response
class SystemDateList(APIView):
permission_classes = (AllowAny,)
def get(self, request, format=None):
# get the local system date
clo... | 134 | 73 | 23 |
d9f7438220a4ebe74beaea888af37f17f5bfb665 | 721 | py | Python | levenshtein_distance.py | int2str/catbot | d6279845eb51eaa9c9e9f2aef2f7a521432d7851 | [
"MIT"
] | null | null | null | levenshtein_distance.py | int2str/catbot | d6279845eb51eaa9c9e9f2aef2f7a521432d7851 | [
"MIT"
] | null | null | null | levenshtein_distance.py | int2str/catbot | d6279845eb51eaa9c9e9f2aef2f7a521432d7851 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 14:54:14 2020
@author: Mei
"""
@memoize
| 18.487179 | 74 | 0.468793 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 14:54:14 2020
@author: Mei
"""
def memoize(func):
mem = {}
def memoizer(*args, **kwargs):
key = str(args) + str(kwargs)
if key not in mem:
mem[key] = func(*args, **kwargs)
return mem[key]
return memoizer
@memoize
de... | 582 | 0 | 45 |
131c12d042555b54873fdce0f237aab3ccf4db7f | 37 | py | Python | src/repconc/models/repconc/__init__.py | jingtaozhan/RepCONC | 64f3f8ac265e33a8abcd8d9d750e8a170b739f3b | [
"MIT"
] | 37 | 2021-10-16T07:38:44.000Z | 2022-03-18T17:54:10.000Z | src/repconc/models/repconc/__init__.py | jingtaozhan/RepCONC | 64f3f8ac265e33a8abcd8d9d750e8a170b739f3b | [
"MIT"
] | 4 | 2021-11-09T15:57:59.000Z | 2022-03-01T09:10:32.000Z | src/repconc/models/repconc/__init__.py | jingtaozhan/RepCONC | 64f3f8ac265e33a8abcd8d9d750e8a170b739f3b | [
"MIT"
] | 5 | 2021-11-08T02:58:24.000Z | 2022-02-22T05:22:37.000Z | from .modeling_repconc import RepCONC | 37 | 37 | 0.891892 | from .modeling_repconc import RepCONC | 0 | 0 | 0 |
b2e9ce95b9c470541c1124a564f290f253410919 | 9,658 | py | Python | applications/FluidDynamicsApplication/tests/embedded_reservoir_test.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 2 | 2020-04-30T19:13:08.000Z | 2021-04-14T19:40:47.000Z | applications/FluidDynamicsApplication/tests/embedded_reservoir_test.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-04-30T19:19:09.000Z | 2020-05-02T14:22:36.000Z | applications/FluidDynamicsApplication/tests/embedded_reservoir_test.py | AndreaVoltan/MyKratos7.0 | e977752722e8ef1b606f25618c4bf8fd04c434cc | [
"BSD-4-Clause"
] | 1 | 2020-06-12T08:51:24.000Z | 2020-06-12T08:51:24.000Z | import KratosMultiphysics
import KratosMultiphysics.FluidDynamicsApplication as KratosFluid
import KratosMultiphysics.kratos_utilities as KratosUtilities
have_external_solvers = KratosUtilities.IsApplicationAvailable("ExternalSolversApplication")
import KratosMultiphysics.KratosUnittest as UnitTest
@UnitTest.skipUnle... | 45.130841 | 203 | 0.657693 | import KratosMultiphysics
import KratosMultiphysics.FluidDynamicsApplication as KratosFluid
import KratosMultiphysics.kratos_utilities as KratosUtilities
have_external_solvers = KratosUtilities.IsApplicationAvailable("ExternalSolversApplication")
import KratosMultiphysics.KratosUnittest as UnitTest
@UnitTest.skipUnle... | 8,421 | 26 | 318 |
68e1ed0ef59a3040f7e29f35297d861200c09805 | 454 | py | Python | tests/conftest.py | BradleyKirton/ice3x | 7a289b6b208a0bd07112744923cf5d315982ee31 | [
"MIT"
] | null | null | null | tests/conftest.py | BradleyKirton/ice3x | 7a289b6b208a0bd07112744923cf5d315982ee31 | [
"MIT"
] | 1 | 2021-01-18T09:38:53.000Z | 2021-01-18T09:38:53.000Z | tests/conftest.py | BradleyKirton/ice3x | 7a289b6b208a0bd07112744923cf5d315982ee31 | [
"MIT"
] | 1 | 2021-01-15T05:15:08.000Z | 2021-01-15T05:15:08.000Z | import pytest
def pytest_collection_modifyitems(config, items):
"""If async dependencies is not available skip async tests."""
try:
import treq # noqa
skip_async = False
except ImportError:
skip_async = True
skip_slow = pytest.mark.skip(reason="need --runslow option to run"... | 23.894737 | 71 | 0.665198 | import pytest
def pytest_collection_modifyitems(config, items):
"""If async dependencies is not available skip async tests."""
try:
import treq # noqa
skip_async = False
except ImportError:
skip_async = True
skip_slow = pytest.mark.skip(reason="need --runslow option to run"... | 0 | 0 | 0 |
1f318af426ba6effdcc824c35b1410a508967992 | 605 | py | Python | python/train_model.py | bfakhri/dml_custom | 1e908b10890df11e510d72c21f3125e3069a0eac | [
"CC-BY-4.0"
] | null | null | null | python/train_model.py | bfakhri/dml_custom | 1e908b10890df11e510d72c21f3125e3069a0eac | [
"CC-BY-4.0"
] | null | null | null | python/train_model.py | bfakhri/dml_custom | 1e908b10890df11e510d72c21f3125e3069a0eac | [
"CC-BY-4.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import argparse
import random
import numpy as np
import deepmind_lab
import tensorflow as tf
import sys
print('PYTHON VERSION - ', sys.version)
# For the DML random agent dataset
impo... | 18.90625 | 39 | 0.771901 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import argparse
import random
import numpy as np
import deepmind_lab
import tensorflow as tf
import sys
print('PYTHON VERSION - ', sys.version)
# For the DML random agent dataset
impo... | 0 | 0 | 0 |
61db0562dc232d4ff5aad924e5350c8b5a68b06a | 503 | py | Python | hub/models/types.py | harenlewis/api-hub | f79cd8b82e95c039269765a4542866286803a322 | [
"MIT"
] | null | null | null | hub/models/types.py | harenlewis/api-hub | f79cd8b82e95c039269765a4542866286803a322 | [
"MIT"
] | 2 | 2020-06-05T19:41:09.000Z | 2021-06-10T21:07:30.000Z | hub/models/types.py | harenlewis/api-hub | f79cd8b82e95c039269765a4542866286803a322 | [
"MIT"
] | null | null | null | GET = 100
POST = 200
PUT = 300
DELETE = 400
METHOD_TYPES = (
(GET, 'GET'),
(POST, 'POST'),
(PUT, 'PUT'),
(DELETE, 'DELETE'),
)
METHOD_TYPES_DICT = {
'GET': GET,
'POST': POST,
'PUT': PUT,
'DELETE': DELETE,
}
JSON = 500
HTML = 600
TEXT = 700
RESP_TYPES = (
(JSON, 'JSON'),
(HTML... | 14.794118 | 46 | 0.532803 | GET = 100
POST = 200
PUT = 300
DELETE = 400
METHOD_TYPES = (
(GET, 'GET'),
(POST, 'POST'),
(PUT, 'PUT'),
(DELETE, 'DELETE'),
)
METHOD_TYPES_DICT = {
'GET': GET,
'POST': POST,
'PUT': PUT,
'DELETE': DELETE,
}
JSON = 500
HTML = 600
TEXT = 700
RESP_TYPES = (
(JSON, 'JSON'),
(HTML... | 0 | 0 | 0 |
052a4a4bdf56d5e8dedd6dfe0080f6b2a2e65602 | 145 | py | Python | app/adapters/api/dtos/message_dto.py | jmp/fast1 | 2fb0283168d93b258da15e12af530c50de2dba75 | [
"MIT"
] | 1 | 2021-11-23T13:27:21.000Z | 2021-11-23T13:27:21.000Z | app/adapters/api/dtos/message_dto.py | jmp/fast1 | 2fb0283168d93b258da15e12af530c50de2dba75 | [
"MIT"
] | null | null | null | app/adapters/api/dtos/message_dto.py | jmp/fast1 | 2fb0283168d93b258da15e12af530c50de2dba75 | [
"MIT"
] | null | null | null | from pydantic import BaseModel
| 14.5 | 30 | 0.641379 | from pydantic import BaseModel
class MessageDto(BaseModel):
detail: str
class Config:
frozen = True
title = "Message"
| 0 | 90 | 23 |
69dfa3f3f3c61dd8f1cd49fd9d62071055662676 | 3,962 | py | Python | genome_designer/tests/integration/test_pipeline_integration.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 45 | 2015-09-30T14:55:33.000Z | 2021-06-28T02:33:30.000Z | genome_designer/tests/integration/test_pipeline_integration.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 261 | 2015-06-03T20:41:56.000Z | 2022-03-07T08:46:10.000Z | genome_designer/tests/integration/test_pipeline_integration.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 22 | 2015-06-04T20:43:10.000Z | 2022-02-27T08:27:34.000Z | """Alignment pipeline integration tests.
"""
import os
import time
from django.conf import settings
from djcelery_testworker.testcase import CeleryWorkerTestCase
from main.models import AlignmentGroup
from main.models import Dataset
from main.models import ExperimentSample
from main.testing_util import create_common... | 38.096154 | 80 | 0.69687 | """Alignment pipeline integration tests.
"""
import os
import time
from django.conf import settings
from djcelery_testworker.testcase import CeleryWorkerTestCase
from main.models import AlignmentGroup
from main.models import Dataset
from main.models import ExperimentSample
from main.testing_util import create_common... | 618 | 2,336 | 23 |
c03319542f2244c2d4ef46ea8722b2475a06c15b | 793 | py | Python | topics/Array/Best_Time_to_Buy_and_Sell_Stock_121/Best_Time_to_Buy_and_Sell_Stock_121.py | DmitryNaimark/leetcode-solutions-python | 16af5f3a9cb8469d82b14c8953847f0e93a92324 | [
"MIT"
] | 1 | 2019-10-31T11:06:23.000Z | 2019-10-31T11:06:23.000Z | topics/Array/Best_Time_to_Buy_and_Sell_Stock_121/Best_Time_to_Buy_and_Sell_Stock_121.py | DmitryNaimark/leetcode-solutions-python | 16af5f3a9cb8469d82b14c8953847f0e93a92324 | [
"MIT"
] | null | null | null | topics/Array/Best_Time_to_Buy_and_Sell_Stock_121/Best_Time_to_Buy_and_Sell_Stock_121.py | DmitryNaimark/leetcode-solutions-python | 16af5f3a9cb8469d82b14c8953847f0e93a92324 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
# ---------------------------------------------------
from typing import List
# Runtime Complexity: O(N)
# Space Complexity: O(1)
# ---------------------------------------------------
# Test Cases
# ----------------------------------... | 27.344828 | 64 | 0.461538 | # https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
# ---------------------------------------------------
from typing import List
# Runtime Complexity: O(N)
# Space Complexity: O(1)
class Solution:
def maxProfit(self, prices: List[int]) -> int:
if len(prices) == 0:
return 0
... | 294 | -6 | 48 |
651987d7de3aff6142ce2f122b6b368e0940755f | 6,839 | py | Python | main.py | GunnarHolwerda/PiWallGuiController | cc90e5f6fd6f13fdfdcabcc8e6b195bf01cb440f | [
"MIT"
] | 5 | 2017-03-29T20:44:42.000Z | 2020-06-26T23:11:34.000Z | main.py | GunnarHolwerda/PiWallGuiController | cc90e5f6fd6f13fdfdcabcc8e6b195bf01cb440f | [
"MIT"
] | null | null | null | main.py | GunnarHolwerda/PiWallGuiController | cc90e5f6fd6f13fdfdcabcc8e6b195bf01cb440f | [
"MIT"
] | 1 | 2021-03-08T14:57:09.000Z | 2021-03-08T14:57:09.000Z | """
GUI Application to control the PiWall from
"""
#!/usr/bin/python3
# Author: Gunnar Holwerda
# GUI to control a PiWall
from tkinter import Frame, StringVar, OptionMenu, Listbox, Button, Label, Tk, END
from piwallcontroller.piwallcontroller import PiWallController
from piwallcontroller.playlist import Playlist
f... | 33.360976 | 90 | 0.619389 | """
GUI Application to control the PiWall from
"""
#!/usr/bin/python3
# Author: Gunnar Holwerda
# GUI to control a PiWall
from tkinter import Frame, StringVar, OptionMenu, Listbox, Button, Label, Tk, END
from piwallcontroller.piwallcontroller import PiWallController
from piwallcontroller.playlist import Playlist
f... | 686 | 0 | 27 |
4e411687a292bc56a0037b2e523555237471ea26 | 765 | py | Python | libraries/botbuilder-schema/botbuilder/schema/_sign_in_enums.py | victor-kironde/botbuilder-python | e893d9b036d7cf33cf9c9afd1405450c354cdbcd | [
"MIT"
] | 1 | 2020-07-12T21:04:08.000Z | 2020-07-12T21:04:08.000Z | libraries/botbuilder-schema/botbuilder/schema/_sign_in_enums.py | Fortune-Adekogbe/botbuilder-python | 4e48c874c32a2a7fe7f27a7a1f825e2aa39466c4 | [
"MIT"
] | null | null | null | libraries/botbuilder-schema/botbuilder/schema/_sign_in_enums.py | Fortune-Adekogbe/botbuilder-python | 4e48c874c32a2a7fe7f27a7a1f825e2aa39466c4 | [
"MIT"
] | 1 | 2020-10-01T07:34:07.000Z | 2020-10-01T07:34:07.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | 40.263158 | 94 | 0.60915 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | 0 | 392 | 23 |
cedce4854061d9a8c9e7cb1c10204a423754caa1 | 220 | py | Python | verifyage.py | cheesyc/basicpython | 9a055e4f813c6caa601ba00da939439b0bc82a3f | [
"MIT"
] | null | null | null | verifyage.py | cheesyc/basicpython | 9a055e4f813c6caa601ba00da939439b0bc82a3f | [
"MIT"
] | null | null | null | verifyage.py | cheesyc/basicpython | 9a055e4f813c6caa601ba00da939439b0bc82a3f | [
"MIT"
] | null | null | null | from datetime import datetime
# def days (d):
# now = datetime.now
if __name__ == "__main__":
# u = int(input("What is your age?"))
# d = int(input("What month were you born in?"")
print (datetime.now)
| 22 | 52 | 0.613636 | from datetime import datetime
# def days (d):
# now = datetime.now
if __name__ == "__main__":
# u = int(input("What is your age?"))
# d = int(input("What month were you born in?"")
print (datetime.now)
| 0 | 0 | 0 |
2ab9ebef051b3056bedabb899617bd511e5cce45 | 3,546 | py | Python | acceptance/harness/acceptance_test.py | ismacaulay/qtcwatchdog | 72f3588eef1019bac8788fa58c52722dfa7c4d28 | [
"MIT"
] | null | null | null | acceptance/harness/acceptance_test.py | ismacaulay/qtcwatchdog | 72f3588eef1019bac8788fa58c52722dfa7c4d28 | [
"MIT"
] | 12 | 2015-10-22T15:38:28.000Z | 2016-03-22T18:53:57.000Z | acceptance/harness/acceptance_test.py | ismacaulay/qtcwatchdog | 72f3588eef1019bac8788fa58c52722dfa7c4d28 | [
"MIT"
] | null | null | null | import os, mock
from pyfakefs import fake_filesystem_unittest
from observer import FakeObserver
from qtcwatchdog.qtcwatchdog import QtcWatchdog
from qtcwatchdog.watcher import ProjectWatcher
| 38.543478 | 101 | 0.663283 | import os, mock
from pyfakefs import fake_filesystem_unittest
from observer import FakeObserver
from qtcwatchdog.qtcwatchdog import QtcWatchdog
from qtcwatchdog.watcher import ProjectWatcher
class WatchdogAcceptanceTest(fake_filesystem_unittest.TestCase):
def setUp(self):
self.setUpPyfakefs()
se... | 3,098 | 43 | 211 |
7d5e808698d08d5b754ad10b30667e0affcf369b | 9,023 | py | Python | predictive-horizontal-pod-autoscaler/short/analyse.py | jthomperoo/custom-pod-autoscaler-experiments | f065bee72391dff008a388d46cba40df3fb23c98 | [
"Apache-2.0"
] | 4 | 2020-02-26T14:00:01.000Z | 2022-02-25T15:23:09.000Z | predictive-horizontal-pod-autoscaler/short/analyse.py | jthomperoo/custom-pod-autoscaler-experiments | f065bee72391dff008a388d46cba40df3fb23c98 | [
"Apache-2.0"
] | 1 | 2021-06-12T09:40:56.000Z | 2021-06-12T09:51:45.000Z | predictive-horizontal-pod-autoscaler/short/analyse.py | jthomperoo/custom-pod-autoscaler-experiments | f065bee72391dff008a388d46cba40df3fb23c98 | [
"Apache-2.0"
] | 1 | 2021-07-07T09:58:23.000Z | 2021-07-07T09:58:23.000Z | # Copyright 2020 Jamie Thompson.
#
# 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 writi... | 54.355422 | 161 | 0.729469 | # Copyright 2020 Jamie Thompson.
#
# 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 writi... | 8,167 | 0 | 138 |
21699970a803f9a1e84a84d986852609b75c11f8 | 2,747 | py | Python | fmformatter/Sites2Query.py | wassermanlab/OpenFlexTyper | 35edbf2c29f20ccec20baaaf46cc2382b7defda6 | [
"MIT"
] | 7 | 2019-11-26T00:01:58.000Z | 2021-04-03T05:31:44.000Z | fmformatter/Sites2Query.py | wassermanlab/OpenFlexTyper_restore | f599011a8f856bd81e73e5472d50980b4695055c | [
"MIT"
] | 33 | 2019-10-22T22:23:51.000Z | 2020-10-02T20:14:17.000Z | fmformatter/Sites2Query.py | wassermanlab/OpenFlexTyper_restore | f599011a8f856bd81e73e5472d50980b4695055c | [
"MIT"
] | 4 | 2019-11-29T23:16:57.000Z | 2020-03-07T19:04:26.000Z | import pybedtools
import sys
import argparse
# Function which takes in a sites file and produces a query file.
# Sites file looks like (these are 1-based coords):
# 22:50988105:G:A
#
# Query file looks like:
# #Index Reference Alternate Chrom Pos Ref Alt Identifier DataType
#0 TTTCTCCAAATACAGATCCAATGTCTTCACTTGTCTA... | 41.621212 | 649 | 0.790681 | import pybedtools
import sys
import argparse
def GetArgs():
parser = argparse.ArgumentParser()
parser.add_argument("-I","--Infile",help="Infile in the format of Sites: Chrom:position:ref:alt", required=True)
parser.add_argument("-F","--Fasta",help="Input fasta file corresponding to the positions", required=True)
... | 1,466 | 0 | 91 |
fac204b97e11e17794e1161b7bf560750117f3ce | 49 | py | Python | src/thekpi_node/__init__.py | keeplerteam/thekpi | 082258c26909254caf46caec1da89438a43548c3 | [
"MIT"
] | 2 | 2022-01-21T14:37:50.000Z | 2022-01-21T16:06:27.000Z | src/thekpi_node/__init__.py | keeplerteam/thekpi | 082258c26909254caf46caec1da89438a43548c3 | [
"MIT"
] | null | null | null | src/thekpi_node/__init__.py | keeplerteam/thekpi | 082258c26909254caf46caec1da89438a43548c3 | [
"MIT"
] | null | null | null | from .node import KpiNode
__all__ = ["KpiNode"]
| 12.25 | 25 | 0.714286 | from .node import KpiNode
__all__ = ["KpiNode"]
| 0 | 0 | 0 |
1fa0e3b8383b8f9f172b6decfb3c6c2eff282ed3 | 4,727 | py | Python | python/Tests/TestStatic.py | ugirumurera/ta_solver | c3bd83633aca4db785a4d0dc554f924bb26754e1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | python/Tests/TestStatic.py | ugirumurera/ta_solver | c3bd83633aca4db785a4d0dc554f924bb26754e1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | python/Tests/TestStatic.py | ugirumurera/ta_solver | c3bd83633aca4db785a4d0dc554f924bb26754e1 | [
"BSD-3-Clause-LBNL"
] | null | null | null |
import unittest
import numpy as np
from Solvers.Frank_Wolfe_Solver_Static import Frank_Wolfe_Solver
from Solvers.Path_Based_Frank_Wolfe_Solver import Path_Based_Frank_Wolfe_Solver
#from Solvers.Decomposition_Solver import Decomposition_Solver
from Model_Manager.Link_Model_Manager import Link_Model_Manager_class
from ... | 41.464912 | 121 | 0.675904 |
import unittest
import numpy as np
from Solvers.Frank_Wolfe_Solver_Static import Frank_Wolfe_Solver
from Solvers.Path_Based_Frank_Wolfe_Solver import Path_Based_Frank_Wolfe_Solver
#from Solvers.Decomposition_Solver import Decomposition_Solver
from Model_Manager.Link_Model_Manager import Link_Model_Manager_class
from ... | 3,559 | 0 | 214 |
7678dbedc0d00e401fec232c6c04c058318a2f5c | 3,363 | py | Python | tests/test_latency_host_filter.py | luos/nova-latency-scheduler | 8e83539ce1dfd080ba86e4e71a2b999e56a91ec8 | [
"MIT"
] | 1 | 2017-03-28T19:02:23.000Z | 2017-03-28T19:02:23.000Z | tests/test_latency_host_filter.py | luos/nova-latency-scheduler | 8e83539ce1dfd080ba86e4e71a2b999e56a91ec8 | [
"MIT"
] | null | null | null | tests/test_latency_host_filter.py | luos/nova-latency-scheduler | 8e83539ce1dfd080ba86e4e71a2b999e56a91ec8 | [
"MIT"
] | null | null | null | from unittest import TestCase
from network_filters import LatencyFilter, HostLatencyService
| 35.03125 | 88 | 0.652691 | from unittest import TestCase
from network_filters import LatencyFilter, HostLatencyService
class TestLatencyHostFilter(TestCase):
def setUp(self):
super(TestLatencyHostFilter, self).setUp()
self.latencies = MockHostLatencyService()
self.filter = LatencyFilter(self.latencies)
def tes... | 2,725 | 118 | 423 |
7c364bc32aba99d22e5967788cc363abdd9e9b31 | 484 | py | Python | api/setup.py | jim8786453/kiln_share | 2d70c8863f7db18069d13cdea319cd113a2d0bbb | [
"BSD-3-Clause"
] | 1 | 2018-03-21T12:27:56.000Z | 2018-03-21T12:27:56.000Z | api/setup.py | jim8786453/kiln_share | 2d70c8863f7db18069d13cdea319cd113a2d0bbb | [
"BSD-3-Clause"
] | null | null | null | api/setup.py | jim8786453/kiln_share | 2d70c8863f7db18069d13cdea319cd113a2d0bbb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import platform
from setuptools import setup
from pip.req import parse_requirements
req_file = 'requirements.txt'
install_reqs = parse_requirements(req_file, session=False)
reqs = [str(ir.req) for ir in install_reqs]
del os.link
setup(
author='Jim Kennedy',
author_email='jim@k... | 22 | 58 | 0.727273 | #!/usr/bin/env python
import os
import platform
from setuptools import setup
from pip.req import parse_requirements
req_file = 'requirements.txt'
install_reqs = parse_requirements(req_file, session=False)
reqs = [str(ir.req) for ir in install_reqs]
del os.link
setup(
author='Jim Kennedy',
author_email='jim@k... | 0 | 0 | 0 |
adeea26af730e012cda2bb7d0ba780ef3a185e64 | 4,228 | py | Python | backend/foodgram/recipes/views.py | solilov/foodgram_project_react | 9b0194f912ff881cd2213550d6b4be71e7587403 | [
"MIT"
] | null | null | null | backend/foodgram/recipes/views.py | solilov/foodgram_project_react | 9b0194f912ff881cd2213550d6b4be71e7587403 | [
"MIT"
] | null | null | null | backend/foodgram/recipes/views.py | solilov/foodgram_project_react | 9b0194f912ff881cd2213550d6b4be71e7587403 | [
"MIT"
] | null | null | null | from api.filters import IngredientFilter, TagOrAuthorFilter
from api.pagination import CustomPagination
from api.serializers import (CustomRecipeSerializer, IngredientSerializer,
RecipeSerializer, TagSerializer)
from django.db.models import Sum
from django.http import HttpResponse
from djan... | 37.415929 | 79 | 0.705061 | from api.filters import IngredientFilter, TagOrAuthorFilter
from api.pagination import CustomPagination
from api.serializers import (CustomRecipeSerializer, IngredientSerializer,
RecipeSerializer, TagSerializer)
from django.db.models import Sum
from django.http import HttpResponse
from djan... | 2,284 | 884 | 115 |
a7da0dc79993ceee28e11231a75e0d28a5195097 | 784 | py | Python | back/infolica/alembic/versions/20210906_5a8069c68433.py | maltaesousa/infolica | 9b510b706daba8f8a04434d281c1f8730651f25f | [
"MIT"
] | null | null | null | back/infolica/alembic/versions/20210906_5a8069c68433.py | maltaesousa/infolica | 9b510b706daba8f8a04434d281c1f8730651f25f | [
"MIT"
] | 327 | 2019-10-29T13:35:25.000Z | 2022-03-03T10:01:46.000Z | back/infolica/alembic/versions/20210906_5a8069c68433.py | maltaesousa/infolica | 9b510b706daba8f8a04434d281c1f8730651f25f | [
"MIT"
] | 5 | 2019-11-07T15:49:05.000Z | 2021-03-08T08:59:56.000Z | """fix affaire abandon default value
Revision ID: 5a8069c68433
Revises: ee79f1259c77
Create Date: 2021-09-06 16:28:58.437853
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5a8069c68433'
down_revision = 'ee79f1259c77'
branch_labels = None
depends_on = None
| 25.290323 | 65 | 0.655612 | """fix affaire abandon default value
Revision ID: 5a8069c68433
Revises: ee79f1259c77
Create Date: 2021-09-06 16:28:58.437853
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5a8069c68433'
down_revision = 'ee79f1259c77'
branch_labels = None
depends_on = None
de... | 421 | 0 | 46 |
93f461036d6eba069464298f7bf6843f8d47e919 | 1,074 | py | Python | fNb-end/src/backend/models/Hangar.py | kauereblin/ifc | 071103c4b87a158754f1fe6751984ed0b1760fed | [
"MIT"
] | 4 | 2020-07-23T18:20:00.000Z | 2020-11-17T02:38:31.000Z | fNb-end/src/backend/models/Hangar.py | kauereblin/ifc | 071103c4b87a158754f1fe6751984ed0b1760fed | [
"MIT"
] | null | null | null | fNb-end/src/backend/models/Hangar.py | kauereblin/ifc | 071103c4b87a158754f1fe6751984ed0b1760fed | [
"MIT"
] | null | null | null | from config import db
from models.Pilot import Pilot
from models.HelicopteroDeCombate import HelicopteroDeCombate
| 31.588235 | 79 | 0.647114 | from config import db
from models.Pilot import Pilot
from models.HelicopteroDeCombate import HelicopteroDeCombate
class Hangar(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(254), nullable=False)
country = db.Column(db.String(254), nullable=False)
pilot_id = db.Column(db.I... | 440 | 498 | 23 |
36df2a65cfecf0f2d8cef146751f1d40789fd2ae | 1,128 | py | Python | Code_Python/Exercicio-03/Leia-três-numeros.py | gabrielf7/code-exercises | b3a8661fadc133395f3c6fb7e926317acf7fa539 | [
"MIT"
] | null | null | null | Code_Python/Exercicio-03/Leia-três-numeros.py | gabrielf7/code-exercises | b3a8661fadc133395f3c6fb7e926317acf7fa539 | [
"MIT"
] | null | null | null | Code_Python/Exercicio-03/Leia-três-numeros.py | gabrielf7/code-exercises | b3a8661fadc133395f3c6fb7e926317acf7fa539 | [
"MIT"
] | null | null | null | #questão 4
num1 = float(input("Digite o primeiro valor: \n"))
num2 = float(input("Digite o segundo valor: \n"))
num3 = float(input("Digite o terceiro valor: \n"))
if(num1 > num2 > num3 or num1 == num2 > num3 or num1 > num2 == num3):
maior = num1
segundo = num2
menor = num3
elif num1 > num2 < num3 or num1 =... | 31.333333 | 75 | 0.565603 | #questão 4
num1 = float(input("Digite o primeiro valor: \n"))
num2 = float(input("Digite o segundo valor: \n"))
num3 = float(input("Digite o terceiro valor: \n"))
if(num1 > num2 > num3 or num1 == num2 > num3 or num1 > num2 == num3):
maior = num1
segundo = num2
menor = num3
elif num1 > num2 < num3 or num1 =... | 0 | 0 | 0 |
ec43363c255f6adb5d1411a40a6f397b07037274 | 383 | py | Python | Economic_Dispatch/plot_results.py | asuncionjc/Pyomo_Playground | b81a12905fb6cdd041b11f89ee4bbbc20168d4d2 | [
"Apache-2.0"
] | 1 | 2019-04-12T14:47:58.000Z | 2019-04-12T14:47:58.000Z | Economic_Dispatch/plot_results.py | asuncionjc/Pyomo_Playground | b81a12905fb6cdd041b11f89ee4bbbc20168d4d2 | [
"Apache-2.0"
] | null | null | null | Economic_Dispatch/plot_results.py | asuncionjc/Pyomo_Playground | b81a12905fb6cdd041b11f89ee4bbbc20168d4d2 | [
"Apache-2.0"
] | 1 | 2021-02-14T18:40:13.000Z | 2021-02-14T18:40:13.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 15:53:54 2019
@author: Asun
"""
import matplotlib.pyplot as plt
import numpy as np | 25.533333 | 99 | 0.665796 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 15:53:54 2019
@author: Asun
"""
import matplotlib.pyplot as plt
import numpy as np
def plot_results(model):
x = np.arange(0, 3)
y = [model.flow[generating_unit,1].value for generating_unit in model.indexes_generating_units]
plt.plot(x, y, color = 'red', m... | 226 | 0 | 23 |
de05130838373479be28ff8059892d8eb6a14633 | 1,787 | py | Python | download_hype.py | woctezuma/steam-hype | cb885f8c1c2a4e7b8d344401207e3a7634f52317 | [
"MIT"
] | 1 | 2019-08-15T18:52:55.000Z | 2019-08-15T18:52:55.000Z | download_hype.py | woctezuma/steam-hype | cb885f8c1c2a4e7b8d344401207e3a7634f52317 | [
"MIT"
] | 10 | 2019-08-15T19:05:10.000Z | 2020-07-24T05:07:28.000Z | download_hype.py | woctezuma/steam-hype | cb885f8c1c2a4e7b8d344401207e3a7634f52317 | [
"MIT"
] | 1 | 2019-08-20T03:32:25.000Z | 2019-08-20T03:32:25.000Z | import time
import requests
from utils import save_results
if __name__ == '__main__':
main()
| 20.078652 | 75 | 0.604365 | import time
import requests
from utils import save_results
def get_steam_hype_url():
# This is not my API. Please use with moderation!
url = 'https://steamhype-api.herokuapp.com/calendar'
return url
def get_time_stamp():
time_stamp = int(time.time() * 1000)
return time_stamp
def get_steam... | 1,543 | 0 | 138 |
538fa6ef11f1d9c920a5d631b5035786fcade951 | 2,881 | py | Python | examples/sine.py | bjodah/finitediff | bfb1940cf5c7ce5c9a3b440d1efd8f8c4128fed8 | [
"BSD-2-Clause"
] | 27 | 2016-09-14T11:40:35.000Z | 2022-03-05T18:48:26.000Z | examples/sine.py | tutoushaonian/finitediff | bfb1940cf5c7ce5c9a3b440d1efd8f8c4128fed8 | [
"BSD-2-Clause"
] | 4 | 2016-04-08T03:55:14.000Z | 2018-06-27T11:18:58.000Z | examples/sine.py | tutoushaonian/finitediff | bfb1940cf5c7ce5c9a3b440d1efd8f8c4128fed8 | [
"BSD-2-Clause"
] | 5 | 2017-05-25T06:50:40.000Z | 2021-09-13T14:16:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function # Python 3 behaviour in Py2
import numpy as np
from finitediff import derivatives_at_point_by_finite_diff, interpolate_by_finite_diff
def demo_usage(n_data=50, n_fit=537, nhead=5, ntail=5, plot=False, alt=0):
"""
... | 30.648936 | 87 | 0.596321 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function # Python 3 behaviour in Py2
import numpy as np
from finitediff import derivatives_at_point_by_finite_diff, interpolate_by_finite_diff
def demo_usage(n_data=50, n_fit=537, nhead=5, ntail=5, plot=False, alt=0):
"""
... | 28 | 0 | 31 |
9271f1a5455a7ecdd71cc83dbca5ba4c204b255a | 1,173 | py | Python | packages/mdspan/package.py | pdidev/spack | 32151f29738895e1f7d96e496c084d6349a9277b | [
"Apache-2.0",
"MIT"
] | 2 | 2020-04-09T11:39:41.000Z | 2021-12-10T17:45:42.000Z | packages/mdspan/package.py | pdidev/spack | 32151f29738895e1f7d96e496c084d6349a9277b | [
"Apache-2.0",
"MIT"
] | 1 | 2021-08-12T10:03:26.000Z | 2021-08-12T10:03:26.000Z | packages/mdspan/package.py | pdidev/spack | 32151f29738895e1f7d96e496c084d6349a9277b | [
"Apache-2.0",
"MIT"
] | 3 | 2020-03-27T15:41:45.000Z | 2022-02-01T15:03:11.000Z | # Copyright (C) 2020 Commissariat a l'energie atomique et aux energies alternatives (CEA)
# and others. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mdspan(CMakePackage):
"""Reference implementation of mdspan targeting C++23."""
hom... | 35.545455 | 115 | 0.695652 | # Copyright (C) 2020 Commissariat a l'energie atomique et aux energies alternatives (CEA)
# and others. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mdspan(CMakePackage):
"""Reference implementation of mdspan targeting C++23."""
hom... | 124 | 0 | 27 |
cdb3f49fb732beb3ef7f5d4eef3c47dfc48b1951 | 307 | py | Python | examples/docs_snippets_crag/docs_snippets_crag/concepts/solids_pipelines/linear_pipeline.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-07-03T09:05:58.000Z | 2021-07-03T09:05:58.000Z | examples/docs_snippets_crag/docs_snippets_crag/concepts/solids_pipelines/linear_pipeline.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-06-21T18:30:02.000Z | 2021-06-25T21:18:39.000Z | examples/docs_snippets_crag/docs_snippets_crag/concepts/solids_pipelines/linear_pipeline.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-09-26T07:29:17.000Z | 2021-09-26T07:29:17.000Z | # pylint: disable=unused-argument
# start_marker
from dagster import pipeline, solid
@solid
@solid
@pipeline
# end_marker
| 13.347826 | 43 | 0.710098 | # pylint: disable=unused-argument
# start_marker
from dagster import pipeline, solid
@solid
def return_one(context) -> int:
return 1
@solid
def add_one(context, number: int) -> int:
return number + 1
@pipeline
def linear_pipeline():
add_one(add_one(add_one(return_one())))
# end_marker
| 110 | 0 | 66 |
18b2f34f7078f46737a2a88c1ad04524675a51e2 | 1,147 | py | Python | snakeskin/sources/source.py | ewanbarr/snakeskin | b41a5393e9b4ab42fd6245e022dd4923be01815b | [
"Apache-2.0"
] | null | null | null | snakeskin/sources/source.py | ewanbarr/snakeskin | b41a5393e9b4ab42fd6245e022dd4923be01815b | [
"Apache-2.0"
] | null | null | null | snakeskin/sources/source.py | ewanbarr/snakeskin | b41a5393e9b4ab42fd6245e022dd4923be01815b | [
"Apache-2.0"
] | null | null | null | import ephem as eph
import numpy as np
from snakeskin.constants import SEC_TO_SIDRAD
| 32.771429 | 82 | 0.632084 | import ephem as eph
import numpy as np
from snakeskin.constants import SEC_TO_SIDRAD
class Source(eph.FixedBody):
def __init__(self,ra,dec,tobs=1800.0,name="none",value=1.,obs_config=None):
super(Source,self).__init__()
self.name = name
coords = eph.Equatorial(ra,dec)
self._ra = coo... | 925 | 7 | 130 |
ac9f99f6f60b9becd44d5f1c6fefe4639be389b0 | 474 | py | Python | xastropy/relativity/__init__.py | bpholden/xastropy | 66aff0995a84c6829da65996d2379ba4c946dabe | [
"BSD-3-Clause"
] | 3 | 2015-08-23T00:32:58.000Z | 2020-12-31T02:37:52.000Z | xastropy/relativity/__init__.py | Kristall-WangShiwei/xastropy | 723fe56cb48d5a5c4cdded839082ee12ef8c6732 | [
"BSD-3-Clause"
] | 104 | 2015-07-17T18:31:54.000Z | 2018-06-29T17:04:09.000Z | xastropy/relativity/__init__.py | Kristall-WangShiwei/xastropy | 723fe56cb48d5a5c4cdded839082ee12ef8c6732 | [
"BSD-3-Clause"
] | 16 | 2015-07-17T15:50:37.000Z | 2019-04-21T03:42:47.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" astropy.cosmology contains classes and functions for cosmological
distance measures and other cosmology-related calculations.
See the `Astropy documentation
<http://docs.astropy.org/en/latest/cosmology/index.html>`_ for more
detailed usage examples an... | 36.461538 | 69 | 0.767932 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" astropy.cosmology contains classes and functions for cosmological
distance measures and other cosmology-related calculations.
See the `Astropy documentation
<http://docs.astropy.org/en/latest/cosmology/index.html>`_ for more
detailed usage examples an... | 0 | 0 | 0 |
4bfa262067e0d0cd970b7cd29211db1db46e96fe | 651 | py | Python | app/migrations/0003_auto_20181022_1601.py | Evohmike/Nyumba-Kumi-App | 80ba9ded12bda6e41c9395a4e439e80f8840d295 | [
"MIT"
] | null | null | null | app/migrations/0003_auto_20181022_1601.py | Evohmike/Nyumba-Kumi-App | 80ba9ded12bda6e41c9395a4e439e80f8840d295 | [
"MIT"
] | null | null | null | app/migrations/0003_auto_20181022_1601.py | Evohmike/Nyumba-Kumi-App | 80ba9ded12bda6e41c9395a4e439e80f8840d295 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-22 13:01
from __future__ import unicode_literals
from django.db import migrations, models
| 25.038462 | 71 | 0.605223 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-22 13:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0002_neighbourhood_hood_photo'),
]
operations = [
migrations.AddField(... | 0 | 474 | 23 |
30d1cfa49c2d708d5f169d7bff5b66ab9dc3fbca | 2,138 | py | Python | test_laylib/test_default_engine.py | Layto888/laylib-1.0.1 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | 1 | 2018-08-04T14:44:42.000Z | 2018-08-04T14:44:42.000Z | test_laylib/test_default_engine.py | Layto888/laylib-1.0 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | null | null | null | test_laylib/test_default_engine.py | Layto888/laylib-1.0 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | null | null | null | # test module default_engine.py
import pytest
import logging
import os
import inspect
import sys
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
from laylib import default_engine
logging.basicConfig(level... | 26.395062 | 87 | 0.755379 | # test module default_engine.py
import pytest
import logging
import os
import inspect
import sys
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
from laylib import default_engine
logging.basicConfig(level... | 966 | 34 | 202 |
e0296db2c64142c0262d853517a11e247c329f34 | 3,886 | py | Python | lingvo/core/base_decoder.py | pizzahan/lingvo | 9b85b7ba5d037701302efa807841c05223bc7d1d | [
"Apache-2.0"
] | 4 | 2019-06-08T00:19:06.000Z | 2020-08-03T16:28:53.000Z | lingvo/core/base_decoder.py | pizzahan/lingvo | 9b85b7ba5d037701302efa807841c05223bc7d1d | [
"Apache-2.0"
] | null | null | null | lingvo/core/base_decoder.py | pizzahan/lingvo | 9b85b7ba5d037701302efa807841c05223bc7d1d | [
"Apache-2.0"
] | 5 | 2018-12-11T08:05:16.000Z | 2020-05-30T03:40:13.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.728155 | 80 | 0.717962 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 1,563 | 0 | 122 |
85d102b6cba4ef055e73d753952668f328b5a301 | 1,225 | py | Python | tests/runtime/asset/test_persistent.py | formlio/forml | fd070da74a0107e37c0c643dd8df8680618fef74 | [
"Apache-2.0"
] | 78 | 2020-11-04T18:27:20.000Z | 2022-02-07T03:32:53.000Z | tests/runtime/asset/test_persistent.py | formlio/forml | fd070da74a0107e37c0c643dd8df8680618fef74 | [
"Apache-2.0"
] | 3 | 2020-11-05T20:42:15.000Z | 2021-01-13T19:57:01.000Z | tests/runtime/asset/test_persistent.py | formlio/forml | fd070da74a0107e37c0c643dd8df8680618fef74 | [
"Apache-2.0"
] | 7 | 2020-11-18T17:18:15.000Z | 2021-03-24T05:14:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.28125 | 120 | 0.75102 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 0 | 0 |
6929622484867a36adedfe910766d009df4df761 | 491 | py | Python | teste_requests.py | stevillis/gu-escola | 2b26ec53e63fb70447c7a0eb13ab9c6e473122e0 | [
"MIT"
] | null | null | null | teste_requests.py | stevillis/gu-escola | 2b26ec53e63fb70447c7a0eb13ab9c6e473122e0 | [
"MIT"
] | null | null | null | teste_requests.py | stevillis/gu-escola | 2b26ec53e63fb70447c7a0eb13ab9c6e473122e0 | [
"MIT"
] | null | null | null | import requests
BASE_URL = 'http://localhost:8000/api/v2/'
# GET Avaliacoes
"""
response = requests.get(f'{BASE_URL}avaliacoes')
print(response)
print(response.status_code)
avaliacoes = response.json()
print(avaliacoes)
print(avaliacoes.get('count'))
print(avaliacoes.get('results'))
"""
# GET Cursos
headers = {
... | 19.64 | 69 | 0.745418 | import requests
BASE_URL = 'http://localhost:8000/api/v2/'
# GET Avaliacoes
"""
response = requests.get(f'{BASE_URL}avaliacoes')
print(response)
print(response.status_code)
avaliacoes = response.json()
print(avaliacoes)
print(avaliacoes.get('count'))
print(avaliacoes.get('results'))
"""
# GET Cursos
headers = {
... | 0 | 0 | 0 |
d5b5b6fef388dc9909b4b8f5f7507dcc08300c41 | 4,852 | py | Python | submissions/aartiste/myKMeans.py | dillonpoff/aima-python | 2eadb43f6ede9c7a2e211ea38dff3fa5fd5c91df | [
"MIT"
] | 1 | 2018-08-24T14:04:18.000Z | 2018-08-24T14:04:18.000Z | submissions/aartiste/myKMeans.py | dillonpoff/aima-python | 2eadb43f6ede9c7a2e211ea38dff3fa5fd5c91df | [
"MIT"
] | null | null | null | submissions/aartiste/myKMeans.py | dillonpoff/aima-python | 2eadb43f6ede9c7a2e211ea38dff3fa5fd5c91df | [
"MIT"
] | null | null | null | from sklearn.cluster import KMeans
import traceback
from submissions.aartiste import election
from submissions.aartiste import county_demographics
trumpECHP = DataFrame()
'''
Extract data from the CORGIS elections, and merge it with the
CORGIS demographics. Both data sets are organized by county and state.
'''
joint... | 27.568182 | 99 | 0.620569 | from sklearn.cluster import KMeans
import traceback
from submissions.aartiste import election
from submissions.aartiste import county_demographics
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
trumpECHP = DataFrame()
'''
Extract data from the CORGIS elections, and merge ... | 759 | 70 | 92 |
f45d5ecb43560f81497d317a23712bf1eaf8d15f | 603 | py | Python | initialize_points_w.py | NCBI-Hackathons/McDiff | 43037967e65e8dbdda18c891175c93537b98a238 | [
"MIT"
] | 3 | 2018-06-21T15:16:25.000Z | 2018-06-21T22:42:17.000Z | initialize_points_w.py | NCBI-Hackathons/McDiff | 43037967e65e8dbdda18c891175c93537b98a238 | [
"MIT"
] | null | null | null | initialize_points_w.py | NCBI-Hackathons/McDiff | 43037967e65e8dbdda18c891175c93537b98a238 | [
"MIT"
] | 1 | 2018-06-25T16:17:04.000Z | 2018-06-25T16:17:04.000Z | from shapely import geometry
# import random
# import numpy as np
# numParticles = 120
# point_list = [[0,0],[0,1],[1,1],[1,0]]
# poly = geometry.Polygon(point_list)
# print generate_random_points(numParticles, poly)
| 25.125 | 71 | 0.706468 | from shapely import geometry
# import random
# import numpy as np
# numParticles = 120
# point_list = [[0,0],[0,1],[1,1],[1,0]]
# poly = geometry.Polygon(point_list)
def generate_random_points(N, poly):
list_of_points = np.zeros((2, N))
minx,miny,maxx,maxy = poly.bounds
counter = 0
while counter < N:
punto = (... | 360 | 0 | 23 |
c67cc3624a702cafd7e7246abe8b88132e111d61 | 53 | py | Python | modules/__init__.py | richardHaw/nagare | 4909c4ba8833e7cf5152e39a7bc58a558aaa2c7c | [
"MIT"
] | null | null | null | modules/__init__.py | richardHaw/nagare | 4909c4ba8833e7cf5152e39a7bc58a558aaa2c7c | [
"MIT"
] | null | null | null | modules/__init__.py | richardHaw/nagare | 4909c4ba8833e7cf5152e39a7bc58a558aaa2c7c | [
"MIT"
] | null | null | null | # this file is needed for python2, delete for python3 | 53 | 53 | 0.792453 | # this file is needed for python2, delete for python3 | 0 | 0 | 0 |
54cd06ce2ea0585ac5ee273e70cb010a30aa3f06 | 9,713 | py | Python | python/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS_test.py | docebo/aws-config-rules | 75f92bcad644bd71f19bbc15cf99e6d6de6b8227 | [
"CC0-1.0"
] | 1,295 | 2016-03-01T23:06:33.000Z | 2022-03-31T07:17:53.000Z | python/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS_test.py | tied/aws-config-rules | 7c66e109c1225111d2ab8d1811d6e80dea0affcb | [
"CC0-1.0"
] | 287 | 2016-03-01T19:51:43.000Z | 2022-01-06T04:59:55.000Z | python/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS_test.py | tied/aws-config-rules | 7c66e109c1225111d2ab8d1811d6e80dea0affcb | [
"CC0-1.0"
] | 744 | 2016-03-01T18:33:00.000Z | 2022-03-31T18:46:44.000Z | # Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may
# not use this file except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | 50.853403 | 182 | 0.724699 | # Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may
# not use this file except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | 7,249 | 1,132 | 184 |
0e295a939cb3bb447622e932af4f06083d13ea4b | 75 | py | Python | starling_sim/basemodel/topology/__init__.py | tellae/starling | 56121c728eb5de3dfc77cdf08da89548f3315c87 | [
"CECILL-B"
] | 19 | 2021-02-16T12:32:22.000Z | 2022-01-06T11:16:44.000Z | starling_sim/basemodel/topology/__init__.py | tellae/starling | 56121c728eb5de3dfc77cdf08da89548f3315c87 | [
"CECILL-B"
] | 20 | 2021-01-13T20:58:07.000Z | 2022-03-21T15:53:07.000Z | starling_sim/basemodel/topology/__init__.py | tellae/starling | 56121c728eb5de3dfc77cdf08da89548f3315c87 | [
"CECILL-B"
] | null | null | null | """
This package contains the modules related to simulation topologies
"""
| 18.75 | 66 | 0.773333 | """
This package contains the modules related to simulation topologies
"""
| 0 | 0 | 0 |
7a9c4005ae9ed6fcb141368f64486d286ecf01ed | 3,288 | py | Python | networking_onos/extensions/callback.py | sanghoshin/networking-onos | 2baec5f74e2721e5f8dffd57b3ef7a27034fa54a | [
"Apache-2.0"
] | null | null | null | networking_onos/extensions/callback.py | sanghoshin/networking-onos | 2baec5f74e2721e5f8dffd57b3ef7a27034fa54a | [
"Apache-2.0"
] | null | null | null | networking_onos/extensions/callback.py | sanghoshin/networking-onos | 2baec5f74e2721e5f8dffd57b3ef7a27034fa54a | [
"Apache-2.0"
] | 1 | 2017-10-19T04:23:14.000Z | 2017-10-19T04:23:14.000Z | # Copyright (c) 2017 SK Telecom Ltd
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 39.614458 | 79 | 0.680961 | # Copyright (c) 2017 SK Telecom Ltd
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 1,819 | 18 | 158 |
2e38813849e7b8d4b409de57f658a7d182ad66aa | 3,682 | py | Python | play.py | ksu-is/guesswordgame | 65478e24c1fc834e43ab9dd3d00c8429fbe96f22 | [
"Apache-2.0"
] | 7 | 2015-10-03T04:10:57.000Z | 2021-04-02T14:43:21.000Z | play.py | ksu-is/guesswordgame | 65478e24c1fc834e43ab9dd3d00c8429fbe96f22 | [
"Apache-2.0"
] | 1 | 2016-04-20T17:11:22.000Z | 2016-04-26T18:08:23.000Z | play.py | ksu-is/guesswordgame | 65478e24c1fc834e43ab9dd3d00c8429fbe96f22 | [
"Apache-2.0"
] | 5 | 2016-02-26T09:42:48.000Z | 2021-05-09T17:32:04.000Z | import game.main as game
import time
import sys
if __name__ == "__main__":
try:
main()
except (KeyboardInterrupt, SystemExit):
print "\n Recieved Interrupt Signal. Bye...."
import sys
sys.exit()
| 32.017391 | 110 | 0.560565 | import game.main as game
import time
import sys
def main():
play = "--++playtheguesswordgame++--"
if len(sys.argv) > 1 and sys.argv[1] == "tut":
print """
Enter your guess that must be containing 4 letters:
"""
time.sleep(3)
print """
# now the player types... | 3,423 | 0 | 23 |
b7325eaebdbd28f2ed8cbfb180708a24650dee3d | 5,258 | py | Python | mysite/users/models.py | 2021fallCMPUT404/group-cmput404-project | 985b76dc6c554caf77e7cf5788355cca22a26e74 | [
"Apache-2.0"
] | 2 | 2021-12-06T06:42:41.000Z | 2022-03-29T21:40:14.000Z | mysite/users/models.py | 2021fallCMPUT404/group-cmput404-project | 985b76dc6c554caf77e7cf5788355cca22a26e74 | [
"Apache-2.0"
] | 7 | 2021-10-29T20:31:44.000Z | 2021-12-05T06:55:58.000Z | mysite/users/models.py | 2021fallCMPUT404/group-cmput404-project | 985b76dc6c554caf77e7cf5788355cca22a26e74 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth.models import AbstractUser
from django.http import HttpResponse
import uuid
from django import forms
from django.forms.widgets import Textarea
import datetime
from posts.models import Post, Like, CommentLike#, In... | 38.661765 | 105 | 0.621909 | from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth.models import AbstractUser
from django.http import HttpResponse
import uuid
from django import forms
from django.forms.widgets import Textarea
import datetime
from posts.models import Post, Like, CommentLike#, In... | 794 | 3,760 | 146 |
414ed76ae0b89becc26b055e4a79ab7edd82af55 | 8,528 | py | Python | clickup/client.py | skwaugh/ClickUp | 3f9fb2d1e8cc8cd4e95cd46030e1265aefa5541d | [
"MIT"
] | 3 | 2019-12-17T13:38:50.000Z | 2021-05-31T13:47:50.000Z | clickup/client.py | secdevopsai/ClickUp | 3f9fb2d1e8cc8cd4e95cd46030e1265aefa5541d | [
"MIT"
] | null | null | null | clickup/client.py | secdevopsai/ClickUp | 3f9fb2d1e8cc8cd4e95cd46030e1265aefa5541d | [
"MIT"
] | 4 | 2020-07-31T08:50:56.000Z | 2022-02-14T18:58:04.000Z | import requests
from collections import defaultdict
import datetime
| 32.8 | 505 | 0.569536 | import requests
from collections import defaultdict
import datetime
class Client:
def __init__(self, email, password, api):
self.server = "https://api.clickup.com/"
self.email = email
self.password = password
self.api = api
self.bearer = self.login(email, password)
... | 813 | 7,623 | 23 |
ff134e64e57b7ca7080b40af0e3f390aa9a3db33 | 1,305 | py | Python | .env/lib/python2.7/site-packages/skimage/viewer/tests/test_utils.py | ViduraPrasangana/faster-rcnn-caffe | af6f5ee89c6e82d295bddd192d9dfcebd60d7c52 | [
"MIT"
] | 1 | 2019-01-12T13:17:32.000Z | 2019-01-12T13:17:32.000Z | .env/lib/python2.7/site-packages/skimage/viewer/tests/test_utils.py | ViduraPrasangana/faster-rcnn-caffe | af6f5ee89c6e82d295bddd192d9dfcebd60d7c52 | [
"MIT"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | .env/lib/python2.7/site-packages/skimage/viewer/tests/test_utils.py | ViduraPrasangana/faster-rcnn-caffe | af6f5ee89c6e82d295bddd192d9dfcebd60d7c52 | [
"MIT"
] | 2 | 2020-03-12T23:20:22.000Z | 2021-02-15T21:54:02.000Z | # -*- coding: utf-8 -*-
from skimage.viewer import utils
from skimage.viewer.utils import dialogs
from skimage.viewer.qt import QtCore, QtWidgets, has_qt
from skimage._shared import testing
@testing.skipif(not has_qt, reason="Qt not installed")
@testing.skipif(not has_qt, reason="Qt not installed")
@testing.skipi... | 31.071429 | 76 | 0.724904 | # -*- coding: utf-8 -*-
from skimage.viewer import utils
from skimage.viewer.utils import dialogs
from skimage.viewer.qt import QtCore, QtWidgets, has_qt
from skimage._shared import testing
@testing.skipif(not has_qt, reason="Qt not installed")
def test_event_loop():
utils.init_qtapp()
timer = QtCore.QTimer()... | 645 | 0 | 88 |
e4eed4150a0020f361e02176075753236176288a | 269 | py | Python | RasaNLU/pending_actions.py | naikshubham/Rasa-Introduction | 93b1c6428879e49ddd93d7a5ec5a4eb52fb9bab2 | [
"BSD-2-Clause"
] | 1 | 2021-06-15T09:58:15.000Z | 2021-06-15T09:58:15.000Z | RasaNLU/pending_actions.py | naikshubham/Rasa-Introduction | 93b1c6428879e49ddd93d7a5ec5a4eb52fb9bab2 | [
"BSD-2-Clause"
] | null | null | null | RasaNLU/pending_actions.py | naikshubham/Rasa-Introduction | 93b1c6428879e49ddd93d7a5ec5a4eb52fb9bab2 | [
"BSD-2-Clause"
] | null | null | null | # Pending actions
# we can improve user experience of our bot by asking the user simple yes or no followup questions
# one easy way to handle these followup is to define pending actions which gets executed as soon as user says "yes"
# and wiped if the user says "no"
| 44.833333 | 115 | 0.769517 | # Pending actions
# we can improve user experience of our bot by asking the user simple yes or no followup questions
# one easy way to handle these followup is to define pending actions which gets executed as soon as user says "yes"
# and wiped if the user says "no"
| 0 | 0 | 0 |
28ea666798dad6da46886eee004f74017eb3e201 | 2,573 | py | Python | get_ip_pool.py | vbertcen/ajk_sp_sale_rent_ratio | bd477441fde3ccbe396b68dba2418ec0b9aa558e | [
"Apache-2.0"
] | 1 | 2019-08-30T10:54:06.000Z | 2019-08-30T10:54:06.000Z | get_ip_pool.py | vbertcen/ajk_sp_sale_rent_ratio | bd477441fde3ccbe396b68dba2418ec0b9aa558e | [
"Apache-2.0"
] | null | null | null | get_ip_pool.py | vbertcen/ajk_sp_sale_rent_ratio | bd477441fde3ccbe396b68dba2418ec0b9aa558e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import sys
import pymysql
import requests
import datetime
from lxml import etree
reload(sys)
sys.setdefaultencoding('utf8')
now_str = datetime.datetime.now().strftime('%Y-%m-%d')
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.... | 34.306667 | 156 | 0.539059 | # coding=utf-8
import sys
import pymysql
import requests
import datetime
from lxml import etree
reload(sys)
sys.setdefaultencoding('utf8')
now_str = datetime.datetime.now().strftime('%Y-%m-%d')
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.... | 2,130 | 0 | 46 |
dd8bdd0ca9cd34cb385f46afc75b4e9cf95ab521 | 476 | py | Python | jython/jython/java_usage_examples.py | JohannesDienst/polyglot_integration | ee0936539282e82d4d0605ed564389c0539ede40 | [
"MIT"
] | null | null | null | jython/jython/java_usage_examples.py | JohannesDienst/polyglot_integration | ee0936539282e82d4d0605ed564389c0539ede40 | [
"MIT"
] | null | null | null | jython/jython/java_usage_examples.py | JohannesDienst/polyglot_integration | ee0936539282e82d4d0605ed564389c0539ede40 | [
"MIT"
] | null | null | null | from java.lang import System as javasystem
javasystem.out.println("Hello")
from java.util import Random
r = rand(100, 23)
for i in range(10):
print r.nextDouble() | 23.8 | 56 | 0.653361 | from java.lang import System as javasystem
javasystem.out.println("Hello")
from java.util import Random
class rand(Random):
def __init__(self, multiplier=1.0, seed=None):
self.multiplier = multiplier
if seed is None:
Random.__init__(self)
else:
Random.__init__(self... | 233 | -2 | 76 |
da4b679b11109485dccab6378be56da7adfaca21 | 321 | py | Python | 5-loops/exercise_3.1.py | wgatharia/csci131 | 50d76603863c9a9932634fdf2e48594f8dc673d2 | [
"MIT"
] | null | null | null | 5-loops/exercise_3.1.py | wgatharia/csci131 | 50d76603863c9a9932634fdf2e48594f8dc673d2 | [
"MIT"
] | null | null | null | 5-loops/exercise_3.1.py | wgatharia/csci131 | 50d76603863c9a9932634fdf2e48594f8dc673d2 | [
"MIT"
] | null | null | null | """
File: exercise_3.1.py
Author: William Gatharia
This code demonstrates using a for loop.
"""
#loop and print numbers from 1 to 10 using a for loop and range
# range creates a list of numbers
# starting from 1 to 10.
# Note the 11 = 10 + 1 is the upper limit form range
for i in range(1, 11):
print(i)
... | 24.692308 | 63 | 0.682243 | """
File: exercise_3.1.py
Author: William Gatharia
This code demonstrates using a for loop.
"""
#loop and print numbers from 1 to 10 using a for loop and range
# range creates a list of numbers
# starting from 1 to 10.
# Note the 11 = 10 + 1 is the upper limit form range
for i in range(1, 11):
print(i)
... | 0 | 0 | 0 |
cd438ed3e070272f3b23e2778ba9493fd02837f8 | 1,919 | py | Python | Data_preparation/test/video_subcrop.py | Rukaume/LRCN | 0d1928cc72544f59a4335fea7febc561d3dfc118 | [
"MIT"
] | 1 | 2020-11-07T05:57:32.000Z | 2020-11-07T05:57:32.000Z | Data_preparation/test/video_subcrop.py | Rukaume/LRCN | 0d1928cc72544f59a4335fea7febc561d3dfc118 | [
"MIT"
] | 1 | 2020-11-07T00:30:22.000Z | 2021-01-26T02:22:16.000Z | Data_preparation/test/video_subcrop.py | Rukaume/LRCN | 0d1928cc72544f59a4335fea7febc561d3dfc118 | [
"MIT"
] | 1 | 2020-11-07T05:57:52.000Z | 2020-11-07T05:57:52.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 21:19:37 2020
@author: miyazakishinichi
"""
import pandas as pd
from tkinter import messagebox
from tkinter import filedialog
import tkinter
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import os, sys, cv2
from tq... | 27.028169 | 71 | 0.668056 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 21:19:37 2020
@author: miyazakishinichi
"""
import pandas as pd
from tkinter import messagebox
from tkinter import filedialog
import tkinter
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import os, sys, cv2
from tq... | 310 | 0 | 23 |
aedaa1eb60c8454a5adaa3d060aa87eba4684ba7 | 207 | py | Python | getFrame.py | divakar-lakhera/Partial-Encryption | 0fc6537b4a23848b21618e906a22920bd00b7c41 | [
"MIT"
] | null | null | null | getFrame.py | divakar-lakhera/Partial-Encryption | 0fc6537b4a23848b21618e906a22920bd00b7c41 | [
"MIT"
] | null | null | null | getFrame.py | divakar-lakhera/Partial-Encryption | 0fc6537b4a23848b21618e906a22920bd00b7c41 | [
"MIT"
] | null | null | null |
import cv2
INPUT_FILE='input_encode.avi'
FRAME_NUMBER=70
cap=cv2.VideoCapture(INPUT_FILE)
cap.set(cv2.CAP_PROP_POS_FRAMES, FRAME_NUMBER)
ret,frame=cap.read()
cv2.imwrite("frame_"+INPUT_FILE+".png",frame)
| 18.818182 | 46 | 0.797101 |
import cv2
INPUT_FILE='input_encode.avi'
FRAME_NUMBER=70
cap=cv2.VideoCapture(INPUT_FILE)
cap.set(cv2.CAP_PROP_POS_FRAMES, FRAME_NUMBER)
ret,frame=cap.read()
cv2.imwrite("frame_"+INPUT_FILE+".png",frame)
| 0 | 0 | 0 |
78169f18b371e12087115a1c033f6919a0a32815 | 27,978 | py | Python | brainda/algorithms/decomposition/csp.py | TBC-TJU/MetaBCI-brainda | d2dc655163b771ca22e43432d886ece3d98235c8 | [
"MIT"
] | null | null | null | brainda/algorithms/decomposition/csp.py | TBC-TJU/MetaBCI-brainda | d2dc655163b771ca22e43432d886ece3d98235c8 | [
"MIT"
] | null | null | null | brainda/algorithms/decomposition/csp.py | TBC-TJU/MetaBCI-brainda | d2dc655163b771ca22e43432d886ece3d98235c8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Authors: Swolf <swolfforever@gmail.com>
# Date: 2021/1/07
# License: MIT License
"""
Common Spatial Patterns and his happy little buddies!
"""
from copy import deepcopy
from typing import Union, Optional, List, Dict, Tuple
from functools import partial
import numpy as np
from numpy import ... | 36.240933 | 315 | 0.589356 | # -*- coding: utf-8 -*-
#
# Authors: Swolf <swolfforever@gmail.com>
# Date: 2021/1/07
# License: MIT License
"""
Common Spatial Patterns and his happy little buddies!
"""
from copy import deepcopy
from typing import Union, Optional, List, Dict, Tuple
from functools import partial
import numpy as np
from numpy import ... | 9,176 | 35 | 446 |
a213ac945ac3eff393596fccbd49623779d35895 | 16,917 | py | Python | teller/explainer/explainer.py | Techtonique/teller | 3571353b843179335e3995a0128d4a0c54c2b905 | [
"BSD-3-Clause-Clear"
] | 5 | 2021-07-14T11:57:36.000Z | 2022-03-26T19:47:54.000Z | teller/explainer/explainer.py | Techtonique/teller | 3571353b843179335e3995a0128d4a0c54c2b905 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-12-21T17:53:37.000Z | 2022-01-26T11:36:32.000Z | teller/explainer/explainer.py | Techtonique/teller | 3571353b843179335e3995a0128d4a0c54c2b905 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-12-21T17:51:00.000Z | 2021-12-21T17:51:00.000Z | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.style as style
from sklearn.base import BaseEstimator
from ..utils import (
is_factor,
numerical_gradient,
numerical_gradient_jackknife,
numerical_gradient_gaussian,
numerical_interactions,... | 32.284351 | 131 | 0.435952 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.style as style
from sklearn.base import BaseEstimator
from ..utils import (
is_factor,
numerical_gradient,
numerical_gradient_jackknife,
numerical_gradient_gaussian,
numerical_interactions,... | 748 | 0 | 93 |
70d25e9deb9ce5482aecfe92367ea925fc132f5b | 4,271 | py | Python | script/extract_spotting_area.py | jingyonghou/XY_QByE_STD | ca2a07c70ea7466ee363cd0b81808c6794a400e5 | [
"Apache-2.0"
] | null | null | null | script/extract_spotting_area.py | jingyonghou/XY_QByE_STD | ca2a07c70ea7466ee363cd0b81808c6794a400e5 | [
"Apache-2.0"
] | null | null | null | script/extract_spotting_area.py | jingyonghou/XY_QByE_STD | ca2a07c70ea7466ee363cd0b81808c6794a400e5 | [
"Apache-2.0"
] | 1 | 2020-07-28T06:02:03.000Z | 2020-07-28T06:02:03.000Z | import numpy as np
import sys
import wavedata
import random
import os
if __name__=="__main__":
if len(sys.argv) < 7:
print("USAGE: python %s result_dir keywordlist testlist testscp textfile ourdir"%sys.argv[0])
exit(1)
result_dir = sys.argv[1]
keywordlist = open(sys.argv[2]).readline... | 36.818966 | 199 | 0.618356 | import numpy as np
import sys
import wavedata
import random
import os
def relevant(query, text_id, relevant_dict):
if text_id in relevant_dict[query]:
return True
return False
def build_relevant_dict(text_file):
relevant_dict = {}
for line in open(text_file).readlines():
fields = line.... | 2,873 | 0 | 116 |
271deb29b66fe4e4014e52baf2d9509cf8f631f6 | 427 | py | Python | src/smallest_integer.py | marco-zangari/code-katas | 1dfda1cfbbe8687b17e97e414358b38d964df675 | [
"MIT"
] | null | null | null | src/smallest_integer.py | marco-zangari/code-katas | 1dfda1cfbbe8687b17e97e414358b38d964df675 | [
"MIT"
] | null | null | null | src/smallest_integer.py | marco-zangari/code-katas | 1dfda1cfbbe8687b17e97e414358b38d964df675 | [
"MIT"
] | null | null | null | """Find the smallest integer in the array, Kata in Codewars."""
def smallest(alist):
"""Return the smallest integer in the list.
input: a list of integers
output: a single integer
ex: [34, 15, 88, 2] should return 34
ex: [34, -345, -1, 100] should return -345
"""
res = [alist[0]]
for ... | 23.722222 | 63 | 0.569087 | """Find the smallest integer in the array, Kata in Codewars."""
def smallest(alist):
"""Return the smallest integer in the list.
input: a list of integers
output: a single integer
ex: [34, 15, 88, 2] should return 34
ex: [34, -345, -1, 100] should return -345
"""
res = [alist[0]]
for ... | 0 | 0 | 0 |
e3f4e7de367fe4adbb1c08ed45342cc24a82354b | 1,810 | py | Python | extract-code.py | aaw/commafree | 6ee17fdf1e7858546782f81b1f004659c03661d3 | [
"Unlicense"
] | null | null | null | extract-code.py | aaw/commafree | 6ee17fdf1e7858546782f81b1f004659c03661d3 | [
"Unlicense"
] | null | null | null | extract-code.py | aaw/commafree | 6ee17fdf1e7858546782f81b1f004659c03661d3 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
# Extracts a commafree code from a CNF file created by commafree.py and
# the output of a SAT solver on that CNF file. Only works on satisfiable
# instances.
#
# Usage: extract-code.py <cnf-file> <sat-solver-output-file>
import re
import sys
if __name__ == '__main__':
if len(sys.argv) < 3:
... | 31.754386 | 78 | 0.570718 | #!/usr/bin/python3
# Extracts a commafree code from a CNF file created by commafree.py and
# the output of a SAT solver on that CNF file. Only works on satisfiable
# instances.
#
# Usage: extract-code.py <cnf-file> <sat-solver-output-file>
import re
import sys
def strip_cnf_mapping(filename):
# lines look like '... | 1,004 | 0 | 69 |
31784bf0310bf0d5bfc0d90a75df67dd15a12b22 | 2,039 | py | Python | bindings/python/native/tests/test_event.py | lmy441900/wallet.rs | 4810f8205c3a3e1b7177d5fc6be92c714e0ef6eb | [
"Apache-2.0"
] | 135 | 2020-08-27T15:31:16.000Z | 2022-03-28T07:52:07.000Z | bindings/python/native/tests/test_event.py | lmy441900/wallet.rs | 4810f8205c3a3e1b7177d5fc6be92c714e0ef6eb | [
"Apache-2.0"
] | 263 | 2020-08-28T00:12:19.000Z | 2022-03-29T18:54:29.000Z | bindings/python/native/tests/test_event.py | lmy441900/wallet.rs | 4810f8205c3a3e1b7177d5fc6be92c714e0ef6eb | [
"Apache-2.0"
] | 56 | 2020-11-02T05:52:06.000Z | 2022-03-13T00:21:12.000Z | import iota_wallet as iw
| 31.369231 | 76 | 0.772928 | import iota_wallet as iw
def test_event_balance_change():
def on_balance_changed(event):
assert isinstance(event, str)
event_id = iw.on_balance_change(on_balance_changed)
iw.remove_balance_change_listener(bytes(event_id))
def test_event_new_transaction():
def on_new_transaction(event):
... | 1,798 | 0 | 207 |
6496c26b86b5e1c0f0f3e63c148cc42bb42f3e84 | 22,361 | py | Python | chrome/test/functional/autofill.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | 1 | 2015-10-12T09:14:22.000Z | 2015-10-12T09:14:22.000Z | chrome/test/functional/autofill.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | null | null | null | chrome/test/functional/autofill.py | meego-tablet-ux/meego-app-browser | 0f4ef17bd4b399c9c990a2f6ca939099495c2b9c | [
"BSD-3-Clause"
] | 1 | 2020-11-04T07:22:28.000Z | 2020-11-04T07:22:28.000Z | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import pickle
import re
import autofill_dataset_converter
import autofill_dataset_generator
import pyauto_fun... | 45.449187 | 80 | 0.653414 | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import pickle
import re
import autofill_dataset_converter
import autofill_dataset_generator
import pyauto_fun... | 0 | 0 | 0 |
707d8212ab78ecedd3b8526ac78feab6240c7ea9 | 531 | py | Python | test/utils/assertions.py | wileykestner/falcon-sqlalchemy-demo | a1c8bdf212bafc4b577dbebab57753d724871572 | [
"MIT"
] | 41 | 2016-10-21T04:08:05.000Z | 2020-11-27T22:07:18.000Z | test/utils/assertions.py | wileykestner/falcon-sqlalchemy-demo | a1c8bdf212bafc4b577dbebab57753d724871572 | [
"MIT"
] | null | null | null | test/utils/assertions.py | wileykestner/falcon-sqlalchemy-demo | a1c8bdf212bafc4b577dbebab57753d724871572 | [
"MIT"
] | 8 | 2017-12-19T21:56:49.000Z | 2022-01-30T12:29:05.000Z | import pytest
from test.utils.helpers import get_header_value, get_json_from_response
| 33.1875 | 91 | 0.783427 | import pytest
from test.utils.helpers import get_header_value, get_json_from_response
def assert_header_value(header_key, expected_value, response_headers):
header_value = get_header_value(header_key, response_headers)
if header_value is not None:
assert header_value == expected_value
else:
... | 396 | 0 | 46 |
818be53fc6b29242febd7a21069a6faefa42f81e | 616 | py | Python | src/lib/jeffos/user.py | JeffTheK/Jeff-OS | 8db91673c82bfad69076a10bce0ded376c0dd58b | [
"MIT"
] | null | null | null | src/lib/jeffos/user.py | JeffTheK/Jeff-OS | 8db91673c82bfad69076a10bce0ded376c0dd58b | [
"MIT"
] | null | null | null | src/lib/jeffos/user.py | JeffTheK/Jeff-OS | 8db91673c82bfad69076a10bce0ded376c0dd58b | [
"MIT"
] | null | null | null | from .__init__ import *
from .color import ERR | 29.333333 | 53 | 0.650974 | from .__init__ import *
from .color import ERR
def get_current_user() -> str:
if not os.path.isfile(OS_PATH+"sys/var/usr.cfg"):
print(ERR+"usr.cfg not found")
return "ERROR"
usr_cfg = open(OS_PATH+"sys/var/usr.cfg", 'r')
current_user = usr_cfg.readlines()[0].strip()
usr_cfg.close()
... | 524 | 0 | 46 |
8d53c50312ab63f92c7d0a794e02e685e48f61a5 | 17,069 | py | Python | fred/clients/eseries.py | dmpe/FRB | 692bcf576e17bd1a81db2b7644f4f61aeb39e5c7 | [
"MIT"
] | 107 | 2016-01-19T15:13:07.000Z | 2022-03-25T03:51:16.000Z | fred/clients/eseries.py | dmpe/FRB | 692bcf576e17bd1a81db2b7644f4f61aeb39e5c7 | [
"MIT"
] | 8 | 2016-02-05T20:07:51.000Z | 2021-08-11T17:05:02.000Z | fred/clients/eseries.py | dmpe/FRB | 692bcf576e17bd1a81db2b7644f4f61aeb39e5c7 | [
"MIT"
] | 37 | 2016-01-19T15:13:11.000Z | 2021-05-21T10:10:41.000Z |
from fred.utils import NamespacedClient, query_params
from fred.helpers import _get_request
class ESeriesClient(NamespacedClient):
"""
Class for working with FRED series
"""
@query_params('realtime_start','realtime_end')
def details(self,series_id=None,response_type=None,params=None):
"""... | 61.399281 | 127 | 0.656629 |
from fred.utils import NamespacedClient, query_params
from fred.helpers import _get_request
class ESeriesClient(NamespacedClient):
"""
Class for working with FRED series
"""
@query_params('realtime_start','realtime_end')
def details(self,series_id=None,response_type=None,params=None):
"""... | 0 | 0 | 0 |
d1839a3279a5cf65bd5fa7efd4fde3026ed8d45c | 9,871 | py | Python | ke/images/python/cluster_tool.py | justasabc/kubernetes-ubuntu | afc670297a5becb2fcb4404c3ee1e02c99b5eaf4 | [
"Apache-2.0"
] | 1 | 2020-10-18T01:34:39.000Z | 2020-10-18T01:34:39.000Z | ke/images/python/cluster_tool.py | justasabc/kubernetes-ubuntu | afc670297a5becb2fcb4404c3ee1e02c99b5eaf4 | [
"Apache-2.0"
] | null | null | null | ke/images/python/cluster_tool.py | justasabc/kubernetes-ubuntu | afc670297a5becb2fcb4404c3ee1e02c99b5eaf4 | [
"Apache-2.0"
] | null | null | null | """
Class Hierarchy
G{classtree: BaseTool}
Package tree
G{packagetree: cluster_tool}
Import Graph
G{importgraph: cluster_tool}
"""
#/usr/bin/python
# -*- coding:utf-8 -*-
import subprocess
from json_generator import JsonGenerator
from container_client import ContainerClient
DOCKER_SERVER_URL = 'tcp://master:23... | 34.757042 | 141 | 0.668727 | """
Class Hierarchy
G{classtree: BaseTool}
Package tree
G{packagetree: cluster_tool}
Import Graph
G{importgraph: cluster_tool}
"""
#/usr/bin/python
# -*- coding:utf-8 -*-
import subprocess
from json_generator import JsonGenerator
from container_client import ContainerClient
DOCKER_SERVER_URL = 'tcp://master:23... | 6,544 | 32 | 1,090 |
82c4e1c9d79324cfb9f7ba26f995247d4d54ad9e | 333 | py | Python | utils.py | liliangbin/faceRecognition | 077e070b42fb8aa8868c604863858a177c178ec7 | [
"Apache-2.0"
] | 4 | 2019-06-30T13:04:30.000Z | 2021-04-18T08:01:55.000Z | utils.py | liliangbin/faceRecognition | 077e070b42fb8aa8868c604863858a177c178ec7 | [
"Apache-2.0"
] | null | null | null | utils.py | liliangbin/faceRecognition | 077e070b42fb8aa8868c604863858a177c178ec7 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
| 27.75 | 57 | 0.708709 | import matplotlib.pyplot as plt
def show_train_history(train_history, train, validation):
plt.plot(train_history.history[train])
plt.plot(train_history.history[validation])
plt.title('train history')
plt.ylabel(train)
plt.xlabel('epoch')
plt.legend(['train', 'validation'], loc='upper left')
... | 277 | 0 | 23 |
4311beaaf96391f1dec77dcb15a6c9c8eec39f67 | 239 | py | Python | cli/__init__.py | Polsaker/throat | 39fd66efb7251f1607d9bf9e407e0cbbdfc10c57 | [
"MIT"
] | 8 | 2019-05-27T19:34:25.000Z | 2020-03-01T19:06:48.000Z | cli/__init__.py | Polsaker/throat | 39fd66efb7251f1607d9bf9e407e0cbbdfc10c57 | [
"MIT"
] | null | null | null | cli/__init__.py | Polsaker/throat | 39fd66efb7251f1607d9bf9e407e0cbbdfc10c57 | [
"MIT"
] | 7 | 2019-05-29T17:12:40.000Z | 2020-05-01T16:41:16.000Z | from .recount import recount
from .admin import admin
from .default import default
from .migration import migration
from .translations import translations
commands = [
migration,
recount,
admin,
default,
translations
]
| 18.384615 | 38 | 0.74477 | from .recount import recount
from .admin import admin
from .default import default
from .migration import migration
from .translations import translations
commands = [
migration,
recount,
admin,
default,
translations
]
| 0 | 0 | 0 |
500d465798a7caedef8ae7ce212b2a7ab666165d | 1,078 | py | Python | madrona/common/assets.py | movermeyer/madrona | fcdced0a03408754b88a3d88f416e04d500c32d4 | [
"BSD-3-Clause"
] | 9 | 2015-03-09T11:04:21.000Z | 2022-01-16T09:45:36.000Z | madrona/common/assets.py | movermeyer/madrona | fcdced0a03408754b88a3d88f416e04d500c32d4 | [
"BSD-3-Clause"
] | 1 | 2020-04-24T14:38:43.000Z | 2020-04-24T14:38:43.000Z | madrona/common/assets.py | movermeyer/madrona | fcdced0a03408754b88a3d88f416e04d500c32d4 | [
"BSD-3-Clause"
] | 2 | 2016-12-06T15:31:35.000Z | 2018-03-04T20:04:44.000Z | from elementtree import ElementTree as et
import os
ROOT_PATH = ''
def get_js_files():
"""Returns a list of all the javascript files listed in
media/js_includes.xml"""
files = []
path = os.path.dirname(os.path.abspath(__file__))
tree = et.parse(path + '/../media/js_includes.xml')
for f in tre... | 30.8 | 65 | 0.646568 | from elementtree import ElementTree as et
import os
ROOT_PATH = ''
def get_js_files():
"""Returns a list of all the javascript files listed in
media/js_includes.xml"""
files = []
path = os.path.dirname(os.path.abspath(__file__))
tree = et.parse(path + '/../media/js_includes.xml')
for f in tre... | 0 | 0 | 0 |
48a887f207778a7c4e05b2e0a8a7e32643674841 | 1,018 | py | Python | tests/conf/config.py | robert-werner/fastapi-crudrouter | 4f924307b53e5ea1adaa509302800c060ee7d06a | [
"MIT"
] | null | null | null | tests/conf/config.py | robert-werner/fastapi-crudrouter | 4f924307b53e5ea1adaa509302800c060ee7d06a | [
"MIT"
] | null | null | null | tests/conf/config.py | robert-werner/fastapi-crudrouter | 4f924307b53e5ea1adaa509302800c060ee7d06a | [
"MIT"
] | null | null | null | import os
import pathlib
ENV_FILE_PATH = pathlib.Path(__file__).parent / "dev.env"
assert ENV_FILE_PATH.exists()
| 27.513514 | 150 | 0.574656 | import os
import pathlib
ENV_FILE_PATH = pathlib.Path(__file__).parent / "dev.env"
assert ENV_FILE_PATH.exists()
class BaseConfig:
POSTGRES_HOST = ""
POSTGRES_USER = ""
POSTGRES_PASSWORD = ""
POSTGRES_DB = ""
POSTGRES_PORT = ""
def __init__(self):
self._apply_dot_env()
self.... | 685 | 194 | 23 |
530a06fbf60cdea98dfb1c9085cf498b370520c5 | 3,958 | py | Python | .2lanemdr/2lanemdr.py | hemidactylus/nbws1 | 282cc2f0d5c04f5fc818f3e411dfb5b549ea47f6 | [
"Apache-2.0"
] | null | null | null | .2lanemdr/2lanemdr.py | hemidactylus/nbws1 | 282cc2f0d5c04f5fc818f3e411dfb5b549ea47f6 | [
"Apache-2.0"
] | null | null | null | .2lanemdr/2lanemdr.py | hemidactylus/nbws1 | 282cc2f0d5c04f5fc818f3e411dfb5b549ea47f6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import re
import os
import sys
import json
import subprocess
DEF_FILE = '.2lane.info'
DIRECTIVE_TEMPLATE = '<!-- 2L {body} -->'
TYPO_WARNING_FINDER = re.compile('\W2L\W', re.IGNORECASE)
MESSAGE_TEMPLATE = '** 2lanemdr {kind} on {filename}:{linenumber} "{message}"'
def parseDirective(line, wrcs):
... | 29.984848 | 80 | 0.490904 | #!/usr/bin/python
import re
import os
import sys
import json
import subprocess
DEF_FILE = '.2lane.info'
DIRECTIVE_TEMPLATE = '<!-- 2L {body} -->'
TYPO_WARNING_FINDER = re.compile('\W2L\W', re.IGNORECASE)
MESSAGE_TEMPLATE = '** 2lanemdr {kind} on {filename}:{linenumber} "{message}"'
def parseDirective(line, wrcs):
... | 525 | 0 | 70 |
9903ff1dd556a8dc9bf96c9260ccd0029845f009 | 4,704 | py | Python | utils.py | menpo/menpo-admin | 41cb5ab9aa56c3df26e7bfbf43a56a0cbd5f9674 | [
"BSD-3-Clause"
] | null | null | null | utils.py | menpo/menpo-admin | 41cb5ab9aa56c3df26e7bfbf43a56a0cbd5f9674 | [
"BSD-3-Clause"
] | 1 | 2017-01-24T11:17:03.000Z | 2017-01-24T11:17:03.000Z | utils.py | menpo/menpo-admin | 41cb5ab9aa56c3df26e7bfbf43a56a0cbd5f9674 | [
"BSD-3-Clause"
] | null | null | null | import os
import subprocess
from subprocess import CalledProcessError
from functools import partial
from collections import namedtuple
Project = namedtuple('Project', ['name', 'versions'])
# all projects using condaci along with the Python version they
# need. Note that for non-python projects we can choose any singl... | 29.4 | 71 | 0.51892 | import os
import subprocess
from subprocess import CalledProcessError
from functools import partial
from collections import namedtuple
Project = namedtuple('Project', ['name', 'versions'])
# all projects using condaci along with the Python version they
# need. Note that for non-python projects we can choose any singl... | 1,511 | 0 | 211 |
51009389239cc5dc8055739ff5e46bb49c3c734e | 4,566 | py | Python | scripts/bench/4_latencybreakdown.py | sirikata/sirikata | 3a0d54a8c4778ad6e25ef031d461b2bc3e264860 | [
"BSD-3-Clause"
] | 31 | 2015-01-28T17:01:10.000Z | 2021-11-04T08:30:37.000Z | scripts/bench/4_latencybreakdown.py | pathorn/sirikata | 5d366a822ef2fb57cd9f64cc4f6085c0a635fdfa | [
"BSD-3-Clause"
] | null | null | null | scripts/bench/4_latencybreakdown.py | pathorn/sirikata | 5d366a822ef2fb57cd9f64cc4f6085c0a635fdfa | [
"BSD-3-Clause"
] | 9 | 2015-08-02T18:39:49.000Z | 2019-10-11T10:32:30.000Z | #!/usr/bin/python
# flow_fairness.py
#
# Runs a simulation with objects continually messaging each other.
# The analysis then generates statistics about the actual rates
# achieved and the weights. The output can be used to generate
# fairness graphs.
import sys
import subprocess
import os.path
# FIXME It would be ... | 31.489655 | 112 | 0.622646 | #!/usr/bin/python
# flow_fairness.py
#
# Runs a simulation with objects continually messaging each other.
# The analysis then generates statistics about the actual rates
# achieved and the weights. The output can be used to generate
# fairness graphs.
import sys
import subprocess
import os.path
# FIXME It would be ... | 1,015 | 30 | 48 |
733ac65472342a53c51bb203028ce20ee9757d52 | 3,537 | py | Python | python/sparkdl/transformers/keras_applications.py | alonsoir/spark-deep-learning | 3f668d9b4a0aa2ef6fe05df5bf5c1d705cd2530d | [
"Apache-2.0"
] | 54 | 2017-10-12T04:42:18.000Z | 2021-08-24T08:47:03.000Z | python/sparkdl/transformers/keras_applications.py | alonsoir/spark-deep-learning | 3f668d9b4a0aa2ef6fe05df5bf5c1d705cd2530d | [
"Apache-2.0"
] | null | null | null | python/sparkdl/transformers/keras_applications.py | alonsoir/spark-deep-learning | 3f668d9b4a0aa2ef6fe05df5bf5c1d705cd2530d | [
"Apache-2.0"
] | 17 | 2017-10-12T07:34:10.000Z | 2020-03-12T12:25:25.000Z | # Copyright 2017 Databricks, 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 writin... | 31.300885 | 91 | 0.685327 | # Copyright 2017 Databricks, 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 writin... | 1,583 | 619 | 305 |
006928383270000981141a2d160f55e1a9bc214b | 773 | py | Python | src/pyscripts/xsbs/plugins.py | harryd/xsbs-minimal | aaceaeda1d3fe6cdd7182484989eaa74e9ae9518 | [
"BSD-3-Clause"
] | 1 | 2018-05-22T13:42:47.000Z | 2018-05-22T13:42:47.000Z | src/pyscripts/xsbs/plugins.py | harryd/xsbs-minimal | aaceaeda1d3fe6cdd7182484989eaa74e9ae9518 | [
"BSD-3-Clause"
] | null | null | null | src/pyscripts/xsbs/plugins.py | harryd/xsbs-minimal | aaceaeda1d3fe6cdd7182484989eaa74e9ae9518 | [
"BSD-3-Clause"
] | null | null | null | from elixir import setup_all, create_all
import os, sys
# Initialize these before loading plugins
import xsbs.db
import xsbs.events
import xsbs.log
import xsbs.ban
import xsbs.users
import xsbs.server
import xsbs.game
import xsbs.teamcontrol
import xsbs.persistteam
import xsbs.demo
import xsbs.http
import xsbs.http.js... | 21.472222 | 113 | 0.756792 | from elixir import setup_all, create_all
import os, sys
# Initialize these before loading plugins
import xsbs.db
import xsbs.events
import xsbs.log
import xsbs.ban
import xsbs.users
import xsbs.server
import xsbs.game
import xsbs.teamcontrol
import xsbs.persistteam
import xsbs.demo
import xsbs.http
import xsbs.http.js... | 339 | 7 | 92 |
67ea6b4220213acf076591a0da456dbff315ee05 | 8,959 | py | Python | fuzzytorch/monitors.py | opimentel-github/fuzzy-torch | 4f1e06e6fc445cdec23e9762ca20408feeb296e3 | [
"MIT"
] | 1 | 2021-03-12T08:49:15.000Z | 2021-03-12T08:49:15.000Z | fuzzytorch/monitors.py | opimentel-github/fuzzy-torch | 4f1e06e6fc445cdec23e9762ca20408feeb296e3 | [
"MIT"
] | null | null | null | fuzzytorch/monitors.py | opimentel-github/fuzzy-torch | 4f1e06e6fc445cdec23e9762ca20408feeb296e3 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import division
from . import _C
import os
import torch.nn as nn
import numpy as np
from . import losses as ft_losses
from . import metrics as ft_metrics
from . import optimizers as ft_optimizers
from . import exceptions as ex
import fuzzytools.files as files
from ... | 31.882562 | 147 | 0.724969 | from __future__ import print_function
from __future__ import division
from . import _C
import os
import torch.nn as nn
import numpy as np
from . import losses as ft_losses
from . import metrics as ft_metrics
from . import optimizers as ft_optimizers
from . import exceptions as ex
import fuzzytools.files as files
from ... | 7,539 | 5 | 665 |
9fca07bdb9a6dbdf43649b5340b88d177ac4d6ab | 7,256 | py | Python | leyline/tree_drawer.py | bentheiii/leyline | e9850b6f30a0aaa453ee1fcbd22fe6bf4c49ce0b | [
"MIT"
] | null | null | null | leyline/tree_drawer.py | bentheiii/leyline | e9850b6f30a0aaa453ee1fcbd22fe6bf4c49ce0b | [
"MIT"
] | null | null | null | leyline/tree_drawer.py | bentheiii/leyline | e9850b6f30a0aaa453ee1fcbd22fe6bf4c49ce0b | [
"MIT"
] | null | null | null | from _ast import AST, Return, Expr, Str, Call, Attribute, Name, Yield, Raise
from abc import ABC
from ast import parse, iter_child_nodes
from functools import reduce
import inspect
from textwrap import dedent
from typing import Type, List, Tuple, Collection, Optional
import re
from leyline import Node
from leyline.gvi... | 34.717703 | 114 | 0.570149 | from _ast import AST, Return, Expr, Str, Call, Attribute, Name, Yield, Raise
from abc import ABC
from ast import parse, iter_child_nodes
from functools import reduce
import inspect
from textwrap import dedent
from typing import Type, List, Tuple, Collection, Optional
import re
from leyline import Node
from leyline.gvi... | 6,228 | 359 | 252 |
3d55f92f4fbef80ed3856d2d699e6a8ff8285101 | 675 | py | Python | zip_function.py | sm1216/python | ccb78875dcb95cc18bf8d2a66896dedbb0fe7b41 | [
"MIT"
] | null | null | null | zip_function.py | sm1216/python | ccb78875dcb95cc18bf8d2a66896dedbb0fe7b41 | [
"MIT"
] | null | null | null | zip_function.py | sm1216/python | ccb78875dcb95cc18bf8d2a66896dedbb0fe7b41 | [
"MIT"
] | null | null | null | list1 =[1,2,3]
list2 =["one","two","three"]
zipped = list(zip(list1,list2))
print(zipped)
print("####################")
unzipped =list(zip(*zipped))
print(unzipped)
print("####################")
for (l1, l2) in zip(list1,list2):
print(l1)
print(l2)
print("####################")
items = [... | 21.09375 | 75 | 0.539259 | list1 =[1,2,3]
list2 =["one","two","three"]
zipped = list(zip(list1,list2))
print(zipped)
print("####################")
unzipped =list(zip(*zipped))
print(unzipped)
print("####################")
for (l1, l2) in zip(list1,list2):
print(l1)
print(l2)
print("####################")
items = [... | 0 | 0 | 0 |
3ba318c481e1408482608b403e889b6d462281f5 | 988 | py | Python | examples/bokeh_interactive_units.py | Narsil/chempy | ac7217f45a8cfe3b11ca771f78f0a04c07708818 | [
"BSD-2-Clause"
] | null | null | null | examples/bokeh_interactive_units.py | Narsil/chempy | ac7217f45a8cfe3b11ca771f78f0a04c07708818 | [
"BSD-2-Clause"
] | null | null | null | examples/bokeh_interactive_units.py | Narsil/chempy | ac7217f45a8cfe3b11ca771f78f0a04c07708818 | [
"BSD-2-Clause"
] | 1 | 2022-03-21T09:01:48.000Z | 2022-03-21T09:01:48.000Z | """
Interactive kinetics app with sliders (with units).
Start by runing:
$ bokeh serve interactive.py
Add --show argument or navigate to:
http://localhost:5006/interactive
"""
from collections import defaultdict
import sys
from chempy.util.bkh import integration_with_sliders
from chempy.units import SI_base_re... | 29.058824 | 84 | 0.672065 | """
Interactive kinetics app with sliders (with units).
Start by runing:
$ bokeh serve interactive.py
Add --show argument or navigate to:
http://localhost:5006/interactive
"""
from collections import defaultdict
import sys
from chempy.util.bkh import integration_with_sliders
from chempy.units import SI_base_re... | 0 | 0 | 0 |
fc603a336d6907b4650063f43483887c9a02976b | 4,693 | py | Python | renku/cli/_config.py | jirikuncar/renku-python | 69df9ea1d5db3c63fd2ea3537c7e46d079360c8f | [
"Apache-2.0"
] | 2 | 2019-03-09T17:56:57.000Z | 2019-07-03T15:20:22.000Z | renku/cli/_config.py | jirikuncar/renku-python | 69df9ea1d5db3c63fd2ea3537c7e46d079360c8f | [
"Apache-2.0"
] | null | null | null | renku/cli/_config.py | jirikuncar/renku-python | 69df9ea1d5db3c63fd2ea3537c7e46d079360c8f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2017 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | 29.149068 | 75 | 0.680162 | # -*- coding: utf-8 -*-
#
# Copyright 2017 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | 974 | 0 | 26 |
a8139ae5acfd5b3b05d97a8c89429570e88de8c3 | 2,016 | py | Python | JaroEliCall/src/wrapped_interfaces/login_wrapped_ui.py | jaroslaw-wieczorek/Project_IP_Telephony_Python_Voip | 05143356fe91f745c286db8c3e2432714ab122e7 | [
"MIT"
] | null | null | null | JaroEliCall/src/wrapped_interfaces/login_wrapped_ui.py | jaroslaw-wieczorek/Project_IP_Telephony_Python_Voip | 05143356fe91f745c286db8c3e2432714ab122e7 | [
"MIT"
] | null | null | null | JaroEliCall/src/wrapped_interfaces/login_wrapped_ui.py | jaroslaw-wieczorek/Project_IP_Telephony_Python_Voip | 05143356fe91f745c286db8c3e2432714ab122e7 | [
"MIT"
] | 1 | 2018-03-20T21:22:40.000Z | 2018-03-20T21:22:40.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 30 18:49:11 2018
@author: afar
"""
import os
import sys
import hashlib
from PyQt5.QtWidgets import QDialog
from PyQt5.QtWidgets import QStatusBar
# importing data accc
lib_path = os.path.abspath(os.path.join(__file__, '..', '..', '..'))
sys.path.... | 25.518987 | 85 | 0.632937 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 30 18:49:11 2018
@author: afar
"""
import os
import sys
import hashlib
from PyQt5.QtWidgets import QDialog
from PyQt5.QtWidgets import QStatusBar
# importing data accc
lib_path = os.path.abspath(os.path.join(__file__, '..', '..', '..'))
sys.path.... | 1,047 | 34 | 422 |