hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4f5e45394a67bcb9a07150dcb0360887e8a8d81f | 2,347 | bzl | Python | closure/private/files_equal_test.bzl | ribrdb/rules_closure | 814465e8d46d5375415193f33d8abbb5ee5d6a6e | [
"Apache-2.0"
] | 1 | 2019-08-25T15:11:13.000Z | 2019-08-25T15:11:13.000Z | closure/private/files_equal_test.bzl | ribrdb/rules_closure | 814465e8d46d5375415193f33d8abbb5ee5d6a6e | [
"Apache-2.0"
] | 1 | 2022-03-01T18:29:50.000Z | 2022-03-01T18:29:50.000Z | closure/private/files_equal_test.bzl | ribrdb/rules_closure | 814465e8d46d5375415193f33d8abbb5ee5d6a6e | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The Closure Rules 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 appli... | 36.671875 | 74 | 0.563698 |
b3b0231227343c2351e05199296c6d3a0def9baf | 1,187 | py | Python | src/gluonts/nursery/few_shot_prediction/src/meta/callbacks/__init__.py | RingoIngo/gluon-ts | 62fb20c36025fc969653accaffaa783671709564 | [
"Apache-2.0"
] | null | null | null | src/gluonts/nursery/few_shot_prediction/src/meta/callbacks/__init__.py | RingoIngo/gluon-ts | 62fb20c36025fc969653accaffaa783671709564 | [
"Apache-2.0"
] | null | null | null | src/gluonts/nursery/few_shot_prediction/src/meta/callbacks/__init__.py | RingoIngo/gluon-ts | 62fb20c36025fc969653accaffaa783671709564 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 33.914286 | 75 | 0.775063 |
4b1e99bcd9a6c625a8a8a52833d6188c4fd010f1 | 15,127 | py | Python | tools/genattrs.py | rabinv/tsplex | bfa2b229086a7ad57dbd9fa462edfd4c5e71ca77 | [
"Apache-2.0"
] | null | null | null | tools/genattrs.py | rabinv/tsplex | bfa2b229086a7ad57dbd9fa462edfd4c5e71ca77 | [
"Apache-2.0"
] | null | null | null | tools/genattrs.py | rabinv/tsplex | bfa2b229086a7ad57dbd9fa462edfd4c5e71ca77 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import json
import pprint
import attr
import sqlite3
import os
import re
import sys
import jinja2
import logging
import itertools
from genchars import Char
from tagger import Tagger
@attr.s
class Attribute(object):
name: str = attr.ib()
group: str = attr.ib()
tagpr... | 34.615561 | 98 | 0.51147 |
426a8b72401b77bac3195d0222cf54d036b323a0 | 565 | py | Python | source/_static/code/scipy/bisection.py | tuttugu-ryo/lecture-source-py | 9ce84044c2cc421775ea63a004556d7ae3b4e504 | [
"BSD-3-Clause"
] | 56 | 2017-05-09T10:45:23.000Z | 2022-01-20T20:33:27.000Z | source/_static/code/scipy/bisection.py | tuttugu-ryo/lecture-source-py | 9ce84044c2cc421775ea63a004556d7ae3b4e504 | [
"BSD-3-Clause"
] | 7 | 2017-06-30T01:52:46.000Z | 2019-05-01T20:09:47.000Z | source/_static/code/scipy/bisection.py | tuttugu-ryo/lecture-source-py | 9ce84044c2cc421775ea63a004556d7ae3b4e504 | [
"BSD-3-Clause"
] | 117 | 2017-04-25T16:09:17.000Z | 2022-03-23T02:30:29.000Z | def bisect(f, a, b, tol=10e-5):
"""
Implements the bisection root finding algorithm, assuming that f is a
real-valued function on [a, b] satisfying f(a) < 0 < f(b).
"""
lower, upper = a, b
while upper - lower > tol:
middle = 0.5 * (upper + lower)
# === if root is between lower a... | 28.25 | 73 | 0.520354 |
b32d0c7abc26f50a9596acd6d16d263e34621876 | 5,606 | py | Python | demos/redemo.py | houzw/knowledge-base-data | 60771e8bf300227e1a26c9e77f56b09d23acd64a | [
"MIT"
] | null | null | null | demos/redemo.py | houzw/knowledge-base-data | 60771e8bf300227e1a26c9e77f56b09d23acd64a | [
"MIT"
] | null | null | null | demos/redemo.py | houzw/knowledge-base-data | 60771e8bf300227e1a26c9e77f56b09d23acd64a | [
"MIT"
] | 1 | 2018-12-17T06:40:53.000Z | 2018-12-17T06:40:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: houzhiwei
# time: 2018/12/18 9:58
import re
v = re.search("Minimum: \d+\.\d+", "Minimum: 0.000000 Default: 1.000000")
v2 = re.search("Default: (\w+|\d+\.\d+)", "Minimum: 0.000000 Default: xxx")
# print(v)
# print(v2)
ac = re.match("Available Choices: [\[\]0-9A-Za... | 31.144444 | 132 | 0.623796 |
bfdd157bdf943db3f3a75084d8c0b4d34351821c | 74,486 | py | Python | python/friesian/test/bigdl/friesian/feature/test_table.py | EmiCareOfCell44/BigDL | 6278ee8eed09b5072da53dab3a99530cf5f69ba2 | [
"Apache-2.0"
] | 3 | 2021-07-14T01:28:47.000Z | 2022-03-02T01:16:32.000Z | python/friesian/test/bigdl/friesian/feature/test_table.py | liangs6212/BigDL | 3c89ff7e8bbdc713110536c18099506811cd2b3a | [
"Apache-2.0"
] | null | null | null | python/friesian/test/bigdl/friesian/feature/test_table.py | liangs6212/BigDL | 3c89ff7e8bbdc713110536c18099506811cd2b3a | [
"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 ... | 55.962434 | 100 | 0.574846 |
f48d24676816c53a1b23a2e1a46e79d0a307d885 | 10,228 | py | Python | raiden/transfer/mediated_transfer/mediation_fee.py | christianbrb/raiden | 64f0715af076747b293671157e2cbbd235cab81b | [
"MIT"
] | null | null | null | raiden/transfer/mediated_transfer/mediation_fee.py | christianbrb/raiden | 64f0715af076747b293671157e2cbbd235cab81b | [
"MIT"
] | null | null | null | raiden/transfer/mediated_transfer/mediation_fee.py | christianbrb/raiden | 64f0715af076747b293671157e2cbbd235cab81b | [
"MIT"
] | null | null | null | from bisect import bisect, bisect_right
from copy import copy
from dataclasses import dataclass, field
from fractions import Fraction
from typing import List, Optional, Sequence, Tuple, TypeVar, Union
from raiden.exceptions import UndefinedMediationFee
from raiden.transfer.architecture import State
from raiden.utils.t... | 34.207358 | 98 | 0.663668 |
ad407364429060d5c3616fb9e42f221a150f5d0d | 238 | py | Python | scope.py | theGreenJedi/practicepy | 330da97b0c79c3c8792ebb4166ecf2609545e127 | [
"MIT"
] | null | null | null | scope.py | theGreenJedi/practicepy | 330da97b0c79c3c8792ebb4166ecf2609545e127 | [
"MIT"
] | null | null | null | scope.py | theGreenJedi/practicepy | 330da97b0c79c3c8792ebb4166ecf2609545e127 | [
"MIT"
] | null | null | null | global_var = 1
def my_vars() :
print( 'Global Variable:' , global_var )
local_var = 2
print( 'Local Variable:' , local_var )
global inner_var
inner_var = 3
my_vars()
print( 'Coerced Global:' , inner_var )
| 13.222222 | 42 | 0.613445 |
cc893b5a3a2102a3681e5b53db186a18f81a9dc1 | 890 | py | Python | Visualization/rendering_categorical_maps.py | liuxb555/earthengine-py-examples | cff5d154b15a17d6a241e3c003b7fc9a2c5903f3 | [
"MIT"
] | 75 | 2020-06-09T14:40:11.000Z | 2022-03-07T08:38:10.000Z | Visualization/rendering_categorical_maps.py | gentaprekazi/earthengine-py-examples | 76ae8e071a71b343f5e464077afa5b0ed2f9314c | [
"MIT"
] | 1 | 2022-03-15T02:23:45.000Z | 2022-03-15T02:23:45.000Z | Visualization/rendering_categorical_maps.py | gentaprekazi/earthengine-py-examples | 76ae8e071a71b343f5e464077afa5b0ed2f9314c | [
"MIT"
] | 35 | 2020-06-12T23:23:48.000Z | 2021-11-15T17:34:50.000Z | import ee
import geemap
# Create a map centered at (lat, lon).
Map = geemap.Map(center=[40, -100], zoom=4)
# Load 2012 MODIS land cover and select the IGBP classification.
cover = ee.Image('MODIS/051/MCD12Q1/2012_01_01').select('Land_Cover_Type_1')
# Define a palette for the 18 distinct land cover classes.
igbpPalet... | 28.709677 | 76 | 0.658427 |
a1ebc1841bb1d7d777d6556f7cfdf8151e4c0e9a | 2,285 | py | Python | xcenternet/datasets/ximilar_dataset.py | wanghh2000/xcenternet | 458d43e01e96adf864809d9a15c756302ec75cd7 | [
"Apache-2.0",
"MIT"
] | null | null | null | xcenternet/datasets/ximilar_dataset.py | wanghh2000/xcenternet | 458d43e01e96adf864809d9a15c756302ec75cd7 | [
"Apache-2.0",
"MIT"
] | null | null | null | xcenternet/datasets/ximilar_dataset.py | wanghh2000/xcenternet | 458d43e01e96adf864809d9a15c756302ec75cd7 | [
"Apache-2.0",
"MIT"
] | null | null | null | import random
import os
import tensorflow as tf
from xcenternet.datasets.dataset import Dataset
from ximilar.client.utils.json_data import read_json_file_list
class XimilarDataset(Dataset):
def __init__(self, dataset_path, init_lr):
labels = read_json_file_list(os.path.join(dataset_path, "labels.json"))... | 34.621212 | 93 | 0.650766 |
ec5a7a858a6de678092d5ec54cbe8c20f1869729 | 2,713 | py | Python | tests/types/test_interfaces.py | ernestoarbitrio/strawberry | 772703c7c47173eeb9e4e8d4c43fccd28166d520 | [
"MIT"
] | null | null | null | tests/types/test_interfaces.py | ernestoarbitrio/strawberry | 772703c7c47173eeb9e4e8d4c43fccd28166d520 | [
"MIT"
] | 1 | 2021-01-18T18:58:45.000Z | 2021-01-18T19:39:09.000Z | tests/types/test_interfaces.py | ernestoarbitrio/strawberry | 772703c7c47173eeb9e4e8d4c43fccd28166d520 | [
"MIT"
] | null | null | null | import strawberry
def test_defining_interface():
@strawberry.interface
class Node:
id: strawberry.ID
definition = Node._type_definition
assert definition.name == "Node"
assert len(definition.fields) == 1
assert definition.fields[0].name == "id"
assert definition.fields[0].type =... | 24.663636 | 83 | 0.693328 |
64931123f69114f98a410d154434d1afae978604 | 561 | py | Python | app/db/models/users.py | JvitorS23/jobboard_fastAPI | 5abcc69f19417ad99352c0434db96407e2d7da76 | [
"MIT"
] | 1 | 2021-10-01T16:40:33.000Z | 2021-10-01T16:40:33.000Z | app/db/models/users.py | JvitorS23/jobboard_fastAPI | 5abcc69f19417ad99352c0434db96407e2d7da76 | [
"MIT"
] | null | null | null | app/db/models/users.py | JvitorS23/jobboard_fastAPI | 5abcc69f19417ad99352c0434db96407e2d7da76 | [
"MIT"
] | null | null | null | from sqlalchemy import Column, Integer, String, Boolean, ForeignKey
from sqlalchemy.orm import relationship
from db.base_class import Base
class User(Base):
"""Users model"""
id = Column(Integer, primary_key=True, index=True)
username = Column(String, unique=True, nullable=False)
email = Column(Strin... | 35.0625 | 67 | 0.734403 |
8228f83a7623c33c0ae02ed77c486b687e4848d7 | 1,879 | py | Python | python/metaparticle_pkg/runner/docker_runner.py | bwoodhouse322/package | c9ffaece59637689ed48607c157227818ea7f60f | [
"MIT"
] | 512 | 2017-10-05T06:19:10.000Z | 2022-01-09T23:04:28.000Z | python/metaparticle_pkg/runner/docker_runner.py | bwoodhouse322/package | c9ffaece59637689ed48607c157227818ea7f60f | [
"MIT"
] | 116 | 2017-12-05T16:14:26.000Z | 2020-08-25T03:39:57.000Z | python/metaparticle_pkg/runner/docker_runner.py | bwoodhouse322/package | c9ffaece59637689ed48607c157227818ea7f60f | [
"MIT"
] | 73 | 2017-12-07T00:00:36.000Z | 2022-02-25T20:06:29.000Z | from __future__ import absolute_import
import logging
from docker import APIClient
# use a generic logger name: metaparticle_pkg.runner
logger = logging.getLogger('.'.join(__name__.split('.')[:-1]))
class DockerRunner:
def __init__(self):
self.docker_client = None
def run(self, img, name, options):... | 29.825397 | 69 | 0.611495 |
6527b0ed25191dbf47d2fef3f6730e0f11a350d5 | 4,991 | py | Python | plonk/simulation/evolution.py | matthewturk/plonk | a2cfb8ebb858cff8fdfdfeb0be1fd672b9022ed1 | [
"MIT"
] | 1 | 2019-09-10T16:22:52.000Z | 2019-09-10T16:22:52.000Z | plonk/simulation/evolution.py | benedettaveronesi/plonk | 2403e41adfaa74688404f592462e011fa9f74516 | [
"MIT"
] | null | null | null | plonk/simulation/evolution.py | benedettaveronesi/plonk | 2403e41adfaa74688404f592462e011fa9f74516 | [
"MIT"
] | null | null | null | """Evolution class for global quantites.
This module contains the Evolution class for tracking global quantities
and sink particle time series data. These files track averaged
quantities that are more frequently output than snapshot files.
"""
from __future__ import annotations
from pathlib import Path
from typing i... | 28.19774 | 87 | 0.602084 |
ad192cb5e3ac0daa0885231e4d6fa50e43873aeb | 381 | py | Python | fides/__init__.py | fides-dev/fides | f481387a3e01a1480c556a826cbdaa9a99636c34 | [
"BSD-3-Clause"
] | 7 | 2020-11-12T19:45:14.000Z | 2021-12-16T19:17:44.000Z | fides/__init__.py | fides-dev/fides | f481387a3e01a1480c556a826cbdaa9a99636c34 | [
"BSD-3-Clause"
] | 44 | 2020-11-12T18:13:06.000Z | 2022-02-10T17:15:14.000Z | fides/__init__.py | fides-dev/fides | f481387a3e01a1480c556a826cbdaa9a99636c34 | [
"BSD-3-Clause"
] | 2 | 2020-12-03T11:11:11.000Z | 2021-04-02T13:25:09.000Z | """
Fides
-----------
Fides is an interior trust-region reflective optimizer
"""
# flake8: noqa
from .minimize import Optimizer
from .hessian_approximation import (
SR1, BFGS, DFP, FX, HybridFixed, GNSBFGS, BB, BG, Broyden, SSM, TSSM
)
from .logging import create_logger
from .version import __version__
from .const... | 25.4 | 72 | 0.753281 |
3f01a0eb7b0c9450b6538c444b2252788996b8fa | 870 | py | Python | manpage-builder/conf.py | domdfcoding/rsc-on-this-day | 4669b2608f93394e2c53fb163ea5b6c6e0e3fd7d | [
"MIT"
] | null | null | null | manpage-builder/conf.py | domdfcoding/rsc-on-this-day | 4669b2608f93394e2c53fb163ea5b6c6e0e3fd7d | [
"MIT"
] | 23 | 2020-11-16T23:47:27.000Z | 2022-01-16T01:24:45.000Z | manpage-builder/conf.py | domdfcoding/rsc-on-this-day | 4669b2608f93394e2c53fb163ea5b6c6e0e3fd7d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# stdlib
import os
import re
import sys
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath(".."))
# this package
from __pkginfo__ import __author__, __copyright__, __version__, modname
project = modname
slug = re.sub(r'\W+', '-', modname.lower())
release = __version__
autho... | 24.166667 | 99 | 0.712644 |
bfa15b3f796454b0ad89206e00ad83075959f38f | 2,442 | py | Python | examples/adspygoogle/dfp/v201208/update_third_party_slot.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201208/update_third_party_slot.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201208/update_third_party_slot.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-04-02T19:00:31.000Z | 2020-08-06T03:28:38.000Z | #!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 33 | 80 | 0.708436 |
0de790684aac5e5a64aefc7bc9e7bb045df15b6c | 1,083 | py | Python | returns/primitives/types.py | ksurta/returns | 9746e569303f214d035462ae3dffe5c49abdcfa7 | [
"BSD-2-Clause"
] | null | null | null | returns/primitives/types.py | ksurta/returns | 9746e569303f214d035462ae3dffe5c49abdcfa7 | [
"BSD-2-Clause"
] | null | null | null | returns/primitives/types.py | ksurta/returns | 9746e569303f214d035462ae3dffe5c49abdcfa7 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import Any, NoReturn
from returns.primitives.exceptions import ImmutableStateError
class Immutable(object):
"""
Helper type for objects that should be immutable.
When applied, each instance becames immutable.
Nothing can be added or deleted from it.
.. code:... | 26.414634 | 77 | 0.65097 |
8f9489601bb7707826675e276fbf1cdfccc5a057 | 40,692 | py | Python | plotly/vis.py | NREL/MetMastVis | 0c3dd87540471c061eb491c871fdb32e6dabd31b | [
"Apache-2.0"
] | 1 | 2018-05-25T20:03:48.000Z | 2018-05-25T20:03:48.000Z | plotly/vis.py | nhamilto/MetMast | 38475682adb21081c86c58e9008a278971306c23 | [
"Apache-2.0"
] | null | null | null | plotly/vis.py | nhamilto/MetMast | 38475682adb21081c86c58e9008a278971306c23 | [
"Apache-2.0"
] | 2 | 2018-06-07T20:00:03.000Z | 2020-11-26T21:52:04.000Z | """
:module: vis
:platform: Unix, Windows
:synopsis: This code is used as a visualization library for the Met Mast data so it is specifically designed to handle MetDat object from the "met_funcs.py" library.
:moduleauthor: Nicholas Hamilton <Nicholas.Hamilton@nrel.gov> Rafael Mudafort <Rafael.Mudafort@nrel.gov> Lucas ... | 46.293515 | 190 | 0.665266 |
660a049f3ec33b87d1f4eb5ea8d298baaaafbc2b | 1,092 | py | Python | name_gen.py | brahmcapoor/naming-changes-complexity | 604369ebcb2649b2a7994a1405b944dd6cb37f18 | [
"MIT"
] | null | null | null | name_gen.py | brahmcapoor/naming-changes-complexity | 604369ebcb2649b2a7994a1405b944dd6cb37f18 | [
"MIT"
] | null | null | null | name_gen.py | brahmcapoor/naming-changes-complexity | 604369ebcb2649b2a7994a1405b944dd6cb37f18 | [
"MIT"
] | null | null | null | from random import sample, shuffle, randint, choice
"""
Generates 8 random pairs of names, one simple and one complex.
It's a pretty simple script, so it's not commented.
"""
VOWELS = ['a', 'e', 'i', 'o', 'u']
CONSONANTS = ['s', 'z', 'f', 'v', 'k', 'g', 'p', 'b', 't', 'd']
def generate_random_word(complex=False):... | 20.603774 | 69 | 0.595238 |
345e8084c4e8f87fac27409e079d337af81cfe36 | 3,858 | py | Python | src/p1.py | BLTowsen/NeuralNetworkFromScratch | fe222a2142f66c9bab5a4ff8539e9c4b46d4e597 | [
"MIT"
] | 1 | 2020-07-22T12:33:39.000Z | 2020-07-22T12:33:39.000Z | src/p1.py | BLTowsen/NeuralNetworkFromScratch | fe222a2142f66c9bab5a4ff8539e9c4b46d4e597 | [
"MIT"
] | null | null | null | src/p1.py | BLTowsen/NeuralNetworkFromScratch | fe222a2142f66c9bab5a4ff8539e9c4b46d4e597 | [
"MIT"
] | null | null | null | import numpy as np
import nnfs
from nnfs.datasets import spiral_data
nnfs.init() # setting random seed and default data type for numpy to use
# X = [[1, 2, 3, 2.5],
# [2.0, 5.0, -1.0, 2.0],
# [-1.5, 2.7, 3.3, -0.8]]
# X = [[1], [2]]
##################################
# Long version of softmax function
#... | 29.007519 | 158 | 0.665111 |
39ddaa5914616bd9ad686fffeb7eef291ee7eb64 | 4,524 | py | Python | ekorpkit/models/sentiment/analyser.py | entelecheia/ekorpkit | 400cb15005fdbcaa2ab0c311e338799283f28fe0 | [
"CC-BY-4.0"
] | 4 | 2022-02-26T10:54:16.000Z | 2022-02-26T11:01:56.000Z | ekorpkit/models/sentiment/analyser.py | entelecheia/ekorpkit | 400cb15005fdbcaa2ab0c311e338799283f28fe0 | [
"CC-BY-4.0"
] | 1 | 2022-03-25T06:37:12.000Z | 2022-03-25T06:45:53.000Z | ekorpkit/models/sentiment/analyser.py | entelecheia/ekorpkit | 400cb15005fdbcaa2ab0c311e338799283f28fe0 | [
"CC-BY-4.0"
] | null | null | null | import logging
import pandas as pd
from .base import BaseSentimentAnalyser
log = logging.getLogger(__name__)
class HIV4SA(BaseSentimentAnalyser):
"""
A class for sentiment analysis using the HIV4 lexicon.
"""
def __init__(self, preprocessor=None, lexicon=None, **kwargs):
super().__init__(pre... | 36.780488 | 79 | 0.54443 |
333949faf73bd0077bd9909ad09820ce35ff7a7b | 2,780 | py | Python | rec/mrnas.py | OmnesRes/OncoRank | 38e76cedff9846a0e76aeee5da07258ed2ec3a49 | [
"MIT"
] | 1 | 2020-03-03T05:11:00.000Z | 2020-03-03T05:11:00.000Z | rec/mrnas.py | OmnesRes/OncoRank | 38e76cedff9846a0e76aeee5da07258ed2ec3a49 | [
"MIT"
] | null | null | null | rec/mrnas.py | OmnesRes/OncoRank | 38e76cedff9846a0e76aeee5da07258ed2ec3a49 | [
"MIT"
] | 1 | 2020-03-04T10:12:42.000Z | 2020-03-04T10:12:42.000Z | import scipy.stats as stats
import numpy as np
import math
from rpy2 import robjects as ro
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
cancers=['BLCA','BRCA','CESC','COAD','ESCA','GBM','HNSC','KIRC','KIRP','LAML','LGG','LIHC','LUAD','LUSC','OV',\
'PAAD','RE... | 29.892473 | 115 | 0.641007 |
c29c5d8f5096365929c2719bf1a0c0b792a500d5 | 4,748 | py | Python | observations/models.py | UiL-OTS-labs/ethics | 7782e08a4f772b375ba56b4b865fa9efcd730ca1 | [
"MIT"
] | 2 | 2017-04-22T11:07:13.000Z | 2018-03-02T12:23:24.000Z | observations/models.py | UiL-OTS-labs/ethics | 7782e08a4f772b375ba56b4b865fa9efcd730ca1 | [
"MIT"
] | 124 | 2020-04-30T07:06:58.000Z | 2022-03-28T12:50:16.000Z | observations/models.py | UiL-OTS-labs/etcl | a22df7ff78620b704a500354fb218fbe9bcabf5f | [
"MIT"
] | 1 | 2021-08-04T11:44:21.000Z | 2021-08-04T11:44:21.000Z | from django.core.validators import MaxValueValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _
from main.models import SettingModel
from main.validators import validate_pdf_or_doc
from studies.models import Study
class Registration(models.Model):
order = models.Positive... | 32.081081 | 113 | 0.65417 |
1c30bad2d352bf9d602223667dd3a7db097949ed | 4,347 | py | Python | src/sage/server/notebook/colorize.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | 2 | 2021-08-20T00:30:35.000Z | 2021-11-17T10:54:00.000Z | src/sage/server/notebook/colorize.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/server/notebook/colorize.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | # This file is part of the OLD Sage notebook and is NOT actively developed,
# maintained, or supported. As of Sage v4.1.2, all notebook development has
# moved to the separate Sage Notebook project:
#
# http://nb.sagemath.org/
#
# The new notebook is installed in Sage as an spkg (e.g., sagenb-0.3.spkg).
#
# Please vis... | 30.1875 | 84 | 0.576259 |
81ea9d65797320e42006a33cdc8c858186bee79a | 198 | py | Python | ex015.py | AdaltonVitor/python-curso-em-video | b7c0b5f72e22c0ea045ca0d47bb577e9832e76f3 | [
"MIT"
] | 1 | 2022-01-02T21:59:04.000Z | 2022-01-02T21:59:04.000Z | ex015.py | AdaltonVitor/python-curso-em-video | b7c0b5f72e22c0ea045ca0d47bb577e9832e76f3 | [
"MIT"
] | null | null | null | ex015.py | AdaltonVitor/python-curso-em-video | b7c0b5f72e22c0ea045ca0d47bb577e9832e76f3 | [
"MIT"
] | null | null | null | salario = float(input('Qual o salario do funcionario? R$'))
novo = salario + (salario * 15 / 100)
print('O salario do funcionario era R${} e com o ajuste de 15% foi para R${} '.format(salario,novo)) | 66 | 100 | 0.686869 |
3267ce7e719235cd196603a526872cbd9cdcfaa0 | 12,587 | py | Python | selfdrive/car/gm/values.py | tunabelly/openpilot | cbd4731145ebba06f6fab822c5e23e146eaa562f | [
"MIT"
] | 1 | 2019-05-24T22:04:41.000Z | 2019-05-24T22:04:41.000Z | selfdrive/car/gm/values.py | tunabelly/openpilot | cbd4731145ebba06f6fab822c5e23e146eaa562f | [
"MIT"
] | null | null | null | selfdrive/car/gm/values.py | tunabelly/openpilot | cbd4731145ebba06f6fab822c5e23e146eaa562f | [
"MIT"
] | null | null | null | from cereal import car
from selfdrive.car import dbc_dict
class CAR:
HOLDEN_ASTRA = "HOLDEN ASTRA RS-V BK 2017"
VOLT = "CHEVROLET VOLT PREMIER 2017"
CADILLAC_ATS = "CADILLAC ATS Premium Performance 2018"
CADILLAC_CT6 = "CADILLAC CT6 SUPERCRUISE 2018"
MALIBU = "CHEVROLET MALIBU PREMIER 2017"
ACADIA = "GMC A... | 111.389381 | 1,265 | 0.559943 |
c61ab811738772f57059cce027a2c76c5a307c87 | 1,246 | py | Python | azure-devops/azext_devops/devops_sdk/v5_1/customer_intelligence/models.py | keithlemon/azure-devops-cli-extension | 4989e5f53650f186e638ccc186605986c76d59bf | [
"MIT"
] | 326 | 2019-04-10T12:38:23.000Z | 2022-03-31T23:07:49.000Z | azure-devops/azext_devops/devops_sdk/v5_1/customer_intelligence/models.py | keithlemon/azure-devops-cli-extension | 4989e5f53650f186e638ccc186605986c76d59bf | [
"MIT"
] | 562 | 2019-04-10T07:36:12.000Z | 2022-03-28T07:37:54.000Z | azure-devops/azext_devops/devops_sdk/v5_1/customer_intelligence/models.py | keithlemon/azure-devops-cli-extension | 4989e5f53650f186e638ccc186605986c76d59bf | [
"MIT"
] | 166 | 2019-04-10T07:59:40.000Z | 2022-03-16T14:17:13.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | 32.789474 | 95 | 0.501605 |
a5f87d0dd4cdc7ca57c5c6795a22fb2b97eb3b7f | 4,429 | py | Python | package_control/versions.py | William-Cao/Less- | b4cb03d2457bcac29ba3cfc13689098aee103971 | [
"Unlicense",
"MIT"
] | 3 | 2019-06-06T00:13:44.000Z | 2020-08-16T20:11:13.000Z | package_control/versions.py | Allyn69/package_control | f78578ed67529e263fb1f4e4f90f92295830560f | [
"MIT",
"Unlicense"
] | null | null | null | package_control/versions.py | Allyn69/package_control | f78578ed67529e263fb1f4e4f90f92295830560f | [
"MIT",
"Unlicense"
] | 1 | 2021-07-26T00:35:53.000Z | 2021-07-26T00:35:53.000Z | import re
from .semver import SemVer
from .console_write import console_write
def semver_compat(v):
"""
Converts a string version number into SemVer. If the version is based on
a date, converts to 0.0.1+yyyy.mm.dd.hh.mm.ss.
:param v:
A string, dict with 'version' key, or a SemVer object
... | 28.031646 | 85 | 0.600813 |
7730053bcdd4204539a300d9a33cbed7e734f38f | 12,813 | py | Python | huaweicloud-sdk-cloudpipeline/huaweicloudsdkcloudpipeline/v2/model/template_view.py | Adek06/huaweicloud-sdk-python-v3 | 3d13b27d089e04a1ae567cd649b3c5509e0391d2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-cloudpipeline/huaweicloudsdkcloudpipeline/v2/model/template_view.py | Adek06/huaweicloud-sdk-python-v3 | 3d13b27d089e04a1ae567cd649b3c5509e0391d2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-cloudpipeline/huaweicloudsdkcloudpipeline/v2/model/template_view.py | Adek06/huaweicloud-sdk-python-v3 | 3d13b27d089e04a1ae567cd649b3c5509e0391d2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class TemplateView:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is js... | 24.640385 | 304 | 0.579333 |
4d4ee63f17394cafaba0656cc86597c10da02852 | 5,854 | py | Python | client/diagnose.py | brad999/nikita-client | e025bb57eb78a169ce6b1807c58788ba59c08933 | [
"MIT"
] | 1 | 2015-05-31T18:48:47.000Z | 2015-05-31T18:48:47.000Z | client/diagnose.py | brad999/nikita | e025bb57eb78a169ce6b1807c58788ba59c08933 | [
"MIT"
] | 34 | 2015-04-09T01:48:43.000Z | 2015-05-04T17:23:24.000Z | client/diagnose.py | brad999/nikita | e025bb57eb78a169ce6b1807c58788ba59c08933 | [
"MIT"
] | null | null | null | # -*- coding: utf-8-*-
import os
import sys
import time
import socket
import subprocess
import pkgutil
import logging
import pip.req
import nikitapath
if sys.version_info < (3, 3):
from distutils.spawn import find_executable
else:
from shutil import which as find_executable
logger = logging.getLogger(__name__)... | 30.175258 | 79 | 0.627947 |
5a6cc6bed39bb8978b1cad2ed760d88a2018ca77 | 920 | py | Python | km_api/functional_tests/know_me/profile/profile_items/list_entries/test_sort_list_entries.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 4 | 2017-08-03T00:46:31.000Z | 2018-11-06T03:32:32.000Z | km_api/functional_tests/know_me/profile/profile_items/list_entries/test_sort_list_entries.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 526 | 2017-06-27T18:13:59.000Z | 2021-06-10T18:00:21.000Z | km_api/functional_tests/know_me/profile/profile_items/list_entries/test_sort_list_entries.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 1 | 2017-07-10T19:46:27.000Z | 2017-07-10T19:46:27.000Z | from rest_framework import status
def test_sort_list_entries(
api_client,
enable_premium_requirement,
profile_list_entry_factory,
user_factory,
):
"""
Premium users should be able to sort list entries with respect to
their parent profile item.
"""
password = "password"
user = u... | 28.75 | 78 | 0.709783 |
c19c4316a774aa05c01d490fca3935bc7052d09d | 2,317 | py | Python | src/ferment_ng/scripts.py | ushacow/ferment | 1ba77be38243f9c074c76bd7b901606f1077d8f3 | [
"Apache-2.0"
] | 1 | 2020-08-19T20:45:07.000Z | 2020-08-19T20:45:07.000Z | src/ferment_ng/scripts.py | ushacow/ferment | 1ba77be38243f9c074c76bd7b901606f1077d8f3 | [
"Apache-2.0"
] | null | null | null | src/ferment_ng/scripts.py | ushacow/ferment | 1ba77be38243f9c074c76bd7b901606f1077d8f3 | [
"Apache-2.0"
] | 1 | 2019-02-13T15:29:46.000Z | 2019-02-13T15:29:46.000Z | import click
import docker
from wheezy.template.engine import Engine
from wheezy.template.ext.core import CoreExtension
from wheezy.template.ext.code import CodeExtension
from wheezy.template.loader import DictLoader
from . import templates
import logging
LOG = logging.getLogger(__name__)
LOG_LEVELS = {
"info... | 22.940594 | 90 | 0.637894 |
4f2911f123117d6e653c7f09d545d8f115019bc4 | 1,081 | py | Python | utils.py | karush17/esac | 9a17d5a6bcff25ed5799e122e59aaedc696e11ac | [
"MIT"
] | 22 | 2020-06-29T03:06:02.000Z | 2021-12-01T12:45:08.000Z | utils.py | karush17/Rough-Notebooks | 9a17d5a6bcff25ed5799e122e59aaedc696e11ac | [
"MIT"
] | 3 | 2021-02-09T01:00:38.000Z | 2021-10-05T16:49:48.000Z | utils.py | karush17/Rough-Notebooks | 9a17d5a6bcff25ed5799e122e59aaedc696e11ac | [
"MIT"
] | 6 | 2020-06-29T03:06:04.000Z | 2022-02-26T02:01:56.000Z | import math
import torch
def create_log_gaussian(mean, log_std, t):
quadratic = -((0.5 * (t - mean) / (log_std.exp())).pow(2))
l = mean.shape
log_z = log_std
z = l[-1] * math.log(2 * math.pi)
log_p = quadratic.sum(dim=-1) - log_z.sum(dim=-1) - 0.5 * z
return log_p
def logsumexp(inputs, dim=Non... | 30.885714 | 83 | 0.630897 |
687e130dc8b68600c36cc29b95fd12e6fa44eb37 | 1,282 | py | Python | .Python Challenges - 101Computing/Fast Typing Test/interface.py | Gustavo-daCosta/Projetos | 459cbf6fc0b67532c1bf2043ccdb915d16ba0df2 | [
"MIT"
] | 2 | 2021-09-13T22:04:30.000Z | 2022-01-05T14:01:43.000Z | .Python Challenges - 101Computing/Fast Typing Test/interface.py | Gustavo-daCosta/Projetos | 459cbf6fc0b67532c1bf2043ccdb915d16ba0df2 | [
"MIT"
] | null | null | null | .Python Challenges - 101Computing/Fast Typing Test/interface.py | Gustavo-daCosta/Projetos | 459cbf6fc0b67532c1bf2043ccdb915d16ba0df2 | [
"MIT"
] | null | null | null | from tkinter import *
import time
from os import system
from random import randint
app = Tk()
app.title("Fast Typing Test")
app.geometry("600x550")
def semComando():
print("Sem comando")
barra_menu = Menu(app)
menuHelp = Menu(barra_menu, tearoff=0)
menuHelp.add_command(label="How the app works?", command=semCom... | 30.52381 | 83 | 0.74259 |
9993477c7ce93e69f346a448139f363536941d25 | 1,587 | py | Python | src/olympia/constants/scanners.py | covariant/addons-server | 41e6ee9e426facb19a1e1ca8d40277cb6f94a7da | [
"BSD-3-Clause"
] | 843 | 2016-02-09T13:00:37.000Z | 2022-03-20T19:17:06.000Z | src/olympia/constants/scanners.py | covariant/addons-server | 41e6ee9e426facb19a1e1ca8d40277cb6f94a7da | [
"BSD-3-Clause"
] | 10,187 | 2016-02-05T23:51:05.000Z | 2022-03-31T15:24:44.000Z | src/olympia/constants/scanners.py | covariant/addons-server | 41e6ee9e426facb19a1e1ca8d40277cb6f94a7da | [
"BSD-3-Clause"
] | 551 | 2016-02-08T20:32:16.000Z | 2022-03-15T16:49:24.000Z | from django.utils.translation import gettext_lazy as _
CUSTOMS = 1
WAT = 2
YARA = 3
MAD = 4
SCANNERS = {CUSTOMS: 'customs', WAT: 'wat', YARA: 'yara', MAD: 'mad'}
# Action IDs are also used for severity (the higher, the more severe).
# The field is a PositiveSmallIntegerField, it should go up to 65535.
NO_ACTION = 1... | 25.190476 | 83 | 0.724008 |
655043a83e02a52b06eb32a34ff7c4ca7f09a3e4 | 1,505 | py | Python | damage_network.py | addison-schwamb/WorkingMemoryModelingAdapted | 47c0319b117152d7f88b8740593846b3aa06e7a3 | [
"Apache-2.0"
] | null | null | null | damage_network.py | addison-schwamb/WorkingMemoryModelingAdapted | 47c0319b117152d7f88b8740593846b3aa06e7a3 | [
"Apache-2.0"
] | null | null | null | damage_network.py | addison-schwamb/WorkingMemoryModelingAdapted | 47c0319b117152d7f88b8740593846b3aa06e7a3 | [
"Apache-2.0"
] | null | null | null | """
Functions for damaging neural networks
written in Python 3.8.3
@ Addison Schwamb
"""
import numpy as np
import time
def remove_neurons(JT, pct_rmv, inhibitory):
tic = time.time()
JT_dim = np.shape(JT)
if inhibitory:
remove = JT<0
else:
remove = JT>0
num_to_keep = ((1-pct_rmv)*(... | 31.354167 | 67 | 0.554817 |
caed021c66a6443cdd7f613de79ff95bb255cde5 | 3,138 | py | Python | tests/ut/python/nn/test_psnr.py | ythlml/mindspore | 028ae212624164044cfaa84f347fc502cb7fcb0f | [
"Apache-2.0"
] | 7 | 2020-05-24T03:19:26.000Z | 2020-05-24T03:20:00.000Z | tests/ut/python/nn/test_psnr.py | ythlml/mindspore | 028ae212624164044cfaa84f347fc502cb7fcb0f | [
"Apache-2.0"
] | null | null | null | tests/ut/python/nn/test_psnr.py | ythlml/mindspore | 028ae212624164044cfaa84f347fc502cb7fcb0f | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 29.603774 | 78 | 0.666348 |
a949b74a92c19a5bac0fce2b81e52ac95a06605b | 1,436 | py | Python | rcaudio/simple_recorder.py | selenakkaya/MushroomGame | 59ecfddb536929cd137198bdab01e9ffab33cc5f | [
"MIT"
] | 31 | 2018-09-27T03:35:06.000Z | 2022-01-11T09:49:26.000Z | rcaudio/simple_recorder.py | selenakkaya/MushroomGame | 59ecfddb536929cd137198bdab01e9ffab33cc5f | [
"MIT"
] | 3 | 2018-11-20T07:49:24.000Z | 2021-01-06T11:48:41.000Z | rcaudio/simple_recorder.py | selenakkaya/MushroomGame | 59ecfddb536929cd137198bdab01e9ffab33cc5f | [
"MIT"
] | 7 | 2019-04-23T06:32:23.000Z | 2020-09-25T14:18:32.000Z | from .core_recorder import CoreRecorder
import threading
import logging
import time
class SimpleRecorder(threading.Thread):
def __init__(self,
sr = 2000, #Sample Rate
):
threading.Thread.__init__(self)
self.audio_data = []
self.audio_lock = threading.Lock()
... | 28.156863 | 66 | 0.590529 |
93f2fa0168f4bec25485db2bc7a869c01979430b | 2,286 | py | Python | scripts/testing/gateway-responses/test-sender.py | jcjveraa/EDDN | d0cbae6b7a2cac180dd414cbc324c2d84c867cd8 | [
"BSD-3-Clause"
] | 100 | 2017-07-19T10:11:04.000Z | 2020-07-05T22:07:39.000Z | scripts/testing/gateway-responses/test-sender.py | jcjveraa/EDDN | d0cbae6b7a2cac180dd414cbc324c2d84c867cd8 | [
"BSD-3-Clause"
] | 24 | 2017-07-03T22:30:32.000Z | 2020-07-04T21:04:30.000Z | scripts/testing/gateway-responses/test-sender.py | jcjveraa/EDDN | d0cbae6b7a2cac180dd414cbc324c2d84c867cd8 | [
"BSD-3-Clause"
] | 23 | 2017-08-08T22:57:16.000Z | 2020-06-26T06:19:25.000Z | #!/usr/bin/env python3
# vim: tabstop=4 shiftwidth=4 expandtab smarttab textwidth=0 wrapmargin=0
import argparse
import requests
import zlib
upload_url = 'https://dev.eddn.edcd.io:4432/upload/'
def send_message(url, args):
print(f'''
send_message:
URL: {url}
input file: "{args.messagefile}"
''')
wit... | 26.275862 | 81 | 0.56168 |
9c7f0b86d23252eb667a628a9f5a6c0fd2927da0 | 5,634 | py | Python | aiida_quantumespresso/calculations/matdyn.py | unkcpz/aiida-quantumespresso | fbac0993bb8b6cdeba85717453debcf0ab062b5a | [
"MIT"
] | null | null | null | aiida_quantumespresso/calculations/matdyn.py | unkcpz/aiida-quantumespresso | fbac0993bb8b6cdeba85717453debcf0ab062b5a | [
"MIT"
] | null | null | null | aiida_quantumespresso/calculations/matdyn.py | unkcpz/aiida-quantumespresso | fbac0993bb8b6cdeba85717453debcf0ab062b5a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from aiida.common.utils import classproperty
from aiida.orm.data.folder import FolderData
from aiida.orm.data.remote import RemoteData
from aiida.orm.data.array.kpoints import KpointsData
from aiida_quantumespresso.calculations.namelists import NamelistsCalculation
from aiida_quantumes... | 43.674419 | 108 | 0.599397 |
a17a354f9959537b8175591c7f74e6c0a1a4108f | 9,484 | py | Python | matdeeplearn/models/dospredict.py | vxfung/MatDeepLearn_DOS | 4c2998bacfe5627958bc792ea62ec2baab2507a1 | [
"MIT"
] | 1 | 2022-03-28T13:09:49.000Z | 2022-03-28T13:09:49.000Z | matdeeplearn/models/dospredict.py | vxfung/MatDeepLearn_DOS | 4c2998bacfe5627958bc792ea62ec2baab2507a1 | [
"MIT"
] | null | null | null | matdeeplearn/models/dospredict.py | vxfung/MatDeepLearn_DOS | 4c2998bacfe5627958bc792ea62ec2baab2507a1 | [
"MIT"
] | null | null | null | from typing import Union, Tuple
import torch
from torch import Tensor
import torch.nn.functional as F
from torch.nn import Sequential, Linear, BatchNorm1d, PReLU
import torch_geometric
from torch_geometric.typing import PairTensor, Adj, OptTensor, Size
from torch_geometric.nn.conv import MessagePassing
from tor... | 36.198473 | 128 | 0.515816 |
c0c438e63d46941a8a0f5ad9e851353a8375dbc5 | 3,781 | py | Python | _unittests/ut_finance/test_stock_file.py | mohamedelkansouli/Ensae_py2 | e54a05f90c6aa6e2a5065eac9f9ec10aca64b46a | [
"MIT"
] | null | null | null | _unittests/ut_finance/test_stock_file.py | mohamedelkansouli/Ensae_py2 | e54a05f90c6aa6e2a5065eac9f9ec10aca64b46a | [
"MIT"
] | null | null | null | _unittests/ut_finance/test_stock_file.py | mohamedelkansouli/Ensae_py2 | e54a05f90c6aa6e2a5065eac9f9ec10aca64b46a | [
"MIT"
] | null | null | null | """
@brief test log(time=3s)
"""
import sys
import os
import unittest
import datetime
import warnings
from quandl.errors.quandl_error import LimitExceededError
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
try:
import src
except ImportError:
path = os.path.no... | 28.216418 | 81 | 0.579212 |
b42465cec5f949e4e3ada5be78ff768320a11910 | 11,286 | py | Python | uweb3/connections.py | stefvanhouten/uweb3 | bd6b03a3c819582afd845b31970b8a49312d1245 | [
"ISC"
] | null | null | null | uweb3/connections.py | stefvanhouten/uweb3 | bd6b03a3c819582afd845b31970b8a49312d1245 | [
"ISC"
] | 3 | 2020-05-20T09:53:14.000Z | 2020-07-12T21:42:37.000Z | uweb3/connections.py | stefvanhouten/uweb3 | bd6b03a3c819582afd845b31970b8a49312d1245 | [
"ISC"
] | 3 | 2020-04-29T09:49:07.000Z | 2020-12-03T09:51:22.000Z | #!/usr/bin/python
"""This file contains all the connectionManager classes that interact with
databases, restfull apis, secure cookies, config files etc."""
__author__ = 'Jan Klopper (janunderdark.nl)'
__version__ = 0.1
import os
import sys
from base64 import b64encode
class ConnectionError(Exception):
"""Error clas... | 35.37931 | 109 | 0.683856 |
667c5e4bd9fd065108749849979bbfc8087b34aa | 1,380 | py | Python | python_serial_sender/sender.py | vvzen/arduino-python-serial-communication-example | 6fb5175266f490acf49ac2ff1c119dfd0b2ee938 | [
"MIT"
] | null | null | null | python_serial_sender/sender.py | vvzen/arduino-python-serial-communication-example | 6fb5175266f490acf49ac2ff1c119dfd0b2ee938 | [
"MIT"
] | null | null | null | python_serial_sender/sender.py | vvzen/arduino-python-serial-communication-example | 6fb5175266f490acf49ac2ff1c119dfd0b2ee938 | [
"MIT"
] | null | null | null | import time
import serial
ARDUINO_URL = "/dev/tty.usbmodem142301"
MAX_WAIT = 32 # seconds
ARDUINO_RESET_WAIT_TIME = 5 # seconds
END_MESSAGE_DELIMITER = b">"
def hello_world():
serial_device = serial.Serial(ARDUINO_URL, 9600, timeout=1)
print("Will talk to ", serial_device.name)
# This is fundamental! Gi... | 27.058824 | 81 | 0.671739 |
5f65efd5f67fbfc56de8446a2fa219df0cfc8e45 | 10,780 | py | Python | boundlexx/api/v1/serializers/world.py | AngellusMortis/boundlexx | 407f5e38e8e0f067cbcb358787fc9af6a9be9b2a | [
"MIT"
] | 1 | 2021-04-23T11:49:50.000Z | 2021-04-23T11:49:50.000Z | boundlexx/api/v1/serializers/world.py | AngellusMortis/boundlexx | 407f5e38e8e0f067cbcb358787fc9af6a9be9b2a | [
"MIT"
] | 1 | 2021-04-17T18:17:12.000Z | 2021-04-17T18:17:12.000Z | boundlexx/api/v1/serializers/world.py | AngellusMortis/boundlexx | 407f5e38e8e0f067cbcb358787fc9af6a9be9b2a | [
"MIT"
] | null | null | null | from rest_framework import serializers
from boundlexx.api.common.serializers import (
BlockColorSerializer,
ItemColorSerializer,
PossibleWBCSerializer,
ResourcesSerializer,
SimpleWorldSerializer,
WorldBlockColorSerializer,
WorldColorSerializer,
WorldDistanceSerializer,
WorldPollLead... | 27.641026 | 84 | 0.589889 |
906fa70ef90f7290724b60ee60af3812b8db4440 | 982 | py | Python | bindings/python/examples/ispace.py | stkaplan/legion | ad82a1c1f39ed20a16df29aa331428d42c0ecfb6 | [
"Apache-2.0"
] | null | null | null | bindings/python/examples/ispace.py | stkaplan/legion | ad82a1c1f39ed20a16df29aa331428d42c0ecfb6 | [
"Apache-2.0"
] | null | null | null | bindings/python/examples/ispace.py | stkaplan/legion | ad82a1c1f39ed20a16df29aa331428d42c0ecfb6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020 Stanford University
#
# 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... | 23.95122 | 74 | 0.664969 |
6e8ec8675682c91053215bdfe303b385987104df | 426 | py | Python | LTC4099_constants.py | chisl/LTC4099-py2 | b30b58c27eedc7a064059e0d7a9ed4466a13a0b6 | [
"MIT"
] | null | null | null | LTC4099_constants.py | chisl/LTC4099-py2 | b30b58c27eedc7a064059e0d7a9ed4466a13a0b6 | [
"MIT"
] | null | null | null | LTC4099_constants.py | chisl/LTC4099-py2 | b30b58c27eedc7a064059e0d7a9ed4466a13a0b6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""LTC4099: I2C Controlled USB Power Manager/Charger with Overvoltage Protection"""
__author__ = "ChISL"
__copyright__ = "TBD"
__credits__ = ["Linear Technology"]
__license__ = "TBD"
__version__ = "0.1"
__maintainer__ = "https://chisl.io"
__email__ = "i... | 22.421053 | 83 | 0.661972 |
1b3ab150aaf325723b197d105dfc2d1ee634ff5e | 264 | py | Python | tests/artificial/transf_Logit/trend_Lag1Trend/cycle_12/ar_12/test_artificial_1024_Logit_Lag1Trend_12_12_100.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Logit/trend_Lag1Trend/cycle_12/ar_12/test_artificial_1024_Logit_Lag1Trend_12_12_100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Logit/trend_Lag1Trend/cycle_12/ar_12/test_artificial_1024_Logit_Lag1Trend_12_12_100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 12, transform = "Logit", sigma = 0.0, exog_count = 100, ar_order = 12); | 37.714286 | 164 | 0.731061 |
a6d8ea49a252d1cfab2a78eadf25dbd70115aa1a | 586 | py | Python | wc.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 7 | 2022-01-15T02:53:53.000Z | 2022-02-17T00:51:32.000Z | wc.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 8 | 2022-01-16T02:45:24.000Z | 2022-03-21T02:08:27.000Z | wc.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 5 | 2022-01-15T02:53:38.000Z | 2022-01-19T17:42:10.000Z | def main():
import args
import log
from memory.memory import Memory
memory = Memory()
from data.data import Data
data = Data(memory.rom, args)
from event.events import Events
events = Events(memory.rom, args, data)
from menus.menus import Menus
menus = Menus(data.characters, ... | 18.903226 | 47 | 0.658703 |
a118e2c7c7d2367792ee43adc2e63b575a16051b | 7,463 | py | Python | purity_fb/purity_fb_1dot6/__init__.py | bsamz-ps/purity_fb_python_client | 11f27ef0c72d8aac1fc4e1ed036cca038b85dfa4 | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot6/__init__.py | bsamz-ps/purity_fb_python_client | 11f27ef0c72d8aac1fc4e1ed036cca038b85dfa4 | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot6/__init__.py | bsamz-ps/purity_fb_python_client | 11f27ef0c72d8aac1fc4e1ed036cca038b85dfa4 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.6 Python SDK
Pure Storage FlashBlade REST 1.X Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.6
Contact: i... | 48.148387 | 204 | 0.874715 |
ddb31abd0d9e9f8e730b621fc194ec33325db38d | 676 | py | Python | Container/LineList.py | ervin-meng/pyspider | cb98eed7f61a9ebde39a42d469e7fd93b06e15aa | [
"MIT"
] | null | null | null | Container/LineList.py | ervin-meng/pyspider | cb98eed7f61a9ebde39a42d469e7fd93b06e15aa | [
"MIT"
] | null | null | null | Container/LineList.py | ervin-meng/pyspider | cb98eed7f61a9ebde39a42d469e7fd93b06e15aa | [
"MIT"
] | null | null | null | # -*- coding=UTF-8 -*-
import redis
class LineList:
_type = 'stack' #queue
_name = ''
_media = ''
def __init__(self,name='',media='redis'):
self._name = name
if media=='redis':
self._media = redis.Redis(host='127.0.0.1',port=6379,decode_responses=True)
def add(sel... | 24.142857 | 87 | 0.578402 |
36a3f80c653ff0f67ba5a6ae16e450915d71366b | 5,699 | py | Python | Rain_fall_in_Australia.py | HeyKashit/Rain-fall-predication-in-Australia | e56d2f652352409d62c76652011d9afa2d9ec4f8 | [
"MIT"
] | 5 | 2021-08-16T17:17:02.000Z | 2021-09-26T10:45:20.000Z | Rain_fall_in_Australia.py | HeyKashit/Rain-fall-predication-in-Australia | e56d2f652352409d62c76652011d9afa2d9ec4f8 | [
"MIT"
] | null | null | null | Rain_fall_in_Australia.py | HeyKashit/Rain-fall-predication-in-Australia | e56d2f652352409d62c76652011d9afa2d9ec4f8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # This is Rain fall predication in Australia and EDA.
# ### Importing Modules
# In[1]:
# importing modules
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
get_ipython().run_line_magic('matplotlib', 'inline')
import warnings
warnin... | 17.535385 | 196 | 0.684331 |
6b7aee7b98cdf372573e4b7565f5301fc345a582 | 397 | py | Python | backend/test_32387/wsgi.py | crowdbotics-apps/test-32387 | a415af4c96bb26031486d8f66f5e6df4a398d7dd | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/test_32387/wsgi.py | crowdbotics-apps/test-32387 | a415af4c96bb26031486d8f66f5e6df4a398d7dd | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/test_32387/wsgi.py | crowdbotics-apps/test-32387 | a415af4c96bb26031486d8f66f5e6df4a398d7dd | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for test_32387 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
6365dcfd20853dd8205b7b4447f4d7388c73f03f | 7,437 | py | Python | python/led.py | wserr/audio-reactive-led-strip | 0da690891ab028c681ca251d2d0195c41108f79f | [
"MIT"
] | null | null | null | python/led.py | wserr/audio-reactive-led-strip | 0da690891ab028c681ca251d2d0195c41108f79f | [
"MIT"
] | null | null | null | python/led.py | wserr/audio-reactive-led-strip | 0da690891ab028c681ca251d2d0195c41108f79f | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import division
import platform
import numpy as np
import config
# ESP8266 uses WiFi communication
if config.DEVICE == 'esp8266':
import socket
_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Raspberry Pi controls the LED strip directly
elif con... | 32.194805 | 79 | 0.627269 |
816a5b78b8ee254579b6831402b421fd89de43d4 | 1,617 | py | Python | constants.py | deadrobots/Create-17 | c90c985c75f5994e17b6b9e5f1754e582b2d1310 | [
"MIT"
] | null | null | null | constants.py | deadrobots/Create-17 | c90c985c75f5994e17b6b9e5f1754e582b2d1310 | [
"MIT"
] | null | null | null | constants.py | deadrobots/Create-17 | c90c985c75f5994e17b6b9e5f1754e582b2d1310 | [
"MIT"
] | null | null | null | from wallaby import digital
# Misc
ALLOW_BUTTON_WAIT = False
START_TIME = 0
CLONE_SWITCH = 9
IS_CLONE = digital(CLONE_SWITCH)
IS_PRIME = not IS_CLONE
STARTLIGHT = 2
FRONT_BUMPED = 0
# Tophats
LEFT_TOPHAT = 0
RIGHT_TOPHAT = 5
THRESHOLD = 1500
# Servos
SERVO_CLAW = 3
SERVO_ARM = 1
SERVO_HAY_SPIN = 2
SERVO_HAY_ARM = ... | 19.25 | 45 | 0.737168 |
aae54f0ed01ffd698276125639b4ed160db2db92 | 11,521 | py | Python | datalad/distribution/create_sibling_github.py | psychoinformatics-de/datalad | 7435edc1d3c73ae2254fa4bfcb8412a8de6d8d4c | [
"MIT"
] | null | null | null | datalad/distribution/create_sibling_github.py | psychoinformatics-de/datalad | 7435edc1d3c73ae2254fa4bfcb8412a8de6d8d4c | [
"MIT"
] | null | null | null | datalad/distribution/create_sibling_github.py | psychoinformatics-de/datalad | 7435edc1d3c73ae2254fa4bfcb8412a8de6d8d4c | [
"MIT"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | 41.442446 | 90 | 0.588143 |
4be32c9cff0e5dbf1af563bfa8c53555adceb91c | 2,185 | py | Python | core/error.py | ykomashiro/gd-backup | 02d2513345a666aec131e94411b5f4c177fbe6ec | [
"MIT"
] | 1 | 2020-12-11T04:13:20.000Z | 2020-12-11T04:13:20.000Z | core/error.py | ykomashiro/gd-backup | 02d2513345a666aec131e94411b5f4c177fbe6ec | [
"MIT"
] | null | null | null | core/error.py | ykomashiro/gd-backup | 02d2513345a666aec131e94411b5f4c177fbe6ec | [
"MIT"
] | null | null | null | import logging
import logging.config
import os
import threading
import yaml
def synchronized(func):
func.__lock__ = threading.Lock()
def lock_func(*args, **kwargs):
with func.__lock__:
return func(*args, **kwargs)
return lock_func
class LogSingleton(object):
instance = None
... | 24.550562 | 72 | 0.577574 |
12f7a3ce5186ac63f9cb24543fa28cbce8a64e51 | 12,920 | py | Python | mars/scheduler/assigner.py | wdkwyf/mars | 3f750e360e64380eab779301a5103994d4886b6a | [
"Apache-2.0"
] | null | null | null | mars/scheduler/assigner.py | wdkwyf/mars | 3f750e360e64380eab779301a5103994d4886b6a | [
"Apache-2.0"
] | null | null | null | mars/scheduler/assigner.py | wdkwyf/mars | 3f750e360e64380eab779301a5103994d4886b6a | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2018 Alibaba Group Holding 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 a... | 35.20436 | 118 | 0.641486 |
121cd448f86b4f1d0e8b5865b5282f4a2fbeb2d1 | 10,789 | py | Python | l5kit/l5kit/tests/evaluation/metrics_test.py | cdicle-motional/l5kit | 4dc4ee5391479bb71f0b373f39c316f9eef5a961 | [
"Apache-2.0"
] | 1 | 2021-12-04T17:48:53.000Z | 2021-12-04T17:48:53.000Z | l5kit/l5kit/tests/evaluation/metrics_test.py | cdicle-motional/l5kit | 4dc4ee5391479bb71f0b373f39c316f9eef5a961 | [
"Apache-2.0"
] | null | null | null | l5kit/l5kit/tests/evaluation/metrics_test.py | cdicle-motional/l5kit | 4dc4ee5391479bb71f0b373f39c316f9eef5a961 | [
"Apache-2.0"
] | 1 | 2021-11-19T08:13:46.000Z | 2021-11-19T08:13:46.000Z | import numpy as np
import pytest
import torch
from l5kit.evaluation.metrics import (_assert_shapes, average_displacement_error_mean,
average_displacement_error_oracle, CollisionType, detect_collision,
distance_to_reference_trajectory, final_di... | 39.811808 | 118 | 0.640467 |
508c810ab44598fb3c1164e772a97e5433629d51 | 2,612 | py | Python | subastas_repo/personas/views.py | diegoduncan21/subastas | 3bae0c9bbb90ad93688b91d6e86bcc64215c0125 | [
"BSD-3-Clause"
] | null | null | null | subastas_repo/personas/views.py | diegoduncan21/subastas | 3bae0c9bbb90ad93688b91d6e86bcc64215c0125 | [
"BSD-3-Clause"
] | null | null | null | subastas_repo/personas/views.py | diegoduncan21/subastas | 3bae0c9bbb90ad93688b91d6e86bcc64215c0125 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy
from django.views.generic import CreateView
from django.views.generic import DeleteView
from django.views.generic import ListView
from django.views.generic import UpdateView
fr... | 35.780822 | 73 | 0.737366 |
11ab84b872f8ffdb6b635eb6f4fbd6192888e39b | 228 | py | Python | chart/models.py | Dev-Briann/tutorials | 01faee527b869d7b3ca4393f194fd715e9325d10 | [
"MIT"
] | null | null | null | chart/models.py | Dev-Briann/tutorials | 01faee527b869d7b3ca4393f194fd715e9325d10 | [
"MIT"
] | null | null | null | chart/models.py | Dev-Briann/tutorials | 01faee527b869d7b3ca4393f194fd715e9325d10 | [
"MIT"
] | null | null | null | from django.db import models
class SalesRecords(models.Model):
month = models.IntegerField()
sales = models.DecimalField(max_digits=5, decimal_places=1)
expenses = models.DecimalField(max_digits=5, decimal_places=1) | 38 | 66 | 0.77193 |
83f39f1971833d9baede06e20e95a4f7bb985a47 | 11,793 | py | Python | dithermaker.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 1 | 2019-03-15T04:01:19.000Z | 2019-03-15T04:01:19.000Z | dithermaker.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 5 | 2017-12-11T00:11:39.000Z | 2021-07-09T17:05:16.000Z | dithermaker.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 2 | 2017-08-15T21:19:11.000Z | 2017-10-12T00:36:35.000Z | #!/usr/bin/env python
#######################
# Script to take center RA/DEC location & generate dithered offsets
# for baseline project exposures
########################
### History:
## 2014/07/21 rgm: take out "coordinates": "absolute",
## which we are told is invalid.
## 2014/07/25 rgm: fix --disableout... | 34.890533 | 149 | 0.572882 |
e3736f9d4e331c23c6f68daeddb8f940fea9e6e4 | 1,270 | py | Python | cloudml-samples-master/reddit_tft/path_constants.py | liufuyang/kaggle-youtube-8m | 1cfbbf92ec9b5ead791f98f7a09463ee165a8120 | [
"MIT"
] | 16 | 2017-04-09T09:51:00.000Z | 2019-04-29T11:29:32.000Z | cloudml-samples-master/reddit_tft/path_constants.py | liufuyang/kaggle-youtube-8m | 1cfbbf92ec9b5ead791f98f7a09463ee165a8120 | [
"MIT"
] | null | null | null | cloudml-samples-master/reddit_tft/path_constants.py | liufuyang/kaggle-youtube-8m | 1cfbbf92ec9b5ead791f98f7a09463ee165a8120 | [
"MIT"
] | 15 | 2017-03-12T18:17:21.000Z | 2019-07-16T21:52:24.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 37.352941 | 74 | 0.807874 |
23f891cddb45ff35c600092f13e618d6f99f5db0 | 2,063 | py | Python | PythonBaseDemo/WINSOCKdemo/15.4/multicast_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/WINSOCKdemo/15.4/multicast_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/WINSOCKdemo/15.4/multicast_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version 1.0 ... | 40.45098 | 73 | 0.428017 |
9044a36594457b9784f5addacc13cfaec75800b8 | 8,627 | py | Python | lib/dgm.py | marcsv87/Deep-PDE-Solvers | 3322704f0291dc98e5bdf8c81c57a95cbfe70981 | [
"MIT"
] | 5 | 2021-01-27T03:32:59.000Z | 2022-03-07T08:34:57.000Z | lib/dgm.py | msabvid/Deep-PDE-Solvers | 3322704f0291dc98e5bdf8c81c57a95cbfe70981 | [
"MIT"
] | null | null | null | lib/dgm.py | msabvid/Deep-PDE-Solvers | 3322704f0291dc98e5bdf8c81c57a95cbfe70981 | [
"MIT"
] | 3 | 2021-02-05T04:56:40.000Z | 2021-11-20T09:01:55.000Z | """
Deep Galerkin Method: https://arxiv.org/abs/1708.07469
"""
import torch
import torch.nn as nn
import numpy as np
import tqdm
from lib.options import BaseOption
class DGM_Layer(nn.Module):
def __init__(self, dim_x, dim_S, activation='Tanh'):
super(DGM_Layer, self).__init__()
if a... | 38.86036 | 196 | 0.588849 |
858121d9f4460e5291a0092474472dd95a4c8edf | 61,299 | py | Python | moto/events/models.py | number09/moto | 9e61ab22207454f69a84a7a9afaeef9eebafec43 | [
"Apache-2.0"
] | null | null | null | moto/events/models.py | number09/moto | 9e61ab22207454f69a84a7a9afaeef9eebafec43 | [
"Apache-2.0"
] | null | null | null | moto/events/models.py | number09/moto | 9e61ab22207454f69a84a7a9afaeef9eebafec43 | [
"Apache-2.0"
] | null | null | null | import copy
import os
import re
import json
import sys
import warnings
from collections import namedtuple
from datetime import datetime
from enum import Enum, unique
from json import JSONDecodeError
from operator import lt, le, eq, ge, gt
from boto3 import Session
from moto.core.exceptions import JsonRESTError
from m... | 33.717822 | 122 | 0.594431 |
928c7fd1f8ed0dd9a409c3faef0da00a25f58723 | 7,293 | py | Python | test/test_tensorflow_graph_pad_conv.py | deb-intel/LPOTtest | f7b7524c733e581668d15192b69f9d9a7ca5222d | [
"Apache-2.0"
] | null | null | null | test/test_tensorflow_graph_pad_conv.py | deb-intel/LPOTtest | f7b7524c733e581668d15192b69f9d9a7ca5222d | [
"Apache-2.0"
] | null | null | null | test/test_tensorflow_graph_pad_conv.py | deb-intel/LPOTtest | f7b7524c733e581668d15192b69f9d9a7ca5222d | [
"Apache-2.0"
] | null | null | null |
import unittest
import os
import yaml
import tensorflow as tf
from tensorflow.python.framework import graph_util
from lpot.adaptor.tf_utils.util import disable_random
def build_fake_yaml():
fake_yaml = '''
model:
name: fake_yaml
framework: tensorflow
inputs: input
... | 41.913793 | 103 | 0.566296 |
28949667ce219452bc7902e75750b933d46409c9 | 317 | py | Python | sapextractor/factory.py | aarkue/sap-meta-explorer | 613bf657bbaa72a3781a84664e5de7626516532f | [
"Apache-2.0"
] | null | null | null | sapextractor/factory.py | aarkue/sap-meta-explorer | 613bf657bbaa72a3781a84664e5de7626516532f | [
"Apache-2.0"
] | null | null | null | sapextractor/factory.py | aarkue/sap-meta-explorer | 613bf657bbaa72a3781a84664e5de7626516532f | [
"Apache-2.0"
] | null | null | null | from sapextractor.database_connection import factory as conn_factory
from sapextractor.algo import factory as algo_factory
def apply(db_type, db_con_arg, process, ext_type, ext_arg):
print(process)
con = conn_factory.apply(db_type, db_con_arg)
return algo_factory.apply(con, process, ext_type, ext_arg)
| 35.222222 | 68 | 0.798107 |
10eb809e38f62b27a9fd8f3084eb1e1b1061d198 | 83 | py | Python | unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py | byte-trading/unicorn-binance-websocket-api | 3aa2f87ef107db75c0c1aaebbcc6a8564357b256 | [
"MIT"
] | null | null | null | unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py | byte-trading/unicorn-binance-websocket-api | 3aa2f87ef107db75c0c1aaebbcc6a8564357b256 | [
"MIT"
] | null | null | null | unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py | byte-trading/unicorn-binance-websocket-api | 3aa2f87ef107db75c0c1aaebbcc6a8564357b256 | [
"MIT"
] | null | null | null | # backward compatibility <= 1.35.0
from .manager import BinanceWebSocketApiManager
| 27.666667 | 47 | 0.819277 |
ef944e45ac26c99652ffd616ddbf206a9ff3004b | 7,943 | py | Python | python3/madasterapi/model/account_response.py | Madaster/examples | bd2e8e464172e0d47cac8ed1672501a24ba624c3 | [
"MIT"
] | 2 | 2021-04-13T12:19:26.000Z | 2021-09-13T15:40:44.000Z | python3/madasterapi/model/account_response.py | Madaster/examples | bd2e8e464172e0d47cac8ed1672501a24ba624c3 | [
"MIT"
] | null | null | null | python3/madasterapi/model/account_response.py | Madaster/examples | bd2e8e464172e0d47cac8ed1672501a24ba624c3 | [
"MIT"
] | null | null | null | """
Madaster Private API - Build: 8815
Welcome to the **Madaster Private API** endpoint. This endpoint can be used to interact with the Madaster Platform and its resources. This API does not fully cover all functionality of the platform yet, please see below for the available functions and what they can be use... | 44.374302 | 1,015 | 0.607075 |
10c75cb45373b832a70aee9a8a77d1549bd75f6c | 5,398 | py | Python | ceph_installer/tests/controllers/test_tasks.py | ceph/ceph-installer | 79988577176d6ea628d6c4f50ed3f55831012a34 | [
"MIT"
] | 16 | 2016-02-26T01:06:13.000Z | 2020-03-04T02:04:35.000Z | ceph_installer/tests/controllers/test_tasks.py | ceph/ceph-installer | 79988577176d6ea628d6c4f50ed3f55831012a34 | [
"MIT"
] | 73 | 2016-02-11T14:56:25.000Z | 2021-11-25T02:09:04.000Z | ceph_installer/tests/controllers/test_tasks.py | ceph/mariner-installer | 79988577176d6ea628d6c4f50ed3f55831012a34 | [
"MIT"
] | 7 | 2016-02-12T17:49:02.000Z | 2021-01-27T10:49:14.000Z | from datetime import datetime
from uuid import uuid4
from ceph_installer.models import Task
class TestTasksController(object):
def create_task(self, **kw):
Task(
identifier=kw.get('identifier', str(uuid4())),
endpoint='/api/rgw/',
command='ansible-playbook -i "rgw.exa... | 35.513158 | 97 | 0.607818 |
beaa6e7dcb4fd89545e8acf61e26958347409499 | 777 | py | Python | samples/python2/mser.py | bonanza-market/opencv | 6550cb2a90b2b074234a3b2ae354d01a1e55fd2b | [
"BSD-3-Clause"
] | 144 | 2015-01-15T03:38:44.000Z | 2022-02-17T09:07:52.000Z | samples/python2/mser.py | bonanza-market/opencv | 6550cb2a90b2b074234a3b2ae354d01a1e55fd2b | [
"BSD-3-Clause"
] | 9 | 2015-09-09T06:51:46.000Z | 2020-06-17T14:10:10.000Z | samples/python2/mser.py | bonanza-market/opencv | 6550cb2a90b2b074234a3b2ae354d01a1e55fd2b | [
"BSD-3-Clause"
] | 73 | 2015-06-20T15:59:27.000Z | 2020-03-15T22:43:36.000Z | #!/usr/bin/env python
'''
MSER detector demo
==================
Usage:
------
mser.py [<video source>]
Keys:
-----
ESC - exit
'''
import numpy as np
import cv2
import video
if __name__ == '__main__':
import sys
try:
video_src = sys.argv[1]
except:
video_src = 0
cam = vid... | 18.069767 | 70 | 0.544402 |
55ff1b78f2053054f32802d609009c846a1fa086 | 2,866 | py | Python | python/game-idea/main.py | ASMlover/study | 5878f862573061f94c5776a351e30270dfd9966a | [
"BSD-2-Clause"
] | 22 | 2015-05-18T07:04:36.000Z | 2021-08-02T03:01:43.000Z | python/game-idea/main.py | ASMlover/study | 5878f862573061f94c5776a351e30270dfd9966a | [
"BSD-2-Clause"
] | 1 | 2017-08-31T22:13:57.000Z | 2017-09-05T15:00:25.000Z | python/game-idea/main.py | ASMlover/study | 5878f862573061f94c5776a351e30270dfd9966a | [
"BSD-2-Clause"
] | 6 | 2015-06-06T07:16:12.000Z | 2021-07-06T13:45:56.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) 2015 ASMlover. 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 copyrig... | 36.278481 | 78 | 0.693301 |
64afce562e4810200045ab9a731f6f158c821182 | 10,165 | py | Python | src/test/python/apache/aurora/client/commands/test_hooks.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | src/test/python/apache/aurora/client/commands/test_hooks.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | src/test/python/apache/aurora/client/commands/test_hooks.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2013 Apache Software Foundation
#
# 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... | 40.987903 | 97 | 0.742056 |
c646c7b3541053893948864e59933756383f6dc0 | 2,235 | py | Python | bevy/app/agents/hooks.py | ZechCodes/bevy.app | c56bd1dba456969807abd8b71f8f02a68c23025d | [
"MIT"
] | null | null | null | bevy/app/agents/hooks.py | ZechCodes/bevy.app | c56bd1dba456969807abd8b71f8f02a68c23025d | [
"MIT"
] | null | null | null | bevy/app/agents/hooks.py | ZechCodes/bevy.app | c56bd1dba456969807abd8b71f8f02a68c23025d | [
"MIT"
] | null | null | null | from __future__ import annotations
from asyncio import gather
from collections import defaultdict
from copy import deepcopy
from inspect import isawaitable, getmro
from typing import Awaitable, Callable, cast, Generator, Iterable, ParamSpec, TypeVar
P = ParamSpec("P")
R = TypeVar("R")
class HookClassRepository:
... | 29.8 | 87 | 0.640268 |
2263c68d084352050a83e2bb94465b9c0f097aff | 7,004 | py | Python | desktop/core/ext-py/Twisted/twisted/internet/pollreactor.py | civascu/hue | 82f2de44789ff5a981ed725175bae7944832d1e9 | [
"Apache-2.0"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | desktop/core/ext-py/Twisted/twisted/internet/pollreactor.py | civascu/hue | 82f2de44789ff5a981ed725175bae7944832d1e9 | [
"Apache-2.0"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | desktop/core/ext-py/Twisted/twisted/internet/pollreactor.py | civascu/hue | 82f2de44789ff5a981ed725175bae7944832d1e9 | [
"Apache-2.0"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | # Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A poll() based implementation of the twisted main loop.
To install the event loop (and you should do this before any connections,
listeners or connectors are added)::
from twisted.internet import pollreactor
pollreactor.in... | 32.12844 | 83 | 0.602227 |
ae14ade4b9a99521ad80e408e0d523f519e11c82 | 2,918 | py | Python | thumbor/engines/gif.py | ustun/thumbor | 2641b17a6cea5d3ebf20abd1d2b464565c1b8b97 | [
"MIT"
] | 1 | 2019-03-05T13:30:19.000Z | 2019-03-05T13:30:19.000Z | thumbor/engines/gif.py | ustun/thumbor | 2641b17a6cea5d3ebf20abd1d2b464565c1b8b97 | [
"MIT"
] | null | null | null | thumbor/engines/gif.py | ustun/thumbor | 2641b17a6cea5d3ebf20abd1d2b464565c1b8b97 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
import re
from subprocess import Popen, PIPE
from thumbor.engines.p... | 29.77551 | 113 | 0.63194 |
57b7fafdadde1c9a1b526801b9000a04c4b48fb6 | 8,305 | py | Python | FGSM-RS/src/base.py | MTandHJ/Pytorch-Robust | 612ec7e71ca11d3b84aacb3aead3253436ba3d2b | [
"MIT"
] | 4 | 2021-11-20T13:11:20.000Z | 2021-12-11T06:50:34.000Z | FGSM-RS/src/base.py | MTandHJ/PyTorch-Robust | 1ba0a96953032db7952278ea49b2f1d5cdfac12c | [
"MIT"
] | null | null | null | FGSM-RS/src/base.py | MTandHJ/PyTorch-Robust | 1ba0a96953032db7952278ea49b2f1d5cdfac12c | [
"MIT"
] | null | null | null |
from typing import Callable, Any, Union, Optional, List, Tuple, Dict, Iterable, cast
import torch
import torch.nn as nn
import foolbox as fb
import os
from models.base import AdversarialDefensiveModule
from .utils import AverageMeter, ProgressMeter, timemeter, getLogger
from .loss_zoo import cross_entropy, kl_diver... | 33.087649 | 97 | 0.615653 |
b17c36265cd2fe08df7021090d94b14b34aa97f9 | 5,254 | py | Python | torch_geometric/nn/conv/gmm_conv.py | shrey-bansal/pytorch_geometric | 17108a08066b0a73530544d01719b186f2625ef2 | [
"MIT"
] | 1 | 2020-11-23T14:29:11.000Z | 2020-11-23T14:29:11.000Z | torch_geometric/nn/conv/gmm_conv.py | shrey-bansal/pytorch_geometric | 17108a08066b0a73530544d01719b186f2625ef2 | [
"MIT"
] | null | null | null | torch_geometric/nn/conv/gmm_conv.py | shrey-bansal/pytorch_geometric | 17108a08066b0a73530544d01719b186f2625ef2 | [
"MIT"
] | null | null | null | import torch
from torch.nn import Parameter
from torch_geometric.nn.conv import MessagePassing
from ..inits import zeros, glorot
class GMMConv(MessagePassing):
r"""The gaussian mixture model convolutional operator from the `"Geometric
Deep Learning on Graphs and Manifolds using Mixture Model CNNs"
<https... | 38.072464 | 79 | 0.57461 |
66380fd391d9d62a64060be4225f406eaca6e5fd | 501 | py | Python | packages/pyright-internal/src/tests/samples/generators5.py | lipovsek/pytea | c536515a5e5947fac8871784323ba7eddc58956d | [
"MIT"
] | null | null | null | packages/pyright-internal/src/tests/samples/generators5.py | lipovsek/pytea | c536515a5e5947fac8871784323ba7eddc58956d | [
"MIT"
] | null | null | null | packages/pyright-internal/src/tests/samples/generators5.py | lipovsek/pytea | c536515a5e5947fac8871784323ba7eddc58956d | [
"MIT"
] | null | null | null | # This sample tests various type checking operations relating to
# async generator functions where the return type is declared.
from typing import AsyncIterable, AsyncIterator
async def g1_explicit() -> AsyncIterator[int]:
yield 1
yield 2
async def g2_explicit():
async for v in g1_explicit(... | 20.04 | 65 | 0.668663 |
c4a12bd449c153af1a4891a952d953cf0bc1ca66 | 531 | py | Python | packages/python/plotly/plotly/validators/heatmap/colorbar/_exponentformat.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/heatmap/colorbar/_exponentformat.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/heatmap/colorbar/_exponentformat.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ExponentformatValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="exponentformat", parent_name="heatmap.colorbar", **kwargs
):
super(ExponentformatValidator, self).__init__(
plotly_name=plotly_name,... | 35.4 | 84 | 0.640301 |
3874ca2d0bcf303f0911b6fffc2c91174ab19f06 | 291 | py | Python | 8day/pan05.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 8day/pan05.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 8day/pan05.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | #Pan05
import chardet
def find_encoding(file):
f1 = open(file, 'rb').read()
#print(f1)
res = chardet.detect(f1)
encType = res['encoding']
return encType
import pandas as pd
file1 = './data/01. CCTV_in_Seoul.csv'
df1 = pd.read_csv(file1, encoding= find_encoding(file1))
| 20.785714 | 56 | 0.676976 |
75a28812f23ef9578f19bb919b6158135858ce77 | 1,346 | py | Python | girvi/filters.py | rajeshr188/django-onex | f1086a4159b1d135e54327c77c93fcc6c446338f | [
"MIT"
] | 2 | 2019-06-08T22:50:59.000Z | 2020-07-12T14:13:18.000Z | girvi/filters.py | rajeshr188/django-onex | f1086a4159b1d135e54327c77c93fcc6c446338f | [
"MIT"
] | 13 | 2020-02-11T23:51:43.000Z | 2021-06-05T13:10:49.000Z | girvi/filters.py | rajeshr188/django-onex | f1086a4159b1d135e54327c77c93fcc6c446338f | [
"MIT"
] | null | null | null | from .models import Loan, LoanStatement,Release,Adjustment
from contact.models import Customer
import django_filters
from django_select2.forms import Select2Widget
class LoanFilter(django_filters.FilterSet):
loanid=django_filters.CharFilter(lookup_expr='icontains')
itemdesc=django_filters.CharFilter(lookup_exp... | 35.421053 | 93 | 0.70951 |
f39e96656d5c1472b3ffaa5714389a87faff49b2 | 3,675 | py | Python | src/sentry/models/groupmeta.py | ChadKillingsworth/sentry | ffcb9007a95a83ee267935fe605f8ee8f03a85a5 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/models/groupmeta.py | ChadKillingsworth/sentry | ffcb9007a95a83ee267935fe605f8ee8f03a85a5 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/models/groupmeta.py | ChadKillingsworth/sentry | ffcb9007a95a83ee267935fe605f8ee8f03a85a5 | [
"BSD-3-Clause"
] | null | null | null | """
sentry.models.groupmeta
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import threading
from celery.signals import task_postrun
from django.core.signals import request_fini... | 30.122951 | 86 | 0.646531 |
23418c7b5788e28db416fa1622a539028b61882b | 6,401 | py | Python | pystash/web.py | ashishchopra/pystash | 6fad5e7ea4684eb4cf749028be2162c047db1f30 | [
"MIT"
] | 6 | 2015-02-23T19:41:42.000Z | 2015-12-24T10:25:54.000Z | pystash/web.py | ashishchopra/pystash | 6fad5e7ea4684eb4cf749028be2162c047db1f30 | [
"MIT"
] | null | null | null | pystash/web.py | ashishchopra/pystash | 6fad5e7ea4684eb4cf749028be2162c047db1f30 | [
"MIT"
] | 2 | 2017-06-01T04:40:08.000Z | 2021-08-30T20:15:04.000Z | # -*- coding: utf-8 -*-
from requests.auth import AuthBase
import requests
import json
import hashlib
import sys
import os
import getpass
from clint.textui import colored
from common import output
import netrc
STASH_HOST = 'http://getstash.herokuapp.com'
if 'STASH_HOST' in os.environ:
STASH_HOST = os.environ['ST... | 25.91498 | 108 | 0.578816 |
a2641655841c9b41f0882b5bd354b408ef903a9a | 5,833 | py | Python | from_3b1b/on_hold/holomorphic.py | WRangers/manim | 38acb22c7e5c1a95afdf05678e07ad506513d676 | [
"MIT"
] | 1 | 2021-09-20T14:16:46.000Z | 2021-09-20T14:16:46.000Z | source/manimlib/from_3b1b/on_hold/holomorphic.py | WRangers/manim_doc | 22e0936ab3b409358fa71b335897aa99aa46b5a0 | [
"MIT"
] | null | null | null | source/manimlib/from_3b1b/on_hold/holomorphic.py | WRangers/manim_doc | 22e0936ab3b409358fa71b335897aa99aa46b5a0 | [
"MIT"
] | 1 | 2021-08-23T04:14:19.000Z | 2021-08-23T04:14:19.000Z | from manimlib.imports import *
class ComplexAnalysisOverlay(Scene):
def construct(self):
words = TextMobject("Complex analysis")
words.scale(1.25)
words.to_edge(UP)
words.add_background_rectangle()
self.add(words)
self.wait()
class AnalyzeZSquared(ComplexTransform... | 31.701087 | 73 | 0.564032 |
59fb44dc6cef37153964603c83f25d1ee81c7672 | 2,698 | py | Python | plugins/lookup/vars_dict_start_with.py | franzs/ansible-plugins | 1babfc9f0876b3dc54cc680931543bc2217e6ed4 | [
"MIT"
] | 2 | 2015-11-03T14:28:57.000Z | 2018-03-31T18:41:04.000Z | plugins/lookup/vars_dict_start_with.py | franzs/ansible-plugins | 1babfc9f0876b3dc54cc680931543bc2217e6ed4 | [
"MIT"
] | 3 | 2017-09-20T20:32:29.000Z | 2020-01-22T14:51:18.000Z | plugins/lookup/vars_dict_start_with.py | franzs/ansible-plugins | 1babfc9f0876b3dc54cc680931543bc2217e6ed4 | [
"MIT"
] | 1 | 2018-06-27T07:35:07.000Z | 2018-06-27T07:35:07.000Z | # (c) 2018 David Lundgren
# MIT
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: vars_dict_starts_with
author: David Lundgren
version_added: "2.5"
short_description: Lookup templated value of variables that start with a prefix
desc... | 29.010753 | 119 | 0.699036 |
d6f1a867c1e8f0150a4954ddeb454cb8768dd876 | 1,057 | py | Python | datastructure/practice/c2/c_2_27.py | stoneyangxu/python-kata | 979af91c74718a525dcd2a83fe53ec6342af9741 | [
"MIT"
] | null | null | null | datastructure/practice/c2/c_2_27.py | stoneyangxu/python-kata | 979af91c74718a525dcd2a83fe53ec6342af9741 | [
"MIT"
] | null | null | null | datastructure/practice/c2/c_2_27.py | stoneyangxu/python-kata | 979af91c74718a525dcd2a83fe53ec6342af9741 | [
"MIT"
] | null | null | null | import unittest
import time
class Range:
def __init__(self, start, stop=None, step=1):
if step == 0:
raise ValueError("step cannot be 0")
if stop is None:
start, stop = 0, start
self._length = max(0, (stop - start + step - 1) // step)
self._start = start
... | 23.488889 | 79 | 0.561022 |
ce4fc51f61fbd73810eeb56a5985ea09981fb25b | 14,597 | py | Python | src/gui/main_gui_controller.py | kamilcieslik/test_house_price_app | f7c5786d0e79e23bafaedd24088aa506c04b5527 | [
"MIT"
] | 1 | 2019-02-15T03:42:43.000Z | 2019-02-15T03:42:43.000Z | src/gui/main_gui_controller.py | kamilcieslik/test_house_price_app | f7c5786d0e79e23bafaedd24088aa506c04b5527 | [
"MIT"
] | 1 | 2021-06-01T22:12:11.000Z | 2021-06-01T22:12:11.000Z | src/gui/main_gui_controller.py | kamilcieslik/test_house_price_app | f7c5786d0e79e23bafaedd24088aa506c04b5527 | [
"MIT"
] | null | null | null | import sys
from PyQt5 import QtWidgets
from src.gui.main_gui import GuiMainWindow
from src.gui.widgets_data_validation import DataValidation
from calculator.prices_calculator import PricesCalculator
from calculator import exception
from googlemaps.exceptions import TransportError
import os
from pathlib import Path
fro... | 49.314189 | 107 | 0.536823 |
57e58f2eebb06c089b1fed3da60669000227a5e5 | 8,100 | py | Python | tools/subunit-trace.py | queria/my-tempest | a9cdee0201bb956c7502fd372dab467b056ba67f | [
"Apache-2.0"
] | 1 | 2021-06-12T14:54:52.000Z | 2021-06-12T14:54:52.000Z | tools/subunit-trace.py | queria/my-tempest | a9cdee0201bb956c7502fd372dab467b056ba67f | [
"Apache-2.0"
] | null | null | null | tools/subunit-trace.py | queria/my-tempest | a9cdee0201bb956c7502fd372dab467b056ba67f | [
"Apache-2.0"
] | 1 | 2017-07-11T13:54:27.000Z | 2017-07-11T13:54:27.000Z | #!/usr/bin/env python
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# Copyright 2014 Samsung Electronics
# 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
#... | 32.66129 | 79 | 0.596543 |
080ceaf39eda9a13dae50629f0ca816ca74a421f | 1,745 | py | Python | apps/drug_target_interaction/sman/metrics.py | RuikangSun/PaddleHelix | 1c84ea6d51625d2d66b3eef1d9a7cc9a87c99e0e | [
"Apache-2.0"
] | 454 | 2020-11-21T01:02:45.000Z | 2022-03-29T12:53:40.000Z | apps/drug_target_interaction/sman/metrics.py | chupvl/PaddleHelix | 6e082f89b8090c3c360593d40a08bffc884165dd | [
"Apache-2.0"
] | 161 | 2020-12-12T06:35:54.000Z | 2022-03-27T11:31:13.000Z | apps/drug_target_interaction/sman/metrics.py | chupvl/PaddleHelix | 6e082f89b8090c3c360593d40a08bffc884165dd | [
"Apache-2.0"
] | 108 | 2020-12-07T09:01:10.000Z | 2022-03-31T14:42:29.000Z | # Copyright (c) 2019 PaddlePaddle 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 applic... | 23.90411 | 74 | 0.558166 |
b328322788cbfca9d9bffe46d26a1da6db094786 | 32,933 | py | Python | src/unity/python/turicreate/toolkits/topic_model/topic_model.py | fossabot/turicreate | a500d5e52143ad15ebdf771d9f74198982c7c45c | [
"BSD-3-Clause"
] | 1 | 2019-04-16T19:51:18.000Z | 2019-04-16T19:51:18.000Z | src/unity/python/turicreate/toolkits/topic_model/topic_model.py | tashby/turicreate | 7f07ce795833d0c56c72b3a1fb9339bed6d178d1 | [
"BSD-3-Clause"
] | 3 | 2021-09-08T02:18:00.000Z | 2022-03-12T00:39:44.000Z | src/unity/python/turicreate/toolkits/topic_model/topic_model.py | tashby/turicreate | 7f07ce795833d0c56c72b3a1fb9339bed6d178d1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Methods for creating a topic model and predicting the topics of new documents.
"... | 39.48801 | 110 | 0.582698 |
72b9f9fecf8548643a9b6d1e938fb80d5005be97 | 1,304 | py | Python | diayn/policies/diayn_policy.py | fgitmichael/SelfSupevisedSkillDiscovery | 60eee11cfd67046190dd2784bf40e97bdbed9d40 | [
"MIT"
] | null | null | null | diayn/policies/diayn_policy.py | fgitmichael/SelfSupevisedSkillDiscovery | 60eee11cfd67046190dd2784bf40e97bdbed9d40 | [
"MIT"
] | 6 | 2021-02-02T23:00:02.000Z | 2022-01-13T03:13:51.000Z | diayn/policies/diayn_policy.py | fgitmichael/SelfSupevisedSkillDiscovery | 60eee11cfd67046190dd2784bf40e97bdbed9d40 | [
"MIT"
] | null | null | null | import numpy as np
from diayn_cont.policy.skill_policy_obs_dim_select import SkillTanhGaussianPolicyObsSelect
from rlkit.policies.base import Policy
class SkillTanhGaussianPolicyObsSelectDIAYN(SkillTanhGaussianPolicyObsSelect):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
... | 25.076923 | 90 | 0.67408 |
776e847d3eb72eec215f75615acef2f5b20f6386 | 3,758 | py | Python | animate_flex.py | martin-rdz/trace_airmass_source | 0b850d6dcfc33ebc6fe19a0c0898ab3e7d5693de | [
"MIT"
] | 3 | 2020-12-11T10:38:06.000Z | 2021-03-07T11:06:16.000Z | animate_flex.py | martin-rdz/trace_airmass_source | 0b850d6dcfc33ebc6fe19a0c0898ab3e7d5693de | [
"MIT"
] | 3 | 2020-12-03T15:50:14.000Z | 2021-04-06T08:20:30.000Z | animate_flex.py | martin-rdz/trace_airmass_source | 0b850d6dcfc33ebc6fe19a0c0898ab3e7d5693de | [
"MIT"
] | 2 | 2021-03-03T02:17:01.000Z | 2022-02-07T16:52:21.000Z | #! /usr/bin/env python3
# coding=utf-8
""""""
"""
Author: radenz@tropos.de
"""
import datetime
import argparse
import sys, os
import gc
import subprocess
import traceback
import numpy as np
import toml
sys.path.append("..")
import trace_source
parser = argparse.ArgumentParser()
parser.add_argument('--station', he... | 33.553571 | 137 | 0.644758 |
e1b6524a7d7500c72a6ffb0bf4b324174c35d36c | 660 | py | Python | examples/plotting/file/linked_brushing.py | andreagrant/bokehDev | a684afee183496c54d4f187a890707cf6b5ec2a5 | [
"BSD-3-Clause"
] | 1 | 2021-04-03T13:05:55.000Z | 2021-04-03T13:05:55.000Z | examples/plotting/file/linked_brushing.py | andreagrant/bokehDev | a684afee183496c54d4f187a890707cf6b5ec2a5 | [
"BSD-3-Clause"
] | null | null | null | examples/plotting/file/linked_brushing.py | andreagrant/bokehDev | a684afee183496c54d4f187a890707cf6b5ec2a5 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, gridplot, show, output_file
N = 300
x = np.linspace(0, 4*np.pi, N)
y1 = np.sin(x)
y2 = np.cos(x)
source = ColumnDataSource(data=dict(x=x, y1=y1, y2=y2))
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select,lasso_select... | 22.758621 | 72 | 0.730303 |
17a3d8f982232d537ecc9171ac1945c9c6316042 | 1,686 | py | Python | minmax.py | lkesteloot/verilog_minmax | f6d774cd8a823d2382c86a349b4385545483fc99 | [
"Apache-2.0"
] | 1 | 2018-05-13T20:54:18.000Z | 2018-05-13T20:54:18.000Z | minmax.py | lkesteloot/verilog_minmax | f6d774cd8a823d2382c86a349b4385545483fc99 | [
"Apache-2.0"
] | null | null | null | minmax.py | lkesteloot/verilog_minmax | f6d774cd8a823d2382c86a349b4385545483fc99 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2017 Lawrence Kesteloot
#
# 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 requi... | 32.423077 | 78 | 0.658363 |
f361983656edd9ac8d26c35bf68e545514e019ec | 1,434 | py | Python | noxfile.py | kjelljorner/libconeangle | 52ef8f38d41a8d6feea0869f457a85598cf6e59b | [
"MIT"
] | 8 | 2022-03-21T07:02:14.000Z | 2022-03-31T22:58:32.000Z | noxfile.py | kjelljorner/libconeangle | 52ef8f38d41a8d6feea0869f457a85598cf6e59b | [
"MIT"
] | 1 | 2022-03-26T10:24:32.000Z | 2022-03-26T14:12:02.000Z | noxfile.py | kjelljorner/libconeangle | 52ef8f38d41a8d6feea0869f457a85598cf6e59b | [
"MIT"
] | null | null | null | """Automated testing linting and formatting apparatus."""
import nox
from nox.sessions import Session
package = "libconeangle"
nox.options.sessions = "lint", "tests", "mypy" # default session
locations = "libconeangle", "test", "noxfile.py" # Linting locations
pyversions = ["3.8", "3.9", "3.10"]
# Testing
@nox.se... | 25.607143 | 84 | 0.638075 |
201bf1453b1c34e9762b94dece9cbb1570bcd514 | 4,205 | py | Python | userbot/modules/emojigames.py | Rewtio/Mikoo-Userbot | 418f0017241fa65bdf7f99c84381317cb4dbeb55 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2022-03-03T01:31:48.000Z | 2022-03-26T00:15:41.000Z | userbot/modules/emojigames.py | Rewtio/Mikoo-Userbot | 418f0017241fa65bdf7f99c84381317cb4dbeb55 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2022-03-16T02:54:27.000Z | 2022-03-17T09:17:12.000Z | userbot/modules/emojigames.py | Rewtio/Mikoo-Userbot | 418f0017241fa65bdf7f99c84381317cb4dbeb55 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2022-03-16T02:41:38.000Z | 2022-03-16T02:41:38.000Z | # fix by @heyworld for OUB
# bug fixed by @d3athwarrior
# Recode by @divarvian
# t.me/MikooUserbot
from telethon.tl.types import InputMediaDice
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP
from userbot.utils import man_cmd
@man_cmd(pattern="dice(?: |$)(.*)")
async def _(event):
if event.f... | 31.380597 | 93 | 0.575981 |
ca03532eed4d8af744b0ba9f8bb14c25db6d08d4 | 2,308 | py | Python | stem_testing/examples/client_usage/Custom_Path_Selection.py | joshuatee/Posh-Stem | bc7f1d4e010e8a7f1e1e4dd70518ec6b1d210fa0 | [
"Unlicense"
] | 1 | 2019-04-02T00:15:59.000Z | 2019-04-02T00:15:59.000Z | stem_testing/examples/client_usage/Custom_Path_Selection.py | joshuatee/Posh-Stem | bc7f1d4e010e8a7f1e1e4dd70518ec6b1d210fa0 | [
"Unlicense"
] | null | null | null | stem_testing/examples/client_usage/Custom_Path_Selection.py | joshuatee/Posh-Stem | bc7f1d4e010e8a7f1e1e4dd70518ec6b1d210fa0 | [
"Unlicense"
] | null | null | null | import StringIO
import time
import pycurl
import stem.control
# Static exit for us to make 2-hop circuits through. Picking aurora, a
# particularly beefy one...
#
# https://atlas.torproject.org/#details/379FB450010D17078B3766C2273303C358C3A442
EXIT_FINGERPRINT = '379FB450010D17078B3766C2273303C358C3A442'
SOCKS_P... | 29.21519 | 89 | 0.737002 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.