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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ba628cd49a0fa260acc61f07dfc56bf249bdcadf | 239 | py | Python | test/mitmproxy/addons/test_comment.py | KarlParkinson/mitmproxy | fd5caf40c75ca73c4b767170497abf6a5bf016a0 | [
"MIT"
] | 24,939 | 2015-01-01T17:13:21.000Z | 2022-03-31T17:50:04.000Z | test/mitmproxy/addons/test_comment.py | KarlParkinson/mitmproxy | fd5caf40c75ca73c4b767170497abf6a5bf016a0 | [
"MIT"
] | 3,655 | 2015-01-02T12:31:43.000Z | 2022-03-31T20:24:57.000Z | test/mitmproxy/addons/test_comment.py | KarlParkinson/mitmproxy | fd5caf40c75ca73c4b767170497abf6a5bf016a0 | [
"MIT"
] | 3,712 | 2015-01-06T06:47:06.000Z | 2022-03-31T10:33:27.000Z | from mitmproxy.test import tflow, taddons
from mitmproxy.addons.comment import Comment
| 18.384615 | 44 | 0.648536 | from mitmproxy.test import tflow, taddons
from mitmproxy.addons.comment import Comment
def test_comment():
c = Comment()
f = tflow.tflow()
with taddons.context():
c.comment([f], "foo")
assert f.comment == "foo"
| 128 | 0 | 23 |
90692882a79f4eef6affd5d58e67200f97d7366a | 301 | py | Python | venv/Lib/site-packages/tensorflow/keras/estimator/__init__.py | caiovini/Image_reader_api | 7fae630a17195d3415eb739278ef21a3b58cae76 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/keras/estimator/__init__.py | caiovini/Image_reader_api | 7fae630a17195d3415eb739278ef21a3b58cae76 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/keras/estimator/__init__.py | caiovini/Image_reader_api | 7fae630a17195d3415eb739278ef21a3b58cae76 | [
"MIT"
] | null | null | null | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/tools/api/generator/create_python_api.py script.
"""Home of estimator related functions.
"""
from __future__ import print_function
from tensorflow.python.estimator.estimator_lib import model_to_estimator
del print_function
| 25.083333 | 75 | 0.817276 | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/tools/api/generator/create_python_api.py script.
"""Home of estimator related functions.
"""
from __future__ import print_function
from tensorflow.python.estimator.estimator_lib import model_to_estimator
del print_function
| 0 | 0 | 0 |
951c166cc63dde88465dc6e4e067b684760cd2b3 | 15,417 | py | Python | utils/scripts/OOOlevelGen/src/LevelBuilder.py | fullscreennl/bullettime | 8967449cdf926aaed6bb7ec217d92e0689fb0c3c | [
"MIT"
] | null | null | null | utils/scripts/OOOlevelGen/src/LevelBuilder.py | fullscreennl/bullettime | 8967449cdf926aaed6bb7ec217d92e0689fb0c3c | [
"MIT"
] | null | null | null | utils/scripts/OOOlevelGen/src/LevelBuilder.py | fullscreennl/bullettime | 8967449cdf926aaed6bb7ec217d92e0689fb0c3c | [
"MIT"
] | null | null | null | import os
import config
from sprites import *
from sprite_templates import *
import traceback
from xml.dom.minidom import parseString
import sys
LEVEL = """
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.... | 36.360849 | 243 | 0.574042 | import os
import config
from sprites import *
from sprite_templates import *
import traceback
from xml.dom.minidom import parseString
import sys
LEVEL = """
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.... | 3,971 | 13 | 418 |
bac6abe5625493532e6b8e6c51c6549f943ccc10 | 11,571 | py | Python | server/ai/src/learnUltimo.py | ChuVal/Respaldo2 | 0e5c8ad2ca7084eae3c907950188218c44acef46 | [
"MIT"
] | null | null | null | server/ai/src/learnUltimo.py | ChuVal/Respaldo2 | 0e5c8ad2ca7084eae3c907950188218c44acef46 | [
"MIT"
] | null | null | null | server/ai/src/learnUltimo.py | ChuVal/Respaldo2 | 0e5c8ad2ca7084eae3c907950188218c44acef46 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import io
import csv
import json
import warnings
import pickle
import operator
import time
import logging
import math
import functools
import numpy
from sklearn.preprocessing import MinMaxScaler
from threading import Thread
from random import shuffle
from sklearn.neural_network import MLPClassifier
... | 35.603077 | 117 | 0.522945 | #!/usr/bin/python3
import io
import csv
import json
import warnings
import pickle
import operator
import time
import logging
import math
import functools
import numpy
from sklearn.preprocessing import MinMaxScaler
from threading import Thread
from random import shuffle
from sklearn.neural_network import MLPClassifier
... | 9,804 | 239 | 46 |
e508509e8df1852db899b8674c4cdd7c0a64151e | 850 | py | Python | src/app.py | kimmomuli/lukuvinkkikirjasto | 633e9bb73f8d9ece96b7e7144df1a14ca7f1c40e | [
"MIT"
] | null | null | null | src/app.py | kimmomuli/lukuvinkkikirjasto | 633e9bb73f8d9ece96b7e7144df1a14ca7f1c40e | [
"MIT"
] | null | null | null | src/app.py | kimmomuli/lukuvinkkikirjasto | 633e9bb73f8d9ece96b7e7144df1a14ca7f1c40e | [
"MIT"
] | null | null | null | import logging
from os import getenv
from flask import Flask
from flask import session # pylint: disable=unused-import
from config import DATABASE_URL, ENV
from database import database
from views import login, new_tip, register, tips, tests, like
| 31.481481 | 61 | 0.756471 | import logging
from os import getenv
from flask import Flask
from flask import session # pylint: disable=unused-import
from config import DATABASE_URL, ENV
from database import database
from views import login, new_tip, register, tips, tests, like
def create_app():
app = Flask(__name__)
app.secret_key = gete... | 577 | 0 | 23 |
5231c3167b920cec661de41fdb187267c70ca933 | 14,138 | py | Python | test/test_auth.py | C2Devel/mongo-python-driver | 7b090b9c89a52504ac85af6028a52a4a4af35221 | [
"Apache-2.0"
] | null | null | null | test/test_auth.py | C2Devel/mongo-python-driver | 7b090b9c89a52504ac85af6028a52a4a4af35221 | [
"Apache-2.0"
] | null | null | null | test/test_auth.py | C2Devel/mongo-python-driver | 7b090b9c89a52504ac85af6028a52a4a4af35221 | [
"Apache-2.0"
] | 1 | 2018-10-19T09:05:26.000Z | 2018-10-19T09:05:26.000Z | # Copyright 2013 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 43.103659 | 82 | 0.580422 | # Copyright 2013 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 12,009 | 73 | 443 |
ed252e3dc09df339dd1a38f6aebfba451a1e5444 | 1,867 | py | Python | research/cv/FaceAttribute/src/far_process_RWMF.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/FaceAttribute/src/far_process_RWMF.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/FaceAttribute/src/far_process_RWMF.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2022 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.586957 | 78 | 0.569898 | # Copyright 2022 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 |
b1912b1998b3e837c525f03cf0cd5cb93731c41a | 515 | py | Python | load_model_weights.py | kkleidal/kens_tf_utils | b650475bceec4221044dabc9a2c219bf281672d0 | [
"MIT"
] | 1 | 2019-02-19T16:09:56.000Z | 2019-02-19T16:09:56.000Z | load_model_weights.py | kkleidal/kens_tf_utils | b650475bceec4221044dabc9a2c219bf281672d0 | [
"MIT"
] | null | null | null | load_model_weights.py | kkleidal/kens_tf_utils | b650475bceec4221044dabc9a2c219bf281672d0 | [
"MIT"
] | 2 | 2018-05-28T15:49:01.000Z | 2021-02-09T13:12:14.000Z | #!/usr/bin/env python3
from model_weights import *
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='See what variables are stored in model.npy file')
parser.add_argument('load_from', metavar='LOAD_FROM', type=str,
help='the model.npy file')
a... | 32.1875 | 99 | 0.650485 | #!/usr/bin/env python3
from model_weights import *
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='See what variables are stored in model.npy file')
parser.add_argument('load_from', metavar='LOAD_FROM', type=str,
help='the model.npy file')
a... | 0 | 0 | 0 |
99f138966bc8b9deb592e8bfa9dfa1ff5c8e4c15 | 4,080 | py | Python | test_pylibCZIrw.py | sebi06/czi_demos | b3f7801f46de0138a8a1ac245e9c80787e0a3f17 | [
"MIT"
] | 3 | 2020-12-31T10:06:42.000Z | 2021-11-09T13:44:16.000Z | test_pylibCZIrw.py | sebi06/czi_demos | b3f7801f46de0138a8a1ac245e9c80787e0a3f17 | [
"MIT"
] | null | null | null | test_pylibCZIrw.py | sebi06/czi_demos | b3f7801f46de0138a8a1ac245e9c80787e0a3f17 | [
"MIT"
] | null | null | null | from czifiletools import pylibCZIrw_tools as cztrw
from pylibCZIrw import czi as pyczi
#from pylibCZIrw import Rectangle
from matplotlib import pyplot as plt
#filename = r'd:\Testdata_Zeiss\CZI_Testfiles\Z=4_CH=2.czi'
#filename = r'd:\Testdata_Zeiss\CZI_Testfiles\T=3_Z=4_CH=2.czi'
#filename = r'd:\Testdata_Zeiss\CZI_... | 53.684211 | 115 | 0.797304 | from czifiletools import pylibCZIrw_tools as cztrw
from pylibCZIrw import czi as pyczi
#from pylibCZIrw import Rectangle
from matplotlib import pyplot as plt
#filename = r'd:\Testdata_Zeiss\CZI_Testfiles\Z=4_CH=2.czi'
#filename = r'd:\Testdata_Zeiss\CZI_Testfiles\T=3_Z=4_CH=2.czi'
#filename = r'd:\Testdata_Zeiss\CZI_... | 0 | 0 | 0 |
565a31ec52be1c9a1b57b11a69e58240cf73dd33 | 3,964 | py | Python | python_hyperscope/utils.py | momonala/hyperscope | 2dafe0946235090b0e799014e7f5de6c04881cf5 | [
"MIT"
] | 1 | 2022-01-14T07:12:48.000Z | 2022-01-14T07:12:48.000Z | python_hyperscope/utils.py | momonala/hyperscope | 2dafe0946235090b0e799014e7f5de6c04881cf5 | [
"MIT"
] | 1 | 2021-10-12T22:51:31.000Z | 2021-10-12T22:51:31.000Z | python_hyperscope/utils.py | momonala/hyperscope | 2dafe0946235090b0e799014e7f5de6c04881cf5 | [
"MIT"
] | null | null | null | """Helper functions for generating panoramics."""
import logging
import os
from contextlib import redirect_stderr
from glob import glob
from shutil import copyfile
import cv2
import numpy as np
import psutil
from tqdm import tqdm
logger = logging.getLogger(__name__)
def prepare_directories_for_stitching_in_rows(inp... | 31.212598 | 101 | 0.681382 | """Helper functions for generating panoramics."""
import logging
import os
from contextlib import redirect_stderr
from glob import glob
from shutil import copyfile
import cv2
import numpy as np
import psutil
from tqdm import tqdm
logger = logging.getLogger(__name__)
def prepare_directories_for_stitching_in_rows(inp... | 650 | 0 | 46 |
0dd00d6b1371d82e5dba287fb1ab84b4b728cdc5 | 2,111 | py | Python | dbdaora/hash/query.py | dutradda/sqldataclass | 5c87a3818e9d736bbf5e1438edc5929a2f5acd3f | [
"MIT"
] | 21 | 2019-10-14T14:33:33.000Z | 2022-02-11T04:43:07.000Z | dbdaora/hash/query.py | dutradda/sqldataclass | 5c87a3818e9d736bbf5e1438edc5929a2f5acd3f | [
"MIT"
] | null | null | null | dbdaora/hash/query.py | dutradda/sqldataclass | 5c87a3818e9d736bbf5e1438edc5929a2f5acd3f | [
"MIT"
] | 1 | 2019-09-29T23:51:44.000Z | 2019-09-29T23:51:44.000Z | import dataclasses
from typing import Any, ClassVar, List, Optional, Sequence, Tuple, Type, Union
from dbdaora.keys import FallbackKey
from dbdaora.query import BaseQuery, Query, QueryMany
from .repositories import HashData, HashEntity, HashRepository
@dataclasses.dataclass(init=False)
@dataclasses.dataclass(init... | 30.157143 | 78 | 0.639981 | import dataclasses
from typing import Any, ClassVar, List, Optional, Sequence, Tuple, Type, Union
from dbdaora.keys import FallbackKey
from dbdaora.query import BaseQuery, Query, QueryMany
from .repositories import HashData, HashEntity, HashRepository
@dataclasses.dataclass(init=False)
class HashQuery(Query[HashEnt... | 1,190 | 525 | 67 |
4edfc6347476f37596746b098f4e82be0e6656bc | 2,111 | py | Python | endochrone/decomposition/undersampling.py | nickwood/endochrone | 050a2604be82ee4cd5ee6357ea72d3d6d4117277 | [
"MIT"
] | 2 | 2020-04-20T15:41:53.000Z | 2021-11-25T18:52:20.000Z | endochrone/decomposition/undersampling.py | nickwood/endochrone | 050a2604be82ee4cd5ee6357ea72d3d6d4117277 | [
"MIT"
] | null | null | null | endochrone/decomposition/undersampling.py | nickwood/endochrone | 050a2604be82ee4cd5ee6357ea72d3d6d4117277 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import defaultdict
import numpy as np
from endochrone import Base, Transformer
from endochrone.stats.measures import arg_nearest
__author__ = "nickwood"
__copyright__ = "nickwood"
__license__ = "mit"
| 34.048387 | 79 | 0.5964 | # -*- coding: utf-8 -*-
from collections import defaultdict
import numpy as np
from endochrone import Base, Transformer
from endochrone.stats.measures import arg_nearest
__author__ = "nickwood"
__copyright__ = "nickwood"
__license__ = "mit"
class TomekLinks(Base, Transformer):
def __init__(self):
super(... | 1,725 | 15 | 126 |
94c398cb093ac494704fa019ee112bd723e9d121 | 3,173 | py | Python | spinup/my_env/rtd/utils/robot_plot.py | muzi2018/DRL_RTD | 518100c4c48f66fd38ef9877f3e4903c9cc2a237 | [
"MIT"
] | null | null | null | spinup/my_env/rtd/utils/robot_plot.py | muzi2018/DRL_RTD | 518100c4c48f66fd38ef9877f3e4903c9cc2a237 | [
"MIT"
] | null | null | null | spinup/my_env/rtd/utils/robot_plot.py | muzi2018/DRL_RTD | 518100c4c48f66fd38ef9877f3e4903c9cc2a237 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.patches import Circle
import numpy as np
import time
from rtd.simulator_files.planner.planner import get_env
from rtd.simulator_files.planner.planner import astar_planning
| 30.219048 | 108 | 0.598802 | import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.patches import Circle
import numpy as np
import time
from rtd.simulator_files.planner.planner import get_env
from rtd.simulator_files.planner.planner import astar_planning
def plot_robot_and_obstacles(robot, obstacles, robot_ra... | 2,870 | 0 | 46 |
ff92ec13ffa6d364097db1db2973673b5c2e828a | 4,763 | py | Python | rebiber/arxiv.py | EntilZha/rebiber | 88c9fbef12cae73e2ed6f67ee6f32f39040f8299 | [
"MIT"
] | null | null | null | rebiber/arxiv.py | EntilZha/rebiber | 88c9fbef12cae73e2ed6f67ee6f32f39040f8299 | [
"MIT"
] | null | null | null | rebiber/arxiv.py | EntilZha/rebiber | 88c9fbef12cae73e2ed6f67ee6f32f39040f8299 | [
"MIT"
] | null | null | null | import json
import os
import pickle
from typing import Dict
import bibtexparser
import typer
from functional import pseq
from rich.console import Console
from rebiber.bib2json import normalize_title
console = Console()
app = typer.Typer()
@app.command()
@app.command()
if __name__ == "__main__":
app()
| 35.022059 | 118 | 0.617258 | import json
import os
import pickle
from typing import Dict
import bibtexparser
import typer
from functional import pseq
from rich.console import Console
from rebiber.bib2json import normalize_title
console = Console()
app = typer.Typer()
def construct_paper_db(bib_list_file, start_dir=""):
with open(bib_list... | 4,307 | 0 | 136 |
30e64b54bb44a15475e4f54d2956f45122645ba7 | 1,520 | py | Python | src/figcli/test/cli/dev/dump.py | figtools/figgy-cli | 88f4ccb8221ef9734f95b2637acfacc6e00983e7 | [
"Apache-2.0"
] | 36 | 2020-07-21T21:22:02.000Z | 2021-10-20T06:55:47.000Z | src/figcli/test/cli/dev/dump.py | figtools/figgy-cli | 88f4ccb8221ef9734f95b2637acfacc6e00983e7 | [
"Apache-2.0"
] | 2 | 2020-10-29T12:49:15.000Z | 2021-04-29T01:12:05.000Z | src/figcli/test/cli/dev/dump.py | figtools/figgy-cli | 88f4ccb8221ef9734f95b2637acfacc6e00983e7 | [
"Apache-2.0"
] | null | null | null | import pexpect
import sys
from figcli.test.cli.actions.delete import DeleteAction
from figcli.test.cli.actions.put import PutAction
from figcli.test.cli.config import *
from figcli.test.cli.figgy import FiggyTest
from figcli.test.cli.test_utils import TestUtils
from figcli.utils.utils import *
import time
| 36.190476 | 102 | 0.658553 | import pexpect
import sys
from figcli.test.cli.actions.delete import DeleteAction
from figcli.test.cli.actions.put import PutAction
from figcli.test.cli.config import *
from figcli.test.cli.figgy import FiggyTest
from figcli.test.cli.test_utils import TestUtils
from figcli.utils.utils import *
import time
class DevD... | 1,130 | 4 | 77 |
aa9ad9646751dbd6146f27b0de601b1ba359fdb3 | 2,183 | py | Python | resources/rest-service/cloudify/migrations/versions/3483e421713d_rename_availability_to_visibility.py | TS-at-WS/cloudify-manager | 3e062e8dec16c89d2ab180d0b761cbf76d3f7ddc | [
"Apache-2.0"
] | null | null | null | resources/rest-service/cloudify/migrations/versions/3483e421713d_rename_availability_to_visibility.py | TS-at-WS/cloudify-manager | 3e062e8dec16c89d2ab180d0b761cbf76d3f7ddc | [
"Apache-2.0"
] | 1 | 2021-03-26T00:32:30.000Z | 2021-03-26T00:32:30.000Z | resources/rest-service/cloudify/migrations/versions/3483e421713d_rename_availability_to_visibility.py | TS-at-WS/cloudify-manager | 3e062e8dec16c89d2ab180d0b761cbf76d3f7ddc | [
"Apache-2.0"
] | 1 | 2019-11-24T12:07:18.000Z | 2019-11-24T12:07:18.000Z | """<changes description>
Revision ID: 3483e421713d
Revises: 784a82cec07a
Create Date: 2017-12-27 12:29:26.302823
"""
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '3483e421713d'
down_revision = '784a82cec07a'
branch_labels = None
depends_on = No... | 37 | 77 | 0.62437 | """<changes description>
Revision ID: 3483e421713d
Revises: 784a82cec07a
Create Date: 2017-12-27 12:29:26.302823
"""
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '3483e421713d'
down_revision = '784a82cec07a'
branch_labels = None
depends_on = No... | 1,456 | 0 | 46 |
3cbb7bfe0204b679f4f7a39d3adb1c29429c2065 | 732 | py | Python | cla_backend/apps/legalaid/fields.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 3 | 2019-10-02T15:31:03.000Z | 2022-01-13T10:15:53.000Z | cla_backend/apps/legalaid/fields.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 206 | 2015-01-02T16:50:11.000Z | 2022-02-16T20:16:05.000Z | cla_backend/apps/legalaid/fields.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 6 | 2015-03-23T23:08:42.000Z | 2022-02-15T17:04:44.000Z | # coding=utf-8
from django.core import validators
from django.db import models
class MoneyField(models.BigIntegerField):
"""
Stores money to nearest penny as integer. e.g. £10.22 would be 1022
"""
| 33.272727 | 75 | 0.677596 | # coding=utf-8
from django.core import validators
from django.db import models
class MoneyField(models.BigIntegerField):
"""
Stores money to nearest penny as integer. e.g. £10.22 would be 1022
"""
def __init__(self, max_value=9999999999, min_value=0, *args, **kwargs):
self.max_value, self.min... | 494 | 0 | 27 |
0c37f57ac031e4fa16b15ec0b67f6c301cb09f2a | 4,456 | py | Python | locust_swarm.py | cds-snc/gc_forms_load_testing | adb1217b36e10047e0470b4de2e47033517f91f8 | [
"MIT"
] | null | null | null | locust_swarm.py | cds-snc/gc_forms_load_testing | adb1217b36e10047e0470b4de2e47033517f91f8 | [
"MIT"
] | null | null | null | locust_swarm.py | cds-snc/gc_forms_load_testing | adb1217b36e10047e0470b4de2e47033517f91f8 | [
"MIT"
] | null | null | null | import logging
import json
from invokust.aws_lambda import LambdaLoadTest, results_aggregator
logging.basicConfig(level=logging.INFO)
###
# SETTINGS
###
# How long should the test run for in minutes?
# Note that Lambda invokations that are started cannot be stopped.
# Test times will actually be run in intervals of ... | 32.764706 | 133 | 0.569794 | import logging
import json
from invokust.aws_lambda import LambdaLoadTest, results_aggregator
logging.basicConfig(level=logging.INFO)
###
# SETTINGS
###
# How long should the test run for in minutes?
# Note that Lambda invokations that are started cannot be stopped.
# Test times will actually be run in intervals of ... | 3,186 | 0 | 46 |
32f94f0e04e74417a0b5b4dba0f7e5305467b33a | 968 | py | Python | Leetcode/1261. Find Elements in a Contaminated Binary Tree/solution3.py | asanoviskhak/Outtalent | c500e8ad498f76d57eb87a9776a04af7bdda913d | [
"MIT"
] | 51 | 2020-07-12T21:27:47.000Z | 2022-02-11T19:25:36.000Z | Leetcode/1261. Find Elements in a Contaminated Binary Tree/solution3.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | null | null | null | Leetcode/1261. Find Elements in a Contaminated Binary Tree/solution3.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | 32 | 2020-07-27T13:54:24.000Z | 2021-12-25T18:12:50.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
# Your FindElements object will be instantiated and called as such:
# obj = FindElements(root)
# param_1 = obj.find(target)
| 23.609756 | 67 | 0.510331 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class FindElements:
def __init__(self, root: TreeNode):
self.root = root
def find(self, target: int) -> bool:
... | 577 | -2 | 76 |
6a58caddeaa88858a276b0327694acf19c4961f2 | 17,431 | py | Python | DQMOffline/Trigger/python/JetMonitor_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | DQMOffline/Trigger/python/JetMonitor_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | DQMOffline/Trigger/python/JetMonitor_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.JetMonitor_cfi import hltJetMETmonitoring
### HLT_PFJet Triggers ###
# HLT_PFJet450
PFJet450_Prommonitoring = hltJetMETmonitoring.clone(
FolderName = 'HLT/JME/Jets/AK4/PF/HLT_PFJet450/',
histoPSet = dict(jetPtThrPSet = dict(
nbin... | 31.016014 | 79 | 0.626527 | import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.JetMonitor_cfi import hltJetMETmonitoring
### HLT_PFJet Triggers ###
# HLT_PFJet450
PFJet450_Prommonitoring = hltJetMETmonitoring.clone(
FolderName = 'HLT/JME/Jets/AK4/PF/HLT_PFJet450/',
histoPSet = dict(jetPtThrPSet = dict(
nbin... | 0 | 0 | 0 |
285263ee501a2ee950825d8fbdac1f046b745c19 | 1,289 | py | Python | exceRNApipeline/tests/test_pipeline/test_pipeline_init.py | zhuchcn/exceRNAseq | 14e1e35962fffb70c9ee7c494e2c7c1955ff3945 | [
"MIT"
] | 1 | 2019-11-26T02:41:11.000Z | 2019-11-26T02:41:11.000Z | exceRNApipeline/tests/test_pipeline/test_pipeline_init.py | zhuchcn/exceRNAseq | 14e1e35962fffb70c9ee7c494e2c7c1955ff3945 | [
"MIT"
] | null | null | null | exceRNApipeline/tests/test_pipeline/test_pipeline_init.py | zhuchcn/exceRNAseq | 14e1e35962fffb70c9ee7c494e2c7c1955ff3945 | [
"MIT"
] | 1 | 2019-11-26T02:42:07.000Z | 2019-11-26T02:42:07.000Z | import exceRNApipeline.pipeline.__main__ as pipeline
from unittest import TestCase
import sys
import os
import shutil
_FILE_DIR = os.path.dirname(__file__)
_TEMP_DIR = os.path.join(_FILE_DIR, "_test_tmp") | 35.805556 | 87 | 0.662529 | import exceRNApipeline.pipeline.__main__ as pipeline
from unittest import TestCase
import sys
import os
import shutil
_FILE_DIR = os.path.dirname(__file__)
_TEMP_DIR = os.path.join(_FILE_DIR, "_test_tmp")
class TestCasePipelineInit(TestCase):
def setUp(self):
super().setUp()
self.sys_argv = sys.a... | 956 | 16 | 111 |
62bc41440bcafabd712be0aad7dcc6f584123ce9 | 2,110 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/clock/test_clock_turn_on_off_alarm.py | ibrahimasarr/gaia | 23b7a2e53a356356f8e082ba17e2dcb35c1950fe | [
"Apache-2.0"
] | 3 | 2015-08-31T15:24:31.000Z | 2020-04-24T20:31:29.000Z | tests/python/gaia-ui-tests/gaiatest/tests/clock/test_clock_turn_on_off_alarm.py | ganesh7/gaia | 32112b10072e82ac8d52be891d09685f8eaa02f8 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/tests/clock/test_clock_turn_on_off_alarm.py | ganesh7/gaia | 32112b10072e82ac8d52be891d09685f8eaa02f8 | [
"Apache-2.0"
] | 3 | 2015-07-29T07:17:15.000Z | 2020-11-04T06:55:37.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.tests.clock import clock_object
import time
| 39.811321 | 121 | 0.726066 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.tests.clock import clock_object
import time
class TestClockTurnOnOffAl... | 371 | 1,423 | 23 |
72bfc480a8e81c0a79db0a6c193c4a46deadf419 | 11,734 | py | Python | neuro-cli/src/neuro_cli/alias.py | neuro-inc/neuro-cli | 72bd2a825cc319bbc79c6df16f33380796fad4f5 | [
"Apache-2.0"
] | 5 | 2019-09-24T15:37:47.000Z | 2020-08-04T09:25:29.000Z | neuro-cli/src/neuro_cli/alias.py | neuromation/platform-client-python | 72bd2a825cc319bbc79c6df16f33380796fad4f5 | [
"Apache-2.0"
] | 748 | 2019-08-05T14:57:11.000Z | 2020-09-28T09:54:41.000Z | neuro-cli/src/neuro_cli/alias.py | neuro-inc/neuro-cli | 72bd2a825cc319bbc79c6df16f33380796fad4f5 | [
"Apache-2.0"
] | 3 | 2019-10-07T19:25:22.000Z | 2020-06-29T01:41:26.000Z | import re
import shlex
import subprocess
import sys
from typing import Any, Dict, List, Optional, Set, Tuple, Union, cast
import click
from click.utils import make_default_short_help
from neuro_sdk import ConfigError
from .root import Root
from .utils import NeuroClickMixin, Option
| 33.718391 | 87 | 0.549855 | import re
import shlex
import subprocess
import sys
from typing import Any, Dict, List, Optional, Set, Tuple, Union, cast
import click
from click.utils import make_default_short_help
from neuro_sdk import ConfigError
from .root import Root
from .utils import NeuroClickMixin, Option
class InternalAlias(NeuroClickMi... | 10,704 | 528 | 207 |
4c8677e38052c00dda4b7ea9057cda5aec79a133 | 487 | py | Python | test_scripts/Barcode/barcode_gen.py | WarriorSubha/Smart-Library | aa8c6f54c02c9ca2846fcc87bf68f1b81f4fd5b6 | [
"MIT"
] | 1 | 2020-03-19T00:06:10.000Z | 2020-03-19T00:06:10.000Z | test_scripts/Barcode/barcode_gen.py | WarriorSubha/Smart-Library | aa8c6f54c02c9ca2846fcc87bf68f1b81f4fd5b6 | [
"MIT"
] | 10 | 2019-09-07T20:01:07.000Z | 2019-10-31T06:27:40.000Z | test_scripts/Barcode/barcode_gen.py | WarriorSubha/Smart-Library | aa8c6f54c02c9ca2846fcc87bf68f1b81f4fd5b6 | [
"MIT"
] | 3 | 2019-09-05T09:06:36.000Z | 2019-10-24T17:45:20.000Z | import requests, socket
import barcode
from barcode.writer import ImageWriter
c128 = barcode.get_barcode_class('CODE128')
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)
url = 'http://{}:5000'.format(host_ip)
res = requests.get('{}/get_all_books'.format(url))
if res.status_code == 200:
bo... | 24.35 | 61 | 0.712526 | import requests, socket
import barcode
from barcode.writer import ImageWriter
c128 = barcode.get_barcode_class('CODE128')
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)
url = 'http://{}:5000'.format(host_ip)
res = requests.get('{}/get_all_books'.format(url))
if res.status_code == 200:
bo... | 0 | 0 | 0 |
ad0a7b53c58624afe27302bf67eec93c90d3473f | 1,033 | py | Python | albums/views.py | ModalSeoul/Weeb.FM | 1393c076a878ef4a05a13fa58243e404bed7e85c | [
"MIT"
] | 54 | 2016-10-04T02:18:02.000Z | 2021-12-27T15:16:05.000Z | albums/views.py | ModalSeoul/Weeb.FM | 1393c076a878ef4a05a13fa58243e404bed7e85c | [
"MIT"
] | 37 | 2016-10-08T18:16:25.000Z | 2020-11-17T04:06:09.000Z | albums/views.py | ModalSeoul/Weeb.FM | 1393c076a878ef4a05a13fa58243e404bed7e85c | [
"MIT"
] | 7 | 2016-10-26T08:59:58.000Z | 2019-01-20T08:00:21.000Z | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.filters import BaseFilterBackend
from rest_framework.decorators import action
from rest_framework.response import Response
from .models import Album
from .serializers import AlbumSerializer
from WeebFM.permissions import IsStaff... | 38.259259 | 76 | 0.730881 | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.filters import BaseFilterBackend
from rest_framework.decorators import action
from rest_framework.response import Response
from .models import Album
from .serializers import AlbumSerializer
from WeebFM.permissions import IsStaff... | 433 | 245 | 23 |
e5749c3d690d86a2253783fae8fd2d93905466e1 | 1,672 | py | Python | photos/views.py | mosesbabu/photoshare | 18f2e72882fde6ce45482f9cf59af3ef41351585 | [
"MIT"
] | null | null | null | photos/views.py | mosesbabu/photoshare | 18f2e72882fde6ce45482f9cf59af3ef41351585 | [
"MIT"
] | 9 | 2021-03-19T03:53:39.000Z | 2022-03-12T00:32:01.000Z | photos/views.py | mosesbabu/photoshare | 18f2e72882fde6ce45482f9cf59af3ef41351585 | [
"MIT"
] | null | null | null | from .models import Image,Category,Location
from django.http import HttpResponse,Http404
from django.shortcuts import render
import datetime as dt
# Create your views here.
| 40.780488 | 142 | 0.753589 | from .models import Image,Category,Location
from django.http import HttpResponse,Http404
from django.shortcuts import render
import datetime as dt
# Create your views here.
def photo_display(request):
all_images = Image.objects.all()
category_results = Category.objects.all()
location_results = Location.o... | 1,398 | 0 | 92 |
48b76621eeb8488a5da816a2d8f6237103b6d2e9 | 790 | py | Python | pysal/region/tests/test_components.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/region/tests/test_components.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/region/tests/test_components.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-07-19T01:46:17.000Z | 2021-07-19T01:46:17.000Z |
import unittest
import pysal
suite = unittest.TestLoader().loadTestsFromTestCase(Test_Components)
if __name__ == '__main__':
runner = unittest.TextTestRunner()
runner.run(suite)
| 30.384615 | 74 | 0.656962 |
import unittest
import pysal
class Test_Components(unittest.TestCase):
def setUp(self):
self.w = pysal.lat2W(5, 5)
def test_check_contiguity(self):
result = pysal.region.check_contiguity(self.w, [0, 1, 2, 3, 4], 4)
self.assertEquals(result, True)
result = pysal.region.check_c... | 503 | 20 | 76 |
d29d6a0ed7362d3ae2be7f320e06b776a7e300a0 | 1,552 | py | Python | python/modular/run_explore.py | wildlava/explore | 8f7417607fc95919518d05dafac98802820c832c | [
"MIT"
] | 1 | 2021-08-24T15:29:23.000Z | 2021-08-24T15:29:23.000Z | python/modular/run_explore.py | wildlava/explore | 8f7417607fc95919518d05dafac98802820c832c | [
"MIT"
] | null | null | null | python/modular/run_explore.py | wildlava/explore | 8f7417607fc95919518d05dafac98802820c832c | [
"MIT"
] | null | null | null | #
# Explore
# - The Adventure Interpreter
#
# Copyright (C) 2006 Joe Peterson
#
import sys
import Explore
filename = None
no_delay = False
trs_compat = False
for arg_num in range(len(sys.argv)):
if sys.argv[arg_num] == "-f":
if len(sys.argv) > (arg_num + 1) and (len(sys.argv[arg_num + 1]) == 0 or sy... | 33.73913 | 114 | 0.561856 | #
# Explore
# - The Adventure Interpreter
#
# Copyright (C) 2006 Joe Peterson
#
import sys
import Explore
filename = None
no_delay = False
trs_compat = False
for arg_num in range(len(sys.argv)):
if sys.argv[arg_num] == "-f":
if len(sys.argv) > (arg_num + 1) and (len(sys.argv[arg_num + 1]) == 0 or sy... | 0 | 0 | 0 |
ecb915fa82646c37afde3791a33d6f881187f1aa | 4,275 | py | Python | scripts/local_goal_creator.py | Jumpei-Arima/local_goal_creator | ec571fd76e43f3ceb889a1222a58a9ee11a86032 | [
"BSD-3-Clause"
] | null | null | null | scripts/local_goal_creator.py | Jumpei-Arima/local_goal_creator | ec571fd76e43f3ceb889a1222a58a9ee11a86032 | [
"BSD-3-Clause"
] | null | null | null | scripts/local_goal_creator.py | Jumpei-Arima/local_goal_creator | ec571fd76e43f3ceb889a1222a58a9ee11a86032 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import math
import json
import random
import rospy
from geometry_msgs.msg import PoseStamped
import tf2_ros
import tf2_geometry_msgs
from utils import *
if __name__ == '__main__':
local_goal_creator = LocalGoalCreator()
try:
local_goal_creator.process()
except rospy.ROSInterru... | 39.953271 | 117 | 0.580585 | #!/usr/bin/python
import math
import json
import random
import rospy
from geometry_msgs.msg import PoseStamped
import tf2_ros
import tf2_geometry_msgs
from utils import *
class LocalGoalCreator:
def __init__(self):
rospy.init_node('LocalGoalCreator', anonymous=True)
# param
self.HZ = r... | 3,797 | 2 | 130 |
21055630c178f95cf6056a746fd7ba4eb3d576c8 | 166 | py | Python | 281A - Word Capitalization.py | bugraaldal/Codeforces | fc5bc0abd94ccf9244d0465e4173fa1ef463630a | [
"MIT"
] | 3 | 2021-04-30T09:25:33.000Z | 2021-04-30T09:25:57.000Z | 281A - Word Capitalization.py | bugraaldal/Codeforces | fc5bc0abd94ccf9244d0465e4173fa1ef463630a | [
"MIT"
] | null | null | null | 281A - Word Capitalization.py | bugraaldal/Codeforces | fc5bc0abd94ccf9244d0465e4173fa1ef463630a | [
"MIT"
] | null | null | null | # https://codeforces.com/problemset/problem/281/A
capital_Input = input("")
compare_List = list(capital_Input)
a = compare_List[0].upper()
print(a+capital_Input[1:])
| 27.666667 | 49 | 0.753012 | # https://codeforces.com/problemset/problem/281/A
capital_Input = input("")
compare_List = list(capital_Input)
a = compare_List[0].upper()
print(a+capital_Input[1:])
| 0 | 0 | 0 |
bc9592be551305633d2659ce4c7a6eb4592ea144 | 3,998 | py | Python | matador/workflows/castep/common.py | dquigley-warwick/matador | 729e97efb0865c4fff50af87555730ff4b7b6d91 | [
"MIT"
] | 24 | 2020-01-21T21:40:44.000Z | 2022-03-23T13:37:18.000Z | matador/workflows/castep/common.py | dquigley-warwick/matador | 729e97efb0865c4fff50af87555730ff4b7b6d91 | [
"MIT"
] | 234 | 2020-02-03T15:56:58.000Z | 2022-03-29T21:36:45.000Z | matador/workflows/castep/common.py | dquigley-warwick/matador | 729e97efb0865c4fff50af87555730ff4b7b6d91 | [
"MIT"
] | 15 | 2019-11-29T11:33:32.000Z | 2021-11-02T09:14:08.000Z | # coding: utf-8
# Distributed under the terms of the MIT License.
""" This submodule implements some common workflow steps for use in
more complicated workflows.
"""
import copy
import logging
__all__ = ("castep_prerelax", "castep_scf")
LOG = logging.getLogger("run3")
def castep_scf(
computer,
calc_doc,
... | 31.984 | 102 | 0.668084 | # coding: utf-8
# Distributed under the terms of the MIT License.
""" This submodule implements some common workflow steps for use in
more complicated workflows.
"""
import copy
import logging
__all__ = ("castep_prerelax", "castep_scf")
LOG = logging.getLogger("run3")
def castep_scf(
computer,
calc_doc,
... | 0 | 0 | 0 |
d99c589bbdadb62e8e0c267353bf02875e75ea2b | 465 | py | Python | Menu.py | PatrickLenis/FLAT_Project_2020 | d3bfe17504e58c63c6b094d72cb33721da8a8e8d | [
"MIT"
] | null | null | null | Menu.py | PatrickLenis/FLAT_Project_2020 | d3bfe17504e58c63c6b094d72cb33721da8a8e8d | [
"MIT"
] | null | null | null | Menu.py | PatrickLenis/FLAT_Project_2020 | d3bfe17504e58c63c6b094d72cb33721da8a8e8d | [
"MIT"
] | null | null | null | from Regex_To_Dfa import *
#inp = "(01*1)*1"
print("\nProject 5 : Construction of an Dfa equivalent to a Regular Expression\nBy Patrick Lenis & Paul Cvasa")
print("Regular expression examples : xy, x+y, x*, (xy*y)*y\n")
inp = input("Your regular expression : ")
nfaObj = NFAfromRegex(inp)
nfa = nfaObj.getNFA()... | 23.25 | 112 | 0.655914 | from Regex_To_Dfa import *
#inp = "(01*1)*1"
print("\nProject 5 : Construction of an Dfa equivalent to a Regular Expression\nBy Patrick Lenis & Paul Cvasa")
print("Regular expression examples : xy, x+y, x*, (xy*y)*y\n")
inp = input("Your regular expression : ")
nfaObj = NFAfromRegex(inp)
nfa = nfaObj.getNFA()... | 0 | 0 | 0 |
528d4a298d2d083011092bf7af07a34511bf17c0 | 564 | py | Python | Python3/Python3_Lesson03/src/testgen.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | Python3/Python3_Lesson03/src/testgen.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | Python3/Python3_Lesson03/src/testgen.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | """
testgen.py: simple test for a sequence generator
"""
import unittest
#from gen123 import gen123
from class123 import gen123
if __name__ == "__main__":
unittest.main() | 29.684211 | 85 | 0.613475 | """
testgen.py: simple test for a sequence generator
"""
import unittest
#from gen123 import gen123
from class123 import gen123
class TestGen(unittest.TestCase):
def testEmpty(self):
self.assertEqual(list(gen123([])), [], "Empty list does not give empty list")
def test123(self):
self.... | 284 | 12 | 84 |
b8bea2f44392cbfc3a21409ead035541b62a814e | 4,774 | py | Python | UpWork_Projects/Will Farell_Spiders/boroondara/boroondara/spiders/boroondara_spider.py | SurendraTamang/Web-Scrapping | 2bb60cce9010b4b68f5c11bf295940832bb5df50 | [
"MIT"
] | null | null | null | UpWork_Projects/Will Farell_Spiders/boroondara/boroondara/spiders/boroondara_spider.py | SurendraTamang/Web-Scrapping | 2bb60cce9010b4b68f5c11bf295940832bb5df50 | [
"MIT"
] | null | null | null | UpWork_Projects/Will Farell_Spiders/boroondara/boroondara/spiders/boroondara_spider.py | SurendraTamang/Web-Scrapping | 2bb60cce9010b4b68f5c11bf295940832bb5df50 | [
"MIT"
] | 1 | 2022-01-18T17:15:51.000Z | 2022-01-18T17:15:51.000Z | # -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import Selector
from scrapy_selenium import SeleniumRequest
from selenium.webdriver.common.keys import Keys
import time
import datetime | 46.803922 | 177 | 0.559698 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import Selector
from scrapy_selenium import SeleniumRequest
from selenium.webdriver.common.keys import Keys
import time
import datetime
class BoroondaraSpiderSpider(scrapy.Spider):
name = 'boroondara_spider'
def remove_nonUTF_char(self, value):
... | 4,367 | 190 | 23 |
c79fc0f1c6ab723440f80bb33d61a345e05c905e | 18,274 | py | Python | xfel/merging/algorithms/error_model/sdfac_propagate.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | xfel/merging/algorithms/error_model/sdfac_propagate.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | xfel/merging/algorithms/error_model/sdfac_propagate.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
from six.moves import range
from dials.array_family import flex
import math
from rstbx.symmetry.constraints.parameter_reduction \
import symmetrize_reduce_enlarge
from scitbx.matrix import sqr, col
from xfel.merging.algorithms.error_model.error_modeler_base import error_modeler_base... | 46.498728 | 156 | 0.608022 | from __future__ import division
from six.moves import range
from dials.array_family import flex
import math
from rstbx.symmetry.constraints.parameter_reduction \
import symmetrize_reduce_enlarge
from scitbx.matrix import sqr, col
from xfel.merging.algorithms.error_model.error_modeler_base import error_modeler_base... | 9,275 | 8,374 | 68 |
b87e8dd6617529d84fccb1b202f8596500d76e96 | 6,198 | py | Python | benchmarks/basic_operations.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | 832 | 2017-01-03T06:21:31.000Z | 2022-03-16T16:51:44.000Z | benchmarks/basic_operations.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | 139 | 2017-02-16T16:02:48.000Z | 2022-02-10T14:05:41.000Z | benchmarks/basic_operations.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | 116 | 2017-01-05T06:33:50.000Z | 2022-03-06T05:02:47.000Z | import aredis
import asyncio
import uvloop
import time
import sys
from functools import wraps
from argparse import ArgumentParser
if sys.version_info[0] == 3:
long = int
@timer
@timer
@timer
@timer
@timer
@timer
@timer
@timer
@timer
if __name__ == '__main__':
print('WITH ASYNCIO ONLY:')
... | 28.562212 | 80 | 0.593901 | import aredis
import asyncio
import uvloop
import time
import sys
from functools import wraps
from argparse import ArgumentParser
if sys.version_info[0] == 3:
long = int
def parse_args():
parser = ArgumentParser()
parser.add_argument('-n',
type=int,
help='T... | 5,384 | 0 | 267 |
b7365216fd0401ebb4f3b64227dd8421a0c2b66b | 4,015 | py | Python | custom/ilsgateway/tests/test_apis.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | 1 | 2017-02-10T03:14:51.000Z | 2017-02-10T03:14:51.000Z | custom/ilsgateway/tests/test_apis.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | null | null | null | custom/ilsgateway/tests/test_apis.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | null | null | null | from decimal import Decimal
import json
import os
from django.test.testcases import TestCase
from custom.ilsgateway.api import Product, ILSUser, SMSUser, Location, ProductStock, StockTransaction
| 50.1875 | 101 | 0.704359 | from decimal import Decimal
import json
import os
from django.test.testcases import TestCase
from custom.ilsgateway.api import Product, ILSUser, SMSUser, Location, ProductStock, StockTransaction
class ApisTest(TestCase):
def setUp(self):
self.datapath = os.path.join(os.path.dirname(__file__), 'data')
... | 3,602 | 4 | 212 |
eb0b74a23ba9cd178be55cbe7800dbb08aa10f17 | 803 | py | Python | catlas/load_adsorbate_structures.py | ulissigroup/catlas | 1796bf562f21f4afaee8999bbdf0ed76e63f8501 | [
"MIT"
] | null | null | null | catlas/load_adsorbate_structures.py | ulissigroup/catlas | 1796bf562f21f4afaee8999bbdf0ed76e63f8501 | [
"MIT"
] | 34 | 2021-12-02T16:55:34.000Z | 2022-03-30T17:58:35.000Z | catlas/load_adsorbate_structures.py | ulissigroup/catlas | 1796bf562f21f4afaee8999bbdf0ed76e63f8501 | [
"MIT"
] | 1 | 2021-12-14T17:22:19.000Z | 2021-12-14T17:22:19.000Z | import pickle
import os.path
import catlas
dir_path = os.path.dirname(os.path.realpath(__file__))
| 27.689655 | 66 | 0.571606 | import pickle
import os.path
import catlas
dir_path = os.path.dirname(os.path.realpath(__file__))
def load_ocdata_adsorbates(adsorbate_path):
path = "%s/%s" % (
os.path.join(os.path.dirname(catlas.__file__), os.pardir),
adsorbate_path,
)
with open(path, "rb") as fhandle:
adsorbate... | 680 | 0 | 23 |
b54f20bc71d7007b20d323cf9983c411cd35b55b | 828 | py | Python | mappers/OperationMapper.py | NikolaySohryakov/tinkoff_invest | 58e2bf88e821046d2884468164b822847f844171 | [
"MIT"
] | null | null | null | mappers/OperationMapper.py | NikolaySohryakov/tinkoff_invest | 58e2bf88e821046d2884468164b822847f844171 | [
"MIT"
] | null | null | null | mappers/OperationMapper.py | NikolaySohryakov/tinkoff_invest | 58e2bf88e821046d2884468164b822847f844171 | [
"MIT"
] | null | null | null | from portfolio import Operation
from tinvest import Operation as TinkoffOperation
| 43.578947 | 79 | 0.589372 | from portfolio import Operation
from tinvest import Operation as TinkoffOperation
class OperationMapper:
@staticmethod
def map(tinkoff_operation: TinkoffOperation) -> Operation:
return Operation(id=tinkoff_operation.id,
figi=tinkoff_operation.figi,
dat... | 677 | 45 | 23 |
6a337e5753d90a32fcc95c5143f7f713c30e8f40 | 3,826 | py | Python | configs/MJOD_Net/MJOD_Net_ratio_1234_coco_mahjong_lr_0.02_batch_8_epoch_24.py | jaheel/MJOD-2136 | 81d4b8b79316f010279ef2c13a30827ae6b25c87 | [
"Apache-2.0"
] | null | null | null | configs/MJOD_Net/MJOD_Net_ratio_1234_coco_mahjong_lr_0.02_batch_8_epoch_24.py | jaheel/MJOD-2136 | 81d4b8b79316f010279ef2c13a30827ae6b25c87 | [
"Apache-2.0"
] | null | null | null | configs/MJOD_Net/MJOD_Net_ratio_1234_coco_mahjong_lr_0.02_batch_8_epoch_24.py | jaheel/MJOD-2136 | 81d4b8b79316f010279ef2c13a30827ae6b25c87 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
type='MJODNet',
pretrained='open-mmlab://regnetx_400mf',
backbone=dict(
type='RegNet',
arch='regnetx_400mf',
out_indices=(3, ),
frozen_stages=1,
norm_cfg=dict(type='BN'... | 31.105691 | 77 | 0.600105 | _base_ = [
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
type='MJODNet',
pretrained='open-mmlab://regnetx_400mf',
backbone=dict(
type='RegNet',
arch='regnetx_400mf',
out_indices=(3, ),
frozen_stages=1,
norm_cfg=dict(type='BN'... | 0 | 0 | 0 |
149c6619f1e01652b76fea7fe90cbfbd79e62951 | 4,168 | py | Python | tests/test_client.py | KnowYourselves/fintoc-python | 7b61850db6bb029aafd6fbf8e37b46e1188474a9 | [
"BSD-3-Clause"
] | 80 | 2020-05-10T13:41:26.000Z | 2022-01-14T14:20:40.000Z | tests/test_client.py | KnowYourselves/fintoc-python | 7b61850db6bb029aafd6fbf8e37b46e1188474a9 | [
"BSD-3-Clause"
] | 23 | 2020-05-27T22:48:06.000Z | 2022-01-04T13:40:09.000Z | tests/test_client.py | KnowYourselves/fintoc-python | 7b61850db6bb029aafd6fbf8e37b46e1188474a9 | [
"BSD-3-Clause"
] | 8 | 2020-09-22T16:13:32.000Z | 2021-12-11T19:58:58.000Z | from types import GeneratorType
import httpx
import pytest
from fintoc.client import Client
| 37.214286 | 87 | 0.672985 | from types import GeneratorType
import httpx
import pytest
from fintoc.client import Client
class TestClientCreationFunctionality:
def setup_method(self):
self.base_url = "https://test.com"
self.api_key = "super_secret_api_key"
self.user_agent = "fintoc-python/test"
self.params =... | 3,610 | 201 | 261 |
751b58840a5019ee0b41172f71612a05dc0c3c49 | 160 | py | Python | Python/django_viewsets_studies/App/Article/admin.py | wendrewdevelop/Estudos | f75d62574a0455ff35b97d404329e43f12f419fb | [
"MIT"
] | null | null | null | Python/django_viewsets_studies/App/Article/admin.py | wendrewdevelop/Estudos | f75d62574a0455ff35b97d404329e43f12f419fb | [
"MIT"
] | null | null | null | Python/django_viewsets_studies/App/Article/admin.py | wendrewdevelop/Estudos | f75d62574a0455ff35b97d404329e43f12f419fb | [
"MIT"
] | null | null | null | # django imports
from django.contrib import admin
# app imports
from .models import Article, Author
admin.site.register(Article)
admin.site.register(Author)
| 16 | 35 | 0.79375 | # django imports
from django.contrib import admin
# app imports
from .models import Article, Author
admin.site.register(Article)
admin.site.register(Author)
| 0 | 0 | 0 |
adb98cd5f300d6d0e08eba6bf62faca8a7b92ea3 | 16,099 | py | Python | module/HME.py | wjn1996/PCNN_RL_HME | 2f5e5a357706c236b0cd89f193cd49b1c2c3fe8a | [
"Apache-2.0"
] | 3 | 2021-02-19T12:05:06.000Z | 2021-06-08T14:33:57.000Z | module/HME.py | wjn1996/PCNN_RL_HME | 2f5e5a357706c236b0cd89f193cd49b1c2c3fe8a | [
"Apache-2.0"
] | null | null | null | module/HME.py | wjn1996/PCNN_RL_HME | 2f5e5a357706c236b0cd89f193cd49b1c2c3fe8a | [
"Apache-2.0"
] | 1 | 2022-03-15T14:53:35.000Z | 2022-03-15T14:53:35.000Z | import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import random
# from configure import args
from load_data import find_node
# Hierarchical Memory Extractor 分层记忆抽取器
class HME(nn.Module):
'''
分层记忆抽取器... | 53.842809 | 129 | 0.533077 | import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import random
# from configure import args
from load_data import find_node
# Hierarchical Memory Extractor 分层记忆抽取器
class HME(nn.Module):
'''
分层记忆抽取器... | 16,807 | 0 | 144 |
894ebf40707576125fc0b771171e8d1326b8e918 | 583 | py | Python | src/src.py | Overexm/python_assignment2 | e8b2c8b2e75e0eff82a6e240a4ad6e4e0c3463f0 | [
"MIT"
] | null | null | null | src/src.py | Overexm/python_assignment2 | e8b2c8b2e75e0eff82a6e240a4ad6e4e0c3463f0 | [
"MIT"
] | null | null | null | src/src.py | Overexm/python_assignment2 | e8b2c8b2e75e0eff82a6e240a4ad6e4e0c3463f0 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from urllib.request import urlopen
url = "https://coinmarketcap.com"
html = urlopen(url)
soup = BeautifulSoup(html, 'lxml')
| 24.291667 | 54 | 0.643225 | from bs4 import BeautifulSoup
from urllib.request import urlopen
url = "https://coinmarketcap.com"
html = urlopen(url)
soup = BeautifulSoup(html, 'lxml')
class WebScrapper:
def getDateByRequest(currencyName):
some_list = []
for paragraph in soup.find_all("p"):
if currencyName in par... | 352 | -3 | 77 |
b1f6d38872379f5269c10776665dea05a3c7b595 | 4,888 | py | Python | tools/gui/os/evt_wn.py | aananthcn/osek-os | 8a5cf718d444d6f4912f905f9a237f5f15fe4780 | [
"MIT",
"Apache-2.0",
"MIT-0"
] | 5 | 2021-11-07T17:54:22.000Z | 2022-02-21T17:29:04.000Z | tools/gui/os/evt_wn.py | aananthcn/osek-os | 8a5cf718d444d6f4912f905f9a237f5f15fe4780 | [
"MIT",
"Apache-2.0",
"MIT-0"
] | null | null | null | tools/gui/os/evt_wn.py | aananthcn/osek-os | 8a5cf718d444d6f4912f905f9a237f5f15fe4780 | [
"MIT",
"Apache-2.0",
"MIT-0"
] | 2 | 2022-01-22T08:41:59.000Z | 2022-02-02T16:00:33.000Z | import tkinter as tk
from tkinter import ttk
from copy import copy
| 37.6 | 133 | 0.609656 | import tkinter as tk
from tkinter import ttk
from copy import copy
class EventWindow:
n_events = 1
max_events = 64
n_events_str = None
events_str = []
events = []
HeaderObjs = 2 #Objects / widgets that are part of the header and shouldn't be destroyed
HeaderSize = 1
prf = None # Par... | 4,221 | 575 | 23 |
28349e092ed9c13d1c7e3c85aec9dd8f89e5bf12 | 2,179 | py | Python | assets/2019-06-10/train.py | vruusmann/blog | 9f63a0361686f9e20a5a038cb67769df80405573 | [
"MIT"
] | null | null | null | assets/2019-06-10/train.py | vruusmann/blog | 9f63a0361686f9e20a5a038cb67769df80405573 | [
"MIT"
] | null | null | null | assets/2019-06-10/train.py | vruusmann/blog | 9f63a0361686f9e20a5a038cb67769df80405573 | [
"MIT"
] | 2 | 2019-02-19T07:59:45.000Z | 2019-12-10T13:56:16.000Z | from sklearn_pandas import DataFrameMapper
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import LabelBinarizer
from sklearn2pmml.decoration import Alias, CategoricalDomain, ContinuousDomain
from sklearn2pmml.preprocessing import ExpressionTransformer
import pandas
df = pandas.read_csv("audit.csv")
... | 36.316667 | 153 | 0.785223 | from sklearn_pandas import DataFrameMapper
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import LabelBinarizer
from sklearn2pmml.decoration import Alias, CategoricalDomain, ContinuousDomain
from sklearn2pmml.preprocessing import ExpressionTransformer
import pandas
df = pandas.read_csv("audit.csv")
... | 0 | 0 | 0 |
c82d0a4815a4179b30f3cbc61529e10f16c8e702 | 3,223 | py | Python | action/action.py | lluminov/Yeagle | 241c8d3a6f3679c1a4033a20934d46be7b6cae95 | [
"MIT"
] | 1 | 2021-01-09T09:15:00.000Z | 2021-01-09T09:15:00.000Z | action/action.py | lluminov/Yeagle | 241c8d3a6f3679c1a4033a20934d46be7b6cae95 | [
"MIT"
] | null | null | null | action/action.py | lluminov/Yeagle | 241c8d3a6f3679c1a4033a20934d46be7b6cae95 | [
"MIT"
] | null | null | null | import sys
import subprocess
import pandas as pd
import os
from pathlib import Path
import time
import datetime
import ast
from configparser import ConfigParser
'''Reading the Config file from command line argument'''
parser = ConfigParser()
pd.set_option('display.max_columns', None)
config_file = sys.argv[1]
parser.... | 45.394366 | 114 | 0.608439 | import sys
import subprocess
import pandas as pd
import os
from pathlib import Path
import time
import datetime
import ast
from configparser import ConfigParser
'''Reading the Config file from command line argument'''
parser = ConfigParser()
pd.set_option('display.max_columns', None)
config_file = sys.argv[1]
parser.... | 0 | 0 | 0 |
063951c0843c9a8de8ce925601de97b548754d01 | 491 | py | Python | src/spyd/game/room/player_event_handlers/explode_handler.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | 4 | 2015-05-05T16:44:42.000Z | 2020-10-27T09:45:23.000Z | src/spyd/game/room/player_event_handlers/explode_handler.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | null | null | null | src/spyd/game/room/player_event_handlers/explode_handler.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | 2 | 2016-12-13T22:21:08.000Z | 2020-03-14T16:44:20.000Z | from cube2common.constants import weapon_types
from spyd.registry_manager import register
from spyd.utils.constrain import constrain_range
@register('room_player_event_handler')
| 35.071429 | 92 | 0.782077 | from cube2common.constants import weapon_types
from spyd.registry_manager import register
from spyd.utils.constrain import constrain_range
@register('room_player_event_handler')
class ExplodeHandler(object):
event_type = 'explode'
@staticmethod
def handle(room, player, cmillis, gun, explode_id, hits):
... | 209 | 80 | 22 |
4859d0104affa4b6dd6b0fce96b9ba9b9e823508 | 1,406 | py | Python | pymodbus/framer/__init__.py | vmacari/pymodbus | ec97e2f2b50c6db0a932f44e550a5dee60bf0970 | [
"BSD-3-Clause"
] | 1,125 | 2017-05-11T06:11:36.000Z | 2022-03-31T02:59:45.000Z | pymodbus/framer/__init__.py | vmacari/pymodbus | ec97e2f2b50c6db0a932f44e550a5dee60bf0970 | [
"BSD-3-Clause"
] | 575 | 2017-05-12T02:46:55.000Z | 2022-03-31T16:00:33.000Z | pymodbus/framer/__init__.py | vmacari/pymodbus | ec97e2f2b50c6db0a932f44e550a5dee60bf0970 | [
"BSD-3-Clause"
] | 516 | 2017-05-19T14:06:06.000Z | 2022-03-31T06:10:13.000Z | from pymodbus.interfaces import IModbusFramer
import struct
# Unit ID, Function Code
BYTE_ORDER = '>'
FRAME_HEADER = 'BB'
# Transaction Id, Protocol ID, Length, Unit ID, Function Code
SOCKET_FRAME_HEADER = BYTE_ORDER + 'HHH' + FRAME_HEADER
# Function Code
TLS_FRAME_HEADER = BYTE_ORDER + 'B'
class ModbusFramer(IModb... | 28.12 | 72 | 0.610242 | from pymodbus.interfaces import IModbusFramer
import struct
# Unit ID, Function Code
BYTE_ORDER = '>'
FRAME_HEADER = 'BB'
# Transaction Id, Protocol ID, Length, Unit ID, Function Code
SOCKET_FRAME_HEADER = BYTE_ORDER + 'HHH' + FRAME_HEADER
# Function Code
TLS_FRAME_HEADER = BYTE_ORDER + 'B'
class ModbusFramer(IModb... | 0 | 0 | 0 |
e92abe42ccb3a2963e233950827b0d1fe8240626 | 10,418 | py | Python | minghu6/tools/tieba.py | minghu6/py-minghu6 | 312bff9c66a0ba936f8600ba019fc514337e92ec | [
"BSD-3-Clause"
] | 2 | 2016-08-23T09:37:34.000Z | 2020-07-05T09:30:57.000Z | minghu6/tools/tieba.py | minghu6/minghu6_py | 2874e3302c8910960a3a8cbc874ab32d22d7edaa | [
"BSD-3-Clause"
] | null | null | null | minghu6/tools/tieba.py | minghu6/minghu6_py | 2874e3302c8910960a3a8cbc874ab32d22d7edaa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
# !/usr/bin/env python3
"""
download tie from Baidu Tieba
"""
import http.client
import os
import re
import urllib.error
import urllib.parse
import urllib.request
from minghu6.http.request import headers
from color import color
from minghu6.text.encoding import get_decode_html
... | 32.154321 | 91 | 0.515358 | # -*- coding:utf-8 -*-
# !/usr/bin/env python3
"""
download tie from Baidu Tieba
"""
import http.client
import os
import re
import urllib.error
import urllib.parse
import urllib.request
from minghu6.http.request import headers
from color import color
from minghu6.text.encoding import get_decode_html
... | 9,488 | 1,164 | 94 |
73b95f29f8a3ca04489a36bc3742abbcca2ac112 | 12,712 | py | Python | src/kodi_addon_dev/displays.py | alexhulbert/kodi-addondev | 5fac65822a51c5691645fd638c51303b66189500 | [
"MIT"
] | null | null | null | src/kodi_addon_dev/displays.py | alexhulbert/kodi-addondev | 5fac65822a51c5691645fd638c51303b66189500 | [
"MIT"
] | null | null | null | src/kodi_addon_dev/displays.py | alexhulbert/kodi-addondev | 5fac65822a51c5691645fd638c51303b66189500 | [
"MIT"
] | null | null | null | from __future__ import print_function
# Standard Library Imports
from typing import List, Iterator, NamedTuple, NoReturn
from functools import partial
from copy import deepcopy
import binascii
import argparse
import pickle
import json
import abc
import re
# Package imports
from kodi_addon_dev.repo import LocalRepo
fr... | 38.874618 | 118 | 0.578823 | from __future__ import print_function
# Standard Library Imports
from typing import List, Iterator, NamedTuple, NoReturn
from functools import partial
from copy import deepcopy
import binascii
import argparse
import pickle
import json
import abc
import re
# Package imports
from kodi_addon_dev.repo import LocalRepo
fr... | 4,359 | 0 | 185 |
b5906a43a8e3da3896eb3f51d3b86389ac06ab65 | 13,587 | py | Python | tests/resource_tests/schema_tests/test_resource_schemas.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 39 | 2017-10-13T19:16:27.000Z | 2021-09-24T16:58:21.000Z | tests/resource_tests/schema_tests/test_resource_schemas.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | tests/resource_tests/schema_tests/test_resource_schemas.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 19 | 2017-09-15T13:58:00.000Z | 2022-02-07T18:33:20.000Z | #
# This file is subject to the terms and conditions defined in the
# file 'LICENSE', which is part of this source code package.
#
import json
import unittest
from tests.helpers.unittest_base import BaseTestCase
# -- BQ model imports
from rdr_service.model import (
bq_code, bq_genomics, bq_hpo, bq_organization, b... | 51.661597 | 120 | 0.65099 | #
# This file is subject to the terms and conditions defined in the
# file 'LICENSE', which is part of this source code package.
#
import json
import unittest
from tests.helpers.unittest_base import BaseTestCase
# -- BQ model imports
from rdr_service.model import (
bq_code, bq_genomics, bq_hpo, bq_organization, b... | 8,255 | 0 | 805 |
e3236fb3b0c13ec2493a871001e35524096ad1ca | 86 | py | Python | src/python/baekjoon/8393.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | src/python/baekjoon/8393.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | src/python/baekjoon/8393.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | n = int(input())
result = 0
for num in range(1, n+1) :
result += num
print(result) | 17.2 | 26 | 0.604651 | n = int(input())
result = 0
for num in range(1, n+1) :
result += num
print(result) | 0 | 0 | 0 |
957367cc6c57a6b0b9c3863071247dd9f9e0ecf0 | 5,021 | py | Python | nox/src/nox/coreapps/messenger/messenger.py | ayjazz/OESS | deadc504d287febc7cbd7251ddb102bb5c8b1f04 | [
"Apache-2.0"
] | 28 | 2015-02-04T13:59:25.000Z | 2021-12-29T03:44:47.000Z | nox/src/nox/coreapps/messenger/messenger.py | ayjazz/OESS | deadc504d287febc7cbd7251ddb102bb5c8b1f04 | [
"Apache-2.0"
] | 552 | 2015-01-05T18:25:54.000Z | 2022-03-16T18:51:13.000Z | nox/src/nox/coreapps/messenger/messenger.py | ayjazz/OESS | deadc504d287febc7cbd7251ddb102bb5c8b1f04 | [
"Apache-2.0"
] | 25 | 2015-02-04T18:48:20.000Z | 2020-06-18T15:51:05.000Z | import struct
import socket
import select
## This module provides library to send and receive messages to NOX's messenger
#
# This is a rewrite of noxmsg.py from OpenRoads (OpenFlow Wireless)
#
# @author ykk (Stanford University)
# @date January, 2010
# @see messenger
def stringarray(string):
"""Output array of ... | 27.740331 | 133 | 0.599084 | import struct
import socket
import select
## This module provides library to send and receive messages to NOX's messenger
#
# This is a rewrite of noxmsg.py from OpenRoads (OpenFlow Wireless)
#
# @author ykk (Stanford University)
# @date January, 2010
# @see messenger
def stringarray(string):
"""Output array of ... | 0 | 0 | 0 |
ae11cb0519d0b4966d63b98d0b134ffb04e4a5e9 | 6,840 | py | Python | tools/fetching.py | Simpleyyt/android-remote-control | fcd494d7195478d115aadd6ff90431f7641ae1d8 | [
"MIT"
] | null | null | null | tools/fetching.py | Simpleyyt/android-remote-control | fcd494d7195478d115aadd6ff90431f7641ae1d8 | [
"MIT"
] | null | null | null | tools/fetching.py | Simpleyyt/android-remote-control | fcd494d7195478d115aadd6ff90431f7641ae1d8 | [
"MIT"
] | 1 | 2021-09-26T08:27:57.000Z | 2021-09-26T08:27:57.000Z | import os
import shutil
import tarfile
import tempfile
import zipfile
import traceback
import requests
import apkutils2
from logzero import logger
from adbutils import device as get_device
device = get_device()
atx_agent_version = "0.10.0"
__all__ = ["get_atx_agent_bundle", "get_whatsinput_apk"]
def get_atx_agent_b... | 32.264151 | 114 | 0.619152 | import os
import shutil
import tarfile
import tempfile
import zipfile
import traceback
import requests
import apkutils2
from logzero import logger
from adbutils import device as get_device
device = get_device()
atx_agent_version = "0.10.0"
__all__ = ["get_atx_agent_bundle", "get_whatsinput_apk"]
def get_atx_agent_b... | 5,025 | 0 | 184 |
f2d2234fe7754e44636c2d0cf7e6409371025ccc | 677 | py | Python | HW5/tests/q1.3.py | ds-modules/EPS-130-SP21 | 783f244145877ad97c0eafde26024310adab55f5 | [
"BSD-3-Clause"
] | 1 | 2021-01-21T17:00:16.000Z | 2021-01-21T17:00:16.000Z | HW5/tests/q1.3.py | ds-modules/EPS-130-SP21 | 783f244145877ad97c0eafde26024310adab55f5 | [
"BSD-3-Clause"
] | null | null | null | HW5/tests/q1.3.py | ds-modules/EPS-130-SP21 | 783f244145877ad97c0eafde26024310adab55f5 | [
"BSD-3-Clause"
] | null | null | null | test = { 'name': 'q1.3',
'points': 1,
'suites': [ { 'cases': [ { 'code': '>>> assert np.abs(v_direct_forward - 1280) / 1280 < 0.1;\n'
'>>> assert v_head_forward > 7000;\n'
'>>> assert v_direct_reverse < 2000;... | 52.076923 | 107 | 0.301329 | test = { 'name': 'q1.3',
'points': 1,
'suites': [ { 'cases': [ { 'code': '>>> assert np.abs(v_direct_forward - 1280) / 1280 < 0.1;\n'
'>>> assert v_head_forward > 7000;\n'
'>>> assert v_direct_reverse < 2000;... | 0 | 0 | 0 |
6aa54382a3179047c6cd77d0bc59b52dcb2f12f4 | 1,580 | py | Python | python/cac_tripplanner/cms/migrations/0007_add_defalut_aboutfaq.py | azavea/cac-tripplanner | 08eaa7e909484ac04687e078fbecba7e7fdc452e | [
"Apache-2.0"
] | 13 | 2015-08-07T13:54:53.000Z | 2020-10-20T18:59:01.000Z | python/cac_tripplanner/cms/migrations/0007_add_defalut_aboutfaq.py | azavea/cac-tripplanner | 08eaa7e909484ac04687e078fbecba7e7fdc452e | [
"Apache-2.0"
] | 1,177 | 2015-01-15T16:46:38.000Z | 2022-03-29T13:37:37.000Z | python/cac_tripplanner/cms/migrations/0007_add_defalut_aboutfaq.py | azavea/cac-tripplanner | 08eaa7e909484ac04687e078fbecba7e7fdc452e | [
"Apache-2.0"
] | 7 | 2015-01-19T20:10:38.000Z | 2019-10-16T05:57:47.000Z | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.utils import timezone
ABOUT_PAGE = {
'title': 'About',
'slug': 'about',
'content': 'About placeholder text',
'publish_date': timezone.now(),
'created': timezone.now(),
'modified': timezone.now()
}
FAQ_PAGE = {
... | 25.483871 | 89 | 0.644304 | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.utils import timezone
ABOUT_PAGE = {
'title': 'About',
'slug': 'about',
'content': 'About placeholder text',
'publish_date': timezone.now(),
'created': timezone.now(),
'modified': timezone.now()
}
FAQ_PAGE = {
... | 823 | 168 | 69 |
60912f18e02dc625a2a44a7086faff546579aa6a | 3,047 | bzl | Python | scripts/packages/self_extract_binary.bzl | NunoEdgarGFlowHub/heron | 53380553d79a9473184821e5864aedfe9f45f290 | [
"Apache-2.0"
] | 2 | 2016-07-04T07:10:31.000Z | 2018-03-28T16:59:02.000Z | scripts/packages/self_extract_binary.bzl | NunoEdgarGFlowHub/heron | 53380553d79a9473184821e5864aedfe9f45f290 | [
"Apache-2.0"
] | null | null | null | scripts/packages/self_extract_binary.bzl | NunoEdgarGFlowHub/heron | 53380553d79a9473184821e5864aedfe9f45f290 | [
"Apache-2.0"
] | 1 | 2019-10-02T15:23:46.000Z | 2019-10-02T15:23:46.000Z | # Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.235955 | 80 | 0.612406 | # Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 0 | 0 | 0 |
bd6e1b9da2cb0eea86357ed3b16b36c92b60979d | 12,986 | py | Python | radlib.py | lytboris/py-radlib | a4309aa99a0bd76fe6bed80612ee04e94b52504d | [
"BSD-2-Clause"
] | null | null | null | radlib.py | lytboris/py-radlib | a4309aa99a0bd76fe6bed80612ee04e94b52504d | [
"BSD-2-Clause"
] | null | null | null | radlib.py | lytboris/py-radlib | a4309aa99a0bd76fe6bed80612ee04e94b52504d | [
"BSD-2-Clause"
] | null | null | null | #!/usr/local/bin/python3
'''
libradius(3) wrapper
'''
import socket
from ctypes import *
from ctypes import util
from collections import namedtuple
from enum import IntEnum, unique
RadiusAttribute = namedtuple('RadiusAttribute', ['type', 'data', 'datalen', 'vendor'])
# allow unknown attributes as pure integers
... | 31.596107 | 108 | 0.710996 | #!/usr/local/bin/python3
'''
libradius(3) wrapper
'''
import socket
from ctypes import *
from ctypes import util
from collections import namedtuple
from enum import IntEnum, unique
RadiusAttribute = namedtuple('RadiusAttribute', ['type', 'data', 'datalen', 'vendor'])
class DirctionaryChapter(IntEnum):
# allow u... | 4,681 | 4,141 | 1,064 |
5fe877d42d61f76473078fa08aa8d5d1071c92eb | 513 | py | Python | run.py | j-sripad/knn-shapley-pytorch | 4b30ce18cf6d692628331ee93dc42f48cf74d826 | [
"MIT"
] | null | null | null | run.py | j-sripad/knn-shapley-pytorch | 4b30ce18cf6d692628331ee93dc42f48cf74d826 | [
"MIT"
] | null | null | null | run.py | j-sripad/knn-shapley-pytorch | 4b30ce18cf6d692628331ee93dc42f48cf74d826 | [
"MIT"
] | 1 | 2022-03-27T06:29:45.000Z | 2022-03-27T06:29:45.000Z | import torch
from models.resnet import ResNet
from shapley.dshap import DShap
from utils.dataset import FashionMNISTDataModule
from shapley.knn_shapley import KNNShapley
if __name__ == "__main__":
save_dir = "fmnist_shapley.pt"
scores = main()
print(scores)
torch.save(scores, save_dir) | 20.52 | 48 | 0.695906 | import torch
from models.resnet import ResNet
from shapley.dshap import DShap
from utils.dataset import FashionMNISTDataModule
from shapley.knn_shapley import KNNShapley
def main():
dm = FashionMNISTDataModule()
dm.setup()
model = ResNet()
measure = KNNShapley()
dshap = DShap(dm, model, m... | 182 | 0 | 23 |
f2a3599f72d06256b2f1a0140f413e67c773e9fd | 1,164 | py | Python | tests/test_representations.py | childsish/dynamic-yaml | a7186d7f9b18f3dc0859c18fcb2b9ed5655e9fba | [
"MIT"
] | 27 | 2017-04-04T18:46:02.000Z | 2022-01-14T16:09:52.000Z | tests/test_representations.py | childsish/dynamic-pyyaml | ea50d792120e87d1f2ad496364512d9591daacc0 | [
"MIT"
] | 10 | 2019-05-03T14:52:11.000Z | 2021-11-11T10:49:37.000Z | tests/test_representations.py | childsish/dynamic-pyyaml | ea50d792120e87d1f2ad496364512d9591daacc0 | [
"MIT"
] | 8 | 2018-08-01T09:27:08.000Z | 2022-01-06T06:10:50.000Z | import yaml
from unittest import TestCase, main
from dynamic_yaml import load, dump
if __name__ == '__main__':
import sys
sys.exit(main())
| 27.714286 | 140 | 0.597938 | import yaml
from unittest import TestCase, main
from dynamic_yaml import load, dump
class TestDynamicYaml(TestCase):
def test_json_dump(self):
config = '''
project_name: hello-world
dirs:
home_dir: /home/user
project_dir: "{dirs.home_dir}/projects/{project_name}"
... | 951 | 11 | 49 |
8b75e95ceb769f14cacbd3114c2511812cc53a32 | 411 | py | Python | Backend/Notizen/main.py | homer65/fellowcoder | 89433e1d44db64d9aa64a8603a7a38bcd220f035 | [
"Apache-2.0"
] | null | null | null | Backend/Notizen/main.py | homer65/fellowcoder | 89433e1d44db64d9aa64a8603a7a38bcd220f035 | [
"Apache-2.0"
] | null | null | null | Backend/Notizen/main.py | homer65/fellowcoder | 89433e1d44db64d9aa64a8603a7a38bcd220f035 | [
"Apache-2.0"
] | null | null | null | from flask_cors import CORS
if __name__ == "__main__":
app = Flask(__name__)
app.secret_key = "averysecretkey" # secret key for encoding and decoding session data
#app.permanent_session_lifetime = datetime.timedelta(hours=12)
CORS(app, supports_credentials=True)
app.run() # for development
#... | 31.615385 | 95 | 0.715328 | from flask_cors import CORS
if __name__ == "__main__":
app = Flask(__name__)
app.secret_key = "averysecretkey" # secret key for encoding and decoding session data
#app.permanent_session_lifetime = datetime.timedelta(hours=12)
CORS(app, supports_credentials=True)
app.run() # for development
#... | 0 | 0 | 0 |
ac316c71d502bb78fb54a5328b095739323b6496 | 1,184 | py | Python | settings.py | YourKalamity/TWLHelper | 5dcd40783f61a086bcd09e04e6c7edcb5e5589a0 | [
"0BSD"
] | 6 | 2021-08-05T09:40:10.000Z | 2022-03-12T16:06:41.000Z | settings.py | YourKalamity/TWLHelper | 5dcd40783f61a086bcd09e04e6c7edcb5e5589a0 | [
"0BSD"
] | 16 | 2021-08-08T07:40:36.000Z | 2022-03-23T21:55:03.000Z | settings.py | YourKalamity/TWLHelper | 5dcd40783f61a086bcd09e04e6c7edcb5e5589a0 | [
"0BSD"
] | 8 | 2021-08-08T07:19:50.000Z | 2022-03-23T21:21:34.000Z | #
# ISC License
#
# Copyright (C) 2021-present DS-Homebrew
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND TH... | 34.823529 | 74 | 0.754223 | #
# ISC License
#
# Copyright (C) 2021-present DS-Homebrew
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND TH... | 0 | 0 | 0 |
58e49225139fc1e6244a1c861514c4933a415ee4 | 1,044 | py | Python | setup.py | c3sr/-semantic-capacity | 2889475d445f31c180d7ec0149cb785d256e8f10 | [
"Apache-2.0"
] | 7 | 2020-10-17T19:50:20.000Z | 2021-12-09T19:42:44.000Z | setup.py | c3sr/-semantic-capacity | 2889475d445f31c180d7ec0149cb785d256e8f10 | [
"Apache-2.0"
] | null | null | null | setup.py | c3sr/-semantic-capacity | 2889475d445f31c180d7ec0149cb785d256e8f10 | [
"Apache-2.0"
] | 2 | 2020-10-05T03:58:58.000Z | 2020-10-05T04:41:09.000Z | # Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
from distutils.core import setup
from Cython.B... | 27.473684 | 82 | 0.72318 | # Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
from distutils.core import setup
from Cython.B... | 0 | 0 | 0 |
b7240e542bf2fc16c1041249618333e1db779b74 | 9,579 | py | Python | test_api.py | eoliveros/zapm_server | c268690b4b0e7749307965fccbdbbe673d8fc9dd | [
"MIT"
] | null | null | null | test_api.py | eoliveros/zapm_server | c268690b4b0e7749307965fccbdbbe673d8fc9dd | [
"MIT"
] | null | null | null | test_api.py | eoliveros/zapm_server | c268690b4b0e7749307965fccbdbbe673d8fc9dd | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import argparse
import time
import json
import requests
import socketio
from utils import create_hmac_sig
URL_BASE = "http://localhost:5000/"
WS_URL = "ws://localhost:5000/"
EXIT_NO_COMMAND = 1
if __name__ == "__main__":
# parse arguments
parser = construct_parser()
args ... | 40.079498 | 146 | 0.694749 | #!/usr/bin/python3
import sys
import argparse
import time
import json
import requests
import socketio
from utils import create_hmac_sig
URL_BASE = "http://localhost:5000/"
WS_URL = "ws://localhost:5000/"
EXIT_NO_COMMAND = 1
def construct_parser():
# construct argument parser
parser = argparse.ArgumentPars... | 8,023 | 0 | 322 |
5d19376c6fede7b9ec251edd4add47fbfe342fb5 | 1,190 | py | Python | scripts/bullet.py | MysteryCoder456/PyTanks.io | 90fc2908796e98fcb23b9492a65bfd8115e27feb | [
"MIT"
] | 4 | 2020-02-26T12:39:13.000Z | 2022-01-22T04:49:25.000Z | scripts/bullet.py | MysteryCoder456/PyTanks.io | 90fc2908796e98fcb23b9492a65bfd8115e27feb | [
"MIT"
] | null | null | null | scripts/bullet.py | MysteryCoder456/PyTanks.io | 90fc2908796e98fcb23b9492a65bfd8115e27feb | [
"MIT"
] | 3 | 2020-03-03T08:26:02.000Z | 2021-11-05T01:49:26.000Z | import pygame
import pymunk
class Bullet:
"""Class for making a bullet
Arguments:
pos {tuple} -- Starting position of the bullet.
vel {tuple} -- Starting velocity of the bullet.
radius {int} -- Radius of bullet (to make relative to tank size).
"""
| 27.045455 | 89 | 0.596639 | import pygame
import pymunk
class Bullet:
"""Class for making a bullet
Arguments:
pos {tuple} -- Starting position of the bullet.
vel {tuple} -- Starting velocity of the bullet.
radius {int} -- Radius of bullet (to make relative to tank size).
"""
def __init__(self, pos, vel,... | 795 | 0 | 108 |
04eba925c64e321c6c3fae9075e69e40a3773fdf | 9,023 | py | Python | orange3/Orange/widgets/evaluate/owliftcurve.py | rgschmitz1/BioDepot-workflow-builder | f74d904eeaf91ec52ec9b703d9fb38e9064e5a66 | [
"MIT"
] | 54 | 2017-01-08T17:21:49.000Z | 2021-11-02T08:46:07.000Z | orange3/Orange/widgets/evaluate/owliftcurve.py | Synthia-3/BioDepot-workflow-builder | 4ee93abe2d79465755e82a145af3b6a6e1e79fd4 | [
"MIT"
] | 22 | 2017-03-28T06:03:14.000Z | 2021-07-28T05:43:55.000Z | orange3/Orange/widgets/evaluate/owliftcurve.py | Synthia-3/BioDepot-workflow-builder | 4ee93abe2d79465755e82a145af3b6a6e1e79fd4 | [
"MIT"
] | 21 | 2017-01-26T21:12:09.000Z | 2022-01-31T21:34:59.000Z | """
Lift Curve Widget
-----------------
"""
from collections import namedtuple
import numpy as np
import sklearn.metrics as skl_metrics
from AnyQt import QtWidgets
from AnyQt.QtGui import QColor, QPen, QPalette, QFont
from AnyQt.QtCore import Qt
import pyqtgraph as pg
import Orange
from Orange.widgets import widge... | 29.778878 | 83 | 0.614097 | """
Lift Curve Widget
-----------------
"""
from collections import namedtuple
import numpy as np
import sklearn.metrics as skl_metrics
from AnyQt import QtWidgets
from AnyQt.QtGui import QColor, QPen, QPalette, QFont
from AnyQt.QtCore import Qt
import pyqtgraph as pg
import Orange
from Orange.widgets import widge... | 6,507 | 1,421 | 115 |
db009fe43c223aa697ddfe7892d612aeb305a575 | 6,477 | py | Python | release/scripts/startup/bl_ui/space_time.py | wycivil08/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 30 | 2015-01-29T14:06:05.000Z | 2022-01-10T07:47:29.000Z | release/scripts/startup/bl_ui/space_time.py | ttagu99/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 1 | 2017-02-20T20:57:48.000Z | 2018-12-19T23:44:38.000Z | release/scripts/startup/bl_ui/space_time.py | ttagu99/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 15 | 2015-04-23T02:38:36.000Z | 2021-03-01T20:09:39.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 32.064356 | 108 | 0.634399 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 5,020 | 362 | 138 |
5145e52e8430fa76dd8bb8dcbd45901b846ecaa3 | 4,994 | py | Python | cogs/commands/info/devices.py | DiscordGIR/GIRRewrite | f4992db06f7ddf4a7038e03dac08fd9834cf5f5e | [
"MIT"
] | null | null | null | cogs/commands/info/devices.py | DiscordGIR/GIRRewrite | f4992db06f7ddf4a7038e03dac08fd9834cf5f5e | [
"MIT"
] | null | null | null | cogs/commands/info/devices.py | DiscordGIR/GIRRewrite | f4992db06f7ddf4a7038e03dac08fd9834cf5f5e | [
"MIT"
] | 1 | 2022-03-31T17:42:41.000Z | 2022-03-31T17:42:41.000Z | import re
from collections import defaultdict
import discord
from discord import app_commands
from discord.ext import commands
from utils import (GIRContext, cfg, get_ios_cfw, transform_context,
transform_groups)
from utils.framework import (DeviceTransformer, VersionOnDevice,
... | 41.616667 | 133 | 0.631358 | import re
from collections import defaultdict
import discord
from discord import app_commands
from discord.ext import commands
from utils import (GIRContext, cfg, get_ios_cfw, transform_context,
transform_groups)
from utils.framework import (DeviceTransformer, VersionOnDevice,
... | 3,530 | 891 | 46 |
c43b4b5749d3a7118032d447680c604b87a054cf | 831 | py | Python | tests/test_kernels.py | jbusecke/gcm-filters | 91cd5794e1518e5631600b3590e173973c140291 | [
"BSD-3-Clause"
] | null | null | null | tests/test_kernels.py | jbusecke/gcm-filters | 91cd5794e1518e5631600b3590e173973c140291 | [
"BSD-3-Clause"
] | null | null | null | tests/test_kernels.py | jbusecke/gcm-filters | 91cd5794e1518e5631600b3590e173973c140291 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
from gcm_filters.kernels import ALL_KERNELS, GridType
@pytest.fixture(scope="module", params=list(GridType))
| 29.678571 | 68 | 0.713598 | import numpy as np
import pytest
from gcm_filters.kernels import ALL_KERNELS, GridType
@pytest.fixture(scope="module", params=list(GridType))
def grid_type_field_and_extra_kwargs(request):
grid_type = request.param
ny, nx = (128, 256)
data = np.random.rand(ny, nx)
extra_kwargs = {}
if grid_type... | 640 | 0 | 45 |
437fb43800560b6c05ed828ececa2384602ba7dd | 682 | py | Python | mosdef_cp2kmcpy/utilities/check_ensemble.py | ramanishsingh/mosdef_cp2kmcpy | 6348b9a55bef9fbfdb7d22b7df51c03802dccc0a | [
"MIT"
] | null | null | null | mosdef_cp2kmcpy/utilities/check_ensemble.py | ramanishsingh/mosdef_cp2kmcpy | 6348b9a55bef9fbfdb7d22b7df51c03802dccc0a | [
"MIT"
] | null | null | null | mosdef_cp2kmcpy/utilities/check_ensemble.py | ramanishsingh/mosdef_cp2kmcpy | 6348b9a55bef9fbfdb7d22b7df51c03802dccc0a | [
"MIT"
] | null | null | null | def pressure_ensemble(val):
"""
:param val: string, Name of the ensemble
:return: boolean, returns True if pressure should be specified
"""
if val=='NPE_F' or val=='NPE_I' or val=='NPT_F' or val=='NPT_I' or val=='NPT_GEMC':
return True
else:
return False
def temperat... | 31 | 150 | 0.609971 | def pressure_ensemble(val):
"""
:param val: string, Name of the ensemble
:return: boolean, returns True if pressure should be specified
"""
if val=='NPE_F' or val=='NPE_I' or val=='NPT_F' or val=='NPT_I' or val=='NPT_GEMC':
return True
else:
return False
def temperat... | 0 | 0 | 0 |
6b3b1d9888129f4fa04533a21743017a4356036c | 2,844 | py | Python | updater.py | apotato369550/python-malware-scanner | 9919c2fa6365c7fe8787e3630eea55f4eab078b2 | [
"MIT"
] | null | null | null | updater.py | apotato369550/python-malware-scanner | 9919c2fa6365c7fe8787e3630eea55f4eab078b2 | [
"MIT"
] | null | null | null | updater.py | apotato369550/python-malware-scanner | 9919c2fa6365c7fe8787e3630eea55f4eab078b2 | [
"MIT"
] | null | null | null | import Tkinter as tk
from Tkinter import *
import BeautifulSoup
from BeautifulSoup import BeautifulSoup
import re
import config
import os
| 28.727273 | 80 | 0.570675 | import Tkinter as tk
from Tkinter import *
import BeautifulSoup
from BeautifulSoup import BeautifulSoup
import re
import config
import os
def successPopup():
popup = tk.Tk()
popup.geometry("200x50")
error = Label(popup, text="Success!")
okButton = Button(popup, text="OK", command=popup.dest... | 2,547 | 0 | 150 |
2b0ad70c6f1cf74e03bb86f880ff282a890a4cea | 13,418 | py | Python | tools/gen_records.py | charlieDurnsfordHollands/utilities | 5306d6f96502f7c4c808d2fd9fe10572b39dfb90 | [
"MIT"
] | null | null | null | tools/gen_records.py | charlieDurnsfordHollands/utilities | 5306d6f96502f7c4c808d2fd9fe10572b39dfb90 | [
"MIT"
] | 1 | 2021-05-06T16:26:32.000Z | 2021-06-28T17:26:09.000Z | tools/gen_records.py | charlieDurnsfordHollands/utilities | 5306d6f96502f7c4c808d2fd9fe10572b39dfb90 | [
"MIT"
] | 3 | 2021-06-16T13:55:09.000Z | 2021-09-10T13:11:58.000Z | """Module for generating test messages for the new APEL system.
It will currently generate job messages or summary messages, depending on
command-line arguments, but shouldn't be difficult to extend to other types of
message. Create a subclass of RecordGenerator for each message type.
"""
import getopt
import os
imp... | 34.229592 | 125 | 0.602698 | """Module for generating test messages for the new APEL system.
It will currently generate job messages or summary messages, depending on
command-line arguments, but shouldn't be difficult to extend to other types of
message. Create a subclass of RecordGenerator for each message type.
"""
import getopt
import os
imp... | 851 | 0 | 77 |
42314301c21e9d9a0374fc5a6948fd930c44cebb | 199 | py | Python | src/pywmapi/common/__init__.py | leonardodalinky/pywmapi | b9e2650761895eb9a88170497c4d209b5dd6870c | [
"MIT"
] | 4 | 2022-01-27T14:31:38.000Z | 2022-03-25T08:52:01.000Z | src/pywmapi/common/__init__.py | leonardodalinky/pywmapi | b9e2650761895eb9a88170497c4d209b5dd6870c | [
"MIT"
] | null | null | null | src/pywmapi/common/__init__.py | leonardodalinky/pywmapi | b9e2650761895eb9a88170497c4d209b5dd6870c | [
"MIT"
] | null | null | null | from .defs import *
from .enums import *
from .models import *
HOMEPAGE_URL = "https://warframe.market"
API_BASE_URL = "https://api.warframe.market/v1"
WSS_BASE_URL = "wss://warframe.market/socket"
| 24.875 | 47 | 0.738693 | from .defs import *
from .enums import *
from .models import *
HOMEPAGE_URL = "https://warframe.market"
API_BASE_URL = "https://api.warframe.market/v1"
WSS_BASE_URL = "wss://warframe.market/socket"
| 0 | 0 | 0 |
517c28415512e55a2db28762175fda18b5bb7b4d | 2,448 | py | Python | prody/routines/prody_select.py | gokceneraslan/ProDy | 74d40c372c53bd68f5e9f9c47b991b2e2b1b9f27 | [
"NCSA"
] | null | null | null | prody/routines/prody_select.py | gokceneraslan/ProDy | 74d40c372c53bd68f5e9f9c47b991b2e2b1b9f27 | [
"NCSA"
] | null | null | null | prody/routines/prody_select.py | gokceneraslan/ProDy | 74d40c372c53bd68f5e9f9c47b991b2e2b1b9f27 | [
"NCSA"
] | null | null | null | # ProDy: A Python Package for Protein Dynamics Analysis
#
# Copyright (C) 2010-2012 Ahmet Bakan
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | 34.971429 | 78 | 0.698529 | # ProDy: A Python Package for Protein Dynamics Analysis
#
# Copyright (C) 2010-2012 Ahmet Bakan
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | 932 | 0 | 23 |
110fe71a6d76acd8c7d0b80c7f91d79e696b7cc3 | 12,435 | py | Python | src/discorn/blockchain.py | Discorn-Project/Discorn | 016afd750031e28880d9acf803ff6bc182adcb7f | [
"MIT"
] | 9 | 2021-04-03T12:28:49.000Z | 2021-05-03T13:07:33.000Z | blockchain.py | busybox11/Discorn | d48f1013d4f4149ce3c53996ff966074ae45dc89 | [
"MIT"
] | 1 | 2021-05-02T18:37:31.000Z | 2021-05-02T18:44:29.000Z | blockchain.py | busybox11/Discorn | d48f1013d4f4149ce3c53996ff966074ae45dc89 | [
"MIT"
] | 2 | 2021-05-16T20:32:29.000Z | 2021-12-14T17:25:21.000Z | import pycryptonight
import ecdsa
from Crypto.Hash import RIPEMD160
import hashlib
from log import Logger
import base58
import os
import time
import string
from merklelib import MerkleTree
string
def fast_hash(data: bytes):
"""
Hashing function used for Corner hashes.
:param data: bytes
:return: str... | 25.325866 | 98 | 0.54998 | import pycryptonight
import ecdsa
from Crypto.Hash import RIPEMD160
import hashlib
from log import Logger
import base58
import os
import time
import string
from merklelib import MerkleTree
string
def fast_hash(data: bytes):
"""
Hashing function used for Corner hashes.
:param data: bytes
:return: str... | 887 | 1,977 | 330 |
6c3e1105a5477b409c757e32e4d1edc15f105a05 | 3,531 | py | Python | pre_process.py | thinkAmi/ipa_issues_model_by_doc2vec | 8fd2c7f48c7342fd185b8f4e4bd4ed2ae0447fa4 | [
"MIT"
] | null | null | null | pre_process.py | thinkAmi/ipa_issues_model_by_doc2vec | 8fd2c7f48c7342fd185b8f4e4bd4ed2ae0447fa4 | [
"MIT"
] | null | null | null | pre_process.py | thinkAmi/ipa_issues_model_by_doc2vec | 8fd2c7f48c7342fd185b8f4e4bd4ed2ae0447fa4 | [
"MIT"
] | null | null | null | import pathlib
import re
OCR_AP = {
'dir': 'ap',
'last': '問80'
}
OCR_KOUDO = {
'dir': 'koudo',
'last': '問30',
}
# 最後の問題が終わったと判断するための正規表現
AFTER_LAST_QUESTION = re.compile(r'[0-9]|-')
if __name__ == '__main__':
main()
| 31.810811 | 98 | 0.540923 | import pathlib
import re
OCR_AP = {
'dir': 'ap',
'last': '問80'
}
OCR_KOUDO = {
'dir': 'koudo',
'last': '問30',
}
# 最後の問題が終わったと判断するための正規表現
AFTER_LAST_QUESTION = re.compile(r'[0-9]|-')
def main():
split_by_question(OCR_AP)
split_by_question(OCR_KOUDO)
def split_by_question(ocr_type):
# ht... | 4,091 | 0 | 92 |
0fef97600b12f3be377b20b9cce249f59e622c18 | 39,809 | py | Python | BioSTEAM 2.x.x/biorefineries/BDO/system.py | blsymens/Bioindustrial-Park | c1173646185d52f4b8d595ad088ade8e5216614d | [
"MIT"
] | 1 | 2020-01-08T23:05:34.000Z | 2020-01-08T23:05:34.000Z | BioSTEAM 2.x.x/biorefineries/BDO/system.py | blsymens/Bioindustrial-Park | c1173646185d52f4b8d595ad088ade8e5216614d | [
"MIT"
] | 3 | 2020-12-30T03:16:50.000Z | 2021-01-04T20:36:45.000Z | BioSTEAM 2.x.x/biorefineries/BDO/system.py | blsymens/Bioindustrial-Park | c1173646185d52f4b8d595ad088ade8e5216614d | [
"MIT"
] | 1 | 2021-03-09T12:04:54.000Z | 2021-03-09T12:04:54.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 09:15:23 2019
Modified from the cornstover biorefinery constructed in Cortes-Peña et al., 2020,
with modification of fermentation system for organic acids instead of the original ethanol
[1] Cortes-Peña et al., BioSTEAM: A Fast and Flexible Plat... | 39.968876 | 162 | 0.567962 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 09:15:23 2019
Modified from the cornstover biorefinery constructed in Cortes-Peña et al., 2020,
with modification of fermentation system for organic acids instead of the original ethanol
[1] Cortes-Peña et al., BioSTEAM: A Fast and Flexible Plat... | 3,339 | 0 | 204 |
5eae81090612c227c9b6d70ca8dad4b306ff2c67 | 332 | py | Python | tests/test_remove_stress.py | absentabyss/ithkuil | 2f10841189550c19d7f951c87e0b020969356cda | [
"MIT"
] | 20 | 2016-03-01T04:21:21.000Z | 2021-04-28T06:52:30.000Z | tests/test_remove_stress.py | absentabyss/ithkuil | 2f10841189550c19d7f951c87e0b020969356cda | [
"MIT"
] | 5 | 2016-01-07T16:22:25.000Z | 2019-12-26T01:49:16.000Z | tests/test_remove_stress.py | absentabyss/ithkuil | 2f10841189550c19d7f951c87e0b020969356cda | [
"MIT"
] | 6 | 2017-05-08T20:46:43.000Z | 2020-05-09T23:54:56.000Z | import pytest
from ithkuil.morphology.words import remove_stress
txts_to_test = [
('a', 'a'),
('o', 'o'),
('áu', 'au'),
('ái', 'ai'),
('aú', 'aù'),
('aé', 'ae'),
('á', 'a')
]
@pytest.mark.parametrize('txt, expected', txts_to_test) | 20.75 | 55 | 0.566265 | import pytest
from ithkuil.morphology.words import remove_stress
txts_to_test = [
('a', 'a'),
('o', 'o'),
('áu', 'au'),
('ái', 'ai'),
('aú', 'aù'),
('aé', 'ae'),
('á', 'a')
]
@pytest.mark.parametrize('txt, expected', txts_to_test)
def test_word(txt, expected):
assert remove_stress(txt)... | 50 | 0 | 22 |
d1751d4f4b25090308f574118440758b1ed37a82 | 792 | py | Python | symbols/source/DCVoltage.py | d-fathi/PyAMS | 98b6e052280551bf53bbb9cb20a6cef1f92faf89 | [
"Unlicense"
] | null | null | null | symbols/source/DCVoltage.py | d-fathi/PyAMS | 98b6e052280551bf53bbb9cb20a6cef1f92faf89 | [
"Unlicense"
] | null | null | null | symbols/source/DCVoltage.py | d-fathi/PyAMS | 98b6e052280551bf53bbb9cb20a6cef1f92faf89 | [
"Unlicense"
] | null | null | null | #-------------------------------------------------------------------------------
# Name: Vdc Source
# Author: D.Fathi
# Created: 20/03/2015
# Modified: 01/04/2020
# Copyright: (c) PyAMS
# Licence: CC-BY-SA
#-------------------------------------------------------------------------------
fr... | 24.75 | 81 | 0.415404 | #-------------------------------------------------------------------------------
# Name: Vdc Source
# Author: D.Fathi
# Created: 20/03/2015
# Modified: 01/04/2020
# Copyright: (c) PyAMS
# Licence: CC-BY-SA
#-------------------------------------------------------------------------------
fr... | 293 | 2 | 78 |
d703b3e89c861e867d5f47f407e19a572813a9c7 | 3,079 | py | Python | Python/Services/Logger.py | vanavski/Text_tonal_analyzer | a990d965dc4eca5bb43a70a050eb3ad10323760b | [
"Apache-2.0"
] | null | null | null | Python/Services/Logger.py | vanavski/Text_tonal_analyzer | a990d965dc4eca5bb43a70a050eb3ad10323760b | [
"Apache-2.0"
] | 1 | 2020-08-07T20:20:46.000Z | 2020-08-07T20:20:46.000Z | Python/Services/Logger.py | vanavski/Text_tonal_analyzer | a990d965dc4eca5bb43a70a050eb3ad10323760b | [
"Apache-2.0"
] | null | null | null | # Copyright © 2018. All rights reserved.
# Author: German Yakimov
# 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 appl... | 39.474359 | 120 | 0.63722 | # Copyright © 2018. All rights reserved.
# Author: German Yakimov
# 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 appl... | 2,091 | 13 | 238 |
b1a2fb515ab785e8bd4da13fa6f5d600c3ff536a | 671 | py | Python | hw-appium/pytest_demo/test_demo.py | ZitherPeng/CodeRecord_Python | 99be14486a04a6fb924b79d1088c08a2dbf0f420 | [
"MIT"
] | null | null | null | hw-appium/pytest_demo/test_demo.py | ZitherPeng/CodeRecord_Python | 99be14486a04a6fb924b79d1088c08a2dbf0f420 | [
"MIT"
] | null | null | null | hw-appium/pytest_demo/test_demo.py | ZitherPeng/CodeRecord_Python | 99be14486a04a6fb924b79d1088c08a2dbf0f420 | [
"MIT"
] | null | null | null | import pytest
@pytest.fixture(scope='function')
@pytest.fixture(scope='module')
@pytest.mark.website
| 19.735294 | 63 | 0.709389 | import pytest
@pytest.fixture(scope='function')
def setup_function(request):
def teardown_function():
print("teardown_function called.")
request.addfinalizer(teardown_function) # 此内嵌函数做teardown工作
print('setup_function called.')
@pytest.fixture(scope='module')
def setup_module(request):
def... | 466 | 0 | 112 |
48068e5d5ca90193702b291b60b5c5e4dac6e08d | 695 | py | Python | setup.py | ismailktami/robotframework-publisher-results-jira | 26167b6c1881fe0ea8ea492f4b58f63061247a48 | [
"MIT"
] | null | null | null | setup.py | ismailktami/robotframework-publisher-results-jira | 26167b6c1881fe0ea8ea492f4b58f63061247a48 | [
"MIT"
] | null | null | null | setup.py | ismailktami/robotframework-publisher-results-jira | 26167b6c1881fe0ea8ea492f4b58f63061247a48 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from PublisherJiraTestsResults.version import VERSION
classifiers = [
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3'
]
setup(
name='robotframework-publisher-results-jira',
version=VERS... | 27.8 | 78 | 0.723741 | from setuptools import setup, find_packages
from PublisherJiraTestsResults.version import VERSION
classifiers = [
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3'
]
setup(
name='robotframework-publisher-results-jira',
version=VERS... | 0 | 0 | 0 |
c74abbf7e46a03add2c525bde08bf9a7b39f5235 | 1,060 | py | Python | rasp/device/__init__.py | CreeperLin/RASP | c45f9ad57b18d92b663419538562d511149c329f | [
"MIT"
] | 1 | 2021-07-20T14:56:58.000Z | 2021-07-20T14:56:58.000Z | rasp/device/__init__.py | CreeperLin/RASP | c45f9ad57b18d92b663419538562d511149c329f | [
"MIT"
] | null | null | null | rasp/device/__init__.py | CreeperLin/RASP | c45f9ad57b18d92b663419538562d511149c329f | [
"MIT"
] | 2 | 2020-04-21T06:49:04.000Z | 2021-07-20T14:57:06.000Z | import importlib
_DEVICE = 'frontend'
required_entries = [
'reset',
'init',
'run',
'add_node',
]
| 25.238095 | 72 | 0.587736 | import importlib
_DEVICE = 'frontend'
required_entries = [
'reset',
'init',
'run',
'add_node',
]
def load_device(config):
global _DEVICE
_DEVICE = config.get('type', 'frontend')
if _DEVICE == 'frontend':
module_name = '.frontend_device'
package = 'rasp.device'
elif _D... | 898 | 0 | 46 |
7fe867fd559b5df13421d21d6455bfcb821f7df6 | 7,328 | py | Python | test_meIRL/run_experiment_irl.py | ranok92/deepirl | 88c7e76986243cf0b988d8d7dc0eef6b58e07864 | [
"MIT"
] | 2 | 2019-01-04T22:03:15.000Z | 2019-04-03T00:16:11.000Z | test_meIRL/run_experiment_irl.py | ranok92/deepirl | 88c7e76986243cf0b988d8d7dc0eef6b58e07864 | [
"MIT"
] | null | null | null | test_meIRL/run_experiment_irl.py | ranok92/deepirl | 88c7e76986243cf0b988d8d7dc0eef6b58e07864 | [
"MIT"
] | null | null | null | import pdb
import argparse
import matplotlib
import numpy as np
import gym, sys, time, os
import torch
import numpy as np
import datetime
sys.path.insert(0, '..') # NOQA: E402
from logger.logger import Logger
import utils
from mountain_car import MCFeatures, MCFeaturesOnehot
parser = argparse.ArgumentParser()
par... | 38.568421 | 118 | 0.63619 | import pdb
import argparse
import matplotlib
import numpy as np
import gym, sys, time, os
import torch
import numpy as np
import datetime
sys.path.insert(0, '..') # NOQA: E402
from logger.logger import Logger
import utils
from mountain_car import MCFeatures, MCFeaturesOnehot
parser = argparse.ArgumentParser()
par... | 4,025 | 0 | 23 |
34f87cabe1432e440a2c44c39b5241ba4fafb621 | 3,918 | py | Python | nr.parsing.core/src/nr/parsing/core/tokenizer/ruleset.py | NiklasRosenstein/nr-python | dc5b31ae5773ea4522a6f35112792dde9e872bef | [
"MIT"
] | 3 | 2018-11-20T22:19:35.000Z | 2020-10-31T09:23:53.000Z | nr.parsing.core/src/nr/parsing/core/tokenizer/ruleset.py | NiklasRosenstein/python-nr | dc5b31ae5773ea4522a6f35112792dde9e872bef | [
"MIT"
] | 3 | 2021-08-09T00:14:26.000Z | 2021-08-09T00:28:27.000Z | nr.parsing.core/src/nr/parsing/core/tokenizer/ruleset.py | NiklasRosenstein/nr-python | dc5b31ae5773ea4522a6f35112792dde9e872bef | [
"MIT"
] | 3 | 2019-03-22T06:15:17.000Z | 2020-10-31T09:23:53.000Z |
import contextlib
import typing as t
from dataclasses import dataclass
from ..scanner import Scanner
if t.TYPE_CHECKING:
from .extractor import TokenExtractor
T = t.TypeVar('T')
U = t.TypeVar('U')
V = t.TypeVar('V')
R = t.TypeVar('R')
@dataclass
@dataclass
class RuleSet(t.Generic[T, U]):
"""
A ordered l... | 29.458647 | 98 | 0.667688 |
import contextlib
import typing as t
from dataclasses import dataclass
from ..scanner import Scanner
if t.TYPE_CHECKING:
from .extractor import TokenExtractor
T = t.TypeVar('T')
U = t.TypeVar('U')
V = t.TypeVar('V')
R = t.TypeVar('R')
@dataclass
class Sentinel(t.Generic[T, U]):
type: T
value: U
@dataclass... | 1,420 | 95 | 318 |
9cdd7347851b7d5b33139253b15ece1088ac0fc1 | 2,934 | py | Python | src/augraphy/augmentations/brightnesstexturize.py | azf99/augraphy | 5266c60606f47ea5b25b4be254c46d5561883431 | [
"MIT"
] | null | null | null | src/augraphy/augmentations/brightnesstexturize.py | azf99/augraphy | 5266c60606f47ea5b25b4be254c46d5561883431 | [
"MIT"
] | null | null | null | src/augraphy/augmentations/brightnesstexturize.py | azf99/augraphy | 5266c60606f47ea5b25b4be254c46d5561883431 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import random
from augraphy.base.augmentation import Augmentation
from augraphy.base.augmentationresult import AugmentationResult
class BrightnessTexturizeAugmentation(Augmentation):
"""Creates a random noise in the brightness channel to emulate paper
textures.
:param range:... | 39.12 | 131 | 0.602249 | import cv2
import numpy as np
import random
from augraphy.base.augmentation import Augmentation
from augraphy.base.augmentationresult import AugmentationResult
class BrightnessTexturizeAugmentation(Augmentation):
"""Creates a random noise in the brightness channel to emulate paper
textures.
:param range:... | 1,691 | 0 | 52 |
6bbe5d2a02bded07f7cafa565ca1011f98c09985 | 734 | py | Python | coniii/test_utils.py | bcdaniels/coniii | 50218dc571135dd08b441361da33fed64a8eebc4 | [
"MIT"
] | 10 | 2018-01-26T09:52:17.000Z | 2019-04-02T13:34:53.000Z | coniii/test_utils.py | bcdaniels/coniii | 50218dc571135dd08b441361da33fed64a8eebc4 | [
"MIT"
] | 19 | 2017-04-19T17:05:50.000Z | 2019-01-20T20:54:06.000Z | coniii/test_utils.py | bcdaniels/coniii | 50218dc571135dd08b441361da33fed64a8eebc4 | [
"MIT"
] | 3 | 2017-04-19T16:58:05.000Z | 2018-10-22T19:14:04.000Z | from __future__ import division
from utils import *
def test_state_gen_and_count():
"""Test generation of binary states using bin_states() and xbin_states()."""
assert np.array_equal( bin_states(5),np.vstack([i for i in xbin_states(5)]) )
states = bin_states(5)
p,s = state_probs(states)
assert (p=... | 28.230769 | 81 | 0.63624 | from __future__ import division
from utils import *
def test_sub_to_ind():
for n in xrange(2,5):
counter = 0
for i,j in combinations(range(n),2):
assert sub_to_ind(n,i,j)==counter
assert ind_to_sub(n,counter)==(i,j)
counter += 1
def test_state_gen_and_count():
... | 211 | 0 | 23 |
d2697b8cee1ae168ceb349d5972a5029bb7ed9db | 838 | py | Python | exercicios/ex056b.py | DeyvisonR/curso_python | 983b634d39f542369628ae48c7449ea75fd1ebbd | [
"MIT"
] | null | null | null | exercicios/ex056b.py | DeyvisonR/curso_python | 983b634d39f542369628ae48c7449ea75fd1ebbd | [
"MIT"
] | null | null | null | exercicios/ex056b.py | DeyvisonR/curso_python | 983b634d39f542369628ae48c7449ea75fd1ebbd | [
"MIT"
] | null | null | null | soma = 0
cont = 0
maior = 0
mulher = 0
nomemaisvelho = ''
for p in range(1, 5):
print(f'----- {p}ª pessoa -----')
nome = str(input('nome: ')).strip()
idade = int(input('idade: '))
sexo = str(input('sexo [M/F]: ')).strip().lower()
soma = idade + soma
cont = cont + 1
if p == 1 and sexo == 'm':... | 29.928571 | 79 | 0.547733 | soma = 0
cont = 0
maior = 0
mulher = 0
nomemaisvelho = ''
for p in range(1, 5):
print(f'----- {p}ª pessoa -----')
nome = str(input('nome: ')).strip()
idade = int(input('idade: '))
sexo = str(input('sexo [M/F]: ')).strip().lower()
soma = idade + soma
cont = cont + 1
if p == 1 and sexo == 'm':... | 0 | 0 | 0 |
123cdf97d184cdca0058cf5c7da05b3cac6a6844 | 3,231 | py | Python | tests/test_number.py | tulth/gcode_gen | d6e276f2074d4fe66755b2ae06c5b4d85583c563 | [
"BSD-3-Clause"
] | null | null | null | tests/test_number.py | tulth/gcode_gen | d6e276f2074d4fe66755b2ae06c5b4d85583c563 | [
"BSD-3-Clause"
] | null | null | null | tests/test_number.py | tulth/gcode_gen | d6e276f2074d4fe66755b2ae06c5b4d85583c563 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import numpy as np
from gcode_gen import number
| 44.875 | 100 | 0.618694 | import unittest
import numpy as np
from gcode_gen import number
class TestNumber(unittest.TestCase):
def test_safe_ceil(self):
self.assertEqual(number.safe_ceil(3.9999999), 4)
self.assertEqual(number.safe_ceil(4.00000001), 4)
self.assertEqual(number.safe_ceil(4.1), 5)
def test_num2st... | 3,020 | 15 | 131 |
8df85d5d9b5be37397d579aeb3a5ed985b1f3327 | 854 | py | Python | slice_db/transforms/date.py | rivethealth/slice-db | 2f94ae7e6c8970bd4ff42b10b0d612c4df179ab8 | [
"MIT"
] | 1 | 2021-04-07T18:13:56.000Z | 2021-04-07T18:13:56.000Z | slice_db/transforms/date.py | rivethealth/slice-db | 2f94ae7e6c8970bd4ff42b10b0d612c4df179ab8 | [
"MIT"
] | null | null | null | slice_db/transforms/date.py | rivethealth/slice-db | 2f94ae7e6c8970bd4ff42b10b0d612c4df179ab8 | [
"MIT"
] | null | null | null | import datetime
import typing
from ..transform import Transform, TransformContext, Transformer
from .common import create_random
| 30.5 | 82 | 0.687354 | import datetime
import typing
from ..transform import Transform, TransformContext, Transformer
from .common import create_random
class DateYearTransform(Transform):
def create(self, context: TransformContext, pepper: bytes, config):
return _DateYearTransformer(pepper)
class _DateYearTransformer(Transfo... | 564 | 33 | 125 |
e5c50c04b31164b92292c1fe2313cfdab744cbfe | 659 | py | Python | parser/team26/G26/Instrucciones/DML/update.py | susanliss/tytus | a613a2352cf4a1d0e90ce27bb346ab60ed8039cc | [
"MIT"
] | 1 | 2021-01-09T05:32:35.000Z | 2021-01-09T05:32:35.000Z | parser/team26/G26/Instrucciones/DML/update.py | XiomRB/tytus | 0873e4bdce5c110bee6ef2aa98240be6a93ae024 | [
"MIT"
] | null | null | null | parser/team26/G26/Instrucciones/DML/update.py | XiomRB/tytus | 0873e4bdce5c110bee6ef2aa98240be6a93ae024 | [
"MIT"
] | null | null | null | import sys
sys.path.append('../G26/Instrucciones')
from instruccion import *
| 21.966667 | 69 | 0.660091 | import sys
sys.path.append('../G26/Instrucciones')
from instruccion import *
class Update(Instruccion):
def __init__(self, tableid, asignaciones = [], condiciones = []):
self.tableid = tableid
self.asignaciones = asignaciones
self.condiciones = condiciones
def execute(self):
... | 353 | 20 | 208 |
efec58b37a6b309b204c9cecd14c0f798a333343 | 2,258 | py | Python | example_stage.py | SimonDaNinja/2D_Platform | 56fd708d306dd45afa2b695492dc6517134aa045 | [
"MIT"
] | 1 | 2021-04-02T20:38:42.000Z | 2021-04-02T20:38:42.000Z | example_stage.py | SimonDaNinja/2D_Platform | 56fd708d306dd45afa2b695492dc6517134aa045 | [
"MIT"
] | null | null | null | example_stage.py | SimonDaNinja/2D_Platform | 56fd708d306dd45afa2b695492dc6517134aa045 | [
"MIT"
] | null | null | null | #---------------
#MIT License
#Copyright (c) 2019 Simon Liljestrand
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, ... | 35.84127 | 91 | 0.736935 | #---------------
#MIT License
#Copyright (c) 2019 Simon Liljestrand
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, ... | 0 | 0 | 0 |
9aeac8d4cde040c2bf4ea72b342d583dce376fc0 | 1,001 | py | Python | mtdb/eval/unused/local-and-ebs-mag/throughput-latency/Conf.py | hobinyoon/mutants-cassandra-2.2.3 | a26821726dcedbb5a96a02e649d552e06815ea5f | [
"Apache-2.0"
] | null | null | null | mtdb/eval/unused/local-and-ebs-mag/throughput-latency/Conf.py | hobinyoon/mutants-cassandra-2.2.3 | a26821726dcedbb5a96a02e649d552e06815ea5f | [
"Apache-2.0"
] | 2 | 2016-07-06T14:38:40.000Z | 2016-07-07T16:41:20.000Z | mtdb/eval/unused/local-and-ebs-mag/throughput-latency/Conf.py | hobinyoon/mutants-cassandra-2.2.3 | a26821726dcedbb5a96a02e649d552e06815ea5f | [
"Apache-2.0"
] | 1 | 2015-11-07T03:07:04.000Z | 2015-11-07T03:07:04.000Z | import argparse
import sys
import yaml
sys.path.insert(0, "../../../util/python")
import Cons
_conf = None
# Implement when needed
| 25.025 | 126 | 0.755245 | import argparse
import sys
import yaml
sys.path.insert(0, "../../../util/python")
import Cons
_conf = None
def Init():
_ParseYaml()
#_ParseCmdlineArgs()
def Get(key):
return _conf[key]
def _ParseYaml():
global _conf
with open("configuration.yaml", 'r') as stream:
_conf = yaml.load(stream)
#Cons.P(_conf)... | 773 | 0 | 91 |
6aa70387d9c785be792414a0f4abdbc04d5dcd35 | 3,344 | py | Python | ann_solution/inference.py | michaellengyel/Rat_Logger | ea0627aa4fadfd587725495818c3f3dbb818151e | [
"Apache-2.0"
] | null | null | null | ann_solution/inference.py | michaellengyel/Rat_Logger | ea0627aa4fadfd587725495818c3f3dbb818151e | [
"Apache-2.0"
] | null | null | null | ann_solution/inference.py | michaellengyel/Rat_Logger | ea0627aa4fadfd587725495818c3f3dbb818151e | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
if __name__ == '__main__':
main()
| 30.678899 | 162 | 0.632177 | import torch
import torch.nn as nn
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
class RatNet(nn.Module):
def __init__(self, input_size, hidden_size, output_size):
... | 2,837 | 10 | 225 |
8c8b6d16519c9b33cc933584b02e1a244bc29d16 | 1,443 | py | Python | ddpg-pendulum/main.py | xlnwel/deep-reinforcement-learning | 59581b9e3402f9e4dc8763d8bc2f54df88f3d885 | [
"MIT"
] | 7 | 2018-08-18T17:13:33.000Z | 2020-05-03T00:12:41.000Z | ddpg-pendulum/main.py | xlnwel/deep-reinforcement-learning | 59581b9e3402f9e4dc8763d8bc2f54df88f3d885 | [
"MIT"
] | null | null | null | ddpg-pendulum/main.py | xlnwel/deep-reinforcement-learning | 59581b9e3402f9e4dc8763d8bc2f54df88f3d885 | [
"MIT"
] | 4 | 2018-10-29T02:43:29.000Z | 2019-02-12T05:08:53.000Z | import gym
import random
import torch
import numpy as np
from collections import deque
# imort matplotlib.pyplot as plt
from MyAgent import Agent
env = gym.make('Pendulum-v0')
env.seed(2)
agent = Agent(state_size=3, action_size=1)
scores = ddpg()
# fig = plt.figure()
# ax = fig.add_subplot(111)
# plt.plot(np.arange(... | 32.066667 | 101 | 0.629245 | import gym
import random
import torch
import numpy as np
from collections import deque
# imort matplotlib.pyplot as plt
from MyAgent import Agent
env = gym.make('Pendulum-v0')
env.seed(2)
agent = Agent(state_size=3, action_size=1)
def ddpg(n_episodes=1000, max_t=300, print_every=100):
scores_deque = deque(maxlen=... | 1,013 | 0 | 23 |
4b483af26b27d5c60b10cc101f5caa6d0b4f4af5 | 485 | py | Python | voxel_globe/ingest/tasks.py | ngageoint/voxel-globe | 91f386de652b704942165889c10468b2c4cf4eec | [
"MIT"
] | 28 | 2015-07-27T23:57:24.000Z | 2020-04-05T15:10:52.000Z | voxel_globe/ingest/tasks.py | VisionSystemsInc/voxel_globe | 6eb3fca5586726428e9d914f7b730ca164c64a52 | [
"MIT"
] | 50 | 2016-02-11T15:50:22.000Z | 2016-10-27T22:38:27.000Z | voxel_globe/ingest/tasks.py | ngageoint/voxel-globe | 91f386de652b704942165889c10468b2c4cf4eec | [
"MIT"
] | 8 | 2015-07-27T19:22:03.000Z | 2021-01-04T09:44:48.000Z | from voxel_globe.common_tasks import shared_task, VipTask
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
@shared_task(base=VipTask, bind=True)
def cleanup(self, upload_session_id):
''' Clean up after successful ingest
Currently this only entails removing the upload session ... | 28.529412 | 77 | 0.802062 | from voxel_globe.common_tasks import shared_task, VipTask
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
@shared_task(base=VipTask, bind=True)
def cleanup(self, upload_session_id):
''' Clean up after successful ingest
Currently this only entails removing the upload session ... | 0 | 0 | 0 |
34fcd78f59e4ffbb673bcddd783c944205d0744b | 8,250 | py | Python | extra_files/lambda.py | rishabh-goel/Rishabh_Goel_CS441_HW3 | 09768825edd11afa2dd3186851c2668c1cef9214 | [
"Apache-2.0"
] | null | null | null | extra_files/lambda.py | rishabh-goel/Rishabh_Goel_CS441_HW3 | 09768825edd11afa2dd3186851c2668c1cef9214 | [
"Apache-2.0"
] | null | null | null | extra_files/lambda.py | rishabh-goel/Rishabh_Goel_CS441_HW3 | 09768825edd11afa2dd3186851c2668c1cef9214 | [
"Apache-2.0"
] | null | null | null | import json
import boto3
import re
import datetime
s3 = boto3.client('s3')
GET_RAW_PATH = '/getLogCount'
POST_RAW_PATH = '/postLogCount'
GRPC_RAW_PATH = '/GRPC'
TEST_RAW_PATH = '/test'
regexPattern = re.compile('([a-c][e-g][0-3]|[A-Z][5-9][f-w]){5,15}')
## Method to parse input for GET, POST, GRPC requests
## Metho... | 38.732394 | 106 | 0.621939 | import json
import boto3
import re
import datetime
s3 = boto3.client('s3')
GET_RAW_PATH = '/getLogCount'
POST_RAW_PATH = '/postLogCount'
GRPC_RAW_PATH = '/GRPC'
TEST_RAW_PATH = '/test'
regexPattern = re.compile('([a-c][e-g][0-3]|[A-Z][5-9][f-w]){5,15}')
## Method to parse input for GET, POST, GRPC requests
def getIn... | 7,612 | 0 | 110 |
0d1c2f707a84ac2af7189b219b6c863866eda165 | 421 | py | Python | 10_learn_openpyxl/write_image.py | shikechen/LearnPython | aa7b914779702c650733c2e95fad1b9dd2c1cb50 | [
"Apache-2.0"
] | null | null | null | 10_learn_openpyxl/write_image.py | shikechen/LearnPython | aa7b914779702c650733c2e95fad1b9dd2c1cb50 | [
"Apache-2.0"
] | null | null | null | 10_learn_openpyxl/write_image.py | shikechen/LearnPython | aa7b914779702c650733c2e95fad1b9dd2c1cb50 | [
"Apache-2.0"
] | null | null | null | """
Author: shikechen
Function: Write image to sheet
Version: 1.0
Date: 2019/3/6
"""
from openpyxl import Workbook
from openpyxl.drawing.image import Image
if __name__ == '__main__':
main()
| 16.84 | 42 | 0.643705 | """
Author: shikechen
Function: Write image to sheet
Version: 1.0
Date: 2019/3/6
"""
from openpyxl import Workbook
from openpyxl.drawing.image import Image
def main():
book = Workbook()
sheet = book.active
img = Image('dream_lake_colorado.png')
sheet['A1'] = 'Beautiful scenery'
s... | 185 | 0 | 23 |
ac5eba834fdc677c381d2e7ae04fddee91bf71b1 | 1,837 | py | Python | imgToTextColor.py | fizzrepo/Video-to-Text | 699db051b3dec96e14f7495722ee24f091e03716 | [
"MIT"
] | 1 | 2022-03-15T17:22:34.000Z | 2022-03-15T17:22:34.000Z | imgToTextColor.py | fizzrepo/Video-to-Text | 699db051b3dec96e14f7495722ee24f091e03716 | [
"MIT"
] | null | null | null | imgToTextColor.py | fizzrepo/Video-to-Text | 699db051b3dec96e14f7495722ee24f091e03716 | [
"MIT"
] | 1 | 2022-03-14T17:18:13.000Z | 2022-03-14T17:18:13.000Z | import numpy as np
import pickle
# Load in color lookup table data
with open('colors.pkl', 'rb') as f:
LERPED = pickle.load(f)
LUT = np.load('LUT.npy')
def set_color(bg, fg):
'''
Generates a character sequence to set the foreground and background colors
'''
return f'\u001b[48;5;{bg... | 28.261538 | 83 | 0.559064 | import numpy as np
import pickle
# Load in color lookup table data
with open('colors.pkl', 'rb') as f:
LERPED = pickle.load(f)
LUT = np.load('LUT.npy')
def set_color(bg, fg):
'''
Generates a character sequence to set the foreground and background colors
'''
return f'\u001b[48;5;{bg... | 0 | 0 | 0 |