hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
919505a632047d117e48879fffe45bf88a9e103a | 2,327 | py | Python | tests/syslog/test_syslog.py | vincent201881/sonic-mgmt | 4f02bb5f91600ae5180ace1620a718caf02c63a1 | [
"Apache-2.0"
] | null | null | null | tests/syslog/test_syslog.py | vincent201881/sonic-mgmt | 4f02bb5f91600ae5180ace1620a718caf02c63a1 | [
"Apache-2.0"
] | null | null | null | tests/syslog/test_syslog.py | vincent201881/sonic-mgmt | 4f02bb5f91600ae5180ace1620a718caf02c63a1 | [
"Apache-2.0"
] | null | null | null | import logging
import pytest
from tests.common.helpers.assertions import pytest_assert
from tests.common.utilities import wait_until
logger = logging.getLogger(__name__)
pytestmark = [
pytest.mark.topology("any")
]
SYSLOG_STARTUP_TIMEOUT = 30
SYSLOG_STARTUP_POLLING_INTERVAL = 3
SYSLOG_MESSAGE_TEST_TIMEOUT = 10... | 32.774648 | 109 | 0.711646 |
9195257ffdac6dd92fc00401ab960e1cb3467e98 | 2,827 | py | Python | napari/benchmarks/benchmark_points_layer.py | mkitti/napari | 4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86 | [
"BSD-3-Clause"
] | 1 | 2021-04-04T21:25:04.000Z | 2021-04-04T21:25:04.000Z | napari/benchmarks/benchmark_points_layer.py | mkitti/napari | 4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86 | [
"BSD-3-Clause"
] | 1 | 2020-10-15T19:31:09.000Z | 2020-10-15T19:39:33.000Z | napari/benchmarks/benchmark_points_layer.py | mkitti/napari | 4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86 | [
"BSD-3-Clause"
] | null | null | null | # See "Writing benchmarks" in the asv docs for more information.
# https://asv.readthedocs.io/en/latest/writing_benchmarks.html
# or the napari documentation on benchmarking
# https://github.com/napari/napari/blob/master/docs/BENCHMARKS.md
import numpy as np
from napari.layers import Points
class Points2DSuite:
... | 27.182692 | 76 | 0.607358 |
9195276fda6907a1e90e95a8b551e3d4e6029569 | 2,051 | py | Python | deeppavlov/models/embedders/fasttext_embedder.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 1 | 2019-05-22T08:34:33.000Z | 2019-05-22T08:34:33.000Z | deeppavlov/models/embedders/fasttext_embedder.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | null | null | null | deeppavlov/models/embedders/fasttext_embedder.py | ineersa/DeepPavlov | 8200bf9a0f0b378baad4ee0eb75b59453f516004 | [
"Apache-2.0"
] | 1 | 2019-03-17T13:47:44.000Z | 2019-03-17T13:47:44.000Z | # Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# 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 applicab... | 31.553846 | 74 | 0.70746 |
91952b776b0c2c232203b244707c161dcfab57b3 | 11,977 | py | Python | qnarre/models/xlm.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/models/xlm.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/models/xlm.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | # Copyright 2022 Quantapix 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 l... | 32.99449 | 99 | 0.536361 |
91958cbfd0b023393e6e28249686f8296a78bfc9 | 1,574 | py | Python | api/franceocr/cni/__init__.py | LouisTrezzini/projet-mairie | 4907fe212d2a6434a676f7c08b9110cc683fd9d7 | [
"BSD-3-Clause"
] | 2 | 2017-12-17T11:50:21.000Z | 2020-10-29T15:53:34.000Z | api/franceocr/cni/__init__.py | mairie-de-paris/franceocr | 4907fe212d2a6434a676f7c08b9110cc683fd9d7 | [
"BSD-3-Clause"
] | 4 | 2021-03-18T20:27:53.000Z | 2022-01-13T00:43:21.000Z | api/franceocr/cni/__init__.py | mairie-de-paris/franceocr | 4907fe212d2a6434a676f7c08b9110cc683fd9d7 | [
"BSD-3-Clause"
] | 4 | 2017-12-17T11:53:09.000Z | 2019-05-27T19:40:28.000Z | """
BSD 3-Clause License
Copyright (c) 2017, Mairie de Paris
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of cond... | 44.971429 | 78 | 0.807497 |
9195da1232fa34befd25121b064d54060bd6f2b2 | 3,218 | py | Python | test.py | netlas-io/netlas-python | cb33beccccc8b7bafb9fe32aaa21c3d8feb21b0c | [
"MIT"
] | 4 | 2021-06-22T12:22:22.000Z | 2022-03-21T15:55:03.000Z | test.py | netlas-io/netlas-python | cb33beccccc8b7bafb9fe32aaa21c3d8feb21b0c | [
"MIT"
] | null | null | null | test.py | netlas-io/netlas-python | cb33beccccc8b7bafb9fe32aaa21c3d8feb21b0c | [
"MIT"
] | null | null | null | import unittest
import netlas
from dotenv import dotenv_values
config = dotenv_values(".env")
class NetlasTests(unittest.TestCase):
DATATYPES = ['response', 'cert', 'domain']
RESPONSE_QUERIES = {'small': 'port:7001', 'empty': 'UIDY&Sdyh&*dhkjkljhas'}
CERT_QUERIES = {
'small': 'certificate.subje... | 32.836735 | 79 | 0.554071 |
9195f0e8440f3f2b6caff9172e94f7787f950513 | 4,441 | py | Python | star_bot/callbacks.py | lampholder/starbot | a58e5925b11861919871f6d2a34c8d191a981a84 | [
"Apache-2.0"
] | 1 | 2021-03-03T00:47:12.000Z | 2021-03-03T00:47:12.000Z | star_bot/callbacks.py | lampholder/starbot | a58e5925b11861919871f6d2a34c8d191a981a84 | [
"Apache-2.0"
] | null | null | null | star_bot/callbacks.py | lampholder/starbot | a58e5925b11861919871f6d2a34c8d191a981a84 | [
"Apache-2.0"
] | null | null | null | import logging
from nio import (
AsyncClient,
InviteMemberEvent,
JoinError,
MatrixRoom,
MegolmEvent,
RoomGetEventError,
RoomMessageText,
RoomSendResponse,
LocalProtocolError,
UnknownEvent,
)
from star_bot.bot_commands import Command
from star_bot.chat_functions import make_pill... | 33.900763 | 207 | 0.603918 |
9195f31d867d300b8d9eea2708bd9533ebac16cd | 4,882 | py | Python | src/pluto/ui/stitcher/views.py | shootsoft/PlutoVideoSnapshoter | 20eb4bc9d4eb6f090c713dce23077173d7ed8e5e | [
"Apache-2.0"
] | 22 | 2018-04-30T23:16:20.000Z | 2021-12-30T02:21:24.000Z | src/pluto/ui/stitcher/views.py | shootsoft/PlutoVidoeSnapshoter | 20eb4bc9d4eb6f090c713dce23077173d7ed8e5e | [
"Apache-2.0"
] | null | null | null | src/pluto/ui/stitcher/views.py | shootsoft/PlutoVidoeSnapshoter | 20eb4bc9d4eb6f090c713dce23077173d7ed8e5e | [
"Apache-2.0"
] | 6 | 2018-05-06T02:35:32.000Z | 2021-03-06T11:37:51.000Z | # -*- coding: utf-8 -*-
import os
from PyQt5.QtCore import QSize
from PyQt5.QtWidgets import (QAction, QMenu)
from pluto.ui.qt.mvc.views import View
from pluto.ui.stitcher.models import ViewModel
class ImageStitchingWindow(View):
def __init__(self):
super(ImageStitchingWindow, self).__init__(ui_file="ima... | 41.02521 | 102 | 0.645432 |
91960afab77016043c75c175cfbe54087cc9077d | 16,818 | py | Python | utils/spark.py | k-ayada/SparkPi | 4aeb549280eb36cb9fe773e9e33ade10c85e1084 | [
"Apache-2.0"
] | null | null | null | utils/spark.py | k-ayada/SparkPi | 4aeb549280eb36cb9fe773e9e33ade10c85e1084 | [
"Apache-2.0"
] | null | null | null | utils/spark.py | k-ayada/SparkPi | 4aeb549280eb36cb9fe773e9e33ade10c85e1084 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import sys, re, logging
from hdfs import Hdfs
from pyspark import SparkConf, SparkContext
from pyspark.sql import SparkSession, DataFrameWriter
from pyspark.sql.dataframe import DataFrame
from pyspark.storagelevel import StorageLevel
class Spark:
def __init__(self,log : R... | 43.911227 | 140 | 0.542157 |
91961d75b2a406e8ed4b3a993fbed6093d4866bd | 4,911 | py | Python | src/olympia/amo/tests/test_storage_utils.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 3 | 2020-03-05T18:17:14.000Z | 2020-03-09T01:24:38.000Z | src/olympia/amo/tests/test_storage_utils.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1,398 | 2020-10-08T06:32:26.000Z | 2022-03-31T12:06:24.000Z | src/olympia/amo/tests/test_storage_utils.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2020-06-04T10:18:59.000Z | 2020-06-04T10:18:59.000Z | import os
import tempfile
from functools import partial
from django.conf import settings
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage as storage
from django.utils.encoding import force_str
import pytest
from olympia.amo.storage_utils import (
copy_stored_f... | 34.829787 | 75 | 0.605376 |
91961ead12fd62fc2da2731112a59fce8d863fab | 6,209 | py | Python | ac2020/days/Day7.py | IstvanOri/adventofcode-2020 | 28c1203fd8f7e1863c8322e60161a32848d9a55b | [
"Apache-2.0"
] | null | null | null | ac2020/days/Day7.py | IstvanOri/adventofcode-2020 | 28c1203fd8f7e1863c8322e60161a32848d9a55b | [
"Apache-2.0"
] | null | null | null | ac2020/days/Day7.py | IstvanOri/adventofcode-2020 | 28c1203fd8f7e1863c8322e60161a32848d9a55b | [
"Apache-2.0"
] | null | null | null | import re
from ac2020.days import AbstractDay
class Day7(AbstractDay.AbstractDay):
"""
Advent of Code 2020 - Day 7
===========================
You land at the regional airport in time for your next flight. In fact, it looks like you'll even have time to
grab some food: all flights are currently ... | 44.992754 | 134 | 0.632952 |
91962d1d7e1caadac270b4c146fa388014862723 | 2,014 | py | Python | nova/tests/unit/virt/test_configdrive.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/tests/unit/virt/test_configdrive.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 132 | 2017-03-27T11:31:52.000Z | 2022-03-30T08:45:02.000Z | nova/tests/unit/virt/test_configdrive.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 8 | 2017-03-27T07:50:38.000Z | 2020-02-14T16:55:56.000Z | # Copyright 2014 IBM Corp.
#
# 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 agree... | 29.617647 | 78 | 0.642999 |
9196360457b0ed1dc44364686e8c73f6c779f288 | 680 | py | Python | vnpy/app/cta_stock/__init__.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | null | null | null | vnpy/app/cta_stock/__init__.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | null | null | null | vnpy/app/cta_stock/__init__.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | null | null | null | from pathlib import Path
from vnpy.trader.app import BaseApp
from .base import APP_NAME, StopOrder
from .engine import CtaEngine
from .template import (
Exchange,
Direction,
Offset,
Status,
Color,
Interval,
TickData,
BarData,
TradeData,
OrderData,
CtaPolicy,
StockPolic... | 19.428571 | 66 | 0.686765 |
91963b0f05f8288fbe19a58052cc8ec40050b007 | 4,025 | py | Python | commitcheck/checkers/gitchecker.py | adan/commitcheck | c7171cd860f8f0781a9db919230deafd3e3367dd | [
"MIT"
] | 2 | 2015-03-05T23:31:43.000Z | 2015-03-07T02:46:59.000Z | commitcheck/checkers/gitchecker.py | adan/commitcheck | c7171cd860f8f0781a9db919230deafd3e3367dd | [
"MIT"
] | null | null | null | commitcheck/checkers/gitchecker.py | adan/commitcheck | c7171cd860f8f0781a9db919230deafd3e3367dd | [
"MIT"
] | null | null | null | # Copyright (c) 2015 Xiaofan Li
# License: MIT
'''Git commit checking.'''
from __future__ import absolute_import, division, print_function, with_statement
import re
# Import git
try:
from git import Repo
from git.diff import Diffable
except ImportError:
# 'git' could not be found or is not GitPython (Re... | 37.616822 | 107 | 0.602733 |
919644dd68f7a0cfa53b8ba7abf43d129a64bc4d | 7,344 | py | Python | gheatae/tile.py | lehrblogger/where-do-you-go | 51c1fb3a66d8babe00a9412c72ebbd66fe348d88 | [
"MIT"
] | 20 | 2015-04-05T05:44:20.000Z | 2020-12-27T19:47:34.000Z | gheatae/tile.py | slachiewicz/where-do-you-go | 4e5c6c3b47866f4a8875a940fa6e889d0ae4ee7b | [
"MIT"
] | null | null | null | gheatae/tile.py | slachiewicz/where-do-you-go | 4e5c6c3b47866f4a8875a940fa6e889d0ae4ee7b | [
"MIT"
] | 4 | 2015-04-05T05:44:25.000Z | 2019-01-22T20:54:40.000Z | import constants
from gheatae import color_scheme, provider
from pngcanvas import PNGCanvas
from random import random, Random
import logging
import gmerc
import math
from models import UserInfo
from datetime import datetime
from google.appengine.api import users
log = logging.getLogger('space_level')
rdm... | 50.30137 | 234 | 0.653595 |
919652d2d32a77ee7995a9cb1d1f964f3b798671 | 23,909 | py | Python | tests/test_commands.py | PPAC37/vpype | 3aee1e4f769866e1a90456e0caa09010fc543fae | [
"MIT",
"BSD-3-Clause"
] | null | null | null | tests/test_commands.py | PPAC37/vpype | 3aee1e4f769866e1a90456e0caa09010fc543fae | [
"MIT",
"BSD-3-Clause"
] | null | null | null | tests/test_commands.py | PPAC37/vpype | 3aee1e4f769866e1a90456e0caa09010fc543fae | [
"MIT",
"BSD-3-Clause"
] | null | null | null | import itertools
from dataclasses import dataclass
import numpy as np
import pytest
import vpype as vp
import vpype_cli
from vpype_cli import DebugData, cli, execute, global_processor
from .utils import TESTS_DIRECTORY, execute_single_line
CM = 96 / 2.54
EXAMPLE_SVG = TESTS_DIRECTORY / "data" / "test_svg" / "svg_w... | 33.913475 | 95 | 0.626208 |
91965ca8735b9c63c644319a660cd029014a9718 | 1,976 | py | Python | examples/examples_query.py | vishalbelsare/pydmrs | 795b35dba4986fa9084eaa81fb16206cb131a752 | [
"MIT"
] | 14 | 2015-11-27T14:22:26.000Z | 2022-03-02T21:11:28.000Z | examples/examples_query.py | vishalbelsare/pydmrs | 795b35dba4986fa9084eaa81fb16206cb131a752 | [
"MIT"
] | 25 | 2015-11-27T16:08:19.000Z | 2019-08-28T10:13:06.000Z | examples/examples_query.py | vishalbelsare/pydmrs | 795b35dba4986fa9084eaa81fb16206cb131a752 | [
"MIT"
] | 8 | 2015-11-01T17:57:44.000Z | 2021-06-04T05:33:38.000Z | from pydmrs.pydelphin_interface import parse
from pydmrs.matching.query import dmrs_query
if __name__ == '__main__':
# basic functionality
dmrs_list = [parse('A mouse ate the whole cheese.')[0],
parse('Lions eat around 15 zebras per year.')[0],
parse('Their children eat so m... | 47.047619 | 101 | 0.640688 |
919678b3dcc3a27c7bbc55650beaa720eb095f61 | 7,407 | py | Python | app/tech_dict/sites/models.py | duoduo369/TechDict | 82fbac72f2dcb24f12d185ea43cc7a6b9887f53b | [
"MIT"
] | 1 | 2016-06-29T23:55:00.000Z | 2016-06-29T23:55:00.000Z | app/tech_dict/sites/models.py | duoduo369/TechDict | 82fbac72f2dcb24f12d185ea43cc7a6b9887f53b | [
"MIT"
] | null | null | null | app/tech_dict/sites/models.py | duoduo369/TechDict | 82fbac72f2dcb24f12d185ea43cc7a6b9887f53b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
import model_settings as config
MAX_LENGTH_20 = config.MAX_LENGTH_20
MAX_LENGTH_100 = config.MAX_LENGTH_100
MAX_LENGTH_200 = config.MAX_LENGTH_200
MAX_LENGTH_1024 = config.MAX_LENGTH_1024
ID_SUBJECT = config.ID_SUBJECT
class SiteRawData(models.Model):
'''
... | 23.81672 | 70 | 0.570271 |
919679b4fece3b864e7a6e580ceaf290ce3c22ec | 1,567 | py | Python | app/commands/loader.py | dbaelipro/coordination-dispo-lits | d252df23f570f6a83a5c6af36056ed5f2cf02fe0 | [
"MIT"
] | 2 | 2020-05-10T16:06:17.000Z | 2020-05-10T16:10:03.000Z | app/commands/loader.py | dbaelipro/coordination-dispo-lits | d252df23f570f6a83a5c6af36056ed5f2cf02fe0 | [
"MIT"
] | 8 | 2020-04-07T16:36:51.000Z | 2020-04-26T10:34:26.000Z | app/commands/loader.py | dbaelipro/coordination-dispo-lits | d252df23f570f6a83a5c6af36056ed5f2cf02fe0 | [
"MIT"
] | 4 | 2020-04-18T22:53:33.000Z | 2021-06-04T09:31:13.000Z | import os
from flask_script import Command, Option
from covidbed.util.loader import load_regions, load_finess_etablissements
from covidbed.repository.user import get_or_create_region, create_user
from covidbed.repository.orga import create_organization
import config
class LoadRegionsCommand(Command):
def run(se... | 29.018519 | 79 | 0.651563 |
9196ba67d31748c307497e6523f29ea259b01767 | 6,467 | py | Python | flowws_keras_geometry/viz/ParticleAttentionViewer.py | klarh/flowws-keras-geometry | f6768ff20fdbf85deacd234c116919219500ecbe | [
"MIT"
] | 2 | 2021-11-17T05:08:01.000Z | 2021-11-28T17:17:08.000Z | flowws_keras_geometry/viz/ParticleAttentionViewer.py | klarh/flowws-keras-geometry | f6768ff20fdbf85deacd234c116919219500ecbe | [
"MIT"
] | null | null | null | flowws_keras_geometry/viz/ParticleAttentionViewer.py | klarh/flowws-keras-geometry | f6768ff20fdbf85deacd234c116919219500ecbe | [
"MIT"
] | null | null | null | import collections
import itertools
import functools
import json
import flowws
from flowws import Argument as Arg
import keras_gtar
import numpy as np
LoadResult = collections.namedtuple(
'LoadResult', ['att_model', 'train_data', 'test_data', 'batch_size'])
@functools.lru_cache(maxsize=1)
def load_model(fname, p... | 38.957831 | 97 | 0.627957 |
9196f5473fbeedf0c981fe178851f643cf1978cb | 95 | py | Python | karabo/util/__init__.py | i4Ds/Karabo-Pipeline | c9a7f120b08b56af93bb953e284b33c107fd865c | [
"MIT"
] | null | null | null | karabo/util/__init__.py | i4Ds/Karabo-Pipeline | c9a7f120b08b56af93bb953e284b33c107fd865c | [
"MIT"
] | 42 | 2022-01-27T14:12:46.000Z | 2022-03-31T14:21:26.000Z | karabo/util/__init__.py | i4Ds/Karabo-Pipeline | c9a7f120b08b56af93bb953e284b33c107fd865c | [
"MIT"
] | null | null | null | from karabo.util.jupyter import set_rascil_data_directory_env
set_rascil_data_directory_env()
| 23.75 | 61 | 0.894737 |
9196fc0e90568649f18a473e9fc674b54bfe8b9e | 3,754 | py | Python | Google Kickstart/2020/Round C/problem2.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | Google Kickstart/2020/Round C/problem2.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | Google Kickstart/2020/Round C/problem2.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | import math
from collections import deque
from collections import defaultdict
class Vertex:
def __init__(self, val):
self.val = val
self.connections = defaultdict()
self.visited = False
self.color = 'white'
self.previous = None
self.distance = math.inf
self.... | 23.759494 | 60 | 0.554875 |
9197058f0168eba990683eea9da8f5ebf7f01423 | 997 | py | Python | tests/data/test_loader.py | shadowCow/algoTrading | 14f86cabd2f0a7e6321103de68d994e4ab93acf6 | [
"MIT"
] | null | null | null | tests/data/test_loader.py | shadowCow/algoTrading | 14f86cabd2f0a7e6321103de68d994e4ab93acf6 | [
"MIT"
] | 1 | 2018-06-11T18:49:40.000Z | 2018-06-11T18:49:40.000Z | tests/data/test_loader.py | shadowCow/algoTrading | 14f86cabd2f0a7e6321103de68d994e4ab93acf6 | [
"MIT"
] | null | null | null | import unittest
import os.path as path
from tests.context import algotrading
from algotrading.data.loader import load_data_file
from algotrading.data.loader import load_daily_data
from algotrading.data.markets import markets
class TestLoader(unittest.TestCase):
def test_load_data_file(self):
file_path =... | 28.485714 | 83 | 0.693079 |
919735898023bfce60ee4508b7e9cccf239fe0e5 | 10,619 | py | Python | services/text_filter/service.py | FirebirdSQL/saturnin-core | bf6c67acdf70a905da51651041d5ddf2fed0c59f | [
"MIT"
] | 1 | 2021-03-04T21:50:19.000Z | 2021-03-04T21:50:19.000Z | services/text_filter/service.py | FirebirdSQL/saturnin-core | bf6c67acdf70a905da51651041d5ddf2fed0c59f | [
"MIT"
] | null | null | null | services/text_filter/service.py | FirebirdSQL/saturnin-core | bf6c67acdf70a905da51651041d5ddf2fed0c59f | [
"MIT"
] | null | null | null | #coding:utf-8
#
# PROGRAM/MODULE: Saturnin microservices
# FILE: text_filter/service.py
# DESCRIPTION: Text line filter microservice
# CREATED: 18.12.2019
#
# The contents of this file are subject to the MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# o... | 46.574561 | 115 | 0.667859 |
9197719de3133455e1bfd7674fe606013b875232 | 3,198 | py | Python | experiments/ashvin/icml2020/hand/pen/phases/sac_bc1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/phases/sac_bc1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/phases/sac_bc1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
if __name__ == "__main__":
variant = dict(... | 28.553571 | 74 | 0.561601 |
919772cf90ec3d0529e7ecfe367753fa181aa5b5 | 15,017 | py | Python | toontown/toon/PlayerInfoPanel.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/toon/PlayerInfoPanel.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/toon/PlayerInfoPanel.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from pandac.PandaModules import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.showbase import DirectObject
from toontown.friends import FriendHandle
from otp.avatar import Avatar
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from... | 37.448878 | 95 | 0.572285 |
9197a824bd735988e32f6f6a36de6082d5c0d14e | 1,899 | py | Python | addon/pycThermopack/pyctp/tcPR.py | ibell/thermopack | dcec37ba9b38acd9a65dbb011483a16c2439706a | [
"MIT"
] | null | null | null | addon/pycThermopack/pyctp/tcPR.py | ibell/thermopack | dcec37ba9b38acd9a65dbb011483a16c2439706a | [
"MIT"
] | null | null | null | addon/pycThermopack/pyctp/tcPR.py | ibell/thermopack | dcec37ba9b38acd9a65dbb011483a16c2439706a | [
"MIT"
] | null | null | null | # Support for python2
from __future__ import print_function
# Import ctypes
from ctypes import *
# Importing Numpy (math, arrays, etc...)
import numpy as np
# Import platform to detect OS
from sys import platform, exit
# Import os utils
from os import path
# Import thermo
from . import thermo
# Import thermo
from . imp... | 29.671875 | 101 | 0.546603 |
9197aa709dfb9c9a21282944d4fa473e3850eb92 | 18,533 | py | Python | habitat/core/dataset.py | NicoGrande/habitat-api | baafd1c13c95043d4b31b910ffe4ecc1579dd75a | [
"MIT"
] | 15 | 2020-07-10T15:43:02.000Z | 2022-03-09T03:11:30.000Z | habitat/core/dataset.py | NicoGrande/habitat-api | baafd1c13c95043d4b31b910ffe4ecc1579dd75a | [
"MIT"
] | 2 | 2020-09-09T19:09:19.000Z | 2020-10-21T16:30:23.000Z | habitat/core/dataset.py | NicoGrande/habitat-api | baafd1c13c95043d4b31b910ffe4ecc1579dd75a | [
"MIT"
] | 1 | 2021-02-05T14:50:30.000Z | 2021-02-05T14:50:30.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
r"""Implements dataset functionality to be used ``habitat.EmbodiedTask``.
``habitat.core.dataset`` abstracts over a colle... | 35.571977 | 88 | 0.632493 |
9197d6798a6d40672ca4aa3785c135a162fbf308 | 219,593 | py | Python | ucscsdk/mometa/aaa/AaaSessionLR.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/aaa/AaaSessionLR.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/aaa/AaaSessionLR.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for AaaSessionLR ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class AaaSessionLRConsts():
CAUSE_A_FAILED = "a-failed"
CAUSE_ACTIVATE_ADAPTOR_NW_FW_LOCAL... | 51.974675 | 45,819 | 0.715041 |
9197d779c07bee16121d3f0db4f009223772b823 | 6,356 | py | Python | opennode/cli/helpers.py | opennode/opennode-tui | 1f92da5690a42ad71b1030c72db4b5a1158ab052 | [
"Apache-1.1"
] | 4 | 2015-05-21T20:21:26.000Z | 2020-12-18T06:50:06.000Z | opennode/cli/helpers.py | opennode/opennode-tui | 1f92da5690a42ad71b1030c72db4b5a1158ab052 | [
"Apache-1.1"
] | null | null | null | opennode/cli/helpers.py | opennode/opennode-tui | 1f92da5690a42ad71b1030c72db4b5a1158ab052 | [
"Apache-1.1"
] | 1 | 2016-02-08T00:43:44.000Z | 2016-02-08T00:43:44.000Z | import types
import re
from opennode.cli import actions
from snack import Textbox, Entry, Button, Listbox, Grid, Scale, Form
from snack import ButtonBar, TextboxReflowed, CheckboxTree, GridFormHelp
from snack import ButtonChoiceWindow, ListboxChoiceWindow
class DownloadMonitor():
def __init__(self, screen, tit... | 38.756098 | 100 | 0.599748 |
9197f58ee7879d93976758c1621cc6f21f7c1410 | 10,028 | py | Python | docs/conf.py | aptivate/cookiecutter | a68e7f8e0b1700f44d9cc4a16eedea761ffb9154 | [
"BSD-3-Clause"
] | 2 | 2015-10-04T03:20:02.000Z | 2015-11-08T13:07:57.000Z | docs/conf.py | aptivate/cookiecutter | a68e7f8e0b1700f44d9cc4a16eedea761ffb9154 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | aptivate/cookiecutter | a68e7f8e0b1700f44d9cc4a16eedea761ffb9154 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# cookiecutter documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 11 11:31:49 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | 31.534591 | 193 | 0.718987 |
91980a6cc628e6f98b01473adb0645455b19c506 | 17,198 | py | Python | ml-agents/mlagents/trainers/tests/test_ppo.py | choyai/ml-agents | dfe9c11518f1de73f36bf85c36477372481e1598 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/tests/test_ppo.py | choyai/ml-agents | dfe9c11518f1de73f36bf85c36477372481e1598 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/tests/test_ppo.py | choyai/ml-agents | dfe9c11518f1de73f36bf85c36477372481e1598 | [
"Apache-2.0"
] | null | null | null | import unittest.mock as mock
import pytest
import numpy as np
from mlagents.tf_utils import tf
import yaml
from mlagents.trainers.ppo.models import PPOModel
from mlagents.trainers.ppo.trainer import PPOTrainer, discount_rewards
from mlagents.trainers.ppo.policy import PPOPolicy
from mlagents.trainers.brain import Br... | 34.123016 | 88 | 0.627108 |
91981429c4255ab8922266ac2443011abf490e5d | 359 | py | Python | hueclient/models/bridge.py | adamcharnock/python-hue-client | e5ba6de8f4b979e108c4451cfc5d65f0046184ac | [
"MIT"
] | 10 | 2015-11-04T12:43:21.000Z | 2022-01-02T19:13:32.000Z | hueclient/models/bridge.py | adamcharnock/python-hue-client | e5ba6de8f4b979e108c4451cfc5d65f0046184ac | [
"MIT"
] | 1 | 2016-01-10T23:02:45.000Z | 2016-01-15T15:38:49.000Z | hueclient/models/bridge.py | adamcharnock/python-hue-client | e5ba6de8f4b979e108c4451cfc5d65f0046184ac | [
"MIT"
] | 1 | 2019-10-29T01:26:08.000Z | 2019-10-29T01:26:08.000Z | from repose.resources import Resource
from hueclient import fields
from hueclient.decoders import IndexedByIdDecoder
from hueclient.models.light import Light
from hueclient.monitor import MonitorMixin
class Bridge(MonitorMixin, Resource):
lights = fields.ManagedCollection(Light, decoders=[IndexedByIdDecoder()])
... | 27.615385 | 77 | 0.791086 |
919843a73a51669515a52fc2624823578ad65326 | 448 | py | Python | run_scrapy_commands.py | fioan89/Price-Cutdown | eca90719f8b7016011cd2c7cdcb3dec4701adbc5 | [
"MIT"
] | null | null | null | run_scrapy_commands.py | fioan89/Price-Cutdown | eca90719f8b7016011cd2c7cdcb3dec4701adbc5 | [
"MIT"
] | null | null | null | run_scrapy_commands.py | fioan89/Price-Cutdown | eca90719f8b7016011cd2c7cdcb3dec4701adbc5 | [
"MIT"
] | null | null | null | __author__ = 'fauri'
import sys
import os
import re
from scrapy.cmdline import execute
# this script is here just to get rid of scrapy crawl command during debuging
# with this I can simply start the process via an IDE (like PyCharm) and then enable breakpoints in my code
# os.environ['http_proxy'] = "proxy.corp.net... | 28 | 107 | 0.707589 |
91987353dd5034dd5686956bfabd2c140a9ec879 | 1,632 | py | Python | marqeta/response_models/ach_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 21 | 2019-04-12T09:02:17.000Z | 2022-02-18T11:39:06.000Z | marqeta/response_models/ach_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 1 | 2020-07-22T21:27:40.000Z | 2020-07-23T17:38:43.000Z | marqeta/response_models/ach_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 10 | 2019-05-08T14:20:37.000Z | 2021-09-20T18:09:26.000Z | from datetime import datetime, date
from marqeta.response_models import datetime_object
import json
import re
class AchModel(object):
def __init__(self, json_response):
self.json_response = json_response
def __str__(self):
return json.dumps(self.json_response, default=self.json_serial)
@... | 23.652174 | 79 | 0.6875 |
91987d6621f91a4d4bc145cf5a020097d54e2f92 | 210 | py | Python | servers/python/coweb/updater/__init__.py | opencoweb/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 83 | 2015-01-05T19:02:57.000Z | 2021-11-19T02:48:09.000Z | servers/python/coweb/updater/__init__.py | xuelingxiao/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 3 | 2015-12-16T13:49:33.000Z | 2019-06-17T13:38:50.000Z | servers/python/coweb/updater/__init__.py | xuelingxiao/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 14 | 2015-04-29T22:36:53.000Z | 2021-11-18T03:24:29.000Z | '''
Updater Type Matcher extension point
Copyright (c) The Dojo Foundation 2011. All Rights Reserved.
Copyright (c) IBM Corporation 2008, 2011. All Rights Reserved.
'''
from .base import UpdaterTypeMatcherBase
| 30 | 62 | 0.785714 |
9198cc6a095ae80707c292c1674053a3d033e410 | 48,476 | py | Python | common/utils.py | kbardool/CarND-Advanced-Lane-Lines | 2c3a0b4c1623c4e303b3833c166627a56c260d71 | [
"MIT"
] | null | null | null | common/utils.py | kbardool/CarND-Advanced-Lane-Lines | 2c3a0b4c1623c4e303b3833c166627a56c260d71 | [
"MIT"
] | null | null | null | common/utils.py | kbardool/CarND-Advanced-Lane-Lines | 2c3a0b4c1623c4e303b3833c166627a56c260d71 | [
"MIT"
] | null | null | null | import sys,os, pprint
if '..' not in sys.path:
print("utils.py: appending '..' to sys.path")
sys.path.append('..')
import numpy as np
import cv2
import glob
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
from matplotlib import colors
import pickle
import pprint
import collections
pp = pp... | 46.079848 | 157 | 0.603495 |
9198e4772371713c348ab6cace178eb57448cc44 | 148,728 | py | Python | test/mapping/phmrc_adult_mapping.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-23T12:57:47.000Z | 2020-04-18T17:13:08.000Z | test/mapping/phmrc_adult_mapping.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-09T22:10:07.000Z | 2022-02-16T04:57:06.000Z | test/mapping/phmrc_adult_mapping.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 11 | 2018-12-11T22:01:13.000Z | 2022-01-07T11:38:02.000Z | MAPPING = [
{
'sid': 'History of asthma',
'symptom': 's1',
'adult_1_1a': 1
},
{
'sid': 'History of arthritis',
'symptom': 's2',
'adult_1_1b': 1
},
{
'sid': 'History of cancer',
'symptom': 's3',
'adult_1_1c': 1
},
{
... | 24.950176 | 82 | 0.454736 |
9198ef948750fcef4f50f5e8ed1eaadaf4263781 | 2,188 | py | Python | tests/test_type_parser.py | decorator-factory/python-fnl | 20db64d5f983c002846df125c55080a62e1b577e | [
"MIT"
] | null | null | null | tests/test_type_parser.py | decorator-factory/python-fnl | 20db64d5f983c002846df125c55080a62e1b577e | [
"MIT"
] | null | null | null | tests/test_type_parser.py | decorator-factory/python-fnl | 20db64d5f983c002846df125c55080a62e1b577e | [
"MIT"
] | null | null | null | import fnl
def test_primitive_types():
assert fnl.type_parser.parse("int") == fnl.et.TInt()
assert fnl.type_parser.parse("str") == fnl.et.TStr()
assert fnl.type_parser.parse("inline") == fnl.et.TInline()
assert fnl.type_parser.parse("block") == fnl.et.TBlock()
assert fnl.type_parser.parse("any") =... | 28.789474 | 91 | 0.59872 |
91995a70dcb7db85ad59b969f13c24e1992b68dd | 4,169 | py | Python | tracopt/mimeview/php.py | CoRfr/trac | 31509d77aa7cd3c6c0057a607313ceaed1f7a20b | [
"BSD-3-Clause"
] | 1 | 2017-08-03T07:04:28.000Z | 2017-08-03T07:04:28.000Z | tracopt/mimeview/php.py | CoRfr/trac | 31509d77aa7cd3c6c0057a607313ceaed1f7a20b | [
"BSD-3-Clause"
] | null | null | null | tracopt/mimeview/php.py | CoRfr/trac | 31509d77aa7cd3c6c0057a607313ceaed1f7a20b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2013 Edgewall Software
# Copyright (C) 2005 Christian Boos <cboos@bct-technology.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of th... | 37.223214 | 74 | 0.610458 |
91997b2fd401b50e262d307f37592dcc72e46b7e | 26,219 | py | Python | app/celery/tasks.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | null | null | null | app/celery/tasks.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | null | null | null | app/celery/tasks.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | null | null | null | import json
from collections import defaultdict, namedtuple
from datetime import datetime
from flask import current_app
from notifications_utils.columns import Columns
from notifications_utils.postal_address import PostalAddress
from notifications_utils.recipients import RecipientCSV
from notifications_utils.statsd_de... | 38.842963 | 120 | 0.70365 |
91999fe3e714869a35abb7e57a810bde59c0d16e | 76,501 | py | Python | stix2elevator/convert_pattern.py | hanymorcos/cti-stix-elevator | 3a5b5f2f4ba333dfda49f52fb7db2e8fb01fb952 | [
"BSD-3-Clause"
] | null | null | null | stix2elevator/convert_pattern.py | hanymorcos/cti-stix-elevator | 3a5b5f2f4ba333dfda49f52fb7db2e8fb01fb952 | [
"BSD-3-Clause"
] | null | null | null | stix2elevator/convert_pattern.py | hanymorcos/cti-stix-elevator | 3a5b5f2f4ba333dfda49f52fb7db2e8fb01fb952 | [
"BSD-3-Clause"
] | null | null | null | import datetime
import re
import sys
from cybox.objects.account_object import Account
from cybox.objects.address_object import Address
from cybox.objects.archive_file_object import ArchiveFile
from cybox.objects.domain_name_object import DomainName
from cybox.objects.email_message_object import EmailMessage
from cybox... | 44.947709 | 133 | 0.642345 |
9199b8b35c63c65b9827a3ad3e506ada74647fc5 | 939 | py | Python | component/io/parc_io.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | component/io/parc_io.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | component/io/parc_io.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | import json
from .gwb_io import GWBIo
from component import parameter as cp
class ParcIo(GWBIo):
def __init__(self):
# the init file
self.file = None
# the process
self.connectivity = cp.connectivity[0]['value']
self.res = None
self.threshol... | 26.083333 | 71 | 0.580405 |
9199cda618bb5e6fe9b3e8df28e275ab195d1395 | 4,908 | py | Python | Arthemis/DataManager.py | AlexandruRusu23/Rufus | 7e4f27cd4bae46a1d72c6aaaf95ca972cb7ac466 | [
"MIT"
] | null | null | null | Arthemis/DataManager.py | AlexandruRusu23/Rufus | 7e4f27cd4bae46a1d72c6aaaf95ca972cb7ac466 | [
"MIT"
] | null | null | null | Arthemis/DataManager.py | AlexandruRusu23/Rufus | 7e4f27cd4bae46a1d72c6aaaf95ca972cb7ac466 | [
"MIT"
] | null | null | null | """
Data Manager module
"""
import threading
import time
import Queue
import ScannerDataProvider
import DatabaseManager
import ResourceProvider
RESOURCE_PROVIDER = ResourceProvider.ResourceProvider()
class DataManager(threading.Thread):
"""
Data Manager class
"""
def __init__(self):
threading... | 35.565217 | 83 | 0.594947 |
9199dc6f5d525767590f74a000309d86caea4af7 | 49,218 | py | Python | zerver/tests/test_events.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_events.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_events.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from typing import Any, Callable, Optional
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.test import TestCase
from zerver.models import (
get_client, get_realm_by_string_id, get_stream, get_user_profile... | 43.060367 | 134 | 0.56205 |
919a2c4f1878436ac2f2475e052762fc1eac9c2a | 3,687 | py | Python | setup.py | toscawidgets/tw2.core | 2fe87fc7ba39aa1f6a6a63fd262ed7264dd98bcd | [
"MIT"
] | 6 | 2015-01-20T13:45:24.000Z | 2022-01-04T18:41:55.000Z | setup.py | toscawidgets/tw2.core | 2fe87fc7ba39aa1f6a6a63fd262ed7264dd98bcd | [
"MIT"
] | 14 | 2015-07-13T20:20:41.000Z | 2021-10-11T23:59:01.000Z | setup.py | toscawidgets/tw2.core | 2fe87fc7ba39aa1f6a6a63fd262ed7264dd98bcd | [
"MIT"
] | 5 | 2015-06-10T06:44:56.000Z | 2018-05-16T17:36:07.000Z | """Setuptools setup file"""
import sys
import os
import logging
from setuptools import setup
# Ridiculous as it may seem, we need to import multiprocessing and logging here
# in order to get tests to pass smoothly on python 2.7.
try:
import multiprocessing
import logging
except:
pass
def get_descriptio... | 28.145038 | 90 | 0.636561 |
919a8422dbcb274489275d32f285737c9439964f | 3,857 | py | Python | ml_libraries/supervised/knn.py | jburs/ml_libraries | 0a78a7c7d9bc162227fbbe37051e02be8e2ba86e | [
"MIT"
] | null | null | null | ml_libraries/supervised/knn.py | jburs/ml_libraries | 0a78a7c7d9bc162227fbbe37051e02be8e2ba86e | [
"MIT"
] | null | null | null | ml_libraries/supervised/knn.py | jburs/ml_libraries | 0a78a7c7d9bc162227fbbe37051e02be8e2ba86e | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from statistics import mode
a = [1,3,3,5,2,1,9,7,8,6,9,10]
b = [2,3,3,2,1,1,8,9,9,7,8,10]
group = [1,1,1,1,1,1,2,2,2,2,2,2]
c = [2,5,7,9,6,5,6,5]
d = [2,9,2,10,6,5,5,6]
df = pd.DataFrame(list(zip(a,b,group)), columns = ['a', 'b', 'group'])
df_cla... | 37.813725 | 133 | 0.633912 |
919ae8788f4dab1338ddb97447b7f0f3885f038f | 12,879 | py | Python | tests/test_integration.py | caltech-netlab/gym-acnportal | cacd2e4aa9159a3bf7f0b8e3db2dbb0832d76e46 | [
"BSD-3-Clause"
] | null | null | null | tests/test_integration.py | caltech-netlab/gym-acnportal | cacd2e4aa9159a3bf7f0b8e3db2dbb0832d76e46 | [
"BSD-3-Clause"
] | 3 | 2021-04-28T14:43:32.000Z | 2021-04-28T14:58:04.000Z | tests/test_integration.py | sunash/gym-acnportal | cacd2e4aa9159a3bf7f0b8e3db2dbb0832d76e46 | [
"BSD-3-Clause"
] | 1 | 2020-05-12T19:13:51.000Z | 2020-05-12T19:13:51.000Z | # coding=utf-8
"""
Integration tests using gym_acnsim.
"""
# TODO: This test suite copies a lot of code from acnportal as the tests
# module isn't part of acnportal. Maybe put integration tests in a
# different repo?
import json
import os
from copy import deepcopy
from datetime import datetime
from typing import Dict... | 36.381356 | 88 | 0.617517 |
919af66528783f2a67e6aa10b4c53790da5bdce3 | 6,360 | py | Python | python/chronos/src/bigdl/chronos/forecaster/seq2seq_forecaster.py | sgwhat/BigDL | 25b402666fbb26b0bc18fc8100e9a00469844778 | [
"Apache-2.0"
] | null | null | null | python/chronos/src/bigdl/chronos/forecaster/seq2seq_forecaster.py | sgwhat/BigDL | 25b402666fbb26b0bc18fc8100e9a00469844778 | [
"Apache-2.0"
] | null | null | null | python/chronos/src/bigdl/chronos/forecaster/seq2seq_forecaster.py | sgwhat/BigDL | 25b402666fbb26b0bc18fc8100e9a00469844778 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 42.684564 | 94 | 0.596698 |
919b14854402e8b9a4e0c50b32eed2a4b2def99d | 1,583 | py | Python | setup_competition.py | JakeRoggenbuck/server-public | 2b8268ec2e5def508ea8a2d5b1bd1b521a3ccb5b | [
"MIT"
] | 1 | 2020-12-02T19:30:47.000Z | 2020-12-02T19:30:47.000Z | setup_competition.py | JakeRoggenbuck/server-public | 2b8268ec2e5def508ea8a2d5b1bd1b521a3ccb5b | [
"MIT"
] | null | null | null | setup_competition.py | JakeRoggenbuck/server-public | 2b8268ec2e5def508ea8a2d5b1bd1b521a3ccb5b | [
"MIT"
] | 1 | 2020-04-15T17:40:08.000Z | 2020-04-15T17:40:08.000Z | #!/usr/bin/env python3
# Copyright (c) 2019 FRC Team 1678: Citrus Circuits
"""Sets up the MongoDB document for a competition, should be run before every competition."""
# External imports
import re
from pymongo import MongoClient
# Internal imports
import cloud_database_communicator
import local_database_communicator
i... | 46.558824 | 96 | 0.802906 |
919b18b691d65e294172ec25b90572bfc943896e | 17,265 | py | Python | scripts/Rotation/lambda_separate.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | scripts/Rotation/lambda_separate.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | scripts/Rotation/lambda_separate.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | """
MODIFICATIONS
2015.12.03
final_gal is removed as non-main-progenitors are also analized,
there is no 1:1 correlation between final galaxies and earlier galaxies.
2015.12.21
Galaxies are saved in HDF format at selected nouts.
(for example,
nouts_d... | 36.043841 | 102 | 0.492268 |
919b3d30123d2e1e7e3039f361667376b2113851 | 3,402 | py | Python | mythril/ether/soliditycontract.py | tintinweb/mythril | 88873206d1311c02ca95c685209060b0584f4d79 | [
"MIT"
] | null | null | null | mythril/ether/soliditycontract.py | tintinweb/mythril | 88873206d1311c02ca95c685209060b0584f4d79 | [
"MIT"
] | null | null | null | mythril/ether/soliditycontract.py | tintinweb/mythril | 88873206d1311c02ca95c685209060b0584f4d79 | [
"MIT"
] | null | null | null | import mythril.laser.ethereum.util as helper
from mythril.ether.ethcontract import ETHContract
from mythril.ether.util import *
from mythril.exceptions import NoContractFoundError
class SourceMapping:
def __init__(self, solidity_file_idx, offset, length, lineno):
self.solidity_file_idx = solidity_file_idx... | 30.927273 | 92 | 0.591123 |
919b3e06f8034d06d078f8c26876f9972ad7eca8 | 11,383 | py | Python | src/dataset.py | abhinavbh08/NNTI-WS2021-NLP-Project | 946cfdcb0e0e64969d12423fa1b26dad3cb2d417 | [
"MIT"
] | null | null | null | src/dataset.py | abhinavbh08/NNTI-WS2021-NLP-Project | 946cfdcb0e0e64969d12423fa1b26dad3cb2d417 | [
"MIT"
] | null | null | null | src/dataset.py | abhinavbh08/NNTI-WS2021-NLP-Project | 946cfdcb0e0e64969d12423fa1b26dad3cb2d417 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from collections import Counter
import re
import torch
from torch.utils.data import DataLoader, Dataset
def read_dataset_hindi(file_path):
"""Read the dataset from the file path, converts it into a dataframe and converts the ... | 36.022152 | 152 | 0.737152 |
919b414820af64819784a488666248c1e4d9aaba | 811 | py | Python | distil_ui/default/panel.py | openstacker/distil-ui | a0452b11ee92f71d046f445025f4387d15e890ba | [
"Apache-2.0"
] | null | null | null | distil_ui/default/panel.py | openstacker/distil-ui | a0452b11ee92f71d046f445025f4387d15e890ba | [
"Apache-2.0"
] | null | null | null | distil_ui/default/panel.py | openstacker/distil-ui | a0452b11ee92f71d046f445025f4387d15e890ba | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Catalyst IT 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 in writ... | 32.44 | 74 | 0.752158 |
919b66b7810ad4f7024e0a1b840d3600f5c09bdc | 2,169 | py | Python | data/transcoder_evaluation_gfg/python/MINIMUM_LENGTH_SUBARRAY_SUM_GREATER_GIVEN_VALUE.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/MINIMUM_LENGTH_SUBARRAY_SUM_GREATER_GIVEN_VALUE.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/MINIMUM_LENGTH_SUBARRAY_SUM_GREATER_GIVEN_VALUE.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-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.
#
def f_gold ( arr , n , x ) :
curr_sum = 0
min_len = n + 1
start = 0
end = 0
while ( end < n ) :
whil... | 50.44186 | 222 | 0.467958 |
919b6d45b85c90e6109263901f78ddf593730234 | 5,485 | py | Python | spectrl/util/rl.py | luigiberducci/dirl | 5f7997aea20dfb7347ebdee66de9bea4e6cd3c62 | [
"MIT"
] | null | null | null | spectrl/util/rl.py | luigiberducci/dirl | 5f7997aea20dfb7347ebdee66de9bea4e6cd3c62 | [
"MIT"
] | null | null | null | spectrl/util/rl.py | luigiberducci/dirl | 5f7997aea20dfb7347ebdee66de9bea4e6cd3c62 | [
"MIT"
] | null | null | null | import numpy as np
import gym
class RandomPolicy:
'''
Policy that takes random actions
Parameters:
action_dim : int
action_bound : float (bound on absolute value of each component)
'''
def __init__(self, action_dim, action_bound):
self.action_dim = action_dim
self... | 30.472222 | 91 | 0.61495 |
919b7df5658e2172f39f59a32d0d6fad7be3b24a | 2,739 | py | Python | venv/Lib/site-packages/pyrogram/types/inline_mode/inline_query_result.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/types/inline_mode/inline_query_result.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/types/inline_mode/inline_query_result.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 38.041667 | 75 | 0.722526 |
919b86f67ef62b12a44020bf9b21e945da73c84e | 16,140 | py | Python | First_tests.py | jason-neal/Efficiency-tests | 64bcec8213876a15ab278c4af328357bcdc126c9 | [
"MIT"
] | null | null | null | First_tests.py | jason-neal/Efficiency-tests | 64bcec8213876a15ab278c4af328357bcdc126c9 | [
"MIT"
] | null | null | null | First_tests.py | jason-neal/Efficiency-tests | 64bcec8213876a15ab278c4af328357bcdc126c9 | [
"MIT"
] | null | null | null |
# coding: utf-8
# # Testing Python Efficiency:
#
# To determine fasted methods to apply sections of code.
#
# I.e. test using numpy arrays indexing, broadcasting etc comapred to my written functions and compreshnsion lists.
#
# Also test overhead of converting to and from lists.
# In[1]:
import numpy as np
# #... | 27.684391 | 144 | 0.671809 |
919b9387243353fd3f49c2cee9e1146f51155ce8 | 4,596 | py | Python | deepdoctection/extern/tp/tpfrcnn/utils/np_box_ops.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 39 | 2021-12-14T11:05:25.000Z | 2022-03-31T18:50:58.000Z | deepdoctection/extern/tp/tpfrcnn/utils/np_box_ops.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 17 | 2022-01-04T14:32:26.000Z | 2022-03-29T14:01:36.000Z | deepdoctection/extern/tp/tpfrcnn/utils/np_box_ops.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 4 | 2022-01-11T16:40:17.000Z | 2022-03-30T02:09:55.000Z | # -*- coding: utf-8 -*-
# File: box_ops.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | 32.828571 | 95 | 0.654917 |
919b97899d4377e2ca7f81fb5af6b5793e42a286 | 5,274 | py | Python | src/rxn_network/network/gt.py | GENESIS-EFRC/reaction-network | 1482ac1b6b550a5bc9961e9210e33c86c07f64cf | [
"BSD-3-Clause-LBNL"
] | 29 | 2020-08-04T07:07:04.000Z | 2022-02-22T22:09:20.000Z | src/rxn_network/network/gt.py | GENESIS-EFRC/reaction-network | 1482ac1b6b550a5bc9961e9210e33c86c07f64cf | [
"BSD-3-Clause-LBNL"
] | 70 | 2021-02-22T07:01:40.000Z | 2022-03-31T20:11:56.000Z | src/rxn_network/network/gt.py | GENESIS-EFRC/reaction-network | 1482ac1b6b550a5bc9961e9210e33c86c07f64cf | [
"BSD-3-Clause-LBNL"
] | 3 | 2021-04-20T09:29:39.000Z | 2022-02-02T17:43:52.000Z | """
Graph-related functions specific to the graph-tool library. Used in the network module.
"""
from queue import Empty, PriorityQueue
from typing import Dict
from graph_tool import Graph, GraphView, Vertex
from graph_tool.topology import shortest_path
DEFAULT_VERTEX_PROPS = {"entry": "object", "type": "int"}
DEFAUL... | 29.629213 | 87 | 0.594425 |
919c208a450ccf9fd13326c1489c5cd510644c77 | 849 | py | Python | salt/modules/temp.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/modules/temp.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/modules/temp.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Simple module for creating temporary directories and files
This is a thin wrapper around Pythons tempfile module
.. versionadded:: Beryllium
'''
from __future__ import absolute_import
import logging
import tempfile
log = logging.getLogger(__name__)
def dir(suffix='', prefix='tmp', par... | 19.295455 | 62 | 0.639576 |
919c35e0b9bb9f3015746d9849ac2a55287fdc03 | 4,068 | py | Python | src/djangoflash/middleware.py | duct-tape/django-flash | ce77d3ca3d6823068984f898c3b44e2fef0beb8b | [
"BSD-3-Clause"
] | null | null | null | src/djangoflash/middleware.py | duct-tape/django-flash | ce77d3ca3d6823068984f898c3b44e2fef0beb8b | [
"BSD-3-Clause"
] | null | null | null | src/djangoflash/middleware.py | duct-tape/django-flash | ce77d3ca3d6823068984f898c3b44e2fef0beb8b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This module provides the :class:`FlashMiddleware` class, which manages the
*flash* whenever a HTTP request hits the server.
To plug this middleware to your Django project, edit your project's
``settings.py`` file as follows::
MIDDLEWARE_CLASSES = (
'djangoflash.middleware.Flas... | 31.78125 | 79 | 0.694444 |
919c46e4b60fc8b25c57c4a07a9f95428bd23176 | 1,974 | py | Python | launchpad/launch/run_locally/launch_local_xterm.py | qstanczyk/launchpad | 32888acfcc8da86a31bf799db19832ccd4573e73 | [
"Apache-2.0"
] | 264 | 2021-04-22T12:55:07.000Z | 2022-03-26T05:55:13.000Z | launchpad/launch/run_locally/launch_local_xterm.py | qstanczyk/launchpad | 32888acfcc8da86a31bf799db19832ccd4573e73 | [
"Apache-2.0"
] | 22 | 2021-04-22T18:00:13.000Z | 2022-03-30T01:45:08.000Z | launchpad/launch/run_locally/launch_local_xterm.py | qstanczyk/launchpad | 32888acfcc8da86a31bf799db19832ccd4573e73 | [
"Apache-2.0"
] | 21 | 2021-04-22T19:20:28.000Z | 2022-03-16T05:36:27.000Z | # Lint as: python3
# Copyright 2020 DeepMind Technologies Limited. 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
#
# ... | 32.360656 | 78 | 0.721884 |
919c6ff178e2cd4b695dafc1fe2c59aa1675a2e8 | 2,781 | py | Python | sim/mock_devices/mock_quantum_dot.py | microsoft/nanotune | 68be8f5b74a52d57b74ccac228e120d9ab48e3e4 | [
"MIT"
] | 5 | 2021-02-24T14:32:37.000Z | 2022-01-05T16:37:26.000Z | sim/mock_devices/mock_quantum_dot.py | microsoft/nanotune | 68be8f5b74a52d57b74ccac228e120d9ab48e3e4 | [
"MIT"
] | 149 | 2021-03-23T14:44:39.000Z | 2022-03-31T06:09:07.000Z | sim/mock_devices/mock_quantum_dot.py | LaudateCorpus1/nanotune | 0ada354597b16f6dbb17ca7be01ab7668b6d5049 | [
"MIT"
] | 10 | 2021-03-29T13:36:38.000Z | 2022-02-16T23:06:35.000Z | """ Defines mock quantum dot devices"""
# pylint: disable=too-many-arguments, too-many-locals
from typing import Mapping, Sequence
from .mock_device import MockDevice
from .mock_pin import MockPin
from sim.mock_pin import IMockPin
# pylint: enable=too-few-public-methods
class MockSingleQuantumDot(MockDevice):
"... | 23.769231 | 70 | 0.553398 |
919c789d9d8595d834dca2e3a7a1746e6b81bd7f | 6,881 | py | Python | data/level/level1050.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | null | null | null | data/level/level1050.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 6 | 2020-07-04T02:53:08.000Z | 2022-03-11T23:53:14.000Z | data/level/level1050.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 3 | 2019-12-31T11:42:59.000Z | 2021-03-28T20:06:13.000Z | data = {
'level_index': 1050,
'move_count': 28,
'fall_ratio': 0,
'board_info': {
(0, 0): {
'prev': (0, 1),
'next': (0, -1),
'bg_number': 41,
'base': (2, 1)
},
(0, 1): {
'prev': (0, 1),
'next': (0, -1),
... | 22.560656 | 34 | 0.197936 |
919cc6079f6007bba62696af423d65b47d6b195a | 7,694 | py | Python | collections/ansible_collections/ansible/tower/plugins/inventory/tower.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/ansible/tower/plugins/inventory/tower.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/ansible/tower/plugins/inventory/tower.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | 2 | 2021-03-30T14:26:02.000Z | 2021-04-01T18:17:29.000Z | # Copyright (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: tower
plugin_type: inventory
author:
- Matthew Jones (@matburt)
- Yun... | 43.965714 | 117 | 0.690018 |
919cc6ca2c4fb1a85261cd2c34b4781de719c91d | 3,654 | py | Python | alipay/aop/api/domain/TaskOperationLog.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/TaskOperationLog.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/TaskOperationLog.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class TaskOperationLog(object):
def __init__(self):
self._gmt_opration = None
self._operation_desc = None
self._operation_memo = None
self._operation_type = None
... | 31.5 | 79 | 0.616311 |
919d624f9d750e55990a991334c35adda30e94c6 | 294 | py | Python | publication_backbone/admin/__init__.py | Excentrics/publication-backbone | 65c9820308b09a6ae1086c265f8d49e36f3724b9 | [
"BSD-3-Clause"
] | 6 | 2016-05-19T14:59:51.000Z | 2020-03-19T10:08:29.000Z | publication_backbone/admin/__init__.py | Excentrics/publication-backbone | 65c9820308b09a6ae1086c265f8d49e36f3724b9 | [
"BSD-3-Clause"
] | null | null | null | publication_backbone/admin/__init__.py | Excentrics/publication-backbone | 65c9820308b09a6ae1086c265f8d49e36f3724b9 | [
"BSD-3-Clause"
] | null | null | null | #-*- coding: utf-8 -*-
import categoryadmin
import rubricatoradmin
import publicationadmin
import modelcloneadmin
import changerubrictypeadmin
import publicationgroupadmin
import configadmin
import staticplaceholderadmin
# Not work
#import publication_detail_template_admin
#import styles_admin | 24.5 | 41 | 0.870748 |
919d892d49511b54b1c39d471cafcd1939a8acca | 1,275 | py | Python | pyclopedia/p02_ref/p03_objective_oriented/p05_staticmethod_classmethod.py | MacHu-GWU/pyclopedia-project | c6ee156eb40bc5a4ac5f51aa735b6fd004cb68ee | [
"MIT"
] | null | null | null | pyclopedia/p02_ref/p03_objective_oriented/p05_staticmethod_classmethod.py | MacHu-GWU/pyclopedia-project | c6ee156eb40bc5a4ac5f51aa735b6fd004cb68ee | [
"MIT"
] | null | null | null | pyclopedia/p02_ref/p03_objective_oriented/p05_staticmethod_classmethod.py | MacHu-GWU/pyclopedia-project | c6ee156eb40bc5a4ac5f51aa735b6fd004cb68ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Static Method and Class Method
==============================================================================
- Static method always take the instance it self as first argument.
- Class method always take the Class of the instance as first argument.
"""
class Calcula... | 25.5 | 78 | 0.609412 |
919d9c26631de4e41b3314e08a2b46deaa3cb2c1 | 839 | py | Python | atom/nucleus/python/test/test_audit_log.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_audit_log.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_audit_log.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.5
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nucleus_api
from nu... | 20.463415 | 79 | 0.686532 |
919d9c268a192219fc423e8ac195406b00c577e6 | 754 | py | Python | python/l0807.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | python/l0807.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | python/l0807.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | class Solution:
def maxIncreaseKeepingSkyline(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
num_row, num_column = len(grid), len(grid[0])
max_row, max_column = [0] * num_row, [0] * num_column
solution = 0
for i in range(num_row):
... | 32.782609 | 71 | 0.534483 |
919dd13d7a536fee9263467b962d5dc6c4872dfa | 26,672 | py | Python | salt/daemons/flo/core.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/daemons/flo/core.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/daemons/flo/core.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
The core behaviors used by minion and master
'''
# pylint: disable=W0232
# Import python libs
import os
import sys
import types
import logging
import multiprocessing
import traceback
import itertools
from collections import deque
# Import salt libs
import salt.daemons.masterapi
import salt... | 32.806888 | 93 | 0.520733 |
919dd9857b30a19741b49412737a80aa450f7c6d | 3,259 | py | Python | src/schemathesis/cli/callbacks.py | chr1st1ank/schemathesis | f2e160d56c1fdce9eac7fee5875b209c8944f54a | [
"MIT"
] | null | null | null | src/schemathesis/cli/callbacks.py | chr1st1ank/schemathesis | f2e160d56c1fdce9eac7fee5875b209c8944f54a | [
"MIT"
] | null | null | null | src/schemathesis/cli/callbacks.py | chr1st1ank/schemathesis | f2e160d56c1fdce9eac7fee5875b209c8944f54a | [
"MIT"
] | null | null | null | import pathlib
import re
import sys
from contextlib import contextmanager
from typing import Any, Dict, Generator, Optional, Tuple
from urllib.parse import urlparse
import click
import hypothesis
from .. import utils
def validate_schema(ctx: click.core.Context, param: click.core.Parameter, raw_value: str) -> str:
... | 33.597938 | 110 | 0.678122 |
919e86283caab7ca91a759c0ce531a5b70fb2fa8 | 2,821 | py | Python | platonpm/_utils/chains.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platonpm/_utils/chains.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platonpm/_utils/chains.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | import re
from typing import (
TYPE_CHECKING,
Any,
Tuple,
)
from urllib import (
parse,
)
from platon_typing import (
URI,
BlockNumber,
HexStr,
)
from platon_utils import (
add_0x_prefix,
is_integer,
remove_0x_prefix,
)
from hexbytes import (
HexBytes,
)
from platonpm.const... | 24.318966 | 97 | 0.661822 |
919e8d1875a828262675ed371d9daee7f3c22981 | 19,714 | py | Python | test/test_filter_gamestates.py | DanBenHa/pelita | 557c3a757a24e0f1abe25f7edf5c4ffee83a077e | [
"BSD-2-Clause"
] | null | null | null | test/test_filter_gamestates.py | DanBenHa/pelita | 557c3a757a24e0f1abe25f7edf5c4ffee83a077e | [
"BSD-2-Clause"
] | null | null | null | test/test_filter_gamestates.py | DanBenHa/pelita | 557c3a757a24e0f1abe25f7edf5c4ffee83a077e | [
"BSD-2-Clause"
] | null | null | null |
import pytest
import collections
import random
from pelita import gamestate_filters as gf
from pelita.game import setup_game, prepare_bot_state
from pelita.layout import parse_layout
def make_gamestate():
def dummy_team(bot, state):
return bot.position, state
# get layout
layout = """
... | 33.756849 | 89 | 0.50842 |
919e8ee226e6c08702461520193e902d73373e11 | 161 | py | Python | aman/main.py | HmzAli/aman | cd82e841188e4a91356103136458beef6613e974 | [
"MIT"
] | null | null | null | aman/main.py | HmzAli/aman | cd82e841188e4a91356103136458beef6613e974 | [
"MIT"
] | 6 | 2019-01-10T06:57:18.000Z | 2019-12-15T07:34:49.000Z | aman/main.py | HmzAli/aman | cd82e841188e4a91356103136458beef6613e974 | [
"MIT"
] | null | null | null | ''' Alias manager for Unix shells'''
import sys
from .operations import exec_command
def main(cmd_str):
exec_command(cmd_str)
main(' '.join(sys.argv[1:])) | 17.888889 | 36 | 0.714286 |
919ea6b80cc600f52837236057bb0f4db36e7ac8 | 2,710 | py | Python | auto3dgm/dataset/datasetfactory.py | hkirvesl/auto3dgm | e2132a992616c430f60af4871a62c0167e0917da | [
"MIT"
] | null | null | null | auto3dgm/dataset/datasetfactory.py | hkirvesl/auto3dgm | e2132a992616c430f60af4871a62c0167e0917da | [
"MIT"
] | null | null | null | auto3dgm/dataset/datasetfactory.py | hkirvesl/auto3dgm | e2132a992616c430f60af4871a62c0167e0917da | [
"MIT"
] | null | null | null | from os import listdir
from os.path import isfile, splitext, join
from auto3dgm.mesh.meshfactory import MeshFactory
from auto3dgm.dataset.datasetcollection import DatasetCollection
from auto3dgm.mesh.subsample import Subsample
from numpy import empty
class DatasetFactory(object):
__ftypes = ['.ply', '.obj', '.st... | 39.275362 | 122 | 0.668266 |
919eab9e66cf90834bbeb5852f910f4bf439d2f6 | 6,659 | py | Python | tempest/api/identity/admin/v3/test_tokens.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/v3/test_tokens.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/v3/test_tokens.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# 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 requ... | 44.993243 | 79 | 0.612104 |
919ec68167face9632040493dd1b8fe43af76804 | 304 | py | Python | license.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | license.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | license.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | import re
def validate_license(key: str) -> bool:
"""Write a regex that matches a PyBites license key
(e.g. PB-U8N435EH-PG65PW87-IXPWQG5T-898XSZI4)
"""
pattern = re.compile(r'^PB-[A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8}-[A-Z0-9]{8}$')
return bool(re.match(pattern, key))
pass | 27.636364 | 81 | 0.601974 |
919eccdaca65d25f0ec96c2af14d83e46c761b09 | 556 | py | Python | src/functions/mesh.py | spasmann/1DQMC | f56483428f03c63d06c16b7fd7f56231296dd940 | [
"MIT"
] | null | null | null | src/functions/mesh.py | spasmann/1DQMC | f56483428f03c63d06c16b7fd7f56231296dd940 | [
"MIT"
] | null | null | null | src/functions/mesh.py | spasmann/1DQMC | f56483428f03c63d06c16b7fd7f56231296dd940 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
class Mesh:
def __init__(self, LB, RB, Nx):
self.Nx = Nx
self.LB = LB
self.RB = RB
self.dx = (RB - LB)/Nx
self.lowR = np.linspace(LB,(RB-self.dx),Nx)
self.highR = np.linspace(LB+self.dx,RB,Nx)
self.midpoints = np.lin... | 29.263158 | 64 | 0.51259 |
919ee6dee9d4759d23ffa3adb2520e5e54b0b287 | 2,164 | py | Python | company/migrations/0028_auto_20170111_1034.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | 1 | 2021-11-06T12:08:26.000Z | 2021-11-06T12:08:26.000Z | company/migrations/0028_auto_20170111_1034.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | company/migrations/0028_auto_20170111_1034.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2017-01-11 10:34
from __future__ import unicode_literals
import directory_validators.enrolment
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('company', '0027_auto_20170109_1844'),
]
opera... | 32.298507 | 76 | 0.569778 |
919efaf6bf2251de0f7f1fc968879da24c4b7136 | 345 | py | Python | yolox/data/datasets/__init__.py | JJLimmm/YOLOx | 85fdb819be84dfec3a8306cb74872a1c0ef28e3e | [
"Apache-2.0"
] | null | null | null | yolox/data/datasets/__init__.py | JJLimmm/YOLOx | 85fdb819be84dfec3a8306cb74872a1c0ef28e3e | [
"Apache-2.0"
] | null | null | null | yolox/data/datasets/__init__.py | JJLimmm/YOLOx | 85fdb819be84dfec3a8306cb74872a1c0ef28e3e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
from .coco import COCODataset
from .coco_classes import COCO_CLASSES
from .datasets_wrapper import ConcatDataset, Dataset, MixConcatDataset
from .mosaicdetection import MosaicDetection
from .voc import VOCDetection
from .cus... | 31.363636 | 70 | 0.8 |
919efc642192ec71834be141d394566474cf8705 | 1,065 | py | Python | old_scripts/dodajRodzaj.py | alkamid/wiktionary | ce242da609a1001ae7462b07da2f6e83f1a7281b | [
"MIT"
] | 3 | 2015-01-06T22:00:22.000Z | 2016-08-14T08:07:32.000Z | old_scripts/dodajRodzaj.py | alkamid/wiktionary | ce242da609a1001ae7462b07da2f6e83f1a7281b | [
"MIT"
] | 56 | 2015-07-12T10:21:38.000Z | 2020-02-23T18:51:01.000Z | old_scripts/dodajRodzaj.py | alkamid/wiktionary | ce242da609a1001ae7462b07da2f6e83f1a7281b | [
"MIT"
] | 2 | 2015-01-06T21:25:06.000Z | 2018-01-17T12:03:17.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# wprowadza rodzaj do haseł z listy w formacie "hasło → nowy rodzaj"
from klasa import *
import codecs
def main():
inp = codecs.open('input/rodzaje.txt', encoding='utf-8')
lst = []
for line in inp:
line = line.split(' → ')
h = Haslo(line[0])
... | 30.428571 | 117 | 0.493897 |
919f63e2de1da4ef3704cf7abdcfde147cd193ff | 1,349 | py | Python | tests/test_day_01.py | southlandp/advent_of_code_2021 | 3075626741a286eef15c3b9feeb074dcbbe9452f | [
"MIT"
] | null | null | null | tests/test_day_01.py | southlandp/advent_of_code_2021 | 3075626741a286eef15c3b9feeb074dcbbe9452f | [
"MIT"
] | null | null | null | tests/test_day_01.py | southlandp/advent_of_code_2021 | 3075626741a286eef15c3b9feeb074dcbbe9452f | [
"MIT"
] | null | null | null | """
.. codeauthor: Peter Southland
tests for advent of code day 1
Day 1: Sonar Sweep
https://adventofcode.com/2021/day/1
"""
import pytest
from advent_code import day_01 as main
@pytest.mark.parametrize('test_input, expected', [
([199, 200, 208, 210, 200, 207, 240, 269, 260, 263], 7),
([199, 200, 208, 210, ... | 38.542857 | 85 | 0.548554 |
919f74f11e784fd858bccf040b07010c698e13ee | 5,356 | py | Python | src/scripts/add_kegg_anno_info.py | secimTools/gait-gm | 758394addb95b09e794132a23a1f7e95ba39df0b | [
"MIT"
] | null | null | null | src/scripts/add_kegg_anno_info.py | secimTools/gait-gm | 758394addb95b09e794132a23a1f7e95ba39df0b | [
"MIT"
] | 1 | 2021-07-09T11:54:15.000Z | 2021-07-09T11:54:15.000Z | src/scripts/add_kegg_anno_info.py | secimTools/gait-gm | 758394addb95b09e794132a23a1f7e95ba39df0b | [
"MIT"
] | 1 | 2021-02-23T18:12:19.000Z | 2021-02-23T18:12:19.000Z | #!/usr/bin/env python
######################################################################################
# AUTHOR: Francisco Huertas <f.huertas@ufl.edu>
# CONTRIBUTORS: Alison Morse <ammorse@ufl.edu>, Oleksandr Moskalenko <om@rc.ufl.edu>
#
# DESCRIPTION: This tool takes a column with gene and/or metabolites names a... | 28.641711 | 99 | 0.594847 |
919f942bfa437aff46c6eb108a504c76aed92a10 | 57,931 | py | Python | pandas/tests/series/test_analytics.py | MaxVanDeursen/pandas | 9821b77de692716d7c2b62db1a68cac9ffc456c3 | [
"BSD-3-Clause"
] | 1 | 2019-03-25T09:31:34.000Z | 2019-03-25T09:31:34.000Z | pandas/tests/series/test_analytics.py | MaxVanDeursen/pandas | 9821b77de692716d7c2b62db1a68cac9ffc456c3 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/series/test_analytics.py | MaxVanDeursen/pandas | 9821b77de692716d7c2b62db1a68cac9ffc456c3 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
# pylint: disable-msg=E1101,W0612
from distutils.version import LooseVersion
from itertools import product
import operator
import numpy as np
from numpy import nan
import pytest
from pandas.compat import lrange
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Cat... | 38.569241 | 79 | 0.556179 |
919fb64488349a5dcf4a9532470fba4d82a0525c | 4,768 | py | Python | digideep/environment/common/vec_env/dummy_vec_env.py | sharif1093/digideep | e42f10a58cec6cab70ac2be5ce3af6102caefd81 | [
"BSD-2-Clause"
] | 11 | 2019-03-09T23:54:02.000Z | 2020-09-05T20:47:55.000Z | log_sessions/cartpole_8_5_05_1/modules/digideep/environment/common/vec_env/dummy_vec_env.py | godnpeter/DMC_Clustering_PICA | 1b3e14dd4034f3941af1caa06c1d4b6f9d606408 | [
"BSD-2-Clause"
] | 1 | 2021-09-30T01:15:57.000Z | 2021-09-30T01:15:57.000Z | digideep/environment/common/vec_env/dummy_vec_env.py | sharif1093/digideep | e42f10a58cec6cab70ac2be5ce3af6102caefd81 | [
"BSD-2-Clause"
] | null | null | null | """
The MIT License
Copyright (c) 2017 OpenAI (http://openai.com)
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, modify... | 37.84127 | 157 | 0.643666 |
919fbaec55c06cd3332f3880b0db16bca90938b4 | 174 | py | Python | src/radical/cm/enactor/__init__.py | iparask/campaign_manager | 7d7f3934fdde6acadc7581825697c89009fcf6fd | [
"MIT"
] | 1 | 2019-12-18T16:46:35.000Z | 2019-12-18T16:46:35.000Z | src/radical/cm/enactor/__init__.py | radical-project/campaign_manager | 7d7f3934fdde6acadc7581825697c89009fcf6fd | [
"MIT"
] | 22 | 2019-12-12T16:31:36.000Z | 2020-12-14T22:45:40.000Z | src/radical/cm/enactor/__init__.py | iparask/campaign_manager | 7d7f3934fdde6acadc7581825697c89009fcf6fd | [
"MIT"
] | null | null | null | """
Author: Ioannis Paraskevakos
License: MIT
Copyright: 2018-2019
"""
from .base import Enactor # noqa: F401
from .simulated_enactor import SimulatedEnactor # noqa: F401
| 19.333333 | 61 | 0.758621 |
919fc0db6c7e731ca62a13c3a19ba967e89022db | 2,359 | py | Python | virtual/lib/python3.8/site-packages/importlib_resources/tests/test_open.py | dan-mutua/flaskwk3 | f7ee5a27d52005bedd757d6008102b9f82508521 | [
"MIT"
] | 18,636 | 2017-12-06T14:53:18.000Z | 2022-03-31T13:12:34.000Z | virtual/lib/python3.8/site-packages/importlib_resources/tests/test_open.py | dan-mutua/flaskwk3 | f7ee5a27d52005bedd757d6008102b9f82508521 | [
"MIT"
] | 3,640 | 2017-12-06T16:58:35.000Z | 2022-03-31T22:20:57.000Z | virtual/lib/python3.8/site-packages/importlib_resources/tests/test_open.py | dan-mutua/flaskwk3 | f7ee5a27d52005bedd757d6008102b9f82508521 | [
"MIT"
] | 1,987 | 2017-12-06T15:04:51.000Z | 2022-03-26T10:05:15.000Z | import unittest
import importlib_resources as resources
from . import data01
from . import util
class CommonBinaryTests(util.CommonTests, unittest.TestCase):
def execute(self, package, path):
with resources.open_binary(package, path):
pass
class CommonTextTests(util.CommonTests, unittest.Te... | 30.24359 | 85 | 0.647308 |
919fd8486e57b2e6487c77f1b7a6b0512d1dea95 | 8,871 | py | Python | airflow_client/test/test_trigger_rule.py | sptsakcg/airflow-client-python | 38a14e8641988f8cc88a5b27632ef4198bdb2843 | [
"Apache-2.0"
] | null | null | null | airflow_client/test/test_trigger_rule.py | sptsakcg/airflow-client-python | 38a14e8641988f8cc88a5b27632ef4198bdb2843 | [
"Apache-2.0"
] | null | null | null | airflow_client/test/test_trigger_rule.py | sptsakcg/airflow-client-python | 38a14e8641988f8cc88a5b27632ef4198bdb2843 | [
"Apache-2.0"
] | null | null | null | """
Airflow API (Stable)
# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means t... | 239.756757 | 8,173 | 0.758426 |
919fe4d2399c94ebd64132ffd18c7679cbde1d3d | 933 | py | Python | applications/tube-network/tube_network_example/settings.py | LivingMatrix/examples | 3ee2a212e47e1820b1940e4d0cb101380af08ff0 | [
"Apache-2.0"
] | null | null | null | applications/tube-network/tube_network_example/settings.py | LivingMatrix/examples | 3ee2a212e47e1820b1940e4d0cb101380af08ff0 | [
"Apache-2.0"
] | null | null | null | applications/tube-network/tube_network_example/settings.py | LivingMatrix/examples | 3ee2a212e47e1820b1940e4d0cb101380af08ff0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Grakn Labs 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 in writin... | 40.565217 | 90 | 0.759914 |
919fea86d0fd846cb9d2cd992066b10fb86fa921 | 2,498 | py | Python | kivy/calculator_app.py | Nuaboc/simple_programs | 8175a31de342b5e385ca72f92b3a6abfde108124 | [
"MIT"
] | null | null | null | kivy/calculator_app.py | Nuaboc/simple_programs | 8175a31de342b5e385ca72f92b3a6abfde108124 | [
"MIT"
] | null | null | null | kivy/calculator_app.py | Nuaboc/simple_programs | 8175a31de342b5e385ca72f92b3a6abfde108124 | [
"MIT"
] | null | null | null | """
Tutorial of a calculator with Kivy.
Script from Real Python, found in:
https://realpython.com/mobile-app-kivy-python/
"""
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
class CalculatorApp(App):
def build(self):
... | 31.225 | 78 | 0.552842 |
91a02413d3ca873c708498fdbbae201b19b79163 | 21,946 | py | Python | cutesy_mvc/helpers/model.py | dvanderweele/Cutesy_MVC | 6e073adc34ef1deb4932dae018f3561176db9e8f | [
"MIT"
] | null | null | null | cutesy_mvc/helpers/model.py | dvanderweele/Cutesy_MVC | 6e073adc34ef1deb4932dae018f3561176db9e8f | [
"MIT"
] | null | null | null | cutesy_mvc/helpers/model.py | dvanderweele/Cutesy_MVC | 6e073adc34ef1deb4932dae018f3561176db9e8f | [
"MIT"
] | null | null | null | from ..helpers import config, db, migrate, timestamp
import collections
def depInjector(name):
from ..models._index import registry
return registry[name]
def keyOfDep(dep):
from ..models._index import registry
for r in registry.items():
if r[1] == dep:
return r[0]
class Model:
connection = co... | 32.755224 | 224 | 0.597922 |
91a0294f96170fdc908315abbd01e415c86026b3 | 10,115 | py | Python | API/src/main/resources/Lib/robot/errors.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/errors.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/errors.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2020, sikuli.org, sikulix.com - MIT license
#
# 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 b... | 32.419872 | 80 | 0.668809 |
91a05519970021cac5cd1502a115a5eff2492729 | 4,484 | py | Python | scripts/Coverage/pseudoautosomal_region.py | tomarovsky/Biocrutch | 40000f3dcd7ca9095e611aca6d658781867233b8 | [
"MIT"
] | 2 | 2020-10-12T11:05:42.000Z | 2020-11-21T13:44:16.000Z | scripts/Coverage/pseudoautosomal_region.py | tomarovsky/Biocrutch | 40000f3dcd7ca9095e611aca6d658781867233b8 | [
"MIT"
] | null | null | null | scripts/Coverage/pseudoautosomal_region.py | tomarovsky/Biocrutch | 40000f3dcd7ca9095e611aca6d658781867233b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
__author__ = 'tomarovsky'
'''
Script for determining the coordinates of the pseudoautosomal region.
Output of coordinates to BED file.
'''
from Biocrutch.Statistics.coverage_statistics.CoverageMetrics import CoveragesMetrics
from Biocrutch.Statistics.pseudoautosomal_region.coordinator import Coor... | 52.139535 | 127 | 0.651204 |
91a091f793e56e039c06b4beba006deb4870e59b | 344 | py | Python | src/homework/homework9/main.py | acc-cosc-1336/cosc-1336-spring-2018-vcruz350 | 0cee9fde3d4129c51626c4e0c870972aebec9b95 | [
"MIT"
] | null | null | null | src/homework/homework9/main.py | acc-cosc-1336/cosc-1336-spring-2018-vcruz350 | 0cee9fde3d4129c51626c4e0c870972aebec9b95 | [
"MIT"
] | 1 | 2018-03-08T19:46:08.000Z | 2018-03-08T20:00:47.000Z | src/homework/homework9/main.py | acc-cosc-1336/cosc-1336-spring-2018-vcruz350 | 0cee9fde3d4129c51626c4e0c870972aebec9b95 | [
"MIT"
] | null | null | null | #write import statements for Player and Die class
from src.homework.homework9.die import Die
from src.homework.homework9.player import Player
#Create an instance of the Main class and call/execute the roll_doubles method
class Main:
def start(self):
player = Player()
player.roll_doubles()
mai... | 24.571429 | 78 | 0.732558 |
91a0a3c451f4c039261cb66eac340d248f4e97eb | 3,143 | py | Python | project_RL/q_learning/q_learning_agent.py | Ronnypetson/gym-minigrid | 1f0a607160960f00b664130c756a4f3bab356752 | [
"Apache-2.0"
] | null | null | null | project_RL/q_learning/q_learning_agent.py | Ronnypetson/gym-minigrid | 1f0a607160960f00b664130c756a4f3bab356752 | [
"Apache-2.0"
] | 2 | 2021-10-15T01:57:47.000Z | 2021-10-29T20:24:56.000Z | project_RL/q_learning/q_learning_agent.py | Ronnypetson/gym-minigrid | 1f0a607160960f00b664130c756a4f3bab356752 | [
"Apache-2.0"
] | null | null | null | import random
import numpy as np
from collections import defaultdict as dd
class QLearning:
"""QLearning Algorithm exploits and explores an environment.
It learns the state action value of each state and action pair.
It converges to the optimal action-value function.
"""
def __init__(self,
... | 37.86747 | 108 | 0.652561 |
91a0a859cd10ae5b87d6da8bbdd54f72b50a72a0 | 321 | py | Python | config.py | swelltt0576/captcha_recognize | 3f5e981fa9cf189ee22ec2c62689e7e6421bd7b5 | [
"Apache-2.0"
] | null | null | null | config.py | swelltt0576/captcha_recognize | 3f5e981fa9cf189ee22ec2c62689e7e6421bd7b5 | [
"Apache-2.0"
] | null | null | null | config.py | swelltt0576/captcha_recognize | 3f5e981fa9cf189ee22ec2c62689e7e6421bd7b5 | [
"Apache-2.0"
] | 1 | 2019-09-29T09:27:01.000Z | 2019-09-29T09:27:01.000Z | # -*- coding: utf-8 -*-
# about captcha image
IMAGE_HEIGHT = 52
IMAGE_WIDTH = 120
# CHAR_SETS = 'abcdefghijklmnpqrstuvwxyz123456789ABCDEFGHIJKLMNPQRSTUVWXYZ'
CHAR_SETS = '0123456789'
CLASSES_NUM = len(CHAR_SETS)
CHARS_NUM = 4
# for train
RECORD_DIR = './data'
TRAIN_FILE = 'train.tfrecords'
VALID_FILE = 'valid.tfrecords... | 26.75 | 75 | 0.76324 |
91a0cdb6fba63e647af6baa1bef6260794c8dd29 | 3,598 | py | Python | pipelines/pipelines.py | SPOClab-ca/COVFEFE | 905e8e5eb0905791de869db18c6f755838657203 | [
"Apache-2.0"
] | 29 | 2018-08-25T15:05:21.000Z | 2021-07-12T06:23:46.000Z | pipelines/pipelines.py | SPOClab-ca/COVFEFE | 905e8e5eb0905791de869db18c6f755838657203 | [
"Apache-2.0"
] | 16 | 2018-08-28T02:36:01.000Z | 2020-12-07T12:32:34.000Z | pipelines/pipelines.py | SPOClab-ca/COVFEFE | 905e8e5eb0905791de869db18c6f755838657203 | [
"Apache-2.0"
] | 11 | 2018-08-28T13:41:12.000Z | 2021-07-18T13:53:16.000Z | from nodes.helper import ProgressPipeline
from pipelines import pipeline_registry
from nodes import helper, audio, lexicosyntactic, lexicosyntactic_multi
from utils.segment_mappers import TxtSegments, EafSegments
@pipeline_registry
def split_speech_eaf(in_folder, out_folder, num_threads):
file_finder = helper.Fin... | 33.943396 | 122 | 0.766259 |
91a0f4bde92bba9cb6e46d9ed683aeb45baa9475 | 4,853 | py | Python | run_sample.py | sdat2/tcpyPI | d739509163f45ce11a91b4c485b50c7e6b4edeba | [
"MIT"
] | 23 | 2021-01-11T08:53:05.000Z | 2022-03-13T15:53:25.000Z | run_sample.py | sdat2/tcpyPI | d739509163f45ce11a91b4c485b50c7e6b4edeba | [
"MIT"
] | 9 | 2020-12-29T16:59:21.000Z | 2022-03-25T20:56:47.000Z | run_sample.py | sdat2/tcpyPI | d739509163f45ce11a91b4c485b50c7e6b4edeba | [
"MIT"
] | 10 | 2021-01-08T16:17:51.000Z | 2022-03-11T09:30:05.000Z | # This pyPI script computes PI and associated analyses over the entire sample dataset
# which is from 2004, MERRA2.
#
# Created by Daniel Gilford, PhD (daniel.gilford@rutgers.edu)
# Many thanks to Daniel Rothenberg for his assitance optimizing pyPI
#
# Last updated 8/14/2020
#
# setup
import xarray as xr
import pickle... | 31.309677 | 113 | 0.598805 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.