hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | 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 3 972 | max_forks_repo_name stringlengths 6 130 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6e2612e7972297e3ae5bcd17721ca2c693f4ceb7 | 2,218 | py | Python | pythonProject1/venv/Lib/site-packages/comtypes/test/find_memleak.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | 64 | 2020-07-22T06:24:18.000Z | 2022-03-27T10:48:15.000Z | venv/Lib/site-packages/comtypes/test/find_memleak.py | AsterLaoWhy/Navi | 819e4cc9e70721d65da5979e0c7a6fead9eb9d6e | [
"MIT"
] | 9 | 2021-08-14T01:27:36.000Z | 2021-08-24T18:10:18.000Z | venv/Lib/site-packages/comtypes/test/find_memleak.py | AsterLaoWhy/Navi | 819e4cc9e70721d65da5979e0c7a6fead9eb9d6e | [
"MIT"
] | 17 | 2020-09-14T02:46:41.000Z | 2022-03-01T09:52:33.000Z | import unittest, gc
from ctypes import *
from ctypes.wintypes import *
################################################################
class PROCESS_MEMORY_COUNTERS(Structure):
_fields_ = [("cb", DWORD),
("PageFaultCount", DWORD),
("PeakWorkingSetSize", c_size_t),
... | 35.774194 | 98 | 0.575744 |
a78f479a638999553972ade0e1016c6d7b0ae708 | 1,089 | py | Python | lib/pylint/test/input/func_w0302.py | willemneal/Docky | d3504e1671b4a6557468234c263950bfab461ce4 | [
"MIT"
] | 3 | 2018-11-25T01:09:55.000Z | 2021-08-24T01:56:36.000Z | lib/pylint/test/input/func_w0302.py | willemneal/Docky | d3504e1671b4a6557468234c263950bfab461ce4 | [
"MIT"
] | 7 | 2021-02-08T20:22:15.000Z | 2022-03-11T23:19:41.000Z | lib/pylint/test/input/func_w0302.py | willemneal/Docky | d3504e1671b4a6557468234c263950bfab461ce4 | [
"MIT"
] | 3 | 2018-11-09T03:38:09.000Z | 2020-02-24T06:26:10.000Z | """test too much line in modules
"""
__revision__ = 0
... | 1.070796 | 32 | 0.048669 |
4748d6a9bce02a656cfc2682434fcc0a5b5549b7 | 1,384 | py | Python | venv/Lib/site-packages/nipype/interfaces/fsl/tests/test_auto_AvScale.py | richung99/digitizePlots | 6b408c820660a415a289726e3223e8f558d3e18b | [
"MIT"
] | 585 | 2015-01-12T16:06:47.000Z | 2022-03-26T14:51:08.000Z | nipype/interfaces/fsl/tests/test_auto_AvScale.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 2,329 | 2015-01-01T09:56:41.000Z | 2022-03-30T14:24:49.000Z | nipype/interfaces/fsl/tests/test_auto_AvScale.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 487 | 2015-01-20T01:04:52.000Z | 2022-03-21T21:22:47.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..utils import AvScale
def test_AvScale_inputs():
input_map = dict(
all_param=dict(
argstr="--allparams",
),
args=dict(
argstr="%s",
),
environ=dict(
nohash=True,
used... | 26.113208 | 67 | 0.553468 |
47719fe4d5a50e02e88b058a135b5bb41e6ad8a0 | 8,147 | py | Python | tests/data/test_image.py | ramonemiliani93/torchio | b6ba3d168d5abb021dc19c4c71f7af72229b9cb8 | [
"Apache-2.0"
] | null | null | null | tests/data/test_image.py | ramonemiliani93/torchio | b6ba3d168d5abb021dc19c4c71f7af72229b9cb8 | [
"Apache-2.0"
] | null | null | null | tests/data/test_image.py | ramonemiliani93/torchio | b6ba3d168d5abb021dc19c4c71f7af72229b9cb8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Tests for Image."""
import sys
import copy
import tempfile
import pytest
import torch
import numpy as np
import nibabel as nib
import torchio as tio
from ..utils import TorchioTestCase
class TestImage(TorchioTestCase):
"""Tests for `Image`."""
def test_image_not_found(self):
... | 35.421739 | 79 | 0.619983 |
c3da0f9c7cf98ebbdf9a75db63bda2781da570e6 | 608 | py | Python | sktime/utils/validation/tests/test_forecasting.py | ermshaua/sktime | b6c7153b4b0fbe601ab2308c53a408f07bc435b2 | [
"BSD-3-Clause"
] | 1 | 2019-12-23T16:57:14.000Z | 2019-12-23T16:57:14.000Z | sktime/utils/validation/tests/test_forecasting.py | ermshaua/sktime | b6c7153b4b0fbe601ab2308c53a408f07bc435b2 | [
"BSD-3-Clause"
] | null | null | null | sktime/utils/validation/tests/test_forecasting.py | ermshaua/sktime | b6c7153b4b0fbe601ab2308c53a408f07bc435b2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Test forecasting module."""
__author__ = ["mloning"]
import numpy as np
import pandas as pd
import pytest
from pytest import raises
from sktime.utils.validation.forecasting import check_fh
em... | 26.434783 | 71 | 0.715461 |
10aa150ad946a27d54e8cd5b4a962a312b9bb651 | 19,310 | py | Python | vision/people_counter_client.py | Fasermaler/Quick-Q | 669a918e33ae191aca7de32307553c1ca5b32622 | [
"MIT"
] | 3 | 2019-04-25T07:57:26.000Z | 2019-07-31T01:38:46.000Z | vision/people_counter_client.py | Fasermaler/Quick-Q | 669a918e33ae191aca7de32307553c1ca5b32622 | [
"MIT"
] | null | null | null | vision/people_counter_client.py | Fasermaler/Quick-Q | 669a918e33ae191aca7de32307553c1ca5b32622 | [
"MIT"
] | 1 | 2021-03-23T06:56:28.000Z | 2021-03-23T06:56:28.000Z | # -*- coding: utf-8 -*-
'''
firestore_device_class
Initialise a device that captures an image and sends it to a random request
queue shard at a user-defined interval, with additional parameters.
Copyright 2018 Fasermaler, methylDragon
All rights reserved.
'''
from google.cloud import firestore
from google.au... | 40.313152 | 135 | 0.543086 |
aeb333fdd11668ae875601c6aa8ffec3b08a5ac5 | 3,164 | py | Python | CAP6-Fruitful functions/thinkpythonCAP6.py | falble/mythinkpython2 | 25de15c8657f32a8f85189d9cb0588c816e9e7d3 | [
"Apache-2.0"
] | 1 | 2020-11-20T16:28:32.000Z | 2020-11-20T16:28:32.000Z | CAP6-Fruitful functions/thinkpythonCAP6.py | falble/mythinkpython2 | 25de15c8657f32a8f85189d9cb0588c816e9e7d3 | [
"Apache-2.0"
] | null | null | null | CAP6-Fruitful functions/thinkpythonCAP6.py | falble/mythinkpython2 | 25de15c8657f32a8f85189d9cb0588c816e9e7d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 22 15:41:11 2019
@author: Utente
"""
#Chapter 6 - Fruitful functions
#6.1 Return values
import math
#e = math.exp(1.0)
#radius = 10
#radians = 45.0
#height = radius * math.sin(radians)
def area(radius):
a = math.pi * radius**2
return a
... | 19.899371 | 113 | 0.516751 |
98a176cfb0207eb3d5b33005858f732f21807004 | 17,601 | py | Python | pybaqus/fil_result.py | cristobaltapia/pybaqus | e99d65279a38810dd419feb0ace5fe962da29bba | [
"MIT"
] | null | null | null | pybaqus/fil_result.py | cristobaltapia/pybaqus | e99d65279a38810dd419feb0ace5fe962da29bba | [
"MIT"
] | 1 | 2021-09-05T11:04:54.000Z | 2021-09-05T16:36:07.000Z | pybaqus/fil_result.py | cristobaltapia/pybaqus | e99d65279a38810dd419feb0ace5fe962da29bba | [
"MIT"
] | 2 | 2021-09-05T00:54:19.000Z | 2022-01-05T15:13:02.000Z | """
Class for the Fil results
"""
import re
import numpy as np
from tqdm import tqdm
from .model import Model
from .nodes import Node2D, Node3D
from .elements import ELEMENTS, N_INT_PNTS
class FilParser:
"""
Parse and store the data from a *.fil file.
Parameters
----------
records : list(str)
... | 29.781726 | 93 | 0.527868 |
493fb5f3c615d0a833a1edf46bd1759a499180cc | 1,902 | py | Python | src/compas_rhino/artists/coneartist.py | ricardoavelino/compas | e3c7f004b8839f96bf01f9f6b21a75786c3f59fa | [
"MIT"
] | null | null | null | src/compas_rhino/artists/coneartist.py | ricardoavelino/compas | e3c7f004b8839f96bf01f9f6b21a75786c3f59fa | [
"MIT"
] | null | null | null | src/compas_rhino/artists/coneartist.py | ricardoavelino/compas | e3c7f004b8839f96bf01f9f6b21a75786c3f59fa | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas_rhino
from compas.artists import ShapeArtist
from compas.colors import Color
from .artist import RhinoArtist
class ConeArtist(RhinoArtist, ShapeArtist):
"""Artist for drawing cone shapes.
... | 32.793103 | 107 | 0.575184 |
9ca818fbfe21c0898a6a52b2e4ff64e5882f8db6 | 1,998 | py | Python | openfl/component/aggregation_functions/weighted_average.py | ssg-research/openfl | b60cbfbdad595e653c94cee23fd35add993b94b0 | [
"Apache-2.0"
] | 297 | 2021-01-13T08:49:35.000Z | 2022-03-31T15:06:43.000Z | openfl/component/aggregation_functions/weighted_average.py | ssg-research/openfl | b60cbfbdad595e653c94cee23fd35add993b94b0 | [
"Apache-2.0"
] | 265 | 2021-02-02T09:57:33.000Z | 2022-03-30T22:51:55.000Z | openfl/component/aggregation_functions/weighted_average.py | ssg-research/openfl | b60cbfbdad595e653c94cee23fd35add993b94b0 | [
"Apache-2.0"
] | 81 | 2021-01-18T07:52:36.000Z | 2022-03-26T18:55:54.000Z | # Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Federated averaging module."""
import numpy as np
from .interface import AggregationFunction
def weighted_average(tensors, weights):
"""Compute average."""
return np.average(tensors, weights=weights, axis=0)
class Weight... | 41.625 | 98 | 0.61011 |
102fd7a75a739b8815a75c1c87a0b65137c256d9 | 10,342 | py | Python | gym/envs/board_game/hex.py | jgsonx/gym | 69d1115861d8c98726cbc11ca39df3e1083517e9 | [
"MIT"
] | 1 | 2016-08-23T05:47:18.000Z | 2016-08-23T05:47:18.000Z | gym/envs/board_game/hex.py | Hiroki-Yoshida7/Reinforcement-Learning-Algorithm | 9c066571ac3f9d9922503af24b828aa4e7f26559 | [
"MIT"
] | null | null | null | gym/envs/board_game/hex.py | Hiroki-Yoshida7/Reinforcement-Learning-Algorithm | 9c066571ac3f9d9922503af24b828aa4e7f26559 | [
"MIT"
] | 3 | 2016-06-17T21:14:23.000Z | 2021-02-12T01:24:43.000Z | """
Game of Hex
"""
from six import StringIO
import sys
import gym
from gym import spaces
import numpy as np
from gym import error
def random_policy(state):
possible_moves = HexEnv.get_possible_actions(state)
a = np.random.randint(len(possible_moves))
return possible_moves[a]
class HexEnv(gym.Env):
... | 35.296928 | 107 | 0.480758 |
e2ed38fc8242ffaf4355796e37c71224b932ef28 | 60,939 | py | Python | scripts/geodata/i18n/transliteration_rules.py | digitalknowledge/libpostal | 287cbd14dd8a4a569be55c407c1de612d79901e2 | [
"MIT"
] | 1 | 2020-11-06T07:47:14.000Z | 2020-11-06T07:47:14.000Z | scripts/geodata/i18n/transliteration_rules.py | digitalknowledge/libpostal | 287cbd14dd8a4a569be55c407c1de612d79901e2 | [
"MIT"
] | null | null | null | scripts/geodata/i18n/transliteration_rules.py | digitalknowledge/libpostal | 287cbd14dd8a4a569be55c407c1de612d79901e2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
transliteration.py
Automatically builds rules for transforming other scripts (e.g. Cyrillic, Greek,
Han, Katakana, Devanagari, etc.) into Latin characters.
Uses XML transforms from the CLDR repository.
'''
import argparse
import codecs
import csv
import htmlentitydefs
import itertools
im... | 38.520228 | 7,866 | 0.596432 |
18dbe268f2e22a3c7273e31599c82e02cfc6c5da | 3,006 | py | Python | Clustering/code.py | nagnath001/ga-learner-dsmp-repo | 7035fd2ebe967182a44011dde59cb8ae411badb6 | [
"MIT"
] | null | null | null | Clustering/code.py | nagnath001/ga-learner-dsmp-repo | 7035fd2ebe967182a44011dde59cb8ae411badb6 | [
"MIT"
] | null | null | null | Clustering/code.py | nagnath001/ga-learner-dsmp-repo | 7035fd2ebe967182a44011dde59cb8ae411badb6 | [
"MIT"
] | null | null | null | # --------------
# import packages
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# Load Offers
offers=pd.read_excel(path, sheet_name=0)
# Load Transactions
transactions=pd.read_excel(path, sheet_name=1)
transactions['n']=1
# Merge dataframes
df=pd.merge(offers,transactio... | 23.302326 | 85 | 0.700266 |
0d1d62972b6ef09bac2c58a9b32803d50edcdcec | 3,548 | py | Python | asdf/tags/core/integer.py | eteq/asdf | 6d9e0e48bbffea166a19b71e29f5f9c211983bfe | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | asdf/tags/core/integer.py | eteq/asdf | 6d9e0e48bbffea166a19b71e29f5f9c211983bfe | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | asdf/tags/core/integer.py | eteq/asdf | 6d9e0e48bbffea166a19b71e29f5f9c211983bfe | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from numbers import Integral
import numpy as np
from ...asdftypes import AsdfType
from ...yamlutil import custom_tree_to_tagged_tree
class IntegerType(AsdfType):
"""
Enables the storage of arbitrarily large integer valu... | 29.081967 | 83 | 0.598929 |
89e89ced98c077d7abecbea5f381b4471eb0db3a | 10,647 | py | Python | mmaction/apis/train.py | kiyoon/Video-Swin-Transformer | 7a0d40ced8fb52c064d1cd11ffa8b0c3bbb77607 | [
"Apache-2.0"
] | 648 | 2021-06-24T19:33:09.000Z | 2022-03-31T06:27:24.000Z | mmaction/apis/train.py | kiyoon/Video-Swin-Transformer | 7a0d40ced8fb52c064d1cd11ffa8b0c3bbb77607 | [
"Apache-2.0"
] | 53 | 2021-07-01T03:07:52.000Z | 2022-03-27T16:15:29.000Z | mmaction/apis/train.py | kiyoon/Video-Swin-Transformer | 7a0d40ced8fb52c064d1cd11ffa8b0c3bbb77607 | [
"Apache-2.0"
] | 117 | 2021-06-25T01:22:32.000Z | 2022-03-31T08:33:55.000Z | import copy as cp
import os.path as osp
import torch
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (DistSamplerSeedHook, EpochBasedRunner, OptimizerHook,
build_optimizer, get_dist_info)
from mmcv.runner.hooks import Fp16OptimizerHook
from ..core i... | 40.637405 | 107 | 0.596224 |
b897ae4bd5b7deeda06b07e34600340b940fab2f | 68,194 | py | Python | BaseTools/Source/Python/AutoGen/GenMake.py | James992927108/uEFI_Edk2_Practice | 2cac7618dfee10bfa5104a2e167c85425fde0100 | [
"BSD-2-Clause"
] | 6 | 2020-01-10T05:16:15.000Z | 2022-01-06T17:41:58.000Z | BaseTools/Source/Python/AutoGen/GenMake.py | James992927108/uEFI_Edk2_Practice | 2cac7618dfee10bfa5104a2e167c85425fde0100 | [
"BSD-2-Clause"
] | null | null | null | BaseTools/Source/Python/AutoGen/GenMake.py | James992927108/uEFI_Edk2_Practice | 2cac7618dfee10bfa5104a2e167c85425fde0100 | [
"BSD-2-Clause"
] | 3 | 2018-04-21T07:59:33.000Z | 2018-04-23T02:06:01.000Z | ## @file
# Create makefile for MS nmake and GNU make
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the l... | 41.862492 | 340 | 0.582896 |
72da325ddb2da3cd6caf7eac906c0b43b5ae4100 | 22,425 | py | Python | tests/python/unittest/test_io.py | pioy/incubator-mxnet | 9d432079f489327ec6daab61326a3e4f3c7cb8b3 | [
"Apache-2.0"
] | 211 | 2016-06-06T08:32:36.000Z | 2021-07-03T16:50:16.000Z | tests/python/unittest/test_io.py | pioy/incubator-mxnet | 9d432079f489327ec6daab61326a3e4f3c7cb8b3 | [
"Apache-2.0"
] | 42 | 2017-01-05T02:45:13.000Z | 2020-08-11T23:45:27.000Z | tests/python/unittest/test_io.py | pioy/incubator-mxnet | 9d432079f489327ec6daab61326a3e4f3c7cb8b3 | [
"Apache-2.0"
] | 58 | 2016-10-27T07:37:08.000Z | 2021-07-03T16:50:17.000Z | # 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, Version 2.0 (the
# "License"); you may not u... | 39 | 120 | 0.61311 |
a64015fbdf4412c8ca8eb12f02071b2cafbbdabf | 5,204 | py | Python | riko/modules/count.py | SpyHello/riko-py-stream | b52e35f3883596a8eac5b2d5be86dcc766dd0a88 | [
"MIT"
] | null | null | null | riko/modules/count.py | SpyHello/riko-py-stream | b52e35f3883596a8eac5b2d5be86dcc766dd0a88 | [
"MIT"
] | null | null | null | riko/modules/count.py | SpyHello/riko-py-stream | b52e35f3883596a8eac5b2d5be86dcc766dd0a88 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
riko.modules.count
~~~~~~~~~~~~~~~~~~
Provides functions for counting the number of items in a stream.
Examples:
basic usage::
>>> from riko.modules.count import pipe
>>>
>>> next(pipe({'x': x} for x in range(5))) == {'count': 5}
... | 31.539394 | 80 | 0.578593 |
997b0826f802f015598222652a5563d276a01f8e | 2,651 | py | Python | elephas/parameter/client.py | anamf/elephas | 0790443dae937492111b91d7461e90d57e4f4140 | [
"MIT"
] | null | null | null | elephas/parameter/client.py | anamf/elephas | 0790443dae937492111b91d7461e90d57e4f4140 | [
"MIT"
] | null | null | null | elephas/parameter/client.py | anamf/elephas | 0790443dae937492111b91d7461e90d57e4f4140 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import abc
import numpy as np
import socket
import six.moves.cPickle as pickle
try:
import urllib.request as urllib2
except ImportError:
import urllib2
from ..utils.sockets import determine_master, send, receive
class BaseParameter... | 31.559524 | 81 | 0.68427 |
1b94e0a78fd21044d5be72717c97e30b040acc36 | 1,366 | py | Python | lk21/extractors/nekopoi.py | UserLazy/lk21 | 5aa4cec0970b1e0b4a14c0086cdf6ed0eebc1be1 | [
"MIT"
] | 2 | 2021-07-10T09:31:15.000Z | 2021-07-11T14:40:03.000Z | lk21/extractors/nekopoi.py | UserLazy/lk21 | 5aa4cec0970b1e0b4a14c0086cdf6ed0eebc1be1 | [
"MIT"
] | null | null | null | lk21/extractors/nekopoi.py | UserLazy/lk21 | 5aa4cec0970b1e0b4a14c0086cdf6ed0eebc1be1 | [
"MIT"
] | null | null | null | from . import BaseExtractor
class Nekopoi(BaseExtractor):
tag = "anime"
host = "https://nekopoi.care"
required = ["proxy"]
def extract_meta(self, id: str) -> dict:
"""
Ambil semua metadata dari halaman web
Args:
id: type 'str'
"""
raw = self.ses... | 23.964912 | 60 | 0.498536 |
a84df1a1b8bccf1d86b92ec2ddb3a64a6fa603eb | 134 | py | Python | auto-insert/python-header.py | ianwahbe/EmacsInit | 81af0d3f3c363aa29a6ee911759fa91cdf191967 | [
"MIT"
] | 1 | 2020-11-27T16:37:44.000Z | 2020-11-27T16:37:44.000Z | auto-insert/python-header.py | ianwahbe/EmacsInit | 81af0d3f3c363aa29a6ee911759fa91cdf191967 | [
"MIT"
] | null | null | null | auto-insert/python-header.py | ianwahbe/EmacsInit | 81af0d3f3c363aa29a6ee911759fa91cdf191967 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- codeing: utf-8 -*-
"""
Created on `(format-time-string "%B %d %y")`
Author github/twitter @iwahbe
"""
$0
| 16.75 | 44 | 0.604478 |
e24e3c6d49d723ac6315e584250868345247d859 | 480 | py | Python | sits.py | volodia-web/web-app | cb84bfd2f5e8f243f31f41b7bdfb34b04b62fb2f | [
"CC0-1.0"
] | null | null | null | sits.py | volodia-web/web-app | cb84bfd2f5e8f243f31f41b7bdfb34b04b62fb2f | [
"CC0-1.0"
] | 2 | 2021-04-23T16:31:14.000Z | 2021-04-23T16:36:45.000Z | sits.py | volodia-web/web-app | cb84bfd2f5e8f243f31f41b7bdfb34b04b62fb2f | [
"CC0-1.0"
] | 3 | 2021-04-23T16:17:45.000Z | 2021-04-23T16:22:15.000Z | from scrollLabel import ScrollLabel
class Sits(ScrollLabel):
def __init__(self, total, **kwargs):
self.current = 0
self.total = total
text = "Осталось приседаний: [b]" + str(self.total) + "[/b]"
super().__init__(text, **kwargs)
def next(self, *args):
self.cu... | 34.285714 | 69 | 0.5625 |
3c94a4da38b1e081f98da5b980298a89b392921c | 503 | py | Python | plotly/validators/histogram/marker/colorbar/_bgcolor.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/histogram/marker/colorbar/_bgcolor.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/histogram/marker/colorbar/_bgcolor.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class BgcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name='bgcolor',
parent_name='histogram.marker.colorbar',
**kwargs
):
super(BgcolorValidator, self).__init__(
plotly_name=plot... | 26.473684 | 68 | 0.614314 |
2373e99a6bd489708e7cb67f900659e6e85c0e19 | 3,436 | py | Python | examples/barycenters/plot_barycenter_1D.py | Pseudomanifold/POT | 5861209f27fe8e022eca2ed2c8d0bb1da4a1146b | [
"MIT"
] | 830 | 2020-04-21T03:45:02.000Z | 2022-03-31T18:27:08.000Z | examples/barycenters/plot_barycenter_1D.py | Pseudomanifold/POT | 5861209f27fe8e022eca2ed2c8d0bb1da4a1146b | [
"MIT"
] | 192 | 2020-04-17T10:15:37.000Z | 2022-03-24T10:00:57.000Z | examples/barycenters/plot_barycenter_1D.py | Pseudomanifold/POT | 5861209f27fe8e022eca2ed2c8d0bb1da4a1146b | [
"MIT"
] | 402 | 2020-04-17T18:24:00.000Z | 2022-03-29T18:26:33.000Z | # -*- coding: utf-8 -*-
"""
==============================
1D Wasserstein barycenter demo
==============================
This example illustrates the computation of regularized Wassersyein Barycenter
as proposed in [3].
[3] Benamou, J. D., Carlier, G., Cuturi, M., Nenna, L., & Peyré, G. (2015).
Iterative Bregman pro... | 23.534247 | 78 | 0.621944 |
7bfb92319a4684182fe50d1c16781f78e32c9b68 | 10,241 | py | Python | contrib/stack/topsStack/s1a_isce_utils.py | yjzhenglamarmota/isce2 | da0ad8877149890d717bbd3278f1bc1f1fdd59a3 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | contrib/stack/topsStack/s1a_isce_utils.py | yjzhenglamarmota/isce2 | da0ad8877149890d717bbd3278f1bc1f1fdd59a3 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | contrib/stack/topsStack/s1a_isce_utils.py | yjzhenglamarmota/isce2 | da0ad8877149890d717bbd3278f1bc1f1fdd59a3 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from coregSwathSLCProduct import coregSwathSLCProduct
import isce
import isceobj
import os
#from isceobj.Sensor.TOPS.coregSwathSLCProduct import coregSwathSLCProduct
class catalog(object):
def __init__(self):
pass
def addItem(self,*args):
print(' '.join([str(x) for x in args]))
def loadProd... | 36.706093 | 137 | 0.680305 |
b06e7a2627b40fcdafb524b4ea3e7bb06e3433a5 | 3,106 | py | Python | opencc_tray/main.py | elleryq/opencc-tray | d77222ad62f97e9df4d32b61c0155f5ebea398be | [
"MIT"
] | null | null | null | opencc_tray/main.py | elleryq/opencc-tray | d77222ad62f97e9df4d32b61c0155f5ebea398be | [
"MIT"
] | null | null | null | opencc_tray/main.py | elleryq/opencc-tray | d77222ad62f97e9df4d32b61c0155f5ebea398be | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import logging
import signal
import subprocess
from functools import partial
from PyQt5 import QtGui
from PyQt5.QtCore import Qt, QProcess
from PyQt5.QtWidgets import (
QWidget, QSystemTrayIcon, QMenu, QApplication, QMessageBox)
from PyQt5.QtCore i... | 27.732143 | 76 | 0.610109 |
9f8474c1bf1d55604771b4fb57c7f612d4867466 | 10,698 | py | Python | scikit_posthocs/_outliers.py | huidongchen/scikit-posthocs | dca4cbf83b7bd96fe2f4c129d6fd463e94a33246 | [
"BSD-3-Clause"
] | null | null | null | scikit_posthocs/_outliers.py | huidongchen/scikit-posthocs | dca4cbf83b7bd96fe2f4c129d6fd463e94a33246 | [
"BSD-3-Clause"
] | null | null | null | scikit_posthocs/_outliers.py | huidongchen/scikit-posthocs | dca4cbf83b7bd96fe2f4c129d6fd463e94a33246 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from scipy.stats import t
def outliers_iqr(x, return_='filtered', coef = 1.5):
"""
Simple detection of potential outliers based on interquartile range (IQR).
Data that lie within the lower and upper limits are considered
non-outliers. The lower limit is the... | 33.53605 | 343 | 0.546364 |
f377c789377ea47012c5e1727011caa362a75471 | 218 | py | Python | habitat/version.py | srama2512/habitat-api | bc85d0961cef3b4a08bc9263869606109fb6ff0a | [
"MIT"
] | 489 | 2019-02-21T21:47:40.000Z | 2020-08-10T06:43:24.000Z | habitat/version.py | srama2512/habitat-api | bc85d0961cef3b4a08bc9263869606109fb6ff0a | [
"MIT"
] | 380 | 2019-02-26T00:50:48.000Z | 2020-08-11T14:57:07.000Z | habitat/version.py | srama2512/habitat-api | bc85d0961cef3b4a08bc9263869606109fb6ff0a | [
"MIT"
] | 167 | 2019-02-26T00:38:30.000Z | 2020-08-09T23:07:10.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
VERSION = "0.2.1"
| 27.25 | 65 | 0.733945 |
3bfd05b40711c68fc05c3682351fe1b2c47f8ad0 | 4,181 | py | Python | examples/seq2seq/paraphrasing/train.py | liorshk/simpletransformers | 226cf4d11edf5157c1beafcc44aaa78f65ccc985 | [
"Apache-2.0"
] | 3,151 | 2019-10-05T11:14:44.000Z | 2022-03-31T17:02:54.000Z | examples/seq2seq/paraphrasing/train.py | liorshk/simpletransformers | 226cf4d11edf5157c1beafcc44aaa78f65ccc985 | [
"Apache-2.0"
] | 1,165 | 2019-10-05T14:48:55.000Z | 2022-03-31T11:12:58.000Z | examples/seq2seq/paraphrasing/train.py | liorshk/simpletransformers | 226cf4d11edf5157c1beafcc44aaa78f65ccc985 | [
"Apache-2.0"
] | 739 | 2019-10-06T15:11:54.000Z | 2022-03-28T11:07:36.000Z | import os
from datetime import datetime
import logging
import pandas as pd
from sklearn.model_selection import train_test_split
from simpletransformers.seq2seq import Seq2SeqModel, Seq2SeqArgs
from utils import load_data, clean_unnecessary_spaces
logging.basicConfig(level=logging.INFO)
transformers_logger = logging... | 29.034722 | 96 | 0.727816 |
6eddf97225ee5def66dbfdd039b21cbf644a41ea | 5,039 | py | Python | tests/test_template.py | oazmon/sceptre-migration-tool | 9727cf69297c28bc59fa0217edec914d2b69e702 | [
"Apache-2.0"
] | 1 | 2018-06-10T15:43:01.000Z | 2018-06-10T15:43:01.000Z | tests/test_template.py | oazmon/sceptre-migration-tool | 9727cf69297c28bc59fa0217edec914d2b69e702 | [
"Apache-2.0"
] | null | null | null | tests/test_template.py | oazmon/sceptre-migration-tool | 9727cf69297c28bc59fa0217edec914d2b69e702 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import pytest
from mock import patch, Mock
from sceptre.connection_manager import ConnectionManager
from sceptre.exceptions import UnsupportedTemplateFileTypeError
from sceptre_migration_tool import template
from sceptre_migration_tool.exceptions import ImportFailureError
from sc... | 34.993056 | 79 | 0.669577 |
b667490264c3d94070025d129b02c929cdbe8b4f | 2,457 | py | Python | yardstick/benchmark/scenarios/lib/create_volume.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 28 | 2017-02-07T07:46:42.000Z | 2021-06-30T08:11:06.000Z | yardstick/benchmark/scenarios/lib/create_volume.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 6 | 2018-01-18T08:00:54.000Z | 2019-04-11T04:51:41.000Z | yardstick/benchmark/scenarios/lib/create_volume.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 46 | 2016-12-13T10:05:47.000Z | 2021-02-18T07:33:06.000Z | ##############################################################################
# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, ... | 34.125 | 79 | 0.614164 |
497dd92d428ca06cfa89aa0c0a1664a2c3a73ba9 | 5,160 | py | Python | spider/pubtator.py | cskyan/bionlp | 1ff6d6d856bbe8f899eabd19f992f0c960cbc0ae | [
"Apache-2.0"
] | 10 | 2017-06-13T08:51:35.000Z | 2020-11-12T17:14:34.000Z | spider/pubtator.py | cskyan/bionlp | 1ff6d6d856bbe8f899eabd19f992f0c960cbc0ae | [
"Apache-2.0"
] | 1 | 2017-11-17T04:08:02.000Z | 2019-06-27T17:51:54.000Z | spider/pubtator.py | cskyan/bionlp | 1ff6d6d856bbe8f899eabd19f992f0c960cbc0ae | [
"Apache-2.0"
] | 3 | 2017-12-30T14:17:48.000Z | 2020-03-27T02:44:13.000Z | #!/usr/bin/env python
# -*- coding=utf-8 -*-
###########################################################################
# Copyright (C) 2013-2019 by Caspar. All rights reserved.
# File Name: pubtator.py
# Author: Shankai Yan
# E-mail: sk.yan@my.cityu.edu.hk
# Created Time: 2019-01-18 19:34:28
#########################... | 43 | 171 | 0.668217 |
4468295428572484d0a78619a86ed9b74c6d707c | 3,668 | py | Python | jobbing/controllers/services_provided_controller.py | davidall-amdocs/jobbing | b13311da07606366dfbe2eb737483a5820038557 | [
"Apache-2.0"
] | null | null | null | jobbing/controllers/services_provided_controller.py | davidall-amdocs/jobbing | b13311da07606366dfbe2eb737483a5820038557 | [
"Apache-2.0"
] | 1 | 2021-06-10T03:34:07.000Z | 2021-06-10T03:34:07.000Z | jobbing/controllers/services_provided_controller.py | davidall-amdocs/jobbing | b13311da07606366dfbe2eb737483a5820038557 | [
"Apache-2.0"
] | 1 | 2022-02-14T15:51:01.000Z | 2022-02-14T15:51:01.000Z | from flask import abort, Response
import connexion
from jobbing.db import db
from jobbing.DBModels import ServiceProvided as DBServiceProvided
from jobbing.models.service_provided import ServiceProvided # noqa: E501
from jobbing.login import token_required
@token_required
def get_service_provided_by_client_id(clien... | 28.88189 | 95 | 0.664395 |
a640efd2bc8c7052e46cc6063acc60dfdc47330e | 434 | py | Python | drfpasswordless/sms.py | Ishma59/django-rest-framework-passwordless | f96456afa08456ab79de651a342bf83924dbcc1a | [
"MIT"
] | null | null | null | drfpasswordless/sms.py | Ishma59/django-rest-framework-passwordless | f96456afa08456ab79de651a342bf83924dbcc1a | [
"MIT"
] | null | null | null | drfpasswordless/sms.py | Ishma59/django-rest-framework-passwordless | f96456afa08456ab79de651a342bf83924dbcc1a | [
"MIT"
] | null | null | null | import africastalking
from django.conf import settings
class Sms:
def __init__(self):
africastalking.initialize(settings.SMS_USERNAME, settings.SMS_API_KEY)
self.sms = africastalking.SMS
def send_sms(self, message, recipient):
response = self.sms.send(message, ("+" + str(recipient)).split())
... | 27.125 | 75 | 0.698157 |
1b68c7b8ba709830d6d91c243c1ea1938316af2f | 57,951 | py | Python | deploy/virenv/lib/python2.7/site-packages/sphinx/ext/autodoc.py | wangvictor2012/liuwei | 0a06f8fd56d78162f81f1e7e7def7bfdeb4472e1 | [
"BSD-3-Clause"
] | null | null | null | deploy/virenv/lib/python2.7/site-packages/sphinx/ext/autodoc.py | wangvictor2012/liuwei | 0a06f8fd56d78162f81f1e7e7def7bfdeb4472e1 | [
"BSD-3-Clause"
] | null | null | null | deploy/virenv/lib/python2.7/site-packages/sphinx/ext/autodoc.py | wangvictor2012/liuwei | 0a06f8fd56d78162f81f1e7e7def7bfdeb4472e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sphinx.ext.autodoc
~~~~~~~~~~~~~~~~~~
Automatically insert docstrings for functions, classes or whole modules into
the doctree, thus avoiding duplication between docstrings and documentation
for those who like elaborate docstrings.
:copyright: Copyright 2007-2014 by... | 39.422449 | 84 | 0.602544 |
2c769f08a88c97a3200b1295ab8dbbf24071f5cd | 23,021 | py | Python | raspioiseauxTk.py | Sebastien-Fr/Python-Pymodbus-Slave | 8e3869dc3afb1a058c3085401b631cac9dbc56ce | [
"MIT"
] | null | null | null | raspioiseauxTk.py | Sebastien-Fr/Python-Pymodbus-Slave | 8e3869dc3afb1a058c3085401b631cac9dbc56ce | [
"MIT"
] | null | null | null | raspioiseauxTk.py | Sebastien-Fr/Python-Pymodbus-Slave | 8e3869dc3afb1a058c3085401b631cac9dbc56ce | [
"MIT"
] | null | null | null | from pymodbus.server.asynchronous import StartTcpServer
from pymodbus.datastore import ModbusSequentialDataBlock
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext
from twisted.internet.task import LoopingCall
import RPi.GPIO as GPIO
import threading
import time
from datetime import timedelta
from ... | 37.677578 | 145 | 0.463924 |
7665ce5e586ffd9be935f3fa4825c23f571b74a4 | 1,027 | py | Python | src/user/route.py | wuttinanhi/flask-simple-auth | 03755791cb7ef9e16c928741cbe4b3fbc2e65be5 | [
"MIT"
] | null | null | null | src/user/route.py | wuttinanhi/flask-simple-auth | 03755791cb7ef9e16c928741cbe4b3fbc2e65be5 | [
"MIT"
] | null | null | null | src/user/route.py | wuttinanhi/flask-simple-auth | 03755791cb7ef9e16c928741cbe4b3fbc2e65be5 | [
"MIT"
] | null | null | null | """
user route
"""
from flask import Blueprint, render_template
from src.exception import UserAlreadyExistsException
from src.decorator.logged_in_decorator import logged_in
from src.security.service import SecurityService
from src.exception.user_not_found import UserNotFoundException
user_blueprint = Blueprint("us... | 33.129032 | 96 | 0.795521 |
4124850fae4ea9cfe99ce1305592d74127e98ca4 | 138 | py | Python | hc2002/transform.py | biochimia/hc2000 | ec12df0326f368dde424bab861fc8fd1c673c010 | [
"Apache-2.0"
] | null | null | null | hc2002/transform.py | biochimia/hc2000 | ec12df0326f368dde424bab861fc8fd1c673c010 | [
"Apache-2.0"
] | null | null | null | hc2002/transform.py | biochimia/hc2000 | ec12df0326f368dde424bab861fc8fd1c673c010 | [
"Apache-2.0"
] | null | null | null | import re
def match(pattern):
regex = re.compile(pattern)
def _match(value):
return regex.match(value)
return _match
| 17.25 | 33 | 0.65942 |
4b3e73d33bacff8c1102e75abad8d17b8c40130d | 3,186 | py | Python | geosoft/gxapi/GXVVEXP.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 25 | 2017-07-14T06:39:37.000Z | 2022-03-09T21:39:51.000Z | geosoft/gxapi/GXVVEXP.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 100 | 2016-12-13T17:30:41.000Z | 2021-08-01T20:21:13.000Z | geosoft/gxapi/GXVVEXP.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 28 | 2016-12-12T17:34:40.000Z | 2022-03-16T15:39:39.000Z | ### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the code in this block
### end... | 26.55 | 143 | 0.624922 |
74ffdd57a7898399812daa1f289b2021e067de2f | 2,700 | py | Python | akanda/neutron/plugins/ml2_neutron_plugin.py | markmcclain/akanda-quantum | 14b0f523cb26990f09a5a26aa8ed7c299c753013 | [
"Apache-2.0"
] | null | null | null | akanda/neutron/plugins/ml2_neutron_plugin.py | markmcclain/akanda-quantum | 14b0f523cb26990f09a5a26aa8ed7c299c753013 | [
"Apache-2.0"
] | null | null | null | akanda/neutron/plugins/ml2_neutron_plugin.py | markmcclain/akanda-quantum | 14b0f523cb26990f09a5a26aa8ed7c299c753013 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, 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 applicabl... | 35.064935 | 75 | 0.714074 |
5338e7f32b563482daf30f3eb5de66f2e4c8fef0 | 2,152 | py | Python | fxthis/webdriver.py | brunocrocomo/fxthis | 30f6ef43a9ac1cd0b886061349c677caafcb21f0 | [
"MIT"
] | 2 | 2022-01-26T17:54:35.000Z | 2022-01-27T01:18:25.000Z | fxthis/webdriver.py | brunocrocomo/fxthis | 30f6ef43a9ac1cd0b886061349c677caafcb21f0 | [
"MIT"
] | null | null | null | fxthis/webdriver.py | brunocrocomo/fxthis | 30f6ef43a9ac1cd0b886061349c677caafcb21f0 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException, NoSuchElemen... | 33.107692 | 86 | 0.70539 |
21f72c733c730c2b34e9fda7154dcb712596ced0 | 2,217 | py | Python | tests/test_75_jinja2_for_see_seealso.py | KaKkouo/kana_text | 8b6a505be94225c10269f527b35ec821cdafe058 | [
"BSD-2-Clause"
] | 1 | 2021-10-02T02:43:21.000Z | 2021-10-02T02:43:21.000Z | tests/test_75_jinja2_for_see_seealso.py | KaKkouo/kana_text | 8b6a505be94225c10269f527b35ec821cdafe058 | [
"BSD-2-Clause"
] | 13 | 2021-11-01T13:27:25.000Z | 2022-03-01T18:51:35.000Z | tests/test_75_jinja2_for_see_seealso.py | KaKkouo/kana_text | 8b6a505be94225c10269f527b35ec821cdafe058 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3.8
import sys
import unittest
from pprint import pprint
from jinja2 import Template
sys.path.append('sphinxcontrib')
from src import ExtIndexRack as IndexRack
from . import util
#-------------------------------------------------------------------
#kana_text_word_listの上書き
testcase01in = {
'doc01': [... | 31.225352 | 68 | 0.617501 |
7afdf9acef719e9a45fed82650bf076bff7b77bc | 1,509 | py | Python | app/core/models.py | BAChapin/recipe-app-api | c007c7879c6a143a1fb2dda38ffabf824eee39aa | [
"MIT"
] | null | null | null | app/core/models.py | BAChapin/recipe-app-api | c007c7879c6a143a1fb2dda38ffabf824eee39aa | [
"MIT"
] | null | null | null | app/core/models.py | BAChapin/recipe-app-api | c007c7879c6a143a1fb2dda38ffabf824eee39aa | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Creates and... | 29.588235 | 76 | 0.665341 |
22ea84b28dd694e6b3d0418f196075f89bbcb5c1 | 7,185 | py | Python | ForgeEvo.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | null | null | null | ForgeEvo.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | null | null | null | ForgeEvo.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | null | null | null | import os
import json
import pickle
import sys
from pdb import set_trace as TT
# My favorite debugging macro
import re
import ray
import torch
if torch.cuda.is_available():
torch.cuda.init()
from fire import Fire
from ray import rllib
import projekt
from evolution.evolver import init_evolver
from projekt import rl... | 33.891509 | 177 | 0.682116 |
139debef4aacdd16470755c2d859b549f9163597 | 7,488 | py | Python | tests/test_pipeline/test_base.py | jianzhnie/AutoTabular | fb407300adf97532a26d33f7442d2a606fa30512 | [
"Apache-2.0"
] | 48 | 2021-09-06T08:09:26.000Z | 2022-03-28T13:02:54.000Z | tests/test_pipeline/test_base.py | Fanxingye/Autotabular | d630c78290a52f8c73885afb16884e18135c34f6 | [
"Apache-2.0"
] | null | null | null | tests/test_pipeline/test_base.py | Fanxingye/Autotabular | d630c78290a52f8c73885afb16884e18135c34f6 | [
"Apache-2.0"
] | 7 | 2021-09-23T07:28:46.000Z | 2021-10-02T21:15:18.000Z | import unittest
import unittest.mock
import autotabular.pipeline.base
import autotabular.pipeline.components.base
import autotabular.pipeline.components.classification
import autotabular.pipeline.components.feature_preprocessing
import ConfigSpace.configuration_space
class BasePipelineMock(autotabular.pipeline.base.... | 44.047059 | 87 | 0.606704 |
94fc3582579ef1b68a3b6cca4d2e85fa805ca292 | 1,309 | py | Python | award/tests.py | Ianadika44/An-Awwwards | 140ac9633afc28187f750bc716075d8ed79f13ef | [
"Unlicense"
] | null | null | null | award/tests.py | Ianadika44/An-Awwwards | 140ac9633afc28187f750bc716075d8ed79f13ef | [
"Unlicense"
] | 1 | 2021-09-08T02:08:35.000Z | 2021-09-08T02:08:35.000Z | award/tests.py | Ianadika44/An-Awwwards | 140ac9633afc28187f750bc716075d8ed79f13ef | [
"Unlicense"
] | null | null | null | from django.test import TestCase
from .models import User, Post
# Create your tests here.
class UserTestClass(TestCase):
# Set up method
def setUp(self):
self.james = User(first_name='James', last_name='Muriuki',
email='james@moringaschool.com')
# Testing instance... | 27.270833 | 98 | 0.624141 |
2d2846a4fd914975e45241939db2d7b08542704e | 9,265 | py | Python | tests/system/presenter/test_get_user_related_models.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | tests/system/presenter/test_get_user_related_models.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | tests/system/presenter/test_get_user_related_models.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | from openslides_backend.permissions.management_levels import (
CommitteeManagementLevel,
OrganizationManagementLevel,
)
from openslides_backend.permissions.permissions import Permissions
from .base import BasePresenterTestCase
class TestGetUserRelatedModels(BasePresenterTestCase):
def test_get_user_relat... | 38.76569 | 97 | 0.468969 |
f3ff1da0d92ae06256e5819a121ce83c0e3f25f1 | 3,680 | py | Python | xw_mcts/wandb/run-20200707_225058-yiwxkhit/code/xw_mcts/main_bpp.py | Wang-Xiaoyang/alpha-zero-general | d3d25f2b21c46b8b313dbca3fe08812663421329 | [
"MIT"
] | null | null | null | xw_mcts/wandb/run-20200707_225058-yiwxkhit/code/xw_mcts/main_bpp.py | Wang-Xiaoyang/alpha-zero-general | d3d25f2b21c46b8b313dbca3fe08812663421329 | [
"MIT"
] | null | null | null | xw_mcts/wandb/run-20200707_225058-yiwxkhit/code/xw_mcts/main_bpp.py | Wang-Xiaoyang/alpha-zero-general | d3d25f2b21c46b8b313dbca3fe08812663421329 | [
"MIT"
] | null | null | null | import logging
import coloredlogs
from CoachBPP import CoachBPP as Coach
from binpacking.BinPackingGame import BinPackingGame as Game
from binpacking.BinPackingGame import ItemsGenerator as Generator
from binpacking.pytorch.NNet import NNetWrapper as nn
from utils import *
import torch
import wandb
wandb.init(enti... | 35.047619 | 150 | 0.713859 |
d87bfa91210c11f3f0a96a0a42af5135bb1db129 | 3,601 | py | Python | rorapi/management/commands/convertgrid.py | jjshoe/ror-api | 8bcd1afcabe76094b69787eb1990b4b19ee94dd7 | [
"MIT"
] | null | null | null | rorapi/management/commands/convertgrid.py | jjshoe/ror-api | 8bcd1afcabe76094b69787eb1990b4b19ee94dd7 | [
"MIT"
] | null | null | null | rorapi/management/commands/convertgrid.py | jjshoe/ror-api | 8bcd1afcabe76094b69787eb1990b4b19ee94dd7 | [
"MIT"
] | null | null | null | import base32_crockford
import json
import os.path
import random
import zipfile
from rorapi.settings import ES, ES_VARS, ROR_API, GRID, ROR_DUMP
from django.core.management.base import BaseCommand
def generate_ror_id():
"""Generates random ROR ID.
The checksum calculation is copied from
https://github.c... | 31.587719 | 79 | 0.572063 |
5122baa57d68ff6b4144d63c16f7cd24ca235cb8 | 2,577 | py | Python | plugins/commands.py | SeriesZone101/Auto-Filter-V2-SZ | 250aef430434f06f5f0ccbe6f86e701b3996befc | [
"MIT"
] | null | null | null | plugins/commands.py | SeriesZone101/Auto-Filter-V2-SZ | 250aef430434f06f5f0ccbe6f86e701b3996befc | [
"MIT"
] | null | null | null | plugins/commands.py | SeriesZone101/Auto-Filter-V2-SZ | 250aef430434f06f5f0ccbe6f86e701b3996befc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @trojanzhex
from pyrogram import Client, filters
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from script import script
@Client.on_message(filters.command(["start"]) & filters.private)
async def start(client, message):
try:
await ... | 32.620253 | 85 | 0.50097 |
8531147df5639ca77e65f2d15115df2fa4267a52 | 963 | py | Python | qiskit_runtime/qka/__init__.py | LucyXing/qiskit-runtime | 4b62470e960043acbd8bc4bddd8b2d4262cb17dd | [
"Apache-2.0"
] | 49 | 2021-05-11T18:54:25.000Z | 2022-02-11T12:17:05.000Z | qiskit_runtime/qka/__init__.py | LucyXing/qiskit-runtime | 4b62470e960043acbd8bc4bddd8b2d4262cb17dd | [
"Apache-2.0"
] | 188 | 2021-11-18T18:59:38.000Z | 2022-03-31T23:35:29.000Z | qiskit_runtime/qka/__init__.py | LucyXing/qiskit-runtime | 4b62470e960043acbd8bc4bddd8b2d4262cb17dd | [
"Apache-2.0"
] | 30 | 2021-05-02T09:53:27.000Z | 2022-02-25T16:15:53.000Z | # This code is part of qiskit-runtime.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or deriv... | 21.886364 | 77 | 0.686397 |
f69c3c67aec9ad9f6ad81d8bf78242504cc7c460 | 8,535 | py | Python | homeassistant/components/media_player/liveboxplaytv.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 2 | 2017-10-26T19:43:55.000Z | 2017-12-30T23:29:00.000Z | homeassistant/components/media_player/liveboxplaytv.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:29:36.000Z | 2022-03-12T00:59:48.000Z | homeassistant/components/media_player/liveboxplaytv.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 1 | 2019-09-28T07:06:08.000Z | 2019-09-28T07:06:08.000Z | """
Support for interface with an Orange Livebox Play TV appliance.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.liveboxplaytv/
"""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
from homeassistant... | 32.953668 | 76 | 0.635149 |
f335aff6154f12223af15eca39ea696901983c84 | 533 | py | Python | tests/test_import.py | trbs/wait_for_port | 50455a8055b1bb725db4328a9e91d895e66f5eb7 | [
"MIT"
] | 5 | 2017-05-26T10:35:29.000Z | 2020-01-18T20:49:04.000Z | tests/test_import.py | trbs/wait_for_port | 50455a8055b1bb725db4328a9e91d895e66f5eb7 | [
"MIT"
] | 2 | 2018-03-06T22:02:09.000Z | 2018-03-07T10:38:16.000Z | tests/test_import.py | trbs/wait_for_port | 50455a8055b1bb725db4328a9e91d895e66f5eb7 | [
"MIT"
] | 4 | 2017-05-26T10:37:30.000Z | 2020-12-01T15:50:44.000Z |
def test_import():
import wait_for_port
assert hasattr(wait_for_port, 'wait_for_port')
import wait_for_port.main
assert hasattr(wait_for_port.main, 'main')
def test_unbound_local_error():
"""
Testing that exception and verbose=True are working together
(test for the issue https://github.... | 24.227273 | 71 | 0.679174 |
676d464929954331d176bb9d8e2fc3140b5bda5c | 4,509 | py | Python | btx_th_error_message2.py | nateGeorge/crypto_predict | 5058af6d389cc06d40e21a663eff3901511198c0 | [
"Apache-2.0"
] | null | null | null | btx_th_error_message2.py | nateGeorge/crypto_predict | 5058af6d389cc06d40e21a663eff3901511198c0 | [
"Apache-2.0"
] | null | null | null | btx_th_error_message2.py | nateGeorge/crypto_predict | 5058af6d389cc06d40e21a663eff3901511198c0 | [
"Apache-2.0"
] | null | null | null | Exception in thread Thread-22:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/usr/local/lib/python3.5/dist-packages/urllib3/util/connection.py", line 60, in create_connectio$
... | 60.932432 | 105 | 0.765358 |
8aae5b4292995700f30b75c71f7384b6a324a7ba | 5,623 | py | Python | core/data/dataloader/cityscapes.py | FUTUREEEEEE/awesome-semantic-segmentation-pytorch | a17435322bde76753763d3a81e9af52dde6f12a3 | [
"Apache-2.0"
] | null | null | null | core/data/dataloader/cityscapes.py | FUTUREEEEEE/awesome-semantic-segmentation-pytorch | a17435322bde76753763d3a81e9af52dde6f12a3 | [
"Apache-2.0"
] | null | null | null | core/data/dataloader/cityscapes.py | FUTUREEEEEE/awesome-semantic-segmentation-pytorch | a17435322bde76753763d3a81e9af52dde6f12a3 | [
"Apache-2.0"
] | null | null | null | """Prepare Cityscapes dataset"""
import os
import torch
import numpy as np
from PIL import Image
from .segbase import SegmentationDataset
class CitySegmentation(SegmentationDataset):
"""Cityscapes Semantic Segmentation Dataset.
Parameters
----------
root : string
Path to Cityscapes folder. D... | 40.746377 | 100 | 0.592744 |
d64c019d7a19ed4b1adf0c69a6824eaae347b230 | 1,579 | py | Python | uploadAssets.py | Contentstack-Solutions/python-asset-operations | eb517bf8928378361ef4ca30cdbcbbd02539dbac | [
"MIT"
] | null | null | null | uploadAssets.py | Contentstack-Solutions/python-asset-operations | eb517bf8928378361ef4ca30cdbcbbd02539dbac | [
"MIT"
] | null | null | null | uploadAssets.py | Contentstack-Solutions/python-asset-operations | eb517bf8928378361ef4ca30cdbcbbd02539dbac | [
"MIT"
] | null | null | null | '''
Bulk create and optionally publish Assets - See comments below. (The publish action is commented out when this is written)
oskar.eiriksson@contentstack.com
2021-01-26
'''
import os
import cma
import mimetypes
folder = '/tmp/tmpImages/' # Path to folder with all assets that you want to import. Must end with a '/'.
... | 36.72093 | 157 | 0.69981 |
a5c674dddc777aa3562ab9fa0eb761ac825f16be | 1,876 | py | Python | lib/bes/python/python_cli_command.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/python/python_cli_command.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/python/python_cli_command.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import sys
from bes.common.check import check
from bes.common.Script import Script
from bes.script.blurber import blurber
from .python_installer import python_installer
class python_cli_command(object):
'python cli commands... | 23.160494 | 90 | 0.719616 |
394902004327ec53f42a5d03b333e01b2861ad02 | 492 | py | Python | tests/trig/sin_tst.py | ikucan/MathsMonkey | 0c0a6089530335e51a64035ec0af2795148d87e2 | [
"Apache-2.0"
] | null | null | null | tests/trig/sin_tst.py | ikucan/MathsMonkey | 0c0a6089530335e51a64035ec0af2795148d87e2 | [
"Apache-2.0"
] | null | null | null | tests/trig/sin_tst.py | ikucan/MathsMonkey | 0c0a6089530335e51a64035ec0af2795148d87e2 | [
"Apache-2.0"
] | null | null | null | from mathsmonkey.trig.sin import xxsin
a = xxsin('../../pdfs/trig/', 'trig_sinus')
a.gen(3, 3, 0, 100, 3)
quit()
for n_nums in range(2, 6):
for n_dgts in range (1, 4):
for dgt_var in range (0, n_dgts):
n_cols = 2
if n_nums * n_dgts < 15:
n_cols += 1
if... | 23.428571 | 55 | 0.485772 |
58be9bffe1a678856a0424c29de9bc76f503d5a2 | 1,918 | py | Python | test/functional/test_framework/bignum.py | MichaelHDesigns/BRS | f5163ab5d47cd2f90fcf623850843996ab9d62dd | [
"MIT"
] | 15 | 2020-12-01T21:20:18.000Z | 2022-02-13T08:20:58.000Z | test/functional/test_framework/bignum.py | MichaelHDesigns/DCG-Crypto | f5163ab5d47cd2f90fcf623850843996ab9d62dd | [
"MIT"
] | 1 | 2020-12-01T23:41:13.000Z | 2020-12-01T23:41:13.000Z | test/functional/test_framework/bignum.py | MichaelHDesigns/DCG-Crypto | f5163ab5d47cd2f90fcf623850843996ab9d62dd | [
"MIT"
] | 8 | 2020-12-01T20:23:15.000Z | 2022-03-28T18:23:19.000Z | #!/usr/bin/env python3
#
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Big number routines.
This file is copied from python-bitcoinlib.
"""
import struct
# generic big endian MPI format
def bn_bytes(v, have_ext=False):
... | 19.571429 | 69 | 0.531283 |
bdfedf00687464164103767024d38786e16ee347 | 4,729 | py | Python | presets/posehandlers/finger_poseHandler.py | markj3d/Red9_StudioPack | 1d40a8bf84c45ce7eaefdd9ccfa3cdbeb1471919 | [
"BSD-3-Clause-Clear"
] | 175 | 2015-02-12T11:11:46.000Z | 2022-02-28T03:40:26.000Z | presets/posehandlers/finger_poseHandler.py | lefan2016/Red9_StudioPack | de19a9066050ed0088de7d1cee70e7062781006d | [
"BSD-3-Clause-Clear"
] | 15 | 2015-04-20T08:46:33.000Z | 2019-11-29T08:45:28.000Z | presets/posehandlers/finger_poseHandler.py | lefan2016/Red9_StudioPack | de19a9066050ed0088de7d1cee70e7062781006d | [
"BSD-3-Clause-Clear"
] | 64 | 2015-01-15T18:39:26.000Z | 2022-02-10T17:46:15.000Z | '''
------------------------------------------
Red9 Studio Pack: Maya Pipeline Solutions
Author: Mark Jackson
email: rednineinfo@gmail.com
Red9 blog : http://red9-consultancy.blogspot.co.uk/
MarkJ blog: http://markj3d.blogspot.co.uk
------------------------------------------
==========================================... | 41.482456 | 122 | 0.63819 |
c8157b54e950437e3f81c724f653d5d7ed55f26e | 508 | wsgi | Python | app.wsgi | gastonorellano/crypto | 1a8f5de446426ab6f41e4542bb3bca0a894b0be1 | [
"Beerware"
] | 3 | 2017-11-21T11:13:57.000Z | 2018-07-18T02:58:03.000Z | app.wsgi | gastonorellano/crypto | 1a8f5de446426ab6f41e4542bb3bca0a894b0be1 | [
"Beerware"
] | null | null | null | app.wsgi | gastonorellano/crypto | 1a8f5de446426ab6f41e4542bb3bca0a894b0be1 | [
"Beerware"
] | 2 | 2017-11-21T11:13:49.000Z | 2020-07-17T02:30:57.000Z | #!/usr/bin/python
# Para correr en apache con wsgi
#
# Incluir en la config:
#
# Alias /static /var/www/crypto.baicom.com/web/crypto/static
# WSGIScriptAlias / /var/www/crypto.baicom.com/web/crypto/app.wsgi
PROJECT_DIR = '/var/www/crypto.baicom.com/web/crypto'
activate_this = PROJECT_DIR + '/venv/bin/activate_t... | 24.190476 | 68 | 0.76378 |
305b0e1cf53406e051e8de1fc69bdd4e34cb5516 | 15,979 | py | Python | electrum_mona/gui/qt/transaction_dialog.py | david4neblio/electrum-mona | 2d13b066be2d6205aeaa7ca859884c3ec1b92e83 | [
"MIT"
] | 2 | 2019-12-27T09:13:48.000Z | 2020-09-18T14:10:48.000Z | electrum_mona/gui/qt/transaction_dialog.py | david4neblio/electrum-mona | 2d13b066be2d6205aeaa7ca859884c3ec1b92e83 | [
"MIT"
] | 2 | 2020-07-31T20:14:43.000Z | 2021-10-17T02:33:41.000Z | electrum_mona/gui/qt/transaction_dialog.py | david4neblio/electrum-mona | 2d13b066be2d6205aeaa7ca859884c3ec1b92e83 | [
"MIT"
] | 3 | 2020-03-08T19:40:17.000Z | 2021-11-10T21:41:11.000Z | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... | 40.047619 | 117 | 0.643595 |
6b3521eb9588e71c4b3989f8f513acef7f408cd4 | 4,532 | py | Python | zeus/networks/mindspore/prune_deformation.py | shaido987/vega | 14d5d49fb8bdf96bd1f3fcfac201ce6b6712c3b6 | [
"MIT"
] | 1 | 2021-05-08T07:47:44.000Z | 2021-05-08T07:47:44.000Z | zeus/networks/mindspore/prune_deformation.py | WholeG/vega | d1ccf1c3ce68a118bdb6775594ceed0f895911e7 | [
"MIT"
] | null | null | null | zeus/networks/mindspore/prune_deformation.py | WholeG/vega | d1ccf1c3ce68a118bdb6775594ceed0f895911e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... | 41.577982 | 108 | 0.639894 |
52e76614572cfa307bfad0c0998bfa0b7808b60b | 556 | py | Python | apps/diary/factories.py | deniskrumko/deniskrumko | 613c0c3eac953d2e8482a2e66fce7d3570770b2c | [
"MIT"
] | 2 | 2019-07-09T01:42:04.000Z | 2020-04-09T16:44:59.000Z | apps/diary/factories.py | deniskrumko/deniskrumko | 613c0c3eac953d2e8482a2e66fce7d3570770b2c | [
"MIT"
] | 5 | 2019-12-30T22:16:38.000Z | 2020-09-11T18:13:14.000Z | apps/diary/factories.py | deniskrumko/deniskrumko | 613c0c3eac953d2e8482a2e66fce7d3570770b2c | [
"MIT"
] | 1 | 2019-07-09T01:42:07.000Z | 2019-07-09T01:42:07.000Z | import factory
from . import models
class DiaryEntryFactory(factory.django.DjangoModelFactory):
"""Factory for ``DiaryEntry`` model."""
text = factory.Faker('text', max_nb_chars=1000, locale='ru_RU')
done = factory.sequence(lambda x: bool(x % 5))
class Meta:
model = models.DiaryEntry
clas... | 23.166667 | 67 | 0.670863 |
7178a4857307d592911b6f7616f5a4a660b49531 | 3,444 | py | Python | python3/koans/about_lists.py | tanahy/python_koans | 9621380aefe8a40cdcc49194ed47d5cd656efea4 | [
"MIT"
] | null | null | null | python3/koans/about_lists.py | tanahy/python_koans | 9621380aefe8a40cdcc49194ed47d5cd656efea4 | [
"MIT"
] | null | null | null | python3/koans/about_lists.py | tanahy/python_koans | 9621380aefe8a40cdcc49194ed47d5cd656efea4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutArrays in the Ruby Koans
#
from runner.koan import *
class AboutLists(Koan):
def test_creating_lists(self):
empty_list = list()
self.assertEqual(list, type(empty_list))
self.assertEqual(0, len(empty_list))
def test_list_... | 31.309091 | 79 | 0.579559 |
b8f4946cd8b70fe6d11ff64e06622b238d7b322c | 2,472 | py | Python | mapillary_tools/commands/post_process.py | testbalda/mapillary_tools | 07c00bb83815e512e1b85f5957b7d1ac9dfdeb0c | [
"BSD-2-Clause"
] | null | null | null | mapillary_tools/commands/post_process.py | testbalda/mapillary_tools | 07c00bb83815e512e1b85f5957b7d1ac9dfdeb0c | [
"BSD-2-Clause"
] | null | null | null | mapillary_tools/commands/post_process.py | testbalda/mapillary_tools | 07c00bb83815e512e1b85f5957b7d1ac9dfdeb0c | [
"BSD-2-Clause"
] | null | null | null | import inspect
from mapillary_tools.post_process import post_process
class Command:
name = 'post_process'
help = 'Post process tool : Post process for a given import path, including import summary and grouping/moving based on import status.'
def add_basic_arguments(self, parser):
parser.add_argu... | 57.488372 | 168 | 0.645631 |
62bc1d2927e5023345701277baef9e0a52eb7b47 | 3,171 | py | Python | tests/test_project_fixtures/test_project_rename_column/test_project_rename_column/settings.py | fevral13/django-migration-linter | 6fcc7b4719ab93acf3036cb27fc185de30be0bde | [
"Apache-2.0"
] | null | null | null | tests/test_project_fixtures/test_project_rename_column/test_project_rename_column/settings.py | fevral13/django-migration-linter | 6fcc7b4719ab93acf3036cb27fc185de30be0bde | [
"Apache-2.0"
] | null | null | null | tests/test_project_fixtures/test_project_rename_column/test_project_rename_column/settings.py | fevral13/django-migration-linter | 6fcc7b4719ab93acf3036cb27fc185de30be0bde | [
"Apache-2.0"
] | null | null | null | """
Django settings for test_project_rename_column project.
Generated by 'django-admin startproject' using Django 1.11.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/setti... | 25.991803 | 91 | 0.701671 |
1527efea459186b1b499f41ced9dc4efce50ffa6 | 10,323 | py | Python | test/functional/credit_createcontract.py | The-Terra-Foundation/Credit-Core | eff0485f19ce5c122f9d7f1f43c8c4ebe53d1470 | [
"MIT"
] | 3 | 2021-08-31T13:16:57.000Z | 2022-03-27T16:06:06.000Z | test/functional/credit_createcontract.py | The-Terra-Foundation/Credit-Core | eff0485f19ce5c122f9d7f1f43c8c4ebe53d1470 | [
"MIT"
] | null | null | null | test/functional/credit_createcontract.py | The-Terra-Foundation/Credit-Core | eff0485f19ce5c122f9d7f1f43c8c4ebe53d1470 | [
"MIT"
] | 2 | 2021-08-31T13:17:03.000Z | 2021-09-07T08:02:07.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from tes... | 68.82 | 1,224 | 0.799768 |
e263f16bb771912a4f7ba9aa964985f8738e31c6 | 142 | py | Python | billing/apps.py | Pythonian/srvup | ea49142ba66baf88b74105e64c3b9c0bc75e5d64 | [
"MIT"
] | 2 | 2020-12-11T20:50:10.000Z | 2021-01-08T15:26:24.000Z | billing/apps.py | charles-co/rad-shop | d46eb7e10f11b2b548e2b9f8dcdd4c4282ed8ab7 | [
"MIT"
] | 9 | 2020-07-08T14:18:57.000Z | 2022-03-12T00:39:37.000Z | billing/apps.py | Pythonian/srvup | ea49142ba66baf88b74105e64c3b9c0bc75e5d64 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class BillingConfig(AppConfig):
name = 'billing'
def ready(self):
import billing.signals
| 15.777778 | 33 | 0.697183 |
2c97900f10ec6cf844e1e3eb90714abb9e82578b | 29,938 | py | Python | python/ns/maya/msv/MayaAgent.py | redpawfx/massiveImporter | 2772d1ce530041007d00d8ba4274dccdda7b8900 | [
"MIT"
] | 2 | 2018-01-30T07:50:48.000Z | 2020-03-10T02:10:38.000Z | python/ns/maya/msv/MayaAgent.py | redpawfx/massiveImporter | 2772d1ce530041007d00d8ba4274dccdda7b8900 | [
"MIT"
] | null | null | null | python/ns/maya/msv/MayaAgent.py | redpawfx/massiveImporter | 2772d1ce530041007d00d8ba4274dccdda7b8900 | [
"MIT"
] | 3 | 2016-10-25T14:29:34.000Z | 2021-08-09T13:37:33.000Z | # The MIT License
#
# Copyright (c) 2008 James Piechota
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | 36.244552 | 143 | 0.712539 |
8690b7c3492761a38f837695b1e679e4816bd98d | 4,996 | py | Python | spotlob/tests/test_line_detection.py | fa-me/spotlob | 1f76f05bf351ba84dc8d3693fc692aa4af05c5d3 | [
"BSD-3-Clause"
] | 1 | 2020-02-14T19:38:55.000Z | 2020-02-14T19:38:55.000Z | spotlob/tests/test_line_detection.py | fa-me/spotlob | 1f76f05bf351ba84dc8d3693fc692aa4af05c5d3 | [
"BSD-3-Clause"
] | null | null | null | spotlob/tests/test_line_detection.py | fa-me/spotlob | 1f76f05bf351ba84dc8d3693fc692aa4af05c5d3 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import cv2
import numpy as np
from numpy.testing import assert_array_equal, assert_almost_equal
from .image_generation import binary_line
from ..spim import Spim, SpimStage
from ..process_opencv import ContourFinderSimple, FeatureFormFilter
from ..analyze_line import LineAnalysis
from ..calculation ... | 33.086093 | 75 | 0.577862 |
69646ede0e5c2c72874669576bfe0fc0487991d4 | 1,233 | py | Python | tests/views/test_staff_endpoints.py | ArnavChawla/requests | a1afc45e236fe59a4b26267eb4a2ae15a8b45f2e | [
"Apache-2.0"
] | 5 | 2019-06-06T08:41:36.000Z | 2020-08-28T18:46:57.000Z | tests/views/test_staff_endpoints.py | ArnavChawla/requests | a1afc45e236fe59a4b26267eb4a2ae15a8b45f2e | [
"Apache-2.0"
] | 1 | 2022-02-10T17:24:39.000Z | 2022-02-10T17:24:39.000Z | tests/views/test_staff_endpoints.py | ArnavChawla/requests | a1afc45e236fe59a4b26267eb4a2ae15a8b45f2e | [
"Apache-2.0"
] | 2 | 2019-06-05T19:05:25.000Z | 2020-08-27T14:04:28.000Z | from urls import staff_url
def test_get_staff_succeeds_with_valid_staff_id_in_params(
valid_staff_model, client, request_headers
):
"""
Tests that response is okay when staff id exists.
Args:
valid_staff_model (Model): a valid model created by a fixture.
client (FlaskClient): a test c... | 30.825 | 70 | 0.699919 |
f24d763f4f94086c92302e029ef65372078f5ad1 | 1,471 | py | Python | tests/geometries/test_polyhedron.py | almarklein/visvis2 | 728a4b7434879d3606f32836eda3971ed73905f8 | [
"BSD-2-Clause"
] | 7 | 2019-12-20T14:15:53.000Z | 2020-05-03T17:43:02.000Z | tests/geometries/test_polyhedron.py | almarklein/visvis2 | 728a4b7434879d3606f32836eda3971ed73905f8 | [
"BSD-2-Clause"
] | 30 | 2020-02-10T08:59:30.000Z | 2020-06-16T21:21:33.000Z | tests/geometries/test_polyhedron.py | almarklein/visvis2 | 728a4b7434879d3606f32836eda3971ed73905f8 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
from pygfx.geometries import (
dodecahedron_geometry,
octahedron_geometry,
icosahedron_geometry,
tetrahedron_geometry,
)
def test_polyhedrons():
for nr_faces, factory in [
[4, tetrahedron_geometry],
[8, octahedron_geometry],
[20, icosahedron_geometry],
... | 32.688889 | 77 | 0.648538 |
cdb0162ebdf8df53bd3e20917b9e8ed23e510dfc | 166 | py | Python | scripts/quest/q29905s.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 9 | 2021-04-26T11:59:29.000Z | 2021-12-20T13:15:27.000Z | scripts/quest/q29905s.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/quest/q29905s.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 6 | 2021-07-14T06:32:05.000Z | 2022-02-06T02:32:56.000Z | # Noblesse
medal = 1142065
if sm.canHold(medal):
sm.chatScript("You obtained the <Noblesse> medal.")
sm.startQuest(parentID)
sm.completeQuest(parentID)
| 18.444444 | 55 | 0.710843 |
c3ba4e51503a912332f13f39f493262c1e68ee78 | 100,266 | py | Python | nova/tests/virt/xenapi/test_vm_utils.py | bopopescu/nova-26 | 3154f2cb0eb0d8c447c6d18ee0bab5e7dbeba60b | [
"Apache-2.0"
] | null | null | null | nova/tests/virt/xenapi/test_vm_utils.py | bopopescu/nova-26 | 3154f2cb0eb0d8c447c6d18ee0bab5e7dbeba60b | [
"Apache-2.0"
] | null | null | null | nova/tests/virt/xenapi/test_vm_utils.py | bopopescu/nova-26 | 3154f2cb0eb0d8c447c6d18ee0bab5e7dbeba60b | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 40.010375 | 79 | 0.620978 |
7c4fed789c3b4a18f0125431007717abd49dd6c9 | 746 | py | Python | app/demo/relations/models.py | sesostris/django-material-admin | f6678e57286bd871a820b235f868873d5f86d649 | [
"MIT"
] | 270 | 2018-09-14T07:55:04.000Z | 2022-03-31T13:12:41.000Z | app/demo/relations/models.py | sesostris/django-material-admin | f6678e57286bd871a820b235f868873d5f86d649 | [
"MIT"
] | 107 | 2019-03-26T20:35:23.000Z | 2022-03-15T15:34:38.000Z | app/demo/relations/models.py | sesostris/django-material-admin | f6678e57286bd871a820b235f868873d5f86d649 | [
"MIT"
] | 66 | 2018-11-05T13:07:14.000Z | 2022-03-31T17:17:22.000Z | from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
class Relation(models.Model):
documents = models.ManyToManyField('documents.Document', verbose_name=_('Documents'))
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, ... | 39.263158 | 104 | 0.72252 |
991193ceaa722515bab06a725188e06af7171d5d | 1,359 | py | Python | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/extensions/test_elseif_used.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/extensions/test_elseif_used.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | 1 | 2016-03-22T13:36:30.000Z | 2016-03-22T13:36:30.000Z | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/extensions/test_elseif_used.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | """Tests for the pylint checker in :mod:`pylint.extensions.check_elif
"""
import os
import os.path as osp
import unittest
from pylint import checkers
from pylint.extensions.check_elif import ElseifUsedChecker
from pylint.lint import PyLinter
from pylint.reporters import BaseReporter
class TestReporter(BaseReporter)... | 28.3125 | 74 | 0.662987 |
c52f61e38a56bc17b20f12c2b8b814053c783f78 | 3,196 | py | Python | message/views.py | kilinger/firon-qhcst | 057e5b65f454083599502c3b178c88399f11c8b7 | [
"BSD-3-Clause"
] | null | null | null | message/views.py | kilinger/firon-qhcst | 057e5b65f454083599502c3b178c88399f11c8b7 | [
"BSD-3-Clause"
] | null | null | null | message/views.py | kilinger/firon-qhcst | 057e5b65f454083599502c3b178c88399f11c8b7 | [
"BSD-3-Clause"
] | null | null | null | #-*- coding: utf-8 -*-
from urllib import quote
import urllib2
from django.shortcuts import render, redirect
from regist.models import Member, Educate, Occupation, Demand
from django.db.models import Q
from django.http import HttpResponse
def message_list(request):
error = []
openid = request.GET.get('openid... | 33.642105 | 81 | 0.577597 |
332e969b61d2c7768ffebfca36bb295be3c12bac | 45,322 | py | Python | dbaas/physical/models.py | panwalas/database-as-a-service | d91126e2dc45eac2a32a0ed20a6d89f7dd85cf8c | [
"BSD-3-Clause"
] | null | null | null | dbaas/physical/models.py | panwalas/database-as-a-service | d91126e2dc45eac2a32a0ed20a6d89f7dd85cf8c | [
"BSD-3-Clause"
] | null | null | null | dbaas/physical/models.py | panwalas/database-as-a-service | d91126e2dc45eac2a32a0ed20a6d89f7dd85cf8c | [
"BSD-3-Clause"
] | null | null | null | # *- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import logging
import simple_audit
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
from django.core.exceptions import ValidationError
from django.core.cache import cache
from django... | 32.34975 | 159 | 0.625436 |
4468f5da75e52c37b4438c8710253610503ce56e | 1,677 | py | Python | app/forms.py | Kiki-Jiji/webby | a02fa581393bb90146213ca0661a8e58bc20cdce | [
"MIT"
] | null | null | null | app/forms.py | Kiki-Jiji/webby | a02fa581393bb90146213ca0661a8e58bc20cdce | [
"MIT"
] | null | null | null | app/forms.py | Kiki-Jiji/webby | a02fa581393bb90146213ca0661a8e58bc20cdce | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo
from app.model import User
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired()])
password... | 41.925 | 76 | 0.717949 |
488b9286c13ca44f82809f4adbb2850c7218fd1e | 1,915 | py | Python | docs/pdf-doc-generation-with-sphinx/source/conf.py | AntaresSimulatorTeam/antares-xpansion | 1aa5775e78d35dd07fc4bd6d0423ce534adf0816 | [
"Apache-2.0"
] | 5 | 2021-08-25T09:29:14.000Z | 2022-03-09T08:59:07.000Z | docs/pdf-doc-generation-with-sphinx/source/conf.py | AntaresSimulatorTeam/antares-xpansion | 1aa5775e78d35dd07fc4bd6d0423ce534adf0816 | [
"Apache-2.0"
] | 251 | 2020-10-30T09:49:29.000Z | 2022-03-31T12:28:48.000Z | docs/pdf-doc-generation-with-sphinx/source/conf.py | AntaresSimulatorTeam/antares-xpansion | 1aa5775e78d35dd07fc4bd6d0423ce534adf0816 | [
"Apache-2.0"
] | 5 | 2020-12-16T15:11:33.000Z | 2021-06-18T05:03:59.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.818182 | 81 | 0.658486 |
c4343880dc60c8c822b7bd459a2554974703d669 | 6,983 | py | Python | tests/transforms/test_transforms.py | jwitos/torchio | 4d5c4fd75e1169f33f566c86e0bd25056dd5be0d | [
"Apache-2.0"
] | null | null | null | tests/transforms/test_transforms.py | jwitos/torchio | 4d5c4fd75e1169f33f566c86e0bd25056dd5be0d | [
"Apache-2.0"
] | null | null | null | tests/transforms/test_transforms.py | jwitos/torchio | 4d5c4fd75e1169f33f566c86e0bd25056dd5be0d | [
"Apache-2.0"
] | null | null | null | import copy
import torch
import numpy as np
import nibabel as nib
import torchio as tio
import SimpleITK as sitk
from ..utils import TorchioTestCase
class TestTransforms(TorchioTestCase):
"""Tests for all transforms."""
def get_transform(self, channels, is_3d=True, labels=True):
landmarks_dict = {
... | 39.451977 | 79 | 0.612774 |
4a72989d61af0648dd2d50ccda9270ca226a29b8 | 526 | py | Python | env/lib/python3.8/site-packages/plotly/validators/area/hoverlabel/_bordercolor.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/area/hoverlabel/_bordercolor.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/area/hoverlabel/_bordercolor.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bordercolor", parent_name="area.hoverlabel", **kwargs
):
super(BordercolorValidator, self).__init__(
plotly_name=plotly_name,
pa... | 32.875 | 80 | 0.638783 |
458f105b782869e317d889a1d20ee54b2b2c5573 | 1,567 | py | Python | long_read_pipeline/utils/sp_utils.py | elifesciences-publications/long_read_cnv | b24c0fcb0be41c98bff8ef530fb8f5cf1e741a17 | [
"MIT"
] | null | null | null | long_read_pipeline/utils/sp_utils.py | elifesciences-publications/long_read_cnv | b24c0fcb0be41c98bff8ef530fb8f5cf1e741a17 | [
"MIT"
] | null | null | null | long_read_pipeline/utils/sp_utils.py | elifesciences-publications/long_read_cnv | b24c0fcb0be41c98bff8ef530fb8f5cf1e741a17 | [
"MIT"
] | 1 | 2019-11-07T10:24:34.000Z | 2019-11-07T10:24:34.000Z | # Copyright (c) 2017 Boocock James <james.boocock@otago.ac.nz>
# Author: Boocock James <james.boocock@otago.ac.nz>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, incl... | 48.96875 | 82 | 0.758775 |
0d8395f0d5bcfef7a5e0e55c0963bdf89f6e0c99 | 1,299 | py | Python | pyyoutube/models/category.py | JoshPaulie/python-youtube | d47da87d03636e4e7166045b4ad9d6426ba43a14 | [
"MIT"
] | 156 | 2019-09-01T13:57:49.000Z | 2022-03-31T13:51:21.000Z | pyyoutube/models/category.py | JoshPaulie/python-youtube | d47da87d03636e4e7166045b4ad9d6426ba43a14 | [
"MIT"
] | 88 | 2019-10-20T16:08:50.000Z | 2022-02-08T10:50:54.000Z | pyyoutube/models/category.py | JoshPaulie/python-youtube | d47da87d03636e4e7166045b4ad9d6426ba43a14 | [
"MIT"
] | 33 | 2019-10-15T17:46:38.000Z | 2022-01-30T04:50:49.000Z | """
These are category related models.
Include VideoCategory
"""
from dataclasses import dataclass, field
from typing import List, Optional
from .base import BaseModel
from .common import BaseApiResponse, BaseResource
@dataclass
class CategorySnippet(BaseModel):
"""
This is base category snippet for ... | 24.509434 | 88 | 0.733641 |
84b63d97ba4f6782152e3d47674676e7933301ce | 4,045 | py | Python | newspaper_project/settings.py | tjdolan121/newspaper_proj | a46890f84cbf93fb4a74b277a78b3ca8b004e095 | [
"MIT"
] | null | null | null | newspaper_project/settings.py | tjdolan121/newspaper_proj | a46890f84cbf93fb4a74b277a78b3ca8b004e095 | [
"MIT"
] | 1 | 2019-01-10T11:19:06.000Z | 2019-01-10T11:19:57.000Z | newspaper_project/settings.py | tjdolan121/newspaper_proj | a46890f84cbf93fb4a74b277a78b3ca8b004e095 | [
"MIT"
] | null | null | null | """
Django settings for newspaper_project project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
im... | 24.515152 | 91 | 0.710012 |
f80d5d3f6ba0ff730fc55e9d8caa3fb4ffc254ee | 1,162 | py | Python | sandbox/lib/jumpscale/JumpscaleLibs/clients/itsyouonline/generated/client/RegistryEntry.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | null | null | null | sandbox/lib/jumpscale/JumpscaleLibs/clients/itsyouonline/generated/client/RegistryEntry.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | 117 | 2019-09-01T11:59:19.000Z | 2020-07-14T11:10:08.000Z | sandbox/lib/jumpscale/JumpscaleLibs/clients/itsyouonline/generated/client/RegistryEntry.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | 2 | 2020-04-06T15:21:23.000Z | 2020-05-07T04:29:53.000Z | """
Auto-generated class for RegistryEntry
"""
from six import string_types
from Jumpscale import j
from . import client_support
class RegistryEntry:
"""
auto-generated. don't touch.
"""
@staticmethod
def create(**kwargs):
"""
:type Key: str
:type Value: str
:rtype... | 25.26087 | 111 | 0.627367 |
3a5dce0133f8d2e0dd022696ff3204e8649188e8 | 41,447 | py | Python | chemdataextractor/model/base.py | OBrink/chemdataextractor2 | 152a45f6abbf069d2070232fa5c4038569ac7717 | [
"MIT"
] | null | null | null | chemdataextractor/model/base.py | OBrink/chemdataextractor2 | 152a45f6abbf069d2070232fa5c4038569ac7717 | [
"MIT"
] | null | null | null | chemdataextractor/model/base.py | OBrink/chemdataextractor2 | 152a45f6abbf069d2070232fa5c4038569ac7717 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Data model for extracted information.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import copy
from abc import ABCMeta
from collections import MutableSequence
import json
import log... | 38.591248 | 189 | 0.592612 |
39faa89f56f8b23b900abd5ff8681b45fb23bcca | 1,145 | py | Python | examples/ccsd_L1.py | msibaev/wick | 59f8a4b522f11875320e9e98b3af57fe7b7d8313 | [
"MIT"
] | 9 | 2020-09-24T15:59:27.000Z | 2022-01-26T16:25:29.000Z | examples/ccsd_L1.py | msibaev/wick | 59f8a4b522f11875320e9e98b3af57fe7b7d8313 | [
"MIT"
] | 1 | 2021-12-28T20:46:16.000Z | 2021-12-28T20:46:16.000Z | examples/ccsd_L1.py | msibaev/wick | 59f8a4b522f11875320e9e98b3af57fe7b7d8313 | [
"MIT"
] | 3 | 2021-09-12T08:37:52.000Z | 2021-11-30T23:25:47.000Z | from fractions import Fraction
from wick.expression import AExpression
from wick.wick import apply_wick
from wick.convenience import one_e, two_e, E1, E2, ketE1, commute
H1 = one_e("f", ["occ", "vir"], norder=True)
H2 = two_e("I", ["occ", "vir"], norder=True)
H = H1 + H2
T1 = E1("t", ["occ"], ["vir"])
T2 = E2("t", ["... | 21.603774 | 65 | 0.653275 |
ea6051aace15bc91bef5b56716cc2a5a80cccc52 | 564 | py | Python | bayesian_optimization/setup.py | a-z-e-r-i-l-a/bayesian_optimization | 245b3fa4f7cfcc4ba1bf2e1b7964367f0bd1e50d | [
"BSD-3-Clause"
] | 31 | 2016-01-29T16:10:34.000Z | 2022-01-15T17:13:37.000Z | bayesian_optimization/setup.py | rock-learning/bayesian_optimization | 0b93c9b3e420ef1a28cfe6e5b749c54759763416 | [
"BSD-3-Clause"
] | 1 | 2019-09-03T18:42:33.000Z | 2019-09-03T18:42:33.000Z | bayesian_optimization/setup.py | rock-learning/bayesian_optimization | 0b93c9b3e420ef1a28cfe6e5b749c54759763416 | [
"BSD-3-Clause"
] | 12 | 2016-07-08T13:10:34.000Z | 2021-09-21T11:37:59.000Z | def configuration(parent_package="", top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration("bayesian_optimization", parent_package, top_path)
config.set_options(ignore_setup_xxx_py=True,
assume_default_configuration=True,
de... | 37.6 | 77 | 0.684397 |
e0846044d406b230ec9a2c507000aacae60ded79 | 1,838 | py | Python | Hackergame_2020/超精巧的数字论证器/fuck.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | Hackergame_2020/超精巧的数字论证器/fuck.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | Hackergame_2020/超精巧的数字论证器/fuck.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | from pathlib import Path
import websocket
res = {}
try:
import thread
except ImportError:
import _thread as thread
def on_message(ws, message: str):
print(message)
print("====")
if message == "Please input your token: ":
ws.send(
"1716:MEUCIAj3vUnhyiI2u58LzU4HZehjHjIKg+dco+t... | 24.506667 | 118 | 0.49728 |
6649e9f9aa83fc33a9f272164d71878186471caf | 3,677 | py | Python | diffrax/local_interpolation.py | FedericoV/diffrax | 98b010242394491fea832e77dc94f456b48495fa | [
"Apache-2.0"
] | 377 | 2022-02-07T11:13:56.000Z | 2022-03-31T18:35:51.000Z | diffrax/local_interpolation.py | FedericoV/diffrax | 98b010242394491fea832e77dc94f456b48495fa | [
"Apache-2.0"
] | 25 | 2022-02-08T23:08:11.000Z | 2022-03-30T21:21:18.000Z | diffrax/local_interpolation.py | FedericoV/diffrax | 98b010242394491fea832e77dc94f456b48495fa | [
"Apache-2.0"
] | 15 | 2022-02-08T04:46:23.000Z | 2022-03-30T20:53:10.000Z | import abc
from dataclasses import field
from typing import Optional
import jax
import jax.numpy as jnp
import numpy as np
from .custom_types import Array, PyTree, Scalar
from .misc import linear_rescale, ω
from .path import AbstractPath
class AbstractLocalInterpolation(AbstractPath):
t0: Scalar = field(init=Tr... | 29.416 | 75 | 0.548001 |
bcb73301df1fa19becf8bcb633f24a92e30c7afb | 21,439 | py | Python | code/lambda/layer/auth/aws/helper.py | Xchange-Taiwan/XChange-SSO-Architect | 0bb56bcf8a849cf3b5858f0597696b5bae00de58 | [
"Apache-2.0"
] | 1 | 2021-08-31T04:23:12.000Z | 2021-08-31T04:23:12.000Z | code/lambda/layer/auth/aws/helper.py | Xchange-Taiwan/XChange-SSO-Architect | 0bb56bcf8a849cf3b5858f0597696b5bae00de58 | [
"Apache-2.0"
] | null | null | null | code/lambda/layer/auth/aws/helper.py | Xchange-Taiwan/XChange-SSO-Architect | 0bb56bcf8a849cf3b5858f0597696b5bae00de58 | [
"Apache-2.0"
] | null | null | null | import boto3
import botocore.exceptions
import base64
import json
import hmac
import hashlib
import traceback
import uuid
import time
import re
from aws import dynamodb_utils
class Helper:
EMAIL_REGEX = re.compile(r"[^@]+@[^@]+\.[^@]+")
def represents_int(s):
try:
int(s)
return True
ex... | 28.81586 | 95 | 0.63795 |
f83c41e87973b8a032c32d8a4d676ba3ccd7089f | 16,903 | py | Python | google/cloud/aiplatform_v1beta1/services/model_service/transports/grpc.py | artbees/python-aiplatform | 3c713d5cf47bf343bf53583296daed6161d4f4ed | [
"Apache-2.0"
] | 1 | 2020-10-26T22:39:01.000Z | 2020-10-26T22:39:01.000Z | google/cloud/aiplatform_v1beta1/services/model_service/transports/grpc.py | artbees/python-aiplatform | 3c713d5cf47bf343bf53583296daed6161d4f4ed | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/model_service/transports/grpc.py | artbees/python-aiplatform | 3c713d5cf47bf343bf53583296daed6161d4f4ed | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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 o... | 40.73012 | 98 | 0.646927 |
6a665a8b37ceeeb027c3dc035ad3729b06901ac3 | 1,201 | py | Python | tests/test_shutter.py | waider/gopro-py-api | b18b5458f5bbe689f468842d6888104317786de8 | [
"MIT"
] | 1 | 2019-05-06T21:48:54.000Z | 2019-05-06T21:48:54.000Z | tests/test_shutter.py | waider/gopro-py-api | b18b5458f5bbe689f468842d6888104317786de8 | [
"MIT"
] | null | null | null | tests/test_shutter.py | waider/gopro-py-api | b18b5458f5bbe689f468842d6888104317786de8 | [
"MIT"
] | null | null | null | from .conftest import GoProCameraTest, GoProCameraAuthTest
from goprocam import constants, GoProCamera
class ShutterTest(GoProCameraTest):
def test_shutter_gpcontrol(self):
# doesn't return anything, so we need to hack it
with self.monkeypatch.context() as m:
def verify_cmd(self, text)... | 38.741935 | 72 | 0.633639 |
29ca014964c886b16d017b8f65ae24238b1654f2 | 6,553 | py | Python | makefigs/fig-A7_deploy_precision.py | shivareddyiirs/solar-pv-global-inventory | 9940a454de88a39ca92dbabf07e98d8623f0ec8b | [
"MIT"
] | 64 | 2021-10-29T18:51:23.000Z | 2022-03-31T01:41:34.000Z | makefigs/fig-A7_deploy_precision.py | shivareddyiirs/solar-pv-global-inventory | 9940a454de88a39ca92dbabf07e98d8623f0ec8b | [
"MIT"
] | 3 | 2021-11-25T06:00:38.000Z | 2021-11-28T16:06:46.000Z | makefigs/fig-A7_deploy_precision.py | shivareddyiirs/solar-pv-global-inventory | 9940a454de88a39ca92dbabf07e98d8623f0ec8b | [
"MIT"
] | 9 | 2021-10-30T01:20:26.000Z | 2022-03-22T18:48:48.000Z | import geopandas as gpd
gpd.options.use_pygeos=False
import pandas as pd
import os, json, geojson
import glob
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from geopandas.plotting import plot_polygon_collection
root = os.getcwd()
ne = gpd.read_file(os.path.join(root,'data','ne_10m_count... | 40.450617 | 180 | 0.675416 |
3fbbeaa0133ac40030f39a826ffea86ca512fd6c | 649 | py | Python | env/lib/python3.8/site-packages/plotly/validators/scatterpolargl/hoverlabel/font/_family.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/scatterpolargl/hoverlabel/font/_family.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/scatterpolargl/hoverlabel/font/_family.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="scatterpolargl.hoverlabel.font",
**kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=pl... | 30.904762 | 68 | 0.600924 |
54d956055999e6154ab76246b2e4c9ec63e79089 | 776 | py | Python | Optimizer/Rank.py | vd1371/GIAMS | dd6551f344b8d0377131d4496846eb5d03b6189c | [
"MIT"
] | null | null | null | Optimizer/Rank.py | vd1371/GIAMS | dd6551f344b8d0377131d4496846eb5d03b6189c | [
"MIT"
] | null | null | null | Optimizer/Rank.py | vd1371/GIAMS | dd6551f344b8d0377131d4496846eb5d03b6189c | [
"MIT"
] | null | null | null | #Loading dependencies
from collections import OrderedDict
class Rank:
def __init__(self, **params):
'''Rank optimization
This method shall be used for LCAs with one objective value
like risk, losses, etc.
'''
self.lca = params.pop('lca')
self.settings = params.pop('settings')
def optimize(self):
'''O... | 15.836735 | 81 | 0.693299 |
a29dc5bbbb49af67abbe3feee7b7e7161f6dd12b | 4,611 | py | Python | graphene_django/tests/test_types.py | mrmilu/graphene-django | dfdfeffa939ff5490b4bf3607de4220b7bc20729 | [
"MIT"
] | null | null | null | graphene_django/tests/test_types.py | mrmilu/graphene-django | dfdfeffa939ff5490b4bf3607de4220b7bc20729 | [
"MIT"
] | null | null | null | graphene_django/tests/test_types.py | mrmilu/graphene-django | dfdfeffa939ff5490b4bf3607de4220b7bc20729 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# General imports
from mock import patch
from graphene import Interface, ObjectType, Schema, Connection, String
from graphene.relay import Node
# App imports
from .. import registry
from ..types import DjangoObjectType, DjangoObjectTypeOptions
from .models import Article as ArticleModel
from .m... | 20.135371 | 86 | 0.660594 |
de6b1757989a7da43637b55a7bd8e9bdfd3dc436 | 1,144 | py | Python | src/utils/common/terminal.py | PranavEranki/SSD-Algorithm | 778c8be06ad75c6dfbe98660fb32ef4cacb7ce4a | [
"MIT"
] | null | null | null | src/utils/common/terminal.py | PranavEranki/SSD-Algorithm | 778c8be06ad75c6dfbe98660fb32ef4cacb7ce4a | [
"MIT"
] | null | null | null | src/utils/common/terminal.py | PranavEranki/SSD-Algorithm | 778c8be06ad75c6dfbe98660fb32ef4cacb7ce4a | [
"MIT"
] | 1 | 2020-02-23T00:40:08.000Z | 2020-02-23T00:40:08.000Z |
import os
import sys
__exec_dir = sys.path[0]
while os.path.basename(__exec_dir) != "src":
__exec_dir = os.path.dirname(__exec_dir)
sys.path.insert(0, __exec_dir)
from utils.common.logging import logging_wait
def query_yes_no(question, default = "yes"):
"""Ask a yes / no question in the console.
Arguments:
... | 22.88 | 99 | 0.658217 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.