hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
932d27331129f1f8d9928f6acd8a6b5f4e0e7518 | 363 | py | Python | validation_api/blueprints.py | LandRegistry/validation-api | f24930236622de7b481bbd378138ab1d6b5345b4 | [
"MIT"
] | null | null | null | validation_api/blueprints.py | LandRegistry/validation-api | f24930236622de7b481bbd378138ab1d6b5345b4 | [
"MIT"
] | null | null | null | validation_api/blueprints.py | LandRegistry/validation-api | f24930236622de7b481bbd378138ab1d6b5345b4 | [
"MIT"
] | 1 | 2021-04-11T05:24:47.000Z | 2021-04-11T05:24:47.000Z | # Import every blueprint file
from validation_api.views import general
from validation_api.views import validate
def register_blueprints(app):
"""Adds all blueprint objects into the app."""
app.register_blueprint(general.general)
app.register_blueprint(validate.validate, url_prefix='')
# All done!
... | 27.923077 | 60 | 0.763085 |
932d2baa50ad1cb8d89b14b12e0de09a7b7ba663 | 330 | py | Python | (3)Algorithms/itertools_combinations_with_replacement.py | mass9/Python | 66499164e36a4fe9630029d34b292ab06f849b2f | [
"MIT"
] | null | null | null | (3)Algorithms/itertools_combinations_with_replacement.py | mass9/Python | 66499164e36a4fe9630029d34b292ab06f849b2f | [
"MIT"
] | null | null | null | (3)Algorithms/itertools_combinations_with_replacement.py | mass9/Python | 66499164e36a4fe9630029d34b292ab06f849b2f | [
"MIT"
] | null | null | null | from itertools import*
def show(iterable):
first = None
for i,item in enumerate(iterable,1):
if first!=item[0]:
if first is not None:
print()
first = item[0]
print(''.join(item),end= ' ')
print()
print('Pairs')
show(combinations_with_replacement('ab... | 20.625 | 47 | 0.557576 |
932d405a178459e058f894df32b45a53c617d456 | 7,209 | py | Python | jsonty/models.py | AlbertFX91/jsonty | 592ef168419be51de4f690a5a33a55c9838683d1 | [
"BSD-2-Clause"
] | null | null | null | jsonty/models.py | AlbertFX91/jsonty | 592ef168419be51de4f690a5a33a55c9838683d1 | [
"BSD-2-Clause"
] | 4 | 2019-11-11T19:25:57.000Z | 2019-12-09T19:39:14.000Z | jsonty/models.py | AlbertFX91/jsonty | 592ef168419be51de4f690a5a33a55c9838683d1 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Python modules
import json
import sys
from collections.abc import Iterable
# Python typing
from typing import List, Dict, Type, _GenericAlias, TypeVar
# Jsonty models
from .exceptions import TypeNotReconized
from .exceptions import IterableNotAllSameType
# Standard data types
_STANDARD_DAT... | 35.688119 | 98 | 0.624775 |
932d409827d82870e4c68fcb5695ce187698be97 | 40,846 | py | Python | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/utils.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/utils.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/utils.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010-2011 OpenStack Foundation.
# Copyright 2012 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | 35.861282 | 79 | 0.632498 |
932d7971ad119b2ae3362c3ca531d291948740b9 | 8,443 | py | Python | Biocrutch/Statistics/coverage_statistics/GenomecovCoverageStatistics.py | tomarovsky/Biocrutch | 40000f3dcd7ca9095e611aca6d658781867233b8 | [
"MIT"
] | 2 | 2020-10-12T11:05:42.000Z | 2020-11-21T13:44:16.000Z | Biocrutch/Statistics/coverage_statistics/GenomecovCoverageStatistics.py | tomarovsky/Biocrutch | 40000f3dcd7ca9095e611aca6d658781867233b8 | [
"MIT"
] | null | null | null | Biocrutch/Statistics/coverage_statistics/GenomecovCoverageStatistics.py | tomarovsky/Biocrutch | 40000f3dcd7ca9095e611aca6d658781867233b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
__author__ = 'tomarovsky'
from Biocrutch.Statistics.coverage_statistics.CoverageMetrics import CoveragesMetrics
from collections import Counter
import pandas as pd
class GenomecovCoverageStatistics:
def __init__(self, data, output, tool_name):
self.data = data
self.output = ... | 52.440994 | 139 | 0.517589 |
932d9122d6d2f08d260566ca76b22bd9c30f1f57 | 3,023 | py | Python | pytorch/utils.py | espectre/kaggle_Human-Protein-Atlas-Image-Classification | 4bc3f2496e2956444649a3a9902de434902a92f2 | [
"MIT"
] | null | null | null | pytorch/utils.py | espectre/kaggle_Human-Protein-Atlas-Image-Classification | 4bc3f2496e2956444649a3a9902de434902a92f2 | [
"MIT"
] | null | null | null | pytorch/utils.py | espectre/kaggle_Human-Protein-Atlas-Image-Classification | 4bc3f2496e2956444649a3a9902de434902a92f2 | [
"MIT"
] | null | null | null | import torch
from collections import OrderedDict
import numpy as np
import sys
import os
sys.path.append("../")
sys.path.append("./")
import settings
from Data import DataLoad_protein
from torch.utils.data import DataLoader
from model import DenseNet121
from torch.nn import BCEWithLogitsLoss,BCELoss
con... | 28.252336 | 109 | 0.625207 |
932ddbd3baedca003f61d9133ab7ecf1e82aa0b4 | 9,016 | py | Python | src/jdk.py | ericCHxia/jdkmgr | e1caad42637bbe80a2bd1828e636d6615ba16e8a | [
"Apache-2.0"
] | null | null | null | src/jdk.py | ericCHxia/jdkmgr | e1caad42637bbe80a2bd1828e636d6615ba16e8a | [
"Apache-2.0"
] | null | null | null | src/jdk.py | ericCHxia/jdkmgr | e1caad42637bbe80a2bd1828e636d6615ba16e8a | [
"Apache-2.0"
] | null | null | null | import os
import platform
import json
import argparse
from utils import download, extract_zip, create_link, get_avaliable_arches
class JDKManager:
"""JDK Manager
JDK Manager class for managing JDKs and JDK links in the system.
It can install JDKs from the internet and use them.
It can also list all i... | 36.502024 | 209 | 0.558673 |
932de166b456c42de214ca422ea604290a497474 | 25,595 | py | Python | ethereum/fastvm.py | isaiahgenis/Ethereum-Python | 295975d393be3b74f7bd7dc89ce45f9d973e225a | [
"MIT"
] | 5 | 2016-09-12T15:26:11.000Z | 2018-09-17T20:27:15.000Z | ethereum/fastvm.py | isaiahgenis/Ethereum-Python | 295975d393be3b74f7bd7dc89ce45f9d973e225a | [
"MIT"
] | null | null | null | ethereum/fastvm.py | isaiahgenis/Ethereum-Python | 295975d393be3b74f7bd7dc89ce45f9d973e225a | [
"MIT"
] | 2 | 2016-09-12T07:04:30.000Z | 2017-02-24T20:56:59.000Z | import copy
import ethereum.opcodes as opcodes
# ####### dev hack flags ###############
verify_stack_after_op = False
# ######################################
import sys
from ethereum import utils
from ethereum.abi import is_numeric
import copy
from ethereum import opcodes
import time
from ethereum.slogging import... | 41.282258 | 113 | 0.507873 |
932de9f161ff1b54ce07c9a3978132df6d4dd7a5 | 1,925 | py | Python | src/functions/source.py | spasmann/1DQMC | f56483428f03c63d06c16b7fd7f56231296dd940 | [
"MIT"
] | null | null | null | src/functions/source.py | spasmann/1DQMC | f56483428f03c63d06c16b7fd7f56231296dd940 | [
"MIT"
] | null | null | null | src/functions/source.py | spasmann/1DQMC | f56483428f03c63d06c16b7fd7f56231296dd940 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 7 14:22:43 2022
@author: sampasmann
"""
import numpy as np
def GetSource(phi_avg, qmc_data):
"""
Parameters
----------
phi_avg : scalar flux matrix of size (Nx,G)
qmc_data : an object from one of the init_files
Returns
... | 28.731343 | 133 | 0.595844 |
932e3221935d86cb2091ac9586f5b6df4ed2b5db | 408 | py | Python | LP/class_iter_overload.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | 1 | 2015-04-23T11:43:26.000Z | 2015-04-23T11:43:26.000Z | LP/class_iter_overload.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | LP/class_iter_overload.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | class Squares:
def __init__(self, start, stop):
self.value = start - 1
self.stop = stop
def __iter__(self):
return self
def __next__(self):
if self.value == self.stop:
raise StopIteration
else:
self.value += 1
return self.value **... | 19.428571 | 36 | 0.519608 |
932e4afc5ebef30937ff009f52de83a46c2a2265 | 14,508 | py | Python | tests/python/pants_test/backend/python/tasks/test_pytest_run.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/python/tasks/test_pytest_run.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/python/tasks/test_pytest_run.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | 1 | 2019-06-10T17:24:34.000Z | 2019-06-10T17:24:34.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import glob
import o... | 34.959036 | 119 | 0.637786 |
932e51cecc618f09ff4bffad09f1575087b8543b | 1,249 | py | Python | SphinxReport/SQLDatabase.py | Tim-HU/sphinx-report | 3a0dc225e594c4b2083dff7a93b6d77054256416 | [
"BSD-2-Clause"
] | 1 | 2020-04-10T12:48:40.000Z | 2020-04-10T12:48:40.000Z | SphinxReport/SQLDatabase.py | Tim-HU/sphinx-report | 3a0dc225e594c4b2083dff7a93b6d77054256416 | [
"BSD-2-Clause"
] | null | null | null | SphinxReport/SQLDatabase.py | Tim-HU/sphinx-report | 3a0dc225e594c4b2083dff7a93b6d77054256416 | [
"BSD-2-Clause"
] | null | null | null |
import os, sys
from sqlalchemy import *
from sqlalchemy.ext.sqlsoup import SqlSoup
# ignore unknown type BigInt warnings
try:
db = create_engine( sql_backend )
db.echo = False
except NameError:
db = None
if db:
pass
#import warnings
#with warnings.catch_warnings():
# warnings.simple... | 23.566038 | 62 | 0.66293 |
932e7f07bd498b1596b4adeca7168b7dae6e48d1 | 2,071 | py | Python | examples/decorators/plot_calculate_classify_ndvi.py | adamancer/imagery_accessor | 9f527891d63b250c1e49dc87b6ba91e90642545d | [
"MIT"
] | null | null | null | examples/decorators/plot_calculate_classify_ndvi.py | adamancer/imagery_accessor | 9f527891d63b250c1e49dc87b6ba91e90642545d | [
"MIT"
] | null | null | null | examples/decorators/plot_calculate_classify_ndvi.py | adamancer/imagery_accessor | 9f527891d63b250c1e49dc87b6ba91e90642545d | [
"MIT"
] | null | null | null | """Calculate and plot NDVI using the imagery accessor
Adapted from https://github.com/earthlab/earthpy/blob/main/examples/plot_calculate_classify_ndvi.py.
The original file contains more detail about the functions and
calculations shown here.
"""
import os
from glob import glob
import numpy as np
import matplotlib.py... | 26.551282 | 100 | 0.742154 |
932e8f43c2304f5aef70ab83828ab0532038fc2d | 5,161 | py | Python | app/series/tests/test_tags_api.py | Akshay-ch-dj/RESTapi-app-series | 0a7ca3384e3d8d6b2d1c746b23f95426988a9bf9 | [
"MIT"
] | null | null | null | app/series/tests/test_tags_api.py | Akshay-ch-dj/RESTapi-app-series | 0a7ca3384e3d8d6b2d1c746b23f95426988a9bf9 | [
"MIT"
] | null | null | null | app/series/tests/test_tags_api.py | Akshay-ch-dj/RESTapi-app-series | 0a7ca3384e3d8d6b2d1c746b23f95426988a9bf9 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Series
from series.serializers import TagSerializer
TAGS_URL = reverse('series:tag-list')
# Publi... | 33.732026 | 79 | 0.633598 |
932e9a99dc764d26f3c452f36a91d8ed89c5163d | 3,667 | py | Python | src/bloombox/schema/partner/integrations/OnFleetSettings_pb2.py | Bloombox/Python | 1b125fbdf54efb390afe12aaa966f093218c4387 | [
"Apache-2.0"
] | 4 | 2018-01-23T20:13:11.000Z | 2018-07-28T22:36:09.000Z | src/bloombox/schema/partner/integrations/OnFleetSettings_pb2.py | Bloombox/Python | 1b125fbdf54efb390afe12aaa966f093218c4387 | [
"Apache-2.0"
] | 159 | 2018-02-02T09:55:52.000Z | 2021-07-21T23:41:59.000Z | src/bloombox/schema/partner/integrations/OnFleetSettings_pb2.py | Bloombox/Python | 1b125fbdf54efb390afe12aaa966f093218c4387 | [
"Apache-2.0"
] | 3 | 2018-01-23T20:13:15.000Z | 2020-01-17T01:07:53.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: partner/integrations/OnFleetSettings.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobu... | 34.92381 | 393 | 0.796291 |
932ea2c6d58e76978f190be0b9684efc61ade701 | 37,214 | py | Python | tensorflow/python/util/dispatch_test.py | tamizhis5n/tensorflow | 2140625dfe395be6ff4afd381ee1110f9f43ff14 | [
"Apache-2.0"
] | 4 | 2015-11-12T20:37:23.000Z | 2021-05-25T20:06:32.000Z | tensorflow/python/util/dispatch_test.py | donny-stacks/tensorflow | 1fb338b1c42930c0eef4d0b4d8d5fdf24a678654 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/util/dispatch_test.py | donny-stacks/tensorflow | 1fb338b1c42930c0eef4d0b4d8d5fdf24a678654 | [
"Apache-2.0"
] | 1 | 2021-11-30T11:40:16.000Z | 2021-11-30T11:40:16.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.363454 | 85 | 0.674343 |
932ea74823eaadb0d9664a54654ca9d353f74813 | 310 | py | Python | pyvirtualdisplay/examples/screenshot1.py | Mrfranken/PyVirtualDisplay | b3d45024d1d55033af69d1af29f56fc04e4e4209 | [
"BSD-2-Clause"
] | null | null | null | pyvirtualdisplay/examples/screenshot1.py | Mrfranken/PyVirtualDisplay | b3d45024d1d55033af69d1af29f56fc04e4e4209 | [
"BSD-2-Clause"
] | null | null | null | pyvirtualdisplay/examples/screenshot1.py | Mrfranken/PyVirtualDisplay | b3d45024d1d55033af69d1af29f56fc04e4e4209 | [
"BSD-2-Clause"
] | null | null | null | from easyprocess import EasyProcess
from pyvirtualdisplay.smartdisplay import SmartDisplay
if __name__ == "__main__":
disp = SmartDisplay(visible=0, bgcolor="black").start()
xmessage = EasyProcess("xmessage hello").start()
img = disp.waitgrab()
xmessage.stop()
disp.stop()
img.show()
| 25.833333 | 59 | 0.709677 |
932eab9fd311cf567fd0fc79ff1103b523d40002 | 6,151 | py | Python | coffea/lumi_tools/lumi_tools.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 1 | 2020-11-19T21:50:34.000Z | 2020-11-19T21:50:34.000Z | coffea/lumi_tools/lumi_tools.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | null | null | null | coffea/lumi_tools/lumi_tools.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | null | null | null | from ..util import numpy as np
import json
import awkward as ak
from ..util import numba
from numba import types
from numba.typed import Dict
class LumiData(object):
r"""Holds per-lumiSection integrated lumi values
Parameters
----------
lumi_csv : str
The path the the luminosity csv ... | 33.796703 | 125 | 0.584946 |
932eacc43e60a903dc484305e5ff65f66202ce17 | 703 | py | Python | alipay/aop/api/response/AlipayOpenMiniAmpeRecommendDetectResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayOpenMiniAmpeRecommendDetectResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayOpenMiniAmpeRecommendDetectResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenMiniAmpeRecommendDetectResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenMiniAmpeRecommendDetectResponse, self).__init__()
self._valid = None
... | 27.038462 | 114 | 0.709815 |
932eae6555d3e17e7f75f47bc4ff2340dc8aa315 | 4,528 | py | Python | mythril/laser/ethereum/state.py | tintinweb/mythril | 88873206d1311c02ca95c685209060b0584f4d79 | [
"MIT"
] | null | null | null | mythril/laser/ethereum/state.py | tintinweb/mythril | 88873206d1311c02ca95c685209060b0584f4d79 | [
"MIT"
] | null | null | null | mythril/laser/ethereum/state.py | tintinweb/mythril | 88873206d1311c02ca95c685209060b0584f4d79 | [
"MIT"
] | null | null | null | from z3 import BitVec, BitVecVal
from copy import copy, deepcopy
from enum import Enum
class CalldataType(Enum):
CONCRETE = 1
SYMBOLIC = 2
class Account:
"""
Account class representing ethereum accounts
"""
def __init__(self, address, code=None, contract_name="unknown", balance=None):
... | 29.789474 | 109 | 0.61992 |
932ec5c2ec4231e3ef1cda7af8034fd57ae7ea31 | 150 | py | Python | setup/blender/startup/avalon_setup.py | simonebarbieri/avalon-core | cfd4191e364b47de7364096f45d9d9d9a901692a | [
"MIT"
] | 5 | 2019-01-09T09:05:16.000Z | 2021-12-11T19:36:22.000Z | setup/blender/startup/avalon_setup.py | jrsndl/avalon-core | 82d5b8137eea3b49d4781a4af51d7f375bb9f628 | [
"MIT"
] | 106 | 2018-11-11T23:48:18.000Z | 2022-03-23T16:21:18.000Z | setup/blender/startup/avalon_setup.py | jrsndl/avalon-core | 82d5b8137eea3b49d4781a4af51d7f375bb9f628 | [
"MIT"
] | 6 | 2020-06-11T10:52:27.000Z | 2021-11-22T12:08:55.000Z | from avalon import api, blender
def register():
"""Register Avalon with Blender."""
print("Registering Avalon...")
api.install(blender)
| 18.75 | 39 | 0.673333 |
932ed45ded31fc2f949ca8afeb07c9d3c1edb674 | 1,521 | py | Python | vzinp/utills/get_image_volume_pyramid.py | zhukevgeniy/video-inpainting | 0f650df61a802c17b2efdfa132211026a7e42eba | [
"MIT"
] | null | null | null | vzinp/utills/get_image_volume_pyramid.py | zhukevgeniy/video-inpainting | 0f650df61a802c17b2efdfa132211026a7e42eba | [
"MIT"
] | null | null | null | vzinp/utills/get_image_volume_pyramid.py | zhukevgeniy/video-inpainting | 0f650df61a802c17b2efdfa132211026a7e42eba | [
"MIT"
] | null | null | null | import numpy as np
import cv2
def matlab_style_gauss2D(shape=(5, 5), sigma=0.5):
"""
2D gaussian mask - should give the same result as MATLAB's
fspecial('gaussian',[shape],[sigma])
"""
m, n = [(ss - 1.) / 2. for ss in shape]
y, x = np.ogrid[-m:m + 1, -n:n + 1]
h = np.exp(-(x * x + y * y) /... | 29.823529 | 110 | 0.66075 |
932f0fe8b55d0030488ca0ca19eb6f8f29c77192 | 24,384 | py | Python | required_scripts/mm_igtx_pairoscope_calling_b38_356362b.py | bryce-turner/phoenix | 11e08bdadc6e93ee0b862234a75026e859b9582a | [
"MIT"
] | 9 | 2020-03-11T20:24:25.000Z | 2021-08-17T21:36:12.000Z | required_scripts/mm_igtx_pairoscope_calling_b38_356362b.py | bryce-turner/phoenix | 11e08bdadc6e93ee0b862234a75026e859b9582a | [
"MIT"
] | 113 | 2020-03-19T00:58:30.000Z | 2022-02-21T20:26:44.000Z | required_scripts/mm_igtx_pairoscope_calling_b38_356362b.py | bryce-turner/phoenix | 11e08bdadc6e93ee0b862234a75026e859b9582a | [
"MIT"
] | 9 | 2020-05-03T06:47:19.000Z | 2021-09-13T19:38:57.000Z | #!/usr/bin/env python3
# MYC blacklist region chr8:129571461-129571635 (b37)
# MYC blacklist region chr8:128559215-128559389 (b38)
#################################################################
# Configure the enviroment
import pandas as pd
import argparse
from multiprocessing import Pool
########################... | 52.214133 | 176 | 0.591412 |
932f1583b492c492c49b4a168f77820fe3d41f0f | 702 | py | Python | goods2/migrations/0021_auto_20180625_1122.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | 3 | 2018-10-16T09:36:12.000Z | 2019-04-15T03:12:49.000Z | goods2/migrations/0021_auto_20180625_1122.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | goods2/migrations/0021_auto_20180625_1122.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-06-25 11:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('goods2', '0020_deviceid'),
]
operations = [
migrations.AlterField(
... | 27 | 94 | 0.626781 |
932f36c95af1a72ec1a3c112c6f3bf5af89b13c9 | 801 | py | Python | Chapter05/smtp/send_attachment_mail_from_gmail.py | yangwawa0323/Learning-Python-Networking-Second-Edition | 5460fe4fb6acc5d0df19bf36e52ac09e9a11eb8b | [
"MIT"
] | 52 | 2018-12-17T19:33:06.000Z | 2022-03-25T18:14:02.000Z | Chapter05/smtp/send_attachment_mail_from_gmail.py | barretthugh/Learning-Python-Networking-Second-Edition | 0f00b8b20c1c85e76754e47113dff8ca9e99d5ca | [
"MIT"
] | null | null | null | Chapter05/smtp/send_attachment_mail_from_gmail.py | barretthugh/Learning-Python-Networking-Second-Edition | 0f00b8b20c1c85e76754e47113dff8ca9e99d5ca | [
"MIT"
] | 38 | 2018-12-18T09:08:43.000Z | 2022-02-06T02:53:05.000Z | #!/usr/bin/env python3
from email.mime.multipart import MIMEMultipart
from email.MIMEImage import MIMEImage
from email.mime.text import MIMEText
import smtplib
# create message object instance
message = MIMEMultipart()
# setup the parameters of the message
message['From'] = "user@domain"
message['To'] = "user@dom... | 26.7 | 68 | 0.745318 |
932f5992f1244ced6eddf67f6eb772a17732958a | 822 | py | Python | rest_framework_jwt/runtests/runtests.py | ardydedase/django-rest-framework-jwt | e730900ef21f26436f87c8fb865cf555d7af1647 | [
"MIT"
] | 1 | 2019-08-29T19:49:29.000Z | 2019-08-29T19:49:29.000Z | rest_framework_jwt/runtests/runtests.py | ardydedase/django-rest-framework-jwt | e730900ef21f26436f87c8fb865cf555d7af1647 | [
"MIT"
] | null | null | null | rest_framework_jwt/runtests/runtests.py | ardydedase/django-rest-framework-jwt | e730900ef21f26436f87c8fb865cf555d7af1647 | [
"MIT"
] | 1 | 2019-06-16T21:51:31.000Z | 2019-06-16T21:51:31.000Z | #!/usr/bin/env python
# https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/runtests/runtests.py
import os
import sys
# fix sys path so we don't need to setup PYTHONPATH
sys.path.append(os.path.join(os.path.dirname(__file__), "../.."))
os.environ['DJANGO_SETTINGS_MODULE'] = 'rest_framework... | 24.909091 | 102 | 0.727494 |
932f6bbd8e2d74c82e0bb7e9441205bac53f3778 | 14,815 | py | Python | tests/test_gemmbatchedex.py | hongyx11/scikit-cuda | 73928d0ebdc3b216338d1c9e8ca42e68f4403001 | [
"BSD-3-Clause"
] | null | null | null | tests/test_gemmbatchedex.py | hongyx11/scikit-cuda | 73928d0ebdc3b216338d1c9e8ca42e68f4403001 | [
"BSD-3-Clause"
] | null | null | null | tests/test_gemmbatchedex.py | hongyx11/scikit-cuda | 73928d0ebdc3b216338d1c9e8ca42e68f4403001 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Unit tests for skcuda.cublas
"""
from ctypes import create_string_buffer
from unittest import main, makeSuite, TestCase, TestSuite
import pycuda.driver as drv
import pycuda.gpuarray as gpuarray
from pycuda.tools import clear_context_caches, make_default_context
import numpy as np
import tim... | 34.858824 | 94 | 0.629497 |
932f7b118baf33a4d37ae42fd12eba55787a480c | 3,116 | py | Python | analysis/plot_ale_1d.py | akuhnregnier/empirical-fire-modelling | 4187f5bfce0595d98361a9264793c25607043047 | [
"MIT"
] | null | null | null | analysis/plot_ale_1d.py | akuhnregnier/empirical-fire-modelling | 4187f5bfce0595d98361a9264793c25607043047 | [
"MIT"
] | null | null | null | analysis/plot_ale_1d.py | akuhnregnier/empirical-fire-modelling | 4187f5bfce0595d98361a9264793c25607043047 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""1D ALE plotting."""
import logging
import sys
import warnings
from pathlib import Path
import matplotlib as mpl
from loguru import logger as loguru_logger
from empirical_fire_modelling.analysis.ale import save_ale_1d
from empirical_fire_modelling.configuration import Experiment
from empiric... | 31.795918 | 80 | 0.727214 |
932f885ef5e27a4a53568bd0ece30539d538e69b | 186 | py | Python | examples/software_defined_assets/software_defined_assets_tests/test_weather_assets_group.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/software_defined_assets/software_defined_assets_tests/test_weather_assets_group.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/software_defined_assets/software_defined_assets_tests/test_weather_assets_group.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from software_defined_assets.weather_assets_group import weather_assets
def test_airport_weather_assets():
assert weather_assets.build_job(name="job").execute_in_process().success
| 31 | 76 | 0.849462 |
932fc299e95ec83702654a2f5961e7d02447e907 | 449 | py | Python | alipay/aop/api/response/AlipayCommerceReceiptInvalidResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayCommerceReceiptInvalidResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayCommerceReceiptInvalidResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayCommerceReceiptInvalidResponse(AlipayResponse):
def __init__(self):
super(AlipayCommerceReceiptInvalidResponse, self).__init__()
def parse_response_content(self, ... | 28.0625 | 109 | 0.783964 |
932fca0ba7e913c0f3cf4be096f881f9135b2cd7 | 379 | py | Python | cryptoxlib/clients/hitbtc/exceptions.py | PetrZufan/cryptoxlib-aio | 8fbb817ee7a7a88693804e24877863370d1d53c7 | [
"MIT"
] | 90 | 2020-04-09T18:34:49.000Z | 2022-03-09T14:29:32.000Z | cryptoxlib/clients/hitbtc/exceptions.py | PetrZufan/cryptoxlib-aio | 8fbb817ee7a7a88693804e24877863370d1d53c7 | [
"MIT"
] | 44 | 2020-04-03T17:02:20.000Z | 2022-01-29T14:51:51.000Z | cryptoxlib/clients/hitbtc/exceptions.py | PetrZufan/cryptoxlib-aio | 8fbb817ee7a7a88693804e24877863370d1d53c7 | [
"MIT"
] | 28 | 2020-04-25T21:34:53.000Z | 2022-03-31T07:20:07.000Z | from typing import Optional
from cryptoxlib.exceptions import CryptoXLibException
class HitbtcException(CryptoXLibException):
pass
class HitbtcRestException(HitbtcException):
def __init__(self, status_code: int, body: Optional[dict]):
super().__init__(f"Rest API exception: status [{status_code}], response [{bo... | 25.266667 | 84 | 0.783641 |
932fdef8835c4901c1037ef9a34ab7166b7f10d9 | 2,838 | py | Python | zerver/webhooks/teamcity/tests.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/teamcity/tests.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | 6 | 2020-09-05T21:07:41.000Z | 2021-12-02T17:56:37.000Z | zerver/webhooks/teamcity/tests.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | 1 | 2021-01-07T23:27:52.000Z | 2021-01-07T23:27:52.000Z | # -*- coding: utf-8 -*-
import ujson
from zerver.lib.test_classes import WebhookTestCase
from zerver.models import Recipient
class TeamcityHookTests(WebhookTestCase):
STREAM_NAME = 'teamcity'
URL_TEMPLATE = u"/api/v1/external/teamcity?stream={stream}&api_key={api_key}"
SUBJECT = u"Project :: Compile"
... | 76.702703 | 346 | 0.761099 |
932ff5bdeed78389f2dd6e271e5e89ecff65720b | 422 | py | Python | venues/migrations/0007_venueapiconfiguration_taphunter_location.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 18 | 2018-12-06T01:46:37.000Z | 2021-10-17T10:37:17.000Z | venues/migrations/0007_venueapiconfiguration_taphunter_location.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 194 | 2018-11-04T12:50:49.000Z | 2022-01-06T22:43:43.000Z | venues/migrations/0007_venueapiconfiguration_taphunter_location.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 7 | 2019-03-18T05:36:06.000Z | 2020-12-25T03:27:29.000Z | # Generated by Django 2.1.5 on 2019-02-12 19:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("venues", "0006_auto_20190205_2208"),
]
operations = [
migrations.AddField(
model_name="venueapiconfiguration",
name=... | 22.210526 | 62 | 0.625592 |
93304d791222f7a8bfb9ee4aeb6398dd4a3f6429 | 552 | py | Python | binarysearch.io/the_insertion_point.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | binarysearch.io/the_insertion_point.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | binarysearch.io/the_insertion_point.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | class Solution:
def solve(self, arr, target):
# Write your code here
n = len(arr)
if len(arr) == 0:
return 0
elif len(arr) == 1:
if arr[0] > target:
return 0
elif arr[0] == target:
return 0
else:... | 25.090909 | 34 | 0.378623 |
93305be7c3eca22525f64cb4203b0ed62a9385da | 1,193 | py | Python | app/api/test_stuff.py | lsraei20/ds-bw | 3fe1a3038c583a906b0bff2d7b2cb96f78eba30a | [
"MIT"
] | null | null | null | app/api/test_stuff.py | lsraei20/ds-bw | 3fe1a3038c583a906b0bff2d7b2cb96f78eba30a | [
"MIT"
] | null | null | null | app/api/test_stuff.py | lsraei20/ds-bw | 3fe1a3038c583a906b0bff2d7b2cb96f78eba30a | [
"MIT"
] | null | null | null | import string
import joblib
import spacy
from spacy.lang.en import English
from spacy.lang.en.stop_words import STOP_WORDS
import dill
import nltk
nltk.download('stopwords')
model = dill.load(open('/Users/israel/PycharmProjects/'
'kickstarter-success-rate/app/'
'api/lrm_mo... | 29.097561 | 59 | 0.631182 |
9330a2bf32a5430f3f7ef8cb1fe386da192ea869 | 5,907 | py | Python | geomloss/examples/performances/plot_benchmarks_samplesloss_3D.py | ismedina/geomloss | bbd6289a139174effedb6855e1e992eb77772c67 | [
"MIT"
] | null | null | null | geomloss/examples/performances/plot_benchmarks_samplesloss_3D.py | ismedina/geomloss | bbd6289a139174effedb6855e1e992eb77772c67 | [
"MIT"
] | null | null | null | geomloss/examples/performances/plot_benchmarks_samplesloss_3D.py | ismedina/geomloss | bbd6289a139174effedb6855e1e992eb77772c67 | [
"MIT"
] | null | null | null | """
Benchmark SamplesLoss in 3D
=====================================
Let's compare the performances of our losses and backends
as the number of samples grows from 100 to 1,000,000.
"""
##############################################
# Setup
# ---------------------
import numpy as np
import time
from matplotlib impo... | 25.24359 | 83 | 0.532419 |
9330a91da1ad65e4fee81f6e72c0d9b247c84325 | 14,336 | py | Python | markdown/preprocessors.py | msabramo/Python-Markdown | 4cac4ff6095c7b7c0b319f16afb7df349ea93ac8 | [
"BSD-3-Clause"
] | null | null | null | markdown/preprocessors.py | msabramo/Python-Markdown | 4cac4ff6095c7b7c0b319f16afb7df349ea93ac8 | [
"BSD-3-Clause"
] | null | null | null | markdown/preprocessors.py | msabramo/Python-Markdown | 4cac4ff6095c7b7c0b319f16afb7df349ea93ac8 | [
"BSD-3-Clause"
] | null | null | null | """
PRE-PROCESSORS
=============================================================================
Preprocessors work on source text before we start doing anything too
complicated.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from . import util
from . import odict
import re
def b... | 41.077364 | 79 | 0.474261 |
9330ab4e8dfa6491b52f311bd811d2cc805b22f1 | 4,817 | py | Python | leetcode_python/Math/random-pick-index.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Math/random-pick-index.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Math/random-pick-index.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | """
Given an integer array nums with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.
Implement the Solution class:
Solution(int[] nums) Initializes the object with the array nums.
int pick(int target) Picks a random index i... | 25.352632 | 174 | 0.568404 |
9330bf6d84918e945524053b3e5690c910f55b8c | 7,774 | py | Python | cccheck/generalization.py | 1301476057/maltrail | be6248fbc6fb02629a9780d3d7f17b262dfe68c8 | [
"MIT"
] | null | null | null | cccheck/generalization.py | 1301476057/maltrail | be6248fbc6fb02629a9780d3d7f17b262dfe68c8 | [
"MIT"
] | null | null | null | cccheck/generalization.py | 1301476057/maltrail | be6248fbc6fb02629a9780d3d7f17b262dfe68c8 | [
"MIT"
] | null | null | null | #!/usr/bin python3
#coding=utf-8
import re
import os
import sys
import pandas as pd
'''
功能:最新版的请求泛化,待完善
注:
读取csv,必须设置sep='\a' 。例如:df = pd.read_csv(readFile,sep='\a')
同时,写入新csv文件时,也必须设置(一些情况可不必)sep='\a' 。例如:df.to_csv(wirteFile,sep='\a',index=False)
'''
emptySet=['nan','','0','/']
def isFloat(string):
return ... | 34.860987 | 124 | 0.541163 |
9330ea19a7fd655cddb23bba516dc767321de1f1 | 1,320 | py | Python | cloud-sql/postgres/sqlalchemy/main.py | jsj14/python-docs-samples | 9cf5461b166eea824c40c704ed06c5ea53cf91d4 | [
"Apache-2.0"
] | null | null | null | cloud-sql/postgres/sqlalchemy/main.py | jsj14/python-docs-samples | 9cf5461b166eea824c40c704ed06c5ea53cf91d4 | [
"Apache-2.0"
] | null | null | null | cloud-sql/postgres/sqlalchemy/main.py | jsj14/python-docs-samples | 9cf5461b166eea824c40c704ed06c5ea53cf91d4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 33 | 85 | 0.711364 |
93310eaf64d02107638e1a979f67fcdc94418585 | 7,217 | py | Python | CS/CSC384/A4/bustersAgents.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | CS/CSC384/A4/bustersAgents.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | CS/CSC384/A4/bustersAgents.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | # bustersAgents.py
# ----------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkel... | 40.094444 | 132 | 0.680615 |
93310f6c325a96c20600d8c0e085dcb9a65832aa | 1,066 | py | Python | sdks/python/test/test_AppDistributionGroupUsersRequest.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_AppDistributionGroupUsersRequest.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_AppDistributionGroupUsersRequest.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 26.65 | 127 | 0.756098 |
9331103826a88deaf8c81cf2917b06f93fd431f5 | 521 | py | Python | tolqc-api/app/test/base/tests/test_bad_sort_by.py | sanger-tol/tolqc | 6ef535a0eb0028c5d9270ff18d95d38c6656cbdd | [
"MIT"
] | null | null | null | tolqc-api/app/test/base/tests/test_bad_sort_by.py | sanger-tol/tolqc | 6ef535a0eb0028c5d9270ff18d95d38c6656cbdd | [
"MIT"
] | null | null | null | tolqc-api/app/test/base/tests/test_bad_sort_by.py | sanger-tol/tolqc | 6ef535a0eb0028c5d9270ff18d95d38c6656cbdd | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2021 Genome Research Ltd.
#
# SPDX-License-Identifier: MIT
from test.base import BaseTestCase
class TestBadSortByParameter400(BaseTestCase):
def test_no_sort_by_invalid_key_400(self):
self.add_D(id=890, non_nullable_column='a nice test')
response = self.client.open(
... | 27.421053 | 65 | 0.641075 |
9331235cfd296bc8ae4e6b6d46d37f9a0f069f0d | 586 | py | Python | utilities/tests.py | Yogev911/sms-service | 18e5c6ba55d354ea59bc0eceed31a0e01ecb5ebb | [
"MIT"
] | null | null | null | utilities/tests.py | Yogev911/sms-service | 18e5c6ba55d354ea59bc0eceed31a0e01ecb5ebb | [
"MIT"
] | null | null | null | utilities/tests.py | Yogev911/sms-service | 18e5c6ba55d354ea59bc0eceed31a0e01ecb5ebb | [
"MIT"
] | null | null | null | import unittest
from utilities.utils import generate_pin_code, generate_token, get_data_by_token
class TestUtilsMethods(unittest.TestCase):
def test_utils(self):
test_user_id = 1234
test_phone = '972529999444'
token = generate_token(test_user_id, test_phone)
token_data = get_data... | 32.555556 | 80 | 0.709898 |
93316dcfa1bfe1972b600b82b2b5747dfc9465bb | 7,835 | py | Python | salt/modules/brew.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | 1 | 2016-12-20T20:11:21.000Z | 2016-12-20T20:11:21.000Z | salt/modules/brew.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | salt/modules/brew.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | '''
Homebrew for Mac OS X
'''
# Import python libs
import copy
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def __virtual__():
'''
Confine this module to Mac OS with Homebrew.
'''
if salt.utils.which('brew') and __grains__['os'] == 'MacOS':
return '... | 25.858086 | 109 | 0.591704 |
93316ec3ba9afb4810238ff195552f60688ca27b | 20,169 | py | Python | bayesian/test/test_graph.py | timgates42/bayesian-belief-networks | 23c3e3ce1c7f99d83efb79f9b7798af2a1537e1c | [
"Apache-2.0"
] | 734 | 2015-01-05T21:25:01.000Z | 2022-03-16T12:12:20.000Z | bayesian/test/test_graph.py | timgates42/bayesian-belief-networks | 23c3e3ce1c7f99d83efb79f9b7798af2a1537e1c | [
"Apache-2.0"
] | 11 | 2015-01-20T16:22:48.000Z | 2021-05-12T13:01:11.000Z | bayesian/test/test_graph.py | timgates42/bayesian-belief-networks | 23c3e3ce1c7f99d83efb79f9b7798af2a1537e1c | [
"Apache-2.0"
] | 222 | 2015-01-06T09:28:53.000Z | 2022-03-04T10:38:32.000Z | import pytest
import os
from bayesian.factor_graph import *
from bayesian.gaussian_bayesian_network import build_gbn
from bayesian.examples.gaussian_bayesian_networks.river import (
f_a, f_b, f_c, f_d)
def pytest_funcarg__river_graph(request):
g = build_gbn(f_a, f_b, f_c, f_d)
return g
def fA(x1):
... | 25.660305 | 77 | 0.601765 |
9331a98eaa19a6279e5c9d0d0cada001cb8382dd | 1,188 | py | Python | suspicious_urls_ips/feeds/cobaltstrike.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/cobaltstrike.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/cobaltstrike.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
import datetime
from antivirus.lists_based_engine.update import retrieve_content
from antivirus.lists_based_engine.settings import IP_TYPE
from antivirus.lis... | 33 | 114 | 0.684343 |
9331d84ef0ad5915fc20d3d4cb7bac38fc6e4be3 | 2,677 | py | Python | jrnl/export.py | TonyRoomZ/jrnl | 75459bb9fcd19107d56b9560094137924e88959f | [
"MIT"
] | null | null | null | jrnl/export.py | TonyRoomZ/jrnl | 75459bb9fcd19107d56b9560094137924e88959f | [
"MIT"
] | null | null | null | jrnl/export.py | TonyRoomZ/jrnl | 75459bb9fcd19107d56b9560094137924e88959f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import, unicode_literals
import codecs
import os
from .template import Template
from .util import ERROR_COLOR, RESET_COLOR, slugify, u
class Exporter(object):
"""This Exporter can convert entries and journals into text files."""
def __... | 39.367647 | 104 | 0.611132 |
933200e60749e62094040672793953c1c79de6cf | 1,320 | py | Python | tensorflow/contrib/quantize/__init__.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/contrib/quantize/__init__.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/contrib/quantize/__init__.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.714286 | 80 | 0.743939 |
93320bdd5247d94d7b8923bd7129bd0a9ab78936 | 19,749 | py | Python | cemu/ui/main.py | MatejKastak/cemu | c6f93239a5901ce00d2f739a3913d0ba7d0ed4e4 | [
"MIT"
] | null | null | null | cemu/ui/main.py | MatejKastak/cemu | c6f93239a5901ce00d2f739a3913d0ba7d0ed4e4 | [
"MIT"
] | null | null | null | cemu/ui/main.py | MatejKastak/cemu | c6f93239a5901ce00d2f739a3913d0ba7d0ed4e4 | [
"MIT"
] | 1 | 2021-01-24T08:58:21.000Z | 2021-01-24T08:58:21.000Z | import functools
import tempfile
import os
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (
QApplication,
qApp,
QVBoxLayout,
QHBoxLayout,
QTabWidget,
QMessageBox,
QAction,
QFileDialog,
QGridLayout,
QLabel,
QWidget,
QMainWindow
)
from PyQt5.QtGui imp... | 34.16782 | 141 | 0.599372 |
93320d8d084c71ee0166acbf5f4d6cf5b84e825a | 2,145 | py | Python | experiment/research/pred/convert_to_proto_bnn.py | prijatelj/bayesian_eval_ground_truth-free | c0e569c78d63beb79f5e1e727c322293c3584323 | [
"MIT"
] | 1 | 2021-12-26T05:55:46.000Z | 2021-12-26T05:55:46.000Z | experiment/research/pred/convert_to_proto_bnn.py | prijatelj/bayesian_eval_ground_truth-free | c0e569c78d63beb79f5e1e727c322293c3584323 | [
"MIT"
] | null | null | null | experiment/research/pred/convert_to_proto_bnn.py | prijatelj/bayesian_eval_ground_truth-free | c0e569c78d63beb79f5e1e727c322293c3584323 | [
"MIT"
] | null | null | null | import argparse
import json
import os
import numpy as np
from psych_metric.distrib.simplex.euclidean import EuclideanSimplexTransform
from experiment import io
def convert_pred_file_to_proto_bnn(
in_file_path,
out_file_path=None,
part='train',
old_euclid_transform=True,
):
"""Converts format fr... | 24.94186 | 79 | 0.620513 |
933213244c62026d4c1e31c4a882419e411857a6 | 3,317 | py | Python | ee_download.py | MAAP-Project/EE-Download | ff868a6a401422a9a6d223ac8802cf852c47ffe1 | [
"MIT"
] | 9 | 2017-06-14T12:19:43.000Z | 2021-10-31T00:58:51.000Z | ee_download.py | MAAP-Project/EE-Download | ff868a6a401422a9a6d223ac8802cf852c47ffe1 | [
"MIT"
] | 2 | 2017-06-14T13:22:59.000Z | 2017-06-14T17:01:09.000Z | ee_download.py | MAAP-Project/EE-Download | ff868a6a401422a9a6d223ac8802cf852c47ffe1 | [
"MIT"
] | 4 | 2018-11-12T19:16:04.000Z | 2021-11-12T20:19:34.000Z | import sys
import os
import errno
from zipfile import is_zipfile, ZipFile
import pycurl
import ee
import ee.mapclient
max_items = 99999
ee.Initialize()
class Curler(object):
def __init__(self):
self.headers = {}
def download(self, url, path):
with open(path, 'wb') as f:
c = pycurl.Curl()
c.setopt(c.UR... | 27.87395 | 148 | 0.724751 |
93321b53dde44e26832c7f29968deaa10036e3e6 | 14,283 | py | Python | src/jetson/acol/pooling.py | ichalkiad/VW_challenge | 333222010ecf3d1ca4a0e181239f761c975453e9 | [
"Apache-2.0"
] | 1 | 2017-08-16T08:42:49.000Z | 2017-08-16T08:42:49.000Z | src/jetson/acol/pooling.py | ichalkiad/VW_challenge | 333222010ecf3d1ca4a0e181239f761c975453e9 | [
"Apache-2.0"
] | 4 | 2017-08-09T23:01:30.000Z | 2017-08-24T16:44:13.000Z | src/jetson/acol/pooling.py | yhalk/vw_challenge_ECR | c1ff50070d0f7367ccfbf473c69e90fd2be5e85e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
import numpy as np
import copy
import inspect
import types as python_types
import warnings
from keras import backend as K
from keras.engine import InputSpec
from keras.engine import Layer
from keras import activations
fro... | 41.520349 | 120 | 0.612406 |
93323aa9e7360d88f8bba72b8a51e87143ba35bb | 2,122 | py | Python | bcbio/variation/annotation.py | matanhofree/bcbio-nextgen | e6938cedb20ff3b7632165105941d71189e46aac | [
"MIT"
] | 1 | 2015-04-08T17:43:39.000Z | 2015-04-08T17:43:39.000Z | bcbio/variation/annotation.py | matanhofree/bcbio-nextgen | e6938cedb20ff3b7632165105941d71189e46aac | [
"MIT"
] | null | null | null | bcbio/variation/annotation.py | matanhofree/bcbio-nextgen | e6938cedb20ff3b7632165105941d71189e46aac | [
"MIT"
] | null | null | null | """Annotated variant VCF files with additional information.
- GATK variant annotation with snpEff predicted effects.
"""
import os
from bcbio import broad, utils
from bcbio.distributed.transaction import file_transaction
from bcbio.variation import vcfutils
def get_gatk_annotations(config):
broad_runner = broad.... | 41.607843 | 80 | 0.634779 |
93326480a730eda2afe20d4e4a2cbc813461badd | 24,560 | py | Python | cinder/tests/unit/api/v3/test_group_snapshots.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/api/v3/test_group_snapshots.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/api/v3/test_group_snapshots.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2016 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 45.565863 | 79 | 0.566612 |
933287a23881a705566351a28ea31de5a129bb91 | 7,858 | py | Python | mysignal/mysignal.py | ochurlaud/MSc_simulation-fofb | dc9a43f54bf7e570915d0360d102ad04f3cb761d | [
"WTFPL"
] | null | null | null | mysignal/mysignal.py | ochurlaud/MSc_simulation-fofb | dc9a43f54bf7e570915d0360d102ad04f3cb761d | [
"WTFPL"
] | null | null | null | mysignal/mysignal.py | ochurlaud/MSc_simulation-fofb | dc9a43f54bf7e570915d0360d102ad04f3cb761d | [
"WTFPL"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
import sympy as sy
def poly_to_sympy(num, den, symbol='s', simplify=True):
""" Convert Scipy's LTI instance to Sympy expression """
s = sy.Symbol(symbol)
G ... | 29.765152 | 82 | 0.521252 |
93328ddb8ed9a09b8356acb1d26410c3e4a172b2 | 11,848 | py | Python | skorch/classifier.py | TheAutumnOfRice/skorch | 6d778fc38d797644c847a9c87dd23299eea63087 | [
"BSD-3-Clause"
] | 2,748 | 2019-03-19T11:43:01.000Z | 2022-03-31T13:55:28.000Z | skorch/classifier.py | TheAutumnOfRice/skorch | 6d778fc38d797644c847a9c87dd23299eea63087 | [
"BSD-3-Clause"
] | 392 | 2019-03-19T11:17:04.000Z | 2022-03-29T21:36:53.000Z | skorch/classifier.py | TheAutumnOfRice/skorch | 6d778fc38d797644c847a9c87dd23299eea63087 | [
"BSD-3-Clause"
] | 197 | 2019-03-27T09:18:25.000Z | 2022-03-27T00:15:23.000Z | """NeuralNet subclasses for classification tasks."""
import re
import numpy as np
from sklearn.base import ClassifierMixin
import torch
from torch.utils.data import DataLoader
from skorch import NeuralNet
from skorch.callbacks import EpochTimer
from skorch.callbacks import PrintLog
from skorch.callbacks import Epoch... | 33.094972 | 85 | 0.595712 |
933295ad6ceca977b9e8b26234cf88fd026d982e | 42,120 | py | Python | SCRAPE/Lib/site-packages/IPython/core/display.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 2 | 2022-02-26T11:19:40.000Z | 2022-03-28T08:23:25.000Z | SCRAPE/Lib/site-packages/IPython/core/display.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | null | null | null | SCRAPE/Lib/site-packages/IPython/core/display.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1 | 2022-03-28T09:19:34.000Z | 2022-03-28T09:19:34.000Z | # -*- coding: utf-8 -*-
"""Top-level display functions for displaying object in different formats."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from binascii import b2a_base64, hexlify
import html
import json
import mimetypes
import os
import struct
import w... | 32.957746 | 162 | 0.588604 |
9332a2735b6ab5670bc4dc21c1049e5227ab1e7e | 20 | py | Python | tests/integration/hub_usage/dummyhub_slow/helper.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | 15,179 | 2020-04-28T10:23:56.000Z | 2022-03-31T14:35:25.000Z | tests/integration/hub_usage/dummyhub_slow/helper.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | 3,912 | 2020-04-28T13:01:29.000Z | 2022-03-31T14:36:46.000Z | tests/integration/hub_usage/dummyhub_slow/helper.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | 1,955 | 2020-04-28T10:50:49.000Z | 2022-03-31T12:28:34.000Z | def foo():
pass
| 6.666667 | 10 | 0.5 |
9332c877a58c1bc21a319f376cdfb71fae078b11 | 1,219 | py | Python | examples/redis_lock.py | msabramo/diesel | a1ed7ed0358d0fec8592e23aafc3b7ec167ab649 | [
"BSD-3-Clause"
] | 224 | 2015-01-03T06:33:05.000Z | 2021-11-22T03:19:02.000Z | examples/redis_lock.py | dowski/diesel | d9824e467805caf40e0ba21b88a27db38e64c352 | [
"BSD-3-Clause"
] | 12 | 2015-01-01T03:35:15.000Z | 2021-05-22T23:37:28.000Z | examples/redis_lock.py | dowski/diesel | d9824e467805caf40e0ba21b88a27db38e64c352 | [
"BSD-3-Clause"
] | 37 | 2015-01-04T01:47:55.000Z | 2022-03-03T02:04:15.000Z | import random
from diesel import fork, quickstop, quickstart, sleep
from diesel.protocols.redis import RedisClient, RedisTransactionError, RedisLock, LockNotAcquired
"""Implement the Redis INCR command using a lock. Obviously this is inefficient, but it's a good
example of how to use the RedisLock class"""
key = 't... | 25.395833 | 111 | 0.669401 |
93333f74c525228d8ff34def3038a1cabe291d27 | 12,907 | py | Python | n_utils/cf_deploy.py | NitorCreations/nitor-deploy-tools | 93dd86d5e6586520f72dd38319f55849bf4a5bc5 | [
"Apache-2.0"
] | 10 | 2017-02-12T17:04:56.000Z | 2018-11-10T16:46:57.000Z | n_utils/cf_deploy.py | NitorCreations/nitor-deploy-tools | 93dd86d5e6586520f72dd38319f55849bf4a5bc5 | [
"Apache-2.0"
] | 22 | 2017-04-06T11:41:01.000Z | 2019-09-18T05:45:03.000Z | n_utils/cf_deploy.py | NitorCreations/nitor-deploy-tools | 93dd86d5e6586520f72dd38319f55849bf4a5bc5 | [
"Apache-2.0"
] | 1 | 2020-08-26T07:32:02.000Z | 2020-08-26T07:32:02.000Z | #!/usr/bin/env python
# Copyright 2016-2017 Nitor Creations Oy
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 38.073746 | 103 | 0.633842 |
93334383ba693fecb9908caa4eebbb225fcbb3ee | 2,938 | py | Python | text_games/hangman.py | ikathuria/PythonProjects | 5e97902ee05f6e4fecde3ef4661c929390ead759 | [
"MIT"
] | null | null | null | text_games/hangman.py | ikathuria/PythonProjects | 5e97902ee05f6e4fecde3ef4661c929390ead759 | [
"MIT"
] | null | null | null | text_games/hangman.py | ikathuria/PythonProjects | 5e97902ee05f6e4fecde3ef4661c929390ead759 | [
"MIT"
] | null | null | null | """The game of hangman made using python.
Hangman is a paper and pencil guessing game for two or more players. One player
thinks of a word, phrase or sentence and the other(s) tries to guess it by suggesting
letters within a certain number of guesses.
"""
import random
the_words = ['python', 'hangman', 'games', 'ra... | 27.716981 | 85 | 0.50919 |
933354e538a2356bbdc8f38bc368e5ff97a4193e | 161 | py | Python | personalcapital/exceptions.py | NeilWong/personalcapital | fa1c29362459ca3730ed950e09e77a2dcba21cb2 | [
"MIT"
] | null | null | null | personalcapital/exceptions.py | NeilWong/personalcapital | fa1c29362459ca3730ed950e09e77a2dcba21cb2 | [
"MIT"
] | null | null | null | personalcapital/exceptions.py | NeilWong/personalcapital | fa1c29362459ca3730ed950e09e77a2dcba21cb2 | [
"MIT"
] | null | null | null | class LoginFailedException(Exception):
pass
class RequireTwoFactorException(Exception):
pass
class TwoFactorException(Exception):
pass
| 17.888889 | 44 | 0.726708 |
93335edfe171e1c36fcd773afe9befd6753a4be6 | 3,143 | py | Python | apps/logs/admin.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/logs/admin.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/logs/admin.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from . import models
@admin.register(models.OrganizationPlatform)
class OrganizationPlatformAdmin(admin.ModelAdmin):
list_display = ['organization', 'platform']
@admin.register(models.ReportType)
class ReportTypeAdmin(Transla... | 32.402062 | 95 | 0.716513 |
9333622be0783c36ad2e1390db701d83f52084f8 | 7,956 | py | Python | libs/index/odc/index/stac.py | tahvane1/odc-tools | 1f11133dc243d8e47060add1c95a3719135895c3 | [
"Apache-2.0"
] | null | null | null | libs/index/odc/index/stac.py | tahvane1/odc-tools | 1f11133dc243d8e47060add1c95a3719135895c3 | [
"Apache-2.0"
] | null | null | null | libs/index/odc/index/stac.py | tahvane1/odc-tools | 1f11133dc243d8e47060add1c95a3719135895c3 | [
"Apache-2.0"
] | null | null | null | import math
from pathlib import Path
from typing import Dict, Tuple, Any, Optional
from uuid import UUID
from datacube.utils.geometry import Geometry
from odc.index import odc_uuid
from toolz import get_in
Document = Dict[str, Any]
KNOWN_CONSTELLATIONS = ["sentinel-2"]
LANDSAT_PLATFORMS = ["landsat-5", "landsat-7",... | 30.837209 | 116 | 0.630216 |
93336734ab30acd6c42cd7babcfc757e6a4e65d7 | 270 | py | Python | marathon/tests/common.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 4 | 2021-06-21T19:21:49.000Z | 2021-06-23T21:21:55.000Z | marathon/tests/common.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2018-08-15T05:50:17.000Z | 2018-08-15T05:50:17.000Z | marathon/tests/common.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2018-08-15T05:45:42.000Z | 2018-08-15T05:45:42.000Z | # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
from datadog_checks.utils.common import get_docker_hostname
HERE = os.path.dirname(os.path.abspath(__file__))
HOST = get_docker_hostname()
PORT = 8080
| 22.5 | 59 | 0.777778 |
9333a088f603c26aec7d4479b04d7cdab8f6d83a | 2,975 | py | Python | livechat/tests/test_helpers.py | livechat/lc-sdk-python | 536483590b9600ef1bc86fe36a1f810368b85a9d | [
"Apache-2.0"
] | 5 | 2021-03-22T19:22:05.000Z | 2022-01-18T13:38:22.000Z | livechat/tests/test_helpers.py | livechat/lc-sdk-python | 536483590b9600ef1bc86fe36a1f810368b85a9d | [
"Apache-2.0"
] | 5 | 2021-10-05T14:44:33.000Z | 2022-02-16T07:33:51.000Z | livechat/tests/test_helpers.py | livechat/lc-sdk-python | 536483590b9600ef1bc86fe36a1f810368b85a9d | [
"Apache-2.0"
] | null | null | null | ''' Tests for helper methods from livechat.utils. '''
import pytest
from livechat.utils import helpers
@pytest.mark.parametrize('parameters,payload', [({
'test': 'test',
'test1': 'test1'
}, {
'test': 'test',
'test1': 'test1'
}),
({
... | 49.583333 | 73 | 0.173782 |
9333b797490994b2fbccc69cccb097c55bf35a14 | 653 | py | Python | ai4water/__init__.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 12 | 2020-10-13T08:23:17.000Z | 2021-01-22T04:36:21.000Z | ai4water/__init__.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 1 | 2020-10-15T02:42:52.000Z | 2020-10-15T02:51:07.000Z | ai4water/__init__.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 2 | 2020-11-23T04:45:38.000Z | 2020-11-26T10:12:34.000Z | """
main models are pytorch based and Model.
All tensorflow based models can be implemented purely using Model.
"""
from ai4water.main import Model
try:
from ai4water.pytorch_models import IMVModel
from ai4water.pytorch_models import HARHNModel
except AttributeError:
print("\n{}Pytorch models could not be ... | 32.65 | 88 | 0.742726 |
9333b94f8c6876bf8ee1bb191a89a513af2ed01a | 2,746 | py | Python | src/api/bkuser_core/profiles/management/commands/update_profile_extras.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/profiles/management/commands/update_profile_extras.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/profiles/management/commands/update_profile_extras.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | 40.382353 | 115 | 0.606336 |
9333cb196df8d1750319c66694e3903f0481224b | 179 | py | Python | orderbook_veinte/utils/hashing.py | morwen1/hyperion | f0d77a6cce6a366555e9f0ca0080f3da134862bf | [
"MIT"
] | null | null | null | orderbook_veinte/utils/hashing.py | morwen1/hyperion | f0d77a6cce6a366555e9f0ca0080f3da134862bf | [
"MIT"
] | null | null | null | orderbook_veinte/utils/hashing.py | morwen1/hyperion | f0d77a6cce6a366555e9f0ca0080f3da134862bf | [
"MIT"
] | null | null | null | def generatehash(items:list):
items = [str(i) for i in items]
hash = ''
for i in range(len(items)):
hash += items[i]
hash.replace('.' , '')
return hash | 25.571429 | 35 | 0.547486 |
93340b783ddc79546fbd4d58e980ab7fc5f8a28e | 6,831 | py | Python | board.py | sglyon/reversi.py | d66f37364e7b6cba1f6c1c08401b6ca9373ecc42 | [
"MIT"
] | null | null | null | board.py | sglyon/reversi.py | d66f37364e7b6cba1f6c1c08401b6ca9373ecc42 | [
"MIT"
] | null | null | null | board.py | sglyon/reversi.py | d66f37364e7b6cba1f6c1c08401b6ca9373ecc42 | [
"MIT"
] | 1 | 2020-01-01T00:12:04.000Z | 2020-01-01T00:12:04.000Z | import sys
if sys.version_info.major == 2:
range = xrange
# MARKERS = {0: " ", 1: " \u25cf ", 2: " \u25cb "}
MARKERS = {0: " ", 1: " X ", 2: " O "}
SPACES = {}
for row in range(8):
for col in range(8):
SPACES[(row, col)] = 1 << (8 * row + col)
class Board(object):
def __init__(self, p1_place... | 31.191781 | 78 | 0.506661 |
933432dcdb2d0129107978331532d773b8c84bc5 | 526 | py | Python | pyggi/base/engine.py | bloa/pyggi | 79babee583460494b1c533e45e49c7cb23ed70c9 | [
"MIT"
] | null | null | null | pyggi/base/engine.py | bloa/pyggi | 79babee583460494b1c533e45e49c7cb23ed70c9 | [
"MIT"
] | null | null | null | pyggi/base/engine.py | bloa/pyggi | 79babee583460494b1c533e45e49c7cb23ed70c9 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class AbstractEngine(ABC):
@classmethod
@abstractmethod
def get_contents(cls, file_path):
pass
@classmethod
@abstractmethod
def get_modification_points(cls, contents_of_file):
pass
@classmethod
def write_to_tmp_dir(cls, contents_of_f... | 21.916667 | 58 | 0.678707 |
933443ffd5c641092706eb88b362505257dd1fb5 | 942 | py | Python | accounts/management/commands/create_permissions.py | EstherWaweru/Ecommerce-Backend | 2e0c1328d669c51e0786bde31c5feca648897875 | [
"MIT"
] | 5 | 2021-02-24T15:17:36.000Z | 2022-02-26T22:25:06.000Z | accounts/management/commands/create_permissions.py | EstherWaweru/Ecommerce-Backend | 2e0c1328d669c51e0786bde31c5feca648897875 | [
"MIT"
] | 5 | 2021-02-24T13:52:50.000Z | 2021-04-21T15:37:23.000Z | accounts/management/commands/create_permissions.py | EstherWaweru/Ecommerce-Backend | 2e0c1328d669c51e0786bde31c5feca648897875 | [
"MIT"
] | 1 | 2021-02-17T14:12:19.000Z | 2021-02-17T14:12:19.000Z | """
Create permission groups
Create permissions (read only) to models for a set of groups
"""
import logging
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from ... | 37.68 | 125 | 0.76327 |
93345e3994bed788bc5fe52aafc5a15eceba13b7 | 9,720 | py | Python | trac/notification/prefs.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/notification/prefs.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/notification/prefs.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2020 Edgewall Software
# Copyright (C) 2008 Stephen Hansen
# Copyright (C) 2009-2010 Robert Corsaro
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also av... | 40.5 | 79 | 0.596399 |
93345fa08a3d822ffbfb8a366499fb325b4e96a7 | 2,068 | py | Python | API/src/main/resources/Lib/robot/model/modifier.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/model/modifier.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/model/modifier.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2020, sikuli.org, sikulix.com - MIT license
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 39.769231 | 78 | 0.639265 |
9334b1882989b6287995178448f569ccd0a19091 | 2,560 | py | Python | rescuetime/tests/anapidata.py | MinoDe/rescuetime | 6b0156fe005ad6a1610953d1b1a03f7645d9355d | [
"MIT"
] | 1 | 2022-03-01T20:19:38.000Z | 2022-03-01T20:19:38.000Z | rescuetime/tests/anapidata.py | MinoDe/rescuetime | 6b0156fe005ad6a1610953d1b1a03f7645d9355d | [
"MIT"
] | null | null | null | rescuetime/tests/anapidata.py | MinoDe/rescuetime | 6b0156fe005ad6a1610953d1b1a03f7645d9355d | [
"MIT"
] | null | null | null | import sys
import datetime
from unittest import TestCase
from rescuetime.tests.data import url, key
from rescuetime.api.service.Service import Service
from rescuetime.api.access.AnalyticApiKey import AnalyticApiKey
from rescuetime.api.model.ResponseData import ResponseData
class TestApiData(TestCase):
def __init... | 37.647059 | 112 | 0.491016 |
9334c6079a4c8c462b40f05341f1efcdfd9b3bd5 | 869 | py | Python | misc.py | parenthetical-e/rl | 5bfb385fee0ca622c71dbb4269a29dc9426bc207 | [
"BSD-2-Clause"
] | 2 | 2015-11-20T04:34:48.000Z | 2016-09-01T22:26:48.000Z | misc.py | parenthetical-e/rl | 5bfb385fee0ca622c71dbb4269a29dc9426bc207 | [
"BSD-2-Clause"
] | null | null | null | misc.py | parenthetical-e/rl | 5bfb385fee0ca622c71dbb4269a29dc9426bc207 | [
"BSD-2-Clause"
] | 2 | 2016-09-01T22:26:49.000Z | 2019-10-05T09:15:39.000Z | """ A set of miscellaneous or helper functions for the rl package"""
def unpack(a_dict,states):
"""
For implementational simplicity, V, RPE, etc, values for all RL models
implemented here are stored in a dict, keyed on each state. This
function uses states to unpack that dict into a list whose order
matches s... | 22.868421 | 72 | 0.672037 |
9334d88f37514e873a890b12c8d1a1b556fbf6d5 | 3,592 | py | Python | holdings.py | bharathcs/PythonFins | e98ffb6f363c6a3ba9b023af0ed26cc1df32be31 | [
"MIT"
] | null | null | null | holdings.py | bharathcs/PythonFins | e98ffb6f363c6a3ba9b023af0ed26cc1df32be31 | [
"MIT"
] | null | null | null | holdings.py | bharathcs/PythonFins | e98ffb6f363c6a3ba9b023af0ed26cc1df32be31 | [
"MIT"
] | null | null | null | import sqlite3
import pandas as pd
import datetime as dt
dbpath = "holdings.db"
columns_heading = ['TxID', 'TxDate', 'Name','Ticker','Amount', 'Broker']
def new_db():
with open(dbpath, 'w'):
db = sqlite3.connect(dbpath)
db.execute("""DROP TABLE IF EXISTS holdings;""")
db.execute('''CREATE TABLE ... | 29.68595 | 84 | 0.566537 |
9334fe8d91aae3dc21860e70c61b033a1d2594c7 | 87,319 | py | Python | epydoc/docparser.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | epydoc/docparser.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | epydoc/docparser.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | 1 | 2019-12-17T19:21:21.000Z | 2019-12-17T19:21:21.000Z | # epydoc -- Source code parsing
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: docparser.py 1776 2008-02-24 06:40:17Z edloper $
"""
Extract API documentation about python objects by parsing their source
code.
The function L{parse_docs()}, which pr... | 39.817145 | 79 | 0.589917 |
9335226b2310cd3de2e4c4d226dac8e852bfa764 | 13,790 | py | Python | pe/_py_machine.py | goodmami/pe | ea2ff69742c7f76f370cdfa8e3f7ae0860d5e6fa | [
"MIT"
] | 18 | 2020-03-25T09:10:24.000Z | 2022-02-21T02:46:10.000Z | pe/_py_machine.py | goodmami/pe | ea2ff69742c7f76f370cdfa8e3f7ae0860d5e6fa | [
"MIT"
] | 21 | 2020-03-18T08:03:04.000Z | 2021-10-11T04:29:09.000Z | pe/_py_machine.py | goodmami/pe | ea2ff69742c7f76f370cdfa8e3f7ae0860d5e6fa | [
"MIT"
] | 1 | 2021-09-02T16:09:29.000Z | 2021-09-02T16:09:29.000Z |
"""
PEG Parsing Machine
Inspired by Medeiros and Ierusalimschy, 2008, "A Parsing Machine for PEGs"
"""
from typing import Union, Tuple, List, Dict, Optional, Any
from enum import IntEnum
import re
from pe._constants import FAIL as FAILURE, Operator, Flag
from pe._errors import Error
from pe._match import Match
fro... | 25.727612 | 76 | 0.522625 |
93352667597eed54a9c5ab771c76b31ade8e37c2 | 23,260 | py | Python | google/appengine/ext/mapreduce/output_writers.py | luduvigo/app-blog-code | 2de41573955f8dfb5f6d964d3cae2bbee6db2f9a | [
"Apache-2.0"
] | null | null | null | google/appengine/ext/mapreduce/output_writers.py | luduvigo/app-blog-code | 2de41573955f8dfb5f6d964d3cae2bbee6db2f9a | [
"Apache-2.0"
] | null | null | null | google/appengine/ext/mapreduce/output_writers.py | luduvigo/app-blog-code | 2de41573955f8dfb5f6d964d3cae2bbee6db2f9a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 30.930851 | 80 | 0.686629 |
93354ac733a0ef0c2c5fa18c5e4268e5842faa13 | 665 | py | Python | instructors/lessons/logging/examples/advanced/configurelogfromdict.py | mgadagin/PythonClass | 70b370362d75720b3fb0e1d6cc8158f9445e9708 | [
"MIT"
] | 46 | 2017-09-27T20:19:36.000Z | 2020-12-08T10:07:19.000Z | instructors/lessons/logging/examples/advanced/configurelogfromdict.py | mgadagin/PythonClass | 70b370362d75720b3fb0e1d6cc8158f9445e9708 | [
"MIT"
] | 6 | 2018-01-09T08:07:37.000Z | 2020-09-07T12:25:13.000Z | instructors/lessons/logging/examples/advanced/configurelogfromdict.py | mgadagin/PythonClass | 70b370362d75720b3fb0e1d6cc8158f9445e9708 | [
"MIT"
] | 18 | 2017-10-10T02:06:51.000Z | 2019-12-01T10:18:13.000Z | """
This uses a json file as a config file, which is loaded
as a Python dict(). The result is a fully configured
logger.
Also note that the encoding specified in the config file
is UTF-8. I am not sure if this need to be specified in
some environments, but I didn't need it on Ubuntu 14.04.
"""
import json
import lo... | 23.75 | 56 | 0.745865 |
9335578145b407293d4e16c79e4c4da4df9b7a9e | 3,695 | py | Python | catalyst/utils/meters/aucmeter.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 2 | 2021-02-22T12:15:41.000Z | 2021-05-02T15:22:24.000Z | catalyst/utils/meters/aucmeter.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/utils/meters/aucmeter.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 1 | 2018-12-21T15:56:21.000Z | 2018-12-21T15:56:21.000Z | """
The AUCMeter measures the area under the receiver-operating characteristic
(ROC) curve for binary classification problems. The area under the curve
(AUC) can be interpreted as the probability that, given a randomly selected
positive example and a randomly selected negative example, the positive
example is assig... | 34.212963 | 75 | 0.596482 |
93355ff403397bfca93575c183210cbdea9006d3 | 159 | py | Python | hs_app_netCDF/apps.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_app_netCDF/apps.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_app_netCDF/apps.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | from django.apps import AppConfig
class NetCDFAppConfig(AppConfig):
name = "hs_app_netCDF"
def ready(self):
from . import receivers # noqa
| 17.666667 | 39 | 0.691824 |
933564c9658804c3b95944963b8186156db903dd | 3,064 | py | Python | cmsplus/tests/cms_plugins.py | domlysi/djangocms_plus | 4779a17935827aa9fb6608bf53f56c10b8cd938a | [
"MIT"
] | 4 | 2020-04-28T12:40:45.000Z | 2021-03-05T08:18:41.000Z | cmsplus/tests/cms_plugins.py | InQuant/djangocms_plus | 887fb048e147e68e5fc63e3570581adddfa67588 | [
"MIT"
] | null | null | null | cmsplus/tests/cms_plugins.py | InQuant/djangocms_plus | 887fb048e147e68e5fc63e3570581adddfa67588 | [
"MIT"
] | null | null | null | from importlib import import_module
from cms.api import create_page, add_plugin
from cms.models import Page
from cms.plugin_pool import plugin_pool
from django.forms.fields import CharField, ChoiceField, MultipleChoiceField, URLField, EmailField, IntegerField, \
BooleanField, FloatField
from django.test import Tes... | 35.218391 | 114 | 0.609661 |
93356abee7b13b3b090a01a961c3f622116bacb3 | 1,804 | py | Python | python-flask-server/jatdb_server/models/base_model_.py | NGenetzky/jatdb | 518e0cedca1b61b8a744aef5e02255d8501bf8eb | [
"MIT"
] | null | null | null | python-flask-server/jatdb_server/models/base_model_.py | NGenetzky/jatdb | 518e0cedca1b61b8a744aef5e02255d8501bf8eb | [
"MIT"
] | null | null | null | python-flask-server/jatdb_server/models/base_model_.py | NGenetzky/jatdb | 518e0cedca1b61b8a744aef5e02255d8501bf8eb | [
"MIT"
] | null | null | null | import pprint
import six
from jatdb_server import util
class Model(object):
# swaggerTypes: The key is attribute name and the
# value is attribute type.
swagger_types = {}
# attributeMap: The key is attribute name and the
# value is json key in definition.
attribute_map = {}
@classmeth... | 26.925373 | 74 | 0.538803 |
93356b381bca8c4dcfc0548a08167882f9e18495 | 2,737 | py | Python | python-package/test/plot/test_assembly.py | IKupriyanov-HORIS/lets-plot | fe960f43d39844d04a89bd12490cd2dd4dbeaa51 | [
"MIT"
] | 768 | 2019-11-28T14:09:46.000Z | 2022-03-30T18:19:28.000Z | python-package/test/plot/test_assembly.py | IKupriyanov-HORIS/lets-plot | fe960f43d39844d04a89bd12490cd2dd4dbeaa51 | [
"MIT"
] | 240 | 2019-12-04T20:15:03.000Z | 2022-03-30T17:12:23.000Z | python-package/test/plot/test_assembly.py | IKupriyanov-HORIS/lets-plot | fe960f43d39844d04a89bd12490cd2dd4dbeaa51 | [
"MIT"
] | 43 | 2019-12-05T13:45:32.000Z | 2022-03-31T21:27:00.000Z | #
# Copyright (c) 2019. JetBrains s.r.o.
# Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#
import lets_plot as gg
from lets_plot.plot.core import DummySpec, FeatureSpecArray
from lets_plot.plot.core import FeatureSpec
from lets_plot.plot.core import LayerSpec
from lets_pl... | 25.579439 | 95 | 0.597369 |
93356f1c51671439ccf0d69663a353c8bd984dd4 | 37,772 | bzl | Python | rust/known_shas.bzl | benbrittain/rules_rust | 999f5dfc8d27e94c4f97a5c67386ea4419acd6ca | [
"Apache-2.0"
] | 1 | 2021-02-05T06:44:28.000Z | 2021-02-05T06:44:28.000Z | rust/known_shas.bzl | Strum355/rules_rust | 6865219d2ddf7849bd8c98d8dc44715660452bde | [
"Apache-2.0"
] | null | null | null | rust/known_shas.bzl | Strum355/rules_rust | 6865219d2ddf7849bd8c98d8dc44715660452bde | [
"Apache-2.0"
] | 2 | 2020-09-12T19:28:00.000Z | 2020-11-24T02:46:42.000Z | # This is a generated file -- see //util:fetch_shas.sh
FILE_KEY_TO_SHA = {
"2018-10-30/rust-beta-x86_64-apple-darwin": "51acc0077d6abae5beed0e7b99c39ae9b8a0ff0f66daec227caef653046144e6",
"2018-10-30/rust-beta-x86_64-unknown-freebsd": "49f1efe5bf10319446a298096dea73e478a466daca20a5b93d5263925e4ba9be",
"2018-... | 110.768328 | 127 | 0.832945 |
9335704b73071b4c10ee9df72acf651c41955a92 | 1,569 | py | Python | code/draw.py | codio-content/cs-intro-python-fundamentals | 7b59810b6fb98089d3b725a3b898a6403a32c447 | [
"MIT"
] | null | null | null | code/draw.py | codio-content/cs-intro-python-fundamentals | 7b59810b6fb98089d3b725a3b898a6403a32c447 | [
"MIT"
] | null | null | null | code/draw.py | codio-content/cs-intro-python-fundamentals | 7b59810b6fb98089d3b725a3b898a6403a32c447 | [
"MIT"
] | null | null | null | """This module contains a code example related to
Think Python, 2nd Edition
by Allen Downey
http://thinkpython2.com
Copyright 2015 Allen Downey
License: http://creativecommons.org/licenses/by/4.0/
"""
from __future__ import print_function, division
import turtle
from Point1 import Point, Rectangle
... | 18.903614 | 68 | 0.595284 |
93359ab965056666b3c84545d02fdb29db07bad6 | 4,931 | py | Python | tests/test_module.py | alexcrichton/wasmtime-py | 90ba6da0a0c5e8a13bdc28c019330f71067823df | [
"Apache-2.0"
] | 4 | 2020-03-25T20:55:29.000Z | 2020-03-26T08:57:43.000Z | tests/test_module.py | alexcrichton/wasmtime-py | 90ba6da0a0c5e8a13bdc28c019330f71067823df | [
"Apache-2.0"
] | null | null | null | tests/test_module.py | alexcrichton/wasmtime-py | 90ba6da0a0c5e8a13bdc28c019330f71067823df | [
"Apache-2.0"
] | null | null | null | import unittest
from wasmtime import *
class TestModule(unittest.TestCase):
def test_smoke(self):
Module(Store(), '(module)')
Module(Store(), bytes(b'\0asm\x01\0\0\0'))
Module(Store(), bytearray(b'\0asm\x01\0\0\0'))
def test_invalid(self):
with self.assertRaises(TypeError):
... | 36.525926 | 69 | 0.564997 |
93359bfa8d12bbaab67b93d89080c403bc010f1f | 4,178 | py | Python | buttonwood/MarketMetrics/EventListeners/MatchSeriesTracker.py | AgalmicVentures/Buttonwood | f86098cd6d97b4767cbd3428e667b307255ba571 | [
"MIT"
] | 2 | 2020-01-04T05:28:20.000Z | 2021-07-21T21:19:43.000Z | buttonwood/MarketMetrics/EventListeners/MatchSeriesTracker.py | AgalmicVentures/Buttonwood | f86098cd6d97b4767cbd3428e667b307255ba571 | [
"MIT"
] | 45 | 2019-07-04T15:13:34.000Z | 2020-06-30T19:41:45.000Z | buttonwood/MarketMetrics/EventListeners/MatchSeriesTracker.py | AgalmicVentures/Buttonwood | f86098cd6d97b4767cbd3428e667b307255ba571 | [
"MIT"
] | 3 | 2020-04-18T16:49:14.000Z | 2021-07-21T21:19:52.000Z | """
This file is part of Buttonwood.
Buttonwood is a python software package created to help quickly create, (re)build, or
analyze markets, market structures, and market participants.
MIT License
Copyright (c) 2016-2020 Peter F. Nabicht
Permission is hereby granted, free of charge, to any person obtaining a copy
o... | 40.960784 | 119 | 0.719483 |
9335cf93f4ed9bc594d3f95693a826078517cedd | 7,156 | py | Python | Core/Model/ChromeModel/SQLite/history.py | UpBeatMan/Abschlussarbeit | e842df691bbfdf77cd1c41d9de00718166bb4e19 | [
"MIT"
] | null | null | null | Core/Model/ChromeModel/SQLite/history.py | UpBeatMan/Abschlussarbeit | e842df691bbfdf77cd1c41d9de00718166bb4e19 | [
"MIT"
] | 28 | 2021-06-20T17:39:00.000Z | 2021-09-04T15:03:41.000Z | Core/Model/ChromeModel/SQLite/history.py | UpBeatMan/Abschlussarbeit | e842df691bbfdf77cd1c41d9de00718166bb4e19 | [
"MIT"
] | null | null | null | from sqlalchemy import Column, Integer, String, orm, ForeignKey
from sqlalchemy.orm import relationship
from Model.util import log_message, change_file_time
from Model.ChromeModel.SQLite.base import (
BaseSession,
BaseSQLiteClass,
BaseSQliteHandler,
BaseAttribute,
OTHER,
DT_MICRO,
DT_MILLI_... | 34.737864 | 87 | 0.578955 |
9335e92cf939608dfbf01404dc06c858993eecd8 | 5,124 | py | Python | model.py | MehranTaghian/pytorch-soft-actor-critic | 757dd399fa3cdc75207db626d8df34b8a602f130 | [
"MIT"
] | null | null | null | model.py | MehranTaghian/pytorch-soft-actor-critic | 757dd399fa3cdc75207db626d8df34b8a602f130 | [
"MIT"
] | null | null | null | model.py | MehranTaghian/pytorch-soft-actor-critic | 757dd399fa3cdc75207db626d8df34b8a602f130 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
LOG_SIG_MAX = 2
LOG_SIG_MIN = -20
epsilon = 1e-6
# Initialize Policy weights
def weights_init_(m):
if isinstance(m, nn.Linear):
torch.nn.init.xavier_uniform_(m.weight, gain=1)
torch.nn.init.co... | 33.490196 | 84 | 0.62783 |
9336308cedc7b3b7541d97bb6592c7820abc271b | 14,532 | py | Python | src/master.py | kemperlab/Cartan_DMFT | 8bfe06e6f9f3a734302e5aee0c29fc4f475a9264 | [
"BSD-2-Clause-Patent"
] | null | null | null | src/master.py | kemperlab/Cartan_DMFT | 8bfe06e6f9f3a734302e5aee0c29fc4f475a9264 | [
"BSD-2-Clause-Patent"
] | null | null | null | src/master.py | kemperlab/Cartan_DMFT | 8bfe06e6f9f3a734302e5aee0c29fc4f475a9264 | [
"BSD-2-Clause-Patent"
] | null | null | null |
#Master Script to manage DMFT iterations
from numpy.lib.npyio import savez
from Step1 import CreateExperiment
from time import time
from datetime import date
import numpy as np
from Step2 import extractFrequencyHigh, extractFrequencyLow, toHerz, toRad
import os
from numpy import savez
#Essential Parameters
expected_m... | 50.110345 | 287 | 0.599367 |
93364d9bb7bcb79684bd75fbd5c18c7cc1548ed9 | 13,889 | py | Python | tests/CNN/t03c_feature_map_dynamic_face_templates.py | michaelStettler/BVS | 947f1e505ccc3ebcf1926c8f52924d823bd1e101 | [
"Apache-2.0"
] | null | null | null | tests/CNN/t03c_feature_map_dynamic_face_templates.py | michaelStettler/BVS | 947f1e505ccc3ebcf1926c8f52924d823bd1e101 | [
"Apache-2.0"
] | null | null | null | tests/CNN/t03c_feature_map_dynamic_face_templates.py | michaelStettler/BVS | 947f1e505ccc3ebcf1926c8f52924d823bd1e101 | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import tensorflow as tf
from utils.load_config import load_config
from utils.load_data import load_data
from utils.extraction_model import load_extraction_model
from utils.PatternFeatureReduction import PatternFeatureSelection
from plots_utils.plot_cnn_output import plot_cnn_output
from ut... | 47.081356 | 140 | 0.703218 |
93365a082b6836e766eed4de829d2762867498a6 | 21,219 | py | Python | skynet/util/keychain.py | hulatang/skynet-blockchain | d7d6f7ec84731c13b9d6d307bb171cf0e266be82 | [
"Apache-2.0"
] | null | null | null | skynet/util/keychain.py | hulatang/skynet-blockchain | d7d6f7ec84731c13b9d6d307bb171cf0e266be82 | [
"Apache-2.0"
] | null | null | null | skynet/util/keychain.py | hulatang/skynet-blockchain | d7d6f7ec84731c13b9d6d307bb171cf0e266be82 | [
"Apache-2.0"
] | null | null | null | import colorama
import pkg_resources
import sys
import unicodedata
from bitstring import BitArray # pyright: reportMissingImports=false
from blspy import AugSchemeMPL, G1Element, PrivateKey # pyright: reportMissingImports=false
from skynet.util.hash import std_hash
from skynet.util.keyring_wrapper import KeyringWrap... | 36.966899 | 117 | 0.644517 |
93366e857fa2ad4465f72007114e39a8639107e8 | 16,384 | py | Python | PaddleCV/PaddleGAN/trainer/AttGAN.py | yangapku/models | b50bc7b77288bcdaed676e70353310786c658d6e | [
"Apache-2.0"
] | 1 | 2020-02-22T08:29:15.000Z | 2020-02-22T08:29:15.000Z | PaddleCV/PaddleGAN/trainer/AttGAN.py | yangapku/models | b50bc7b77288bcdaed676e70353310786c658d6e | [
"Apache-2.0"
] | null | null | null | PaddleCV/PaddleGAN/trainer/AttGAN.py | yangapku/models | b50bc7b77288bcdaed676e70353310786c658d6e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 42.445596 | 151 | 0.545776 |
933673a047b7fcd7d9f3b595e212274e5f53e438 | 8,771 | py | Python | squaternion/squaternion.py | coolshou/squaternion | 931bcde54ca8c27dc84b3ee92da47bfa451f8b62 | [
"MIT"
] | 7 | 2020-05-12T14:48:50.000Z | 2021-04-04T13:56:30.000Z | squaternion/squaternion.py | coolshou/squaternion | 931bcde54ca8c27dc84b3ee92da47bfa451f8b62 | [
"MIT"
] | 4 | 2020-04-06T06:21:29.000Z | 2021-04-06T14:44:18.000Z | squaternion/squaternion.py | coolshou/squaternion | 931bcde54ca8c27dc84b3ee92da47bfa451f8b62 | [
"MIT"
] | 2 | 2019-11-01T12:51:18.000Z | 2021-05-24T06:56:47.000Z | # -*- coding: utf-8 -*-
##############################################
# The MIT License (MIT)
# Copyright (c) 2014 Kevin Walchko
# see LICENSE for full details
##############################################
from math import sin, cos, atan2, pi, sqrt, asin, acos
# import numpy as np
import attr
from enum import IntFlag... | 30.667832 | 123 | 0.518869 |
9336cf8b34352a718becbdefcfa936294c7dc8b7 | 3,742 | py | Python | app.py | HiLASEPythonCourse/image-lab | 51c46cf47eacb3c6d744dc59dcc115781f84d376 | [
"MIT"
] | null | null | null | app.py | HiLASEPythonCourse/image-lab | 51c46cf47eacb3c6d744dc59dcc115781f84d376 | [
"MIT"
] | null | null | null | app.py | HiLASEPythonCourse/image-lab | 51c46cf47eacb3c6d744dc59dcc115781f84d376 | [
"MIT"
] | null | null | null | import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
import skimage.io
import streamlit as st
from skimage import data, exposure
from skimage.color import label2rgb
from skimage.measure import label, regionprops
from skimage.morphology import closing, square
from skimage.segmentation... | 32.824561 | 103 | 0.685997 |
9336d12316737a0c1b41c98ee9866a19056eaf8a | 4,139 | py | Python | robdollar/robdollar.py | retroam/robdollar | c51191eed204f9c4c71656c2b7f4c12ab8b66180 | [
"MIT"
] | null | null | null | robdollar/robdollar.py | retroam/robdollar | c51191eed204f9c4c71656c2b7f4c12ab8b66180 | [
"MIT"
] | null | null | null | robdollar/robdollar.py | retroam/robdollar | c51191eed204f9c4c71656c2b7f4c12ab8b66180 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Main module."""
import pandas as pd
from sklearn.linear_model import LinearRegression, RandomizedLasso
from sklearn.feature_selection import VarianceThreshold
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import... | 32.849206 | 114 | 0.580817 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.