hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0a6f3a549a3f8a41861c7ee807040649078ca252 | 3,461 | py | Python | ss_baselines/saven/ddppo/algo/ddppo.py | gtatiya/sound-spaces | 52792865b2a491883bdbfebbc015acaf980a8d3a | [
"CC-BY-4.0"
] | 1 | 2021-09-28T16:04:09.000Z | 2021-09-28T16:04:09.000Z | ss_baselines/saven/ddppo/algo/ddppo.py | gtatiya/sound-spaces | 52792865b2a491883bdbfebbc015acaf980a8d3a | [
"CC-BY-4.0"
] | null | null | null | ss_baselines/saven/ddppo/algo/ddppo.py | gtatiya/sound-spaces | 52792865b2a491883bdbfebbc015acaf980a8d3a | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from typing import Tuple
import torch
import torch.distributed as distrib
from ss_baselines.saven.... | 34.959596 | 97 | 0.649812 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from typing import Tuple
import torch
import torch.distributed as distrib
from ss_baselines.saven.... | 873 | 1,177 | 46 |
2261ff7ea8e67e5456531bd1d61559ba5cca2948 | 2,166 | py | Python | generated-libraries/python/netapp/ntdtest/group2_view_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/ntdtest/group2_view_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/ntdtest/group2_view_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | from netapp.netapp_object import NetAppObject
class Group2ViewInfo(NetAppObject):
"""
2nd nested typedef at level 1
"""
_field_5 = None
@property
def field_5(self):
"""
Generic/Dummy Field 5
Attributes: required-for-create, modifiable
"""
return self... | 25.785714 | 89 | 0.537858 | from netapp.netapp_object import NetAppObject
class Group2ViewInfo(NetAppObject):
"""
2nd nested typedef at level 1
"""
_field_5 = None
@property
def field_5(self):
"""
Generic/Dummy Field 5
Attributes: required-for-create, modifiable
"""
return self... | 936 | 0 | 187 |
047464dd0842beeeadd509639a066e71adabcead | 1,427 | py | Python | chapter09/chain.py | JoeanAmiee/Mastering-Python-Design-Patterns-Second-Edition | 89c55dcf5e1e0e730dde593b487050f360371932 | [
"MIT"
] | 278 | 2018-08-16T12:59:24.000Z | 2022-03-21T08:21:11.000Z | chapter09/chain.py | 50611/Mastering-Python-Design-Patterns-Second-Edition | 6efc4a935f15d2aa6c840131f72fb8c53a493a93 | [
"MIT"
] | 4 | 2019-05-16T11:44:45.000Z | 2022-02-04T07:24:47.000Z | chapter09/chain.py | 50611/Mastering-Python-Design-Patterns-Second-Edition | 6efc4a935f15d2aa6c840131f72fb8c53a493a93 | [
"MIT"
] | 166 | 2018-08-13T21:47:16.000Z | 2022-03-18T12:20:31.000Z |
if __name__ == '__main__':
main()
| 26.924528 | 55 | 0.553609 | class Event:
def __init__(self, name):
self.name = name
def __str__(self):
return self.name
class Widget:
def __init__(self, parent=None):
self.parent = parent
def handle(self, event):
handler = f'handle_{event}'
if hasattr(self, handler)... | 1,008 | -8 | 384 |
dc532744bff28dc0b15b2faea563fe4cb6ff5ae6 | 5,260 | py | Python | venv/Lib/site-packages/PySide2/examples/sql/books/ui_bookwindow.py | Farhan-Malik/advance-hand-gesture | 0ebe21ddd7c8c2eb14746678be57b33d38c47205 | [
"MIT"
] | 41 | 2021-06-19T13:57:18.000Z | 2021-12-02T17:08:53.000Z | venv/Lib/site-packages/PySide2/examples/sql/books/ui_bookwindow.py | Farhan-Malik/advance-hand-gesture | 0ebe21ddd7c8c2eb14746678be57b33d38c47205 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | venvWIN/Lib/site-packages/PySide2/examples/sql/books/ui_bookwindow.py | NeroNekro/PortableController | a8bbfc1b6c8cb2c919e48eb0104e42f436059b18 | [
"BSD-3-Clause"
] | 4 | 2021-07-02T03:09:51.000Z | 2021-11-25T13:00:10.000Z | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'bookwindow.ui'
##
## Created by: Qt User Interface Compiler version 5.14.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###############... | 40.461538 | 96 | 0.68251 | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'bookwindow.ui'
##
## Created by: Qt User Interface Compiler version 5.14.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###############... | 4,459 | 7 | 76 |
24c230a304bff436e218ccf5ebd50b2cdc35065c | 2,356 | py | Python | src/analysisService.py | openeuler-mirror/hpcrunner | 338bc16b1dceb3909a49a6a51c0946c4b1a30f77 | [
"MulanPSL-1.0"
] | null | null | null | src/analysisService.py | openeuler-mirror/hpcrunner | 338bc16b1dceb3909a49a6a51c0946c4b1a30f77 | [
"MulanPSL-1.0"
] | null | null | null | src/analysisService.py | openeuler-mirror/hpcrunner | 338bc16b1dceb3909a49a6a51c0946c4b1a30f77 | [
"MulanPSL-1.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from machineService import MachineService
from configService import ConfigService
from downloadService import DownloadService
from installService import InstallService
from envService import EnvService
from buildService import BuildService
from runService import RunServi... | 25.608696 | 63 | 0.669355 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from machineService import MachineService
from configService import ConfigService
from downloadService import DownloadService
from installService import InstallService
from envService import EnvService
from buildService import BuildService
from runService import RunServi... | 1,220 | 1 | 652 |
79c15f3fee537e6b2c6b3615c01b789101bd0a90 | 475 | py | Python | data/syn_project/queries/syn_project_query.py | ki-tools/sls_ki_synapse | 8c726a9ec568e3d416049a8813c21bbe87740f16 | [
"Apache-2.0"
] | 1 | 2018-11-21T19:54:34.000Z | 2018-11-21T19:54:34.000Z | data/syn_project/queries/syn_project_query.py | pcstout/sls_ki_synapse | 8c726a9ec568e3d416049a8813c21bbe87740f16 | [
"Apache-2.0"
] | 5 | 2019-03-12T16:44:35.000Z | 2019-03-15T21:46:00.000Z | data/syn_project/queries/syn_project_query.py | ki-tools/sls_ki_synapse | 8c726a9ec568e3d416049a8813c21bbe87740f16 | [
"Apache-2.0"
] | 2 | 2019-02-28T23:16:32.000Z | 2019-03-05T22:16:39.000Z | import graphene
from ..types import SynProject
from core import Synapse
class SynProjectQuery(graphene.ObjectType):
"""
Defines all the SynProject queries.
"""
syn_project = graphene.Field(
SynProject,
id=graphene.String(required=True)
)
| 22.619048 | 51 | 0.642105 | import graphene
from ..types import SynProject
from core import Synapse
class SynProjectQuery(graphene.ObjectType):
"""
Defines all the SynProject queries.
"""
syn_project = graphene.Field(
SynProject,
id=graphene.String(required=True)
)
def resolve_syn_project(self, info, id)... | 172 | 0 | 27 |
d0f9a14ec45437a9db87ebe67c95d4f188a5622d | 2,151 | py | Python | worker.py | reger-men/tensorflow_benchmark | bc51f98d38c2e54fca61b4ce628b0e6c457e04ac | [
"MIT"
] | 6 | 2019-12-31T23:32:35.000Z | 2021-05-20T06:20:19.000Z | worker.py | reger-men/tensorflow_benchmark | bc51f98d38c2e54fca61b4ce628b0e6c457e04ac | [
"MIT"
] | null | null | null | worker.py | reger-men/tensorflow_benchmark | bc51f98d38c2e54fca61b4ce628b0e6c457e04ac | [
"MIT"
] | 2 | 2019-12-18T19:28:13.000Z | 2020-05-04T09:44:46.000Z | from paramiko import SSHClient, AutoAddPolicy
from paramiko.auth_handler import AuthenticationException
from paramiko.ssh_exception import NoValidConnectionsError
class Config(object):
"""Worker access data"""
class Worker(object):
"""Worker Object to connect and execute commands from the 'chief' worker"""
... | 31.173913 | 80 | 0.569503 | from paramiko import SSHClient, AutoAddPolicy
from paramiko.auth_handler import AuthenticationException
from paramiko.ssh_exception import NoValidConnectionsError
class Config(object):
"""Worker access data"""
def __init__(self, ip, user, pwd, port=22):
self.ip = ip
self.port = port
... | 337 | 0 | 89 |
bcd2ed3d312e4715a91b90c5cbcdb3cae15e20b0 | 752 | py | Python | python/test/util.py | iamvarol/spark-nlp | 90bacd5cc9723cc0c4be53c5ffa8891ca450ada7 | [
"Apache-2.0"
] | null | null | null | python/test/util.py | iamvarol/spark-nlp | 90bacd5cc9723cc0c4be53c5ffa8891ca450ada7 | [
"Apache-2.0"
] | null | null | null | python/test/util.py | iamvarol/spark-nlp | 90bacd5cc9723cc0c4be53c5ffa8891ca450ada7 | [
"Apache-2.0"
] | null | null | null | from pyspark.sql import SparkSession
import os
| 30.08 | 89 | 0.62367 | from pyspark.sql import SparkSession
import os
class SparkSessionForTest:
spark = SparkSession.builder \
.master("local[*]") \
.config("spark.jars", 'lib/sparknlp.jar') \
.config("spark.driver.memory", "12G") \
.config("spark.driver.maxResultSize", "2G") \
.config("spark.se... | 0 | 657 | 46 |
dfdaee496a68b4ad6cd43c190ebddc067bf47fca | 5,280 | py | Python | feature_mining/em_original.py | nfreundlich/CS410_CourseProject | c50d0ff04472e48b0b59abe4467dc17d7c2cfab8 | [
"MIT"
] | null | null | null | feature_mining/em_original.py | nfreundlich/CS410_CourseProject | c50d0ff04472e48b0b59abe4467dc17d7c2cfab8 | [
"MIT"
] | 18 | 2018-10-24T01:35:45.000Z | 2018-12-17T03:57:36.000Z | feature_mining/em_original.py | nfreundlich/CS410_CourseProject | c50d0ff04472e48b0b59abe4467dc17d7c2cfab8 | [
"MIT"
] | null | null | null | import numpy as np
import math
from feature_mining.em_base import ExpectationMaximization
class ExpectationMaximizationOriginal(ExpectationMaximization):
"""
Original EM Algorithm as developed by Santu.
"""
if __name__ == '__main__':
em = ExpectationMaximizationOriginal()
em.em()
| 44.745763 | 143 | 0.57197 | import numpy as np
import math
from feature_mining.em_base import ExpectationMaximization
class ExpectationMaximizationOriginal(ExpectationMaximization):
"""
Original EM Algorithm as developed by Santu.
"""
def __init__(self, dump_path="../tests/data/em_01/"):
print(type(self).__name__, '- in... | 4,785 | 0 | 189 |
400952750f2e5961c31828c24e96fa7524ba2ebd | 98,704 | py | Python | pygeoutil/ggeo.py | ritviksahajpal/pygeoutil | b3d396c64eb7ecb8090bc6be9765003ce0b18cf5 | [
"MIT"
] | 1 | 2018-02-28T10:02:39.000Z | 2018-02-28T10:02:39.000Z | pygeoutil/ggeo.py | ritviksahajpal/pygeoutil | b3d396c64eb7ecb8090bc6be9765003ce0b18cf5 | [
"MIT"
] | 7 | 2016-08-14T03:54:26.000Z | 2022-03-11T23:17:45.000Z | pygeoutil/ggeo.py | ritviksahajpal/pygeoutil | b3d396c64eb7ecb8090bc6be9765003ce0b18cf5 | [
"MIT"
] | null | null | null | import os
import pdb
import time
import errno
import shapely.wkt
import shapely.ops
from shapely import speedups
import shapely.prepared
import subprocess
import logging
import tempfile
import distutils.version
import atexit
import functools
import math
import numpy
import gdal
import gdalconst
from osgeo import gdal
... | 39.560721 | 120 | 0.662314 | import os
import pdb
import time
import errno
import shapely.wkt
import shapely.ops
from shapely import speedups
import shapely.prepared
import subprocess
import logging
import tempfile
import distutils.version
import atexit
import functools
import math
import numpy
import gdal
import gdalconst
from osgeo import gdal
... | 127 | 0 | 53 |
01531490b5a75ebd803634367f6ed969cdc69f75 | 2,233 | py | Python | backend/course_application/sources/services/course_service.py | heyImDrew/edupro | 98b8342dda45071da4871bbf73f2ef002fee938f | [
"Apache-2.0"
] | null | null | null | backend/course_application/sources/services/course_service.py | heyImDrew/edupro | 98b8342dda45071da4871bbf73f2ef002fee938f | [
"Apache-2.0"
] | null | null | null | backend/course_application/sources/services/course_service.py | heyImDrew/edupro | 98b8342dda45071da4871bbf73f2ef002fee938f | [
"Apache-2.0"
] | null | null | null | import random
from ..serializers.course_serializers import CourseSerializer
from ..serializers.partition_serializer import PartitionSerializer, PartitionTaskSerializer
from ..models.user_course import UserCourse
from ..models.course import Course
from ..models.partition import Partition
from ..models.partition_task im... | 37.847458 | 94 | 0.677116 | import random
from ..serializers.course_serializers import CourseSerializer
from ..serializers.partition_serializer import PartitionSerializer, PartitionTaskSerializer
from ..models.user_course import UserCourse
from ..models.course import Course
from ..models.partition import Partition
from ..models.partition_task im... | 1,676 | -1 | 184 |
1dd066a74be8c7882c1f9c99223ba4a076b3de2d | 1,973 | py | Python | breeds/migrations/0002_auto_20180430_1118.py | rocity/simple-endpoints | 6754a7353dd6b71f19276b67467297e951129a45 | [
"MIT"
] | null | null | null | breeds/migrations/0002_auto_20180430_1118.py | rocity/simple-endpoints | 6754a7353dd6b71f19276b67467297e951129a45 | [
"MIT"
] | null | null | null | breeds/migrations/0002_auto_20180430_1118.py | rocity/simple-endpoints | 6754a7353dd6b71f19276b67467297e951129a45 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.4 on 2018-04-30 11:18
from django.db import migrations, models
import django.utils.timezone
| 37.942308 | 114 | 0.562088 | # Generated by Django 2.0.4 on 2018-04-30 11:18
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('breeds', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Anime',
fields... | 0 | 1,830 | 23 |
510eda9630efc129fe5bb152e8a858ee54a8d0b9 | 2,365 | py | Python | build.py | rpokemon/ideasforpokemon | b135b3f78a77abaf533b38c4eec75509b1a4a152 | [
"MIT"
] | null | null | null | build.py | rpokemon/ideasforpokemon | b135b3f78a77abaf533b38c4eec75509b1a4a152 | [
"MIT"
] | null | null | null | build.py | rpokemon/ideasforpokemon | b135b3f78a77abaf533b38c4eec75509b1a4a152 | [
"MIT"
] | null | null | null | #! python3
import datetime
import json
from csscompressor import compress
# Run Python script
if __name__ == '__main__':
main()
| 35.298507 | 164 | 0.586469 | #! python3
import datetime
import json
from csscompressor import compress
def main():
# Open config file
with open("config.json", 'r') as config_file:
config = json.load(config_file)
# Incriment the build counter
config["build"] += 1
# Print starting script message
print("\n{} CSS; bu... | 2,209 | 0 | 23 |
976ac13a0d17f78cc33df43ffbf0a73639846a80 | 1,783 | py | Python | s3dis_viz.py | zghera/pvcnn-tf | 9aaae991d8117736d0cb260bb525cf5e90c93f21 | [
"MIT"
] | null | null | null | s3dis_viz.py | zghera/pvcnn-tf | 9aaae991d8117736d0cb260bb525cf5e90c93f21 | [
"MIT"
] | null | null | null | s3dis_viz.py | zghera/pvcnn-tf | 9aaae991d8117736d0cb260bb525cf5e90c93f21 | [
"MIT"
] | null | null | null | """Demo to visualize data pipeline output."""
import matplotlib.pyplot as plt
import tensorflow as tf
from dataloaders.s3dis import create_s3dis_dataset
if __name__ == "__main__":
main(create_pointcloud_dump=False)
| 25.84058 | 73 | 0.614133 | """Demo to visualize data pipeline output."""
import matplotlib.pyplot as plt
import tensorflow as tf
from dataloaders.s3dis import create_s3dis_dataset
def main(create_pointcloud_dump: bool):
objects = {
0: "clutter",
1: "ceiling",
2: "floor",
3: "wall",
4: "beam",
5: "column",
6: "door... | 1,540 | 0 | 23 |
5f0c939440824c40818d4392a6861bfb95e0b707 | 636 | py | Python | heron/dsl/src/python/__init__.py | zhengyangtean/CG4001_Heron_ElasticBolt | e471593c265088996d485e2dd11c9f2484876568 | [
"Apache-2.0"
] | 1 | 2017-11-06T08:23:43.000Z | 2017-11-06T08:23:43.000Z | heron/dsl/src/python/__init__.py | zhengyangtean/CG4001_Heron_ElasticBolt | e471593c265088996d485e2dd11c9f2484876568 | [
"Apache-2.0"
] | null | null | null | heron/dsl/src/python/__init__.py | zhengyangtean/CG4001_Heron_ElasticBolt | e471593c265088996d485e2dd11c9f2484876568 | [
"Apache-2.0"
] | null | null | null | """
The top-level library for Heron's Python DSL, which enables you to write Heron
[topologies](https://twitter.github.io/heron/docs/concepts/topologies/) in
a Python DSL.
Heron topologies are acyclic graphs used to process streaming data. Topologies
have two major components:
[spouts](spout/spout.m.html#heron_py.spou... | 39.75 | 78 | 0.784591 | """
The top-level library for Heron's Python DSL, which enables you to write Heron
[topologies](https://twitter.github.io/heron/docs/concepts/topologies/) in
a Python DSL.
Heron topologies are acyclic graphs used to process streaming data. Topologies
have two major components:
[spouts](spout/spout.m.html#heron_py.spou... | 0 | 0 | 0 |
b5b8d9b15a585714c65998304ca44e6f5f5f48fc | 3,214 | py | Python | train_mask_detector.py | ali-commits/pyhtonML-FaceMaskDetection | 506294ba97786b2eb9c63936d9078eca4d5b4707 | [
"MIT"
] | null | null | null | train_mask_detector.py | ali-commits/pyhtonML-FaceMaskDetection | 506294ba97786b2eb9c63936d9078eca4d5b4707 | [
"MIT"
] | null | null | null | train_mask_detector.py | ali-commits/pyhtonML-FaceMaskDetection | 506294ba97786b2eb9c63936d9078eca4d5b4707 | [
"MIT"
] | null | null | null | from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.preprocessing.image import load_img
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from t... | 28.442478 | 86 | 0.756067 | from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.preprocessing.image import load_img
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from t... | 0 | 0 | 0 |
e22a9c687b78795ce4ef99ea128b7372e86e57eb | 505 | py | Python | api/test/test_statics_inhabitants.py | Viet2503/rki-vaccination-data | a40ff7be7e55850f5184cebc3cc1049541c87282 | [
"MIT"
] | 27 | 2020-12-30T06:47:23.000Z | 2021-12-05T14:14:53.000Z | api/test/test_statics_inhabitants.py | rphl/rki-vaccination-data | 360f1456613bfd2f0e6199016dde3941ed6f234a | [
"MIT"
] | 56 | 2020-12-31T09:00:57.000Z | 2022-01-19T18:17:15.000Z | api/test/test_statics_inhabitants.py | rphl/rki-vaccination-data | 360f1456613bfd2f0e6199016dde3941ed6f234a | [
"MIT"
] | 7 | 2020-12-30T13:39:58.000Z | 2021-11-21T13:52:53.000Z | """ Unittest """
import unittest
# pylint: disable=import-error
from _utils.statics import inhabitants
class TestModuleStaticsInhabitants(unittest.TestCase):
""" Test Module for statics.inhabitants """
def test_total(self):
""" Test for inhabitants.TOTAL """
self.assertEqual(type(inhabitants.TOTAL).__name_... | 28.055556 | 62 | 0.724752 | """ Unittest """
import unittest
# pylint: disable=import-error
from _utils.statics import inhabitants
class TestModuleStaticsInhabitants(unittest.TestCase):
""" Test Module for statics.inhabitants """
def test_total(self):
""" Test for inhabitants.TOTAL """
self.assertEqual(type(inhabitants.TOTAL).__name_... | 0 | 0 | 0 |
a102ca24a694ce5cda55ec16de27a47047d2234b | 21,181 | py | Python | nestedsulcusfeatures_HBM2011/register_to_template.py | binarybottle/nestedsulcusfeatures_HBM2011 | 4a1e064316b73c268c49383a34f49baca23cef93 | [
"Apache-2.0"
] | null | null | null | nestedsulcusfeatures_HBM2011/register_to_template.py | binarybottle/nestedsulcusfeatures_HBM2011 | 4a1e064316b73c268c49383a34f49baca23cef93 | [
"Apache-2.0"
] | null | null | null | nestedsulcusfeatures_HBM2011/register_to_template.py | binarybottle/nestedsulcusfeatures_HBM2011 | 4a1e064316b73c268c49383a34f49baca23cef93 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
Register brains, landmarks, and labels to a template.
(c) 2011, @rno klein
"""
import os
from os.path import exists
from subprocess import call
from numpy import float, isnan
# Run intensity-based registration
# 1. Register brains to template
# 2. Transform brains to each other via template
# 3... | 50.672249 | 108 | 0.507153 | #!/usr/bin/python
"""
Register brains, landmarks, and labels to a template.
(c) 2011, @rno klein
"""
import os
from os.path import exists
from subprocess import call
from numpy import float, isnan
# Run intensity-based registration
# 1. Register brains to template
# 2. Transform brains to each other via template
# 3... | 0 | 0 | 0 |
74727a6c79fe3a6e89dbf9ba47e01f093de21c57 | 574 | py | Python | EfficientCoding/Assignment-1-equilibriumindex.py | vikbehal/Explore | b35948d8a6894647df3ee462746475f7e66f78f8 | [
"MIT"
] | 3 | 2019-01-29T06:33:34.000Z | 2022-01-26T20:01:04.000Z | EfficientCoding/Assignment-1-equilibriumindex.py | vikbehal/Explore | b35948d8a6894647df3ee462746475f7e66f78f8 | [
"MIT"
] | null | null | null | EfficientCoding/Assignment-1-equilibriumindex.py | vikbehal/Explore | b35948d8a6894647df3ee462746475f7e66f78f8 | [
"MIT"
] | 1 | 2022-03-11T10:47:29.000Z | 2022-03-11T10:47:29.000Z |
#inputString = input()
inputString = "3,-4, 2, -1,-3, 2, 1"
inputList = [int(val) for val in inputString.split(",")]
print(solve(inputList)) | 22.076923 | 57 | 0.557491 | def solve(inputList):
# Edge cases
if sum(inputList[1:]) == 0:
return 0
totalItems = len(inputList)
if sum(inputList[:totalItems - 1]) == 0:
return totalItems - 1
leftSum = 0
rightSum = sum(inputList)
for idx, item in enumerate(inputList):
rightSum -= it... | 404 | 0 | 23 |
90e2e88ba073a5e73d350beeba17dadc19ce1da1 | 390 | py | Python | rplugin/python3/defx/session.py | roachsinai/defx.nvim | 609e858b5211ec4de45cb93045ab320c961048b2 | [
"MIT"
] | 1,229 | 2017-01-03T13:21:59.000Z | 2022-03-29T06:33:20.000Z | rplugin/python3/defx/session.py | roachsinai/defx.nvim | 609e858b5211ec4de45cb93045ab320c961048b2 | [
"MIT"
] | 295 | 2017-12-07T02:38:55.000Z | 2022-03-29T00:30:52.000Z | rplugin/python3/defx/session.py | roachsinai/defx.nvim | 609e858b5211ec4de45cb93045ab320c961048b2 | [
"MIT"
] | 136 | 2018-07-20T02:57:54.000Z | 2022-03-01T00:30:36.000Z | # ============================================================================
# FILE: session.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
import typing
| 27.857143 | 78 | 0.402564 | # ============================================================================
# FILE: session.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
import typing
class Session(typing.NamedTuple):
name: str... | 0 | 95 | 23 |
6ee29bfe43fc37be3cb3d8d63953bf79d532f4aa | 1,973 | py | Python | vae.py | chauhankaranraj/ELDR-pytorch | 99d40186e960933e6f0ae18270530f3534741296 | [
"MIT"
] | null | null | null | vae.py | chauhankaranraj/ELDR-pytorch | 99d40186e960933e6f0ae18270530f3534741296 | [
"MIT"
] | null | null | null | vae.py | chauhankaranraj/ELDR-pytorch | 99d40186e960933e6f0ae18270530f3534741296 | [
"MIT"
] | null | null | null | # NOTE: this code is currently copypasta'd from pytorch official examples repo at
# https://github.com/pytorch/examples/blob/master/vae/main.py
# In the future, this could probably be added as a submodule
import pdb
import torch
import torch.nn as nn
import torch.nn.functional as F
# Reconstruction + KL divergence l... | 34.017241 | 81 | 0.660416 | # NOTE: this code is currently copypasta'd from pytorch official examples repo at
# https://github.com/pytorch/examples/blob/master/vae/main.py
# In the future, this could probably be added as a submodule
import pdb
import torch
import torch.nn as nn
import torch.nn.functional as F
class VAE(nn.Module):
def __ini... | 1,432 | 0 | 180 |
5e2f291dcf29e2e8f32139edb721bac8de6f799d | 664 | py | Python | test/unit/devices/test_iosxr.py | NorthLandTeam/ncclient | ff6bba74c3304f0a5053087449f5a51e8eb13ed4 | [
"Apache-2.0"
] | 498 | 2015-10-21T18:43:23.000Z | 2022-03-29T17:27:59.000Z | test/unit/devices/test_iosxr.py | NorthLandTeam/ncclient | ff6bba74c3304f0a5053087449f5a51e8eb13ed4 | [
"Apache-2.0"
] | 440 | 2015-09-07T23:43:01.000Z | 2022-03-17T11:43:16.000Z | test/unit/devices/test_iosxr.py | NorthLandTeam/ncclient | ff6bba74c3304f0a5053087449f5a51e8eb13ed4 | [
"Apache-2.0"
] | 330 | 2015-09-10T16:53:50.000Z | 2022-03-31T12:24:53.000Z | import unittest
from ncclient.devices.iosxr import *
| 30.181818 | 69 | 0.712349 | import unittest
from ncclient.devices.iosxr import *
class TestIosxrDevice(unittest.TestCase):
def setUp(self):
self.obj = IosxrDeviceHandler({'name': 'iosxe'})
def test_add_additional_ssh_connect_params(self):
expected = dict()
expected["unknown_host_cb"] = iosxr_unknown_host_cb... | 455 | 20 | 135 |
35744b0cc75c7d6a7b087efb811ee192fa489500 | 318 | py | Python | onfido/apps.py | snicks1/django-onfido | 7288552c6a156d022539d4d22d7f5a0236018ada | [
"MIT"
] | null | null | null | onfido/apps.py | snicks1/django-onfido | 7288552c6a156d022539d4d22d7f5a0236018ada | [
"MIT"
] | null | null | null | onfido/apps.py | snicks1/django-onfido | 7288552c6a156d022539d4d22d7f5a0236018ada | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class OnfidoAppConfig(AppConfig):
"""AppConfig for Django-Onfido."""
name = 'onfido'
verbose_name = "Onfido"
configs = []
def ready(self):
"""Validate config and connect signals."""
super(OnfidoAppConfig, self).ready()
| 19.875 | 50 | 0.625786 | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class OnfidoAppConfig(AppConfig):
"""AppConfig for Django-Onfido."""
name = 'onfido'
verbose_name = "Onfido"
configs = []
def ready(self):
"""Validate config and connect signals."""
super(OnfidoAppConfig, self).ready()
| 0 | 0 | 0 |
6f54454045f345a91f5cdf3456d3e88496e7aada | 8,242 | py | Python | bob/bio/face/database/pola_thermal.py | bioidiap/bob.bio.face | 2341e6423ca5a412ebe23fa18acacd69ea1ef914 | [
"BSD-3-Clause"
] | 4 | 2016-09-01T13:16:46.000Z | 2021-09-03T03:27:18.000Z | bob/bio/face/database/pola_thermal.py | bioidiap/bob.bio.face | 2341e6423ca5a412ebe23fa18acacd69ea1ef914 | [
"BSD-3-Clause"
] | 6 | 2015-09-02T19:31:15.000Z | 2016-10-10T21:48:39.000Z | bob/bio/face/database/pola_thermal.py | bioidiap/bob.bio.face | 2341e6423ca5a412ebe23fa18acacd69ea1ef914 | [
"BSD-3-Clause"
] | 6 | 2015-10-07T17:18:48.000Z | 2017-07-18T19:41:14.000Z | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
"""
PolaThermal database: database implementation
"""
from bob.bio.base.database import CSVDataset
from bob.bio.base.database import CSVToSampleLoaderBiometrics
from bob.bio.face.database.sample_loaders import ... | 45.038251 | 314 | 0.609803 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
"""
PolaThermal database: database implementation
"""
from bob.bio.base.database import CSVDataset
from bob.bio.base.database import CSVToSampleLoaderBiometrics
from bob.bio.face.database.sample_loaders import ... | 3,725 | 0 | 79 |
779f4c31a1264d2a29f034d8c08cac74be966211 | 3,725 | py | Python | unittest_reinvent/scoring_tests/physchem/test_slogp_score.py | fujirock/Reinvent | 9c57636f9d32b4ce5b75670f43906a70d5daf886 | [
"MIT"
] | 1 | 2021-08-31T02:28:10.000Z | 2021-08-31T02:28:10.000Z | unittest_reinvent/scoring_tests/physchem/test_slogp_score.py | prasannavd/Reinvent | ca02ebee8d8ed83223c55f4a1dd1b3fbc2359616 | [
"MIT"
] | null | null | null | unittest_reinvent/scoring_tests/physchem/test_slogp_score.py | prasannavd/Reinvent | ca02ebee8d8ed83223c55f4a1dd1b3fbc2359616 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
import numpy.testing as npt
from scoring.component_parameters import ComponentParameters
from scoring.function import CustomSum
from utils.enums.component_specific_parameters_enum import ComponentSpecificParametersEnum
from utils.enums.scoring_function_component_enum import ScoringF... | 47.75641 | 127 | 0.517584 | import unittest
import numpy as np
import numpy.testing as npt
from scoring.component_parameters import ComponentParameters
from scoring.function import CustomSum
from utils.enums.component_specific_parameters_enum import ComponentSpecificParametersEnum
from utils.enums.scoring_function_component_enum import ScoringF... | 3,038 | 223 | 46 |
9afdc4c833bc248918013ec47848b1b410c62331 | 5,661 | py | Python | Repository_files/TLCS/models/create_plots.py | kraken24/mhp_hackathon_sustainable_traffic_light_challenge | 0b4c61968d54c7e8faceb07a2c78c70570a2e162 | [
"CC0-1.0"
] | null | null | null | Repository_files/TLCS/models/create_plots.py | kraken24/mhp_hackathon_sustainable_traffic_light_challenge | 0b4c61968d54c7e8faceb07a2c78c70570a2e162 | [
"CC0-1.0"
] | null | null | null | Repository_files/TLCS/models/create_plots.py | kraken24/mhp_hackathon_sustainable_traffic_light_challenge | 0b4c61968d54c7e8faceb07a2c78c70570a2e162 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 5 02:12:12 2022
@author: Kraken
Project: MHP Hackathon
"""
import os
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 16})
WORKING_DIR = "model_14"
WORKING_DIR2 = "model_12"
# "model_8": dqn with fixed weights
# "model_4": dqn
MVG_... | 35.161491 | 84 | 0.585409 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 5 02:12:12 2022
@author: Kraken
Project: MHP Hackathon
"""
import os
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 16})
WORKING_DIR = "model_14"
WORKING_DIR2 = "model_12"
# "model_8": dqn with fixed weights
# "model_4": dqn
MVG_... | 0 | 0 | 0 |
ab4dcf42708ad98c9f00d476dd47908b95919fce | 22,998 | py | Python | src/deepke/relation_extraction/multimodal/models/clip/feature_extraction_utils.py | johncolezhang/DeepKE | ea4552ec42cb003a835f00fc14fb454f9a9a7183 | [
"MIT"
] | 3 | 2022-02-18T05:03:02.000Z | 2022-03-19T12:32:16.000Z | src/deepke/relation_extraction/multimodal/models/clip/feature_extraction_utils.py | johncolezhang/DeepKE | ea4552ec42cb003a835f00fc14fb454f9a9a7183 | [
"MIT"
] | null | null | null | src/deepke/relation_extraction/multimodal/models/clip/feature_extraction_utils.py | johncolezhang/DeepKE | ea4552ec42cb003a835f00fc14fb454f9a9a7183 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# 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... | 44.226923 | 189 | 0.651709 | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# 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... | 906 | 0 | 331 |
781ab1b68d7175d472282dd2c34637ddada37ab7 | 23,855 | py | Python | tests/test_outputs_handler_matsim_xml_writer.py | arup-group/genet | 24bfbee31da6d7951598adb29ddf17d3a08ed5e6 | [
"MIT"
] | 22 | 2020-12-22T11:11:44.000Z | 2022-03-07T16:25:35.000Z | tests/test_outputs_handler_matsim_xml_writer.py | tkahng/genet | d5c29ed9e44408b60f55d8de889d7430debc9f04 | [
"MIT"
] | 27 | 2020-12-22T09:45:35.000Z | 2022-03-03T14:52:24.000Z | tests/test_outputs_handler_matsim_xml_writer.py | tkahng/genet | d5c29ed9e44408b60f55d8de889d7430debc9f04 | [
"MIT"
] | 7 | 2021-01-02T10:00:05.000Z | 2022-01-06T03:53:43.000Z | import os, sys
import pytest
import lxml
from copy import deepcopy
from shapely.geometry import LineString
from tests.fixtures import network_object_from_test_data, full_fat_default_config_path, assert_semantically_equal
from tests import xml_diff
from genet.outputs_handler import matsim_xml_writer
from genet.core impo... | 51.634199 | 117 | 0.57686 | import os, sys
import pytest
import lxml
from copy import deepcopy
from shapely.geometry import LineString
from tests.fixtures import network_object_from_test_data, full_fat_default_config_path, assert_semantically_equal
from tests import xml_diff
from genet.outputs_handler import matsim_xml_writer
from genet.core impo... | 22,287 | 0 | 548 |
6fc066cfaa85a48df43cc8e9329854aaebfcadd0 | 7,123 | py | Python | lesson04/likangwen/lession04_hw.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | lesson04/likangwen/lession04_hw.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | lesson04/likangwen/lession04_hw.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | import sys
import getpass
import json
from prettytable import PrettyTable
import pandas
import logging
import os.path
import time
# 定义变量
RESULT = {}
# USERINFO = ("admin", "123456")
USERINFO = ("a", "a")
FIELDS = ['name', 'age', 'tel', 'email']
# RESULT.append(FIELDS)
FORMAT = """
==================================... | 28.955285 | 106 | 0.491226 | import sys
import getpass
import json
from prettytable import PrettyTable
import pandas
import logging
import os.path
import time
# 定义变量
RESULT = {}
# USERINFO = ("admin", "123456")
USERINFO = ("a", "a")
FIELDS = ['name', 'age', 'tel', 'email']
# RESULT.append(FIELDS)
FORMAT = """
==================================... | 6,460 | 0 | 265 |
d33ec8e728c20478a449e26f8c58c3e1196d416e | 8,511 | py | Python | troposphere_mate/core/orchestration.py | tsuttsu305/troposphere_mate-project | 15ee94cc913efb32bc991979efcad943c992074c | [
"MIT"
] | 10 | 2019-07-08T14:52:16.000Z | 2021-10-15T22:18:22.000Z | troposphere_mate/core/orchestration.py | tsuttsu305/troposphere_mate-project | 15ee94cc913efb32bc991979efcad943c992074c | [
"MIT"
] | 1 | 2019-07-08T00:36:50.000Z | 2019-07-08T00:36:50.000Z | troposphere_mate/core/orchestration.py | tsuttsu305/troposphere_mate-project | 15ee94cc913efb32bc991979efcad943c992074c | [
"MIT"
] | 2 | 2020-03-22T14:44:54.000Z | 2020-08-05T02:08:01.000Z | # -*- coding: utf-8 -*-
"""
Implement a Orchestration Framework.
"""
try:
from typing import List, Tuple, Dict, Type
except:
pass
import attr
from collections import OrderedDict
from pathlib_mate import PathCls as Path
from .mate import AWSObject, Template
from .canned import Canned
def resolve_pipeline(p... | 29.655052 | 99 | 0.602397 | # -*- coding: utf-8 -*-
"""
Implement a Orchestration Framework.
"""
try:
from typing import List, Tuple, Dict, Type
except:
pass
import attr
from collections import OrderedDict
from pathlib_mate import PathCls as Path
from .mate import AWSObject, Template
from .canned import Canned
def resolve_pipeline(p... | 3,727 | 710 | 152 |
07e38744e543d0958ff29a1c922e0df64b4d8e9b | 2,674 | py | Python | tracker.py | ramondfdez/kalman-tracking | f9439dab0d9daed505e6fd3f0c8a86f47279ee6c | [
"MIT"
] | null | null | null | tracker.py | ramondfdez/kalman-tracking | f9439dab0d9daed505e6fd3f0c8a86f47279ee6c | [
"MIT"
] | null | null | null | tracker.py | ramondfdez/kalman-tracking | f9439dab0d9daed505e6fd3f0c8a86f47279ee6c | [
"MIT"
] | null | null | null | import numpy as np
from kalmanFilter import KalmanFilter
from scipy.optimize import linear_sum_assignment
from collections import deque
class Tracks(object):
"""docstring for Tracks"""
class Tracker(object):
"""docstring for Tracker"""
| 25.961165 | 87 | 0.663426 | import numpy as np
from kalmanFilter import KalmanFilter
from scipy.optimize import linear_sum_assignment
from collections import deque
class Tracks(object):
"""docstring for Tracks"""
def __init__(self, detection, trackId):
super(Tracks, self).__init__()
self.KF = KalmanFilter()
self.KF.predict()... | 2,295 | 0 | 100 |
7a9bead17f4f87fe28b94db3b6288db94bc69e37 | 939 | py | Python | ballir_dicom_manager/file_readers/read_nifti.py | bashirlab/BaLLIR_DICOM_Manager | b24aab9eb6e551bbc684d78cf578e446a9acd526 | [
"MIT"
] | null | null | null | ballir_dicom_manager/file_readers/read_nifti.py | bashirlab/BaLLIR_DICOM_Manager | b24aab9eb6e551bbc684d78cf578e446a9acd526 | [
"MIT"
] | null | null | null | ballir_dicom_manager/file_readers/read_nifti.py | bashirlab/BaLLIR_DICOM_Manager | b24aab9eb6e551bbc684d78cf578e446a9acd526 | [
"MIT"
] | null | null | null | import pathlib
import numpy as np
from ballir_dicom_manager.file_readers.read_image_volume import ReadImageVolume
from ballir_dicom_manager.file_loaders.nifti_loader import NiftiLoader
from ballir_dicom_manager.file_viewers.array_viewer import ArrayViewer
| 34.777778 | 80 | 0.70181 | import pathlib
import numpy as np
from ballir_dicom_manager.file_readers.read_image_volume import ReadImageVolume
from ballir_dicom_manager.file_loaders.nifti_loader import NiftiLoader
from ballir_dicom_manager.file_viewers.array_viewer import ArrayViewer
class ReadNifti(ReadImageVolume):
loader = NiftiLoader(... | 563 | 94 | 23 |
c14cc8c968eafae9faee4ceccaee3b5b93fb10da | 4,863 | py | Python | findfaceApp/findeyes/frol.py | WilShi/unity_tool | 14df85aec6f2c889a3c7bf4f88d6632029f96bef | [
"MIT"
] | null | null | null | findfaceApp/findeyes/frol.py | WilShi/unity_tool | 14df85aec6f2c889a3c7bf4f88d6632029f96bef | [
"MIT"
] | null | null | null | findfaceApp/findeyes/frol.py | WilShi/unity_tool | 14df85aec6f2c889a3c7bf4f88d6632029f96bef | [
"MIT"
] | null | null | null |
import datetime
from sys import argv
import tensorflow as tf
import os
import glob
from skimage import io
import matplotlib.pyplot as plt
from multiprocessing import Process
from PIL import Image, ImageDraw
from pathlib import Path
from PyQt5.QtWidgets import QApplication, QWidget, QMessageBox
import qdarkstyle
imp... | 28.946429 | 127 | 0.544931 |
import datetime
from sys import argv
import tensorflow as tf
import os
import glob
from skimage import io
import matplotlib.pyplot as plt
from multiprocessing import Process
from PIL import Image, ImageDraw
from pathlib import Path
from PyQt5.QtWidgets import QApplication, QWidget, QMessageBox
import qdarkstyle
imp... | 4,203 | -12 | 314 |
d6ccd34a5a30b7522fa57f541100cb9301ffad9e | 1,971 | py | Python | pixeldrain.py | FayasNoushad/Pixeldrain | e8d620986f3d186b6c472b75db8bd3dad58bf4b5 | [
"MIT"
] | 5 | 2021-11-28T12:03:12.000Z | 2021-12-29T03:14:06.000Z | pixeldrain.py | FayasNoushad/Pixeldrain | e8d620986f3d186b6c472b75db8bd3dad58bf4b5 | [
"MIT"
] | null | null | null | pixeldrain.py | FayasNoushad/Pixeldrain | e8d620986f3d186b6c472b75db8bd3dad58bf4b5 | [
"MIT"
] | 1 | 2021-12-21T02:42:41.000Z | 2021-12-21T02:42:41.000Z | import requests
def upload_file(file):
"""
Upload a file to pixeldrain
upload_file(file)
"""
response = requests.post(
"https://pixeldrain.com/api/file",
data={"anonymous": True},
files={"file": open(file, "rb")}
)
return response.json()
def file(file_id):
... | 28.157143 | 136 | 0.646372 | import requests
def upload_file(file):
"""
Upload a file to pixeldrain
upload_file(file)
"""
response = requests.post(
"https://pixeldrain.com/api/file",
data={"anonymous": True},
files={"file": open(file, "rb")}
)
return response.json()
def file(file_id):
... | 0 | 0 | 0 |
72b3cfe0b7ace9709b11fe2908ccaeabc29f1262 | 1,359 | py | Python | 08.Regression/8.2.LinearRegression_CV.py | radiumweilei/chinahadoop-ml-2 | ea886610a6ccb278afeff759bf2dc8a30ef3f275 | [
"Apache-2.0"
] | null | null | null | 08.Regression/8.2.LinearRegression_CV.py | radiumweilei/chinahadoop-ml-2 | ea886610a6ccb278afeff759bf2dc8a30ef3f275 | [
"Apache-2.0"
] | null | null | null | 08.Regression/8.2.LinearRegression_CV.py | radiumweilei/chinahadoop-ml-2 | ea886610a6ccb278afeff759bf2dc8a30ef3f275 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding:utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import Lasso, Ridge, ElasticNet
from sklearn.model_selection import GridSearchCV
if __name__ == "__main__":
# pandas读入
... | 32.357143 | 98 | 0.658572 | #!/usr/bin/python
# -*- coding:utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import Lasso, Ridge, ElasticNet
from sklearn.model_selection import GridSearchCV
if __name__ == "__main__":
# pandas读入
... | 0 | 0 | 0 |
549b9bd68f1c4944ff9d770440583ba0a6c1005e | 1,967 | py | Python | lbrynet/daemon/auth/factory.py | vyaspranjal33/lbry | e03e41ad3105ccc0d8d8891b0e9fa63f9bbfce34 | [
"MIT"
] | null | null | null | lbrynet/daemon/auth/factory.py | vyaspranjal33/lbry | e03e41ad3105ccc0d8d8891b0e9fa63f9bbfce34 | [
"MIT"
] | null | null | null | lbrynet/daemon/auth/factory.py | vyaspranjal33/lbry | e03e41ad3105ccc0d8d8891b0e9fa63f9bbfce34 | [
"MIT"
] | null | null | null | import logging
from twisted.web import server, guard, resource
from twisted.cred import portal
from lbrynet import conf
from .auth import PasswordChecker, HttpPasswordRealm
from ..auth.keyring import Keyring
log = logging.getLogger(__name__)
| 38.568627 | 107 | 0.688866 | import logging
from twisted.web import server, guard, resource
from twisted.cred import portal
from lbrynet import conf
from .auth import PasswordChecker, HttpPasswordRealm
from ..auth.keyring import Keyring
log = logging.getLogger(__name__)
class HTTPJSONRPCFactory(server.Site):
def __init__(self, resource, k... | 1,459 | 59 | 201 |
f9abc59e0046c917fae8331d828bf949fa2bf3b8 | 11,840 | py | Python | http_async_client/base.py | jossefaz/async-http-client | 74fe7540d1781d64d41161350019bc5ccfec6426 | [
"MIT"
] | 1 | 2021-12-05T21:01:59.000Z | 2021-12-05T21:01:59.000Z | http_async_client/base.py | jossefaz/http-async-client | 74fe7540d1781d64d41161350019bc5ccfec6426 | [
"MIT"
] | null | null | null | http_async_client/base.py | jossefaz/http-async-client | 74fe7540d1781d64d41161350019bc5ccfec6426 | [
"MIT"
] | null | null | null | from functools import partial
from typing import Union, Dict, Optional
from http_async_client.enums import SupportedProtocols, Methods
import httpx
import re
from dataclasses import dataclass
from httpx._types import RequestContent, URLTypes, RequestData, RequestFiles, QueryParamTypes, HeaderTypes, CookieTypes
from nan... | 40.409556 | 157 | 0.601098 | from functools import partial
from typing import Union, Dict, Optional
from http_async_client.enums import SupportedProtocols, Methods
import httpx
import re
from dataclasses import dataclass
from httpx._types import RequestContent, URLTypes, RequestData, RequestFiles, QueryParamTypes, HeaderTypes, CookieTypes
from nan... | 350 | 8,208 | 72 |
da8499f0797074b5c7fabba9eb9bbeb7b0b66b09 | 728 | py | Python | examples/textArea.py | tgolsson/appJar | 5e2f8bff44e927e7c2bae17fccddc6dbf79952f0 | [
"Apache-2.0"
] | 666 | 2016-11-14T18:17:40.000Z | 2022-03-29T03:53:22.000Z | examples/textArea.py | tgolsson/appJar | 5e2f8bff44e927e7c2bae17fccddc6dbf79952f0 | [
"Apache-2.0"
] | 598 | 2016-10-20T21:04:09.000Z | 2022-03-15T22:44:49.000Z | examples/textArea.py | tgolsson/appJar | 5e2f8bff44e927e7c2bae17fccddc6dbf79952f0 | [
"Apache-2.0"
] | 95 | 2017-01-19T12:23:58.000Z | 2022-03-06T18:16:21.000Z | import sys
sys.path.append("../")
from appJar import gui
app=gui()
app.addScrolledTextArea("t1")
app.setTextAreaChangeFunction("t1", press)
app.addButtons(["CLEAR", "SET"], press)
app.addButtons(["LOG", "CHECK"], log)
app.addCheckBox("CALL")
app.addCheckBox("END")
app.addEntry("text")
app.go()
| 23.483871 | 117 | 0.637363 | import sys
sys.path.append("../")
from appJar import gui
def press(btn=None):
if btn == "CLEAR":
app.clearTextArea("t1", callFunction=app.getCheckBox("CALL"))
elif btn == "SET":
app.setTextArea("t1", app.getEntry("text"), callFunction=app.getCheckBox("CALL"), end=app.getCheckBox("END"))
els... | 383 | 0 | 46 |
588b761156ea659c9c346c22dd0ae03fb49cf417 | 12,480 | py | Python | dp_multiq/tree.py | michaeljneely/google-research | 8028769662d23426be6d316e4ab954e8c85cf8fe | [
"Apache-2.0"
] | 1 | 2021-08-15T20:03:51.000Z | 2021-08-15T20:03:51.000Z | dp_multiq/tree.py | michaeljneely/google-research | 8028769662d23426be6d316e4ab954e8c85cf8fe | [
"Apache-2.0"
] | 12 | 2021-08-25T16:15:31.000Z | 2022-02-10T05:10:37.000Z | dp_multiq/tree.py | michaeljneely/google-research | 8028769662d23426be6d316e4ab954e8c85cf8fe | [
"Apache-2.0"
] | 1 | 2021-05-09T07:26:31.000Z | 2021-05-09T07:26:31.000Z | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | 35.965418 | 127 | 0.685817 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | 0 | 39 | 25 |
81b0da0e4b675061328ec8d1c6ae3f7c6c0db455 | 5,077 | py | Python | kaa/exts/games/_cards.py | haasosaurus/kaa | 476fc93e2c6c9a75c2eaf70f189ef993e877f896 | [
"MIT"
] | 2 | 2021-11-16T01:18:18.000Z | 2021-12-28T06:53:34.000Z | kaa/exts/games/_cards.py | haasosaurus/pythonidae | 476fc93e2c6c9a75c2eaf70f189ef993e877f896 | [
"MIT"
] | null | null | null | kaa/exts/games/_cards.py | haasosaurus/pythonidae | 476fc93e2c6c9a75c2eaf70f189ef993e877f896 | [
"MIT"
] | 5 | 2020-02-23T00:50:30.000Z | 2020-06-24T07:42:45.000Z | # -*- coding: utf-8 -*-
import enum
import random
from typing import Union
class Card:
"""
represents a single playing card
"""
class Deck:
"""
playing card deck class
"""
class Icons:
"""
icon container for Card/Deck
"""
card_back = '🂠'
joke... | 22.766816 | 128 | 0.515068 | # -*- coding: utf-8 -*-
import enum
import random
from typing import Union
class Card:
"""
represents a single playing card
"""
class Suit(enum.Enum):
SPADES = ('Spades', 'S', '♠️')
DIAMONDS = ('Diamonds', 'D', '♣️')
CLUBS = ('Clubs', 'C', '♥️')
HEARTS = ('Hearts', '... | 3,142 | 906 | 374 |
c48e6a44c4da3a2f27992537d69968cbcb561fe2 | 1,806 | py | Python | nipype/interfaces/freesurfer/__init__.py | effigies/nipype | 18fe222557cf3b9627e06b2a66fba589feaca581 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/freesurfer/__init__.py | effigies/nipype | 18fe222557cf3b9627e06b2a66fba589feaca581 | [
"Apache-2.0"
] | 2 | 2017-10-05T21:08:38.000Z | 2018-10-09T23:01:23.000Z | nipype/interfaces/freesurfer/__init__.py | effigies/nipype | 18fe222557cf3b9627e06b2a66fba589feaca581 | [
"Apache-2.0"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Top-level namespace for freesurfer."""
from .base import Info, FSCommand, no_freesurfer
from .preprocess import (ParseDICOMDir, UnpackSDICOMDir, MRIConvert, Resample,
ReconAll, ... | 66.888889 | 91 | 0.668328 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Top-level namespace for freesurfer."""
from .base import Info, FSCommand, no_freesurfer
from .preprocess import (ParseDICOMDir, UnpackSDICOMDir, MRIConvert, Resample,
ReconAll, ... | 0 | 0 | 0 |
e0e9a4a6b64f80ce663be8d5634e8732072df3c3 | 211 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/CODESIGNAL/valid_time.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_RESOURCES/CODESIGNAL/valid_time.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_RESOURCES/CODESIGNAL/valid_time.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | def validTime(time):
"""
Boolean indicating if time is in valid 24hr format
"""
tokens = time.split(':')
hours = int(tokens[0])
minutes = int(tokens[1])
return not (hours > 23 or minutes > 59) | 26.375 | 51 | 0.625592 | def validTime(time):
"""
Boolean indicating if time is in valid 24hr format
"""
tokens = time.split(':')
hours = int(tokens[0])
minutes = int(tokens[1])
return not (hours > 23 or minutes > 59) | 0 | 0 | 0 |
af5759f25b7a68cffdc5af17722bac8dc2f24f92 | 1,672 | py | Python | copy_csv_res.py | Murilodsv/py-jules | 601ca9e6fbad7fe82404f5296babb04583ddda95 | [
"MIT"
] | null | null | null | copy_csv_res.py | Murilodsv/py-jules | 601ca9e6fbad7fe82404f5296babb04583ddda95 | [
"MIT"
] | null | null | null | copy_csv_res.py | Murilodsv/py-jules | 601ca9e6fbad7fe82404f5296babb04583ddda95 | [
"MIT"
] | 1 | 2020-04-13T17:23:54.000Z | 2020-04-13T17:23:54.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 20 13:32:20 2021
#--- Copy csv results to single folder based on dashboard_db.csv
#--- Murilo Vianna (murilodsv@gmail.com)
#--- May, 2021.
#--- Dev-log in: https://github.com/Murilodsv/py-jules
@author: muril
"""
# DEBUG import os; os.chdir('C:/M... | 24.588235 | 89 | 0.504785 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 20 13:32:20 2021
#--- Copy csv results to single folder based on dashboard_db.csv
#--- Murilo Vianna (murilodsv@gmail.com)
#--- May, 2021.
#--- Dev-log in: https://github.com/Murilodsv/py-jules
@author: muril
"""
# DEBUG import os; os.chdir('C:/M... | 0 | 0 | 0 |
e9942c4758244414581d47ccf19b8ab557f3e099 | 1,177 | py | Python | orders/management/commands/order_csv_feed.py | ms0680146/Order_System | 934c3849ad0d72c0ce560706a6857870935e8599 | [
"MIT"
] | null | null | null | orders/management/commands/order_csv_feed.py | ms0680146/Order_System | 934c3849ad0d72c0ce560706a6857870935e8599 | [
"MIT"
] | null | null | null | orders/management/commands/order_csv_feed.py | ms0680146/Order_System | 934c3849ad0d72c0ce560706a6857870935e8599 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from django.utils.timezone import get_current_timezone
from orders.models import Order
from datetime import datetime
import csv
import pytz | 43.592593 | 145 | 0.642311 | from django.core.management.base import BaseCommand, CommandError
from django.utils.timezone import get_current_timezone
from orders.models import Order
from datetime import datetime
import csv
import pytz
class Command(BaseCommand):
help = 'Feed order_csv file into Order table.'
def add_arguments(self, parse... | 838 | 111 | 23 |
761134a35bd916ec48ce32ff5660748d454f087a | 68 | py | Python | dtale_desktop/default_sources/dft_csv/metadata.py | dennislwm/dtale-desktop | 1a034d505f6b45c1ece4c18b83af6ae367d16824 | [
"MIT"
] | 154 | 2020-10-27T00:33:51.000Z | 2022-02-19T13:16:36.000Z | dtale_desktop/default_sources/dft_csv/metadata.py | dennislwm/dtale-desktop | 1a034d505f6b45c1ece4c18b83af6ae367d16824 | [
"MIT"
] | 9 | 2020-10-26T23:48:38.000Z | 2021-02-18T04:13:42.000Z | dtale_desktop/default_sources/dft_csv/metadata.py | dennislwm/dtale-desktop | 1a034d505f6b45c1ece4c18b83af6ae367d16824 | [
"MIT"
] | 15 | 2021-01-31T01:11:20.000Z | 2022-02-17T11:41:27.000Z | import os
display_name = f"csv files in {os.path.expanduser('~')}"
| 17 | 56 | 0.691176 | import os
display_name = f"csv files in {os.path.expanduser('~')}"
| 0 | 0 | 0 |
8a65b2fac9052c66b04cfc5adb41cf66fe6c89b0 | 790 | py | Python | filter_plugins/wrap_list_elements.py | major/ansible-role-aptly | ca975fe854831c0694c0b5dc56be9ac056b7602c | [
"MIT"
] | 2 | 2017-01-24T14:58:25.000Z | 2017-05-23T08:10:28.000Z | filter_plugins/wrap_list_elements.py | major/ansible-role-aptly | ca975fe854831c0694c0b5dc56be9ac056b7602c | [
"MIT"
] | 8 | 2016-12-05T14:33:55.000Z | 2018-07-19T15:33:02.000Z | filter_plugins/wrap_list_elements.py | major/ansible-role-aptly | ca975fe854831c0694c0b5dc56be9ac056b7602c | [
"MIT"
] | 7 | 2015-11-01T15:05:09.000Z | 2019-01-18T09:35:54.000Z | from ansible import errors
#
# Additional Jinja2 filter to wrap list elements with quote
#
def wrap_list_elements(arg):
"""
Wrap each list element with quote, to use before join filter
:param arg: the brute list to manage
:type arg: list
:return: quoted elements
:rtype: l... | 21.351351 | 68 | 0.634177 | from ansible import errors
#
# Additional Jinja2 filter to wrap list elements with quote
#
def wrap_list_elements(arg):
"""
Wrap each list element with quote, to use before join filter
:param arg: the brute list to manage
:type arg: list
:return: quoted elements
:rtype: l... | 28 | 0 | 27 |
b18fc2e4398b5fe692a468df028978c6863ce1e5 | 421 | py | Python | assessement_image_basic.py | JeffLabonte/Computer_Vision_Course_Example | 6da36419b424ef4b65e493f8467aa8a5ffddd30b | [
"MIT"
] | null | null | null | assessement_image_basic.py | JeffLabonte/Computer_Vision_Course_Example | 6da36419b424ef4b65e493f8467aa8a5ffddd30b | [
"MIT"
] | null | null | null | assessement_image_basic.py | JeffLabonte/Computer_Vision_Course_Example | 6da36419b424ef4b65e493f8467aa8a5ffddd30b | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib.pyplot as plt
img = cv2.imread("Computer-Vision-with-Python/DATA/dog_backpack.png")
plt.imshow(img)
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt.imshow(img_rgb)
new_img = img_rgb.copy()
new_img = cv2.flip(new_img, 0)
plt.imshow(new_img)
pt1 = (200, 380)
pt2 = (... | 22.157895 | 71 | 0.743468 | import cv2
import numpy as np
import matplotlib.pyplot as plt
img = cv2.imread("Computer-Vision-with-Python/DATA/dog_backpack.png")
plt.imshow(img)
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt.imshow(img_rgb)
new_img = img_rgb.copy()
new_img = cv2.flip(new_img, 0)
plt.imshow(new_img)
pt1 = (200, 380)
pt2 = (... | 0 | 0 | 0 |
04a4848fd3a50deebad0f5129e982bbc9c0a69b8 | 150 | py | Python | points/urls.py | rmishra7/cms | 06898eabe708254eedfa410694f86396fcf69f53 | [
"MIT"
] | null | null | null | points/urls.py | rmishra7/cms | 06898eabe708254eedfa410694f86396fcf69f53 | [
"MIT"
] | null | null | null | points/urls.py | rmishra7/cms | 06898eabe708254eedfa410694f86396fcf69f53 | [
"MIT"
] | null | null | null |
from django.conf.urls import url
from points import apis
urlpatterns = [
url(r'^$', apis.PointsTableApi.as_view(), name="api_points_table")
]
| 15 | 70 | 0.713333 |
from django.conf.urls import url
from points import apis
urlpatterns = [
url(r'^$', apis.PointsTableApi.as_view(), name="api_points_table")
]
| 0 | 0 | 0 |
e6377ef30a571471f18d96d915d9f9353c8eae6b | 3,734 | py | Python | MyGame/code/tile_box.py | Chad474/2dPyGame | 22d2c19a5407fa4b539b772facfc5c08e6860ddd | [
"MIT"
] | null | null | null | MyGame/code/tile_box.py | Chad474/2dPyGame | 22d2c19a5407fa4b539b772facfc5c08e6860ddd | [
"MIT"
] | null | null | null | MyGame/code/tile_box.py | Chad474/2dPyGame | 22d2c19a5407fa4b539b772facfc5c08e6860ddd | [
"MIT"
] | null | null | null | import pygame
from tile_movingbox import MovingBox
| 25.751724 | 79 | 0.610337 | import pygame
from tile_movingbox import MovingBox
def check_if_box(block):
if type(block) is Box:
return True
elif type(block) is JumpBox:
return True
elif type(block) is MovingBox:
return True
return False
def static_boxes(box_list):
for box in box_list.sprites... | 3,127 | 402 | 151 |
ee69d4394b07343fbd1a670c78a0e3edc5afb890 | 1,221 | py | Python | osmaxx/excerptexport/urls.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | 27 | 2015-03-30T14:17:26.000Z | 2022-02-19T17:30:44.000Z | osmaxx/excerptexport/urls.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | 483 | 2015-03-09T16:58:03.000Z | 2022-03-14T09:29:06.000Z | osmaxx/excerptexport/urls.py | tyrasd/osmaxx | da4454083d17b2ef8b0623cad62e39992b6bd52a | [
"MIT"
] | 6 | 2015-04-07T07:38:30.000Z | 2020-04-01T12:45:53.000Z | from django.conf.urls import url
from django.contrib.auth.views import login, logout
from django.views.generic import TemplateView
from osmaxx.excerptexport.views import (
delete_excerpt,
export_list,
export_detail,
manage_own_excerpts,
order_new_excerpt,
order_existing_excerpt,
)
excerpt_exp... | 34.885714 | 103 | 0.710893 | from django.conf.urls import url
from django.contrib.auth.views import login, logout
from django.views.generic import TemplateView
from osmaxx.excerptexport.views import (
delete_excerpt,
export_list,
export_detail,
manage_own_excerpts,
order_new_excerpt,
order_existing_excerpt,
)
excerpt_exp... | 0 | 0 | 0 |
b6cb7e0878363791464914093ee1e35bdf2144d8 | 1,905 | py | Python | tests/unit/test_config.py | paulopes/runningtrack | ce01730fd8e92f5411d45705e6a857eedd7374cd | [
"Apache-2.0"
] | 2 | 2019-04-22T03:16:08.000Z | 2019-04-22T22:09:30.000Z | tests/unit/test_config.py | paulopes/runningtrack | ce01730fd8e92f5411d45705e6a857eedd7374cd | [
"Apache-2.0"
] | 4 | 2018-11-10T21:16:16.000Z | 2018-11-10T23:18:59.000Z | tests/unit/test_config.py | paulopes/runningtrack | ce01730fd8e92f5411d45705e6a857eedd7374cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
""" Unit tests for the running.config module
"""
from __future__ import print_function, division, unicode_literals
import os
import running.config as config
def test_load_config_ini():
""" Load a test configuration file in .ini format, and
check if the DEFAULT section propagate... | 25.065789 | 74 | 0.493438 | # -*- coding: utf-8 -*-
""" Unit tests for the running.config module
"""
from __future__ import print_function, division, unicode_literals
import os
import running.config as config
def test_load_config_ini():
""" Load a test configuration file in .ini format, and
check if the DEFAULT section propagate... | 0 | 0 | 0 |
3f58e8080b40914eaea3d6b88428011db919a95a | 630 | py | Python | tests/testapp/views.py | matthiask/feincms3-downloads | 962bf2574feb1627a0cf794dd20e038377fb4c1e | [
"MIT"
] | 2 | 2021-04-12T10:36:34.000Z | 2021-10-03T12:17:57.000Z | tests/testapp/views.py | matthiask/feincms3-downloads | 962bf2574feb1627a0cf794dd20e038377fb4c1e | [
"MIT"
] | null | null | null | tests/testapp/views.py | matthiask/feincms3-downloads | 962bf2574feb1627a0cf794dd20e038377fb4c1e | [
"MIT"
] | 1 | 2019-09-29T05:58:25.000Z | 2019-09-29T05:58:25.000Z | from django.shortcuts import get_object_or_404, render
from feincms3 import plugins
from feincms3.regions import Regions
from feincms3.renderer import TemplatePluginRenderer
from .models import HTML, Article, Download
renderer = TemplatePluginRenderer()
renderer.register_string_renderer(HTML, plugins.html.render_html... | 31.5 | 87 | 0.774603 | from django.shortcuts import get_object_or_404, render
from feincms3 import plugins
from feincms3.regions import Regions
from feincms3.renderer import TemplatePluginRenderer
from .models import HTML, Article, Download
renderer = TemplatePluginRenderer()
renderer.register_string_renderer(HTML, plugins.html.render_html... | 213 | 0 | 23 |
396df33f8d1ede98400b2c34baa926f24ec900d4 | 578 | py | Python | scantron/tests.py | suhelhammoud/scantron | fcf64d973342cd63acf5235ce621fed02aeae47d | [
"MIT"
] | null | null | null | scantron/tests.py | suhelhammoud/scantron | fcf64d973342cd63acf5235ce621fed02aeae47d | [
"MIT"
] | null | null | null | scantron/tests.py | suhelhammoud/scantron | fcf64d973342cd63acf5235ce621fed02aeae47d | [
"MIT"
] | null | null | null | from django.test import TestCase
from .resources import StudentResource
from .models import Student
# TODO modify code to do REAL testing | 34 | 64 | 0.65917 | from django.test import TestCase
from .resources import StudentResource
from .models import Student
# TODO modify code to do REAL testing
class StudetTest(TestCase):
def setUp(self):
Student.objects.create(name="Sami", std_id = "2011300")
Student.objects.create(name="Ahmad", std_id = "2011500")
... | 188 | 230 | 22 |
427fe59299333a0f870405e8974d8aeb4a098740 | 1,587 | py | Python | deeplabcut/pose_estimation_tensorflow/dataset/pose_dataset.py | serre-lab/deeplabcut_mgh | aa37b104ba4967932528d4f79665648474f51112 | [
"MIT"
] | null | null | null | deeplabcut/pose_estimation_tensorflow/dataset/pose_dataset.py | serre-lab/deeplabcut_mgh | aa37b104ba4967932528d4f79665648474f51112 | [
"MIT"
] | 1 | 2019-12-15T00:37:15.000Z | 2019-12-15T00:37:15.000Z | deeplabcut/pose_estimation_tensorflow/dataset/pose_dataset.py | kalpitthakkar/deeplabcut_mgh_pose | 8fa4a59f422ff0357552e290230838239edcfe1b | [
"MIT"
] | null | null | null | '''
Adapted from DeeperCut by Eldar Insafutdinov
https://github.com/eldar/pose-tensorflow
'''
from enum import Enum
import numpy as np
# Augmentation functions
def CropImage(joints,im,Xlabel,Ylabel,cfg):
''' Randomly cropping image around xlabel,ylabel taking into account size of image. Introduced in DLC 2 '''
... | 31.117647 | 125 | 0.672968 | '''
Adapted from DeeperCut by Eldar Insafutdinov
https://github.com/eldar/pose-tensorflow
'''
from enum import Enum
import numpy as np
class Batch(Enum):
inputs = 0
part_score_targets = 1
part_score_weights = 2
locref_targets = 3
locref_mask = 4
pairwise_targets = 5
pairwise_mask = 6
d... | 287 | 177 | 91 |
a0a41812b1925cad41bf397f94704699fb2e3b66 | 3,096 | py | Python | tests/test_kind.py | lycantropos/shewchuk | 0091891e57d6700d71ad38d6c445397a2c53c2b7 | [
"MIT"
] | null | null | null | tests/test_kind.py | lycantropos/shewchuk | 0091891e57d6700d71ad38d6c445397a2c53c2b7 | [
"MIT"
] | null | null | null | tests/test_kind.py | lycantropos/shewchuk | 0091891e57d6700d71ad38d6c445397a2c53c2b7 | [
"MIT"
] | null | null | null | from typing import Tuple
from hypothesis import given
from shewchuk import (kind,
vectors_dot_product)
from tests.utils import (exact_kind,
to_sign)
from . import strategies
@given(strategies.floats_sextuplets)
@given(strategies.floats_quadruplets)
@given(strategie... | 40.736842 | 76 | 0.676034 | from typing import Tuple
from hypothesis import given
from shewchuk import (kind,
vectors_dot_product)
from tests.utils import (exact_kind,
to_sign)
from . import strategies
@given(strategies.floats_sextuplets)
def test_basic(sextuplet: Tuple[float, float, float, float... | 2,628 | 0 | 88 |
62e477f0f1ec380d60c2fbcd1f119ae3c51edaf5 | 486 | py | Python | setup.py | csmarfan/petpy | d5edaea43a6657e6a93a1f01f3dd27e9e8fbb0cf | [
"Apache-2.0"
] | null | null | null | setup.py | csmarfan/petpy | d5edaea43a6657e6a93a1f01f3dd27e9e8fbb0cf | [
"Apache-2.0"
] | 2 | 2019-06-19T12:16:12.000Z | 2019-06-19T12:38:02.000Z | setup.py | csmarfan/petpy | d5edaea43a6657e6a93a1f01f3dd27e9e8fbb0cf | [
"Apache-2.0"
] | 1 | 2019-06-19T12:27:06.000Z | 2019-06-19T12:27:06.000Z | from setuptools import setup
setup(name='petpy',
version='0.1',
description='Petrophysics utilities',
url='https://example.com/',
author = 'Fan',
author_email='yuanzhong.fan@shell.com',
license = 'Apache 2',
pakages=['petpy'],
install_requires=['numpy'],
... | 30.375 | 47 | 0.54321 | from setuptools import setup
setup(name='petpy',
version='0.1',
description='Petrophysics utilities',
url='https://example.com/',
author = 'Fan',
author_email='yuanzhong.fan@shell.com',
license = 'Apache 2',
pakages=['petpy'],
install_requires=['numpy'],
... | 0 | 0 | 0 |
1f38fc45c9f57f950dc20432a34d9b30298bfa71 | 2,514 | py | Python | dask_saturn/backoff.py | saturncloud/dask-saturn | 9c9733f68fee26e60f544ab9653bc9056b7543e5 | [
"BSD-3-Clause"
] | 12 | 2020-05-19T17:18:06.000Z | 2022-03-24T01:25:57.000Z | dask_saturn/backoff.py | saturncloud/dask-saturn | 9c9733f68fee26e60f544ab9653bc9056b7543e5 | [
"BSD-3-Clause"
] | 32 | 2020-04-01T13:43:38.000Z | 2021-12-21T18:42:13.000Z | dask_saturn/backoff.py | saturncloud/dask-saturn | 9c9733f68fee26e60f544ab9653bc9056b7543e5 | [
"BSD-3-Clause"
] | 3 | 2020-04-28T13:52:22.000Z | 2021-09-15T02:03:28.000Z | """
Lightweight implementation of exponential backoff,
used for operations that require polling. This is simple enough
that it isn't worth bringing in a new dependency for it.
"""
from time import sleep
from datetime import datetime
from math import ceil
from random import randrange
class ExpBackoff:
"""
``S... | 35.408451 | 90 | 0.663087 | """
Lightweight implementation of exponential backoff,
used for operations that require polling. This is simple enough
that it isn't worth bringing in a new dependency for it.
"""
from time import sleep
from datetime import datetime
from math import ceil
from random import randrange
class ExpBackoff:
"""
``S... | 0 | 0 | 0 |
bec83fb8bd6c75559aaf20eeef95d3956142f1c5 | 3,015 | py | Python | gazeclassify/tests/unit/test_OpenCVVideoReader.py | Flow000/gazeclassify | dda4c8cd62ad84615f4272171f1635ab683f9bed | [
"MIT"
] | 6 | 2021-02-25T01:17:09.000Z | 2022-03-19T07:13:52.000Z | gazeclassify/tests/unit/test_OpenCVVideoReader.py | Flow000/gazeclassify | dda4c8cd62ad84615f4272171f1635ab683f9bed | [
"MIT"
] | 3 | 2021-05-10T07:38:24.000Z | 2021-06-07T12:59:29.000Z | gazeclassify/tests/unit/test_OpenCVVideoReader.py | Flow000/gazeclassify | dda4c8cd62ad84615f4272171f1635ab683f9bed | [
"MIT"
] | 1 | 2021-06-24T12:58:01.000Z | 2021-06-24T12:58:01.000Z | import io
from dataclasses import dataclass
import cv2 # type: ignore
import numpy as np # type: ignore
from PIL import Image # type: ignore
@dataclass
| 34.261364 | 107 | 0.668657 | import io
from dataclasses import dataclass
import cv2 # type: ignore
import numpy as np # type: ignore
from PIL import Image # type: ignore
@dataclass
class VideoHandle:
stream: cv2.VideoCapture
width: int
height: int
fps: int
class TestOpenCVVideoReader:
def test_read_two_video_frames_openc... | 2,599 | 77 | 179 |
dcabc35ace7762a3ac7e2768db9464f713687e1e | 2,656 | py | Python | account/models.py | Emmastro/africanlibraries | 6755dd5a7d3453c7ba6e63d49071f9f5af280f71 | [
"Apache-2.0"
] | null | null | null | account/models.py | Emmastro/africanlibraries | 6755dd5a7d3453c7ba6e63d49071f9f5af280f71 | [
"Apache-2.0"
] | null | null | null | account/models.py | Emmastro/africanlibraries | 6755dd5a7d3453c7ba6e63d49071f9f5af280f71 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.urls import reverse
from django.contrib.auth.models import User
class Reader(User):
"""
A reader is any school member that can have access to the library for
reading purpose
"""
# Reader's school
school = models.ForeignKey('schools.School',
on_delete=models.CASCADE)
... | 25.295238 | 90 | 0.725904 | from django.db import models
from django.urls import reverse
from django.contrib.auth.models import User
class Reader(User):
"""
A reader is any school member that can have access to the library for
reading purpose
"""
# Reader's school
school = models.ForeignKey('schools.School',
on_delete=models.CASCADE)
... | 195 | 0 | 72 |
6b12411d483da832edf7bcaa1cfa3bafb65bbb40 | 9,403 | py | Python | tekore/_auth/expiring/client.py | Allerter/tekore | 20cf68280fb5b691126600a5b474ee841f7be199 | [
"MIT"
] | 135 | 2020-01-14T17:47:26.000Z | 2022-03-25T18:30:04.000Z | tekore/_auth/expiring/client.py | Allerter/tekore | 20cf68280fb5b691126600a5b474ee841f7be199 | [
"MIT"
] | 135 | 2020-01-13T22:56:35.000Z | 2022-03-11T19:41:36.000Z | tekore/_auth/expiring/client.py | Allerter/tekore | 20cf68280fb5b691126600a5b474ee841f7be199 | [
"MIT"
] | 21 | 2020-01-16T16:01:23.000Z | 2022-02-17T12:46:32.000Z | from base64 import b64encode as _b64encode
from typing import Tuple
from hashlib import sha256
from secrets import token_urlsafe
from urllib.parse import urlencode
from .decor import parse_token, parse_refreshed_token
from .token import Token
from ..scope import Scope
from ..._sender import Sender, Client, send_and_p... | 30.332258 | 84 | 0.584175 | from base64 import b64encode as _b64encode
from typing import Tuple
from hashlib import sha256
from secrets import token_urlsafe
from urllib.parse import urlencode
from .decor import parse_token, parse_refreshed_token
from .token import Token
from ..scope import Scope
from ..._sender import Sender, Client, send_and_p... | 1,517 | 0 | 108 |
0587045a70a089d0e2fb0c2508b2623eba5fd3c0 | 3,700 | py | Python | automow_maps/scripts/field_publisher.py | Auburn-Automow/au_automow_common | 920be6a740aa6d738e9954417b41490e353efd04 | [
"BSD-3-Clause"
] | 43 | 2016-03-05T17:06:29.000Z | 2022-03-10T08:50:46.000Z | automow_maps/scripts/field_publisher.py | qintxwd/au_automow_common | 920be6a740aa6d738e9954417b41490e353efd04 | [
"BSD-3-Clause"
] | 2 | 2017-07-10T12:43:49.000Z | 2019-03-13T13:57:31.000Z | automow_maps/scripts/field_publisher.py | qintxwd/au_automow_common | 920be6a740aa6d738e9954417b41490e353efd04 | [
"BSD-3-Clause"
] | 22 | 2016-03-23T06:10:52.000Z | 2022-03-10T08:50:49.000Z | #!/usr/bin/env python
"""
This ROS node takes the field survey file and publishes a
field polygon as a geometry_msgs/PolygonStamped for use in
other nodes and for visualization in rviz.
"""
import roslib; roslib.load_manifest('automow_maps')
import rospy
from geometry_msgs.msg import PolygonStamped, Point32, Polygo... | 37 | 85 | 0.605405 | #!/usr/bin/env python
"""
This ROS node takes the field survey file and publishes a
field polygon as a geometry_msgs/PolygonStamped for use in
other nodes and for visualization in rviz.
"""
import roslib; roslib.load_manifest('automow_maps')
import rospy
from geometry_msgs.msg import PolygonStamped, Point32, Polygo... | 3,111 | 0 | 80 |
5ddf20fef29c8012101e7fb1a4922bd6af50aece | 26,502 | py | Python | smlb/core/metrics.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 6 | 2020-07-27T21:08:55.000Z | 2021-05-04T07:00:29.000Z | smlb/core/metrics.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 18 | 2020-09-01T00:47:04.000Z | 2021-09-15T22:16:56.000Z | smlb/core/metrics.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 2 | 2020-08-24T21:50:16.000Z | 2020-12-06T05:18:57.000Z | """Evaluation metrics.
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
(c) Matthias Rupp 2019, Citrine Informatics.
Related terms: objective functions, loss functions, cost functions,
reward functions, utility functions, fitness functions, score functions,... | 35.716981 | 152 | 0.659497 | """Evaluation metrics.
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
(c) Matthias Rupp 2019, Citrine Informatics.
Related terms: objective functions, loss functions, cost functions,
reward functions, utility functions, fitness functions, score functions,... | 0 | 0 | 0 |
0e281d56c5f9905e8839b0896a7170ae4e709fb0 | 41,296 | py | Python | sepnet/model.py | Andrewzh112/SepNet | 58618efd82a72b156ccbb45005d18d347982865f | [
"MIT"
] | null | null | null | sepnet/model.py | Andrewzh112/SepNet | 58618efd82a72b156ccbb45005d18d347982865f | [
"MIT"
] | null | null | null | sepnet/model.py | Andrewzh112/SepNet | 58618efd82a72b156ccbb45005d18d347982865f | [
"MIT"
] | null | null | null | import torch
from torch import nn
class DistractionConv(nn.Module):
"""Inspired by SKNet"""
| 34.128926 | 79 | 0.499177 | import torch
from torch import nn
def convs(in_channels, out_channels):
return nn.Sequential(
nn.Conv2d(in_channels=in_channels,
out_channels=out_channels,
kernel_size=3,
padding=1),
nn.BatchNorm2d(out_channels),
nn.LeakyReLU(inplace=Tr... | 39,819 | 191 | 1,174 |
bd9fc6a2e9a1bd5460c3136bbc62956e2761bb63 | 1,604 | py | Python | examples/script.py | FelixBoelle/aiida-ase-basic | 25a89835b880e07e695a0fdef280be4319b23cb4 | [
"MIT"
] | null | null | null | examples/script.py | FelixBoelle/aiida-ase-basic | 25a89835b880e07e695a0fdef280be4319b23cb4 | [
"MIT"
] | 1 | 2019-11-06T18:10:56.000Z | 2019-11-06T18:10:56.000Z | examples/script.py | FelixBoelle/aiida-ase-basic | 25a89835b880e07e695a0fdef280be4319b23cb4 | [
"MIT"
] | 1 | 2019-11-07T08:44:47.000Z | 2019-11-07T08:44:47.000Z | """
Test script that uses ASE to run an EMT calculation
Script partly from the ASE intro tutorials
https://wiki.fysik.dtu.dk/ase/tutorials/surface.html
"""
# --------------------- STEP 1: Prepare the atoms/structure object ------------
#from ase.build import fcc111
#h = 1.85
#d = 1.10
#atoms = fcc111('Cu', size=(4, ... | 32.734694 | 79 | 0.597257 | """
Test script that uses ASE to run an EMT calculation
Script partly from the ASE intro tutorials
https://wiki.fysik.dtu.dk/ase/tutorials/surface.html
"""
# --------------------- STEP 1: Prepare the atoms/structure object ------------
#from ase.build import fcc111
#h = 1.85
#d = 1.10
#atoms = fcc111('Cu', size=(4, ... | 0 | 0 | 0 |
b692793606989fb6d0b83138ad1b450a2f06bf18 | 510 | py | Python | app/board_app/migrations/0003_auto_20200708_1139.py | KimKiHyuk/BenefitObserver | 74d59ee2d9dc81f8b8423e14a9ce950fa21f332b | [
"MIT"
] | null | null | null | app/board_app/migrations/0003_auto_20200708_1139.py | KimKiHyuk/BenefitObserver | 74d59ee2d9dc81f8b8423e14a9ce950fa21f332b | [
"MIT"
] | 8 | 2021-03-30T13:53:18.000Z | 2022-03-02T14:54:13.000Z | app/board_app/migrations/0003_auto_20200708_1139.py | KimKiHyuk/BenefitObserver | 74d59ee2d9dc81f8b8423e14a9ce950fa21f332b | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-07-08 11:39
from django.db import migrations
| 23.181818 | 81 | 0.584314 | # Generated by Django 3.0.7 on 2020-07-08 11:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('board_app', '0002_auto_20200630_0938'),
]
operations = [
migrations.AlterModelOptions(
name='posts',
options={'ordering': ['... | 0 | 404 | 23 |
d1262dcb778ce01b695f8d85addafbc5daac572e | 6,646 | py | Python | plyer/platforms/win/cpu.py | EdwardCoventry/plyer | 4002b21fe1a664e80b422547b8ae04d2a2d3037d | [
"MIT"
] | 1,184 | 2015-01-02T23:24:46.000Z | 2022-03-27T16:28:16.000Z | plyer/platforms/win/cpu.py | EdwardCoventry/plyer | 4002b21fe1a664e80b422547b8ae04d2a2d3037d | [
"MIT"
] | 469 | 2015-01-02T09:23:15.000Z | 2022-03-17T10:35:58.000Z | plyer/platforms/win/cpu.py | EdwardCoventry/plyer | 4002b21fe1a664e80b422547b8ae04d2a2d3037d | [
"MIT"
] | 431 | 2015-01-05T23:00:43.000Z | 2022-03-15T04:20:03.000Z | '''
Module of Windows API for plyer.cpu.
'''
from ctypes import (
c_ulonglong, c_ulong, byref,
Structure, POINTER, Union, windll, create_string_buffer,
sizeof, cast, c_void_p, c_uint32
)
from ctypes.wintypes import (
BYTE, DWORD, WORD
)
from plyer.facades import CPU
KERNEL = windll.kernel32
ERROR_IN... | 26.268775 | 75 | 0.592838 | '''
Module of Windows API for plyer.cpu.
'''
from ctypes import (
c_ulonglong, c_ulong, byref,
Structure, POINTER, Union, windll, create_string_buffer,
sizeof, cast, c_void_p, c_uint32
)
from ctypes.wintypes import (
BYTE, DWORD, WORD
)
from plyer.facades import CPU
KERNEL = windll.kernel32
ERROR_IN... | 3,716 | 0 | 188 |
7259792742b0ad4d459082903d93acb6d50ac521 | 735 | py | Python | gaussian.py | santosmv/probability-distributions | 7e21069a6998897d996dec4e8bafc775b2fe0098 | [
"MIT"
] | null | null | null | gaussian.py | santosmv/probability-distributions | 7e21069a6998897d996dec4e8bafc775b2fe0098 | [
"MIT"
] | null | null | null | gaussian.py | santosmv/probability-distributions | 7e21069a6998897d996dec4e8bafc775b2fe0098 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from distributions import gaussian
mu_list = [0, -5, 3]
sigma_list = [1, 2, 4]
x = np.linspace(-15, 15, 500)
for i in range(len(mu_list)):
mu = mu_list[i]
sigma = sigma_list[i]
plt.plot(x, gaussian(x, mu, sigma), label=r'$\mu = %d$'%mu + r' $\sigma = ... | 28.269231 | 151 | 0.668027 | import numpy as np
import matplotlib.pyplot as plt
from distributions import gaussian
mu_list = [0, -5, 3]
sigma_list = [1, 2, 4]
x = np.linspace(-15, 15, 500)
for i in range(len(mu_list)):
mu = mu_list[i]
sigma = sigma_list[i]
plt.plot(x, gaussian(x, mu, sigma), label=r'$\mu = %d$'%mu + r' $\sigma = ... | 0 | 0 | 0 |
f1127d1ceb6b0f1debf418a6f19cebc92d82130c | 972 | py | Python | utils.py | ThomasRanvier/autoencoders_and_gans | cab05522d847c512cdfea4b853f454d2fdd80581 | [
"MIT"
] | 1 | 2021-02-04T21:50:24.000Z | 2021-02-04T21:50:24.000Z | utils.py | ThomasRanvier/image_restoration | cab05522d847c512cdfea4b853f454d2fdd80581 | [
"MIT"
] | null | null | null | utils.py | ThomasRanvier/image_restoration | cab05522d847c512cdfea4b853f454d2fdd80581 | [
"MIT"
] | null | null | null | import datasets
import matplotlib.pyplot as plt
| 31.354839 | 110 | 0.688272 | import datasets
import matplotlib.pyplot as plt
def _raise(ex):
raise NotImplementedError(ex)
def load_dataset(dataset_name, batch_size=128):
datasets_switch = {
'mnist': datasets.load_mnist,
'noisy_mnist': datasets.load_noisy_mnist,
'fashion_mnist': datasets.load_fashion_mnist,
... | 853 | 0 | 69 |
ebe2a5ddb21e51192a8434ce010c70d3fbda8c69 | 6,271 | py | Python | tests/netcdf_engine/test_convert_multifragments.py | TileDB-Inc/TileDB-CF-Py | 9aab0fe9ba7346a1846c7458a5d08b123dcf90a8 | [
"MIT"
] | 12 | 2021-06-07T16:51:32.000Z | 2022-03-10T12:48:00.000Z | tests/netcdf_engine/test_convert_multifragments.py | TileDB-Inc/TileDB-CF-Py | 9aab0fe9ba7346a1846c7458a5d08b123dcf90a8 | [
"MIT"
] | 72 | 2021-04-28T21:49:41.000Z | 2022-02-24T13:58:11.000Z | tests/netcdf_engine/test_convert_multifragments.py | TileDB-Inc/TileDB-CF-Py | 9aab0fe9ba7346a1846c7458a5d08b123dcf90a8 | [
"MIT"
] | 3 | 2021-08-11T16:33:37.000Z | 2021-12-01T20:31:12.000Z | # Copyright 2021 TileDB Inc.
# Licensed under the MIT License.
import numpy as np
import pytest
import tiledb
from tiledb.cf import Group, NetCDF4ConverterEngine
netCDF4 = pytest.importorskip("netCDF4")
class TestSimplyCopyChunks:
"""Test converting a simple NetCDF in chunks.
NetCDF File:
dimensions:
... | 39.440252 | 86 | 0.614894 | # Copyright 2021 TileDB Inc.
# Licensed under the MIT License.
import numpy as np
import pytest
import tiledb
from tiledb.cf import Group, NetCDF4ConverterEngine
netCDF4 = pytest.importorskip("netCDF4")
class TestSimplyCopyChunks:
"""Test converting a simple NetCDF in chunks.
NetCDF File:
dimensions:
... | 0 | 0 | 0 |
ada7701a7425979917dc464f79038b2b74c9fb6d | 14,117 | py | Python | mi/dataset/driver/ctdpf_ckl/wfp/test/test_driver.py | rhan1498/marine-integrations | ad94c865e0e4cc7c8fd337870410c74b57d5c826 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/driver/ctdpf_ckl/wfp/test/test_driver.py | rhan1498/marine-integrations | ad94c865e0e4cc7c8fd337870410c74b57d5c826 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/driver/ctdpf_ckl/wfp/test/test_driver.py | rhan1498/marine-integrations | ad94c865e0e4cc7c8fd337870410c74b57d5c826 | [
"BSD-2-Clause"
] | null | null | null | """
@package mi.dataset.driver.ctdpf_ckl.wfp.test.test_driver
@file marine-integrations/mi/dataset/driver/ctdpf_ckl/wfp/driver.py
@author cgoodrich
@brief Test cases for ctdpf_ckl_wfp driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/dsa/test_driver
$ bin/dsa/test_driver -i [-t... | 39.543417 | 122 | 0.6393 | """
@package mi.dataset.driver.ctdpf_ckl.wfp.test.test_driver
@file marine-integrations/mi/dataset/driver/ctdpf_ckl/wfp/driver.py
@author cgoodrich
@brief Test cases for ctdpf_ckl_wfp driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/dsa/test_driver
$ bin/dsa/test_driver -i [-t... | 137 | 10,998 | 44 |
2e3208da4f7b896f8fbaa40603f80a8420f457dd | 804 | py | Python | interpretability/explanation_methods/__init__.py | moboehle/CoDA-Nets | 9f43f286d8a662078e21dc401a315e257da21c0d | [
"BSD-2-Clause",
"0BSD"
] | 25 | 2021-06-14T09:14:12.000Z | 2022-03-31T14:27:09.000Z | interpretability/explanation_methods/__init__.py | moboehle/B-cos | 5f9218f6773534c80367793d1cd767742869764a | [
"BSD-2-Clause",
"0BSD"
] | 1 | 2021-07-05T12:31:58.000Z | 2021-07-05T12:31:58.000Z | interpretability/explanation_methods/__init__.py | moboehle/CoDA-Nets | 9f43f286d8a662078e21dc401a315e257da21c0d | [
"BSD-2-Clause",
"0BSD"
] | 3 | 2021-07-10T09:37:54.000Z | 2022-02-18T21:02:20.000Z | from interpretability.explanation_methods.explainers.rise import RISE
from interpretability.explanation_methods.explainers.lime import Lime
from interpretability.explanation_methods.explainers.occlusion import Occlusion
from interpretability.explanation_methods.explainers.captum import GradCam, GB, IxG, Grad, DeepLIFT,... | 33.5 | 108 | 0.771144 | from interpretability.explanation_methods.explainers.rise import RISE
from interpretability.explanation_methods.explainers.lime import Lime
from interpretability.explanation_methods.explainers.occlusion import Occlusion
from interpretability.explanation_methods.explainers.captum import GradCam, GB, IxG, Grad, DeepLIFT,... | 135 | 0 | 23 |
4f9d0c16553dd37369561237a7161761ce921494 | 14,968 | py | Python | repartition_experiments/algorithms/utils.py | big-data-lab-team/repartition_experiments | 71cff469d2036f3e325ea3fc15b9f686c794f8d8 | [
"MIT"
] | null | null | null | repartition_experiments/algorithms/utils.py | big-data-lab-team/repartition_experiments | 71cff469d2036f3e325ea3fc15b9f686c794f8d8 | [
"MIT"
] | 1 | 2020-07-05T02:06:19.000Z | 2020-09-25T16:20:39.000Z | repartition_experiments/algorithms/utils.py | GTimothee/repartition_experiments | 71cff469d2036f3e325ea3fc15b9f686c794f8d8 | [
"MIT"
] | null | null | null | import operator, logging, math, psutil
from enum import Enum
from repartition_experiments.file_formats.hdf5 import HDF5_manager
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
logger = logging.getLogger(__name__)
def get_volumes(R, B):
""" Returns a dictionary mapping each buffe... | 32.53913 | 205 | 0.620657 | import operator, logging, math, psutil
from enum import Enum
from repartition_experiments.file_formats.hdf5 import HDF5_manager
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
logger = logging.getLogger(__name__)
class Axes(Enum):
i = 0
j = 1
k = 2
class Volume:
def __... | 2,702 | 410 | 197 |
7039fa9efaf3eed38d0a11013660a04b20f4c052 | 1,468 | py | Python | PythonLeetcode/周赛/223/summary.py | Lcoderfit/Introduction-to-algotithms | aea2630be6ca2c60186593d6e66b0a59e56dc848 | [
"MIT"
] | 3 | 2018-08-25T16:14:16.000Z | 2019-10-15T22:25:32.000Z | PythonLeetcode/周赛/223/summary.py | Lcoderfit/Introduction-to-algotithms | aea2630be6ca2c60186593d6e66b0a59e56dc848 | [
"MIT"
] | null | null | null | PythonLeetcode/周赛/223/summary.py | Lcoderfit/Introduction-to-algotithms | aea2630be6ca2c60186593d6e66b0a59e56dc848 | [
"MIT"
] | 1 | 2019-10-08T09:03:48.000Z | 2019-10-08T09:03:48.000Z | """
一、1167. 连接棒材的最低费用.py
遇到这种需要排序,然后取最小的两个或者最大的两个数进行操作得到一个结果,这个结果又要与剩下的元素进行同样操作的时候,可以采用堆的数据结构简化
二、1564. 把箱子放进仓库里 I.py
1.当有双指针时,其中一个指针必须遍历完所有元素,则可将while替换为for循环
2.这个跟分发饼干有些类似,关键在于将高低不同的warehouse转换为非递增的序列
例如 3 5 4 2 3, 后一块墙能通过多大的板子受到前一块板子的限制,也就是能通过当前墙面的最大板子为min(前一块墙高度,当前墙高度)
所以可以通过从左到右遍历,两个相邻的墙对比,如果后一块墙要高于前一快,则将后一块改成跟前一... | 31.234043 | 86 | 0.740463 | """
一、1167. 连接棒材的最低费用.py
遇到这种需要排序,然后取最小的两个或者最大的两个数进行操作得到一个结果,这个结果又要与剩下的元素进行同样操作的时候,可以采用堆的数据结构简化
二、1564. 把箱子放进仓库里 I.py
1.当有双指针时,其中一个指针必须遍历完所有元素,则可将while替换为for循环
2.这个跟分发饼干有些类似,关键在于将高低不同的warehouse转换为非递增的序列
例如 3 5 4 2 3, 后一块墙能通过多大的板子受到前一块板子的限制,也就是能通过当前墙面的最大板子为min(前一块墙高度,当前墙高度)
所以可以通过从左到右遍历,两个相邻的墙对比,如果后一块墙要高于前一快,则将后一块改成跟前一... | 0 | 0 | 0 |
288bb81d358fa77f0218517e7452e76bd9daf534 | 34 | py | Python | oasislmf/cli/__init__.py | ibailey-SCOR/OasisLMF | 966b4de4e1e64851970f4291c5bdfe7edc20cb7a | [
"BSD-3-Clause"
] | 88 | 2018-03-24T11:57:10.000Z | 2022-03-21T13:04:41.000Z | oasislmf/cli/__init__.py | ibailey-SCOR/OasisLMF | 966b4de4e1e64851970f4291c5bdfe7edc20cb7a | [
"BSD-3-Clause"
] | 558 | 2018-03-14T14:16:30.000Z | 2022-03-29T12:48:14.000Z | oasislmf/cli/__init__.py | ibailey-SCOR/OasisLMF | 966b4de4e1e64851970f4291c5bdfe7edc20cb7a | [
"BSD-3-Clause"
] | 41 | 2018-04-09T11:13:12.000Z | 2021-10-05T14:43:11.000Z | from .root import RootCmd # noqa
| 17 | 33 | 0.735294 | from .root import RootCmd # noqa
| 0 | 0 | 0 |
c18b39d5ec83f88bf9a4528ab2fc41ae5f48f7d3 | 1,685 | py | Python | data/sex-difference.py | franpog859/darwinLogs | 1d0a9bdd7c928ceee96b3121e408fc1ee1d80e05 | [
"Apache-2.0"
] | 7 | 2019-02-21T10:50:09.000Z | 2019-10-16T06:22:27.000Z | data/sex-difference.py | franpog859/darwinLogs | 1d0a9bdd7c928ceee96b3121e408fc1ee1d80e05 | [
"Apache-2.0"
] | null | null | null | data/sex-difference.py | franpog859/darwinLogs | 1d0a9bdd7c928ceee96b3121e408fc1ee1d80e05 | [
"Apache-2.0"
] | 2 | 2019-10-16T17:34:25.000Z | 2020-01-18T20:40:02.000Z | import random
import matplotlib.pyplot as plt
import pandas as pd
from math import fabs
import numpy as np
sex_differences = []
pair_differences = []
for i in range(2, 100):
for j in range(i):
men = j
women = i - j
homo_pair = 0
hetero_pair = 0
for m in range(men):
... | 35.851064 | 255 | 0.681306 | import random
import matplotlib.pyplot as plt
import pandas as pd
from math import fabs
import numpy as np
sex_differences = []
pair_differences = []
for i in range(2, 100):
for j in range(i):
men = j
women = i - j
homo_pair = 0
hetero_pair = 0
for m in range(men):
... | 0 | 0 | 0 |
514cd2c6cf41ca4554af2219f11300bbd63be9fd | 378 | py | Python | project_summarizer/__main__.py | jackdewinter/pyscan | 05ea9bff0aaf4d53aa401c51526bb847accec56a | [
"MIT"
] | 1 | 2021-01-14T17:39:18.000Z | 2021-01-14T17:39:18.000Z | project_summarizer/__main__.py | jackdewinter/pyscan | 05ea9bff0aaf4d53aa401c51526bb847accec56a | [
"MIT"
] | 17 | 2020-08-15T23:27:28.000Z | 2022-02-20T18:23:49.000Z | project_summarizer/__main__.py | jackdewinter/pyscan | 05ea9bff0aaf4d53aa401c51526bb847accec56a | [
"MIT"
] | null | null | null | """
Module to provide for "-m project_summarizer" access to the module,
as if it was run from the console.
"""
import project_summarizer
def main():
"""
Main entry point. Exposed in this manner so that the setup
entry_points configuration has something to execute.
"""
project_summarizer.ProjectSu... | 21 | 67 | 0.701058 | """
Module to provide for "-m project_summarizer" access to the module,
as if it was run from the console.
"""
import project_summarizer
def main():
"""
Main entry point. Exposed in this manner so that the setup
entry_points configuration has something to execute.
"""
project_summarizer.ProjectSu... | 0 | 0 | 0 |
ca88939b873d30889c8ab1eb22c81b8ae87e1875 | 18,742 | py | Python | notebooks/example_utils.py | neonithinar/hexagdly | dcd15bfb7bdabb4f6280f0598f2cf0b923924a81 | [
"MIT"
] | 67 | 2018-02-10T13:54:16.000Z | 2022-01-31T05:41:40.000Z | notebooks/example_utils.py | neonithinar/hexagdly | dcd15bfb7bdabb4f6280f0598f2cf0b923924a81 | [
"MIT"
] | 4 | 2018-02-21T16:28:38.000Z | 2020-05-02T17:01:01.000Z | notebooks/example_utils.py | neonithinar/hexagdly | dcd15bfb7bdabb4f6280f0598f2cf0b923924a81 | [
"MIT"
] | 17 | 2018-05-25T12:30:19.000Z | 2021-07-19T05:48:47.000Z | """
HexagDLy utilities for illustrative examples.
"""
import numpy as np
import numpy.linalg as LA
from scipy.interpolate import griddata
import torch
import torch.utils.data
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
import torch.optim.lr_sc... | 35.699048 | 112 | 0.505336 | """
HexagDLy utilities for illustrative examples.
"""
import numpy as np
import numpy.linalg as LA
from scipy.interpolate import griddata
import torch
import torch.utils.data
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
import torch.optim.lr_sc... | 15,813 | -1 | 747 |
ec341a894798ee4489508adfa9e19d8e1399afde | 653 | py | Python | Practice/Mo's Algo_1.py | rajansh87/Algorithms-Implementations | 1f3dd1bc2decf10638fe0fdeeede47a650a9057b | [
"MIT"
] | 1 | 2020-05-10T19:01:51.000Z | 2020-05-10T19:01:51.000Z | Practice/Mo's Algo_1.py | rajansh87/Algorithms-Implementations | 1f3dd1bc2decf10638fe0fdeeede47a650a9057b | [
"MIT"
] | 9 | 2021-03-17T18:10:18.000Z | 2021-03-29T19:35:06.000Z | Practice/Mo's Algo_1.py | rajansh87/Data-Structures-and-Algorithms-Implementations | 0529079fbcd4d1a047210e9f2ff42c194c0818fe | [
"MIT"
] | null | null | null | # sum of elements in given range
arr=list(map(int,input().split()))
m=int(input("query size: "))
query=[]
for i in range(m):
l,r=map(int,input().split())
query.append([l,r])
query.sort(key=lambda x:x[1])
curL,curR,curS=0,0,0
for i in range(len(query)):
l,r=query[i]
while curL<l: #move to right
... | 21.064516 | 39 | 0.529862 | # sum of elements in given range
arr=list(map(int,input().split()))
m=int(input("query size: "))
query=[]
for i in range(m):
l,r=map(int,input().split())
query.append([l,r])
query.sort(key=lambda x:x[1])
curL,curR,curS=0,0,0
for i in range(len(query)):
l,r=query[i]
while curL<l: #move to right
... | 0 | 0 | 0 |
cee5f59982d776bc1eb45cd99f5023af14e334bd | 3,787 | py | Python | wandbox/__nim__.py | srz-zumix/wandbox-api | 009a5080f8b10068c203dce0b625dd9b38d9b046 | [
"MIT"
] | 6 | 2017-03-16T15:09:08.000Z | 2022-01-11T02:19:36.000Z | wandbox/__nim__.py | srz-zumix/wandbox-api | 009a5080f8b10068c203dce0b625dd9b38d9b046 | [
"MIT"
] | 30 | 2020-04-20T12:21:28.000Z | 2022-01-23T13:58:57.000Z | wandbox/__nim__.py | srz-zumix/wandbox-api | 009a5080f8b10068c203dce0b625dd9b38d9b046 | [
"MIT"
] | 2 | 2020-04-20T13:28:38.000Z | 2020-05-30T11:26:02.000Z | import re
import os
from .cli import CLI
from .runner import Runner
from .__cxx__ import CxxRunner
if __name__ == '__main__':
main()
| 34.743119 | 109 | 0.581991 | import re
import os
from .cli import CLI
from .runner import Runner
from .__cxx__ import CxxRunner
class NimRunner(Runner):
IMPORT_REGEX = re.compile(r'^\s*import\s*(.*?)(\s*except\s*.*|)$')
FROM_IMPORT_REGEX = re.compile(r'^\s*from\s*(\S*?)\s*import\s*(.*?)$')
C_PROC_REGEX = re.compile(r'^\s*proc.*{.*\... | 2,963 | 534 | 146 |
5ffc09ccc88b108f92c7dd0b1f9a1a5c812f7d30 | 3,861 | py | Python | src/bitpay/models/subscription/subscription.py | ppatidar2021/python-bitpay-client | b0bd6ef6f2ce2950fb42e6583113e225639a4340 | [
"MIT"
] | 3 | 2022-01-24T17:02:22.000Z | 2022-03-10T00:57:20.000Z | src/bitpay/models/subscription/subscription.py | ppatidar2021/python-bitpay-client | b0bd6ef6f2ce2950fb42e6583113e225639a4340 | [
"MIT"
] | 1 | 2022-03-08T03:11:09.000Z | 2022-03-09T12:51:13.000Z | src/bitpay/models/subscription/subscription.py | ppatidar2021/python-bitpay-client | b0bd6ef6f2ce2950fb42e6583113e225639a4340 | [
"MIT"
] | 3 | 2021-12-24T05:57:33.000Z | 2022-03-14T09:17:40.000Z | """
Subscription: Subscriptions are repeat billing agreements with specific buyers.
BitPay sends bill emails to buyers identified in active subscriptions according
to the specified schedule.
"""
from .bill_data import BillData
from ...utils.key_utils import change_camel_case_to_snake_case
class Subscription:
"""
... | 24.75 | 85 | 0.532246 | """
Subscription: Subscriptions are repeat billing agreements with specific buyers.
BitPay sends bill emails to buyers identified in active subscriptions according
to the specified schedule.
"""
from .bill_data import BillData
from ...utils.key_utils import change_camel_case_to_snake_case
class Subscription:
"""
... | 602 | 0 | 27 |
6a95395d3565ef2d706e106a3ada8672c0593121 | 541 | py | Python | python/ember/__init__.py | BangShiuh/ember | f0a70c7e01ae0dd7b5bd5ee70c8fc5d3f7207388 | [
"MIT"
] | 27 | 2016-11-22T08:29:48.000Z | 2021-12-01T12:15:39.000Z | python/ember/__init__.py | minhbau/ember | f0a70c7e01ae0dd7b5bd5ee70c8fc5d3f7207388 | [
"MIT"
] | 11 | 2015-02-12T14:12:33.000Z | 2021-04-15T15:53:03.000Z | python/ember/__init__.py | minhbau/ember | f0a70c7e01ae0dd7b5bd5ee70c8fc5d3f7207388 | [
"MIT"
] | 20 | 2016-05-15T04:51:36.000Z | 2022-01-26T09:07:35.000Z | import os.path as _path
import cantera
from ._ember import *
from . import _ember
from .input import *
from .output import *
from . import utils
__version__ = '1.4.0'
# Add Ember's data file directory to Cantera's search path. Because the Python
# module is statically linked to Cantera, this needs to be done separat... | 30.055556 | 78 | 0.778189 | import os.path as _path
import cantera
from ._ember import *
from . import _ember
from .input import *
from .output import *
from . import utils
__version__ = '1.4.0'
# Add Ember's data file directory to Cantera's search path. Because the Python
# module is statically linked to Cantera, this needs to be done separat... | 0 | 0 | 0 |
8caed7bdf72c8d9b1fb3c833bc36f023ba4a193a | 2,728 | py | Python | slider-agent/src/test/python/agent/TestShell.py | pramodthangali/incubator-slider | 8434b8971af93fe316e4b4c9f6d4a2a917caedd0 | [
"Apache-2.0"
] | 1 | 2019-01-18T21:00:19.000Z | 2019-01-18T21:00:19.000Z | slider-agent/src/test/python/agent/TestShell.py | pramodthangali/incubator-slider | 8434b8971af93fe316e4b4c9f6d4a2a917caedd0 | [
"Apache-2.0"
] | null | null | null | slider-agent/src/test/python/agent/TestShell.py | pramodthangali/incubator-slider | 8434b8971af93fe316e4b4c9f6d4a2a917caedd0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Ver... | 35.894737 | 107 | 0.728739 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Ver... | 1,600 | 93 | 23 |
fe878e67227214f872037684567ed0df2357ce71 | 832 | py | Python | setup.py | rec/recs | 24d545cfa12129dc6c413f0defad08bac6f5ff14 | [
"MIT"
] | 2 | 2019-05-26T15:09:37.000Z | 2019-06-15T10:18:45.000Z | setup.py | rec/recs | 24d545cfa12129dc6c413f0defad08bac6f5ff14 | [
"MIT"
] | null | null | null | setup.py | rec/recs | 24d545cfa12129dc6c413f0defad08bac6f5ff14 | [
"MIT"
] | null | null | null | from setuptools import setup
import recs
_classifiers = [
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
... | 29.714286 | 65 | 0.627404 | from setuptools import setup
import recs
_classifiers = [
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
... | 0 | 0 | 0 |
44679082923e024843dab607e9bd1340db00e86a | 1,850 | py | Python | tests/test_phone_numbers.py | robclewley/scrubadub | 465b5d50e6fc6fb3b3dde49dac5c7d95305a3f0c | [
"MIT"
] | 190 | 2015-12-03T01:31:36.000Z | 2020-09-02T23:46:38.000Z | tests/test_phone_numbers.py | robclewley/scrubadub | 465b5d50e6fc6fb3b3dde49dac5c7d95305a3f0c | [
"MIT"
] | 54 | 2020-09-10T14:46:14.000Z | 2022-03-10T06:03:00.000Z | tests/test_phone_numbers.py | robclewley/scrubadub | 465b5d50e6fc6fb3b3dde49dac5c7d95305a3f0c | [
"MIT"
] | 57 | 2016-04-04T18:37:38.000Z | 2020-08-18T22:59:03.000Z | import unittest
from base import BaseTestCase
| 30.327869 | 75 | 0.557297 | import unittest
from base import BaseTestCase
class PhoneNumberTestCase(unittest.TestCase, BaseTestCase):
def create_docstring(self, phone_number):
return """
BEFORE: My phone number is %s
AFTER: My phone number is {{PHONE}}
""" % phone_number
def check_phone_numbers(self, ... | 779 | 1,000 | 23 |
681206aed8dc1aa26d1177a01471710980f614c7 | 414 | py | Python | website/products/sitemaps.py | zckoh/ecommerce-fullstack | c4cecea3ebaec900da484954d01dcbc2cba325c9 | [
"Apache-2.0"
] | 1 | 2021-12-14T22:24:20.000Z | 2021-12-14T22:24:20.000Z | website/products/sitemaps.py | zckoh/ecommerce-fullstack | c4cecea3ebaec900da484954d01dcbc2cba325c9 | [
"Apache-2.0"
] | 11 | 2021-03-30T13:59:29.000Z | 2022-03-12T00:48:40.000Z | website/products/sitemaps.py | zckoh/ecommerce-fullstack | c4cecea3ebaec900da484954d01dcbc2cba325c9 | [
"Apache-2.0"
] | null | null | null | from django.contrib.sitemaps import Sitemap
from django.shortcuts import reverse
from .models import Product
| 21.789474 | 44 | 0.657005 | from django.contrib.sitemaps import Sitemap
from django.shortcuts import reverse
from .models import Product
class ProductSitemap(Sitemap):
protocol = 'https'
def items(self):
return ['products']
def location(self, item):
return reverse(item)
class AllProductsSitemap(Sitemap... | 91 | 159 | 48 |
f34a5b2defe52a683dcc06d84294c96ea1da392b | 481 | py | Python | AuthTest/CustomMiddleModule.py | zhangjiang1203/AuthModuleModel | 04a8ebcba131643595127c254098bc4cfd14dea8 | [
"MIT"
] | null | null | null | AuthTest/CustomMiddleModule.py | zhangjiang1203/AuthModuleModel | 04a8ebcba131643595127c254098bc4cfd14dea8 | [
"MIT"
] | null | null | null | AuthTest/CustomMiddleModule.py | zhangjiang1203/AuthModuleModel | 04a8ebcba131643595127c254098bc4cfd14dea8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-06-18 14:00
# @Author : 张江
# @Site :
# @File : CustomMiddleModule.py
# @Software: PyCharm
#添加自己的中间件
from django.utils.deprecation import MiddlewareMixin
# 可以在中间件中添加用户认证和登录设置等信息 | 24.05 | 52 | 0.683992 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-06-18 14:00
# @Author : 张江
# @Site :
# @File : CustomMiddleModule.py
# @Software: PyCharm
#添加自己的中间件
from django.utils.deprecation import MiddlewareMixin
# 可以在中间件中添加用户认证和登录设置等信息
class CustomMiddle(MiddlewareMixin):
def process_request(self, r... | 172 | 15 | 75 |
653fa0e48b9de8ab2cb7131c8a04c498d0598f8f | 5,506 | py | Python | anvilfs/workspacebucket.py | anvilproject/fs.anvilfs | 781b11c0665bf056f90beef5412b79e7c3cb6bd1 | [
"Apache-2.0"
] | 3 | 2021-02-26T06:47:22.000Z | 2022-01-20T19:26:33.000Z | anvilfs/workspacebucket.py | anvilproject/fs.anvilfs | 781b11c0665bf056f90beef5412b79e7c3cb6bd1 | [
"Apache-2.0"
] | 10 | 2020-10-08T22:33:15.000Z | 2021-11-15T18:59:31.000Z | anvilfs/workspacebucket.py | anvilproject/fs.anvilfs | 781b11c0665bf056f90beef5412b79e7c3cb6bd1 | [
"Apache-2.0"
] | null | null | null | from io import BytesIO
from os import SEEK_END, SEEK_SET
import re
import gs_chunked_io as gscio
from .basefile import BaseAnVILFile
from .basefolder import BaseAnVILFolder
| 32.579882 | 96 | 0.592081 | from io import BytesIO
from os import SEEK_END, SEEK_SET
import re
import gs_chunked_io as gscio
from .basefile import BaseAnVILFile
from .basefolder import BaseAnVILFolder
class OtherDataFolder(BaseAnVILFolder):
def __init__(self, attributes, bucket_name):
super().__init__("Other Data")
self.b... | 4,641 | 119 | 564 |
719a7ec92140a49dcb3ff7ab37cd2451db2334c9 | 439 | py | Python | scripts/getLabelsForConceptUris.py | TobiasNx/fix-FunctionalReview-Testing | 6169332db22224ec64b6c3fe4ea4b31fa6a4c5c8 | [
"MIT"
] | null | null | null | scripts/getLabelsForConceptUris.py | TobiasNx/fix-FunctionalReview-Testing | 6169332db22224ec64b6c3fe4ea4b31fa6a4c5c8 | [
"MIT"
] | null | null | null | scripts/getLabelsForConceptUris.py | TobiasNx/fix-FunctionalReview-Testing | 6169332db22224ec64b6c3fe4ea4b31fa6a4c5c8 | [
"MIT"
] | null | null | null | import requests
import json
filepath = '../data/maps/edusharing-subject-mapping.tsv'
input = open(filepath).readlines()
for row in input:
if "https" in row:
uri = row.split('\t')[1].rstrip()
label = requests.get(uri, headers={"accept":"application/json"}).json()['prefLabel']['de'].encode('utf-8')... | 33.769231 | 122 | 0.605923 | import requests
import json
filepath = '../data/maps/edusharing-subject-mapping.tsv'
input = open(filepath).readlines()
for row in input:
if "https" in row:
uri = row.split('\t')[1].rstrip()
label = requests.get(uri, headers={"accept":"application/json"}).json()['prefLabel']['de'].encode('utf-8')... | 0 | 0 | 0 |
136545fce3e8cecf2001e7bdbd83ade947e69365 | 245 | py | Python | 7kyu/check_for_prime_numbers.py | nhsz/codewars | 82703959e910254d6feff4162f78c6dbd7a1c3ed | [
"MIT"
] | 1 | 2018-12-02T23:04:38.000Z | 2018-12-02T23:04:38.000Z | 7kyu/check_for_prime_numbers.py | nhsz/codewars | 82703959e910254d6feff4162f78c6dbd7a1c3ed | [
"MIT"
] | null | null | null | 7kyu/check_for_prime_numbers.py | nhsz/codewars | 82703959e910254d6feff4162f78c6dbd7a1c3ed | [
"MIT"
] | null | null | null | # http://www.codewars.com/kata/53daa9e5af55c184db00025f/
| 22.272727 | 56 | 0.522449 | # http://www.codewars.com/kata/53daa9e5af55c184db00025f/
def is_prime(n):
if n <= 1:
return False
else:
for div in xrange(2, n):
if n % div == 0 and n != div:
return False
return True
| 165 | 0 | 23 |
a486d371c1af152079a6a939561c7002483891ad | 149 | py | Python | demo/test.py | aravindhk/Vides | 65d9ea9764ddf5f6ef40e869bd31387d0e3e378f | [
"BSD-4-Clause"
] | 2 | 2021-11-03T17:24:24.000Z | 2021-12-02T06:06:50.000Z | demo/test.py | aravindhk/Vides | 65d9ea9764ddf5f6ef40e869bd31387d0e3e378f | [
"BSD-4-Clause"
] | null | null | null | demo/test.py | aravindhk/Vides | 65d9ea9764ddf5f6ef40e869bd31387d0e3e378f | [
"BSD-4-Clause"
] | null | null | null | from NanoTCAD_ViDES import *
from numpy import genfromtxt
fi = genfromtxt("./datiout_idvds/idvds.out", delimiter = ' ')
plot(fi[:,0],fi[:,1])
show() | 24.833333 | 61 | 0.704698 | from NanoTCAD_ViDES import *
from numpy import genfromtxt
fi = genfromtxt("./datiout_idvds/idvds.out", delimiter = ' ')
plot(fi[:,0],fi[:,1])
show() | 0 | 0 | 0 |
e765fb3f3635f387b5b8188b7acfcdc41c6bffec | 894 | py | Python | test/test_substitution.py | corneliusroemer/pyro-cov | 54e89d128293f9ff9e995c442f72fa73f5f99b76 | [
"Apache-2.0"
] | 22 | 2021-09-14T04:33:11.000Z | 2022-02-01T21:33:05.000Z | test/test_substitution.py | corneliusroemer/pyro-cov | 54e89d128293f9ff9e995c442f72fa73f5f99b76 | [
"Apache-2.0"
] | 7 | 2021-11-02T13:48:35.000Z | 2022-03-23T18:08:35.000Z | test/test_substitution.py | corneliusroemer/pyro-cov | 54e89d128293f9ff9e995c442f72fa73f5f99b76 | [
"Apache-2.0"
] | 6 | 2021-09-18T01:06:51.000Z | 2022-01-10T02:22:06.000Z | # Copyright Contributors to the Pyro-Cov project.
# SPDX-License-Identifier: Apache-2.0
import pyro.poutine as poutine
import pytest
import torch
from pyro.infer.autoguide import AutoDelta
from pyrocov.substitution import GeneralizedTimeReversible, JukesCantor69
@pytest.mark.parametrize("Model", [JukesCantor69, Gen... | 29.8 | 77 | 0.694631 | # Copyright Contributors to the Pyro-Cov project.
# SPDX-License-Identifier: Apache-2.0
import pyro.poutine as poutine
import pytest
import torch
from pyro.infer.autoguide import AutoDelta
from pyrocov.substitution import GeneralizedTimeReversible, JukesCantor69
@pytest.mark.parametrize("Model", [JukesCantor69, Gen... | 527 | 0 | 22 |
4542387fbb3b4014a1c19c862b65107f76ff164c | 6,667 | py | Python | range_repair.py | hancockks/cassandra_range_repair | 14e21826cd43e0df15e8f7f9d3e8842f5339bda8 | [
"MIT"
] | null | null | null | range_repair.py | hancockks/cassandra_range_repair | 14e21826cd43e0df15e8f7f9d3e8842f5339bda8 | [
"MIT"
] | null | null | null | range_repair.py | hancockks/cassandra_range_repair | 14e21826cd43e0df15e8f7f9d3e8842f5339bda8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import operator
import optparse
import os
import re
import subprocess
import sys
import datetime
#def lrange(num1, num2 = None, step = 1, format = format_murmur):
# offset = 0 if format == format_md5 else 2**63
# max = 2**127-1 if format == format_md5 else 2**63-1
# wrap = 2**128 if form... | 29.763393 | 161 | 0.612719 | #!/usr/bin/env python
import operator
import optparse
import os
import re
import subprocess
import sys
import datetime
def format_murmur(i):
return "%020d" % i
def format_md5(i):
return "%039d" % i
#def lrange(num1, num2 = None, step = 1, format = format_murmur):
# offset = 0 if format == format_md5 else ... | 4,962 | 0 | 384 |
d1e472cf17de0fbe8a6a5b4389fb7607c0ac78a1 | 225 | py | Python | room/admin.py | iver56/useat-api | f0f241c584cbb05990ee4afb5bb1b2fd6d5fdb44 | [
"MIT"
] | null | null | null | room/admin.py | iver56/useat-api | f0f241c584cbb05990ee4afb5bb1b2fd6d5fdb44 | [
"MIT"
] | null | null | null | room/admin.py | iver56/useat-api | f0f241c584cbb05990ee4afb5bb1b2fd6d5fdb44 | [
"MIT"
] | null | null | null | from django.contrib.gis import admin
from .models import Room
admin.site.register(Room, RoomAdmin)
| 18.75 | 36 | 0.76 | from django.contrib.gis import admin
from .models import Room
class RoomAdmin(admin.OSMGeoAdmin):
default_lon = 1157108.48900
default_lat = 9205549.12020
default_zoom = 12
admin.site.register(Room, RoomAdmin)
| 0 | 100 | 23 |
afb6d94d3d73198348ac427a1fcadd42592842ca | 1,843 | py | Python | src/surface.py | BozeBro/Snake-Game-and-two-player | 13989418ff92d9e5cc0e218b75cd8bd1ed1ca591 | [
"MIT"
] | null | null | null | src/surface.py | BozeBro/Snake-Game-and-two-player | 13989418ff92d9e5cc0e218b75cd8bd1ed1ca591 | [
"MIT"
] | null | null | null | src/surface.py | BozeBro/Snake-Game-and-two-player | 13989418ff92d9e5cc0e218b75cd8bd1ed1ca591 | [
"MIT"
] | null | null | null | import pygame
from colors import *
class Surface:
"""
Handles functions that interact with the screen including:
drawing to the screen
creating the screen
"""
def __init__(
self, rows=17, columns=17, blocksize=20, caption="Snake Game", color=WHITE
):
"""
:param:
... | 29.725806 | 82 | 0.600651 | import pygame
from colors import *
class Surface:
"""
Handles functions that interact with the screen including:
drawing to the screen
creating the screen
"""
def __init__(
self, rows=17, columns=17, blocksize=20, caption="Snake Game", color=WHITE
):
"""
:param:
... | 0 | 0 | 0 |
a20e5233d64cfa59b698bedc530b40a510125ce8 | 3,311 | py | Python | Course 2: Python Data Structures/Week 1 (Strings)/String-Comparisons.py | kunal5042/Python-for-Everybody | ed702f92c963a467ffb682f171ba0bbb1b571726 | [
"MIT"
] | null | null | null | Course 2: Python Data Structures/Week 1 (Strings)/String-Comparisons.py | kunal5042/Python-for-Everybody | ed702f92c963a467ffb682f171ba0bbb1b571726 | [
"MIT"
] | null | null | null | Course 2: Python Data Structures/Week 1 (Strings)/String-Comparisons.py | kunal5042/Python-for-Everybody | ed702f92c963a467ffb682f171ba0bbb1b571726 | [
"MIT"
] | null | null | null | stringVar1 = "190905042"
stringVar2 = "5042"
stringVar3 = "Kunal"
stringVar4 = "Wadhwa"
stringVar5 = "abc"
stringVar = ["Kunal", "Tanya", "Olivia", "5042", "123"]
WeightOfArrayOfStrings(stringVar)
MaximumAndMinimum_Value_Of_Strings(stringVar)
stringVar = ["AAA", "BBB", "CCC", "DDD"]
WeightOfArrayOfStrings(stringVa... | 30.657407 | 133 | 0.652371 | stringVar1 = "190905042"
stringVar2 = "5042"
stringVar3 = "Kunal"
stringVar4 = "Wadhwa"
stringVar5 = "abc"
def WeightOfString(stringVar):
total = 0
for character in stringVar:
total += int(ord(character))
return total
def WeightOfArrayOfStrings(stringArrayVar):
count = -1
for string in str... | 1,127 | 0 | 69 |
1980deaa8c57e0c5df32e9054d7ffab90bfae55b | 83,912 | py | Python | privex/helpers/net/socket.py | Privex/python-helpers | 1c976ce5b0e2c5241ea0bdf330bd6701b5e31153 | [
"X11"
] | 12 | 2019-06-18T11:17:41.000Z | 2021-09-13T23:00:21.000Z | privex/helpers/net/socket.py | Privex/python-helpers | 1c976ce5b0e2c5241ea0bdf330bd6701b5e31153 | [
"X11"
] | 1 | 2019-10-13T07:34:44.000Z | 2019-10-13T07:34:44.000Z | privex/helpers/net/socket.py | Privex/python-helpers | 1c976ce5b0e2c5241ea0bdf330bd6701b5e31153 | [
"X11"
] | 4 | 2019-10-10T10:15:09.000Z | 2021-05-16T01:55:48.000Z | """
Various wrapper functions/classes which use :mod:`socket` or are strongly tied to functions in this file
which use :mod:`socket`. Part of :mod:`privex.helpers.net` - network related helper code.
**Copyright**::
+===================================================+
| © 2019 Privex I... | 46.695604 | 140 | 0.603859 | """
Various wrapper functions/classes which use :mod:`socket` or are strongly tied to functions in this file
which use :mod:`socket`. Part of :mod:`privex.helpers.net` - network related helper code.
**Copyright**::
+===================================================+
| © 2019 Privex I... | 54,535 | 246 | 3,335 |
f0a3f804aa451fdb3b34d8b44bce2b427e244b53 | 324 | py | Python | ch5/fibonacci.first.py | ldmcdaniel/learning_python | 63717c397cd75e45a8aef909d4b601466cd6036a | [
"MIT"
] | 30 | 2016-10-28T18:14:15.000Z | 2021-08-29T15:20:56.000Z | ch5/fibonacci.first.py | ldmcdaniel/learning_python | 63717c397cd75e45a8aef909d4b601466cd6036a | [
"MIT"
] | null | null | null | ch5/fibonacci.first.py | ldmcdaniel/learning_python | 63717c397cd75e45a8aef909d4b601466cd6036a | [
"MIT"
] | 31 | 2016-09-10T22:47:12.000Z | 2022-03-13T04:50:35.000Z | def fibonacci(N):
"""Return all fibonacci numbers up to N. """
result = [0]
next_n = 1
while next_n <= N:
result.append(next_n)
next_n = sum(result[-2:])
return result
print(fibonacci(0)) # [0]
print(fibonacci(1)) # [0, 1, 1]
print(fibonacci(50)) # [0, 1, 1, 2, 3, 5, 8, 13, 21, ... | 23.142857 | 57 | 0.549383 | def fibonacci(N):
"""Return all fibonacci numbers up to N. """
result = [0]
next_n = 1
while next_n <= N:
result.append(next_n)
next_n = sum(result[-2:])
return result
print(fibonacci(0)) # [0]
print(fibonacci(1)) # [0, 1, 1]
print(fibonacci(50)) # [0, 1, 1, 2, 3, 5, 8, 13, 21, ... | 0 | 0 | 0 |
09743b8d5ae4a032a89d80ec7947cf104ae4dd31 | 5,751 | py | Python | robot_ws/src/cloudwatch_robot/launch/monitoring.launch.py | husarion/aws-robomaker-sample-application-cloudwatch | 9a381009aca558e65c03077965a349fb93c59d99 | [
"MIT-0"
] | null | null | null | robot_ws/src/cloudwatch_robot/launch/monitoring.launch.py | husarion/aws-robomaker-sample-application-cloudwatch | 9a381009aca558e65c03077965a349fb93c59d99 | [
"MIT-0"
] | null | null | null | robot_ws/src/cloudwatch_robot/launch/monitoring.launch.py | husarion/aws-robomaker-sample-application-cloudwatch | 9a381009aca558e65c03077965a349fb93c59d99 | [
"MIT-0"
] | 1 | 2022-03-04T10:36:17.000Z | 2022-03-04T10:36:17.000Z | import os
import sys
import yaml
import launch
import launch_ros.actions
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration
from launch.substitutions import PythonExpression
from ament_index_python.packages import get_package_share_directory
if __name__ == '__main__':
... | 47.139344 | 141 | 0.677621 | import os
import sys
import yaml
import launch
import launch_ros.actions
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration
from launch.substitutions import PythonExpression
from ament_index_python.packages import get_package_share_directory
def generate_launch_description... | 5,377 | 0 | 23 |
67e5af01030aade7fd237d0de541c611aee0fcd3 | 1,165 | py | Python | lambdata_jpalex/__init__.py | extrajp2014/lambdata | bbe126516533ebe334c2b9f3bdc8dfa0bd1755be | [
"MIT"
] | null | null | null | lambdata_jpalex/__init__.py | extrajp2014/lambdata | bbe126516533ebe334c2b9f3bdc8dfa0bd1755be | [
"MIT"
] | null | null | null | lambdata_jpalex/__init__.py | extrajp2014/lambdata | bbe126516533ebe334c2b9f3bdc8dfa0bd1755be | [
"MIT"
] | null | null | null | import numpy as np
class Statistic:
"""
Contains statistic functions helper
"""
def __init__(self, numbers = [1,2], confidence=0.95):
"""
numbers = array of numbers
confidence = confidence interval, default is 95%
"""
self.numbers = numbers
self.confidenc... | 26.477273 | 66 | 0.571674 | import numpy as np
class Statistic:
"""
Contains statistic functions helper
"""
def __init__(self, numbers = [1,2], confidence=0.95):
"""
numbers = array of numbers
confidence = confidence interval, default is 95%
"""
self.numbers = numbers
self.confidenc... | 0 | 0 | 0 |
4fd062e0af2520762bf197fa4024a682543bf356 | 9,754 | py | Python | backend/celery/api.py | OriHoch/wikimedia-crosswatch | 05b009cfd9e17eb0e252d37c8a22a93cade5c6a4 | [
"ISC"
] | null | null | null | backend/celery/api.py | OriHoch/wikimedia-crosswatch | 05b009cfd9e17eb0e252d37c8a22a93cade5c6a4 | [
"ISC"
] | null | null | null | backend/celery/api.py | OriHoch/wikimedia-crosswatch | 05b009cfd9e17eb0e252d37c8a22a93cade5c6a4 | [
"ISC"
] | null | null | null | # -*- coding: utf-8 -*-
# ISC License
# Copyright (C) 2015 Jan Lebert
from __future__ import absolute_import
from __future__ import unicode_literals
from collections import namedtuple
import requests
from requests_oauthlib import OAuth1
from redis import StrictRedis
import json
from datetime import datetime, timedelta... | 34.224561 | 78 | 0.554849 | # -*- coding: utf-8 -*-
# ISC License
# Copyright (C) 2015 Jan Lebert
from __future__ import absolute_import
from __future__ import unicode_literals
from collections import namedtuple
import requests
from requests_oauthlib import OAuth1
from redis import StrictRedis
import json
from datetime import datetime, timedelta... | 6,260 | 3,027 | 23 |