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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3e9e7b05c50154f1786818941676949cdcb37843 | 10,027 | py | Python | snp_pipeline/scripts/snp_subsample.py | kelly-sovacool/tiger_salamander_project | fa795f4488aab73564d563c268f1c88969bd2abc | [
"MIT"
] | 1 | 2022-01-31T08:01:12.000Z | 2022-01-31T08:01:12.000Z | snp_pipeline/scripts/snp_subsample.py | kelly-sovacool/tiger_salamander_project | fa795f4488aab73564d563c268f1c88969bd2abc | [
"MIT"
] | null | null | null | snp_pipeline/scripts/snp_subsample.py | kelly-sovacool/tiger_salamander_project | fa795f4488aab73564d563c268f1c88969bd2abc | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
"""
Author: Kelly Sovacool
Email: kellysovacool@uky.edu
28 Sep 2017
Usage:
snp_subsample.py <snp-sites-dir> <output-filename-base> [--abundance-filter=<percent-cutoff> --output-filtered-fasta-dir=<filtered_dir> --skip-filter --num_subsamples=<num> --all-snps-all-loci --missing-cutoff=<perc... | 43.406926 | 263 | 0.61863 | #!/usr/local/bin/python3
"""
Author: Kelly Sovacool
Email: kellysovacool@uky.edu
28 Sep 2017
Usage:
snp_subsample.py <snp-sites-dir> <output-filename-base> [--abundance-filter=<percent-cutoff> --output-filtered-fasta-dir=<filtered_dir> --skip-filter --num_subsamples=<num> --all-snps-all-loci --missing-cutoff=<perc... | 7,744 | 245 | 371 |
d17a5c18fe9d56b7bb799e31cc9d3d646de88110 | 2,312 | py | Python | tests/test_models.py | rekt-hard/invenio-userprofiles | 69cbe381a35aca98d398a9673af351b672d41b70 | [
"MIT"
] | null | null | null | tests/test_models.py | rekt-hard/invenio-userprofiles | 69cbe381a35aca98d398a9673af351b672d41b70 | [
"MIT"
] | null | null | null | tests/test_models.py | rekt-hard/invenio-userprofiles | 69cbe381a35aca98d398a9673af351b672d41b70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Tests for user profile models."""
import pytest
from invenio_accounts.models impo... | 31.671233 | 72 | 0.679498 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Tests for user profile models."""
import pytest
from invenio_accounts.models impo... | 0 | 0 | 0 |
881d4e01c75cf326258781678b4a1ae10cc19b02 | 3,236 | py | Python | libraries/logger.py | tede12/DCNFT | 21871b5abec0498ab4402eae0939a4c212025f53 | [
"MIT"
] | 3 | 2021-11-06T13:17:07.000Z | 2022-03-14T00:01:03.000Z | libraries/logger.py | tede12/DCNFT | 21871b5abec0498ab4402eae0939a4c212025f53 | [
"MIT"
] | null | null | null | libraries/logger.py | tede12/DCNFT | 21871b5abec0498ab4402eae0939a4c212025f53 | [
"MIT"
] | null | null | null | import datetime
import logging
import time
from colorama import Fore
logging.getLogger('filelock').propagate = False
logging.basicConfig(
# filename='logger.log',
level=logging.INFO,
format='%(message)s'
)
logger = Logger(classic=True, logger_name='Default-Logger')
| 29.962963 | 93 | 0.545426 | import datetime
import logging
import time
from colorama import Fore
logging.getLogger('filelock').propagate = False
logging.basicConfig(
# filename='logger.log',
level=logging.INFO,
format='%(message)s'
)
class Logger:
def __init__(
self, logger_name='Unknown',
classic=False... | 2,678 | 252 | 23 |
96fa01033fa1760e78f5335d4f5adf4376fecb7e | 1,557 | py | Python | test/train/test_train_pairwise_similarity_model.py | mski-iksm/redshells | 1e956fed9b000ea3f6ba1c96e25d5dd953025155 | [
"MIT"
] | null | null | null | test/train/test_train_pairwise_similarity_model.py | mski-iksm/redshells | 1e956fed9b000ea3f6ba1c96e25d5dd953025155 | [
"MIT"
] | null | null | null | test/train/test_train_pairwise_similarity_model.py | mski-iksm/redshells | 1e956fed9b000ea3f6ba1c96e25d5dd953025155 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import MagicMock
import luigi
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from redshells.train import TrainPairwiseSimilarityModel
if __name__ == '__main__':
unittest.main()
| 29.942308 | 91 | 0.654464 | import unittest
from unittest.mock import MagicMock
import luigi
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from redshells.train import TrainPairwiseSimilarityModel
class _DummyTask(luigi.Task):
pass
class TrainPairwiseSimilarityModelTest(unittest.TestCase):
def setUp(self):
... | 1,103 | 54 | 153 |
43eaa90c3a6818bcb51d39cbf7858f129021fbc3 | 641 | py | Python | tests/queued_scheduler_cancel.py | Gelbpunkt/aiosched | 8bb46be71894c022ce4862212c39636c5789a181 | [
"MIT"
] | 18 | 2020-05-16T18:46:14.000Z | 2022-03-19T18:12:16.000Z | tests/queued_scheduler_cancel.py | Gelbpunkt/aiosched | 8bb46be71894c022ce4862212c39636c5789a181 | [
"MIT"
] | 2 | 2020-10-02T14:35:04.000Z | 2021-12-27T20:47:16.000Z | tests/queued_scheduler_cancel.py | Gelbpunkt/aiosched | 8bb46be71894c022ce4862212c39636c5789a181 | [
"MIT"
] | 4 | 2020-05-29T19:12:07.000Z | 2021-04-13T13:12:10.000Z | import asyncio
import sys
sys.path.insert(0, ".")
from aioscheduler import QueuedScheduler
asyncio.run(main())
| 19.424242 | 49 | 0.659906 | import asyncio
import sys
sys.path.insert(0, ".")
from aioscheduler import QueuedScheduler
async def work(n: int) -> None:
await asyncio.sleep(60)
print(f"I am doing heavy work: {n}")
async def main() -> None:
scheduler = QueuedScheduler()
scheduler.start()
tasks = []
for i in range(50):
... | 478 | 0 | 46 |
ed3567225d39db8ffdd0344dc4b4954ff74e2d7f | 841 | py | Python | FaceDetector.py | rcorvus/R2PY | bb06fba4e73f09095393813ec06dec0a9a49362f | [
"MIT"
] | 4 | 2019-04-21T14:04:56.000Z | 2019-04-22T16:32:17.000Z | FaceDetector.py | rcorvus/R2PY | bb06fba4e73f09095393813ec06dec0a9a49362f | [
"MIT"
] | null | null | null | FaceDetector.py | rcorvus/R2PY | bb06fba4e73f09095393813ec06dec0a9a49362f | [
"MIT"
] | null | null | null | import cv2
| 36.565217 | 101 | 0.585018 | import cv2
class FaceDetector:
def __init__(self, faceCascadePath):
# load the face detector
try:
self.faceCascade = cv2.CascadeClassifier(faceCascadePath)
except:
print("CascadeClassifier failed to load")
def detect(self, image, scaleFactor=1.1, minNeighbors=5,... | 756 | -2 | 76 |
969efcfd98765aae0d9f785d6b09b86bc9087f0a | 6,120 | py | Python | Subreddit.py | LeBruitDesBots/airAnnuaire | fc03a8b38a9e5401bf09b9a3456bccdef158b03a | [
"0BSD"
] | null | null | null | Subreddit.py | LeBruitDesBots/airAnnuaire | fc03a8b38a9e5401bf09b9a3456bccdef158b03a | [
"0BSD"
] | null | null | null | Subreddit.py | LeBruitDesBots/airAnnuaire | fc03a8b38a9e5401bf09b9a3456bccdef158b03a | [
"0BSD"
] | 1 | 2020-05-29T09:16:51.000Z | 2020-05-29T09:16:51.000Z | # encoding: utf-8
from enum import Enum
from datetime import datetime, timedelta
import math
import pprint
from prawcore import exceptions
import langdetect
DAYS_IN_WEEK = 7
DAYS_IN_MONTH = 28
class Subreddit:
"""A class to retrieve and store information about subreddits"""
def auto_update(self, reddit, ... | 31.06599 | 101 | 0.605065 | # encoding: utf-8
from enum import Enum
from datetime import datetime, timedelta
import math
import pprint
from prawcore import exceptions
import langdetect
DAYS_IN_WEEK = 7
DAYS_IN_MONTH = 28
class SubredditStatus(Enum):
UNKNOWN = 0
PUBLIC = 1
RESTRICTED = 2
QUARANTINED = 3
PRIVATE = 4
BANN... | 4,208 | 156 | 293 |
9012b66c9db87f7ba18fc946415ee83d451d1d15 | 7,247 | py | Python | WORC/featureprocessing/Decomposition.py | MStarmans91/WORC | b6b8fc2ccb7d443a69b5ca20b1d6efb65b3f0fc7 | [
"ECL-2.0",
"Apache-2.0"
] | 47 | 2018-01-28T14:08:15.000Z | 2022-03-24T16:10:07.000Z | WORC/featureprocessing/Decomposition.py | JZK00/WORC | 14e8099835eccb35d49b52b97c0be64ecca3809c | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2018-08-28T13:32:57.000Z | 2020-10-26T16:35:59.000Z | WORC/featureprocessing/Decomposition.py | JZK00/WORC | 14e8099835eccb35d49b52b97c0be64ecca3809c | [
"ECL-2.0",
"Apache-2.0"
] | 16 | 2017-11-13T10:53:36.000Z | 2022-03-18T17:02:04.000Z | #!/usr/bin/env python
# Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | 38.547872 | 81 | 0.613357 | #!/usr/bin/env python
# Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | 0 | 0 | 0 |
703b2e178dfc582d43a9a15235386cc883ec6042 | 1,766 | py | Python | common/actor_critic.py | IanYHWu/msc_2021 | 0ae09ed392cce5fdf0e85d1f96b7af82900835f8 | [
"MIT"
] | null | null | null | common/actor_critic.py | IanYHWu/msc_2021 | 0ae09ed392cce5fdf0e85d1f96b7af82900835f8 | [
"MIT"
] | null | null | null | common/actor_critic.py | IanYHWu/msc_2021 | 0ae09ed392cce5fdf0e85d1f96b7af82900835f8 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from common.utils import init
class FixedCategorical(Categorical):
"""
Categorical distribution object
"""
class Categorical(nn.Module):
"""
Categorical distribution (NN module)
"""
| 26.358209 | 100 | 0.606455 | import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from common.utils import init
class CategoricalAC(nn.Module):
def __init__(self, base, recurrent, num_actions):
"""
embedder: (torch.Tensor) model to extract the embedding for observation - probably a... | 848 | 453 | 156 |
7073f16f06db3de1ab53d454e076544e515ab1d3 | 1,220 | py | Python | XML/XML_to_dict__xmltodict__examples/dict_to_xml__unparse.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | XML/XML_to_dict__xmltodict__examples/dict_to_xml__unparse.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | XML/XML_to_dict__xmltodict__examples/dict_to_xml__unparse.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://github.com/martinblech/xmltodict#roundtripping
# pip install xmltodict
import xmltodict
my_dict = {
'response': {
'status': 'good',
'last_updated': '2014-02-16T23:10:12Z',
}
}
print(xmltodict.unparse(... | 25.416667 | 109 | 0.663115 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://github.com/martinblech/xmltodict#roundtripping
# pip install xmltodict
import xmltodict
my_dict = {
'response': {
'status': 'good',
'last_updated': '2014-02-16T23:10:12Z',
}
}
print(xmltodict.unparse(... | 0 | 0 | 0 |
547250e28386f9801f70b2f1c41a9589aa802d7d | 15,648 | py | Python | resources/libraries/python/QemuManager.py | nidhyanandhan/csit | 2156583b4e66f2c3c35903c854b1823b76a4e9a6 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/QemuManager.py | nidhyanandhan/csit | 2156583b4e66f2c3c35903c854b1823b76a4e9a6 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/QemuManager.py | nidhyanandhan/csit | 2156583b4e66f2c3c35903c854b1823b76a4e9a6 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Cisco and/or its affiliates.
# 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... | 37.080569 | 79 | 0.522814 | # Copyright (c) 2020 Cisco and/or its affiliates.
# 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... | 0 | 0 | 0 |
ae12c915e418b34a08c739c078807fd4542718ed | 973 | py | Python | utvsapi/main.py | hroncok/utvsapi-eve | 83fcf9e1d14be2740cfec810c97f662a56a1a0ed | [
"MIT"
] | null | null | null | utvsapi/main.py | hroncok/utvsapi-eve | 83fcf9e1d14be2740cfec810c97f662a56a1a0ed | [
"MIT"
] | null | null | null | utvsapi/main.py | hroncok/utvsapi-eve | 83fcf9e1d14be2740cfec810c97f662a56a1a0ed | [
"MIT"
] | null | null | null | from eve import Eve
from eve_sqlalchemy import SQL
from eve_sqlalchemy.validation import ValidatorSQL
from sqlalchemy.engine.url import URL
try:
from eve_docs import eve_docs
from flask.ext.bootstrap import Bootstrap
except ImportError:
Bootstrap = None
from utvsapi.tables import domain, Base, on_fetched_... | 24.948718 | 79 | 0.758479 | from eve import Eve
from eve_sqlalchemy import SQL
from eve_sqlalchemy.validation import ValidatorSQL
from sqlalchemy.engine.url import URL
try:
from eve_docs import eve_docs
from flask.ext.bootstrap import Bootstrap
except ImportError:
Bootstrap = None
from utvsapi.tables import domain, Base, on_fetched_... | 0 | 0 | 0 |
bcbe3aaf1f6e1214c4258ecc1fbd37b90e14f66f | 600 | py | Python | class1/create_yaml_json.py | hyoung-dpl/pynet | 3171268fd44bffef4a42e5381f11f2aae7b338d6 | [
"Apache-2.0"
] | null | null | null | class1/create_yaml_json.py | hyoung-dpl/pynet | 3171268fd44bffef4a42e5381f11f2aae7b338d6 | [
"Apache-2.0"
] | null | null | null | class1/create_yaml_json.py | hyoung-dpl/pynet | 3171268fd44bffef4a42e5381f11f2aae7b338d6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
Write to a yaml and json file for a list and dictionary variable
'''
import yaml
import json
if __name__ == "__main__":
main()
| 17.647059 | 66 | 0.64 | #!/usr/bin/env python
'''
Write to a yaml and json file for a list and dictionary variable
'''
import yaml
import json
def main():
yaml_file = 'yaml_write.yml'
json_file = 'json_write.json'
yaml_json_dictionary = {
'code_version': '11.5',
'vlan': '404',
}
yaml_json_list = [
'Locatio... | 418 | 0 | 23 |
639bf8a31fde3adf852d62aede94eb4377ccd087 | 1,211 | py | Python | src/train_emb.py | RowitZou/topic_dialog_summ | 0de31d97b07be4004e08f9755ee66bea47aa7b10 | [
"MIT"
] | 42 | 2020-12-16T07:53:44.000Z | 2022-03-31T06:48:18.000Z | src/train_emb.py | RowitZou/topic_dialog_summ | 0de31d97b07be4004e08f9755ee66bea47aa7b10 | [
"MIT"
] | 25 | 2021-03-26T02:07:36.000Z | 2022-03-29T09:55:55.000Z | src/train_emb.py | RowitZou/topic_dialog_summ | 0de31d97b07be4004e08f9755ee66bea47aa7b10 | [
"MIT"
] | 7 | 2020-12-23T20:07:22.000Z | 2022-03-07T12:47:37.000Z | import argparse
import os
import json
import glob
from os.path import join as pjoin
from others.vocab_wrapper import VocabWrapper
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-mode", default='word2vec', type=str, choices=['glove', 'word2vec'])
parser.add_argument("-d... | 28.833333 | 93 | 0.659785 | import argparse
import os
import json
import glob
from os.path import join as pjoin
from others.vocab_wrapper import VocabWrapper
def train_emb(args):
data_dir = os.path.abspath(args.data_path)
print("Preparing to process %s ..." % data_dir)
raw_files = glob.glob(pjoin(data_dir, '*.json'))
ex_num = 0... | 663 | 0 | 23 |
f8f0611c9323dcea116a76a266b78b5412d312ca | 1,376 | py | Python | vectorbt/returns/__init__.py | RileyMShea/vectorbt | 92ce571ce9fd0667f2994a2c922fb4cfcde10c88 | [
"Apache-2.0"
] | 1 | 2021-01-15T00:02:11.000Z | 2021-01-15T00:02:11.000Z | vectorbt/returns/__init__.py | RileyMShea/vectorbt | 92ce571ce9fd0667f2994a2c922fb4cfcde10c88 | [
"Apache-2.0"
] | null | null | null | vectorbt/returns/__init__.py | RileyMShea/vectorbt | 92ce571ce9fd0667f2994a2c922fb4cfcde10c88 | [
"Apache-2.0"
] | null | null | null | """Modules for working with returns.
Offers common financial risk and performance metrics as found in [empyrical](https://github.com/quantopian/empyrical),
but Numba-compiled and optimized for 2-dim arrays.
## Accessors
You can access methods listed in `vectorbt.returns.accessors` as follows:
* `vectorbt.returns.ac... | 29.276596 | 118 | 0.742733 | """Modules for working with returns.
Offers common financial risk and performance metrics as found in [empyrical](https://github.com/quantopian/empyrical),
but Numba-compiled and optimized for 2-dim arrays.
## Accessors
You can access methods listed in `vectorbt.returns.accessors` as follows:
* `vectorbt.returns.ac... | 0 | 0 | 0 |
ac967be092eb4b64ff1b298ff06388e5136ace2c | 2,819 | py | Python | Fundamentos/Strings.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | null | null | null | Fundamentos/Strings.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | 4 | 2021-04-08T21:54:09.000Z | 2022-02-10T14:35:13.000Z | Fundamentos/Strings.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | null | null | null | #%% [markdown]
## Strings (parte 1)
dir(str)
nome = 'Victor Mello'
nome
#Acessando um caracter de uma string
nome[0]
# nome[0] = 'P' #Erro! Strings são imutáveis
"""OBS: quando se tem uma string cujo conteúdo já possui
aspas simples, para evitar erro de sintaxe, tem-se 2 opções:
1) Delimitar a string com aspas du... | 21.356061 | 99 | 0.719759 | #%% [markdown]
## Strings (parte 1)
dir(str)
nome = 'Victor Mello'
nome
#Acessando um caracter de uma string
nome[0]
# nome[0] = 'P' #Erro! Strings são imutáveis
"""OBS: quando se tem uma string cujo conteúdo já possui
aspas simples, para evitar erro de sintaxe, tem-se 2 opções:
1) Delimitar a string com aspas du... | 0 | 0 | 0 |
02a06d266080beb3092c464049b0b79657ebae9b | 6,665 | py | Python | tests/test_kinematics.py | tp5uiuc/kinematic_snake | 70a59a431d185a5fbe304b18db17eb3819ddbee1 | [
"MIT"
] | 2 | 2022-01-01T21:12:53.000Z | 2022-01-02T16:23:09.000Z | tests/test_kinematics.py | tp5uiuc/kinematic_snake | 70a59a431d185a5fbe304b18db17eb3819ddbee1 | [
"MIT"
] | null | null | null | tests/test_kinematics.py | tp5uiuc/kinematic_snake | 70a59a431d185a5fbe304b18db17eb3819ddbee1 | [
"MIT"
] | null | null | null | import numpy as np
from numpy.testing import assert_allclose
from scipy.integrate import trapz
import pytest
from kinematic_snake.kinematic_snake import zero_mean_integral, project, KinematicSnake
# TODO Add more tests
| 32.832512 | 87 | 0.628807 | import numpy as np
from numpy.testing import assert_allclose
from scipy.integrate import trapz
import pytest
from kinematic_snake.kinematic_snake import zero_mean_integral, project, KinematicSnake
class TestZeroMeanIntegral:
@pytest.fixture(scope="class", params=[101, np.random.randint(100, 200)])
def load_s... | 5,083 | 1,266 | 91 |
f0bd97a83ef68c7c33ba4c4c35408149131700ab | 1,172 | py | Python | open-ai-gym-lab/1. gym/ex01/gym1.py | hojeong3709/RL | a1c6eab8c3e7f2487e527fe68658d13eea5334af | [
"MIT"
] | null | null | null | open-ai-gym-lab/1. gym/ex01/gym1.py | hojeong3709/RL | a1c6eab8c3e7f2487e527fe68658d13eea5334af | [
"MIT"
] | null | null | null | open-ai-gym-lab/1. gym/ex01/gym1.py | hojeong3709/RL | a1c6eab8c3e7f2487e527fe68658d13eea5334af | [
"MIT"
] | null | null | null | import gym
import numpy as np
print(gym.__file__)
print(dir(gym))
env = gym.make('FrozenLake-v0')
q_table = np.zeros([env.observation_space.n, env.action_space.n])
print(env.render())
if __name__ == "__main__":
lr = 0.8
discount_factor = 0.95
num_episodes = 2000
reward_list = []
for i in rang... | 29.3 | 113 | 0.562287 | import gym
import numpy as np
print(gym.__file__)
print(dir(gym))
env = gym.make('FrozenLake-v0')
q_table = np.zeros([env.observation_space.n, env.action_space.n])
print(env.render())
if __name__ == "__main__":
lr = 0.8
discount_factor = 0.95
num_episodes = 2000
reward_list = []
for i in rang... | 0 | 0 | 0 |
0a8a0a0e92b9c19993841104fa8221ea7e366c1f | 46,575 | py | Python | peripheral/tcc_u2213/config/tcc.py | Techdisc/Microchip | ea8391c689c4badbe2f9ac5181e21bbd5d9d1e54 | [
"0BSD"
] | null | null | null | peripheral/tcc_u2213/config/tcc.py | Techdisc/Microchip | ea8391c689c4badbe2f9ac5181e21bbd5d9d1e54 | [
"0BSD"
] | null | null | null | peripheral/tcc_u2213/config/tcc.py | Techdisc/Microchip | ea8391c689c4badbe2f9ac5181e21bbd5d9d1e54 | [
"0BSD"
] | null | null | null | # coding: utf-8
"""*****************************************************************************
* Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* re... | 50.735294 | 212 | 0.704369 | # coding: utf-8
"""*****************************************************************************
* Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* re... | 43,253 | 0 | 481 |
7c16237489a32a6947682f9416ee999e331bf508 | 1,151 | py | Python | Task2F.py | amyponter/amy_reve | 89c6464d56a96d3430a2b3106fc386a86a8b4512 | [
"MIT"
] | null | null | null | Task2F.py | amyponter/amy_reve | 89c6464d56a96d3430a2b3106fc386a86a8b4512 | [
"MIT"
] | null | null | null | Task2F.py | amyponter/amy_reve | 89c6464d56a96d3430a2b3106fc386a86a8b4512 | [
"MIT"
] | null | null | null | import datetime
from floodsystem.analysis import polyfit
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.plot import plot_water_level_with_fit
from floodsystem.utils import sorted_by_key
if __name__ == "__main__":
... | 29.512821 | 93 | 0.691573 | import datetime
from floodsystem.analysis import polyfit
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.plot import plot_water_level_with_fit
from floodsystem.utils import sorted_by_key
def highest_levels(stations):
... | 715 | 0 | 46 |
97ddfff6de8858ea4f079e934f202617622729a8 | 26,309 | py | Python | putil/plot/series.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | 6 | 2015-12-15T04:09:08.000Z | 2020-02-21T01:40:57.000Z | putil/plot/series.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | null | null | null | putil/plot/series.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | 2 | 2016-01-21T23:29:17.000Z | 2020-02-21T01:41:05.000Z | # series.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,C0302,E0102,E0611,W0105
# PyPI imports
import numpy
import matplotlib.path
import matplotlib.pyplot as plt
from scipy.stats import linregress
from scipy.interpolate import InterpolatedUnivariateSpline
# Putil ... | 36.138736 | 79 | 0.594511 | # series.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,C0302,E0102,E0611,W0105
# PyPI imports
import numpy
import matplotlib.path
import matplotlib.pyplot as plt
from scipy.stats import linregress
from scipy.interpolate import InterpolatedUnivariateSpline
# Putil ... | 7,254 | 0 | 399 |
ba5b2d2a2874a4511323fe0650c36a0e9d8df146 | 313 | py | Python | handlers/FaviconHandler.py | Boss-XP/server_tornado | d25781f8c426ae6ec2af4ecdcfd87c6ba5eaa55f | [
"Apache-2.0"
] | null | null | null | handlers/FaviconHandler.py | Boss-XP/server_tornado | d25781f8c426ae6ec2af4ecdcfd87c6ba5eaa55f | [
"Apache-2.0"
] | null | null | null | handlers/FaviconHandler.py | Boss-XP/server_tornado | d25781f8c426ae6ec2af4ecdcfd87c6ba5eaa55f | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from handlers.BaseHandler import RequestBaseHandler
import os
class GetFavicon(RequestBaseHandler):
"""发布数据接口""" | 26.083333 | 79 | 0.648562 | # coding: utf-8
from handlers.BaseHandler import RequestBaseHandler
import os
class GetFavicon(RequestBaseHandler):
"""发布数据接口"""
def get(self, *args, **kwargs):
print('---fav')
pic = open(os.path.join(os.path.dirname(__file__), "favicon.png"), 'r')
return self.write(pic.read()) | 152 | 0 | 26 |
accc11b35ac61e2ea056f246d67b34b4dcbe62b1 | 1,194 | py | Python | datasets/Macaws/split.py | yuhongherald/pytorch-CycleGAN-and-pix2pix | 48cb3aa46fde39684db9c24586fcec6781138e2a | [
"BSD-3-Clause"
] | null | null | null | datasets/Macaws/split.py | yuhongherald/pytorch-CycleGAN-and-pix2pix | 48cb3aa46fde39684db9c24586fcec6781138e2a | [
"BSD-3-Clause"
] | null | null | null | datasets/Macaws/split.py | yuhongherald/pytorch-CycleGAN-and-pix2pix | 48cb3aa46fde39684db9c24586fcec6781138e2a | [
"BSD-3-Clause"
] | 1 | 2019-09-28T02:29:58.000Z | 2019-09-28T02:29:58.000Z | import os
import random
import tqdm
import shutil
train_p = 0.9
#val_p = 0.05
test_p = 0.05
root_dir = "contoured-cut-outlines"
all_dir = "all"
train_dir = "train"
val_dir = "val"
test_dir = "test"
if __name__ == "__main__":
data = os.listdir(os.path.join(root_dir, all_dir))
random.shuffle(data)
total_co... | 34.114286 | 109 | 0.688442 | import os
import random
import tqdm
import shutil
train_p = 0.9
#val_p = 0.05
test_p = 0.05
root_dir = "contoured-cut-outlines"
all_dir = "all"
train_dir = "train"
val_dir = "val"
test_dir = "test"
if __name__ == "__main__":
data = os.listdir(os.path.join(root_dir, all_dir))
random.shuffle(data)
total_co... | 0 | 0 | 0 |
c90f69370182cc935ee7b07948d1203a8e243e9e | 613 | py | Python | src/loggy.py | aarora8/VistaOCR | dd8a41e45d4efe49816054c097d06be41937fae1 | [
"Apache-2.0"
] | 24 | 2018-06-05T06:38:24.000Z | 2021-12-08T12:20:06.000Z | src/loggy.py | aarora8/VistaOCR | dd8a41e45d4efe49816054c097d06be41937fae1 | [
"Apache-2.0"
] | 3 | 2018-08-16T23:47:30.000Z | 2020-02-13T09:48:53.000Z | src/loggy.py | aarora8/VistaOCR | dd8a41e45d4efe49816054c097d06be41937fae1 | [
"Apache-2.0"
] | 10 | 2018-05-07T17:30:45.000Z | 2020-01-29T10:34:02.000Z | import datetime
import logging
| 30.65 | 107 | 0.71615 | import datetime
import logging
def setup_custom_logger(name, filename, path="/tmp"):
logFormatter = logging.Formatter("%(asctime)s [%(filename)s] %(message)s")
fileHandler = logging.FileHandler(
"{0}/{1}.log".format(path, filename + '_' + datetime.datetime.now().strftime('%y_%m_%d_%H_%M_%S')))
f... | 558 | 0 | 23 |
6c5fe05941b7380a3079443f25ac97babdcda178 | 1,169 | py | Python | follow/urls.py | CMPUT404W22AMNRY/CMPUT404-project-socialdistribution | 61d5c8aa2c7f038c137fc86c8b194d92a33d90e3 | [
"W3C-20150513"
] | 1 | 2022-01-14T04:37:54.000Z | 2022-01-14T04:37:54.000Z | follow/urls.py | CMPUT404W22AMNRY/CMPUT404-project-socialdistribution | 61d5c8aa2c7f038c137fc86c8b194d92a33d90e3 | [
"W3C-20150513"
] | 88 | 2022-02-19T00:16:44.000Z | 2022-03-29T03:05:08.000Z | follow/urls.py | CMPUT404W22AMNRY/CMPUT404-project-socialdistribution | 61d5c8aa2c7f038c137fc86c8b194d92a33d90e3 | [
"W3C-20150513"
] | null | null | null | from django.urls import path
from .views import (
FriendRequestsView,
MyFriendsView,
create_follow_request,
accept_follow_request,
unfollow_request,
reject_follow_request,
accept_remote_follow_request,
reject_remote_follow_request,
UsersView
)
app_name = 'follow'
urlpatterns = [
... | 44.961538 | 112 | 0.755346 | from django.urls import path
from .views import (
FriendRequestsView,
MyFriendsView,
create_follow_request,
accept_follow_request,
unfollow_request,
reject_follow_request,
accept_remote_follow_request,
reject_remote_follow_request,
UsersView
)
app_name = 'follow'
urlpatterns = [
... | 0 | 0 | 0 |
1352cd1956b4e01e14016003fe3ea6ede6c23e4f | 352 | py | Python | challenges/array_shift/array_shift.py | dambergn-codefellows/py401_data-structures-and-algorithms | 64ca78a70c9de8bee37459481eb8ce0d359b1bb8 | [
"MIT"
] | null | null | null | challenges/array_shift/array_shift.py | dambergn-codefellows/py401_data-structures-and-algorithms | 64ca78a70c9de8bee37459481eb8ce0d359b1bb8 | [
"MIT"
] | null | null | null | challenges/array_shift/array_shift.py | dambergn-codefellows/py401_data-structures-and-algorithms | 64ca78a70c9de8bee37459481eb8ce0d359b1bb8 | [
"MIT"
] | null | null | null | def insertShiftArray(array, value):
'''
inserts a value in middle of array.
'''
if len(array)%2 !=0:
oddOrEven = 1
else:
oddOrEven = 0
half = len(array)//2 + oddOrEven
# print(array[:half] + [value] + array[half:])
return array[:half] + [value] + array[half:]
#insertShiftArray([1,2,4,5], 3)
#... | 22 | 48 | 0.610795 | def insertShiftArray(array, value):
'''
inserts a value in middle of array.
'''
if len(array)%2 !=0:
oddOrEven = 1
else:
oddOrEven = 0
half = len(array)//2 + oddOrEven
# print(array[:half] + [value] + array[half:])
return array[:half] + [value] + array[half:]
#insertShiftArray([1,2,4,5], 3)
#... | 0 | 0 | 0 |
a317b2012cc9cb51be908bfe20411a2c9002cee9 | 1,333 | py | Python | src/others/download_pdb.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | src/others/download_pdb.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | src/others/download_pdb.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# file_name : download_pdb.py
# time : 3/22/2019 13:54
# author : ruiyang
# email : ww_sry@163.com
# ------------------------------
import sys
import pandas as pd
import os
def download_pdb(name_list,outpath):
"""
:function: download pdb archive by pd... | 28.978261 | 90 | 0.622656 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# file_name : download_pdb.py
# time : 3/22/2019 13:54
# author : ruiyang
# email : ww_sry@163.com
# ------------------------------
import sys
import pandas as pd
import os
def download_pdb(name_list,outpath):
"""
:function: download pdb archive by pd... | 0 | 0 | 0 |
837cb049c36189f05e97e865bab8ef0f9cee3048 | 350 | py | Python | examples/configs/generic_st7735/landscape_128x128.py | russhughes/lv_st7789 | aa5134383250abd7d26285c01cb344374449e5b8 | [
"MIT"
] | 8 | 2021-08-28T01:41:38.000Z | 2022-01-30T15:49:33.000Z | examples/configs/generic_st7735/landscape_128x128.py | russhughes/lv_st7789 | aa5134383250abd7d26285c01cb344374449e5b8 | [
"MIT"
] | 9 | 2021-08-29T03:01:28.000Z | 2022-01-28T11:57:45.000Z | examples/configs/generic_st7735/landscape_128x128.py | russhughes/lv_st7789 | aa5134383250abd7d26285c01cb344374449e5b8 | [
"MIT"
] | 1 | 2022-01-28T11:58:10.000Z | 2022-01-28T11:58:10.000Z | '''
Generic st7735 128x128 LCD module on esp32
'''
from ili9XXX import ili9341, MADCTL_MY, MADCTL_MV
disp = ili9341(
mhz=3,
mosi=18,
clk=19,
cs=13,
dc=12,
rst=4,
power=-1,
backlight=15,
backlight_on=1,
width=128,
height=128,
start_x=2,
start_y=1,
invert=False,
... | 15.217391 | 49 | 0.602857 | '''
Generic st7735 128x128 LCD module on esp32
'''
from ili9XXX import ili9341, MADCTL_MY, MADCTL_MV
disp = ili9341(
mhz=3,
mosi=18,
clk=19,
cs=13,
dc=12,
rst=4,
power=-1,
backlight=15,
backlight_on=1,
width=128,
height=128,
start_x=2,
start_y=1,
invert=False,
... | 0 | 0 | 0 |
f7a31e4bb99aff01ed2a23f058553ba02d108c73 | 945 | py | Python | mne/viz/backends/tests/_utils.py | kalenkovich/mne-python | d5752051b37f74713233929382bcc632d404f837 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/backends/tests/_utils.py | kalenkovich/mne-python | d5752051b37f74713233929382bcc632d404f837 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/backends/tests/_utils.py | kalenkovich/mne-python | d5752051b37f74713233929382bcc632d404f837 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
#
# License: Simplified BSD
import pytest
import warnings
def has_vtki():
"""Check that... | 27 | 71 | 0.609524 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
#
# License: Simplified BSD
import pytest
import warnings
def has_vtki():
"""Check that... | 0 | 0 | 0 |
faf6328d3f2235855bce224b41bfd52ccae030e4 | 595 | py | Python | setup.py | bonnland/geocat-comp | cb6e0f6a50ff9542d2f003dd0e9ffa1434d4a561 | [
"Apache-2.0"
] | null | null | null | setup.py | bonnland/geocat-comp | cb6e0f6a50ff9542d2f003dd0e9ffa1434d4a561 | [
"Apache-2.0"
] | null | null | null | setup.py | bonnland/geocat-comp | cb6e0f6a50ff9542d2f003dd0e9ffa1434d4a561 | [
"Apache-2.0"
] | null | null | null | try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
#import distutils.sysconfig
with open("src/geocat/comp/version.py") as f:
exec(f.read())
setup(name="geocat.comp",
package_dir={
... | 25.869565 | 61 | 0.640336 | try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
#import distutils.sysconfig
with open("src/geocat/comp/version.py") as f:
exec(f.read())
setup(name="geocat.comp",
package_dir={
... | 0 | 0 | 0 |
cb7d2a1e81d6afc89d1b23a6bfa078facb0d862d | 1,469 | py | Python | src/GDNN3_tf.py | gmaggiotti/genetic_deep_learning | 3bade857fa7a1564d2c6ef9519bcd37cfcd2d1a4 | [
"MIT"
] | 13 | 2019-01-01T20:30:56.000Z | 2020-02-13T19:49:21.000Z | src/GDNN3_tf.py | gmaggiotti/genetic_deep_learning | 3bade857fa7a1564d2c6ef9519bcd37cfcd2d1a4 | [
"MIT"
] | 2 | 2019-01-05T15:33:26.000Z | 2019-01-05T15:38:16.000Z | src/GDNN3_tf.py | gmaggiotti/genetic_deep_learning | 3bade857fa7a1564d2c6ef9519bcd37cfcd2d1a4 | [
"MIT"
] | 9 | 2019-01-06T14:37:15.000Z | 2020-12-16T15:34:30.000Z | import numpy as np
from NN3_tf import NN3_tf
from sklearn.model_selection import train_test_split
from nn_utils import crossover, Type, sort_by_fittest, read_dataset
X, Y = read_dataset(180, 500)
train_x, test_x, train_y, test_y = train_test_split(
X, Y, test_size=0.3, random_state=1)
X, Y = read_dataset(180, 5... | 34.162791 | 88 | 0.698434 | import numpy as np
from NN3_tf import NN3_tf
from sklearn.model_selection import train_test_split
from nn_utils import crossover, Type, sort_by_fittest, read_dataset
X, Y = read_dataset(180, 500)
train_x, test_x, train_y, test_y = train_test_split(
X, Y, test_size=0.3, random_state=1)
X, Y = read_dataset(180, 5... | 0 | 0 | 0 |
dba5aab41fe191654d0d37097ad32f42312cd355 | 701 | py | Python | smlb/core/features.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 6 | 2020-07-27T21:08:55.000Z | 2021-05-04T07:00:29.000Z | smlb/core/features.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 18 | 2020-09-01T00:47:04.000Z | 2021-09-15T22:16:56.000Z | smlb/core/features.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 2 | 2020-08-24T21:50:16.000Z | 2020-12-06T05:18:57.000Z | """Features
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
2020, Matthias Rupp, Citrine Informatics.
Features transform datasets.
"""
from smlb import DataValuedTransformation, IdentityTransformation, DataPipelineTransformation
class Features(DataValue... | 21.90625 | 93 | 0.777461 | """Features
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
2020, Matthias Rupp, Citrine Informatics.
Features transform datasets.
"""
from smlb import DataValuedTransformation, IdentityTransformation, DataPipelineTransformation
class Features(DataValue... | 0 | 0 | 0 |
50cc1ee5cf17c548e771c7096fa0a585e90d55ad | 2,408 | py | Python | simpegAIP/SeogiUtils/PetaInv.py | sgkang/simpegAIP | 78d24c9170a6a345e0896a932e80ef1a6959cf30 | [
"MIT"
] | null | null | null | simpegAIP/SeogiUtils/PetaInv.py | sgkang/simpegAIP | 78d24c9170a6a345e0896a932e80ef1a6959cf30 | [
"MIT"
] | 2 | 2016-02-04T21:55:03.000Z | 2016-02-05T17:40:55.000Z | simpegAIP/SeogiUtils/PetaInv.py | sgkang/simpegAIP | 78d24c9170a6a345e0896a932e80ef1a6959cf30 | [
"MIT"
] | 1 | 2022-01-11T08:22:10.000Z | 2022-01-11T08:22:10.000Z | from SimPEG import Problem, Survey, Utils, Maps
import Convolution
import numpy as np
| 32.540541 | 88 | 0.584302 | from SimPEG import Problem, Survey, Utils, Maps
import Convolution
import numpy as np
class PetaInvProblem(Problem.BaseProblem):
surveyPair = Survey.BaseSurvey
P = None
J = None
time = None
we = None
def __init__(self, mesh, mapping, **kwargs):
Problem.BaseProblem.__init__(self, mesh, ... | 1,885 | 344 | 92 |
eb656459d5c06345b5b9787e8be6a55e5c9cc130 | 615 | py | Python | _1327/information_pages/urls.py | Nef10/1327 | 71fb83a3c12ba24a7638acebeeffed80825e0101 | [
"MIT"
] | null | null | null | _1327/information_pages/urls.py | Nef10/1327 | 71fb83a3c12ba24a7638acebeeffed80825e0101 | [
"MIT"
] | null | null | null | _1327/information_pages/urls.py | Nef10/1327 | 71fb83a3c12ba24a7638acebeeffed80825e0101 | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('_1327.information_pages.views',
url(r"create$", 'create', name='create'),
url(r"(?P<title>[\w-]+)/edit$", 'edit', name='edit'),
url(r"(?P<title>[\w-]+)/autosave$", 'autosave', name='autosave'),
... | 41 | 75 | 0.650407 | from django.conf.urls import patterns, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('_1327.information_pages.views',
url(r"create$", 'create', name='create'),
url(r"(?P<title>[\w-]+)/edit$", 'edit', name='edit'),
url(r"(?P<title>[\w-]+)/autosave$", 'autosave', name='autosave'),
... | 0 | 0 | 0 |
48d60e2dc37de4248f1cec08b57bcbb18f01dd84 | 1,844 | py | Python | environmennt.py | cyroilt/game | 49dba23c8e361f8d870cb3260f3421ca9f9e16de | [
"BSD-3-Clause"
] | null | null | null | environmennt.py | cyroilt/game | 49dba23c8e361f8d870cb3260f3421ca9f9e16de | [
"BSD-3-Clause"
] | null | null | null | environmennt.py | cyroilt/game | 49dba23c8e361f8d870cb3260f3421ca9f9e16de | [
"BSD-3-Clause"
] | null | null | null | import random
forests=[]
forestload=[]
forestmaxload=[]
stones1=[]
stoneload=[]
stonemaxload=[]
frpl=[]
frpl1=[]
| 24.918919 | 73 | 0.703905 | import random
forests=[]
forestload=[]
forestmaxload=[]
stones1=[]
stoneload=[]
stonemaxload=[]
frpl=[]
frpl1=[]
class forest():
def genforest(n,maxgen):
global forests,forestload,forestmaxload
for i in range(n):
forests.append([random.randint(0,maxgen),random.randint(0,maxgen)])
forestload.append... | 1,293 | -12 | 450 |
addfbd51a9bfbe32f25a15f5a5b371e22f592d52 | 8,144 | py | Python | yz/rl_agent_sil.py | yizhouzhao/moca | 2a4c3cb140f59aef94f9cdfce1169089b3aabddf | [
"MIT"
] | null | null | null | yz/rl_agent_sil.py | yizhouzhao/moca | 2a4c3cb140f59aef94f9cdfce1169089b3aabddf | [
"MIT"
] | null | null | null | yz/rl_agent_sil.py | yizhouzhao/moca | 2a4c3cb140f59aef94f9cdfce1169089b3aabddf | [
"MIT"
] | null | null | null | from yz.nav_tools import FrameInfo
from yz.params import *
from yz.rl_policy import PolicyNetwork, ValueNetwork
from yz.utils import soft_update_from_to
from ai2thor.controller import Controller
from collections import deque
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as opt... | 32.189723 | 116 | 0.603635 | from yz.nav_tools import FrameInfo
from yz.params import *
from yz.rl_policy import PolicyNetwork, ValueNetwork
from yz.utils import soft_update_from_to
from ai2thor.controller import Controller
from collections import deque
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as opt... | 5,382 | 2,416 | 23 |
56741da3d94b0e05476cdd784d626e95cb58ad9b | 1,185 | py | Python | ucb_cs61A/lab/lab09/tests/accumulate.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | null | null | null | ucb_cs61A/lab/lab09/tests/accumulate.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2017-07-31T08:15:26.000Z | 2017-07-31T08:15:26.000Z | ucb_cs61A/lab/lab09/tests/accumulate.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2019-10-06T16:52:31.000Z | 2019-10-06T16:52:31.000Z | test = {
'name': 'accumulate',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
scm> (accumulate + 0 4 square)
30
""",
'hidden': False,
'locked': False
}
],
'scored': False,
'setup': r"""
scm> (load '... | 18.809524 | 42 | 0.347679 | test = {
'name': 'accumulate',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
scm> (accumulate + 0 4 square)
30
""",
'hidden': False,
'locked': False
}
],
'scored': False,
'setup': r"""
scm> (load '... | 0 | 0 | 0 |
c20c0b53ab477291ef3dcfbc603ab811174b4302 | 3,328 | py | Python | coderunner/interact.py | zhao-embassy/learn_language | 2719f27dea1877ba1da32f1c1d53ebedd5a81fdf | [
"FSFAP"
] | 48 | 2015-02-05T15:25:47.000Z | 2022-01-07T05:52:03.000Z | coderunner/interact.py | zhao-embassy/learn_language | 2719f27dea1877ba1da32f1c1d53ebedd5a81fdf | [
"FSFAP"
] | null | null | null | coderunner/interact.py | zhao-embassy/learn_language | 2719f27dea1877ba1da32f1c1d53ebedd5a81fdf | [
"FSFAP"
] | 21 | 2015-02-12T23:50:10.000Z | 2019-12-12T08:25:35.000Z | r"""
communicate with interactive subprocess, such as GHCi, and get its output
>>> s = interact('ghci', ':t 1\n' + EOT)
>>> get_ghci_body(s)
'Prelude> :t 1\n1 :: (Num t) => t'
>>> s = interact('swipl', 'X = 1 - 1.\n' + EOT)
>>> get_swipl_body(s)
'?- X = 1 - 1.\nX = 1-1.'
>>> s = interact('python', 'import this\n' + ... | 24.651852 | 73 | 0.555589 | r"""
communicate with interactive subprocess, such as GHCi, and get its output
>>> s = interact('ghci', ':t 1\n' + EOT)
>>> get_ghci_body(s)
'Prelude> :t 1\n1 :: (Num t) => t'
>>> s = interact('swipl', 'X = 1 - 1.\n' + EOT)
>>> get_swipl_body(s)
'?- X = 1 - 1.\nX = 1-1.'
>>> s = interact('python', 'import this\n' + ... | 1,158 | 0 | 161 |
4c27a7ebbbdaa0bf7cc6bd83f0a8e845805c3b62 | 7,168 | py | Python | docx2python/iterators.py | FabianGroeger96/docx2python | 7a43fc4ef15033881203713224e894ae33ef79d7 | [
"MIT"
] | null | null | null | docx2python/iterators.py | FabianGroeger96/docx2python | 7a43fc4ef15033881203713224e894ae33ef79d7 | [
"MIT"
] | null | null | null | docx2python/iterators.py | FabianGroeger96/docx2python | 7a43fc4ef15033881203713224e894ae33ef79d7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# _*_ coding: utf-8 _*_
"""Iterate over extracted docx content.
:author: Shay Hill
:created: 6/28/2019
This package extracts docx text as::
[ # tables
[ # table
[ # row
[ # cell
"" # paragraph
]
]
... | 28.787149 | 87 | 0.539063 | #!/usr/bin/env python3
# _*_ coding: utf-8 _*_
"""Iterate over extracted docx content.
:author: Shay Hill
:created: 6/28/2019
This package extracts docx text as::
[ # tables
[ # table
[ # row
[ # cell
"" # paragraph
]
]
... | 0 | 0 | 0 |
e48df518cad508f16a41114500431b930ec91a46 | 2,062 | py | Python | tests/test_cli_gui/test_fetch.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | null | null | null | tests/test_cli_gui/test_fetch.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | null | null | null | tests/test_cli_gui/test_fetch.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | 33.258065 | 86 | 0.64452 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | 0 | 0 | 0 |
77cd887735c4c63ff879ffa44e3e4c4e0b7004b1 | 487 | py | Python | scripts/encode.py | univoid/a3x | 46f48363f191344747fec5e643efe1b467fb04c3 | [
"MIT"
] | null | null | null | scripts/encode.py | univoid/a3x | 46f48363f191344747fec5e643efe1b467fb04c3 | [
"MIT"
] | null | null | null | scripts/encode.py | univoid/a3x | 46f48363f191344747fec5e643efe1b467fb04c3 | [
"MIT"
] | null | null | null | import base64
if __name__ == "__main__":
print convert("in.jpeg")
| 22.136364 | 46 | 0.64271 | import base64
def decode_base64(data):
missing_padding = len(data) % 4
if missing_padding != 0:
data += b'='* (4 - missing_padding)
return base64.decodestring(data)
def convert(image):
f = open(image)
data = f.read()
f.close()
base64_encode_str = base64.b64encode(data)
t = ope... | 370 | 0 | 46 |
a5e6293df4e370dbbceb0976cbcb58cc075c164c | 2,568 | py | Python | scripts/tests/tests1.py | ronan-keane/hav-sim | 0aaf9674e987822ff2dc90c74613d5e68e8ef0ce | [
"Apache-2.0"
] | null | null | null | scripts/tests/tests1.py | ronan-keane/hav-sim | 0aaf9674e987822ff2dc90c74613d5e68e8ef0ce | [
"Apache-2.0"
] | null | null | null | scripts/tests/tests1.py | ronan-keane/hav-sim | 0aaf9674e987822ff2dc90c74613d5e68e8ef0ce | [
"Apache-2.0"
] | 2 | 2020-09-30T22:44:37.000Z | 2021-05-09T07:36:28.000Z |
"""
@author: rlk268@cornell.edu
test helper functions
"""
from havsim.calibration.helper import makeleadfolinfo, boundaryspeeds, interpolate
path_reconngsim = 'C:/Users/rlk268/OneDrive - Cornell University/important misc/pickle files/meng/reconngsim.pkl'
# reconstructed ngsim data
with open(path_reconngsim, 'rb'... | 40.125 | 116 | 0.580997 |
"""
@author: rlk268@cornell.edu
test helper functions
"""
from havsim.calibration.helper import makeleadfolinfo, boundaryspeeds, interpolate
path_reconngsim = 'C:/Users/rlk268/OneDrive - Cornell University/important misc/pickle files/meng/reconngsim.pkl'
# reconstructed ngsim data
with open(path_reconngsim, 'rb'... | 1,839 | 0 | 69 |
ce9d97cd2c8d61694d46d2f7ee2e3ee27fbb4bf9 | 1,185 | py | Python | demo/fibonacci.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | demo/fibonacci.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | demo/fibonacci.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 2 | 2016-07-29T07:09:50.000Z | 2016-10-16T08:50:26.000Z | """
Thunk (a.k.a. lazy objects) in PyPy.
To run on top of the thunk object space with the following command-line:
py.py -o thunk fibonacci.py
This is a typical Functional Programming Languages demo, computing the
Fibonacci sequence by using an infinite lazy linked list.
"""
try:
from __pypy__ import thunk ... | 26.931818 | 72 | 0.678481 | """
Thunk (a.k.a. lazy objects) in PyPy.
To run on top of the thunk object space with the following command-line:
py.py -o thunk fibonacci.py
This is a typical Functional Programming Languages demo, computing the
Fibonacci sequence by using an infinite lazy linked list.
"""
try:
from __pypy__ import thunk ... | 136 | -6 | 49 |
aacfde57a3d4e97b3f22201cd2b8b1e04de71e89 | 34,754 | py | Python | websocket_server/wsfile.py | CylonicRaider/websocket-server | 8288edf7f145b6359378c1bf745e92b9aa963791 | [
"MIT"
] | 1 | 2019-06-08T21:25:51.000Z | 2019-06-08T21:25:51.000Z | websocket_server/wsfile.py | CylonicRaider/websocket-server | 8288edf7f145b6359378c1bf745e92b9aa963791 | [
"MIT"
] | null | null | null | websocket_server/wsfile.py | CylonicRaider/websocket-server | 8288edf7f145b6359378c1bf745e92b9aa963791 | [
"MIT"
] | 1 | 2017-03-16T00:40:56.000Z | 2017-03-16T00:40:56.000Z | # websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
WebSocket protocol implementation.
client_handshake() and server_handshake() perform the appropriate operations
on mappings of HTTP headers; the WebSocketFile class implements the framing
protocol.
"""
... | 40.935218 | 78 | 0.567388 | # websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
WebSocket protocol implementation.
client_handshake() and server_handshake() perform the appropriate operations
on mappings of HTTP headers; the WebSocketFile class implements the framing
protocol.
"""
... | 45 | 0 | 26 |
e32632230e8d861c619ce796ee13f65c84506eb5 | 1,908 | py | Python | __main__.py | vprzybylo/ai2es | cd54222ca377e15dfada6436564e7f4ee942527c | [
"MIT"
] | null | null | null | __main__.py | vprzybylo/ai2es | cd54222ca377e15dfada6436564e7f4ee942527c | [
"MIT"
] | null | null | null | __main__.py | vprzybylo/ai2es | cd54222ca377e15dfada6436564e7f4ee942527c | [
"MIT"
] | null | null | null | import cocpit
import cocpit.config as config # isort: split
import os
import time
import pandas as pd
import torch
def build_model():
"""
train ML models
"""
# loop through batch sizes, models, epochs, and/or folds
for batch_size in config.BATCH_SIZE:
print("BATCH SIZE: ", batch_size)
... | 26.136986 | 77 | 0.614256 | import cocpit
import cocpit.config as config # isort: split
import os
import time
import pandas as pd
import torch
def build_model():
"""
train ML models
"""
# loop through batch sizes, models, epochs, and/or folds
for batch_size in config.BATCH_SIZE:
print("BATCH SIZE: ", batch_size)
... | 0 | 0 | 0 |
cfa59b7e03a621229d3a7654d9a1137ae714d261 | 2,256 | py | Python | 20-fs-ias-lec/groups/Demo B/src/longFi/src/receiveEther.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/Demo B/src/longFi/src/receiveEther.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/Demo B/src/longFi/src/receiveEther.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | """
receiveEther.py
Faris Ahmetasevic, Marco Banholzer, Nderim Shatri
This code receives raw ethernet packets, which were sent to a network using the scapy library.
"""
from scapy.all import conf
import struct
"""
This function returns the converted information of the packets.
:param data: the bytes data which get... | 27.512195 | 128 | 0.699911 | """
receiveEther.py
Faris Ahmetasevic, Marco Banholzer, Nderim Shatri
This code receives raw ethernet packets, which were sent to a network using the scapy library.
"""
from scapy.all import conf
import struct
"""
This function returns the converted information of the packets.
:param data: the bytes data which get... | 1,253 | 0 | 92 |
d527756039814af170d4be81d8e19538b9c99d78 | 3,033 | py | Python | commands/text.py | Commodoreprime/Command-Block-Assembly | b54c2afee3ea7bdfddfe619b9b207ce30d160e45 | [
"MIT"
] | 223 | 2017-05-10T18:27:44.000Z | 2022-03-06T22:44:18.000Z | commands/text.py | Commodoreprime/Command-Block-Assembly | b54c2afee3ea7bdfddfe619b9b207ce30d160e45 | [
"MIT"
] | 25 | 2017-12-07T15:37:37.000Z | 2021-02-05T14:28:59.000Z | commands/text.py | Commodoreprime/Command-Block-Assembly | b54c2afee3ea7bdfddfe619b9b207ce30d160e45 | [
"MIT"
] | 30 | 2017-12-07T15:16:36.000Z | 2022-03-16T03:29:59.000Z | import json
from .core import Command, EntityRef, Resolvable
from .scoreboard import ScoreRef
from .nbt import Path, NBTStorable
| 29.446602 | 74 | 0.598088 | import json
from .core import Command, EntityRef, Resolvable
from .scoreboard import ScoreRef
from .nbt import Path, NBTStorable
class Tellraw(Command):
def __init__(self, text, target):
assert isinstance(text, TextComponentHolder)
assert isinstance(target, EntityRef)
self.text = text
... | 2,253 | 111 | 539 |
624d0d0443d3ba5cb2b1fae2f1dd5f70165b3739 | 2,868 | py | Python | environments/gym_pycolab/protocols/logging.py | braemt/attentive-multi-task-deep-reinforcement-learning | 921feefce98076f88c892f0b7e6db8572f596763 | [
"MIT"
] | 12 | 2019-04-07T02:04:48.000Z | 2022-03-22T12:57:47.000Z | environments/gym_pycolab/protocols/logging.py | braemt/attentive-multi-task-deep-reinforcement-learning | 921feefce98076f88c892f0b7e6db8572f596763 | [
"MIT"
] | null | null | null | environments/gym_pycolab/protocols/logging.py | braemt/attentive-multi-task-deep-reinforcement-learning | 921feefce98076f88c892f0b7e6db8572f596763 | [
"MIT"
] | 7 | 2019-04-07T02:04:49.000Z | 2020-12-28T10:30:27.000Z | # Copyright 2017 the pycolab Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 40.394366 | 82 | 0.74477 | # Copyright 2017 the pycolab Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 0 | 0 | 0 |
76e13b55d98ab2dbca05ab4638b9827bc2fc8afe | 1,076 | py | Python | pylith/materials/__init__.py | joegeisz/pylith | f74060b7b19d7e90abf8597bbe9250c96593c0ad | [
"MIT"
] | 1 | 2021-01-20T17:18:28.000Z | 2021-01-20T17:18:28.000Z | pylith/materials/__init__.py | joegeisz/pylith | f74060b7b19d7e90abf8597bbe9250c96593c0ad | [
"MIT"
] | null | null | null | pylith/materials/__init__.py | joegeisz/pylith | f74060b7b19d7e90abf8597bbe9250c96593c0ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://ge... | 26.243902 | 72 | 0.546468 | #!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://ge... | 0 | 0 | 0 |
4f22a2d7f5fa7d72c3510a14657615fe75aacb01 | 3,193 | py | Python | utils.py | LynnHongLiu/replayed_distillation | 943169e3b37f5453b386ae652af81db935efc7bd | [
"MIT"
] | 79 | 2017-07-20T07:27:59.000Z | 2022-02-13T14:10:35.000Z | utils.py | LynnHongLiu/replayed_distillation | 943169e3b37f5453b386ae652af81db935efc7bd | [
"MIT"
] | 4 | 2018-02-03T14:43:07.000Z | 2018-04-21T08:47:18.000Z | utils.py | iRapha/replayed_distillation | 943169e3b37f5453b386ae652af81db935efc7bd | [
"MIT"
] | 20 | 2017-07-22T16:22:38.000Z | 2021-05-17T14:03:31.000Z | import datetime as dt
import json
import os
import sys
import tensorflow as tf
import numpy as np
from subprocess import check_output
from itertools import zip_longest
def grouper(iterable, batch_size, fill_value=None):
""" Helper method for returning batches of size batch_size of a dataset.
grouper('ABC... | 29.027273 | 76 | 0.658628 | import datetime as dt
import json
import os
import sys
import tensorflow as tf
import numpy as np
from subprocess import check_output
from itertools import zip_longest
def get_logger(f):
if len(f.commit) == 0:
print('No commit hash provided, using most recent on HEAD')
f.commit = check_output(['g... | 2,585 | 0 | 161 |
9d71d09623ea6dba322c262bfb4c0d049a1a2533 | 14,351 | py | Python | src/finn/custom_op/logicnets/truthtable.py | jalezeta/finn-base | 14051a23670834ce41fd19a7134968648d2d112b | [
"BSD-3-Clause"
] | null | null | null | src/finn/custom_op/logicnets/truthtable.py | jalezeta/finn-base | 14051a23670834ce41fd19a7134968648d2d112b | [
"BSD-3-Clause"
] | null | null | null | src/finn/custom_op/logicnets/truthtable.py | jalezeta/finn-base | 14051a23670834ce41fd19a7134968648d2d112b | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2021 Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the f... | 39.534435 | 88 | 0.594035 | # Copyright (c) 2021 Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the f... | 10,148 | 0 | 189 |
c27a8b95b59e8ad90ba6e52a8fbf028a76e98858 | 1,086 | py | Python | dnm_cohorts/cohorts/oroak_nature.py | jeremymcrae/dnm_cohorts | e968357797d2d370b44904129c32c2e74b36b903 | [
"MIT"
] | 1 | 2020-12-10T05:17:21.000Z | 2020-12-10T05:17:21.000Z | dnm_cohorts/cohorts/oroak_nature.py | jeremymcrae/dnm_cohorts | e968357797d2d370b44904129c32c2e74b36b903 | [
"MIT"
] | null | null | null | dnm_cohorts/cohorts/oroak_nature.py | jeremymcrae/dnm_cohorts | e968357797d2d370b44904129c32c2e74b36b903 | [
"MIT"
] | null | null | null |
import pandas
from dnm_cohorts.person import Person
url = 'https://static-content.springer.com/esm/art%3A10.1038%2Fnature10989/MediaObjects/41586_2012_BFnature10989_MOESM11_ESM.xls'
def open_oroak_cohort():
""" get proband data from the O'Roak et al autism exome study
O'Roak et al. (2012) Nature 485:24... | 31.941176 | 129 | 0.644567 |
import pandas
from dnm_cohorts.person import Person
url = 'https://static-content.springer.com/esm/art%3A10.1038%2Fnature10989/MediaObjects/41586_2012_BFnature10989_MOESM11_ESM.xls'
def open_oroak_cohort():
""" get proband data from the O'Roak et al autism exome study
O'Roak et al. (2012) Nature 485:24... | 0 | 0 | 0 |
be78eee36931eb4bac4c4c3c6c4acf2ae89f68d4 | 2,308 | py | Python | JumpscaleLibs/sal/zosv2/billing.py | grimpy/jumpscaleX_libs | 4cd8a8b69dd3aa7a1a558c81befc97894ab2ec39 | [
"Apache-2.0"
] | null | null | null | JumpscaleLibs/sal/zosv2/billing.py | grimpy/jumpscaleX_libs | 4cd8a8b69dd3aa7a1a558c81befc97894ab2ec39 | [
"Apache-2.0"
] | null | null | null | JumpscaleLibs/sal/zosv2/billing.py | grimpy/jumpscaleX_libs | 4cd8a8b69dd3aa7a1a558c81befc97894ab2ec39 | [
"Apache-2.0"
] | null | null | null | from .resource import ResourceParser
| 38.466667 | 117 | 0.679809 | from .resource import ResourceParser
class Billing:
def __init__(self, explorer):
self._explorer = explorer
def reservation_resources(self, reservation):
"""
compute how much resource units is reserved in the reservation
:param reservation: reservation object
:type re... | 42 | 2,205 | 23 |
ab66010ad825163ec3980b41cacb3534407aba8b | 414 | py | Python | once/clean-ep-nums.py | erikfastermann/etc | a85ad6f0cb87dab208716dcc5a58c3f71a9b202c | [
"MIT"
] | null | null | null | once/clean-ep-nums.py | erikfastermann/etc | a85ad6f0cb87dab208716dcc5a58c3f71a9b202c | [
"MIT"
] | null | null | null | once/clean-ep-nums.py | erikfastermann/etc | a85ad6f0cb87dab208716dcc5a58c3f71a9b202c | [
"MIT"
] | null | null | null | import os
path = os.getcwd()
content = os.listdir(path)
last = 0
for f in content:
name, ext = os.path.splitext(f)
ep_num = name.split('x', 1)[1]
ep_num = int(ep_num.split(' -', 1)[0])
if ep_num != last + 1:
ep_num = last + 1
last += 1
season = name.split('x', 1)[0]
name = name.split(' - ', 1)[1]
new = f'{... | 21.789474 | 58 | 0.599034 | import os
path = os.getcwd()
content = os.listdir(path)
last = 0
for f in content:
name, ext = os.path.splitext(f)
ep_num = name.split('x', 1)[1]
ep_num = int(ep_num.split(' -', 1)[0])
if ep_num != last + 1:
ep_num = last + 1
last += 1
season = name.split('x', 1)[0]
name = name.split(' - ', 1)[1]
new = f'{... | 0 | 0 | 0 |
25e0e8cc87b2e760d45a0a5d8f84d75189109445 | 3,695 | py | Python | projects/realtek/amebaD/IAR/aws_demos/python_custom_ecdsa_D.py | ambiot/ambd_amazon-freertos | 5ac9a8782bdcdd46838459111141fbf483d8aa5a | [
"MIT"
] | 2 | 2020-09-03T02:00:25.000Z | 2021-05-20T07:44:22.000Z | projects/realtek/amebaD/IAR/aws_demos/python_custom_ecdsa_D.py | ambiot/ambd_amazon-freertos | 5ac9a8782bdcdd46838459111141fbf483d8aa5a | [
"MIT"
] | null | null | null | projects/realtek/amebaD/IAR/aws_demos/python_custom_ecdsa_D.py | ambiot/ambd_amazon-freertos | 5ac9a8782bdcdd46838459111141fbf483d8aa5a | [
"MIT"
] | 1 | 2020-08-16T07:14:55.000Z | 2020-08-16T07:14:55.000Z | from OpenSSL import crypto
from socket import gethostname
import os
import array as arr
import subprocess
Major = 0
Minor = 0
Build = 0
with open('../../../../../demos/include/aws_application_version.h') as f:
for line in f:
if line.find('APP_VERSION_MAJOR') != -1:
x = line.split()
... | 29.798387 | 118 | 0.68498 | from OpenSSL import crypto
from socket import gethostname
import os
import array as arr
import subprocess
Major = 0
Minor = 0
Build = 0
with open('../../../../../demos/include/aws_application_version.h') as f:
for line in f:
if line.find('APP_VERSION_MAJOR') != -1:
x = line.split()
... | 0 | 0 | 0 |
bcd3b65d9c0e74bcd69032f281dd72460d9c3725 | 5,133 | py | Python | base/modules/utils/root/sb_utils/general.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | 1 | 2019-04-29T12:47:17.000Z | 2019-04-29T12:47:17.000Z | base/modules/utils/root/sb_utils/general.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | null | null | null | base/modules/utils/root/sb_utils/general.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | null | null | null | import base64
import binascii
import json
import re
import struct
import sys
import uuid
from typing import (
Any,
Callable,
Dict,
Type,
Union
)
# Util Functions
def toStr(s: Any) -> str:
"""
Convert a given type to a default string
:param s: item to convert to a string
:return: c... | 29.5 | 170 | 0.629651 | import base64
import binascii
import json
import re
import struct
import sys
import uuid
from typing import (
Any,
Callable,
Dict,
Type,
Union
)
# Util Functions
def toStr(s: Any) -> str:
"""
Convert a given type to a default string
:param s: item to convert to a string
:return: c... | 945 | 0 | 69 |
994fbf1a06a98785c519373eb80211528ef9f780 | 1,363 | py | Python | src/elevatorChecker.py | wennycooper/cross_map_navigation | 01564cda841603b7cc81b7bfd10ea0cae1c5a4b7 | [
"Apache-2.0"
] | null | null | null | src/elevatorChecker.py | wennycooper/cross_map_navigation | 01564cda841603b7cc81b7bfd10ea0cae1c5a4b7 | [
"Apache-2.0"
] | null | null | null | src/elevatorChecker.py | wennycooper/cross_map_navigation | 01564cda841603b7cc81b7bfd10ea0cae1c5a4b7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from threading import Timer
import rospy
from geometry_msgs.msg import Twist, Pose2D, PoseStamped
from std_msgs.msg import *
from move_base_msgs.msg import *
from actionlib_msgs.msg import *
from apriltags_ros.msg import *
avalability = False
tagOne = False
tagTwo = False
checkCBPub = rospy.Pub... | 23.101695 | 86 | 0.644901 | #!/usr/bin/env python
from threading import Timer
import rospy
from geometry_msgs.msg import Twist, Pose2D, PoseStamped
from std_msgs.msg import *
from move_base_msgs.msg import *
from actionlib_msgs.msg import *
from apriltags_ros.msg import *
avalability = False
tagOne = False
tagTwo = False
checkCBPub = rospy.Pub... | 705 | 0 | 73 |
26864c90522bcced2776b665faf31d612440e695 | 1,897 | py | Python | beorn_lib/dialog/base/field_element.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | beorn_lib/dialog/base/field_element.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | beorn_lib/dialog/base/field_element.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------------
#
# ,--.
# | |-. ,---. ,---. ,--.--.,--,--,
# | .-. '| .-. :| .-. || .--'| \
# | `-' |\ --.' '-' '| | ... | 28.313433 | 82 | 0.489193 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------------
#
# ,--.
# | |-. ,---. ,---. ,--.--.,--,--,
# | .-. '| .-. :| .-. || .--'| \
# | `-' |\ --.' '-' '| | ... | 0 | 877 | 23 |
52f575289ebdd1210d2528436783985cff1f850b | 32,153 | py | Python | databaseobjects.py | judev1/sqlitewrapper | 4506c7d51bb8387865443194f690f35ee9d7c823 | [
"MIT"
] | 3 | 2021-08-31T18:33:43.000Z | 2022-01-10T16:26:58.000Z | databaseobjects.py | judev1/sqlitewrapper | 4506c7d51bb8387865443194f690f35ee9d7c823 | [
"MIT"
] | 1 | 2021-08-31T20:31:37.000Z | 2021-09-01T10:53:59.000Z | databaseobjects.py | judev1/sqlitewrapper | 4506c7d51bb8387865443194f690f35ee9d7c823 | [
"MIT"
] | null | null | null | import sqlite3
from sqlite3.dbapi2 import DataError
import threading
import random
import string
from .datatypes import *
from .errors import *
# TODO: in-code documentation
# TODO: pragma values
QueryObjects = (RawReadObject, RawWriteObject,
CreateTableObject, AddColumnObject,
AddR... | 31.491675 | 104 | 0.580755 | import sqlite3
from sqlite3.dbapi2 import DataError
import threading
import random
import string
from .datatypes import *
from .errors import *
# TODO: in-code documentation
def database(path, table=None, daemon=True, await_completion=True):
database = DatabaseObject(path, daemon, await_completion)
if not t... | 26,676 | 4,360 | 552 |
c0daa3074cb06ba61b6b6a5474d78f1a3b93f764 | 413 | py | Python | __examples__/correct_checksums/b.py | jeremywiebe/checksync | e626707492dbcb77fd1b13841e2f261b0c4796ba | [
"MIT"
] | 15 | 2019-09-11T21:44:29.000Z | 2022-01-24T12:54:59.000Z | __examples__/correct_checksums/b.py | jeremywiebe/checksync | e626707492dbcb77fd1b13841e2f261b0c4796ba | [
"MIT"
] | 874 | 2019-09-03T20:17:16.000Z | 2022-03-30T14:04:58.000Z | __examples__/correct_checksums/b.py | jeremywiebe/checksync | e626707492dbcb77fd1b13841e2f261b0c4796ba | [
"MIT"
] | 2 | 2020-11-04T19:16:37.000Z | 2021-06-02T21:30:34.000Z | # Test file in Python style
# sync-start:correct 770446101 __examples__/correct_checksums/a.js
code = 1
# sync-end:correct
# sync-start:correct2 322927876 __examples__/correct_checksums/a.js
genwebpack/khan-apollo/fragment-types.js genfiles/graphql_schema.json: $(shell find */graphql */*/graphql -name '*.py' -a ! -na... | 37.545455 | 142 | 0.774818 | # Test file in Python style
# sync-start:correct 770446101 __examples__/correct_checksums/a.js
code = 1
# sync-end:correct
# sync-start:correct2 322927876 __examples__/correct_checksums/a.js
genwebpack/khan-apollo/fragment-types.js genfiles/graphql_schema.json: $(shell find */graphql */*/graphql -name '*.py' -a ! -na... | 0 | 0 | 0 |
7facb7933bd8ce6cda2b29652b8361ed79e2b8ab | 130 | py | Python | src/linakdeskapp/__main__.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 121 | 2018-09-19T20:10:21.000Z | 2022-03-31T08:07:33.000Z | src/feedsfix/__main__.py | anetczuk/thunderbird-feeds-recover | 996536bada6961df87873313e2e4b9a6e1bb9431 | [
"MIT"
] | 13 | 2020-02-19T15:58:37.000Z | 2022-03-05T03:20:42.000Z | src/feedsfix/__main__.py | anetczuk/thunderbird-feeds-recover | 996536bada6961df87873313e2e4b9a6e1bb9431 | [
"MIT"
] | 12 | 2020-02-13T23:55:30.000Z | 2022-01-30T15:11:31.000Z | ##
## Entry file when package is used as the main program.
##
if __name__ == '__main__':
from .main import main
main()
| 13 | 55 | 0.630769 | ##
## Entry file when package is used as the main program.
##
if __name__ == '__main__':
from .main import main
main()
| 0 | 0 | 0 |
376d488896fc2ff1dc1e86ef65758221a5f8051d | 783 | py | Python | tests/test_multiple.py | abraia/abraia-python | e49e3869b2ee7e6b1bcb41e0cc1ae126ac39e202 | [
"MIT"
] | 4 | 2018-03-23T22:32:53.000Z | 2020-08-25T12:42:00.000Z | tests/test_multiple.py | abraia/abraia-multiple | e49e3869b2ee7e6b1bcb41e0cc1ae126ac39e202 | [
"MIT"
] | 5 | 2021-02-18T20:29:09.000Z | 2022-03-29T09:28:57.000Z | tests/test_multiple.py | abraia/abraia-python | e49e3869b2ee7e6b1bcb41e0cc1ae126ac39e202 | [
"MIT"
] | 1 | 2021-01-22T23:51:14.000Z | 2021-01-22T23:51:14.000Z | import numpy as np
from abraia import Multiple
multiple = Multiple()
| 23.029412 | 55 | 0.706258 | import numpy as np
from abraia import Multiple
multiple = Multiple()
def test_load_image():
img = multiple.load_image('lion.jpg')
assert isinstance(img, np.ndarray)
def test_load_metadata():
meta = multiple.load_metadata('lion.jpg')
assert meta['MIMEType'] == 'image/jpeg'
def test_save_image():
... | 592 | 0 | 115 |
07fb5058c7a297096cbf1ff7f21aedcf66b7d3ad | 985 | py | Python | shogitk/usikif.py | koji-hirono/pytk-shogi-replayer | a10819a797faecbee5c7b0654beb3694eb522840 | [
"MIT"
] | null | null | null | shogitk/usikif.py | koji-hirono/pytk-shogi-replayer | a10819a797faecbee5c7b0654beb3694eb522840 | [
"MIT"
] | null | null | null | shogitk/usikif.py | koji-hirono/pytk-shogi-replayer | a10819a797faecbee5c7b0654beb3694eb522840 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from shogitk.shogi import Coords, Move, BLACK, WHITE, DROP, PROMOTE
RANKNUM = {
'a': 1,
'b': 2,
'c': 3,
'd': 4,
'e': 5,
'f': 6,
'g': 7,
'h': 8,
'i': 9
}
| 25.921053 | 74 | 0.450761 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from shogitk.shogi import Coords, Move, BLACK, WHITE, DROP, PROMOTE
RANKNUM = {
'a': 1,
'b': 2,
'c': 3,
'd': 4,
'e': 5,
'f': 6,
'g': 7,
'h': 8,
'i': 9
}
def decoder(f):
color = ... | 671 | 0 | 23 |
0b8b5527516fdb912956613a39b881648f901319 | 213 | py | Python | doc/src/modules/mpmath/plots/bessely.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 319 | 2016-09-22T15:54:48.000Z | 2022-03-18T02:36:58.000Z | doc/src/modules/mpmath/plots/bessely.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 9 | 2016-11-03T21:56:41.000Z | 2020-08-09T19:27:37.000Z | doc/src/modules/mpmath/plots/bessely.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 27 | 2016-10-06T16:05:32.000Z | 2022-03-18T02:37:00.000Z | # Bessel function of 2nd kind Y_n(x) on the real line for n=0,1,2,3
y0 = lambda x: bessely(0,x)
y1 = lambda x: bessely(1,x)
y2 = lambda x: bessely(2,x)
y3 = lambda x: bessely(3,x)
plot([y0,y1,y2,y3],[0,10],[-4,1]) | 35.5 | 67 | 0.643192 | # Bessel function of 2nd kind Y_n(x) on the real line for n=0,1,2,3
y0 = lambda x: bessely(0,x)
y1 = lambda x: bessely(1,x)
y2 = lambda x: bessely(2,x)
y3 = lambda x: bessely(3,x)
plot([y0,y1,y2,y3],[0,10],[-4,1]) | 0 | 0 | 0 |
a7bdc9328f5e2ca030f44bdfe27a9bb538f3ee6b | 2,442 | py | Python | h5flow/modules/__init__.py | peter-madigan/h5flow | b90e93677c6a45495e989cf578c96ddf42ffb3c8 | [
"MIT"
] | null | null | null | h5flow/modules/__init__.py | peter-madigan/h5flow | b90e93677c6a45495e989cf578c96ddf42ffb3c8 | [
"MIT"
] | 7 | 2021-05-21T20:23:22.000Z | 2021-11-24T21:06:34.000Z | h5flow/modules/__init__.py | peter-madigan/h5flow | b90e93677c6a45495e989cf578c96ddf42ffb3c8 | [
"MIT"
] | 1 | 2021-08-13T21:46:05.000Z | 2021-08-13T21:46:05.000Z | from inspect import isclass
import os
import importlib.util
import sys
import logging
from pkgutil import iter_modules
def find_class(classname, directory):
'''
Search the specified directory for a file containing a python
implementation with the specified class name
:param classname: cla... | 33 | 99 | 0.599509 | from inspect import isclass
import os
import importlib.util
import sys
import logging
from pkgutil import iter_modules
def find_class(classname, directory):
'''
Search the specified directory for a file containing a python
implementation with the specified class name
:param classname: cla... | 0 | 0 | 0 |
0f7f3a5f87b4462c9b5d7faab0e44b67fbe81c22 | 1,182 | py | Python | nameless/__main__.py | ElliotPenson/Nameless | 54bf7a4d2e8fe6bf73722938970cb1d8c509c97d | [
"MIT"
] | 6 | 2017-08-14T17:22:29.000Z | 2022-01-02T14:54:13.000Z | nameless/__main__.py | ElliotPenson/nameless | 54bf7a4d2e8fe6bf73722938970cb1d8c509c97d | [
"MIT"
] | 1 | 2020-04-13T22:00:40.000Z | 2022-02-24T23:24:12.000Z | nameless/__main__.py | ElliotPenson/nameless | 54bf7a4d2e8fe6bf73722938970cb1d8c509c97d | [
"MIT"
] | 2 | 2017-10-01T17:09:18.000Z | 2019-05-20T06:12:42.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
main.py
@author ejnp
"""
from lexer import Lexer
from parser import Parser, ParserError
from visitors import BetaReduction
def interpret(input_string, print_reductions=False):
"""Performs normal order reduction on the given string lambda calculus
expression. Re... | 24.122449 | 74 | 0.63621 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
main.py
@author ejnp
"""
from lexer import Lexer
from parser import Parser, ParserError
from visitors import BetaReduction
def interpret(input_string, print_reductions=False):
"""Performs normal order reduction on the given string lambda calculus
expression. Re... | 0 | 0 | 0 |
98dcc11cfe8014ee9fb08412398f5c5c35e4a380 | 3,350 | py | Python | basic/inlines/parser.py | neechadi/django-basic-apps | 3a90090857549ea4198a72c44f45f6edb238e2a8 | [
"BSD-3-Clause"
] | 548 | 2015-01-02T21:41:29.000Z | 2022-03-23T09:10:04.000Z | basic/inlines/parser.py | neechadi/django-basic-apps | 3a90090857549ea4198a72c44f45f6edb238e2a8 | [
"BSD-3-Clause"
] | 4 | 2015-01-13T16:27:02.000Z | 2016-11-01T01:51:31.000Z | basic/inlines/parser.py | neechadi/django-basic-apps | 3a90090857549ea4198a72c44f45f6edb238e2a8 | [
"BSD-3-Clause"
] | 182 | 2015-01-02T21:41:29.000Z | 2021-08-09T07:01:07.000Z | from django.template import TemplateSyntaxError
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.http import Http404
from django.utils.encoding import smart_unicode
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
... | 35.263158 | 134 | 0.624776 | from django.template import TemplateSyntaxError
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.http import Http404
from django.utils.encoding import smart_unicode
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
... | 836 | 0 | 23 |
b643d0886806c4dd0b4e934d942a30b98ea669c2 | 1,015 | py | Python | 033/main.py | jasonmobley/euler-python | cd483da472e525be625c1fe0c791ac075bd3a3ef | [
"Unlicense"
] | null | null | null | 033/main.py | jasonmobley/euler-python | cd483da472e525be625c1fe0c791ac075bd3a3ef | [
"Unlicense"
] | null | null | null | 033/main.py | jasonmobley/euler-python | cd483da472e525be625c1fe0c791ac075bd3a3ef | [
"Unlicense"
] | null | null | null | from math import gcd
fractions = list()
for numerator in range(10, 100):
for denominator in range(numerator+1, 100):
actual = numerator / denominator
a = numerator // 10
b = numerator % 10
c = denominator // 10
d = denominator % 10
if (b == 0 and d == 0) or (a == b and c == d) or (a != d and... | 24.756098 | 73 | 0.591133 | from math import gcd
def intFromList(l):
n = 0
m = 1
for i in range(len(l)-1, -1, -1):
n += m * l[i]
m *= 10
return n
fractions = list()
for numerator in range(10, 100):
for denominator in range(numerator+1, 100):
actual = numerator / denominator
a = numerator // 10
b = numerator % 10
... | 91 | 0 | 23 |
688ee5545254622e1ce44b690ca4611724abbcc6 | 5,835 | py | Python | datatables_ajax/datatables.py | ntbrown/django-datatables-ajax | 33d7d2088f83b292ddc86bb04fb6d3198c64e384 | [
"BSD-2-Clause"
] | null | null | null | datatables_ajax/datatables.py | ntbrown/django-datatables-ajax | 33d7d2088f83b292ddc86bb04fb6d3198c64e384 | [
"BSD-2-Clause"
] | null | null | null | datatables_ajax/datatables.py | ntbrown/django-datatables-ajax | 33d7d2088f83b292ddc86bb04fb6d3198c64e384 | [
"BSD-2-Clause"
] | null | null | null | import datetime
import json
from django.conf import settings
from django.utils import timezone
| 36.93038 | 94 | 0.538817 | import datetime
import json
from django.conf import settings
from django.utils import timezone
class DjangoDatatablesServerProc(object):
def __init__(self, request, model, columns):
"""
model = StatoUtenzaCorso
columns = ['pk', 'cliente', 'corso', 'altro',
'contatt... | 435 | 5,281 | 23 |
42710362f7c9593935a7f782e4bf40278b85164a | 3,605 | py | Python | src/modules/ZapBot/__init__.py | Icaro-G-Silva/Bot-Suite | d18e17ea0432524c71f83db7c83603eb88c0c3cd | [
"MIT"
] | null | null | null | src/modules/ZapBot/__init__.py | Icaro-G-Silva/Bot-Suite | d18e17ea0432524c71f83db7c83603eb88c0c3cd | [
"MIT"
] | null | null | null | src/modules/ZapBot/__init__.py | Icaro-G-Silva/Bot-Suite | d18e17ea0432524c71f83db7c83603eb88c0c3cd | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from datetime import datetime
import time
| 40.055556 | 140 | 0.612205 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from datetime import datetime
import time
def verifyInput(message, sendTo):
if type(message) != str or type(s... | 3,041 | -3 | 317 |
432b32f7744af2c2ec20833b2b229f79eee61e8a | 1,424 | py | Python | MiddleKit/Run/SQLiteObjectStore.py | PeaceWorksTechnologySolutions/w4py | 74f5a03a63f1a93563502b908474aefaae2abda2 | [
"MIT"
] | null | null | null | MiddleKit/Run/SQLiteObjectStore.py | PeaceWorksTechnologySolutions/w4py | 74f5a03a63f1a93563502b908474aefaae2abda2 | [
"MIT"
] | null | null | null | MiddleKit/Run/SQLiteObjectStore.py | PeaceWorksTechnologySolutions/w4py | 74f5a03a63f1a93563502b908474aefaae2abda2 | [
"MIT"
] | null | null | null | import sqlite3 as sqlite
from SQLObjectStore import SQLObjectStore
class SQLiteObjectStore(SQLObjectStore):
"""SQLiteObjectStore implements an object store backed by a SQLite database.
See the SQLite docs or the DB API 2.0 docs for more information:
https://docs.python.org/2/library/sqlite3.html
... | 29.061224 | 80 | 0.624298 | import sqlite3 as sqlite
from SQLObjectStore import SQLObjectStore
class SQLiteObjectStore(SQLObjectStore):
"""SQLiteObjectStore implements an object store backed by a SQLite database.
See the SQLite docs or the DB API 2.0 docs for more information:
https://docs.python.org/2/library/sqlite3.html
... | 836 | 4 | 212 |
9cba84af39093c2f8e33ef840cac70750d953876 | 692 | py | Python | itdagene/graphql/middleware.py | itdagene-ntnu/itdagene | b972cd3d803debccebbc33641397a39834b8d69a | [
"MIT"
] | 9 | 2018-10-17T20:58:09.000Z | 2021-12-16T16:16:45.000Z | itdagene/graphql/middleware.py | itdagene-ntnu/itdagene | b972cd3d803debccebbc33641397a39834b8d69a | [
"MIT"
] | 177 | 2018-10-27T18:15:56.000Z | 2022-03-28T04:29:06.000Z | itdagene/graphql/middleware.py | itdagene-ntnu/itdagene | b972cd3d803debccebbc33641397a39834b8d69a | [
"MIT"
] | null | null | null | from django.conf import settings
from graphql import GraphQLError
from itdagene.graphql.loaders import Loaders
| 32.952381 | 65 | 0.66185 | from django.conf import settings
from graphql import GraphQLError
from itdagene.graphql.loaders import Loaders
class LoaderMiddleware:
def resolve(self, next, root, info, **args):
if not hasattr(info.context, "loaders"):
info.context.loaders = Loaders()
return next(root, info, **args)
... | 471 | 10 | 98 |
8317afd021e220b555dc36ab7cec6b22207fd711 | 1,497 | py | Python | oneoff.py | Bevan0/oneoff | 619a16e1eaaf7c6d841dfa32f1dccfd741bf891d | [
"MIT"
] | 1 | 2022-02-01T03:27:13.000Z | 2022-02-01T03:27:13.000Z | oneoff.py | Bevan0/oneoff | 619a16e1eaaf7c6d841dfa32f1dccfd741bf891d | [
"MIT"
] | null | null | null | oneoff.py | Bevan0/oneoff | 619a16e1eaaf7c6d841dfa32f1dccfd741bf891d | [
"MIT"
] | null | null | null | import click
import subprocess
import random
import string
import os
@click.group()
@cli.command()
@click.argument("runner")
@click.option("--editor", default="nano")
| 30.55102 | 115 | 0.603206 | import click
import subprocess
import random
import string
import os
@click.group()
def cli(): pass
@cli.command()
@click.argument("runner")
@click.option("--editor", default="nano")
def run(runner, editor):
file_name = None
realrunner = runner
if runner == "!":
prevfile = open(f"{os.environ['HOME... | 1,284 | 0 | 44 |
86c037e23ad6dc6e733532c71365e27da825f860 | 1,194 | py | Python | neutron/tests/functional/__init__.py | NeCTAR-RC/neutron | acf78cc3c88aff638180819419a65145a9a79695 | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/__init__.py | NeCTAR-RC/neutron | acf78cc3c88aff638180819419a65145a9a79695 | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/__init__.py | NeCTAR-RC/neutron | acf78cc3c88aff638180819419a65145a9a79695 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Red Hat, 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 agre... | 33.166667 | 78 | 0.711055 | # Copyright 2015 Red Hat, 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 agre... | 402 | 0 | 23 |
65c631fbb803e3fbc0221f0843c0f33c68e1b661 | 8,179 | py | Python | examples/privacy/membership_inference/train.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | 139 | 2020-03-28T02:37:07.000Z | 2022-03-24T15:35:39.000Z | examples/privacy/membership_inference/train.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | 2 | 2020-04-02T09:50:21.000Z | 2020-05-09T06:52:57.000Z | examples/privacy/membership_inference/train.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | 12 | 2020-03-28T02:52:42.000Z | 2021-07-15T08:05:06.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 40.895 | 117 | 0.669275 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 0 | 0 | 0 |
0cbeb629e794b65cf7a6c61177377cd5ccd4028a | 386 | py | Python | armada_command/command_name.py | firesoft/armada | 245115fcf21d988db5da71f18b3123479de5f2c1 | [
"Apache-2.0"
] | 281 | 2015-07-08T12:52:19.000Z | 2022-01-14T22:56:25.000Z | armada_command/command_name.py | firesoft/armada | 245115fcf21d988db5da71f18b3123479de5f2c1 | [
"Apache-2.0"
] | 15 | 2015-08-03T14:54:30.000Z | 2021-01-27T12:30:06.000Z | armada_command/command_name.py | firesoft/armada | 245115fcf21d988db5da71f18b3123479de5f2c1 | [
"Apache-2.0"
] | 39 | 2015-07-13T14:43:44.000Z | 2022-01-12T15:41:32.000Z | from armada_command import armada_api
| 25.733333 | 84 | 0.668394 | from armada_command import armada_api
def add_arguments(parser):
parser.add_argument('name', help='New name for the ship', nargs='?', default='')
def command_name(args):
if args.name:
result = armada_api.post('name', {'name': args.name})
armada_api.print_result_from_armada_api(result)
el... | 300 | 0 | 46 |
213120ab7d47e5368a0a6d21cf7ba3a46730eda8 | 7,282 | py | Python | src/controllers/mainController.py | shimadasoftware/ATM-Simulator | 2d3b0cdc06f9b5a5ea2ba1b9b17053227e322dc4 | [
"Apache-2.0"
] | 2 | 2021-09-08T16:57:51.000Z | 2021-09-14T19:41:25.000Z | src/controllers/mainController.py | shimadasoftware/ATM-Simulator | 2d3b0cdc06f9b5a5ea2ba1b9b17053227e322dc4 | [
"Apache-2.0"
] | null | null | null | src/controllers/mainController.py | shimadasoftware/ATM-Simulator | 2d3b0cdc06f9b5a5ea2ba1b9b17053227e322dc4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Main Controller
Created on Tue Aug 17 14:16:44 2021
Version: 1.0
Universidad Santo Tomás Tunja
Simulation
@author: Juana Valentina Mendoza Santamaría
@author: Alix Ivonne Chaparro Vasquez
presented to: Martha Susana Contreras Ortiz
"""
from random import randint
imp... | 29.24498 | 100 | 0.633068 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Main Controller
Created on Tue Aug 17 14:16:44 2021
Version: 1.0
Universidad Santo Tomás Tunja
Simulation
@author: Juana Valentina Mendoza Santamaría
@author: Alix Ivonne Chaparro Vasquez
presented to: Martha Susana Contreras Ortiz
"""
from random import randint
imp... | 0 | 0 | 0 |
8dd6e9731c0a7723cdc7ad07c5dc2364c7e82ae3 | 198 | py | Python | zksync_sdk/types/__init__.py | toobit/zksync-python | 49b774dfda6a6b5f2e879bfee831b1ce3bf64ad0 | [
"MIT"
] | null | null | null | zksync_sdk/types/__init__.py | toobit/zksync-python | 49b774dfda6a6b5f2e879bfee831b1ce3bf64ad0 | [
"MIT"
] | null | null | null | zksync_sdk/types/__init__.py | toobit/zksync-python | 49b774dfda6a6b5f2e879bfee831b1ce3bf64ad0 | [
"MIT"
] | null | null | null | from enum import IntEnum
from .responses import *
from .signatures import *
from .transactions import *
| 15.230769 | 27 | 0.686869 | from enum import IntEnum
from .responses import *
from .signatures import *
from .transactions import *
class ChainId(IntEnum):
MAINNET = 10
RINKEBY = 4
ROPSTEN = 3
LOCALHOST = 9
| 0 | 69 | 23 |
281ec0bf45a2ac0a1f920b77e99794caa55c4669 | 1,188 | py | Python | tools/harmonics/show.py | jjzhang166/OpenGLEngine | e5d86f41536834499f4dd534c590fbeed045ff7c | [
"MIT"
] | 1 | 2021-08-12T07:35:49.000Z | 2021-08-12T07:35:49.000Z | tools/harmonics/show.py | jjzhang166/OpenGLEngine | e5d86f41536834499f4dd534c590fbeed045ff7c | [
"MIT"
] | null | null | null | tools/harmonics/show.py | jjzhang166/OpenGLEngine | e5d86f41536834499f4dd534c590fbeed045ff7c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: penghuailiang
# @Date : 1/1/20
"""
此脚本使用scipy.special绘制球谐函数
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import sph_harm
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
theta_1d = np.linspace(0, np.pi, 181) # c... | 26.4 | 107 | 0.670875 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: penghuailiang
# @Date : 1/1/20
"""
此脚本使用scipy.special绘制球谐函数
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import sph_harm
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
theta_1d = np.linspace(0, np.pi, 181) # c... | 473 | 0 | 23 |
f78a15aad41a1b7a1db447dc27b33c377969ed73 | 1,081 | py | Python | uploads/core/migrations/0004_auto_20211123_1244.py | Borna07/IFC2Data | 8a3f287785b165ea4f0090c4f50c08a3d3b0c75c | [
"MIT"
] | null | null | null | uploads/core/migrations/0004_auto_20211123_1244.py | Borna07/IFC2Data | 8a3f287785b165ea4f0090c4f50c08a3d3b0c75c | [
"MIT"
] | null | null | null | uploads/core/migrations/0004_auto_20211123_1244.py | Borna07/IFC2Data | 8a3f287785b165ea4f0090c4f50c08a3d3b0c75c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-11-23 11:44
from django.db import migrations, models
| 27.717949 | 62 | 0.565217 | # Generated by Django 3.2.7 on 2021-11-23 11:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20211028_1323'),
]
operations = [
migrations.AddField(
model_name='document',
name='author',
... | 0 | 967 | 23 |
8a26904370270bb9ef3f9739a127a6f42fb2fd42 | 1,954 | py | Python | 25-Scheme/lab09/lab09/tests/composed.py | ericchen12377/CS61A_LearningDoc | 31f23962b0e2834795bf61eeb0f4884cc5da1809 | [
"MIT"
] | 2 | 2020-04-24T18:36:53.000Z | 2020-04-25T00:15:55.000Z | 25-Scheme/lab09/lab09/tests/composed.py | ericchen12377/CS61A_LearningDoc | 31f23962b0e2834795bf61eeb0f4884cc5da1809 | [
"MIT"
] | null | null | null | 25-Scheme/lab09/lab09/tests/composed.py | ericchen12377/CS61A_LearningDoc | 31f23962b0e2834795bf61eeb0f4884cc5da1809 | [
"MIT"
] | null | null | null | test = {
'name': 'composed',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> ((composed add-one add-one) 2)
a1e11865670a42d05e20b9a3455dc457
# locked
""",
'hidden': False,
'locked': True
},
{
... | 23.829268 | 72 | 0.420676 | test = {
'name': 'composed',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> ((composed add-one add-one) 2)
a1e11865670a42d05e20b9a3455dc457
# locked
""",
'hidden': False,
'locked': True
},
{
... | 0 | 0 | 0 |
cde1909da181e5ecc25ad5f5fd545a95d8f60d11 | 2,580 | py | Python | src/visualize.py | Mirofil/RobustDARTS | da8654f63c89b28207c1253bdc6ad20222e99c9d | [
"Apache-2.0"
] | 151 | 2019-09-25T06:25:38.000Z | 2022-02-05T04:35:11.000Z | src/visualize.py | Mirofil/RobustDARTS | da8654f63c89b28207c1253bdc6ad20222e99c9d | [
"Apache-2.0"
] | 6 | 2019-12-27T08:10:22.000Z | 2020-11-10T16:01:20.000Z | src/visualize.py | Mirofil/RobustDARTS | da8654f63c89b28207c1253bdc6ad20222e99c9d | [
"Apache-2.0"
] | 39 | 2019-09-26T07:14:08.000Z | 2021-12-27T10:20:27.000Z | import sys
import genotypes
from graphviz import Digraph
from genotypes import PRIMITIVES
if __name__ == '__main__':
if len(sys.argv) != 2:
print("usage:\n python {} ARCH_NAME".format(sys.argv[0]))
sys.exit(1)
genotype_name = sys.argv[1]
try:
genotype = eval('genotypes.{}'.format(genotype_name))
... | 26.326531 | 141 | 0.60969 | import sys
import genotypes
from graphviz import Digraph
from genotypes import PRIMITIVES
def plot_space(primitives, filename):
g = Digraph(
format='pdf',
edge_attr=dict(fontsize='20', fontname="times"),
node_attr=dict(style='filled', shape='rect', align='center', fontsize='20', height='0.5', widt... | 1,882 | 0 | 46 |
f86649417dde7d4997f359927c0844d691b94fbb | 845 | py | Python | app/backend/meridien/settings/local.py | NicholasCF/meridien | dd00caf341d4c9979b89dc8441224ff2b97eac7f | [
"MIT"
] | null | null | null | app/backend/meridien/settings/local.py | NicholasCF/meridien | dd00caf341d4c9979b89dc8441224ff2b97eac7f | [
"MIT"
] | 41 | 2020-05-24T06:47:53.000Z | 2022-02-27T11:10:41.000Z | app/backend/meridien/settings/local.py | NicholasCF/meridien | dd00caf341d4c9979b89dc8441224ff2b97eac7f | [
"MIT"
] | 2 | 2020-11-26T12:19:30.000Z | 2020-12-19T01:14:02.000Z | from meridien.settings.base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '8ka@=25ffr7377i_s*$$6n_=sepb1jpwhrbbgviphal7q=(3zz'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#dat... | 24.142857 | 66 | 0.67574 | from meridien.settings.base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '8ka@=25ffr7377i_s*$$6n_=sepb1jpwhrbbgviphal7q=(3zz'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#dat... | 0 | 0 | 0 |
7c9f348b03d42a72fc76f0d7f884d0b24a4362d0 | 807 | py | Python | Easy/StringMatching.py | revanthsenthil/dCoder_select | 20662123f1d3e1f9c7e8225eea7732be3a19ae57 | [
"MIT"
] | 1 | 2021-08-03T21:23:08.000Z | 2021-08-03T21:23:08.000Z | Easy/StringMatching.py | revanthsenthil/dCoder-Solved | 20662123f1d3e1f9c7e8225eea7732be3a19ae57 | [
"MIT"
] | null | null | null | Easy/StringMatching.py | revanthsenthil/dCoder-Solved | 20662123f1d3e1f9c7e8225eea7732be3a19ae57 | [
"MIT"
] | 1 | 2021-04-22T09:20:12.000Z | 2021-04-22T09:20:12.000Z | """
Problem Description:
Cody has a sequence of characters N. He likes a sequence if it contains his favourite sequence as a substring.
Given the sequence and his favourite sequence F, check whether the favourite sequence is present in the sequence.
Input:
The first line of input contains a single line T, which repres... | 23.057143 | 113 | 0.716233 | """
Problem Description:
Cody has a sequence of characters N. He likes a sequence if it contains his favourite sequence as a substring.
Given the sequence and his favourite sequence F, check whether the favourite sequence is present in the sequence.
Input:
The first line of input contains a single line T, which repres... | 0 | 0 | 0 |
03987ead140b81c6c957329556d3dd9eb6b94c02 | 3,079 | py | Python | SLB.py | kinglionsoft/ali-ecs | 8a7cd902dc0c691ba486585c42b80043da4a1597 | [
"MIT"
] | null | null | null | SLB.py | kinglionsoft/ali-ecs | 8a7cd902dc0c691ba486585c42b80043da4a1597 | [
"MIT"
] | null | null | null | SLB.py | kinglionsoft/ali-ecs | 8a7cd902dc0c691ba486585c42b80043da4a1597 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
from typing import List
import requests
from alibabacloud_slb20140515.client import Client as Slb20140515Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_slb20140515 import models as slb_20140515_models
if __name__ == '__main__':
Sample.... | 33.467391 | 119 | 0.634622 | # -*- coding: utf-8 -*-
import sys
from typing import List
import requests
from alibabacloud_slb20140515.client import Client as Slb20140515Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_slb20140515 import models as slb_20140515_models
class Sample:
def __init__(self):
... | 1,965 | 740 | 23 |
e47cd2291ace2b554a9ac4ba430c9bd2a9575e07 | 7,555 | py | Python | Robovest/robovest.py | yingluwang/Fin-Tech_Intelligent-Portforlio-Recommendation | 7e1ef0ecc71d8335d25d5c2c5f219b5c5f9cdb66 | [
"MIT"
] | 2 | 2017-10-08T11:06:28.000Z | 2019-06-10T07:43:46.000Z | Robovest/robovest.py | yingluwang/Fin-Tech_Intelligent-Portforlio-Recommendation | 7e1ef0ecc71d8335d25d5c2c5f219b5c5f9cdb66 | [
"MIT"
] | 1 | 2020-06-05T18:10:52.000Z | 2020-06-05T18:10:52.000Z | Robovest/robovest.py | yingluwang/Fin-Tech_Intelligent-Portforlio-Recommendation | 7e1ef0ecc71d8335d25d5c2c5f219b5c5f9cdb66 | [
"MIT"
] | 1 | 2018-06-13T02:49:22.000Z | 2018-06-13T02:49:22.000Z | # all the imports
import psycopg2
import nltk
from robovest.portfolio import*
#nltk.download()
import tweepy
import os
import sqlite3
import datetime
import numpy as np
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_templ... | 31.348548 | 401 | 0.647386 | # all the imports
import psycopg2
import nltk
from robovest.portfolio import*
#nltk.download()
import tweepy
import os
import sqlite3
import datetime
import numpy as np
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_templ... | 4,845 | 0 | 317 |
72c35ea74260260a0e6d310370bc1e461a820f05 | 6,051 | py | Python | metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py | LucaBassanesecuebiq/datahub | f659cc89388cc6322795c7ba7758d65775a7dedf | [
"Apache-2.0"
] | null | null | null | metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py | LucaBassanesecuebiq/datahub | f659cc89388cc6322795c7ba7758d65775a7dedf | [
"Apache-2.0"
] | 1 | 2022-02-02T17:26:16.000Z | 2022-02-02T17:26:16.000Z | metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py | liftoffio/datahub | ff163059587a137a22fa0c655f568a40eda44236 | [
"Apache-2.0"
] | null | null | null | import concurrent.futures
import functools
import logging
from dataclasses import dataclass
from typing import Union, cast
from datahub.cli.cli_utils import set_env_variables_override_config
from datahub.configuration.common import OperationalError
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from dat... | 39.03871 | 97 | 0.632788 | import concurrent.futures
import functools
import logging
from dataclasses import dataclass
from typing import Union, cast
from datahub.cli.cli_utils import set_env_variables_override_config
from datahub.configuration.common import OperationalError
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from dat... | 4,547 | 465 | 67 |
9c43110fdc192b45c3d8ed5df71194250983b1d9 | 63 | py | Python | django_project/kv_settings/__init__.py | eshandas/django_key_value_settings | 70ba8c0877f4b59cb66e69507b1e78bbd62f7e65 | [
"MIT"
] | null | null | null | django_project/kv_settings/__init__.py | eshandas/django_key_value_settings | 70ba8c0877f4b59cb66e69507b1e78bbd62f7e65 | [
"MIT"
] | 7 | 2020-06-06T00:25:53.000Z | 2022-03-12T00:03:44.000Z | kv_settings/__init__.py | eshandas/django_key_value_settings | 70ba8c0877f4b59cb66e69507b1e78bbd62f7e65 | [
"MIT"
] | null | null | null | default_app_config = 'kv_settings.apps.KeyValueSettingsConfig'
| 31.5 | 62 | 0.873016 | default_app_config = 'kv_settings.apps.KeyValueSettingsConfig'
| 0 | 0 | 0 |
794b4ed15c8f93c479bec99b65b51a11d39732e7 | 377 | py | Python | flows/models.py | sergioisidoro/django-flows | 326baa3e216a15bd7a8d13b2a09ba9752e250dbb | [
"BSD-2-Clause"
] | 104 | 2015-01-05T14:29:16.000Z | 2021-11-08T11:20:24.000Z | flows/models.py | sergioisidoro/django-flows | 326baa3e216a15bd7a8d13b2a09ba9752e250dbb | [
"BSD-2-Clause"
] | 4 | 2015-09-23T11:14:50.000Z | 2020-03-21T06:08:34.000Z | flows/models.py | sergioisidoro/django-flows | 326baa3e216a15bd7a8d13b2a09ba9752e250dbb | [
"BSD-2-Clause"
] | 16 | 2015-01-05T10:13:44.000Z | 2022-02-14T05:21:23.000Z | # -*- coding: UTF-8 -*-
# Note: this is mainly required because using the Django test runner
# requires that apps under test have a 'models' module, even if it's
# just empty.
from flows import config
if config.FLOWS_STATE_STORE == 'flows.statestore.django_store':
from flows.statestore.django_store import StateM... | 37.7 | 109 | 0.763926 | # -*- coding: UTF-8 -*-
# Note: this is mainly required because using the Django test runner
# requires that apps under test have a 'models' module, even if it's
# just empty.
from flows import config
if config.FLOWS_STATE_STORE == 'flows.statestore.django_store':
from flows.statestore.django_store import StateM... | 0 | 0 | 0 |
b1c9d24c4d92140fd0fc0bd73cab307649f1602b | 439 | py | Python | Thread_Socket/Thread-Multiprocess.py | dumin199101/Scrapy-Project | b4135beb73a2c5aad1728f747c1856266af649dd | [
"Apache-2.0"
] | 1 | 2019-07-11T03:28:25.000Z | 2019-07-11T03:28:25.000Z | Thread_Socket/Thread-Multiprocess.py | dumin199101/Scrapy-Project | b4135beb73a2c5aad1728f747c1856266af649dd | [
"Apache-2.0"
] | null | null | null | Thread_Socket/Thread-Multiprocess.py | dumin199101/Scrapy-Project | b4135beb73a2c5aad1728f747c1856266af649dd | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
使用multiprocessing模块创建多进程
"""
import os
from multiprocessing import Process
# 子进程要执行的代码
if __name__ == '__main__':
print('Parent process %s.'% os.getpid())
for i in range(5):
p = Process(target=run_proc,args=(str(i),))
print('Process will start.')
p.start()
p.join... | 23.105263 | 65 | 0.626424 | # coding=utf-8
"""
使用multiprocessing模块创建多进程
"""
import os
from multiprocessing import Process
# 子进程要执行的代码
def run_proc(name):
print('Child progress %s (%s) Running...'%(name,os.getpid()))
if __name__ == '__main__':
print('Parent process %s.'% os.getpid())
for i in range(5):
p = Process(target=run_... | 64 | 0 | 22 |
874402dc3739cdffb2a6dc31b45049338e340ffd | 5,258 | py | Python | web/server/views.py | p-schlickmann/proffy-app | 2c8edb3195993e29f2c4033eed1f330ea79a5cd6 | [
"MIT"
] | null | null | null | web/server/views.py | p-schlickmann/proffy-app | 2c8edb3195993e29f2c4033eed1f330ea79a5cd6 | [
"MIT"
] | null | null | null | web/server/views.py | p-schlickmann/proffy-app | 2c8edb3195993e29f2c4033eed1f330ea79a5cd6 | [
"MIT"
] | null | null | null | from django.shortcuts import render
import time
import datetime
from server import models
# Create your views here.
| 33.922581 | 132 | 0.579498 | from django.shortcuts import render
import time
import datetime
from server import models
# Create your views here.
def index(request):
return render(request, "server/index.html")
def study(request):
return render(request, "server/study.html", {
'proffys': models.Teacher.objects.all()
})
de... | 5,006 | 0 | 138 |
7354772c1b94e715c0a4c2319b9b462e99ca7ccd | 739 | py | Python | tests/data.py | szymonmaszke/torchtraining | 1ddf169325b7239d6d6686b20072a406b69a0180 | [
"MIT"
] | 3 | 2020-08-26T06:11:58.000Z | 2020-08-27T08:11:15.000Z | tests/data.py | klaudiapalasz/torchtraining | 7ac54009eea2fd84aa635b6f3cbfe306f317d087 | [
"MIT"
] | 1 | 2020-08-25T19:19:43.000Z | 2020-08-25T19:19:43.000Z | tests/data.py | klaudiapalasz/torchtraining | 7ac54009eea2fd84aa635b6f3cbfe306f317d087 | [
"MIT"
] | 1 | 2021-04-15T18:55:57.000Z | 2021-04-15T18:55:57.000Z | import typing
import torch
import torchtraining as tt
import torchvision
| 28.423077 | 84 | 0.638701 | import typing
import torch
import torchtraining as tt
import torchvision
def get(batch_size: int) -> typing.Dict:
train, validation = tt.functional.data.random_split(
torchvision.datasets.FakeData(
size=64,
image_size=(3, 28, 28),
transform=torchvision.transforms.ToTen... | 641 | 0 | 23 |
06f067b36da9ed63fc57904f7389ad728f45b423 | 425 | py | Python | setup.py | rlugojr/pygments-snowball | 4d9b086f4e2f81a3cd351c1fd2eaddf0d20abee9 | [
"BSD-2-Clause"
] | 2 | 2018-03-01T05:38:42.000Z | 2021-02-08T15:49:59.000Z | setup.py | rlugojr/pygments-snowball | 4d9b086f4e2f81a3cd351c1fd2eaddf0d20abee9 | [
"BSD-2-Clause"
] | 1 | 2015-10-09T04:33:10.000Z | 2015-10-09T04:33:10.000Z | setup.py | rlugojr/pygments-snowball | 4d9b086f4e2f81a3cd351c1fd2eaddf0d20abee9 | [
"BSD-2-Clause"
] | 2 | 2015-10-09T00:23:46.000Z | 2017-02-20T06:28:33.000Z | from setuptools import setup
setup(
name="Pygments Snowball Plugin",
version = "1.0",
scripts = ['pygments_snowball.py'],
entry_points = """
[pygments.lexers]
snowball_lexer = pygments_snowball:SnowballLexer
""",
description = 'Pygments Lexer Plugin for Snowball',
license = '... | 28.333333 | 56 | 0.649412 | from setuptools import setup
setup(
name="Pygments Snowball Plugin",
version = "1.0",
scripts = ['pygments_snowball.py'],
entry_points = """
[pygments.lexers]
snowball_lexer = pygments_snowball:SnowballLexer
""",
description = 'Pygments Lexer Plugin for Snowball',
license = '... | 0 | 0 | 0 |
6f8359d5ef293b0acd6612a7956555e5aaa066b7 | 2,664 | py | Python | GSAS-II-WONDER/imports/G2img_Rigaku.py | WONDER-project/GSAS-II-WONDER-OSX | f90ab85f89f282d1b9686a1cbbf5adc5c48ceac9 | [
"MIT"
] | null | null | null | GSAS-II-WONDER/imports/G2img_Rigaku.py | WONDER-project/GSAS-II-WONDER-OSX | f90ab85f89f282d1b9686a1cbbf5adc5c48ceac9 | [
"MIT"
] | null | null | null | GSAS-II-WONDER/imports/G2img_Rigaku.py | WONDER-project/GSAS-II-WONDER-OSX | f90ab85f89f282d1b9686a1cbbf5adc5c48ceac9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
########### SVN repository information ###################
# $Date: 2017-10-23 11:39:16 -0500 (Mon, 23 Oct 2017) $
# $Author: vondreele $
# $Revision: 3136 $
# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/imports/G2img_Rigaku.py $
# $Id: G2img_Rigaku.py 3136 2017-10-23 16:39:16Z vondre... | 34.597403 | 106 | 0.596471 | # -*- coding: utf-8 -*-
########### SVN repository information ###################
# $Date: 2017-10-23 11:39:16 -0500 (Mon, 23 Oct 2017) $
# $Author: vondreele $
# $Revision: 3136 $
# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/imports/G2img_Rigaku.py $
# $Id: G2img_Rigaku.py 3136 2017-10-23 16:39:16Z vondre... | 509 | 0 | 61 |
0119dceea660beaed65024aa33059b7c1e1cc25a | 1,889 | py | Python | src/m6_your_turtles.py | shaneecho/01-IntroductionToPython | 4bd03dd0631b24a8a58c6709c05c73eea9dc1567 | [
"MIT"
] | null | null | null | src/m6_your_turtles.py | shaneecho/01-IntroductionToPython | 4bd03dd0631b24a8a58c6709c05c73eea9dc1567 | [
"MIT"
] | null | null | null | src/m6_your_turtles.py | shaneecho/01-IntroductionToPython | 4bd03dd0631b24a8a58c6709c05c73eea9dc1567 | [
"MIT"
] | null | null | null | """
Your chance to explore Loops and Turtles!
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Aaron Wilkin, their colleagues, and Shixin Yan.
"""
########################################################################
# DONE: 1.
# On Line 5 above, replace PUT_YOUR_NAME_HERE with your o... | 31.483333 | 73 | 0.586024 | """
Your chance to explore Loops and Turtles!
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Aaron Wilkin, their colleagues, and Shixin Yan.
"""
########################################################################
# DONE: 1.
# On Line 5 above, replace PUT_YOUR_NAME_HERE with your o... | 0 | 0 | 0 |
ccb90990658e51c1364711573c5224ef470491c3 | 2,810 | py | Python | script/MakeRef.py | weefuzzy/flucoma-docs | bc7cc6b9f4f2b35ba20659a894590fa1879a34f7 | [
"BSD-3-Clause"
] | 2 | 2020-09-03T21:24:14.000Z | 2020-09-30T07:54:41.000Z | script/MakeRef.py | weefuzzy/flucoma-docs | bc7cc6b9f4f2b35ba20659a894590fa1879a34f7 | [
"BSD-3-Clause"
] | 66 | 2021-06-10T10:29:26.000Z | 2022-03-29T11:24:16.000Z | script/MakeRef.py | weefuzzy/flucoma-docs | bc7cc6b9f4f2b35ba20659a894590fa1879a34f7 | [
"BSD-3-Clause"
] | 4 | 2021-06-24T12:06:05.000Z | 2021-09-20T10:48:54.000Z | # Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
# Copyright 2017-2019 University of Huddersfield.
# Licensed under the BSD-3 License.
# See license.md file in the project root for full license information.
# This project has received funding from the European Research Council (ERC)
# under the... | 33.855422 | 119 | 0.677224 | # Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
# Copyright 2017-2019 University of Huddersfield.
# Licensed under the BSD-3 License.
# See license.md file in the project root for full license information.
# This project has received funding from the European Research Council (ERC)
# under the... | 832 | 0 | 23 |
04d616b61bd8c5c92992d7d948f74bfe17e96634 | 1,535 | py | Python | api/migrations/0003_auto_20161111_2324.py | gdelnegro/orders_api | e6cc45e0b486ae5bb50c095174f251a941733d6b | [
"MIT"
] | null | null | null | api/migrations/0003_auto_20161111_2324.py | gdelnegro/orders_api | e6cc45e0b486ae5bb50c095174f251a941733d6b | [
"MIT"
] | null | null | null | api/migrations/0003_auto_20161111_2324.py | gdelnegro/orders_api | e6cc45e0b486ae5bb50c095174f251a941733d6b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-11 23:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| 39.358974 | 136 | 0.607818 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-11 23:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0002_auto_20161111_2309'),
]
operations = [... | 0 | 1,323 | 23 |
fa31827beee52528e022c7012ef90988bb621e78 | 23,958 | py | Python | ppci/binutils/linker.py | rakati/ppci-mirror | 8f5b0282fd1122d7c389b39c86fcf5d9352b7bb2 | [
"BSD-2-Clause"
] | null | null | null | ppci/binutils/linker.py | rakati/ppci-mirror | 8f5b0282fd1122d7c389b39c86fcf5d9352b7bb2 | [
"BSD-2-Clause"
] | null | null | null | ppci/binutils/linker.py | rakati/ppci-mirror | 8f5b0282fd1122d7c389b39c86fcf5d9352b7bb2 | [
"BSD-2-Clause"
] | 1 | 2021-11-23T14:23:04.000Z | 2021-11-23T14:23:04.000Z | """ Linker utility. """
import logging
from collections import defaultdict
from .objectfile import ObjectFile, Image, get_object, RelocationEntry
from ..common import CompilerError
from .layout import Layout, Section, SectionData, SymbolDefinition, Align
from .layout import get_layout
from .debuginfo import SymbolIdAd... | 37.086687 | 79 | 0.570457 | """ Linker utility. """
import logging
from collections import defaultdict
from .objectfile import ObjectFile, Image, get_object, RelocationEntry
from ..common import CompilerError
from .layout import Layout, Section, SectionData, SymbolDefinition, Align
from .layout import get_layout
from .debuginfo import SymbolIdAd... | 111 | 0 | 27 |
dfe16477368e24a4f2172694856b8591a7539edf | 511 | py | Python | rest_api/api/models.py | markbirds/Django-Code-Repo | b55762d2dab00640acf2e8e00ddc66716d53c6b5 | [
"MIT"
] | 1 | 2021-11-25T00:02:36.000Z | 2021-11-25T00:02:36.000Z | rest_api/api/models.py | markbirds/Django-Code-Repo | b55762d2dab00640acf2e8e00ddc66716d53c6b5 | [
"MIT"
] | null | null | null | rest_api/api/models.py | markbirds/Django-Code-Repo | b55762d2dab00640acf2e8e00ddc66716d53c6b5 | [
"MIT"
] | null | null | null | from django.db import models
import uuid
# Create your models here.
| 36.5 | 101 | 0.737769 | from django.db import models
import uuid
# Create your models here.
class User(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length=50)
age = models.IntegerField()
language = models.CharField(null=True,max_length=50,verbose_name="... | 39 | 381 | 22 |
d4c139e44c9983284d65e44c0b0cfcc570e4e8b9 | 140 | py | Python | setup.py | SaradhaVenkatachalapathy/annotate_images | fd10672909211d87c24e5e3eedaebb1f5d3ebda3 | [
"MIT"
] | 1 | 2021-08-06T18:40:14.000Z | 2021-08-06T18:40:14.000Z | setup.py | SaradhaVenkatachalapathy/annotate_images | fd10672909211d87c24e5e3eedaebb1f5d3ebda3 | [
"MIT"
] | 1 | 2021-08-19T10:54:47.000Z | 2021-08-19T11:03:00.000Z | setup.py | SaradhaVenkatachalapathy/annotate_images | fd10672909211d87c24e5e3eedaebb1f5d3ebda3 | [
"MIT"
] | 1 | 2021-08-11T11:41:48.000Z | 2021-08-11T11:41:48.000Z | from setuptools import setup
setup(
name='interactive_segmentation',
version='1.0',
packages=['annotate'],
license='MIT'
)
| 15.555556 | 36 | 0.664286 | from setuptools import setup
setup(
name='interactive_segmentation',
version='1.0',
packages=['annotate'],
license='MIT'
)
| 0 | 0 | 0 |