hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1a7a2cf83e5f7d8faa01bd96919b956e0eba68 | 7,522 | py | Python | tools/pytorch-quantization/pytorch_quantization/nn/modules/quant_pooling.py | 5had3z/TensorRT | 8561894f7373c5c87a0b67c9a8661b345971aa09 | [
"Apache-2.0"
] | 4 | 2021-04-16T13:49:38.000Z | 2022-01-16T08:58:07.000Z | tools/pytorch-quantization/pytorch_quantization/nn/modules/quant_pooling.py | 5had3z/TensorRT | 8561894f7373c5c87a0b67c9a8661b345971aa09 | [
"Apache-2.0"
] | null | null | null | tools/pytorch-quantization/pytorch_quantization/nn/modules/quant_pooling.py | 5had3z/TensorRT | 8561894f7373c5c87a0b67c9a8661b345971aa09 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020, NVIDIA 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 required by appl... | 46.147239 | 114 | 0.720686 |
from torch.nn.modules import pooling
from . import _utils
__all__ = [
"MaxPool1d", "QuantMaxPool1d", "MaxPool2d", "QuantMaxPool2d", "MaxPool3d", "QuantMaxPool3d",
"AvgPool1d", "QuantAvgPool1d", "AvgPool2d", "QuantAvgPool2d", "AvgPool3d", "QuantAvgPool3d",
"AdaptiveAvgPool1d", "QuantAdapt... | true | true |
1c1a7af5502e774c949089abc6c2874080f1e1b2 | 280 | py | Python | mne/inverse_sparse/__init__.py | Okamille/mne-python | 25df6b63ea3cc2eca1855fcafd8bfbcfd7199263 | [
"BSD-3-Clause"
] | 1 | 2020-11-05T21:30:15.000Z | 2020-11-05T21:30:15.000Z | mne/inverse_sparse/__init__.py | Okamille/mne-python | 25df6b63ea3cc2eca1855fcafd8bfbcfd7199263 | [
"BSD-3-Clause"
] | 4 | 2016-06-04T15:28:08.000Z | 2016-12-22T14:23:13.000Z | mne/inverse_sparse/__init__.py | Okamille/mne-python | 25df6b63ea3cc2eca1855fcafd8bfbcfd7199263 | [
"BSD-3-Clause"
] | 1 | 2020-01-07T03:16:59.000Z | 2020-01-07T03:16:59.000Z | """Non-Linear sparse inverse solvers."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: Simplified BSD
from .mxne_inverse import (mixed_norm, tf_mixed_norm,
make_stc_from_dipoles)
from ._gamma_map import gamma_map
| 28 | 70 | 0.721429 |
from .mxne_inverse import (mixed_norm, tf_mixed_norm,
make_stc_from_dipoles)
from ._gamma_map import gamma_map
| true | true |
1c1a7e106a012f4868302284b271df7b945776ce | 2,474 | py | Python | test/functional/p2p_addrv2_relay.py | rojarsmith/eleccoin | 2f1bb02eb75f244fe9f1b46a91ee72b756d85912 | [
"MIT"
] | null | null | null | test/functional/p2p_addrv2_relay.py | rojarsmith/eleccoin | 2f1bb02eb75f244fe9f1b46a91ee72b756d85912 | [
"MIT"
] | null | null | null | test/functional/p2p_addrv2_relay.py | rojarsmith/eleccoin | 2f1bb02eb75f244fe9f1b46a91ee72b756d85912 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020-2021 The Eleccoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test addrv2 relay
"""
import time
from test_framework.messages import (
CAddress,
msg_addrv... | 30.925 | 90 | 0.664511 |
import time
from test_framework.messages import (
CAddress,
msg_addrv2,
NODE_NETWORK,
NODE_WITNESS,
)
from test_framework.p2p import P2PInterface
from test_framework.test_framework import EleccoinTestFramework
from test_framework.util import assert_equal
ADDRS = []
for i in range(10):
addr = ... | true | true |
1c1a7e48bbcdd4587b3be29fdb2f1f9c235c0d61 | 2,023 | py | Python | tests/test_completed_trade.py | b1nhm1nh/jesse-ctf | 98e519ba6a08af5dd8dd5bae09617a6056f3b5e4 | [
"MIT"
] | 3 | 2021-09-26T15:55:00.000Z | 2022-01-17T08:04:21.000Z | tests/test_completed_trade.py | b1nhm1nh/jesse-ctf | 98e519ba6a08af5dd8dd5bae09617a6056f3b5e4 | [
"MIT"
] | 26 | 2021-10-31T07:04:04.000Z | 2022-03-24T04:24:21.000Z | tests/test_completed_trade.py | b1nhm1nh/jesse | 98e519ba6a08af5dd8dd5bae09617a6056f3b5e4 | [
"MIT"
] | null | null | null | from jesse.models import CompletedTrade
from jesse.store import store
from .utils import single_route_backtest
import numpy as np
def test_completed_trade_in_a_simple_strategy():
assert store.completed_trades.trades == []
single_route_backtest('CanAddCompletedTradeToStore')
assert len(store.completed_tr... | 28.097222 | 76 | 0.68265 | from jesse.models import CompletedTrade
from jesse.store import store
from .utils import single_route_backtest
import numpy as np
def test_completed_trade_in_a_simple_strategy():
assert store.completed_trades.trades == []
single_route_backtest('CanAddCompletedTradeToStore')
assert len(store.completed_tr... | true | true |
1c1a7e6848d6c6a39ea05587081e3f2f4d161477 | 6,374 | py | Python | utils.py | NivNayman/XNAS | cbe838d12d043bdb8e0e3e2a1eb04dbe99da2111 | [
"Apache-2.0"
] | 15 | 2019-11-06T08:33:40.000Z | 2021-12-22T00:27:02.000Z | utils.py | NivNayman/XNAS | cbe838d12d043bdb8e0e3e2a1eb04dbe99da2111 | [
"Apache-2.0"
] | 1 | 2019-12-21T09:03:55.000Z | 2020-04-07T16:55:02.000Z | utils.py | NivNayman/XNAS | cbe838d12d043bdb8e0e3e2a1eb04dbe99da2111 | [
"Apache-2.0"
] | 3 | 2020-02-22T01:22:38.000Z | 2021-05-21T00:09:55.000Z | import os
import torch
import shutil
import time
import logging
import numpy as np
import torchvision.transforms as transforms
from torch.autograd import Variable
import torch.nn as nn
import parameters as params
class AvgrageMeter(object):
def __init__(self):
self.reset()
def reset(self):
se... | 31.554455 | 127 | 0.588328 | import os
import torch
import shutil
import time
import logging
import numpy as np
import torchvision.transforms as transforms
from torch.autograd import Variable
import torch.nn as nn
import parameters as params
class AvgrageMeter(object):
def __init__(self):
self.reset()
def reset(self):
se... | false | true |
1c1a7ed300874397c1447376328c50fab9c95040 | 2,422 | py | Python | official/vision/beta/configs/backbones_3d.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 2 | 2020-12-11T04:07:55.000Z | 2020-12-11T04:08:11.000Z | official/vision/beta/configs/backbones_3d.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | null | null | null | official/vision/beta/configs/backbones_3d.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 3 | 2021-02-22T13:24:07.000Z | 2021-02-26T02:06:24.000Z | # Lint as: python3
# Copyright 2020 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 ... | 33.638889 | 80 | 0.656895 |
from typing import Optional, Tuple
import dataclasses
from official.modeling import hyperparams
@dataclasses.dataclass
class ResNet3DBlock(hyperparams.Config):
temporal_strides: int = 1
temporal_kernel_sizes: Tuple[int, ...] = ()
use_self_gating: bool = False
@dataclasses.dataclass
class Res... | true | true |
1c1a7fdaa66b4b5b1a0b9a6980fcbc2638bd83b7 | 3,561 | py | Python | pathfinder.py | robinmanuelthiel/Pi2Go-Pathfinder | 202668d5977dc73dcdc5608bc96760eeb4459c2f | [
"MIT"
] | 1 | 2016-07-26T05:56:37.000Z | 2016-07-26T05:56:37.000Z | pathfinder.py | robinmanuelthiel/Pi2Go-Pathfinder | 202668d5977dc73dcdc5608bc96760eeb4459c2f | [
"MIT"
] | null | null | null | pathfinder.py | robinmanuelthiel/Pi2Go-Pathfinder | 202668d5977dc73dcdc5608bc96760eeb4459c2f | [
"MIT"
] | null | null | null | # Pathfinder script for the Pi2Go robot project for Raspberry Pi
# The robot will follow a line on the floor until it detects and obstacle.
# When it finds one, it turns around until it finds the line again.
import time, pi2go
# Variables
goForward = True
turnLeft = False
turnRight = False
turnAround = False
rightSen... | 32.669725 | 90 | 0.490031 |
import time, pi2go
goForward = True
turnLeft = False
turnRight = False
turnAround = False
rightSensorFoundTurnLine = False
foundLineAfterTurn = False
alreadyTurned = False
movingSpeed = 38
pi2go.init()
try:
while True:
if (goForward):
... | false | true |
1c1a7feb7bcb62251e5f3a890773d113de9d4f97 | 582 | py | Python | test/tests/reinitializable.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:28:45.000Z | 2020-02-06T14:28:45.000Z | test/tests/reinitializable.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | test/tests/reinitializable.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:29:00.000Z | 2020-02-06T14:29:00.000Z | # Not sure if these are important or not:
p = property(1, 2, 3)
print p.fset
property.__init__(p, 4, 5, 6)
print p.fset
s = staticmethod(7)
print s.__get__(8)
staticmethod.__init__(s, 9)
print s.__get__(10)
c = classmethod(11)
print c.__get__(12).im_func
classmethod.__init__(c, 13)
print c.__get__(13).im_func
sl = ... | 17.636364 | 41 | 0.701031 |
p = property(1, 2, 3)
print p.fset
property.__init__(p, 4, 5, 6)
print p.fset
s = staticmethod(7)
print s.__get__(8)
staticmethod.__init__(s, 9)
print s.__get__(10)
c = classmethod(11)
print c.__get__(12).im_func
classmethod.__init__(c, 13)
print c.__get__(13).im_func
sl = slice(14, 15, 16)
print sl.start
slice.__... | false | true |
1c1a803c785af4a81fbee3d55a9f65c6b45f9011 | 4,779 | py | Python | test/helper_classes.py | mbollmann/perceptron | 05e00af80491bed67859f09a71f15a3f0cf4b51b | [
"MIT"
] | null | null | null | test/helper_classes.py | mbollmann/perceptron | 05e00af80491bed67859f09a71f15a3f0cf4b51b | [
"MIT"
] | 6 | 2015-11-10T17:38:19.000Z | 2015-11-23T16:29:54.000Z | test/helper_classes.py | mbollmann/perceptron | 05e00af80491bed67859f09a71f15a3f0cf4b51b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Contains helper classes, such as feature extractors, that are used in the tests.
"""
import numpy as np
from mmb_perceptron.feature_extractor import FeatureExtractor
from mmb_perceptron.feature_extractor.generator import GenerativeExtractor
class BinaryFeatureExtractor(FeatureExtractor):
... | 34.381295 | 83 | 0.575643 |
import numpy as np
from mmb_perceptron.feature_extractor import FeatureExtractor
from mmb_perceptron.feature_extractor.generator import GenerativeExtractor
class BinaryFeatureExtractor(FeatureExtractor):
_binary_featureset = ('bias', 'lhs_true', 'rhs_true')
def _init_independent(self, dataset):
self... | true | true |
1c1a827b704c1a8ac9b4357f2a01a4a2099d8a36 | 844 | py | Python | setup.py | themis-project/themis-attack-py | f32e0cb89e14e4e308cac8c9a3d9642b66db9573 | [
"MIT"
] | 3 | 2015-09-09T16:22:03.000Z | 2016-04-23T13:04:06.000Z | setup.py | themis-project/themis-attack-py | f32e0cb89e14e4e308cac8c9a3d9642b66db9573 | [
"MIT"
] | null | null | null | setup.py | themis-project/themis-attack-py | f32e0cb89e14e4e308cac8c9a3d9642b66db9573 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import io
import os
about = {}
about_filename = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'themis', 'attack', '__about__.py')
with io.open(about_filename, 'rb') as fp:
exec(fp.read(), about)
setup(
name='themis.atta... | 23.444444 | 56 | 0.622038 |
from setuptools import setup, find_packages
import io
import os
about = {}
about_filename = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'themis', 'attack', '__about__.py')
with io.open(about_filename, 'rb') as fp:
exec(fp.read(), about)
setup(
name='themis.attack',
version=about[... | true | true |
1c1a82ade73b1285dfc03f9d2d461d8c65dceaf7 | 597 | py | Python | staff/admin/instructor_epertises.py | mamalmaleki/maktab-community | 8ce25053ea0f6f0a6c082617c9ff306d1ada9707 | [
"MIT"
] | null | null | null | staff/admin/instructor_epertises.py | mamalmaleki/maktab-community | 8ce25053ea0f6f0a6c082617c9ff306d1ada9707 | [
"MIT"
] | null | null | null | staff/admin/instructor_epertises.py | mamalmaleki/maktab-community | 8ce25053ea0f6f0a6c082617c9ff306d1ada9707 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib import admin
from .. import models
class InstructorExpertiseForm(forms.ModelForm):
class Meta:
model = models.InstructorExpertise
fields = '__all__'
class InstructorExpertiseAdmin(admin.ModelAdmin):
form = InstructorExpertiseForm
fields = ('... | 27.136364 | 78 | 0.690117 | from django import forms
from django.contrib import admin
from .. import models
class InstructorExpertiseForm(forms.ModelForm):
class Meta:
model = models.InstructorExpertise
fields = '__all__'
class InstructorExpertiseAdmin(admin.ModelAdmin):
form = InstructorExpertiseForm
fields = ('... | true | true |
1c1a83050ffb3e52535edb5dd8ad6e28da5685fd | 33 | py | Python | godity/math/__init__.py | Xnork/GodityEngine | eb058aa0b92a2992138a2ddc5f2538894c3a7812 | [
"MIT"
] | 8 | 2021-01-25T19:23:27.000Z | 2021-07-19T14:31:54.000Z | godity/math/__init__.py | Xnork/GodityEngine | eb058aa0b92a2992138a2ddc5f2538894c3a7812 | [
"MIT"
] | null | null | null | godity/math/__init__.py | Xnork/GodityEngine | eb058aa0b92a2992138a2ddc5f2538894c3a7812 | [
"MIT"
] | 2 | 2021-01-25T19:26:15.000Z | 2021-08-07T00:10:02.000Z | from godity.math.Vector2 import * | 33 | 33 | 0.818182 | from godity.math.Vector2 import * | true | true |
1c1a857a4a82f27a47ce11a915d41d8a6ce57128 | 31,007 | py | Python | fastapi/dependencies/utils.py | Borisoid/fastapi | 2eb5097c755517bc43ad0372014efc66ae0a8f61 | [
"MIT"
] | null | null | null | fastapi/dependencies/utils.py | Borisoid/fastapi | 2eb5097c755517bc43ad0372014efc66ae0a8f61 | [
"MIT"
] | null | null | null | fastapi/dependencies/utils.py | Borisoid/fastapi | 2eb5097c755517bc43ad0372014efc66ae0a8f61 | [
"MIT"
] | null | null | null | import dataclasses
import inspect
from contextlib import contextmanager
from copy import deepcopy
from typing import (
Any,
Callable,
Coroutine,
Dict,
List,
Mapping,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
import anyio
from fastapi import params
from fastapi.conc... | 36.6513 | 107 | 0.663947 | import dataclasses
import inspect
from contextlib import contextmanager
from copy import deepcopy
from typing import (
Any,
Callable,
Coroutine,
Dict,
List,
Mapping,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
import anyio
from fastapi import params
from fastapi.conc... | true | true |
1c1a858ef61576e59c8b11bb9da5ca87e918aa61 | 3,454 | py | Python | src/bitcaster/web/views/callbacks.py | bitcaster-io/bitcaster | 9f1bad96e00e3bc78a22451731e231d30662b166 | [
"BSD-3-Clause"
] | 4 | 2018-03-01T10:22:30.000Z | 2020-04-04T16:31:11.000Z | src/bitcaster/web/views/callbacks.py | bitcaster-io/bitcaster | 9f1bad96e00e3bc78a22451731e231d30662b166 | [
"BSD-3-Clause"
] | 60 | 2018-05-20T04:42:32.000Z | 2022-02-10T17:03:37.000Z | src/bitcaster/web/views/callbacks.py | bitcaster-io/bitcaster | 9f1bad96e00e3bc78a22451731e231d30662b166 | [
"BSD-3-Clause"
] | 1 | 2018-08-04T05:06:45.000Z | 2018-08-04T05:06:45.000Z | import logging
from constance import config
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.utils import timezone
from django.views.decorators.http import require_http_methods
from bitcaster.models import Notification, Occurenc... | 42.121951 | 101 | 0.605096 | import logging
from constance import config
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.utils import timezone
from django.views.decorators.http import require_http_methods
from bitcaster.models import Notification, Occurenc... | true | true |
1c1a86dec6d24e6054b686fc1e35804c698b3d78 | 1,182 | py | Python | hackerearth/Algorithms/Raghu Vs Sayan/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerearth/Algorithms/Raghu Vs Sayan/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerearth/Algorithms/Raghu Vs Sayan/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | """
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
t = int(input())
for _ in range(t):
a, ... | 28.829268 | 94 | 0.461929 |
t = int(input())
for _ in range(t):
a, b, n = map(int, input().split())
kCals = list(map(int, input().split()))
if a == b:
print('Tie')
else:
raghu_count = sayan_count = raghu_done = sayan_done = 0
kCals.sort()
for kCal in kCals:
if raghu_done != 1:
... | true | true |
1c1a874f462704bb21b985ac2653cb99f9e8cd06 | 351 | py | Python | offspect/gui/VWidgets/message.py | translationalneurosurgery/tool-offspect | 011dafb697e8542fc7c3cf8af8523af3ff704a14 | [
"MIT"
] | 1 | 2022-02-23T12:26:45.000Z | 2022-02-23T12:26:45.000Z | offspect/gui/VWidgets/message.py | neuromti/tool-offspect | 011dafb697e8542fc7c3cf8af8523af3ff704a14 | [
"MIT"
] | 51 | 2020-03-15T14:52:36.000Z | 2020-09-28T09:30:53.000Z | offspect/gui/VWidgets/message.py | neuromti/tool-offspect | 011dafb697e8542fc7c3cf8af8523af3ff704a14 | [
"MIT"
] | 1 | 2020-03-24T07:35:30.000Z | 2020-03-24T07:35:30.000Z | # from PyQt5.QtWidgets import QMessageBox
# def raise_error(message: str = "DEFAULT:Error Description:More Information"):
# box = QMessageBox()
# kind, msg, info = message.split(":")
# box.setIcon(QMessageBox.Critical)
# box.setWindowTitle(kind + " Error")
# box.setText(msg)
# box.setInformati... | 29.25 | 79 | 0.669516 | true | true | |
1c1a87ccf63b9af0a8e354b7e60f857ebb8b78f6 | 69,225 | py | Python | algorithms/scaling/scaler.py | Anthchirp/dials | 211cf7646d6711769b86643b010cb2fe5aaf71b9 | [
"BSD-3-Clause"
] | null | null | null | algorithms/scaling/scaler.py | Anthchirp/dials | 211cf7646d6711769b86643b010cb2fe5aaf71b9 | [
"BSD-3-Clause"
] | 2 | 2020-07-31T22:37:30.000Z | 2020-07-31T23:08:55.000Z | algorithms/scaling/scaler.py | Anthchirp/dials | 211cf7646d6711769b86643b010cb2fe5aaf71b9 | [
"BSD-3-Clause"
] | null | null | null | """
This module defines classes which implement the stages of the scaling algorithm.
These 'scalers' act to initialise and connect various parts of the scaling
algorithm and datastructures such as the Ih_table etc, and
present a united interface to the main scaling algorithm for single, multi
and targeted scaling.
Th... | 43.510371 | 95 | 0.618476 | from __future__ import absolute_import, division, print_function
import copy
import logging
import time
from math import ceil
from collections import OrderedDict
from dials.util import tabulate
import six
from six.moves import cStringIO as StringIO
from dials_scaling_ext import row_multiply
from dials_scaling_ext imp... | true | true |
1c1a87d332587784c3416864d00220108f6b27e4 | 1,198 | py | Python | run_dataset.py | lh-wang/ACC | 1561f53a21f909495d7ce791196ea49d7eb4879d | [
"MIT"
] | 5 | 2018-04-16T02:40:47.000Z | 2021-01-30T19:56:21.000Z | run_dataset.py | gholakemohit/Autopilot-TensorFlow | 4133f590ce17b977e6650c62d44d45067b0a6bf4 | [
"MIT"
] | 1 | 2019-10-11T09:54:44.000Z | 2019-10-11T09:54:44.000Z | run_dataset.py | Alexxand-alter/Autopilot-TensorFlow-clone | 3387a2cd585bd9dee581ab53d64cb0e47d870bbd | [
"MIT"
] | 3 | 2017-12-11T02:59:34.000Z | 2021-01-30T14:42:43.000Z | import tensorflow as tf
import scipy.misc
import model
import cv2
from subprocess import call
sess = tf.InteractiveSession()
saver = tf.train.Saver()
saver.restore(sess, "save/model.ckpt")
img = cv2.imread('steering_wheel_image.jpg',0)
rows,cols = img.shape
smoothed_angle = 0
i = 0
while(cv2.waitKey(10) != ord('q')... | 36.30303 | 136 | 0.692821 | import tensorflow as tf
import scipy.misc
import model
import cv2
from subprocess import call
sess = tf.InteractiveSession()
saver = tf.train.Saver()
saver.restore(sess, "save/model.ckpt")
img = cv2.imread('steering_wheel_image.jpg',0)
rows,cols = img.shape
smoothed_angle = 0
i = 0
while(cv2.waitKey(10) != ord('q')... | true | true |
1c1a88c7b57326764b326d3f4d6251756dfbc516 | 15,426 | py | Python | lib/python/pyflyby/_modules.py | Quansight/pyflyby-old | 8f83d2f2335419512a8f3d72f21186d4a4a975e0 | [
"BSD-3-Clause"
] | null | null | null | lib/python/pyflyby/_modules.py | Quansight/pyflyby-old | 8f83d2f2335419512a8f3d72f21186d4a4a975e0 | [
"BSD-3-Clause"
] | null | null | null | lib/python/pyflyby/_modules.py | Quansight/pyflyby-old | 8f83d2f2335419512a8f3d72f21186d4a4a975e0 | [
"BSD-3-Clause"
] | 1 | 2021-04-08T11:21:28.000Z | 2021-04-08T11:21:28.000Z | # pyflyby/_modules.py.
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT
from __future__ import (absolute_import, division, print_function,
with_statement)
from functools import total_ordering
import os
import re
import s... | 35.874419 | 79 | 0.594775 |
from __future__ import (absolute_import, division, print_function,
with_statement)
from functools import total_ordering
import os
import re
import six
from six import reraise
import sys
import types
from pyflyby._file import FileText, Fi... | true | true |
1c1a895212c0e6b58516c7877b0df57652c74a6f | 319 | py | Python | Lab 8/BouncingBallsRandom5/Controls.py | Cheezegami/HKU-ECTTP | 1bfeefbb6ed372128edd2e62602fe5c8d35bd0bd | [
"MIT"
] | null | null | null | Lab 8/BouncingBallsRandom5/Controls.py | Cheezegami/HKU-ECTTP | 1bfeefbb6ed372128edd2e62602fe5c8d35bd0bd | [
"MIT"
] | null | null | null | Lab 8/BouncingBallsRandom5/Controls.py | Cheezegami/HKU-ECTTP | 1bfeefbb6ed372128edd2e62602fe5c8d35bd0bd | [
"MIT"
] | null | null | null | <<<<<<< HEAD
class Controls() :
#Right, Left, Down, Up, Special.
#Keyboard.
String_controls = ["D","A","S","W"," "]
=======
class Controls() :
#Right, Left, Down, Up, Special.
#Keyboard.
String_controls = ["D","A","S","W"," "]
>>>>>>> origin/master
String_altControls = ["d","a","s","w","c"] | 26.583333 | 46 | 0.510972 | <<<<<<< HEAD
class Controls() :
String_controls = ["D","A","S","W"," "]
=======
class Controls() :
String_controls = ["D","A","S","W"," "]
>>>>>>> origin/master
String_altControls = ["d","a","s","w","c"] | false | true |
1c1a8a995f0ca33846ce1424fdc8ea7a6189fb94 | 977 | py | Python | tests/test2.py | Cavenfish/qmspy | 4ac6191b22d606ce007b5fb7b75a3c0734b41a70 | [
"MIT"
] | null | null | null | tests/test2.py | Cavenfish/qmspy | 4ac6191b22d606ce007b5fb7b75a3c0734b41a70 | [
"MIT"
] | null | null | null | tests/test2.py | Cavenfish/qmspy | 4ac6191b22d606ce007b5fb7b75a3c0734b41a70 | [
"MIT"
] | null | null | null | import qmspy as qp
#Directory Strings
datadir0 = '../CSV Files/2019-01-17/'
datadir1 = '../CSV Files/2019-01-26/'
outdir0 = './10e-6 Methane/'
outdir1 = './1.50-1.51 e-7 Methane/'
outdir2 = './1.43-1.45 e-8 Methane/'
outdir3 = './1.10-1.45 e-9 Methane/'
#File Extensions
csv = '.csv'
#Data File... | 32.566667 | 69 | 0.646878 | import qmspy as qp
datadir0 = '../CSV Files/2019-01-17/'
datadir1 = '../CSV Files/2019-01-26/'
outdir0 = './10e-6 Methane/'
outdir1 = './1.50-1.51 e-7 Methane/'
outdir2 = './1.43-1.45 e-8 Methane/'
outdir3 = './1.10-1.45 e-9 Methane/'
csv = '.csv'
empty0 = datadir0 + '10e-9 methane exper... | true | true |
1c1a8c2ffd2df47e771ed62126d14382ff7ec814 | 389 | py | Python | bloggy/wsgi.py | ediziks/yaziyo.co | 0badd7e6ee555d45dd2ba856640c725886a2e2a4 | [
"MIT"
] | null | null | null | bloggy/wsgi.py | ediziks/yaziyo.co | 0badd7e6ee555d45dd2ba856640c725886a2e2a4 | [
"MIT"
] | 5 | 2022-02-22T22:53:20.000Z | 2022-02-22T22:53:21.000Z | bloggy/wsgi.py | ediziks/yaziyo.co | 0badd7e6ee555d45dd2ba856640c725886a2e2a4 | [
"MIT"
] | null | null | null | """
WSGI config for bloggy project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bloggy.settings')
application = get_wsgi_application()
| true | true |
1c1a8e005bb491423a5b5ae0bae8185ee658901e | 4,586 | py | Python | rsfsup/ssa/instrument.py | l-johnston/rsfsup | da1da721049bf4952cfc314b3680a85824a16cd6 | [
"MIT"
] | 1 | 2021-04-16T07:57:54.000Z | 2021-04-16T07:57:54.000Z | rsfsup/ssa/instrument.py | l-johnston/rsfsup | da1da721049bf4952cfc314b3680a85824a16cd6 | [
"MIT"
] | null | null | null | rsfsup/ssa/instrument.py | l-johnston/rsfsup | da1da721049bf4952cfc314b3680a85824a16cd6 | [
"MIT"
] | 2 | 2020-03-25T06:35:52.000Z | 2021-04-16T07:57:56.000Z | """Signal Source Analyzer mode (PNO)"""
import sys
import itertools
import asyncio
from dataclasses import dataclass
import pyvisa
from unyt import unyt_array
from rsfsup.common import Subsystem
from rsfsup.ssa.display import Display
from rsfsup.ssa.configure import Configure
from rsfsup.ssa.traces import Tra... | 36.396825 | 92 | 0.583733 | import sys
import itertools
import asyncio
from dataclasses import dataclass
import pyvisa
from unyt import unyt_array
from rsfsup.common import Subsystem
from rsfsup.ssa.display import Display
from rsfsup.ssa.configure import Configure
from rsfsup.ssa.traces import Trace
@dataclass
class State:
r... | true | true |
1c1a8e867c0a56944a42172ecb71546096607bbe | 336 | py | Python | dnsmon/webapp/supportlib.py | 3ev0/dns-monitor | 3a0ded3fbd7a52211e64b884e5e6471e738a3697 | [
"Apache-2.0"
] | 2 | 2015-05-26T07:08:18.000Z | 2021-02-04T02:16:40.000Z | dnsmon/webapp/supportlib.py | 3ev0/dns-monitor | 3a0ded3fbd7a52211e64b884e5e6471e738a3697 | [
"Apache-2.0"
] | null | null | null | dnsmon/webapp/supportlib.py | 3ev0/dns-monitor | 3a0ded3fbd7a52211e64b884e5e6471e738a3697 | [
"Apache-2.0"
] | null | null | null | __author__ = 'ivo'
from dnsmon import mongostore
import re
import difflib
def parse_names_from_liststring(liststring):
sep_chars = (" ",",",";","\t","\t","\r","\n")
names = re.split("[\'\"\s\,\;]+", liststring)
return names
def strdiff(a, b):
d = difflib.Differ()
results = list(d.compare(a,b))
... | 22.4 | 49 | 0.616071 | __author__ = 'ivo'
from dnsmon import mongostore
import re
import difflib
def parse_names_from_liststring(liststring):
sep_chars = (" ",",",";","\t","\t","\r","\n")
names = re.split("[\'\"\s\,\;]+", liststring)
return names
def strdiff(a, b):
d = difflib.Differ()
results = list(d.compare(a,b))
... | true | true |
1c1a8f0de8e0a1c0216e0d7fb65ec83b1800b614 | 4,877 | py | Python | src/python/pants/backend/terraform/dependency_inference_test.py | chebbyChefNEQ/pants | a53b9d29a160f36f9af1d1a2c43a693b6a55fa55 | [
"Apache-2.0"
] | 1 | 2016-04-27T15:35:42.000Z | 2016-04-27T15:35:42.000Z | src/python/pants/backend/terraform/dependency_inference_test.py | chebbyChefNEQ/pants | a53b9d29a160f36f9af1d1a2c43a693b6a55fa55 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/terraform/dependency_inference_test.py | chebbyChefNEQ/pants | a53b9d29a160f36f9af1d1a2c43a693b6a55fa55 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import textwrap
import pytest
from pants.backend.python.util_rules.pex import rules as pex_rules
from pants.backend.terraform import dependency_inference
from pants.backend.terraform.depe... | 34.835714 | 97 | 0.622719 |
import textwrap
import pytest
from pants.backend.python.util_rules.pex import rules as pex_rules
from pants.backend.terraform import dependency_inference
from pants.backend.terraform.dependency_inference import (
InferTerraformModuleDependenciesRequest,
ParseTerraformModuleSources,
TerraformHcl2Parser,
... | true | true |
1c1a8fdd5ac40376d0864b6d0607569a4a9cc4f1 | 2,240 | py | Python | kaskade/cli.py | sauljabin/kaskade | fe270821dd05459df11adaabbd5a0ea39809456e | [
"MIT"
] | 16 | 2021-10-02T02:58:17.000Z | 2022-02-13T13:09:27.000Z | kaskade/cli.py | sauljabin/kaskade | fe270821dd05459df11adaabbd5a0ea39809456e | [
"MIT"
] | 3 | 2021-11-17T17:08:12.000Z | 2022-02-07T23:54:04.000Z | kaskade/cli.py | sauljabin/kaskade | fe270821dd05459df11adaabbd5a0ea39809456e | [
"MIT"
] | 1 | 2021-12-22T17:15:54.000Z | 2021-12-22T17:15:54.000Z | import sys
from logging import DEBUG
from confluent_kafka import KafkaException
from rich.console import Console
from kaskade import logger
from kaskade.config import Config
from kaskade.emojis import THINKING_FACE
from kaskade.renderables.config_examples import ConfigExamples
from kaskade.renderables.kaskade_info im... | 28 | 84 | 0.624554 | import sys
from logging import DEBUG
from confluent_kafka import KafkaException
from rich.console import Console
from kaskade import logger
from kaskade.config import Config
from kaskade.emojis import THINKING_FACE
from kaskade.renderables.config_examples import ConfigExamples
from kaskade.renderables.kaskade_info im... | true | true |
1c1a9032b4a07e4ba0d093070b56f710467b8904 | 17,307 | py | Python | tests/classification/test_f_beta.py | Borda/torchmetrics | 6144eb3b248b7fa315bb9afeb96c690a5d747001 | [
"Apache-2.0"
] | null | null | null | tests/classification/test_f_beta.py | Borda/torchmetrics | 6144eb3b248b7fa315bb9afeb96c690a5d747001 | [
"Apache-2.0"
] | null | null | null | tests/classification/test_f_beta.py | Borda/torchmetrics | 6144eb3b248b7fa315bb9afeb96c690a5d747001 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 37.38013 | 120 | 0.660195 |
from functools import partial
from typing import Callable, Optional
import numpy as np
import pytest
import torch
from sklearn.metrics import f1_score, fbeta_score
from torch import Tensor
from tests.classification.inputs import _input_binary, _input_binary_logits, _input_binary_prob
from tests.classific... | true | true |
1c1a90bb9089abe9b5911579d5883cbf6a3e3790 | 797 | py | Python | scripts/letsencrypt/boulder/start.py | influx6/tlsfs | 49c59472132e16b94e1711bfafa97cae10e5ef79 | [
"MIT"
] | 2 | 2017-07-05T09:57:33.000Z | 2017-11-14T23:05:53.000Z | scripts/letsencrypt/boulder/start.py | influx6/tlsfs | 49c59472132e16b94e1711bfafa97cae10e5ef79 | [
"MIT"
] | 1 | 2019-01-17T14:26:22.000Z | 2019-01-17T22:56:26.000Z | scripts/letsencrypt/boulder/start.py | influx6/tlsfs | 49c59472132e16b94e1711bfafa97cae10e5ef79 | [
"MIT"
] | 1 | 2017-08-31T14:33:03.000Z | 2017-08-31T14:33:03.000Z | #!/usr/bin/python2.7 -u
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C. Exit non-zero if any servers fail to
start, or die before ^C.
"""
import errno
import os
import sys
import time
sys.path.append('./test... | 23.441176 | 74 | 0.710163 |
"""
Run a local instance of Boulder for testing purposes.
This runs in non-monolithic mode and requires RabbitMQ on localhost.
Keeps servers alive until ^C. Exit non-zero if any servers fail to
start, or die before ^C.
"""
import errno
import os
import sys
import time
sys.path.append('./test')
import startservers
... | false | true |
1c1a9239c7162d116c4111d8597aaede7150acce | 23,056 | py | Python | sdk/python/pulumi_aws/lb/target_group.py | texdc/pulumi-aws | 93a7a28ab7db6b1cd7e6686c0b68aa4c89490d4f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lb/target_group.py | texdc/pulumi-aws | 93a7a28ab7db6b1cd7e6686c0b68aa4c89490d4f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lb/target_group.py | texdc/pulumi-aws | 93a7a28ab7db6b1cd7e6686c0b68aa4c89490d4f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Target... | 89.712062 | 460 | 0.713524 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class TargetGroup(pulumi.CustomResource):
arn: pulumi.Output[str]
arn_suffix: pulumi.Output[str]
deregistration_delay: pulumi.Output[float]
health_check: pulumi.Output[dict]
... | true | true |
1c1a927aae6198056baf00c803b8ceaf2c85301c | 126 | py | Python | soloact/data/__init__.py | ADGEfficiency/soloact | 8c36c03b5d502f3cea1d89d180cbfbc2b830fb3c | [
"MIT"
] | null | null | null | soloact/data/__init__.py | ADGEfficiency/soloact | 8c36c03b5d502f3cea1d89d180cbfbc2b830fb3c | [
"MIT"
] | null | null | null | soloact/data/__init__.py | ADGEfficiency/soloact | 8c36c03b5d502f3cea1d89d180cbfbc2b830fb3c | [
"MIT"
] | null | null | null | from soloact.data.annotations_chords import write_annotation, write_chords
from soloact.data.make_dataset import augment_data
| 42 | 74 | 0.888889 | from soloact.data.annotations_chords import write_annotation, write_chords
from soloact.data.make_dataset import augment_data
| true | true |
1c1a92f00b6452a03f1c050627a8933c16236285 | 3,056 | py | Python | src/strategy/fetch_data.py | f304646673/scheduler_frame | 0a9ba45a6523cbf9bd50e9fa8e08c8bfd2a9204a | [
"Apache-2.0"
] | 9 | 2017-05-14T05:12:32.000Z | 2022-01-13T08:11:07.000Z | src/strategy/fetch_data.py | f304646673/scheduler_frame | 0a9ba45a6523cbf9bd50e9fa8e08c8bfd2a9204a | [
"Apache-2.0"
] | null | null | null | src/strategy/fetch_data.py | f304646673/scheduler_frame | 0a9ba45a6523cbf9bd50e9fa8e08c8bfd2a9204a | [
"Apache-2.0"
] | 7 | 2017-08-28T08:31:43.000Z | 2020-03-03T07:18:37.000Z | #coding=utf-8
#-*- coding: utf-8 -*-
import os
import re
import sys
import time
import socket
import urllib2
sys.path.append("../frame/")
from loggingex import LOG_INFO
from loggingex import LOG_ERROR
from loggingex import LOG_WARNING
from mysql_manager import mysql_manager
from regular_split_manager import regular_... | 29.960784 | 199 | 0.661649 |
import os
import re
import sys
import time
import socket
import urllib2
sys.path.append("../frame/")
from loggingex import LOG_INFO
from loggingex import LOG_ERROR
from loggingex import LOG_WARNING
from mysql_manager import mysql_manager
from regular_split_manager import regular_split_manager
class select_db:
... | false | true |
1c1a93c6938ba43764a0ca75fda120d2ef55bf68 | 1,355 | py | Python | tf/masking.py | congchan/nnnlp | 9a2026a2577817d485d139bf442de7fd602418e6 | [
"MIT"
] | 1 | 2020-01-13T06:09:49.000Z | 2020-01-13T06:09:49.000Z | tf/masking.py | congchan/nnnlp | 9a2026a2577817d485d139bf442de7fd602418e6 | [
"MIT"
] | null | null | null | tf/masking.py | congchan/nnnlp | 9a2026a2577817d485d139bf442de7fd602418e6 | [
"MIT"
] | 1 | 2020-10-12T12:08:46.000Z | 2020-10-12T12:08:46.000Z | """Generate all sort of masks"""
import tensorflow as tf
def upper_left_square_mask(mask):
"""
Transform a sequence mask to square mask
:param mask: A mask tensor of shape (batch, feature_size) specify each sample mask
:return: A mask tensor of shape (batch, feature_size, feature_size)
Example:
input
... | 28.229167 | 86 | 0.667159 |
import tensorflow as tf
def upper_left_square_mask(mask):
return tf.logical_and(
tf.expand_dims(mask, [1]),
tf.expand_dims(mask, [2])
)
def upper_triangular_mask(seq_length):
return tf.linalg.band_part(
tf.ones([seq_length, seq_length], tf.bool), 0, -1,
)
| true | true |
1c1a93e5630aada643ced05994305edcd2e600d4 | 1,676 | py | Python | game/actions.py | kim-tran/text-based-atk | eb33a39f1fcb70729d9c3a5a147923c5c95a1fe8 | [
"MIT"
] | null | null | null | game/actions.py | kim-tran/text-based-atk | eb33a39f1fcb70729d9c3a5a147923c5c95a1fe8 | [
"MIT"
] | null | null | null | game/actions.py | kim-tran/text-based-atk | eb33a39f1fcb70729d9c3a5a147923c5c95a1fe8 | [
"MIT"
] | null | null | null | from player import Player
class Action():
"""The base class for all actions"""
def __init__(self, method, name, hotkey, **kwargs):
"""Creates a new action
:param method: the function object to execute
:param name: the name of the action
:param ends_turn: True if the player is e... | 29.928571 | 95 | 0.662291 | from player import Player
class Action():
def __init__(self, method, name, hotkey, **kwargs):
self.method = method
self.hotkey = hotkey
self.name = name
self.kwargs = kwargs
def __str__(self):
return "{}: {}".format(self.hotkey, self.name)
class MoveNorth(Action):
... | true | true |
1c1a9426cd25d639795da2c441e6e4a5588e6ac7 | 1,013 | py | Python | my_utils/my_util.py | rilu0361/mytorch | 9f00b830b3ce8fdf942cd19704dedfe6ffd359a5 | [
"MIT"
] | null | null | null | my_utils/my_util.py | rilu0361/mytorch | 9f00b830b3ce8fdf942cd19704dedfe6ffd359a5 | [
"MIT"
] | null | null | null | my_utils/my_util.py | rilu0361/mytorch | 9f00b830b3ce8fdf942cd19704dedfe6ffd359a5 | [
"MIT"
] | null | null | null | """
my_util.py
関数のまとめ
"""
import shutil, os
'''
ファイルの存在チェック
'''
def check_file(path):
if os.path.exists(path):
check = input("CHECK : すでに{}が存在しています。削除しますか?(y/n) : ".format(path))
if check=="y" or check=="Y":
shutil.rmtree(path)
print("FILE : ",path,"を削除しました.")
... | 30.69697 | 76 | 0.624877 | import shutil, os
def check_file(path):
if os.path.exists(path):
check = input("CHECK : すでに{}が存在しています。削除しますか?(y/n) : ".format(path))
if check=="y" or check=="Y":
shutil.rmtree(path)
print("FILE : ",path,"を削除しました.")
else:
print("INFO : 任意の操作の後再実行し... | true | true |
1c1a946a1fe170500c3ccc27cfb3f3f62c9276ef | 4,247 | py | Python | mindspore/numpy/dtypes.py | chncwang/mindspore | 6dac92aedf0aa1541d181e6aedab29aaadc2dafb | [
"Apache-2.0"
] | 1 | 2021-03-10T09:05:13.000Z | 2021-03-10T09:05:13.000Z | mindspore/numpy/dtypes.py | king4arabs/mindspore | bc38590e5300588aa551355836043af0ea092a72 | [
"Apache-2.0"
] | null | null | null | mindspore/numpy/dtypes.py | king4arabs/mindspore | bc38590e5300588aa551355836043af0ea092a72 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 24.69186 | 87 | 0.594302 |
from ..common.dtype import (int8, int16, int32, int64, uint8, uint16, uint32, uint64,
float16, float32, float64, bool_)
inf = float('inf')
PINF = float('inf')
NINF = float('-inf')
nan = float('nan')
pi = 3.141592653589793
int_ = int32
uint = uint32
float_ = float32
nu... | true | true |
1c1a94890ead0ef2729d1d5194e94d628b73f8ed | 1,440 | py | Python | src/AuShadha/visit/visit_assessment_and_plan/urls.py | GosthMan/AuShadha | 3ab48825a0dba19bf880b6ac6141ab7a6adf1f3e | [
"PostgreSQL"
] | 46 | 2015-03-04T14:19:47.000Z | 2021-12-09T02:58:46.000Z | src/AuShadha/visit/visit_assessment_and_plan/urls.py | aytida23/AuShadha | 3ab48825a0dba19bf880b6ac6141ab7a6adf1f3e | [
"PostgreSQL"
] | 2 | 2015-06-05T10:29:04.000Z | 2015-12-06T16:54:10.000Z | src/AuShadha/visit/visit_assessment_and_plan/urls.py | aytida23/AuShadha | 3ab48825a0dba19bf880b6ac6141ab7a6adf1f3e | [
"PostgreSQL"
] | 24 | 2015-03-23T01:38:11.000Z | 2022-01-24T16:23:42.000Z | from django.conf.urls import *
import AuShadha.settings
from .views import *
#from utilities import *
urlpatterns = patterns('',
url(r'get/template/(?P<assessment_name>\w+)/(?P<visit_id>\d+)/$' ,
visit_assessment_and_plan_template ,
name="visit_assessment_and_plan_temp... | 30.638298 | 80 | 0.528472 | from django.conf.urls import *
import AuShadha.settings
from .views import *
urlpatterns = patterns('',
url(r'get/template/(?P<assessment_name>\w+)/(?P<visit_id>\d+)/$' ,
visit_assessment_and_plan_template ,
name="visit_assessment_and_plan_template"
),... | true | true |
1c1a95279710b7273a5aeda5d78689ffe459aca1 | 1,124 | py | Python | acq4/util/Canvas/items/CellCanvasItem.py | ablot/acq4 | ba7cd340d9d0282640adb501d3788f8c0837e4c4 | [
"MIT"
] | null | null | null | acq4/util/Canvas/items/CellCanvasItem.py | ablot/acq4 | ba7cd340d9d0282640adb501d3788f8c0837e4c4 | [
"MIT"
] | null | null | null | acq4/util/Canvas/items/CellCanvasItem.py | ablot/acq4 | ba7cd340d9d0282640adb501d3788f8c0837e4c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from CanvasItem import CanvasItem
from PyQt4 import QtCore, QtGui
import acq4.pyqtgraph as pg
import acq4.Manager
from .itemtypes import registerItemType
class CellCanvasItem(CanvasItem):
"""
Canvas item used for marking the location of cells.
"""
_typeName = "Cell"
... | 26.761905 | 61 | 0.588968 |
from CanvasItem import CanvasItem
from PyQt4 import QtCore, QtGui
import acq4.pyqtgraph as pg
import acq4.Manager
from .itemtypes import registerItemType
class CellCanvasItem(CanvasItem):
_typeName = "Cell"
def __init__(self, **opts):
if 'scale' not in opts:
opts['scale'] = [20e-6, 2... | true | true |
1c1a958d1ab5e4d1b88c7c6c00d096e781fe887d | 14,273 | py | Python | SparseGaussJordan/SparseGaussJordan.py | dwillcox/gauss-jordan-solver | 17d68b86abb18ddf53078ba6f11d8a7d1605f62a | [
"BSD-3-Clause"
] | 1 | 2020-11-18T19:32:26.000Z | 2020-11-18T19:32:26.000Z | SparseGaussJordan/SparseGaussJordan.py | dwillcox/gauss-jordan-solver | 17d68b86abb18ddf53078ba6f11d8a7d1605f62a | [
"BSD-3-Clause"
] | null | null | null | SparseGaussJordan/SparseGaussJordan.py | dwillcox/gauss-jordan-solver | 17d68b86abb18ddf53078ba6f11d8a7d1605f62a | [
"BSD-3-Clause"
] | 3 | 2019-05-23T07:28:07.000Z | 2021-03-22T13:37:56.000Z | """
Copyright (c) 2016, Donald E. Willcox
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the follo... | 39.10411 | 162 | 0.513697 | import sympy
from .Row import Row
from .Element import Element1D, Element2D
class GaussJordan(object):
def __init__(self, structure_file=None, compressed_sparse_row=False, out_py=None, out_f95=None, out_cpp=None, smp=None, expand=False, cse=None, verbose=None):
self.infile = structure_file
self.cse... | true | true |
1c1a95bc51b0e2a48371d4cd24c1febab6cf6087 | 265 | py | Python | src/python/models/__init__.py | tengyu-liu/Part-GPNN | d2092917edeee835fc1888101dddf42ad76ec5e5 | [
"MIT"
] | null | null | null | src/python/models/__init__.py | tengyu-liu/Part-GPNN | d2092917edeee835fc1888101dddf42ad76ec5e5 | [
"MIT"
] | null | null | null | src/python/models/__init__.py | tengyu-liu/Part-GPNN | d2092917edeee835fc1888101dddf42ad76ec5e5 | [
"MIT"
] | null | null | null | from .GPNN_CAD import GPNN_CAD
from .GPNN_HICO import GPNN_HICO
from .GPNN_VCOCO import GPNN_VCOCO
from .GPNN_VCOCO_v2 import GPNN_VCOCO_v2
from .GPNN_VCOCO_PG import GPNN_VCOCO_PG
__all__ = ('GPNN_CAD', 'GPNN_HICO', 'GPNN_VCOCO', 'GPNN_VCOCO_v2', 'GPNN_VCOCO_PG') | 37.857143 | 83 | 0.815094 | from .GPNN_CAD import GPNN_CAD
from .GPNN_HICO import GPNN_HICO
from .GPNN_VCOCO import GPNN_VCOCO
from .GPNN_VCOCO_v2 import GPNN_VCOCO_v2
from .GPNN_VCOCO_PG import GPNN_VCOCO_PG
__all__ = ('GPNN_CAD', 'GPNN_HICO', 'GPNN_VCOCO', 'GPNN_VCOCO_v2', 'GPNN_VCOCO_PG') | true | true |
1c1a9633fb48c1f257f0c612bba6a16c21868342 | 1,499 | py | Python | Api/__init__.py | Evavic44/Api | 3ff1691b8e0cc71baea0ed23ffd7284c6835c2e1 | [
"CC0-1.0"
] | 2 | 2020-12-26T15:36:21.000Z | 2021-01-26T07:33:03.000Z | Api/__init__.py | SpiffGreen/Api | ab6d67bbd05b8015df82ca6edd5ec944f7eea15d | [
"CC0-1.0"
] | null | null | null | Api/__init__.py | SpiffGreen/Api | ab6d67bbd05b8015df82ca6edd5ec944f7eea15d | [
"CC0-1.0"
] | 1 | 2021-01-26T07:33:06.000Z | 2021-01-26T07:33:06.000Z | import datetime
from flask import Flask
from flask_bcrypt import Bcrypt
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from .config import Config
from flask_cors import CORS
from flask_socketio import SocketIO
app = Flask(__name__)
cors... | 26.298246 | 87 | 0.733823 | import datetime
from flask import Flask
from flask_bcrypt import Bcrypt
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from .config import Config
from flask_cors import CORS
from flask_socketio import SocketIO
app = Flask(__name__)
cors... | true | true |
1c1a974ad0fe0b01d0db587a17244cdde86021e3 | 7,005 | py | Python | populate.py | HoverHell/python-pypi-template | 08707c2bead31bc5e3ba8608e1c328a415704f0c | [
"MIT"
] | null | null | null | populate.py | HoverHell/python-pypi-template | 08707c2bead31bc5e3ba8608e1c328a415704f0c | [
"MIT"
] | null | null | null | populate.py | HoverHell/python-pypi-template | 08707c2bead31bc5e3ba8608e1c328a415704f0c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# pylint: disable=missing-docstring
import fnmatch
import os
from os.path import abspath, dirname, join
import re
import sys
import textwrap
from datetime import date
from string import capwords
from subprocess import check_call, check_output
from configparser import ConfigParser
THIS_DIR = dir... | 28.13253 | 79 | 0.626124 |
import fnmatch
import os
from os.path import abspath, dirname, join
import re
import sys
import textwrap
from datetime import date
from string import capwords
from subprocess import check_call, check_output
from configparser import ConfigParser
THIS_DIR = dirname(abspath(__file__))
TEMPLATE_DIR = join(THIS_DIR, 't... | true | true |
1c1a97e8c56f164ff622a0a2756964b47fb6b95f | 1,091 | py | Python | preprocess.py | Mutefish0/graduation-project | b6c47e946a6ed2fe25389881828e15b5e522eeb5 | [
"Apache-2.0"
] | null | null | null | preprocess.py | Mutefish0/graduation-project | b6c47e946a6ed2fe25389881828e15b5e522eeb5 | [
"Apache-2.0"
] | null | null | null | preprocess.py | Mutefish0/graduation-project | b6c47e946a6ed2fe25389881828e15b5e522eeb5 | [
"Apache-2.0"
] | null | null | null | #coding=utf8
import numpy as np
from PIL import Image, ImageDraw
import sys
sys.path.append('tools')
from tool import binImg2vectors, img2binImg, random_rgb
from sklearn.cluster import KMeans
im = Image.open('./res/B02_E36518_0.jpg')
width, height = im.size
grey = im.convert('L')
vectors = []
for w in xrange(widt... | 19.482143 | 75 | 0.615949 |
import numpy as np
from PIL import Image, ImageDraw
import sys
sys.path.append('tools')
from tool import binImg2vectors, img2binImg, random_rgb
from sklearn.cluster import KMeans
im = Image.open('./res/B02_E36518_0.jpg')
width, height = im.size
grey = im.convert('L')
vectors = []
for w in xrange(width):
for ... | true | true |
1c1a97f56999658df1d4c273b8a3776129353b4c | 631 | py | Python | manage.py | WilliamOrringe/RideSharingMachineLearning | 5f0d2ac3cab5dbf8618cff202e201fe1c7016728 | [
"MIT"
] | null | null | null | manage.py | WilliamOrringe/RideSharingMachineLearning | 5f0d2ac3cab5dbf8618cff202e201fe1c7016728 | [
"MIT"
] | null | null | null | manage.py | WilliamOrringe/RideSharingMachineLearning | 5f0d2ac3cab5dbf8618cff202e201fe1c7016728 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ridesharing.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Im... | 28.681818 | 75 | 0.684628 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ridesharing.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c1a999153fdc75450d36728c1e678fe3c7e2a6f | 739 | py | Python | mk/bin/run_file_hash.py | sommercharles/fprime | f28c92e31d58e7e44bff09ad57d574ca5d5e91c7 | [
"Apache-2.0"
] | 1 | 2022-02-15T19:28:01.000Z | 2022-02-15T19:28:01.000Z | mk/bin/run_file_hash.py | abcouwer-jpl/fprime | f28c92e31d58e7e44bff09ad57d574ca5d5e91c7 | [
"Apache-2.0"
] | 5 | 2020-07-13T16:56:33.000Z | 2020-07-23T20:38:13.000Z | mk/bin/run_file_hash.py | abcouwer-jpl/fprime | f28c92e31d58e7e44bff09ad57d574ca5d5e91c7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
import os
filename = "%s"%sys.argv[1]
hash_val = hash(filename)% 0xFFFFFFFF # force to 32-bits
hash_arg = "0x%08X"%(hash_val)
# open local hash file
open("%s/mk/hash/%s"%(os.environ["BUILD_ROOT"],filename.replace(".","_")+".hash"),"w").write("%s: %s"%(hash_arg,filename))
# open fra... | 43.470588 | 310 | 0.625169 |
import sys
import os
filename = "%s"%sys.argv[1]
hash_val = hash(filename)% 0xFFFFFFFF
hash_arg = "0x%08X"%(hash_val)
open("%s/mk/hash/%s"%(os.environ["BUILD_ROOT"],filename.replace(".","_")+".hash"),"w").write("%s: %s"%(hash_arg,filename))
print(("%s"%hash_arg))
| true | true |
1c1a9b5856ff122164be1b1f5ceba098ff69fd0c | 2,311 | py | Python | LinkLayer/ether.py | markzxx/ImplementNetwork | f46f172a5aafe6ef975e77764a31f73cd2f2e269 | [
"MIT"
] | null | null | null | LinkLayer/ether.py | markzxx/ImplementNetwork | f46f172a5aafe6ef975e77764a31f73cd2f2e269 | [
"MIT"
] | null | null | null | LinkLayer/ether.py | markzxx/ImplementNetwork | f46f172a5aafe6ef975e77764a31f73cd2f2e269 | [
"MIT"
] | null | null | null | import json
import threading
from random import random
from socket import *
from LinkLayer.util import *
class IncomeHandler(threading.Thread):
def __init__(self, link_layer):
super(IncomeHandler, self).__init__()
self.link_layer = link_layer
def run(self):
while True:
fr... | 32.549296 | 97 | 0.561229 | import json
import threading
from random import random
from socket import *
from LinkLayer.util import *
class IncomeHandler(threading.Thread):
def __init__(self, link_layer):
super(IncomeHandler, self).__init__()
self.link_layer = link_layer
def run(self):
while True:
fr... | true | true |
1c1a9b76999ebcef31a663b567d1bbd82564ccc0 | 9,080 | py | Python | sdk/python/pulumi_azure_native/datalakestore/v20161101/trusted_id_provider.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datalakestore/v20161101/trusted_id_provider.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datalakestore/v20161101/trusted_id_provider.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 43.864734 | 269 | 0.65859 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = ['TrustedIdProviderArgs', 'TrustedIdProvider']
@pulumi.input_type
class TrustedIdProviderArgs:
def __init__(__self__, *,
account_name: ... | true | true |
1c1a9c58aaa34ceaf955695de392e3b1ed8cae95 | 10,157 | py | Python | mfem/_ser/socketstream.py | GabrielJie/PyMFEM | fa654447ac6819c5aa0341397b91a299f4ce5492 | [
"BSD-3-Clause"
] | 1 | 2022-01-19T07:16:59.000Z | 2022-01-19T07:16:59.000Z | mfem/_ser/socketstream.py | GabrielJie/PyMFEM | fa654447ac6819c5aa0341397b91a299f4ce5492 | [
"BSD-3-Clause"
] | null | null | null | mfem/_ser/socketstream.py | GabrielJie/PyMFEM | fa654447ac6819c5aa0341397b91a299f4ce5492 | [
"BSD-3-Clause"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | 36.800725 | 118 | 0.725805 |
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise RuntimeError("Python 2.7 or later required")
if __package__ or "." in __name__:
from . import _socketstream
else:
import _socketstream
try:
import builtins as __builtin__
except ImportError... | true | true |
1c1a9c6a45f797c68d38ea0cbc6104b692aae67e | 5,454 | py | Python | pyrestcli/fields.py | danicarrion/pyrestcli | 319a0d9574f47a2ff23cbce197bf412f5000d6fa | [
"MIT"
] | 5 | 2018-03-13T13:29:12.000Z | 2021-02-12T11:34:59.000Z | pyrestcli/fields.py | danicarrion/pyrestcli | 319a0d9574f47a2ff23cbce197bf412f5000d6fa | [
"MIT"
] | 21 | 2016-09-04T20:16:07.000Z | 2021-06-10T19:30:44.000Z | pyrestcli/fields.py | danicarrion/pyrestcli | 319a0d9574f47a2ff23cbce197bf412f5000d6fa | [
"MIT"
] | 5 | 2017-03-17T19:51:47.000Z | 2021-03-18T07:40:12.000Z | from dateutil.parser import parse
class Field(object):
"""
Fields represent attributes of resources. This class is meant to be subclassed everytime a new specific data type wants to be defined
on the value_class attribute.
This default field simply stores the value in the instance as it comes, suitab... | 35.187097 | 143 | 0.641914 | from dateutil.parser import parse
class Field(object):
def __init__(self, many=False):
self.many = many
self.name = None
def __get__(self, instance, owner):
if instance is not None and self.name is not None:
return instance.__dict__.get(self.name)
else:
... | true | true |
1c1a9ca050e9f99a01d79f2c4e57dab495272bc2 | 544 | py | Python | main.py | teitei-tk/AWS-Lambda-Python-Example | 1d26163712a4f324484ccec9eaf9b11947e39682 | [
"MIT"
] | null | null | null | main.py | teitei-tk/AWS-Lambda-Python-Example | 1d26163712a4f324484ccec9eaf9b11947e39682 | [
"MIT"
] | null | null | null | main.py | teitei-tk/AWS-Lambda-Python-Example | 1d26163712a4f324484ccec9eaf9b11947e39682 | [
"MIT"
] | null | null | null | import urllib2
from bs4 import BeautifulSoup
print("load function")
SCRAPING_URL = "https://news.google.com/"
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
def lambda_handler(event, context):
request = urllib2.Request(SCR... | 28.631579 | 136 | 0.727941 | import urllib2
from bs4 import BeautifulSoup
print("load function")
SCRAPING_URL = "https://news.google.com/"
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
def lambda_handler(event, context):
request = urllib2.Request(SCR... | true | true |
1c1a9cdaa705140eeeca279e27222d679ddd6d82 | 2,067 | py | Python | src/robot/result/__init__.py | rdagum/robotframework | b7069d505374e9f09a140ed5a9727d2a40716446 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/result/__init__.py | rdagum/robotframework | b7069d505374e9f09a140ed5a9727d2a40716446 | [
"ECL-2.0",
"Apache-2.0"
] | 127 | 2021-01-04T16:59:43.000Z | 2022-03-24T01:38:49.000Z | src/robot/result/__init__.py | rdagum/robotframework | b7069d505374e9f09a140ed5a9727d2a40716446 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | 42.183673 | 116 | 0.774069 |
from .executionresult import Result
from .model import (For, If, IfBranch, ForIteration, Keyword, Message, TestCase,
TestSuite, Return)
from .resultbuilder import ExecutionResult, ExecutionResultBuilder
from .visitor import ResultVisitor
| true | true |
1c1a9d252c32c0960b37b202b68c553876d7679c | 250 | py | Python | fuzzy_matching/__init__.py | INK-USC/procedural-extraction | 6b53d8a03bdd24560e96960fd0eddeee9ff8bc6f | [
"Apache-2.0"
] | 5 | 2019-09-11T20:29:35.000Z | 2022-03-27T13:16:51.000Z | fuzzy_matching/__init__.py | INK-USC/procedural-extraction | 6b53d8a03bdd24560e96960fd0eddeee9ff8bc6f | [
"Apache-2.0"
] | null | null | null | fuzzy_matching/__init__.py | INK-USC/procedural-extraction | 6b53d8a03bdd24560e96960fd0eddeee9ff8bc6f | [
"Apache-2.0"
] | null | null | null | from .dist import get_nearest_method, get_method_names
# import dist adaptors below
from .dist_exbert import extracted_bert_adaptor
from .dist_embavg import embavg_adaptor
from .dist_manual import manual_adaptor
from .dist_exact import exact_adaptor | 35.714286 | 54 | 0.868 | from .dist import get_nearest_method, get_method_names
from .dist_exbert import extracted_bert_adaptor
from .dist_embavg import embavg_adaptor
from .dist_manual import manual_adaptor
from .dist_exact import exact_adaptor | true | true |
1c1a9d91106f54edc69270713d431f3bc7e3641a | 7,880 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_probes_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2021-06-02T08:01:35.000Z | 2021-06-02T08:01:35.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_probes_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_probes_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2021-06-03T19:31:10.000Z | 2021-06-03T19:31:10.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 44.519774 | 176 | 0.654315 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class LoadBalancerProbesOperations(object):
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
sel... | true | true |
1c1a9dfbfb88778f3a6aa8f06f925295c99a8f4b | 3,182 | py | Python | Widen/LC759_Employee_Free_Time.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | Widen/LC759_Employee_Free_Time.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | Widen/LC759_Employee_Free_Time.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | """
759. Employee Free Time
We are given a list schedule of employees, which represents the working time for each employee.
Each employee has a list of non-overlapping Intervals, and these intervals are in sorted order.
Return the list of finite intervals representing common, positive-length free time for all employe... | 38.804878 | 309 | 0.634192 |
class Solution:
def employeeFreeTime(self, schedule: '[[Interval]]') -> '[Interval]':
START, END = 0, 1
all_interval = []
for person in schedule:
for interval in person:
all_interval.append((interval.start, START))
all_interval.append((inter... | true | true |
1c1a9e411529d5d8b68f39754d7a30129e316be4 | 194 | py | Python | tests/complex/urls.py | AGoodId/django-tastypie | 22a91974e006e352ce3ff8b8d95a75dbbb6668d5 | [
"BSD-3-Clause"
] | null | null | null | tests/complex/urls.py | AGoodId/django-tastypie | 22a91974e006e352ce3ff8b8d95a75dbbb6668d5 | [
"BSD-3-Clause"
] | null | null | null | tests/complex/urls.py | AGoodId/django-tastypie | 22a91974e006e352ce3ff8b8d95a75dbbb6668d5 | [
"BSD-3-Clause"
] | null | null | null | try:
from django.conf.urls import *
except ImportError: # Django < 1.4
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^api/', include('complex.api.urls')),
)
| 21.555556 | 44 | 0.659794 | try:
from django.conf.urls import *
except ImportError:
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^api/', include('complex.api.urls')),
)
| true | true |
1c1a9ea566ed151f994039774704a9f502d6d038 | 917 | py | Python | saraswati/mooncal/migrations/0004_event.py | tony-mikhailov/mooncal | 9f0a1a215a2d5fd2ec1f98803f666ea10106f25e | [
"MIT"
] | null | null | null | saraswati/mooncal/migrations/0004_event.py | tony-mikhailov/mooncal | 9f0a1a215a2d5fd2ec1f98803f666ea10106f25e | [
"MIT"
] | 9 | 2020-03-04T09:31:37.000Z | 2021-06-10T18:28:36.000Z | saraswati/mooncal/migrations/0004_event.py | tony-mikhailov/mooncal | 9f0a1a215a2d5fd2ec1f98803f666ea10106f25e | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2020-02-24 12:28
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mooncal', '0003_auto_20200223_1627'),
]
operations = [
migrations.CreateModel(
name='Event',
... | 35.269231 | 164 | 0.608506 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mooncal', '0003_auto_20200223_1627'),
]
operations = [
migrations.CreateModel(
name='Event',
fields=[
('id', model... | true | true |
1c1a9ec14078e4f563a293fa3c4f430b40775afe | 1,366 | py | Python | src/strategize/analysis.py | raghavaro/strategize | d8ec85b487fe5512689755cdc48c3ad7f76cff12 | [
"MIT"
] | 1 | 2020-07-21T12:45:06.000Z | 2020-07-21T12:45:06.000Z | src/strategize/analysis.py | raghavaro/strategize | d8ec85b487fe5512689755cdc48c3ad7f76cff12 | [
"MIT"
] | null | null | null | src/strategize/analysis.py | raghavaro/strategize | d8ec85b487fe5512689755cdc48c3ad7f76cff12 | [
"MIT"
] | null | null | null | import numpy as np
def find_pareto_optimal_outcomes(game):
# Assuming 2p game with 2 choices each
num_rows = 4
num_columns = 2
# change shape from 2,2,2 to 4,2
utilities_row = np.reshape(game.u, (num_rows, num_columns))
# add index to each utility
numbers = np.vstack(np.arange(num_rows))
... | 42.6875 | 123 | 0.673499 | import numpy as np
def find_pareto_optimal_outcomes(game):
num_rows = 4
num_columns = 2
utilities_row = np.reshape(game.u, (num_rows, num_columns))
numbers = np.vstack(np.arange(num_rows))
utilities_row = np.concatenate((numbers, utilities_row), axis=1)
sorted_utilities... | true | true |
1c1aa016bebafeef23b06d8df6105fd9bd0758b1 | 1,573 | py | Python | terse/Interface/ChkGaussian.py | talipovm/Terse | e6bfd3ac0d411b18d5167019623d5451695e787c | [
"MIT"
] | 2 | 2015-04-08T21:28:35.000Z | 2015-04-08T23:25:04.000Z | terse/Interface/ChkGaussian.py | talipovm/Terse | e6bfd3ac0d411b18d5167019623d5451695e787c | [
"MIT"
] | null | null | null | terse/Interface/ChkGaussian.py | talipovm/Terse | e6bfd3ac0d411b18d5167019623d5451695e787c | [
"MIT"
] | 1 | 2015-04-08T21:29:22.000Z | 2015-04-08T21:29:22.000Z | if __name__ == "__main__":
import sys,os
append_path = os.path.abspath(sys.argv[0])[:-22]
print("Append to PYTHONPATH: %s" % (append_path))
sys.path.append(append_path)
import time,logging
import subprocess
from Top import Top
from Tools.IO import is_readable
from Interface.FchkGaussian import FchkGaus... | 19.911392 | 64 | 0.62047 | if __name__ == "__main__":
import sys,os
append_path = os.path.abspath(sys.argv[0])[:-22]
print("Append to PYTHONPATH: %s" % (append_path))
sys.path.append(append_path)
import time,logging
import subprocess
from Top import Top
from Tools.IO import is_readable
from Interface.FchkGaussian import FchkGaus... | true | true |
1c1aa0319fb7149f66688815a9b1f70e840cae33 | 25 | py | Python | test/test_03.py | ulsanether/3-min-pytorch | aabb18a2d122c74b6eca8bb7d2219dfdfea153ba | [
"MIT"
] | null | null | null | test/test_03.py | ulsanether/3-min-pytorch | aabb18a2d122c74b6eca8bb7d2219dfdfea153ba | [
"MIT"
] | null | null | null | test/test_03.py | ulsanether/3-min-pytorch | aabb18a2d122c74b6eca8bb7d2219dfdfea153ba | [
"MIT"
] | null | null | null | #첫번째 입니다.
a =10
b=20
a+b | 5 | 9 | 0.56 |
a =10
b=20
a+b | true | true |
1c1aa0d4d1ceea95da9ab692e39017e481d147e2 | 5,948 | py | Python | unipipeline/definitions/uni_module_definition.py | aliaksandr-master/unipipeline | d8eac38534172aee59ab5777321cabe67f3779ef | [
"MIT"
] | null | null | null | unipipeline/definitions/uni_module_definition.py | aliaksandr-master/unipipeline | d8eac38534172aee59ab5777321cabe67f3779ef | [
"MIT"
] | 1 | 2021-09-14T13:08:13.000Z | 2021-09-14T13:08:13.000Z | unipipeline/definitions/uni_module_definition.py | aliaksandr-master/unipipeline | d8eac38534172aee59ab5777321cabe67f3779ef | [
"MIT"
] | null | null | null | import os.path
import importlib
from time import sleep
from typing import NamedTuple, Generic, Type, TypeVar, Any, Optional, Set, Callable
from unipipeline.utils.uni_util import UniUtil
from unipipeline.utils.uni_echo import UniEcho
T = TypeVar('T')
uni_broker_template = '''
from typing import Set, List
from unipip... | 36.716049 | 169 | 0.631137 | import os.path
import importlib
from time import sleep
from typing import NamedTuple, Generic, Type, TypeVar, Any, Optional, Set, Callable
from unipipeline.utils.uni_util import UniUtil
from unipipeline.utils.uni_echo import UniEcho
T = TypeVar('T')
uni_broker_template = '''
from typing import Set, List
from unipip... | true | true |
1c1aa298fea0cec28c26147daca509f6cae181e4 | 665 | py | Python | string/0017_letter_combinations_of_a_phone_number/0017_letter_combinations_of_a_phone_number.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 6 | 2019-09-16T01:50:44.000Z | 2020-09-17T08:52:25.000Z | string/0017_letter_combinations_of_a_phone_number/0017_letter_combinations_of_a_phone_number.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | null | null | null | string/0017_letter_combinations_of_a_phone_number/0017_letter_combinations_of_a_phone_number.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 4 | 2020-02-07T12:43:16.000Z | 2021-04-11T06:38:55.000Z | class Solution(object):
def letterCombinations(self, digits):
if not digits:
return []
letters = { "2": ["a","b","c"],
"3": ["d","e","f"],
"4": ["g","h","i"],
"5": ["j","k","l"],
"6": ["m","n","o"],
... | 28.913043 | 66 | 0.341353 | class Solution(object):
def letterCombinations(self, digits):
if not digits:
return []
letters = { "2": ["a","b","c"],
"3": ["d","e","f"],
"4": ["g","h","i"],
"5": ["j","k","l"],
"6": ["m","n","o"],
... | true | true |
1c1aa30534888bf09dc5632ec124871c77956c71 | 2,594 | py | Python | src/rocketpy.py | petcg/rocketpy | f1e2e4021b61faf046bbc5d1d1b98793e768c218 | [
"MIT"
] | 1 | 2019-01-09T05:17:01.000Z | 2019-01-09T05:17:01.000Z | src/rocketpy.py | petcg/rocketpy | f1e2e4021b61faf046bbc5d1d1b98793e768c218 | [
"MIT"
] | null | null | null | src/rocketpy.py | petcg/rocketpy | f1e2e4021b61faf046bbc5d1d1b98793e768c218 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''Simple wrapper of Rocket.Chat API.
'''
from http.client import HTTPConnection, HTTPSConnection, HTTPException
from http import HTTPStatus
from urllib.parse import urlparse
import json
class REST:
'''Simple wrapper of Rocket.Chat REST API.
'''
@classmetho... | 27.892473 | 79 | 0.551658 |
from http.client import HTTPConnection, HTTPSConnection, HTTPException
from http import HTTPStatus
from urllib.parse import urlparse
import json
class REST:
@classmethod
def fromlogin(cls, url, login):
rest = cls(url)
result = rest.POST('login', **login)
if result['status'... | true | true |
1c1aa454b7327710695ea5f3b24b4c902edef563 | 871 | py | Python | mmdet/ops/roi_align/gradcheck.py | dandelin/mmdetection | 03e1c72f1bb6222bdf9af3bfe60946cf008c7143 | [
"Apache-2.0"
] | null | null | null | mmdet/ops/roi_align/gradcheck.py | dandelin/mmdetection | 03e1c72f1bb6222bdf9af3bfe60946cf008c7143 | [
"Apache-2.0"
] | null | null | null | mmdet/ops/roi_align/gradcheck.py | dandelin/mmdetection | 03e1c72f1bb6222bdf9af3bfe60946cf008c7143 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
from torch.autograd import gradcheck
import os.path as osp
import sys
sys.path.insert(0, osp.abspath(osp.join(__file__, "../../")))
from roi_align import RoIAlign # noqa: E402
feat_size = 15
spatial_scale = 1.0 / 8
img_size = feat_size / spatial_scale
num_imgs = 2
num_rois = 20
batc... | 27.21875 | 76 | 0.714122 | import numpy as np
import torch
from torch.autograd import gradcheck
import os.path as osp
import sys
sys.path.insert(0, osp.abspath(osp.join(__file__, "../../")))
from roi_align import RoIAlign
feat_size = 15
spatial_scale = 1.0 / 8
img_size = feat_size / spatial_scale
num_imgs = 2
num_rois = 20
batch_ind = np.r... | true | true |
1c1aa4fe3a776fdc70d840768a3b9deacdbccf53 | 3,779 | py | Python | test/functional/wallet_keypool_topup.py | vivuscoin/vivuscoin | ba0db89712234bf68b2d6b63ef2c420d65c7c25d | [
"MIT"
] | null | null | null | test/functional/wallet_keypool_topup.py | vivuscoin/vivuscoin | ba0db89712234bf68b2d6b63ef2c420d65c7c25d | [
"MIT"
] | null | null | null | test/functional/wallet_keypool_topup.py | vivuscoin/vivuscoin | ba0db89712234bf68b2d6b63ef2c420d65c7c25d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Copyright (c) 2021 The Vivuscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test HD Wallet keypool restore function.
Two nodes.... | 42.460674 | 164 | 0.661286 |
import os
import shutil
from test_framework.test_framework import VivuscoinTestFramework
from test_framework.util import (
assert_equal,
connect_nodes_bi,
sync_blocks,
)
class KeypoolRestoreTest(VivuscoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
sel... | true | true |
1c1aa5a2c4eee10c10159175224d9b77ea57e57b | 181 | py | Python | configs/resnet/resnet50_8xb32-lbs_in1k.py | YuxinZou/mmclassification | 2037260ea6c98a3b115e97727e1151a1c2c32f7a | [
"Apache-2.0"
] | 1,190 | 2020-07-10T01:16:01.000Z | 2022-03-31T09:48:38.000Z | configs/resnet/resnet50_8xb32-lbs_in1k.py | YuxinZou/mmclassification | 2037260ea6c98a3b115e97727e1151a1c2c32f7a | [
"Apache-2.0"
] | 702 | 2020-07-13T13:31:33.000Z | 2022-03-31T06:48:04.000Z | configs/resnet/resnet50_8xb32-lbs_in1k.py | YuxinZou/mmclassification | 2037260ea6c98a3b115e97727e1151a1c2c32f7a | [
"Apache-2.0"
] | 502 | 2020-07-10T02:40:55.000Z | 2022-03-31T02:07:09.000Z | _base_ = [
'../_base_/models/resnet50_label_smooth.py',
'../_base_/datasets/imagenet_bs32.py',
'../_base_/schedules/imagenet_bs256.py', '../_base_/default_runtime.py'
]
| 30.166667 | 75 | 0.685083 | _base_ = [
'../_base_/models/resnet50_label_smooth.py',
'../_base_/datasets/imagenet_bs32.py',
'../_base_/schedules/imagenet_bs256.py', '../_base_/default_runtime.py'
]
| true | true |
1c1aa69189773395fc596831312ef8ef5f94f0e2 | 1,206 | py | Python | scripts/pcaDemo2d.py | onlyrichbrain/pyprobml | cc98c88fd6334d65fe5bc7975c4f27ed9fcf21e8 | [
"MIT"
] | 1 | 2022-03-13T15:27:31.000Z | 2022-03-13T15:27:31.000Z | scripts/pcaDemo2d.py | onlyrichbrain/pyprobml | cc98c88fd6334d65fe5bc7975c4f27ed9fcf21e8 | [
"MIT"
] | 5 | 2022-03-23T12:03:49.000Z | 2022-03-24T12:18:17.000Z | scripts/pcaDemo2d.py | onlyrichbrain/pyprobml | cc98c88fd6334d65fe5bc7975c4f27ed9fcf21e8 | [
"MIT"
] | 2 | 2022-03-26T11:52:36.000Z | 2022-03-27T05:17:48.000Z | import superimport
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
import os
import pyprobml_utils as pml
np.random.seed(42)
# Generate Data
n = 9
var = 3
corr = .5
cov_mat = [[var, corr * var], [corr * var, var]]
X = np.random.multivariate_normal([0, 0], cov_mat, n)
# Proj... | 24.612245 | 86 | 0.699005 | import superimport
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
import os
import pyprobml_utils as pml
np.random.seed(42)
n = 9
var = 3
corr = .5
cov_mat = [[var, corr * var], [corr * var, var]]
X = np.random.multivariate_normal([0, 0], cov_mat, n)
subspace_dim = 1
pca... | true | true |
1c1aa7d40db77040ba7d17db6086dedf02fa8ce0 | 745 | py | Python | agent/agent.py | aaitor/agent | 835ddf5037b1b6254eda57f056f54195670c17ff | [
"Apache-2.0"
] | null | null | null | agent/agent.py | aaitor/agent | 835ddf5037b1b6254eda57f056f54195670c17ff | [
"Apache-2.0"
] | null | null | null | agent/agent.py | aaitor/agent | 835ddf5037b1b6254eda57f056f54195670c17ff | [
"Apache-2.0"
] | 1 | 2019-08-28T09:19:05.000Z | 2019-08-28T09:19:05.000Z | import configparser
import argparse
"""Main module."""
def parse_args():
"""Parse command line arguments given to the agent"""
parser = argparse.ArgumentParser(description="Ocean Agent Application")
parser.add_argument('--config', metavar='path', required=True,
help='path to the ag... | 24.032258 | 75 | 0.672483 | import configparser
import argparse
def parse_args():
parser = argparse.ArgumentParser(description="Ocean Agent Application")
parser.add_argument('--config', metavar='path', required=True,
help='path to the agent.ini file')
args = parser.parse_args()
def parse_config(file_path):
... | true | true |
1c1aa814e4cd71714a89db17189371ebc1d6aba9 | 1,236 | py | Python | cvat/apps/engine/migrations/0029_data_storage_method.py | reinforcementdriving/cvat | d3675eec05b8c313ae8d89f074b38c1f13eb746c | [
"Intel",
"MIT"
] | 4,197 | 2018-06-30T05:47:50.000Z | 2020-09-08T07:34:22.000Z | cvat/apps/engine/migrations/0029_data_storage_method.py | nav13n/cvat | 9bdcc7f8f2d86a763ab5f306ea049ce1432da557 | [
"Intel",
"MIT"
] | 2,049 | 2020-09-08T10:01:10.000Z | 2022-03-31T19:08:15.000Z | cvat/apps/engine/migrations/0029_data_storage_method.py | nav13n/cvat | 9bdcc7f8f2d86a763ab5f306ea049ce1432da557 | [
"Intel",
"MIT"
] | 1,253 | 2018-06-30T05:47:58.000Z | 2020-09-08T02:19:52.000Z | # Generated by Django 2.2.13 on 2020-08-13 05:49
from cvat.apps.engine.media_extractors import _is_archive, _is_zip
import cvat.apps.engine.models
from django.conf import settings
from django.db import migrations, models
import os
from pyunpack import Archive
def unzip(apps, schema_editor):
Data = apps.get_model(... | 33.405405 | 180 | 0.679612 |
from cvat.apps.engine.media_extractors import _is_archive, _is_zip
import cvat.apps.engine.models
from django.conf import settings
from django.db import migrations, models
import os
from pyunpack import Archive
def unzip(apps, schema_editor):
Data = apps.get_model("engine", "Data")
data_q_set = Data.objects.... | true | true |
1c1aa867a74101ef2fa4f142d5c49ef3ba7f4d31 | 11,759 | py | Python | src/geneflow/extend/local_step.py | jhphan/geneflow2 | a39ab97e6425ee45584cfc15b5740e94a5bf7512 | [
"Apache-2.0"
] | null | null | null | src/geneflow/extend/local_step.py | jhphan/geneflow2 | a39ab97e6425ee45584cfc15b5740e94a5bf7512 | [
"Apache-2.0"
] | null | null | null | src/geneflow/extend/local_step.py | jhphan/geneflow2 | a39ab97e6425ee45584cfc15b5740e94a5bf7512 | [
"Apache-2.0"
] | null | null | null | """This module contains the GeneFlow LocalStep class."""
from slugify import slugify
from geneflow.log import Log
from geneflow.workflow_step import WorkflowStep
from geneflow.data_manager import DataManager
from geneflow.uri_parser import URIParser
from geneflow.shell_wrapper import ShellWrapper
class LocalStep(W... | 30.151282 | 92 | 0.507016 |
from slugify import slugify
from geneflow.log import Log
from geneflow.workflow_step import WorkflowStep
from geneflow.data_manager import DataManager
from geneflow.uri_parser import URIParser
from geneflow.shell_wrapper import ShellWrapper
class LocalStep(WorkflowStep):
def __init__(
self,
... | true | true |
1c1aa89e7bc4af04b4ce32bb00a5c6d6a61ca3a8 | 310 | py | Python | fic_location_eval_poc.py | nagasudhirpulla/wrldc_metering_warehouse | d56568783fb282c72977d537e51ed66f64dedf62 | [
"MIT"
] | null | null | null | fic_location_eval_poc.py | nagasudhirpulla/wrldc_metering_warehouse | d56568783fb282c72977d537e51ed66f64dedf62 | [
"MIT"
] | 2 | 2019-09-13T08:48:37.000Z | 2019-09-13T08:49:47.000Z | fic_location_eval_poc.py | nagasudhirpulla/wrldc_metering_warehouse | d56568783fb282c72977d537e51ed66f64dedf62 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 12 09:51:56 2019
@author: Nagasudhir
"""
from num_string_parser import NumericStringParser
nsp = NumericStringParser()
s = '+(KO-11) +(KO-12) +(KO-13) '
newStr = s.replace('KO-11', '45').replace('KO-12', '84').replace('KO-13', '34')
nsp.eval(newStr) | 25.833333 | 79 | 0.622581 |
from num_string_parser import NumericStringParser
nsp = NumericStringParser()
s = '+(KO-11) +(KO-12) +(KO-13) '
newStr = s.replace('KO-11', '45').replace('KO-12', '84').replace('KO-13', '34')
nsp.eval(newStr) | true | true |
1c1aa91f6048c588329a31ac6bb0ec6e2205355f | 40,984 | py | Python | featuretools/tests/computational_backend/test_feature_set_calculator.py | ridicolos/featuretools | 0af409da206e0b691ec64a3e0e618a43f1701dd9 | [
"BSD-3-Clause"
] | 942 | 2020-11-10T02:59:39.000Z | 2022-03-31T16:34:33.000Z | featuretools/tests/computational_backend/test_feature_set_calculator.py | 167rgc911/featuretools | bbad3f7392b203b7b9c250a93465052e7fc06bbc | [
"BSD-3-Clause"
] | 721 | 2020-11-09T23:12:06.000Z | 2022-03-31T22:33:35.000Z | featuretools/tests/computational_backend/test_feature_set_calculator.py | 167rgc911/featuretools | bbad3f7392b203b7b9c250a93465052e7fc06bbc | [
"BSD-3-Clause"
] | 127 | 2020-11-10T10:12:30.000Z | 2022-03-27T08:55:05.000Z | from datetime import datetime
import numpy as np
import pandas as pd
import pytest
from dask import dataframe as dd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Categorical, Datetime, Double, Integer
import featuretools as ft
from featuretools import Timedelta
from featuretools.c... | 37.913043 | 171 | 0.59838 | from datetime import datetime
import numpy as np
import pandas as pd
import pytest
from dask import dataframe as dd
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Categorical, Datetime, Double, Integer
import featuretools as ft
from featuretools import Timedelta
from featuretools.c... | true | true |
1c1aa983885f954af7593e6a27ad1ded77d68016 | 4,470 | py | Python | benchmark/mlp/swap-module.py | YyongXin/tf-mets | dacd9398170f5135feb7135b635d4cc3f6869369 | [
"Apache-2.0"
] | null | null | null | benchmark/mlp/swap-module.py | YyongXin/tf-mets | dacd9398170f5135feb7135b635d4cc3f6869369 | [
"Apache-2.0"
] | null | null | null | benchmark/mlp/swap-module.py | YyongXin/tf-mets | dacd9398170f5135feb7135b635d4cc3f6869369 | [
"Apache-2.0"
] | null | null | null | #
# 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... | 33.111111 | 80 | 0.599776 |
import sys
from singa import module
from singa import autograd
from singa import tensor
from singa.tensor import Tensor
class MLP(module.Module):
def __init__(self, data_size=10, perceptron_size=100, num_classes=10):
super(MLP, self).__init__()
self.num_classes = num_classes
... | true | true |
1c1aa99f82c63ea8d7bb81cd00e1c18659af9e93 | 2,330 | py | Python | conftest.py | kdmitrieva16/Pyton_training_mantis | be1189a28c3f0172c6046ca5e2eecddb2063e816 | [
"Apache-2.0"
] | null | null | null | conftest.py | kdmitrieva16/Pyton_training_mantis | be1189a28c3f0172c6046ca5e2eecddb2063e816 | [
"Apache-2.0"
] | null | null | null | conftest.py | kdmitrieva16/Pyton_training_mantis | be1189a28c3f0172c6046ca5e2eecddb2063e816 | [
"Apache-2.0"
] | null | null | null |
import pytest
from fixture.application import Application
import json
import jsonpickle
import os.path
import importlib
from fixture.db import DbFixture
fixture = None
target = None
def load_confif(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... | 32.361111 | 127 | 0.704721 |
import pytest
from fixture.application import Application
import json
import jsonpickle
import os.path
import importlib
from fixture.db import DbFixture
fixture = None
target = None
def load_confif(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... | true | true |
1c1aaa19c907cc66e7031bae465cdc6e87f9cc61 | 17,045 | py | Python | google/dataflow/v1beta3/dataflow-v1beta3-py/google/cloud/dataflow_v1beta3/services/flex_templates_service/client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/dataflow/v1beta3/dataflow-v1beta3-py/google/cloud/dataflow_v1beta3/services/flex_templates_service/client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/dataflow/v1beta3/dataflow-v1beta3-py/google/cloud/dataflow_v1beta3/services/flex_templates_service/client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- 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 or... | 42.400498 | 106 | 0.645761 |
from collections import OrderedDict
from distutils import util
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
fr... | true | true |
1c1aaaf29009692c2f76cb9c4300ce895525d07d | 1,333 | py | Python | storitch/config.py | thomaserlang/storitch | dbcf97af547d9cb1ae5c3994654e8db03e43a253 | [
"MIT"
] | null | null | null | storitch/config.py | thomaserlang/storitch | dbcf97af547d9cb1ae5c3994654e8db03e43a253 | [
"MIT"
] | 1 | 2022-03-03T00:35:08.000Z | 2022-03-03T00:35:08.000Z | storitch/config.py | thomaserlang/storitch | dbcf97af547d9cb1ae5c3994654e8db03e43a253 | [
"MIT"
] | null | null | null | import os, yaml
config = {
'debug': False,
'port': 5000,
'store_path': '/var/storitch',
'pool_size': 5,
'logging': {
'level': 'warning',
'path': None,
'max_size': 100 * 1000 * 1000,# ~ 95 mb
'num_backups': 10,
},
'image_exts': [
'.jpg', '.jpeg', '.png... | 28.361702 | 72 | 0.487622 | import os, yaml
config = {
'debug': False,
'port': 5000,
'store_path': '/var/storitch',
'pool_size': 5,
'logging': {
'level': 'warning',
'path': None,
'max_size': 100 * 1000 * 1000,
'num_backups': 10,
},
'image_exts': [
'.jpg', '.jpeg', '.png', '.tiff... | true | true |
1c1aab8a2f33aa9d706af6cf694fa83cfcf9955a | 2,469 | py | Python | logparser/MoLFI/main/org/core/utility/chromosome_corrections.py | CUHK-CSE/logalizer | e8d96cd4de1121c5d2b517982c6028cd06e643f1 | [
"MIT"
] | 859 | 2017-05-06T03:06:22.000Z | 2022-03-31T12:02:29.000Z | logparser/MoLFI/main/org/core/utility/chromosome_corrections.py | mandychenze/logparser | 8f1f1face2c0e270fd9bcecdefe37ebc6ba76e9d | [
"MIT"
] | 71 | 2018-02-24T08:11:32.000Z | 2022-03-15T11:44:29.000Z | logparser/MoLFI/main/org/core/utility/chromosome_corrections.py | mandychenze/logparser | 8f1f1face2c0e270fd9bcecdefe37ebc6ba76e9d | [
"MIT"
] | 445 | 2017-06-19T01:26:16.000Z | 2022-03-29T08:27:17.000Z | import random
from ..chromosome.chromosome import Chromosome
from ..chromosome.template import Template
random.seed(0)
def check_variable_parts(chromosome: Chromosome, messages: dict):
""" checks each variable element in a template agiants the values of the matched lines
:param chromosome: the chr... | 44.890909 | 97 | 0.599838 | import random
from ..chromosome.chromosome import Chromosome
from ..chromosome.template import Template
random.seed(0)
def check_variable_parts(chromosome: Chromosome, messages: dict):
for key in chromosome.templates.keys():
for template in chromosome.templates[key]:
for index in range(... | true | true |
1c1aab992acefa7f390e8a157ccf6125e0a08b48 | 18,500 | py | Python | dashboard/dashboard/common/testing_common.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 1,894 | 2015-04-17T18:29:53.000Z | 2022-03-28T22:41:06.000Z | dashboard/dashboard/common/testing_common.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | dashboard/dashboard/common/testing_common.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 698 | 2015-06-02T19:18:35.000Z | 2022-03-29T16:57:15.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper functions used in multiple unit tests."""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_imp... | 32.743363 | 80 | 0.679676 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import base64
import fnmatch
import itertools
import json
import logging
import mock
import os
import re
import sys
import unittest
import urllib
import webapp2
import webtest
from google.appengine.api imp... | true | true |
1c1aabb9b6801ad408a88e47b4507b7fb65146ce | 337 | py | Python | client.py | kernelforce/invoice | 58c4e24484b3e47ed8aaf227964b372eac475227 | [
"MIT"
] | null | null | null | client.py | kernelforce/invoice | 58c4e24484b3e47ed8aaf227964b372eac475227 | [
"MIT"
] | null | null | null | client.py | kernelforce/invoice | 58c4e24484b3e47ed8aaf227964b372eac475227 | [
"MIT"
] | null | null | null | import requests
from config import service_name, service_port
url = "http://localhost:{}/{}".format(service_port, service_name)
data = {'enctype': 'multipart/form-data'}
files = {'file': open('E:\\python\\invoice\\test-invoice\\test.jpg', 'rb')}
reponse = requests.post(url, data=data, files=files)
text = reponse.te... | 22.466667 | 75 | 0.709199 | import requests
from config import service_name, service_port
url = "http://localhost:{}/{}".format(service_port, service_name)
data = {'enctype': 'multipart/form-data'}
files = {'file': open('E:\\python\\invoice\\test-invoice\\test.jpg', 'rb')}
reponse = requests.post(url, data=data, files=files)
text = reponse.te... | true | true |
1c1aac55f5b0f4de9c34b4609276c1b8d40304d3 | 652 | py | Python | Quagga/utils/buildpreset.py | dmcbffeng/StripeCaller | 2204c0d3e21359766559bc3b9d113e66b4642970 | [
"MIT"
] | null | null | null | Quagga/utils/buildpreset.py | dmcbffeng/StripeCaller | 2204c0d3e21359766559bc3b9d113e66b4642970 | [
"MIT"
] | 2 | 2022-02-01T13:49:29.000Z | 2022-02-09T20:39:32.000Z | Quagga/utils/buildpreset.py | dmcbffeng/StripeCaller | 2204c0d3e21359766559bc3b9d113e66b4642970 | [
"MIT"
] | 1 | 2021-09-29T02:54:15.000Z | 2021-09-29T02:54:15.000Z | import json
import sys
payload = {}
presets = ["HiC_5000","MiC_5000"]
prekeys = ['reference_genome', 'nstrata_blank', 'chrs', 'norm', 'threshold', 'max_range', 'resolution', 'min_length', 'min_distance', 'merge', 'window_size', 'step', 'sigma', 'rel_height', 'threshold']
prevals = [
['hg38', 1, ['chr1'], "balanced"... | 31.047619 | 201 | 0.625767 | import json
import sys
payload = {}
presets = ["HiC_5000","MiC_5000"]
prekeys = ['reference_genome', 'nstrata_blank', 'chrs', 'norm', 'threshold', 'max_range', 'resolution', 'min_length', 'min_distance', 'merge', 'window_size', 'step', 'sigma', 'rel_height', 'threshold']
prevals = [
['hg38', 1, ['chr1'], "balanced"... | true | true |
1c1aad13e047e2cc1ee27e6d7e2b1a289a9e8cf8 | 2,192 | py | Python | backend/api/v1/organization/views.py | KusumaMarktine/vriti-backend | 171eabc648f1a03131a9f7da5ba01bee080d1bfe | [
"MIT"
] | null | null | null | backend/api/v1/organization/views.py | KusumaMarktine/vriti-backend | 171eabc648f1a03131a9f7da5ba01bee080d1bfe | [
"MIT"
] | null | null | null | backend/api/v1/organization/views.py | KusumaMarktine/vriti-backend | 171eabc648f1a03131a9f7da5ba01bee080d1bfe | [
"MIT"
] | null | null | null | from rest_framework import status
from rest_framework.generics import (ListCreateAPIView, RetrieveUpdateDestroyAPIView, ListAPIView)
from rest_framework.response import Response
from organization.models import Organization
from . import serializer
from rest_framework.filters import SearchFilter, OrderingFilter
from d... | 41.358491 | 103 | 0.717153 | from rest_framework import status
from rest_framework.generics import (ListCreateAPIView, RetrieveUpdateDestroyAPIView, ListAPIView)
from rest_framework.response import Response
from organization.models import Organization
from . import serializer
from rest_framework.filters import SearchFilter, OrderingFilter
from d... | true | true |
1c1aaec2150347adf72d330ec0ce7c4c5c600630 | 3,920 | py | Python | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cc.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 4 | 2018-02-06T01:53:12.000Z | 2018-02-20T01:47:36.000Z | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cc.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | null | null | null | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cc.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 3 | 2018-02-06T01:53:18.000Z | 2021-07-28T09:48:15.000Z | """SCons.Tool.cc
Tool-specific initialization for generic Posix C compilers.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is he... | 36.981132 | 102 | 0.672449 |
__revision__ = "src/engine/SCons/Tool/cc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import SCons.Tool
import SCons.Defaults
import SCons.Util
CSuffixes = ['.c', '.m']
if not SCons.Util.case_sensitive_suffixes('.c', '.C'):
CSuffixes.append('.C')
def add_common... | true | true |
1c1ab0e17b45c203bb3886c39a76b16f9d024250 | 5,202 | py | Python | selfdrive/controls/lib/longitudinal_planner.py | gasx-tesla/openpilot | e6180738fdc4c55ba913905e6591de5435966eb1 | [
"MIT"
] | 2 | 2021-02-25T04:37:52.000Z | 2022-01-27T05:27:01.000Z | selfdrive/controls/lib/longitudinal_planner.py | speedking456/openpilot | 994cc307186146ee65bc41af7744d67a502142d3 | [
"MIT"
] | 2 | 2021-08-19T08:13:29.000Z | 2021-08-19T08:19:16.000Z | selfdrive/controls/lib/longitudinal_planner.py | speedking456/openpilot | 994cc307186146ee65bc41af7744d67a502142d3 | [
"MIT"
] | 1 | 2021-12-27T07:28:26.000Z | 2021-12-27T07:28:26.000Z | #!/usr/bin/env python3
import math
import numpy as np
from common.numpy_fast import interp
import cereal.messaging as messaging
from common.realtime import DT_MDL
from selfdrive.modeld.constants import T_IDXS
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.longcontrol import LongCtrlState
fr... | 41.285714 | 108 | 0.746251 |
import math
import numpy as np
from common.numpy_fast import interp
import cereal.messaging as messaging
from common.realtime import DT_MDL
from selfdrive.modeld.constants import T_IDXS
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.longcontrol import LongCtrlState
from selfdrive.controls.... | true | true |
1c1ab199a8c82acea1c48b088e01d8052da26e66 | 12,632 | py | Python | examples/min_test_task/run_task.py | fqiang/FATE | 36a5a41848f78df7be1e520ae804e64bc67d72fb | [
"Apache-2.0"
] | 1 | 2020-02-07T01:27:32.000Z | 2020-02-07T01:27:32.000Z | examples/min_test_task/run_task.py | fqiang/FATE | 36a5a41848f78df7be1e520ae804e64bc67d72fb | [
"Apache-2.0"
] | null | null | null | examples/min_test_task/run_task.py | fqiang/FATE | 36a5a41848f78df7be1e520ae804e64bc67d72fb | [
"Apache-2.0"
] | null | null | null | import json
import os
import random
import subprocess
import sys
import time
home_dir = os.path.split(os.path.realpath(__file__))[0]
# Upload and download data
upload_config_file = home_dir + "/config/upload.json"
download_config_file = home_dir + "/config/download.json"
# Hetero-lr task
hetero_lr_config_file = home... | 35.683616 | 116 | 0.596501 | import json
import os
import random
import subprocess
import sys
import time
home_dir = os.path.split(os.path.realpath(__file__))[0]
upload_config_file = home_dir + "/config/upload.json"
download_config_file = home_dir + "/config/download.json"
hetero_lr_config_file = home_dir + "/config/test_hetero_lr_train_job_c... | true | true |
1c1ab2386256b46e044414ebc80c525a21b6b992 | 5,884 | py | Python | aries_cloudagent/config/ledger.py | baens/aries-cloudagent-python | 0ff9a490f60bb8de686c4e26fa9a0dd32db0cb33 | [
"Apache-2.0"
] | 7 | 2020-07-07T15:44:41.000Z | 2022-03-26T21:20:41.000Z | aries_cloudagent/config/ledger.py | totemprotocol/aries-fl | dd78dcebc771971abfee301b80cdd5d246c14840 | [
"Apache-2.0"
] | 6 | 2021-03-10T20:05:19.000Z | 2022-02-27T05:41:09.000Z | aries_cloudagent/config/ledger.py | totemprotocol/aries-fl | dd78dcebc771971abfee301b80cdd5d246c14840 | [
"Apache-2.0"
] | 4 | 2020-02-19T23:02:11.000Z | 2021-11-18T11:33:43.000Z | """Ledger configuration."""
import asyncio
from collections import OrderedDict
import logging
import re
import sys
from aiohttp import ClientSession, ClientError, ClientResponse
import markdown
import prompt_toolkit
from prompt_toolkit.eventloop.defaults import use_asyncio_event_loop
from prompt_toolkit.formatted_tex... | 33.05618 | 88 | 0.598063 |
import asyncio
from collections import OrderedDict
import logging
import re
import sys
from aiohttp import ClientSession, ClientError, ClientResponse
import markdown
import prompt_toolkit
from prompt_toolkit.eventloop.defaults import use_asyncio_event_loop
from prompt_toolkit.formatted_text import HTML
from ..ledger... | true | true |
1c1ab28ba5d5b6617875e55667d95926caf6544c | 16,322 | py | Python | homeassistant/components/zha/core/channels/general.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 1 | 2017-05-30T22:21:05.000Z | 2017-05-30T22:21:05.000Z | homeassistant/components/zha/core/channels/general.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 51 | 2020-10-14T01:19:07.000Z | 2022-03-31T06:02:48.000Z | homeassistant/components/zha/core/channels/general.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 2 | 2021-03-22T21:42:48.000Z | 2021-04-12T12:26:39.000Z | """General channels module for Zigbee Home Automation."""
import asyncio
from typing import Any, Coroutine, List, Optional
import zigpy.exceptions
import zigpy.zcl.clusters.general as general
from zigpy.zcl.foundation import Status
from homeassistant.core import callback
from homeassistant.helpers.event import async_... | 35.40564 | 87 | 0.688886 | import asyncio
from typing import Any, Coroutine, List, Optional
import zigpy.exceptions
import zigpy.zcl.clusters.general as general
from zigpy.zcl.foundation import Status
from homeassistant.core import callback
from homeassistant.helpers.event import async_call_later
from .. import registries, typing as zha_typin... | true | true |
1c1ab2df9a30c0e947b7e82d57bfc4180d7fc6dc | 1,967 | py | Python | vega/trainer/trial_agent.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | vega/trainer/trial_agent.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | vega/trainer/trial_agent.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. 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/LICENS... | 33.913793 | 85 | 0.680224 |
import os
import vega
from vega.common.general import General
from vega.report.report_client import ReportClient
from vega.common import FileOps
class TrialAgent(object):
def __init__(self):
self._load_config()
vega.set_backend(General.backend, General.device_category)
se... | true | true |
1c1ab34e55c79e5a6e7ae445835a41b0038a2ee6 | 4,546 | py | Python | python/GafferUI/CompoundVectorParameterValueWidget.py | danieldresser/gaffer | f9ec5612fafcdcbab6284df71f9d7a03078e5407 | [
"BSD-3-Clause"
] | 2 | 2019-03-26T02:36:38.000Z | 2020-01-19T22:53:57.000Z | python/GafferUI/CompoundVectorParameterValueWidget.py | danieldresser/gaffer | f9ec5612fafcdcbab6284df71f9d7a03078e5407 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/CompoundVectorParameterValueWidget.py | danieldresser/gaffer | f9ec5612fafcdcbab6284df71f9d7a03078e5407 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... | 40.589286 | 136 | 0.720194 | true | true | |
1c1ab472af3eff291ca5d692e92c5b97faff53a7 | 23,335 | py | Python | quantiphyse_datasim/struc_models.py | physimals/quantiphyse-perfsim | 6cd209e9f9d51b52ffbd2a0b148cec6a0a64f0ca | [
"Apache-2.0"
] | 1 | 2019-11-20T16:24:07.000Z | 2019-11-20T16:24:07.000Z | quantiphyse_datasim/struc_models.py | physimals/quantiphyse-perfsim | 6cd209e9f9d51b52ffbd2a0b148cec6a0a64f0ca | [
"Apache-2.0"
] | null | null | null | quantiphyse_datasim/struc_models.py | physimals/quantiphyse-perfsim | 6cd209e9f9d51b52ffbd2a0b148cec6a0a64f0ca | [
"Apache-2.0"
] | null | null | null | """
Data simulation Quantiphyse plugin
Structural models, i.e. classes which return lists of different
structures and the corresponding partial volume maps
Author: Martin Craig <martin.craig@eng.ox.ac.uk>
Copyright (c) 2016-2017 University of Oxford, Martin Craig
"""
from __future__ import division, unicode_literals... | 41.227915 | 139 | 0.611699 |
from __future__ import division, unicode_literals, absolute_import, print_function
import time
import numpy as np
from quantiphyse.data import NumpyData, DataGrid, ImageVolumeManagement
from quantiphyse.utils import QpException, get_plugins
from quantiphyse.processes import Process
from .model import Model, Parame... | true | true |
1c1ab493edec3c689b88005aad7882ad414de01b | 3,074 | py | Python | example/neural-style/end_to_end/data_processing.py | Vikas-kum/incubator-mxnet | ba02bf2fe2da423caa59ddb3fd5e433b90b730bf | [
"Apache-2.0"
] | 399 | 2017-05-30T05:12:48.000Z | 2022-01-29T05:53:08.000Z | example/neural-style/end_to_end/data_processing.py | Vikas-kum/incubator-mxnet | ba02bf2fe2da423caa59ddb3fd5e433b90b730bf | [
"Apache-2.0"
] | 187 | 2018-03-16T23:44:43.000Z | 2021-12-14T21:19:54.000Z | example/neural-style/end_to_end/data_processing.py | Vikas-kum/incubator-mxnet | ba02bf2fe2da423caa59ddb3fd5e433b90b730bf | [
"Apache-2.0"
] | 107 | 2017-05-30T05:53:22.000Z | 2021-06-24T02:43:31.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... | 36.164706 | 79 | 0.665257 |
import numpy as np
from skimage import io, transform
from skimage.restoration import denoise_tv_chambolle
import logging
import random
FORMAT = '%(asctime)-15s %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
def PreprocessContentImage(path, short_edge, dshape=None):
img = io.im... | true | true |
1c1ab52a41b34b7f0fbf9caebc94b1dd59c7c85b | 319 | py | Python | soluzione_it1/bank.py | mary023010/bank_managment_system_pro | b678012f881e471fc55fbff7116ba232905dc890 | [
"MIT"
] | null | null | null | soluzione_it1/bank.py | mary023010/bank_managment_system_pro | b678012f881e471fc55fbff7116ba232905dc890 | [
"MIT"
] | null | null | null | soluzione_it1/bank.py | mary023010/bank_managment_system_pro | b678012f881e471fc55fbff7116ba232905dc890 | [
"MIT"
] | null | null | null | class Banca:
def __init__(self,nome_banca):
self.nome_banca = nome_banca
self.clienti = []
self.conti_correnti = []
def __repr__(self):
return f"Nome Banca: {self.nome_banca}, numero totale di clienti: {self.clienti}, numero totale di conti correnti: {self.conti_correnti}" | 35.444444 | 145 | 0.658307 | class Banca:
def __init__(self,nome_banca):
self.nome_banca = nome_banca
self.clienti = []
self.conti_correnti = []
def __repr__(self):
return f"Nome Banca: {self.nome_banca}, numero totale di clienti: {self.clienti}, numero totale di conti correnti: {self.conti_correnti}" | true | true |
1c1ab58c364ba49e87812c2999095ef9ff989e1f | 23,999 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/aio/operations/_network_profiles_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/aio/operations/_network_profiles_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_05_01/aio/operations/_network_profiles_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.178279 | 190 | 0.668778 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
1c1ab6bd5f7a3728e2ecf97fa5b1926c53e393b3 | 38,180 | py | Python | rasa/core/policies/unexpected_intent_policy.py | xuhuan/rasa | 19fb70a05e3637efb9512a942c56cd12ad2c738e | [
"Apache-2.0"
] | null | null | null | rasa/core/policies/unexpected_intent_policy.py | xuhuan/rasa | 19fb70a05e3637efb9512a942c56cd12ad2c738e | [
"Apache-2.0"
] | 72 | 2021-09-07T02:02:37.000Z | 2022-03-28T12:12:44.000Z | rasa/core/policies/unexpected_intent_policy.py | xuhuan/rasa | 19fb70a05e3637efb9512a942c56cd12ad2c738e | [
"Apache-2.0"
] | null | null | null | import logging
from rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization
import numpy as np
import tensorflow as tf
from pathlib import Path
from typing import Any, List, Optional, Text, Dict, Type, TYPE_CHECKING
from rasa.engine.graph import ExecutionContext
from rasa.engine.storage.resour... | 38.604651 | 88 | 0.636878 | import logging
from rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization
import numpy as np
import tensorflow as tf
from pathlib import Path
from typing import Any, List, Optional, Text, Dict, Type, TYPE_CHECKING
from rasa.engine.graph import ExecutionContext
from rasa.engine.storage.resour... | true | true |
1c1ab86a29cff79be2ec13c226cda919797dc070 | 13,070 | py | Python | code/python/StocksAPIforDigitalPortals/v3/fds/sdk/StocksAPIforDigitalPortals/model/inline_response20012_data_stock_type.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/StocksAPIforDigitalPortals/v3/fds/sdk/StocksAPIforDigitalPortals/model/inline_response20012_data_stock_type.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/StocksAPIforDigitalPortals/v3/fds/sdk/StocksAPIforDigitalPortals/model/inline_response20012_data_stock_type.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Stocks API For Digital Portals
The stocks API features a screener to search for equity instruments based on stock-specific parameters. Parameters for up to three fiscal years might now be used in one request; data is available for the ten most recent completed fiscal years. Estimates are available for the... | 49.135338 | 1,585 | 0.598776 |
import re
import sys
from fds.sdk.StocksAPIforDigitalPortals.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_... | true | true |
1c1ab91b6afbb814832dfd874868c9e042c37481 | 830 | py | Python | ensembler/visualisation/style.py | philthiel/Ensembler | 943efac3c673eb40165927e81336386788e3a19f | [
"MIT"
] | 39 | 2020-05-19T08:45:27.000Z | 2022-03-17T16:58:34.000Z | ensembler/visualisation/style.py | SchroederB/Ensembler | 943efac3c673eb40165927e81336386788e3a19f | [
"MIT"
] | 38 | 2020-06-18T13:02:18.000Z | 2022-02-25T14:29:17.000Z | ensembler/visualisation/style.py | SchroederB/Ensembler | 943efac3c673eb40165927e81336386788e3a19f | [
"MIT"
] | 13 | 2020-05-19T08:45:57.000Z | 2022-03-10T16:18:20.000Z | """
This style file is used to control the styling of the visualizations followed
"""
from matplotlib import cm
# COLORS:
alpha_val = 1
alpha_traj = 0.8
aplha_light = 0.3
traj_current = "k"
traj_start = "blue"
traj_end = "red"
trajectory_color = "orange"
animation_traj = cm.get_cmap("inferno")
potential_color =... | 23.055556 | 81 | 0.754217 |
from matplotlib import cm
alpha_val = 1
alpha_traj = 0.8
aplha_light = 0.3
traj_current = "k"
traj_start = "blue"
traj_end = "red"
trajectory_color = "orange"
animation_traj = cm.get_cmap("inferno")
potential_color = cm.get_cmap("tab10")
potential_light = "grey"
potential_resolution = 1000
e_map = cm.get_cmap("Bl... | true | true |
1c1ab9f1ef733781705d16a427aae21027703665 | 735 | py | Python | vaccine_feed_ingest_schema/common.py | jeremyschlatter/vaccine-feed-ingest-schema | b342937b944ef477fee11512448be39181c1bfb5 | [
"MIT"
] | null | null | null | vaccine_feed_ingest_schema/common.py | jeremyschlatter/vaccine-feed-ingest-schema | b342937b944ef477fee11512448be39181c1bfb5 | [
"MIT"
] | 15 | 2021-04-28T16:18:02.000Z | 2021-08-30T08:00:32.000Z | vaccine_feed_ingest_schema/common.py | jeremyschlatter/vaccine-feed-ingest-schema | b342937b944ef477fee11512448be39181c1bfb5 | [
"MIT"
] | 3 | 2021-05-01T23:57:13.000Z | 2021-07-28T21:37:29.000Z | """Common config for all schemas"""
import pydantic
class BaseModel(pydantic.BaseModel):
"""BaseModel for all schema to inherit from."""
class Config:
# Strip whitespace from str values by default.
# This will help have consistant data if parsers forgot to strip.
anystr_strip_whitesp... | 29.4 | 73 | 0.659864 |
import pydantic
class BaseModel(pydantic.BaseModel):
class Config:
anystr_strip_whitespace = True
# This will help reduce typos.
extra = "forbid"
# Validate when setting attributes.
# This will help trigger errors right where they occur.
... | true | true |
1c1aba11f7aa8937e097b11164ddfff21b9504c0 | 988 | py | Python | test/actions/test_inject_flags.py | thinkmoore/blight | 756c31d661367a243e1968f0950352d30b437a46 | [
"Apache-2.0"
] | 51 | 2020-07-30T17:08:21.000Z | 2022-03-23T17:15:21.000Z | test/actions/test_inject_flags.py | thinkmoore/blight | 756c31d661367a243e1968f0950352d30b437a46 | [
"Apache-2.0"
] | 31,392 | 2020-08-18T18:43:30.000Z | 2022-03-29T15:00:00.000Z | test/actions/test_inject_flags.py | thinkmoore/blight | 756c31d661367a243e1968f0950352d30b437a46 | [
"Apache-2.0"
] | 4 | 2020-11-11T15:58:47.000Z | 2022-03-16T22:48:41.000Z | import shlex
from blight.actions import InjectFlags
from blight.tool import CC, CXX
def test_inject_flags():
inject_flags = InjectFlags(
{"CFLAGS": "-more -flags", "CXXFLAGS": "-these -are -ignored", "CPPFLAGS": "-foo"}
)
cc = CC(["-fake", "-flags"])
inject_flags.before_run(cc)
assert c... | 26 | 99 | 0.625506 | import shlex
from blight.actions import InjectFlags
from blight.tool import CC, CXX
def test_inject_flags():
inject_flags = InjectFlags(
{"CFLAGS": "-more -flags", "CXXFLAGS": "-these -are -ignored", "CPPFLAGS": "-foo"}
)
cc = CC(["-fake", "-flags"])
inject_flags.before_run(cc)
assert c... | true | true |
1c1aba16f1d0df13312e6c54da2dd71c2cdb386d | 6,525 | py | Python | userbot/modules/filter.py | JoanLindo/BaianoBot-backup-sexo | b3d0b0f83b6460c3279a243ab753745df1562852 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-11-23T16:43:44.000Z | 2021-11-23T16:43:44.000Z | userbot/modules/filter.py | JoanLindo/purpled | fd95c674de3e4c0bc9eb909dddb4a65c7623fa02 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/filter.py | JoanLindo/purpled | fd95c674de3e4c0bc9eb909dddb4a65c7623fa02 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for filter commands """
from asyncio import sleep
from re import IGNORECASE, escape, search
from u... | 39.545455 | 120 | 0.622989 |
from asyncio import sleep
from re import IGNORECASE, escape, search
from userbot import BOTLOG, BOTLOG_CHATID, CMD_HELP
from userbot.events import register
@register(incoming=True, disable_edited=True, disable_errors=True)
async def filter_incoming_handler(handler):
try:
if not (await handler.get_s... | true | true |
1c1aba1a9d6c543119b1a1a5227a1c95340ccc18 | 1,836 | py | Python | sim2_TOPO_vs_CTR_ENS_HCforcing_h2_Inteference_Modi_test/Modi_plus_macro_and_micro/Code/Q_related/15_g_term123_Amazon_mean_sfc_top_vertical_integral_time_series.py | hongcheq/WADA | 56ce48fc26872851b615ecfba7d1aa678faa5a4c | [
"MIT"
] | null | null | null | sim2_TOPO_vs_CTR_ENS_HCforcing_h2_Inteference_Modi_test/Modi_plus_macro_and_micro/Code/Q_related/15_g_term123_Amazon_mean_sfc_top_vertical_integral_time_series.py | hongcheq/WADA | 56ce48fc26872851b615ecfba7d1aa678faa5a4c | [
"MIT"
] | null | null | null | sim2_TOPO_vs_CTR_ENS_HCforcing_h2_Inteference_Modi_test/Modi_plus_macro_and_micro/Code/Q_related/15_g_term123_Amazon_mean_sfc_top_vertical_integral_time_series.py | hongcheq/WADA | 56ce48fc26872851b615ecfba7d1aa678faa5a4c | [
"MIT"
] | null | null | null | '''
Function: using output files under /DFS-L/DATA/pritchard/hongcheq/OLD/scratch/
hongcheq/HCforcing_sim2_WADA_CTR_TOPO_ENSEMBLE_post-processing_h2_tapes_New_Modifications/MSE_decomp_Andes_Amazon
MSE.nc LSE.nc DSE.nc
Date: 2019/06/17
'''
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
data_pat... | 32.785714 | 113 | 0.691176 |
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
data_path = '/DFS-L/DATA/pritchard/hongcheq/OLD/scratch/hongcheq/\
HCforcing_sim2_WADA_CTR_TOPO_ENSEMBLE_post-processing_h2_tapes_New_Modifications/Qadv/'
file_names = ['var_vert_adv']
name_strings = ['[-Omega*(dq/dp)]_ctr-topo','-Omega_topo*(dq/d... | true | true |
1c1aba74bf41d6089ca8fa58f1a6ea701f12222a | 490 | py | Python | newspaper/comments/migrations/0002_auto_20190507_2039.py | mp5maker/django | a2d38e2e9973e755afce1bd0ccb17e58f3db7e33 | [
"MIT"
] | null | null | null | newspaper/comments/migrations/0002_auto_20190507_2039.py | mp5maker/django | a2d38e2e9973e755afce1bd0ccb17e58f3db7e33 | [
"MIT"
] | 13 | 2020-02-12T00:14:20.000Z | 2022-02-10T08:46:42.000Z | newspaper/comments/migrations/0002_auto_20190507_2039.py | mp5maker/django | a2d38e2e9973e755afce1bd0ccb17e58f3db7e33 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-07 14:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('comments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='comment',
... | 24.5 | 129 | 0.642857 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('comments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='article',
field=models... | true | true |
1c1abd62ee856b9d9f9723fcd1ed976ad5f24263 | 13,296 | py | Python | simulation.py | flohilde/eta_rmdp | 3ef9dad0dbbe4f8626dfe7d3a1e6a03b992e9ad1 | [
"MIT"
] | 1 | 2022-02-19T07:57:16.000Z | 2022-02-19T07:57:16.000Z | simulation.py | flohilde/eta_rmdp | 3ef9dad0dbbe4f8626dfe7d3a1e6a03b992e9ad1 | [
"MIT"
] | null | null | null | simulation.py | flohilde/eta_rmdp | 3ef9dad0dbbe4f8626dfe7d3a1e6a03b992e9ad1 | [
"MIT"
] | null | null | null | import numpy as np
import parameters as param
from generator import customer_generator
from etd import get_all_restaurants_etd
from dispatcher import Dispatcher, FakeDispatcher
from pathos.multiprocessing import ProcessingPool as Pool
def simulate(state_dict, spatial_distrib, nodes=None):
r"""
Full online sim... | 50.555133 | 117 | 0.558514 | import numpy as np
import parameters as param
from generator import customer_generator
from etd import get_all_restaurants_etd
from dispatcher import Dispatcher, FakeDispatcher
from pathos.multiprocessing import ProcessingPool as Pool
def simulate(state_dict, spatial_distrib, nodes=None):
if nodes is None or... | true | true |
1c1abd9393c9669503411c4052408986fd99c3c5 | 2,160 | py | Python | parser/leetcode_examples/brace_expansion.py | heqin-zhu/algorithm | 61b33a38c49ecdc9f443433ef500aa3f5e8f68e4 | [
"WTFPL"
] | 2 | 2022-01-17T11:38:55.000Z | 2022-01-19T17:38:00.000Z | parser/leetcode_examples/brace_expansion.py | heqin-zhu/algorithm | 61b33a38c49ecdc9f443433ef500aa3f5e8f68e4 | [
"WTFPL"
] | null | null | null | parser/leetcode_examples/brace_expansion.py | heqin-zhu/algorithm | 61b33a38c49ecdc9f443433ef500aa3f5e8f68e4 | [
"WTFPL"
] | 1 | 2022-01-16T16:23:53.000Z | 2022-01-16T16:23:53.000Z | import re
from collections import namedtuple
token = namedtuple('token', ['type', 'value'])
left = r'(?P<LEFT>\{)'
right = r'(?P<RIGHT>\})'
word = r'(?P<WORD>[a-z]+)'
comma = r'(?P<COMMA>\,)'
blank = r'(?P<BLANK>\s)'
pt = re.compile('|'.join([left, right, word, comma, blank]))
def genToken(s):
scanner = pt.sca... | 24.827586 | 73 | 0.489815 | import re
from collections import namedtuple
token = namedtuple('token', ['type', 'value'])
left = r'(?P<LEFT>\{)'
right = r'(?P<RIGHT>\})'
word = r'(?P<WORD>[a-z]+)'
comma = r'(?P<COMMA>\,)'
blank = r'(?P<BLANK>\s)'
pt = re.compile('|'.join([left, right, word, comma, blank]))
def genToken(s):
scanner = pt.sca... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.