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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70fbd91114f85dd58aec1ae1d0e5b97858e7d13 | 1,429 | py | Python | helpers.py | rkeulemans/exercise_public | 5f8020198b8b234169eea4d5e08c98344438de5d | [
"MIT"
] | null | null | null | helpers.py | rkeulemans/exercise_public | 5f8020198b8b234169eea4d5e08c98344438de5d | [
"MIT"
] | null | null | null | helpers.py | rkeulemans/exercise_public | 5f8020198b8b234169eea4d5e08c98344438de5d | [
"MIT"
] | null | null | null | from sympy import Rational, Symbol, latex, UnevaluatedExpr
import sympy as sp
import numpy as np
u = lambda x : UnevaluatedExpr(x)
# Helper functions
def explain_add(a, b):
assert(np.shape(a) == np.shape(b))
rows, columns = np.shape(a)
return sp.Matrix([[Symbol(f"({latex(u(a[i,j]))} + {latex(u(b[i,j]))})"... | 39.694444 | 123 | 0.577327 | from sympy import Rational, Symbol, latex, UnevaluatedExpr
import sympy as sp
import numpy as np
u = lambda x : UnevaluatedExpr(x)
def explain_add(a, b):
assert(np.shape(a) == np.shape(b))
rows, columns = np.shape(a)
return sp.Matrix([[Symbol(f"({latex(u(a[i,j]))} + {latex(u(b[i,j]))})") for j in range(c... | true | true |
f70fbf815f40c2d553b7ff2f423ff855c4ec22d7 | 5,650 | py | Python | space/station.py | galactics/space-command | 496b054883c6464bcd8d73d72c8145ae80606336 | [
"MIT"
] | 14 | 2019-03-22T08:12:39.000Z | 2022-01-25T17:45:26.000Z | space/station.py | galactics/space-command | 496b054883c6464bcd8d73d72c8145ae80606336 | [
"MIT"
] | 3 | 2019-11-07T09:34:14.000Z | 2019-12-29T14:38:17.000Z | space/station.py | galactics/space-command | 496b054883c6464bcd8d73d72c8145ae80606336 | [
"MIT"
] | 1 | 2019-12-12T00:48:39.000Z | 2019-12-12T00:48:39.000Z | import logging
from numpy import degrees, pi, radians
from beyond.frames import get_frame, create_station
from beyond.errors import UnknownFrameError
from .wspace import ws
from .utils import dms2deg, deg2dms
log = logging.getLogger(__name__)
class StationDb:
def __new__(cls):
if not hasattr(cls, "_i... | 28.25 | 82 | 0.507965 | import logging
from numpy import degrees, pi, radians
from beyond.frames import get_frame, create_station
from beyond.errors import UnknownFrameError
from .wspace import ws
from .utils import dms2deg, deg2dms
log = logging.getLogger(__name__)
class StationDb:
def __new__(cls):
if not hasattr(cls, "_i... | true | true |
f70fbff6ebbce086af0b72f88cdfefd2aaa4e033 | 2,561 | py | Python | fieldbook/client.py | CSIS-iLab/fieldbook-python | 7dc5c26eab9675b4b3421ef1c943668d0616372e | [
"0BSD"
] | null | null | null | fieldbook/client.py | CSIS-iLab/fieldbook-python | 7dc5c26eab9675b4b3421ef1c943668d0616372e | [
"0BSD"
] | null | null | null | fieldbook/client.py | CSIS-iLab/fieldbook-python | 7dc5c26eab9675b4b3421ef1c943668d0616372e | [
"0BSD"
] | 1 | 2021-04-15T17:14:19.000Z | 2021-04-15T17:14:19.000Z | # -*- coding: utf-8 -*-
import requests
from urllib.parse import urljoin
from os import getenv
import types
class Fieldbook(object):
"""
Client for Fieldbook API: https://github.com/fieldbook/api-docs
Initialize with a fieldbook_id and optionally the api key (name) and secret.
"""
BASE_UR... | 36.070423 | 109 | 0.627099 |
import requests
from urllib.parse import urljoin
from os import getenv
import types
class Fieldbook(object):
BASE_URL = "https://api.fieldbook.com"
API_VERSION = "v1"
def __init__(self, book_id, key=None, secret=None):
super(Fieldbook, self).__init__()
self._key = key if key else getenv... | true | true |
f70fc008f539426def15dab6f35c0b85e1508550 | 17,667 | py | Python | preprocess/funsd/preprocess_2nd.py | clovaai/bros | eb3aa51ad7348444bafb06be64c4604182275edd | [
"Apache-2.0"
] | 36 | 2021-12-15T04:02:14.000Z | 2022-03-24T01:21:00.000Z | preprocess/funsd/preprocess_2nd.py | clovaai/bros | eb3aa51ad7348444bafb06be64c4604182275edd | [
"Apache-2.0"
] | 6 | 2022-01-20T11:18:08.000Z | 2022-03-30T00:19:17.000Z | preprocess/funsd/preprocess_2nd.py | clovaai/bros | eb3aa51ad7348444bafb06be64c4604182275edd | [
"Apache-2.0"
] | 2 | 2022-01-29T01:55:58.000Z | 2022-02-09T07:10:42.000Z | """
BROS
Copyright 2022-present NAVER Corp.
Apache License v2.0
Do 2nd preprocess on top of the result of the 'preprocess.sh' file.
Reference: https://github.com/microsoft/unilm/blob/master/layoutlm/deprecated/examples/seq_labeling/run_seq_labeling.py
"""
import json
import os
from collections import Counter
from t... | 37.993548 | 144 | 0.574291 |
import json
import os
from collections import Counter
from tqdm import tqdm
from transformers import BertTokenizer
MAX_SEQ_LENGTH = 512
MODEL_TYPE = "bert"
VOCA = "bert-base-uncased"
INPUT_PATH = "./data"
OUTPUT_PATH = "../../datasets/funsd"
os.makedirs(OUTPUT_PATH, exist_ok=True)
os.makedirs(os.path.join(OUTPUT_P... | true | true |
f70fc144d0d4dade68af5d8aa612fa32ea819049 | 683 | py | Python | tests/ast/nodes/test_evaluate_subscript.py | andrelfpinto/vyper | d9b73846aa14a6019faa4126ec7608acd05e480d | [
"Apache-2.0"
] | 1 | 2020-07-04T01:47:26.000Z | 2020-07-04T01:47:26.000Z | tests/ast/nodes/test_evaluate_subscript.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null | tests/ast/nodes/test_evaluate_subscript.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null | import pytest
from hypothesis import given, settings
from hypothesis import strategies as st
from vyper import ast as vy_ast
@pytest.mark.fuzzing
@settings(max_examples=50, deadline=1000)
@given(
idx=st.integers(min_value=0, max_value=9),
array=st.lists(st.integers(), min_size=10, max_size=10),
)
def test_su... | 25.296296 | 60 | 0.710102 | import pytest
from hypothesis import given, settings
from hypothesis import strategies as st
from vyper import ast as vy_ast
@pytest.mark.fuzzing
@settings(max_examples=50, deadline=1000)
@given(
idx=st.integers(min_value=0, max_value=9),
array=st.lists(st.integers(), min_size=10, max_size=10),
)
def test_su... | true | true |
f70fc1a9600cd747693c17cbde32cc3ac240198d | 1,331 | py | Python | emsm/plugins/__init__.py | KronK0321/emsm | 2d8882003ff6d688cd4074dcce17f3171f99a69f | [
"MIT"
] | 82 | 2015-02-17T19:26:51.000Z | 2022-03-30T20:13:43.000Z | emsm/plugins/__init__.py | KronK0321/emsm | 2d8882003ff6d688cd4074dcce17f3171f99a69f | [
"MIT"
] | 55 | 2015-01-01T19:49:25.000Z | 2021-06-11T19:45:26.000Z | emsm/plugins/__init__.py | SilkAndSlug/emsm | 2c1cdb305205942e797fdf47fd030c87080d19f9 | [
"MIT"
] | 32 | 2015-01-15T11:47:04.000Z | 2021-12-19T21:49:20.000Z | #!/usr/bin/env python3
# The MIT License (MIT)
#
# Copyright (c) 2014-2018 <see AUTHORS.txt>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitati... | 42.935484 | 79 | 0.768595 | true | true | |
f70fc1dd54c95480d8d9cf4c427a8b9c598266f9 | 6,345 | py | Python | grow/translations/locales.py | matthiasrohmer/grow | 88fae5026040ad0f7dd9260ee290cebbe49b39d7 | [
"MIT"
] | 1 | 2019-01-25T17:00:42.000Z | 2019-01-25T17:00:42.000Z | grow/translations/locales.py | kmcnellis/grow | 4787f5a01681ef0800e9b4388a56cdbc48209368 | [
"MIT"
] | null | null | null | grow/translations/locales.py | kmcnellis/grow | 4787f5a01681ef0800e9b4388a56cdbc48209368 | [
"MIT"
] | null | null | null | from babel import localedata
from grow.pods import errors
from grow.pods import messages
import pickle
import os
import babel
import re
class Locales(object):
def __init__(self, pod):
self.pod = pod
def list_groups(self):
if 'locales' not in self.pod.yaml:
return []
retur... | 35.446927 | 83 | 0.622695 | from babel import localedata
from grow.pods import errors
from grow.pods import messages
import pickle
import os
import babel
import re
class Locales(object):
def __init__(self, pod):
self.pod = pod
def list_groups(self):
if 'locales' not in self.pod.yaml:
return []
retur... | true | true |
f70fc2ab84b8b81bc5e39c5a740166c588e6362f | 7,625 | py | Python | examples/pwr_run/checkpointing/final/final4_new2/job51.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final/final4_new2/job51.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final/final4_new2/job51.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 32.725322 | 118 | 0.693377 |
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras.callbacks import ReduceLROn... | true | true |
f70fc307d1ca7708b58118c2e04d529c472e7d00 | 6,329 | py | Python | patches/multiworld.py | kbranch/LADXR | 21e795daecf90fa48f19e051a2977fffb71ade5c | [
"MIT"
] | null | null | null | patches/multiworld.py | kbranch/LADXR | 21e795daecf90fa48f19e051a2977fffb71ade5c | [
"MIT"
] | null | null | null | patches/multiworld.py | kbranch/LADXR | 21e795daecf90fa48f19e051a2977fffb71ade5c | [
"MIT"
] | null | null | null | from assembler import ASM
from roomEditor import RoomEditor
import entityData
def addMultiworldShop(rom):
# Make a copy of the shop into GrandpaUlrira house
shop_room = RoomEditor(rom, 0x2A1)
re = RoomEditor(rom, 0x2A9)
re.objects = [obj for obj in shop_room.objects if obj.x is not None and obj.type_i... | 21.674658 | 112 | 0.557592 | from assembler import ASM
from roomEditor import RoomEditor
import entityData
def addMultiworldShop(rom):
shop_room = RoomEditor(rom, 0x2A1)
re = RoomEditor(rom, 0x2A9)
re.objects = [obj for obj in shop_room.objects if obj.x is not None and obj.type_id != 0xCE] + re.getWarps()
re.entities = [(1, ... | true | true |
f70fc3e33f50cffe0c707d86a267aec3f37ec6a4 | 4,449 | py | Python | turbinia/state_manager_test.py | youjitwo/turbinia | aae3c41cf72f08347c119f0734d1ce74f57df831 | [
"Apache-2.0"
] | null | null | null | turbinia/state_manager_test.py | youjitwo/turbinia | aae3c41cf72f08347c119f0734d1ce74f57df831 | [
"Apache-2.0"
] | null | null | null | turbinia/state_manager_test.py | youjitwo/turbinia | aae3c41cf72f08347c119f0734d1ce74f57df831 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 38.353448 | 80 | 0.733423 |
from __future__ import unicode_literals
import copy
import os
import tempfile
import unittest
from unittest import mock
from turbinia import config
from turbinia.workers import TurbiniaTask
from turbinia.workers import TurbiniaTaskResult
from turbinia import state_manager
class TestPSQStateManager(u... | true | true |
f70fc40e9143f9c3f8ffb69f403f565a54f0c2b4 | 1,049 | bzl | Python | hack/repo-infra/defs/build.bzl | linxiulei/cri-tools | 17484cda811c93b69e61448835db9559c7f3ab9c | [
"Apache-2.0"
] | 777 | 2018-09-09T18:10:30.000Z | 2022-03-31T15:29:00.000Z | hack/repo-infra/defs/build.bzl | linxiulei/cri-tools | 17484cda811c93b69e61448835db9559c7f3ab9c | [
"Apache-2.0"
] | 553 | 2018-09-07T02:36:56.000Z | 2022-03-30T02:13:57.000Z | hack/repo-infra/defs/build.bzl | linxiulei/cri-tools | 17484cda811c93b69e61448835db9559c7f3ab9c | [
"Apache-2.0"
] | 217 | 2018-09-19T13:47:36.000Z | 2022-03-25T13:58:12.000Z | def _gcs_upload_impl(ctx):
targets = []
for target in ctx.files.data:
targets.append(target.short_path)
ctx.file_action(
output = ctx.outputs.targets,
content = "\n".join(targets),
)
ctx.file_action(
content = "%s --manifest %s --root $PWD -- $@" % (
ctx.attr.uploader.files_... | 23.840909 | 63 | 0.554814 | def _gcs_upload_impl(ctx):
targets = []
for target in ctx.files.data:
targets.append(target.short_path)
ctx.file_action(
output = ctx.outputs.targets,
content = "\n".join(targets),
)
ctx.file_action(
content = "%s --manifest %s --root $PWD -- $@" % (
ctx.attr.uploader.files_... | true | true |
f70fc42e1bdd3e9182fc5cb7fe03ea0f0092441a | 34,760 | py | Python | .history/neuroformer/model_perceiver_20220116213408.py | woanderer/neuroformer | df3462d55977b6c9adcb6753e7c474b8b76e8021 | [
"MIT"
] | null | null | null | .history/neuroformer/model_perceiver_20220116213408.py | woanderer/neuroformer | df3462d55977b6c9adcb6753e7c474b8b76e8021 | [
"MIT"
] | null | null | null | .history/neuroformer/model_perceiver_20220116213408.py | woanderer/neuroformer | df3462d55977b6c9adcb6753e7c474b8b76e8021 | [
"MIT"
] | null | null | null | # from code.transformer_vid.utils import convert_weights
# import rotary_embedding_torch
from torch.nn.modules.activation import GELU, ReLU
# from data.OneCombo3.trainer import TrainerConfig
import math
import numpy as np
import itertools
import logging
import torch
import torch.nn as nn
from torch.nn import functiona... | 39.232506 | 139 | 0.581761 |
from torch.nn.modules.activation import GELU, ReLU
import math
import numpy as np
import itertools
import logging
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.autograd import Variable
from torchvision.models.video import r3d_18
from scipy.optimize import linear_sum_assignment... | true | true |
f70fc4b75705f42bbe31c2e4b05c351f37b97eeb | 2,243 | py | Python | driller/prioritization_techniques/unique.py | ruaronicola/driller | 9f581dee0fa0365c0738d947428d0d9462290c5e | [
"BSD-2-Clause"
] | null | null | null | driller/prioritization_techniques/unique.py | ruaronicola/driller | 9f581dee0fa0365c0738d947428d0d9462290c5e | [
"BSD-2-Clause"
] | null | null | null | driller/prioritization_techniques/unique.py | ruaronicola/driller | 9f581dee0fa0365c0738d947428d0d9462290c5e | [
"BSD-2-Clause"
] | null | null | null | from . import PrioritizationTechnique
from collections import Counter
class UniqueSearch(PrioritizationTechnique):
def __init__(self, binary, target_os, target_arch, similarity_func=None):
super(UniqueSearch, self).__init__(binary=binary, target_os=target_os, target_arch=target_arch)
self... | 39.350877 | 105 | 0.607222 | from . import PrioritizationTechnique
from collections import Counter
class UniqueSearch(PrioritizationTechnique):
def __init__(self, binary, target_os, target_arch, similarity_func=None):
super(UniqueSearch, self).__init__(binary=binary, target_os=target_os, target_arch=target_arch)
self... | true | true |
f70fc4d24cffa26af63c6d398dd5b0f208d70f01 | 7,543 | py | Python | pymultifracs/simul/mrw.py | agramfort/pymultifracs | 3a8896f3f26180b05ccecb4a905b05a3ebc0308b | [
"MIT"
] | 9 | 2019-03-29T05:28:42.000Z | 2019-12-29T12:41:15.000Z | pymultifracs/simul/mrw.py | agramfort/pymultifracs | 3a8896f3f26180b05ccecb4a905b05a3ebc0308b | [
"MIT"
] | 4 | 2021-01-20T14:58:03.000Z | 2021-03-01T11:52:09.000Z | pymultifracs/simul/mrw.py | agramfort/pymultifracs | 3a8896f3f26180b05ccecb4a905b05a3ebc0308b | [
"MIT"
] | 6 | 2021-02-08T15:23:39.000Z | 2022-03-28T13:30:46.000Z | # Synthesis of multifractal random walk and derived processes.
#
# Roberto Fabio Leonarduzzi
# January, 2019
import numpy as np
from .fbm import fgn
from .pzutils import gaussian_cme, gaussian_chol
from numpy.fft import fft, ifft
# import math
# import matplotlib.pyplot as plt
def mrw(shape, H, lam, L, sigma=1, meth... | 25.832192 | 79 | 0.561978 |
import numpy as np
from .fbm import fgn
from .pzutils import gaussian_cme, gaussian_chol
from numpy.fft import fft, ifft
def mrw(shape, H, lam, L, sigma=1, method='cme', z0=(None, None)):
try:
N, R = shape
do_squeeze = False
except TypeError:
N, R = shape, 1
do_squeez... | true | true |
f70fc5015c78a597d0e8b3f39a7c892676afd6d0 | 1,296 | py | Python | tests/pyregex/test_file_ext.py | BrianLusina/PyCharm | 144dd4f6b2d254507237f46c8ee175c407fe053d | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/pyregex/test_file_ext.py | BrianLusina/PyCharm | 144dd4f6b2d254507237f46c8ee175c407fe053d | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/pyregex/test_file_ext.py | BrianLusina/PyCharm | 144dd4f6b2d254507237f46c8ee175c407fe053d | [
"Apache-2.0",
"MIT"
] | null | null | null | import unittest
from pyregex.file_extensions import is_audio, is_img
class FileExtTests(unittest.TestCase):
def test_1(self):
self.assertEqual(is_audio("Nothing Else Matters.mp3"), False)
def test_2(self):
self.assertEqual(is_audio("NothingElseMatters.mp3"), True)
def test_3(self):
... | 24.923077 | 69 | 0.655093 | import unittest
from pyregex.file_extensions import is_audio, is_img
class FileExtTests(unittest.TestCase):
def test_1(self):
self.assertEqual(is_audio("Nothing Else Matters.mp3"), False)
def test_2(self):
self.assertEqual(is_audio("NothingElseMatters.mp3"), True)
def test_3(self):
... | true | true |
f70fc52500dca37eb444c1562ccc361d0506ca18 | 2,151 | py | Python | aide_validation/lfom_validation.py | AguaClara/aide_validation | 997b9da8077d1f560d4aa9ccb236b21580da4808 | [
"MIT"
] | null | null | null | aide_validation/lfom_validation.py | AguaClara/aide_validation | 997b9da8077d1f560d4aa9ccb236b21580da4808 | [
"MIT"
] | 3 | 2021-01-28T02:30:34.000Z | 2021-03-30T16:57:21.000Z | aide_validation/lfom_validation.py | AguaClara/aide_validation | 997b9da8077d1f560d4aa9ccb236b21580da4808 | [
"MIT"
] | null | null | null | """Helper functions for validating LFOM.
Created on September 18, 2020
@author: jcs528@cornell.edu
"""
from aguaclara.core.units import u
import aguaclara.core.physchem as pc
import aguaclara.core.constants as con
def flow_lfom_vert(height, d_ori, h_ori, n_oris):
"""Returns the flow through the LFOM as a functi... | 30.728571 | 85 | 0.641562 |
from aguaclara.core.units import u
import aguaclara.core.physchem as pc
import aguaclara.core.constants as con
def flow_lfom_vert(height, d_ori, h_ori, n_oris):
flow = pc.flow_orifice_vert(d_ori, height - h_ori, con.VC_ORIFICE_RATIO) * n_oris
return (sum(flow)).to(u.L / u.s)
def check_flow_lfom_vert(
d... | true | true |
f70fc536e34579924ddaa83ede4401b79ce9f249 | 2,796 | py | Python | script popolamento DB/env/lib/python3.7/site-packages/pip/_internal/__init__.py | 2dadsgn/Smart-vase-webapp-flask- | 0714d960ec21c77be069dd07b1bc8407f33e0b72 | [
"Apache-2.0"
] | null | null | null | script popolamento DB/env/lib/python3.7/site-packages/pip/_internal/__init__.py | 2dadsgn/Smart-vase-webapp-flask- | 0714d960ec21c77be069dd07b1bc8407f33e0b72 | [
"Apache-2.0"
] | null | null | null | script popolamento DB/env/lib/python3.7/site-packages/pip/_internal/__init__.py | 2dadsgn/Smart-vase-webapp-flask- | 0714d960ec21c77be069dd07b1bc8407f33e0b72 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import
import locale
import logging
import os
import sys
import warnings
# 2016-06-17 barry@debian.org: urllib3 1.14 added optional support for socks,
# but if invoked (i.e. imported), it will issue a warning to stderr if socks
# isn't available. requests uncondi... | 35.846154 | 79 | 0.741059 |
from __future__ import absolute_import
import locale
import logging
import os
import sys
import warnings
# to add socks as yet another dependency for pip, nor do I want to allow-stder
# in the DEP-8 tests, so just suppress the warning. pdb tells me this has to
# be done before the import of pip.vcs.
from pip._... | true | true |
f70fc6b477776e6e8c300af6054a006f420fbd61 | 13,684 | py | Python | venv/lib/python3.7/site-packages/rqdatac/services/stock_status.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/rqdatac/services/stock_status.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | 1 | 2020-04-21T02:42:32.000Z | 2020-04-21T02:42:32.000Z | venv/lib/python3.7/site-packages/rqdatac/services/stock_status.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import warnings
import pandas as pd
import numpy as np
from rqdatac.utils import to_datetime, to_date
from rqdatac.validators import (
ensure_date_range,
ensure_date_or_today_int,
ensure_list_of_string,
check_items_in_container,
ensure_order,
ensure_orde... | 36.297082 | 106 | 0.668372 |
import datetime
import warnings
import pandas as pd
import numpy as np
from rqdatac.utils import to_datetime, to_date
from rqdatac.validators import (
ensure_date_range,
ensure_date_or_today_int,
ensure_list_of_string,
check_items_in_container,
ensure_order,
ensure_order_book_id,
ensure_o... | true | true |
f70fc6f681ce167e1c1f5581804480dafb4f6607 | 3,118 | py | Python | backend/apps/endpoints/models.py | alcibiadesBustillo/ml_service | 99417531e2dbd43f212b5b0a397307f31c8131ca | [
"MIT"
] | null | null | null | backend/apps/endpoints/models.py | alcibiadesBustillo/ml_service | 99417531e2dbd43f212b5b0a397307f31c8131ca | [
"MIT"
] | null | null | null | backend/apps/endpoints/models.py | alcibiadesBustillo/ml_service | 99417531e2dbd43f212b5b0a397307f31c8131ca | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Endpoint(models.Model):
"""
The Endpoint object represents ML API endpoints
Attributes:
name: The name of the endpoints, it will be used in API URL,
owner: The string with owner name,
created_at: The date when endpoint w... | 41.573333 | 106 | 0.724182 | from django.db import models
class Endpoint(models.Model):
name = models.CharField(max_length=128)
owner = models.CharField(max_length=128)
created_at = models.DateTimeField(auto_now_add=True, blank=True)
class MLAlgorithm(models.Model):
name = models.CharField(max_length=128)
description = mod... | true | true |
f70fc7967c36f339b881f758de114c8b5641438b | 162 | py | Python | tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_PolyTrend_Seasonal_Hour_MLP.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_PolyTrend_Seasonal_Hour_MLP.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_PolyTrend_Seasonal_Hour_MLP.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Difference'] , ['PolyTrend'] , ['Seasonal_Hour'] , ['MLP'] ); | 40.5 | 84 | 0.753086 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Difference'] , ['PolyTrend'] , ['Seasonal_Hour'] , ['MLP'] ); | true | true |
f70fc914b27823d8d36316353c43270277541831 | 4,591 | py | Python | u24_lymphocyte/third_party/treeano/sandbox/nodes/randomized_relu.py | ALSM-PhD/quip_classification | 7347bfaa5cf11ae2d7a528fbcc43322a12c795d3 | [
"BSD-3-Clause"
] | 45 | 2015-04-26T04:45:51.000Z | 2022-01-24T15:03:55.000Z | u24_lymphocyte/third_party/treeano/sandbox/nodes/randomized_relu.py | ALSM-PhD/quip_classification | 7347bfaa5cf11ae2d7a528fbcc43322a12c795d3 | [
"BSD-3-Clause"
] | 8 | 2018-07-20T20:54:51.000Z | 2020-06-12T05:36:04.000Z | u24_lymphocyte/third_party/treeano/sandbox/nodes/randomized_relu.py | ALSM-PhD/quip_classification | 7347bfaa5cf11ae2d7a528fbcc43322a12c795d3 | [
"BSD-3-Clause"
] | 22 | 2018-05-21T23:57:20.000Z | 2022-02-21T00:48:32.000Z | import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from theano.sandbox.rng_mrg import MRG_RandomStreams
@treeano.register_node("randomized_relu")
class RandomizedReLUNode(treeano.NodeImpl):
"""
from "Empirical Evaluation of Rectified Activations in Convolutio... | 33.268116 | 76 | 0.544544 | import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from theano.sandbox.rng_mrg import MRG_RandomStreams
@treeano.register_node("randomized_relu")
class RandomizedReLUNode(treeano.NodeImpl):
hyperparameter_names = ("alpha_lower",
"alpha... | true | true |
f70fca0643f281fccf3a6c2b02a8457d15910cb5 | 930 | py | Python | abrv/db.py | shwnchpl/abrv | 762a96a408104c5cd0623387bf0b6163f7367ca6 | [
"MIT"
] | null | null | null | abrv/db.py | shwnchpl/abrv | 762a96a408104c5cd0623387bf0b6163f7367ca6 | [
"MIT"
] | 1 | 2021-03-20T05:30:27.000Z | 2021-03-20T05:30:27.000Z | abrv/db.py | shwnchpl/abrv.io | 762a96a408104c5cd0623387bf0b6163f7367ca6 | [
"MIT"
] | null | null | null |
import click
import psycopg2 as pg2
from flask import current_app, g
from flask.cli import with_appcontext
from psycopg2.extras import DictCursor
def get_db():
if 'db' not in g:
g.db = pg2.connect(
**current_app.config['DATABASE'],
)
g.db.cursor_factory = DictCursor
retu... | 18.979592 | 56 | 0.648387 |
import click
import psycopg2 as pg2
from flask import current_app, g
from flask.cli import with_appcontext
from psycopg2.extras import DictCursor
def get_db():
if 'db' not in g:
g.db = pg2.connect(
**current_app.config['DATABASE'],
)
g.db.cursor_factory = DictCursor
retu... | true | true |
f70fca09f62c53b1a4b27f6e0b1daad65396083a | 17,810 | py | Python | twilio/rest/sync/v1/service/sync_list/__init__.py | ethan-schaffer/MassMessenger | 3042ed98864d012a7276a6a365f81690431d5157 | [
"MIT"
] | 1 | 2019-02-08T01:13:38.000Z | 2019-02-08T01:13:38.000Z | twilio/rest/sync/v1/service/sync_list/__init__.py | kkrlee/twilio-python | 260de9df17c5a1440d9c037a971e2182da7f4ced | [
"MIT"
] | 2 | 2019-09-20T19:08:16.000Z | 2021-04-02T13:28:29.000Z | twilio/rest/sync/v1/service/sync_list/__init__.py | kkrlee/twilio-python | 260de9df17c5a1440d9c037a971e2182da7f4ced | [
"MIT"
] | null | null | null | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.... | 33.54049 | 106 | 0.626727 |
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
from twilio.rest.sync.v1.service.sync_list.sync_li... | true | true |
f70fca2a46b2b6b5b759453f5fa1bf80d9210bfe | 4,988 | py | Python | var/spack/repos/builtin/packages/phist/package.py | mrzv/spack | a0fb2838ea60f020179f480a2db1438da9d2e2ab | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/phist/package.py | mrzv/spack | a0fb2838ea60f020179f480a2db1438da9d2e2ab | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/phist/package.py | mrzv/spack | a0fb2838ea60f020179f480a2db1438da9d2e2ab | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Phist(CMakePackage):
"""The Pipelined, Hybrid-parallel Iterative Solver Toolkit provides
... | 42.632479 | 95 | 0.611668 |
from spack import *
class Phist(CMakePackage):
homepage = "https://bitbucket.org/essex/phist/"
url = "https://bitbucket.org/essex/phist/get/phist-1.4.3.tar.gz"
git = "https://bitbucket.org/essex/phist/phist.git"
version('develop', branch='devel')
version('master', branch='master'... | true | true |
f70fcd603a54e94391c4758ae07ce19fce6dcb4f | 6,385 | py | Python | src/bindings/python/tests/test_ngraph/test_ops_binary.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 1 | 2019-09-22T01:05:07.000Z | 2019-09-22T01:05:07.000Z | src/bindings/python/tests/test_ngraph/test_ops_binary.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 58 | 2020-11-06T12:13:45.000Z | 2022-03-28T13:20:11.000Z | src/bindings/python/tests/test_ngraph/test_ops_binary.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 2 | 2021-07-14T07:40:50.000Z | 2021-07-27T01:40:03.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import operator
import numpy as np
import pytest
import openvino.runtime.opset8 as ov
from tests.runtime import get_runtime
from tests.test_ngraph.util import run_op_node
@pytest.mark.parametrize(
"ng_api_helper,numpy_function",
... | 30.404762 | 105 | 0.649021 |
import operator
import numpy as np
import pytest
import openvino.runtime.opset8 as ov
from tests.runtime import get_runtime
from tests.test_ngraph.util import run_op_node
@pytest.mark.parametrize(
"ng_api_helper,numpy_function",
[
(ov.add, np.add),
(ov.divide, np.divide),
(ov.mult... | true | true |
f70fcd9fc74db1c3ee037f4d11c4ff2fdad8ae4a | 1,015 | py | Python | autoindex.py | langsci/91 | bca083ed2f5f30dd4c2d6587366e8e0f649285c3 | [
"CC-BY-4.0"
] | null | null | null | autoindex.py | langsci/91 | bca083ed2f5f30dd4c2d6587366e8e0f649285c3 | [
"CC-BY-4.0"
] | null | null | null | autoindex.py | langsci/91 | bca083ed2f5f30dd4c2d6587366e8e0f649285c3 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/python3
import glob
import re
lgs=open("locallanguages.txt").read().split('\n')
terms=open("localsubjectterms.txt").read().split('\n')[::-1]#reverse to avoid double indexing
print("found %i language names for autoindexing" % len(lgs))
print("found %i subject terms for autoindexing" % len(terms))
files = g... | 28.194444 | 103 | 0.595074 |
import glob
import re
lgs=open("locallanguages.txt").read().split('\n')
terms=open("localsubjectterms.txt").read().split('\n')[::-1]
print("found %i language names for autoindexing" % len(lgs))
print("found %i subject terms for autoindexing" % len(terms))
files = glob.glob('chapters/*tex')
for f in files:
print("... | true | true |
f70fcdc4a7591387a0e661b787c802ae0ddafa4c | 3,137 | py | Python | mir/qualia/comment.py | darkfeline/qualia | 28ccb419dd82b75878c2f52227f291b249b489d7 | [
"Apache-2.0"
] | 23 | 2017-01-18T13:53:05.000Z | 2020-05-30T10:41:56.000Z | mir/qualia/comment.py | project-mir/mir.qualia | 28ccb419dd82b75878c2f52227f291b249b489d7 | [
"Apache-2.0"
] | 4 | 2016-10-16T00:19:15.000Z | 2017-10-25T13:28:05.000Z | mir/qualia/comment.py | project-mir/mir.qualia | 28ccb419dd82b75878c2f52227f291b249b489d7 | [
"Apache-2.0"
] | 5 | 2016-10-16T00:07:38.000Z | 2022-03-30T13:11:30.000Z | # Copyright (C) 2016 Allen Li
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 32.340206 | 75 | 0.63277 |
import re
from mir.qualia.indent import common_indent
class CommentPrefix:
def __init__(self, comment_prefix):
self._comment_prefix = comment_prefix
self._prefix_pattern = re.compile(
fr'^(?P<indent>\s*){re.escape(comment_prefix)}')
def __repr__(self):
cl... | true | true |
f70fcec201aadc2ae8017ed9ede79957d301a8d7 | 1,785 | py | Python | eloquent/query/processors/mysql_processor.py | KarthickNamakkalKrishnan/eloquent | 0638b688d5fd0c1a46b7471dd465eeb4c2f84666 | [
"MIT"
] | 47 | 2015-03-19T02:11:36.000Z | 2022-03-29T07:16:42.000Z | eloquent/query/processors/mysql_processor.py | KarthickNamakkalKrishnan/eloquent | 0638b688d5fd0c1a46b7471dd465eeb4c2f84666 | [
"MIT"
] | 20 | 2015-03-16T02:56:51.000Z | 2015-05-24T17:51:29.000Z | eloquent/query/processors/mysql_processor.py | sdispater/eloquent | 0638b688d5fd0c1a46b7471dd465eeb4c2f84666 | [
"MIT"
] | 4 | 2018-08-29T13:42:50.000Z | 2021-03-14T11:28:31.000Z | # -*- coding: utf-8 -*-
from .processor import QueryProcessor
class MySqlQueryProcessor(QueryProcessor):
def process_insert_get_id(self, query, sql, values, sequence=None):
"""
Process an "insert get ID" query.
:param query: A QueryBuilder instance
:type query: QueryBuilder
... | 27.890625 | 84 | 0.568067 |
from .processor import QueryProcessor
class MySqlQueryProcessor(QueryProcessor):
def process_insert_get_id(self, query, sql, values, sequence=None):
if not query.get_connection().transaction_level():
with query.get_connection().transaction():
query.get_connection().insert(sq... | true | true |
f70fcef80f20ce380e02798f1200de49413bc6f2 | 202 | py | Python | src/simmate/toolkit/creators/vector/__init__.py | sionab/simmate | 6dedea7310829aae425bf3393e7923e454a0129f | [
"BSD-3-Clause"
] | null | null | null | src/simmate/toolkit/creators/vector/__init__.py | sionab/simmate | 6dedea7310829aae425bf3393e7923e454a0129f | [
"BSD-3-Clause"
] | null | null | null | src/simmate/toolkit/creators/vector/__init__.py | sionab/simmate | 6dedea7310829aae425bf3393e7923e454a0129f | [
"BSD-3-Clause"
] | null | null | null | from simmate.toolkit.creators.vector.uniform_distribution import (
UniformlyDistributedVectors,
)
from simmate.toolkit.creators.vector.normal_distribution import (
NormallyDistributedVectors,
)
| 28.857143 | 66 | 0.831683 | from simmate.toolkit.creators.vector.uniform_distribution import (
UniformlyDistributedVectors,
)
from simmate.toolkit.creators.vector.normal_distribution import (
NormallyDistributedVectors,
)
| true | true |
f70fcf41f7c218d9425b0cdbb130c4b7ef454437 | 3,403 | py | Python | pepys_admin/maintenance/dialogs/progress_dialog.py | debrief/pepys-import | 12d29c0e0f69e1119400334983947893e7679b6b | [
"Apache-2.0"
] | 4 | 2021-05-14T08:22:47.000Z | 2022-02-04T19:48:25.000Z | pepys_admin/maintenance/dialogs/progress_dialog.py | debrief/pepys-import | 12d29c0e0f69e1119400334983947893e7679b6b | [
"Apache-2.0"
] | 1,083 | 2019-11-06T17:01:07.000Z | 2022-03-25T10:26:51.000Z | pepys_admin/maintenance/dialogs/progress_dialog.py | debrief/pepys-import | 12d29c0e0f69e1119400334983947893e7679b6b | [
"Apache-2.0"
] | 4 | 2019-11-06T12:00:45.000Z | 2021-06-09T04:18:28.000Z | import asyncio
from asyncio import Future
from asyncio.tasks import ensure_future
from functools import partial
from prompt_toolkit.application.current import get_app
from prompt_toolkit.layout.containers import HSplit
from prompt_toolkit.layout.dimension import D
from prompt_toolkit.widgets import Button, Label, Prog... | 38.235955 | 88 | 0.628563 | import asyncio
from asyncio import Future
from asyncio.tasks import ensure_future
from functools import partial
from prompt_toolkit.application.current import get_app
from prompt_toolkit.layout.containers import HSplit
from prompt_toolkit.layout.dimension import D
from prompt_toolkit.widgets import Button, Label, Prog... | true | true |
f70fcf542f3210fc83f2ec7cfff75251815ab90f | 5,071 | py | Python | python/configuration.py | robertosilviu/differential_evolution_bridge | dc9e7692d4e88aaca6d6db38f52926286879efb6 | [
"MIT"
] | 1 | 2020-06-10T05:59:34.000Z | 2020-06-10T05:59:34.000Z | python/configuration.py | robertosilviu/differential_evolution_bridge | dc9e7692d4e88aaca6d6db38f52926286879efb6 | [
"MIT"
] | null | null | null | python/configuration.py | robertosilviu/differential_evolution_bridge | dc9e7692d4e88aaca6d6db38f52926286879efb6 | [
"MIT"
] | 2 | 2020-02-26T02:10:58.000Z | 2021-07-02T08:24:42.000Z | import json
class Configuration():
# class to organize Netlogo simulation parameters
def __init__(self):
# costants
self.constants={
'strategy?' : 3,
'drone.radius': 0.2,
'drone.speedMax': 8.5,
'drone.cruisingSpeed': 2,
'drone.acceleration... | 35.964539 | 63 | 0.549399 | import json
class Configuration():
def __init__(self):
self.constants={
'strategy?' : 3,
'drone.radius': 0.2,
'drone.speedMax': 8.5,
'drone.cruisingSpeed': 2,
'drone.acceleration': 2,
'drone.deceleration': -2,
'dr... | true | true |
f70fd0b4258ce75e8178e9428e3b7a835b135324 | 1,925 | py | Python | docs-source/source/conf.py | bengranett/synmock | def8f73792d1b756feb2203c1e03e71ce9326d9b | [
"MIT"
] | 1 | 2020-03-18T15:16:50.000Z | 2020-03-18T15:16:50.000Z | docs-source/source/conf.py | bengranett/synmock | def8f73792d1b756feb2203c1e03e71ce9326d9b | [
"MIT"
] | null | null | null | docs-source/source/conf.py | bengranett/synmock | def8f73792d1b756feb2203c1e03e71ce9326d9b | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 37.019231 | 79 | 0.661299 |
project = 'Synmock'
copyright = '2020, Ben Granett'
author = 'Ben Granett'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon',
'sphinx.ext.githubpages', 'sphinx.ext.viewcode']
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'alabaster'
h... | true | true |
f70fd182757e69c7390c6872baa160b5dc484126 | 378 | py | Python | dictances/intersection_squared_variation.py | DavidBerdik/dictances | 7b804b62032bbdecc8e73946cf74b171681fe4f5 | [
"MIT"
] | 30 | 2018-08-30T16:00:14.000Z | 2022-03-14T14:36:17.000Z | dictances/intersection_squared_variation.py | DavidBerdik/dictances | 7b804b62032bbdecc8e73946cf74b171681fe4f5 | [
"MIT"
] | 6 | 2019-06-18T15:37:23.000Z | 2021-04-15T12:40:42.000Z | dictances/intersection_squared_variation.py | DavidBerdik/dictances | 7b804b62032bbdecc8e73946cf74b171681fe4f5 | [
"MIT"
] | 6 | 2019-02-10T23:22:25.000Z | 2020-10-01T16:25:40.000Z | """Return the squared distance beetween the intersection of a and b."""
from .intersection_nth_variation import intersection_nth_variation
from typing import Dict
def intersection_squared_variation(a: Dict, b: Dict, overlap: bool=False)->float:
"""Return the squared distance beetween the intersection of a and b.""... | 47.25 | 81 | 0.783069 | from .intersection_nth_variation import intersection_nth_variation
from typing import Dict
def intersection_squared_variation(a: Dict, b: Dict, overlap: bool=False)->float:
return intersection_nth_variation(a, b, 2, overlap)
| true | true |
f70fd192b0b86d4d1b0220c841fb600a1a2d7002 | 503 | py | Python | generated-libraries/python/netapp/exports/security_flavor.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/exports/security_flavor.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/exports/security_flavor.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | class SecurityFlavor(basestring):
"""
any|none|never|krb5|ntlm|sys
Possible values:
<ul>
<li> "any" - Any,
<li> "none" - Anonymous Access Allowed If Security Type
Not Already Listed,
<li> "never" - Never,
<li> "krb5" - Kerberos 5 Authentication,
<li> "ntlm" - ... | 23.952381 | 63 | 0.540755 | class SecurityFlavor(basestring):
@staticmethod
def get_api_name():
return "security-flavor"
| true | true |
f70fd19c066bebb0ed59dbe39549e05e6dbe3832 | 19,393 | py | Python | powderBot.py | JordanGoodridge/Weather-Discord-Bot | 5fd0056a38e753fc6de5eb3d9af428cf6e244fb8 | [
"MIT"
] | null | null | null | powderBot.py | JordanGoodridge/Weather-Discord-Bot | 5fd0056a38e753fc6de5eb3d9af428cf6e244fb8 | [
"MIT"
] | null | null | null | powderBot.py | JordanGoodridge/Weather-Discord-Bot | 5fd0056a38e753fc6de5eb3d9af428cf6e244fb8 | [
"MIT"
] | null | null | null |
#Weather
#Functions TODO
# precip accumilation works well hourly
# sign up for storm alert per IKON or EPIC resort
# timer to check the 3 day for storms
# highest winter in state
from datetime import datetime, timedelta
from dateutil import tz
import discord
import googlemaps
import aiohttp
import as... | 48.726131 | 233 | 0.640437 |
from datetime import datetime, timedelta
from dateutil import tz
import discord
import googlemaps
import aiohttp
import asyncio
from PIL import Image, ImageDraw, ImageFont
client = discord.Client()
gmaps_key = ''
api_key = ''
gmaps = googlemaps.Client(key=gmaps_key)
latitude = 0
longitude ... | true | true |
f70fd1d2052388cfe0df232571e7e732dc7273e5 | 3,702 | py | Python | PythonClient/Framework/CmdRotate.py | SweetShot/AirSim | d43269f9387fdac03298d14416ecf6af43b6fd12 | [
"MIT"
] | null | null | null | PythonClient/Framework/CmdRotate.py | SweetShot/AirSim | d43269f9387fdac03298d14416ecf6af43b6fd12 | [
"MIT"
] | null | null | null | PythonClient/Framework/CmdRotate.py | SweetShot/AirSim | d43269f9387fdac03298d14416ecf6af43b6fd12 | [
"MIT"
] | 2 | 2018-03-07T18:23:42.000Z | 2020-02-12T19:58:32.000Z | from CmdBase import *
from PersistentModules import *
# Cmd
# turn left deg
# turn right deg
# turn to deg
# turn rate deg
class CmdRotate(CmdBase):
def __init__(self, controller, line, engage_object = None):
super().__init__(controller, line, engage_object)
def start(self):
self.mystate_mo... | 44.071429 | 123 | 0.555105 | from CmdBase import *
from PersistentModules import *
class CmdRotate(CmdBase):
def __init__(self, controller, line, engage_object = None):
super().__init__(controller, line, engage_object)
def start(self):
self.mystate_module = self.get_persistent_module('mystate')
self.consta... | true | true |
f70fd24934cbde2839dbd458ccd8f3b8b099a413 | 4,017 | py | Python | tests/model/test_priors.py | ihmeuw/cascade-at | a5b1b5da1698163fd3bbafc6288968dd9c398096 | [
"MIT"
] | 1 | 2019-10-14T23:18:04.000Z | 2019-10-14T23:18:04.000Z | tests/model/test_priors.py | ihmeuw/cascade | a5b1b5da1698163fd3bbafc6288968dd9c398096 | [
"MIT"
] | 35 | 2018-07-17T18:37:33.000Z | 2020-03-06T13:31:35.000Z | tests/model/test_priors.py | ihmeuw/cascade | a5b1b5da1698163fd3bbafc6288968dd9c398096 | [
"MIT"
] | 4 | 2018-07-13T00:01:35.000Z | 2019-09-02T23:56:11.000Z | import pytest
import numpy as np
from numpy import isclose
from numpy.random import RandomState
from cascade_at.model.priors import (
Constant,
Gaussian,
Uniform,
Laplace,
StudentsT,
LogGaussian,
LogLaplace,
LogStudentsT,
PriorError,
)
def test_happy_construction():
Uniform(-1... | 25.916129 | 85 | 0.618123 | import pytest
import numpy as np
from numpy import isclose
from numpy.random import RandomState
from cascade_at.model.priors import (
Constant,
Gaussian,
Uniform,
Laplace,
StudentsT,
LogGaussian,
LogLaplace,
LogStudentsT,
PriorError,
)
def test_happy_construction():
Uniform(-1... | true | true |
f70fd2fa94d673fff6f6c9d257ae2d677caba319 | 13,298 | py | Python | models/rcnn.py | jiangbestone/DetectRccn | fb30491201f8c64d5ca75298d52aa1a20c4bc6e3 | [
"MIT"
] | null | null | null | models/rcnn.py | jiangbestone/DetectRccn | fb30491201f8c64d5ca75298d52aa1a20c4bc6e3 | [
"MIT"
] | null | null | null | models/rcnn.py | jiangbestone/DetectRccn | fb30491201f8c64d5ca75298d52aa1a20c4bc6e3 | [
"MIT"
] | null | null | null |
from torch.autograd import Variable
from models.proposal_target_layer_cascade import *
import torchvision.models as models
from models.proposal import *
#bocknet
class ResNet(nn.Module):
def __init__(self, block, layers, num_classes=1000,dropout_prob=0.2):
self.inplanes = 64
super(ResNet, self).__i... | 37.2493 | 138 | 0.563769 |
from torch.autograd import Variable
from models.proposal_target_layer_cascade import *
import torchvision.models as models
from models.proposal import *
class ResNet(nn.Module):
def __init__(self, block, layers, num_classes=1000,dropout_prob=0.2):
self.inplanes = 64
super(ResNet, self).__init__()
... | true | true |
f70fd34fcef7070d01158e4acd65734d35826d88 | 678 | py | Python | world/load.py | Eoin-Irwin/wmap-geodjango-tutorial-master | f441567d5c9e6059e7192ee5f2d00a51e3d832d8 | [
"MIT"
] | null | null | null | world/load.py | Eoin-Irwin/wmap-geodjango-tutorial-master | f441567d5c9e6059e7192ee5f2d00a51e3d832d8 | [
"MIT"
] | null | null | null | world/load.py | Eoin-Irwin/wmap-geodjango-tutorial-master | f441567d5c9e6059e7192ee5f2d00a51e3d832d8 | [
"MIT"
] | null | null | null | import os
from django.contrib.gis.utils import LayerMapping
from .models import WorldBorder
world_mapping = {
'fips': 'FIPS',
'iso2': 'ISO2',
'iso3': 'ISO3',
'un': 'UN',
'name': 'NAME',
'area': 'AREA',
'pop2005': 'POP2005',
'region': 'REGION',
'subregion': 'SUBREGION',
'lon': 'L... | 21.870968 | 80 | 0.60472 | import os
from django.contrib.gis.utils import LayerMapping
from .models import WorldBorder
world_mapping = {
'fips': 'FIPS',
'iso2': 'ISO2',
'iso3': 'ISO3',
'un': 'UN',
'name': 'NAME',
'area': 'AREA',
'pop2005': 'POP2005',
'region': 'REGION',
'subregion': 'SUBREGION',
'lon': 'L... | true | true |
f70fd35d3f0c8c6b1837e551460d92a1bc63db21 | 6,306 | py | Python | service/views.py | zingbretsen/diplomacy | e4c8d2c89540c0e2ea1929879fd303a170d0a723 | [
"MIT"
] | null | null | null | service/views.py | zingbretsen/diplomacy | e4c8d2c89540c0e2ea1929879fd303a170d0a723 | [
"MIT"
] | null | null | null | service/views.py | zingbretsen/diplomacy | e4c8d2c89540c0e2ea1929879fd303a170d0a723 | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters, generics, views, exceptions
from rest_framework.response import Response
from core import models
from core.models.base import GameStatus
from service import serializers
from ... | 30.317308 | 75 | 0.664605 | from django.shortcuts import get_object_or_404
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters, generics, views, exceptions
from rest_framework.response import Response
from core import models
from core.models.base import GameStatus
from service import serializers
from ... | true | true |
f70fd38f695b4de489bb91ad4acb68243448e994 | 6,573 | py | Python | tests/ut/python/dataset/test_rgb_hsv.py | httpsgithu/mindspore | c29d6bb764e233b427319cb89ba79e420f1e2c64 | [
"Apache-2.0"
] | 1 | 2022-03-30T03:43:29.000Z | 2022-03-30T03:43:29.000Z | tests/ut/python/dataset/test_rgb_hsv.py | 949144093/mindspore | c29d6bb764e233b427319cb89ba79e420f1e2c64 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/dataset/test_rgb_hsv.py | 949144093/mindspore | c29d6bb764e233b427319cb89ba79e420f1e2c64 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 38.215116 | 119 | 0.66621 |
import colorsys
import numpy as np
from numpy.testing import assert_allclose
import mindspore.dataset as ds
import mindspore.dataset.transforms.transforms
import mindspore.dataset.vision.transforms as vision
import mindspore.dataset.vision.py_transforms_util as util
DATA_DIR = ["../data/dataset/test_tf... | true | true |
f70fd4d19e6dc7edc35f39b372064e31f3be0c68 | 2,521 | py | Python | algorithms/agents/intrinsic.py | rtloftin/strategically_efficient_rl | 85a702b9361211d345a58cc60696e4e851d48ec4 | [
"MIT"
] | 7 | 2021-08-02T14:28:33.000Z | 2021-12-27T03:30:47.000Z | algorithms/agents/intrinsic.py | rtloftin/strategically_efficient_rl | 85a702b9361211d345a58cc60696e4e851d48ec4 | [
"MIT"
] | 3 | 2021-08-02T17:35:52.000Z | 2022-02-10T04:42:17.000Z | algorithms/agents/intrinsic.py | rtloftin/strategically_efficient_rl | 85a702b9361211d345a58cc60696e4e851d48ec4 | [
"MIT"
] | 2 | 2021-08-02T17:30:05.000Z | 2021-09-13T12:16:29.000Z | import numpy as np
import scipy.signal
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.evaluation.postprocessing import Postprocessing
from algorithms.curiosity import INTRINSIC_REWARD
INTRINSIC_VALUE_TARGETS = "intrinsic_value_targets"
INTRINSIC_VF_PREDS = "intrinsic_vf_preds"
def discount(x, ... | 38.784615 | 115 | 0.685839 | import numpy as np
import scipy.signal
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.evaluation.postprocessing import Postprocessing
from algorithms.curiosity import INTRINSIC_REWARD
INTRINSIC_VALUE_TARGETS = "intrinsic_value_targets"
INTRINSIC_VF_PREDS = "intrinsic_vf_preds"
def discount(x, ... | true | true |
f70fd5a77b2b7e1d279a9781bf732832a587791e | 12,829 | py | Python | maskrcnn_benchmark/modeling/roi_heads/relation_head/model_transformer.py | KaihuaTang/scene-graph-benchmark.pytorch | 45cd54f7465b81d3154e94fcab2b554a09637f6f | [
"MIT"
] | 16 | 2021-08-18T02:51:02.000Z | 2022-03-19T12:43:27.000Z | maskrcnn_benchmark/modeling/roi_heads/relation_head/model_transformer.py | KaihuaTang/scene-graph-benchmark.pytorch | 45cd54f7465b81d3154e94fcab2b554a09637f6f | [
"MIT"
] | 4 | 2021-09-23T11:04:57.000Z | 2022-02-21T01:57:30.000Z | maskrcnn_benchmark/modeling/roi_heads/relation_head/model_transformer.py | KaihuaTang/scene-graph-benchmark.pytorch | 45cd54f7465b81d3154e94fcab2b554a09637f6f | [
"MIT"
] | 2 | 2022-03-22T01:28:10.000Z | 2022-03-28T13:26:25.000Z | """
Based on the implementation of https://github.com/jadore801120/attention-is-all-you-need-pytorch
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from maskrcnn_benchmark.modeling.utils import cat
from .utils_motifs import obj_edge_vectors, to_onehot, nms_overlaps, encode_box... | 41.924837 | 165 | 0.626159 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from maskrcnn_benchmark.modeling.utils import cat
from .utils_motifs import obj_edge_vectors, to_onehot, nms_overlaps, encode_box_info
class ScaledDotProductAttention(nn.Module):
def __init__(self, temperature, attn_dropout=0.1):... | true | true |
f70fd62b300ff414f3f9d7f1839393e9f800dd25 | 2,666 | py | Python | scripts/train.py | lenna-project/birds-plugin | c548790dcb0593b80ea6da4605e7aa32e3f141ae | [
"MIT"
] | null | null | null | scripts/train.py | lenna-project/birds-plugin | c548790dcb0593b80ea6da4605e7aa32e3f141ae | [
"MIT"
] | null | null | null | scripts/train.py | lenna-project/birds-plugin | c548790dcb0593b80ea6da4605e7aa32e3f141ae | [
"MIT"
] | null | null | null | import logging
import numpy as np
import os
import PIL
import PIL.Image
import tensorflow as tf
from tensorflow.keras.layers import Layer, Conv2D, MaxPool2D, Dense, Flatten, Dropout, GlobalAveragePooling2D
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras import layers
from tensorflow.keras i... | 26.137255 | 109 | 0.716429 | import logging
import numpy as np
import os
import PIL
import PIL.Image
import tensorflow as tf
from tensorflow.keras.layers import Layer, Conv2D, MaxPool2D, Dense, Flatten, Dropout, GlobalAveragePooling2D
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras import layers
from tensorflow.keras i... | true | true |
f70fd6ce4c9506385e733ceaf337664ae0b4ab6f | 1,198 | py | Python | learn_pipe/model/lstm.py | tpimentelms/meaning2form | 624b3947b3ac2a7a521cf35c762fb56508236f74 | [
"MIT"
] | 1 | 2021-07-11T09:27:13.000Z | 2021-07-11T09:27:13.000Z | learn_pipe/model/lstm.py | tpimentelms/meaning2form | 624b3947b3ac2a7a521cf35c762fb56508236f74 | [
"MIT"
] | 2 | 2021-09-08T01:04:05.000Z | 2022-03-11T23:50:19.000Z | learn_pipe/model/lstm.py | tpimentelms/meaning2form | 624b3947b3ac2a7a521cf35c762fb56508236f74 | [
"MIT"
] | 1 | 2019-10-22T14:22:53.000Z | 2019-10-22T14:22:53.000Z | import torch.nn as nn
from .base import BaseLM
class IpaLM(BaseLM):
name = 'lstm'
def __init__(self, vocab_size, hidden_size, nlayers=1, dropout=0.1, embedding_size=None, **kwargs):
super().__init__(
vocab_size, hidden_size, nlayers=nlayers, dropout=dropout, embedding_size=embedding_size... | 33.277778 | 113 | 0.649416 | import torch.nn as nn
from .base import BaseLM
class IpaLM(BaseLM):
name = 'lstm'
def __init__(self, vocab_size, hidden_size, nlayers=1, dropout=0.1, embedding_size=None, **kwargs):
super().__init__(
vocab_size, hidden_size, nlayers=nlayers, dropout=dropout, embedding_size=embedding_size... | true | true |
f70fd8904b39f8d1a6fff3821f6d106d8fd7a3e2 | 6,582 | py | Python | tests/lax_numpy_einsum_test.py | j-towns/jax | 49f3f991d4faae22fcd9d8248f3d36575b5004f6 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2019-02-11T16:44:26.000Z | 2019-12-21T06:17:36.000Z | tests/lax_numpy_einsum_test.py | j-towns/jax | 49f3f991d4faae22fcd9d8248f3d36575b5004f6 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/lax_numpy_einsum_test.py | j-towns/jax | 49f3f991d4faae22fcd9d8248f3d36575b5004f6 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-13T13:25:49.000Z | 2020-10-13T13:25:49.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 23.257951 | 77 | 0.55272 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import defaultdict
import itertools
import numpy as onp
from absl.testing import absltest
from absl.testing import parameterized
import jax.numpy as np
import jax.test_util as j... | true | true |
f70fd8bf2d8002f88cdec8c2042ed6b8aebfceb0 | 20,088 | py | Python | pysnmp-with-texts/SW-STRCTURE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/SW-STRCTURE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/SW-STRCTURE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module SW-STRCTURE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SW-STRCTURE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:12:42 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... | 133.033113 | 2,170 | 0.759359 |
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion = mibBuild... | true | true |
f70fda2462f589a62308e52704ddeabc6bfe0104 | 21,792 | py | Python | my_utils/my_geometry.py | cigar666/my_manim_projects | 64d02fb829ce5befd75d91327be465902fabb9c1 | [
"MIT"
] | 159 | 2020-02-17T06:45:25.000Z | 2022-03-24T06:11:00.000Z | my_utils/my_geometry.py | cigar666/my_manim_projects | 64d02fb829ce5befd75d91327be465902fabb9c1 | [
"MIT"
] | 1 | 2020-08-06T02:01:29.000Z | 2020-08-06T03:05:25.000Z | my_utils/my_geometry.py | cigar666/my_manim_projects | 64d02fb829ce5befd75d91327be465902fabb9c1 | [
"MIT"
] | 53 | 2020-02-21T03:13:49.000Z | 2022-03-14T09:03:59.000Z | from manimlib.constants import *
from manimlib.mobject.types.vectorized_mobject import VMobject, VGroup
from manimlib.mobject.geometry import Arc, Line, Dot, Polygon, Sector, Circle
from manimlib.utils.color import color_gradient
from manimlib.mobject.number_line import DecimalNumber
from manimlib.mobject.svg.tex_mobje... | 41.116981 | 193 | 0.583058 | from manimlib.constants import *
from manimlib.mobject.types.vectorized_mobject import VMobject, VGroup
from manimlib.mobject.geometry import Arc, Line, Dot, Polygon, Sector, Circle
from manimlib.utils.color import color_gradient
from manimlib.mobject.number_line import DecimalNumber
from manimlib.mobject.svg.tex_mobje... | true | true |
f70fdb71a02ce4ac6ec40e53c2beb666b9b2d2c5 | 1,884 | py | Python | image_augmentation/callbacks/extra_eval.py | tanzhenyu/image_augmentation | d1f8cc35cf25438556e7934e8e6c78827819ea9d | [
"Apache-2.0"
] | 6 | 2020-08-26T18:54:42.000Z | 2020-11-22T02:45:37.000Z | image_augmentation/callbacks/extra_eval.py | tanzhenyu/image_augmentation | d1f8cc35cf25438556e7934e8e6c78827819ea9d | [
"Apache-2.0"
] | 3 | 2020-07-13T13:44:09.000Z | 2022-02-10T02:12:46.000Z | image_augmentation/callbacks/extra_eval.py | tanzhenyu/image_augmentation | d1f8cc35cf25438556e7934e8e6c78827819ea9d | [
"Apache-2.0"
] | 1 | 2021-03-24T09:51:22.000Z | 2021-03-24T09:51:22.000Z | import tensorflow as tf
from tensorflow.keras.callbacks import Callback
class ExtraValidation(Callback):
"""Log evaluation metrics of an extra validation set. This callback
is useful for model training scenarios where multiple validation sets
are used for evaluation (as Keras by default, provides function... | 42.818182 | 86 | 0.684713 | import tensorflow as tf
from tensorflow.keras.callbacks import Callback
class ExtraValidation(Callback):
def __init__(self, validation_data, tensorboard_path, validation_freq=1):
super(ExtraValidation, self).__init__()
self.validation_data = validation_data
self.tensorboard_path = tensorb... | true | true |
f70fdbec7fdf36e212bd081759f1a760efe641e0 | 31 | py | Python | anoflows/__init__.py | rom1mouret/anoflows | 42381c06b8897e4510e73cda87ea97ea3f4a5579 | [
"Apache-2.0"
] | null | null | null | anoflows/__init__.py | rom1mouret/anoflows | 42381c06b8897e4510e73cda87ea97ea3f4a5579 | [
"Apache-2.0"
] | null | null | null | anoflows/__init__.py | rom1mouret/anoflows | 42381c06b8897e4510e73cda87ea97ea3f4a5579 | [
"Apache-2.0"
] | null | null | null | from .anoflows import AnoFlows
| 15.5 | 30 | 0.83871 | from .anoflows import AnoFlows
| true | true |
f70fdce8d4dc8ca30480e127bc4ef4d7f2e0fe06 | 585 | py | Python | flask_unchained/bundles/security/admins/role_admin.py | briancappello/flask-unchained | bff296b5c808f5b1db10f7dddb81054600545749 | [
"MIT"
] | 69 | 2018-10-10T01:59:11.000Z | 2022-03-29T17:29:30.000Z | flask_unchained/bundles/security/admins/role_admin.py | briancappello/flask-unchained | bff296b5c808f5b1db10f7dddb81054600545749 | [
"MIT"
] | 18 | 2018-11-17T12:42:02.000Z | 2021-05-22T18:45:27.000Z | flask_unchained/bundles/security/admins/role_admin.py | briancappello/flask-unchained | bff296b5c808f5b1db10f7dddb81054600545749 | [
"MIT"
] | 7 | 2018-10-12T16:20:25.000Z | 2021-10-06T12:18:21.000Z | from flask_unchained.bundles.admin import ModelAdmin
from flask_unchained.bundles.admin.templates import details_link, edit_link
from ..models import Role
class RoleAdmin(ModelAdmin):
model = Role
name = 'Roles'
category_name = 'Security'
menu_icon_value = 'fa fa-check'
column_searchable_list =... | 25.434783 | 75 | 0.71453 | from flask_unchained.bundles.admin import ModelAdmin
from flask_unchained.bundles.admin.templates import details_link, edit_link
from ..models import Role
class RoleAdmin(ModelAdmin):
model = Role
name = 'Roles'
category_name = 'Security'
menu_icon_value = 'fa fa-check'
column_searchable_list =... | true | true |
f70fdd0c46e28d30b6201db991e8334f76ba47d6 | 762 | py | Python | image_optimizer_demo/image_optimizer_demo/urls.py | agusmakmun/django-tinypng | 30fe24d2f9bd8767133ee8c0f418fd6c58fdd1be | [
"MIT"
] | 17 | 2018-08-15T21:38:21.000Z | 2021-08-17T04:31:10.000Z | image_optimizer_demo/image_optimizer_demo/urls.py | agusmakmun/django-tinypng | 30fe24d2f9bd8767133ee8c0f418fd6c58fdd1be | [
"MIT"
] | 6 | 2019-02-17T03:07:46.000Z | 2022-03-29T06:35:01.000Z | image_optimizer_demo/image_optimizer_demo/urls.py | agusmakmun/django-tinypng | 30fe24d2f9bd8767133ee8c0f418fd6c58fdd1be | [
"MIT"
] | 9 | 2019-02-16T16:54:38.000Z | 2022-01-14T18:29:56.000Z | """image_optimizer_demo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home'... | 34.636364 | 77 | 0.713911 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
f70fdd11036b90d4d4b1ae1d474d715bf5351817 | 11,113 | py | Python | 3-extract-data/cablegatedata.py | paul-mathieu/cablegate-cia-analysis | 89ea4570319c29df5f2b105384ff9e7eb408f2f9 | [
"MIT"
] | null | null | null | 3-extract-data/cablegatedata.py | paul-mathieu/cablegate-cia-analysis | 89ea4570319c29df5f2b105384ff9e7eb408f2f9 | [
"MIT"
] | null | null | null | 3-extract-data/cablegatedata.py | paul-mathieu/cablegate-cia-analysis | 89ea4570319c29df5f2b105384ff9e7eb408f2f9 | [
"MIT"
] | null | null | null | countries = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia",
"Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus",
"Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "B... | 101.954128 | 120 | 0.454513 | countries = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia",
"Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus",
"Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "B... | true | true |
f70fdf440a5e9d6267be85dd22467b253cd43fb7 | 42,685 | py | Python | httpx/models.py | pereile/httpx | 31730e709597baaa7b2364fee041dfa985169789 | [
"BSD-3-Clause"
] | null | null | null | httpx/models.py | pereile/httpx | 31730e709597baaa7b2364fee041dfa985169789 | [
"BSD-3-Clause"
] | null | null | null | httpx/models.py | pereile/httpx | 31730e709597baaa7b2364fee041dfa985169789 | [
"BSD-3-Clause"
] | null | null | null | import cgi
import datetime
import email.message
import json as jsonlib
import typing
import urllib.request
from collections.abc import MutableMapping
from http.cookiejar import Cookie, CookieJar
from urllib.parse import parse_qsl, urlencode
import chardet
import rfc3986
from .config import USER_AGENT
from .decoders i... | 32.2882 | 88 | 0.579806 | import cgi
import datetime
import email.message
import json as jsonlib
import typing
import urllib.request
from collections.abc import MutableMapping
from http.cookiejar import Cookie, CookieJar
from urllib.parse import parse_qsl, urlencode
import chardet
import rfc3986
from .config import USER_AGENT
from .decoders i... | true | true |
f70fdfa9f2c0a52362c0e1de74f04cebad41b2f6 | 13,269 | py | Python | framework/CodeInterfaces/MAMMOTH/MAMMOTHInterface.py | milljm/raven | 5f29fe81b75e2ffbeb54a55aa63647e7b2f6457b | [
"Apache-2.0"
] | null | null | null | framework/CodeInterfaces/MAMMOTH/MAMMOTHInterface.py | milljm/raven | 5f29fe81b75e2ffbeb54a55aa63647e7b2f6457b | [
"Apache-2.0"
] | null | null | null | framework/CodeInterfaces/MAMMOTH/MAMMOTHInterface.py | milljm/raven | 5f29fe81b75e2ffbeb54a55aa63647e7b2f6457b | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 52.240157 | 130 | 0.692064 |
from __future__ import division, print_function, unicode_literals, absolute_import
import warnings
warnings.simplefilter('default',DeprecationWarning)
import os
import copy
from subprocess import Popen
from CodeInterfaceBaseClass import CodeInterfaceBase
from MooseBasedAppInterface import MooseBasedApp
fr... | true | true |
f70fe063edbc04be9bbe4375c8b98151415f3e24 | 514 | py | Python | 1. Python/1. Getting Started with Python/27.explicite_type_conversion.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | 1 | 2021-12-05T18:02:15.000Z | 2021-12-05T18:02:15.000Z | 1. Python/1. Getting Started with Python/27.explicite_type_conversion.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | null | null | null | 1. Python/1. Getting Started with Python/27.explicite_type_conversion.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | null | null | null | #Explicit type conversion from int to float
num1 = 10
num2 = 20
num3 = num1 + num2
print(num3)
print(type(num3))
num4 = float(num1 + num2)
print(num4)
print(type(num4))
#Explicit type conversion from float to int
num1 = 10.2
num2 = 20.6
num3 = (num1 + num2)
print(num3)
print(type(num3))
num4 = int(num1 + num2)
print(n... | 19.037037 | 44 | 0.727626 |
num1 = 10
num2 = 20
num3 = num1 + num2
print(num3)
print(type(num3))
num4 = float(num1 + num2)
print(num4)
print(type(num4))
num1 = 10.2
num2 = 20.6
num3 = (num1 + num2)
print(num3)
print(type(num3))
num4 = int(num1 + num2)
print(num4)
print(type(num4))
priceIcecream = 25
priceBrownie = 45
totalPrice = priceIcecre... | true | true |
f70fe0a01bae4cc23cfd544120436709046c362b | 10,820 | py | Python | backend/workers/tasks/data.py | uwer/coco-annotator | 03f33aee2f1bb00c3b5f93b299f7c45dd7ab36d4 | [
"MIT"
] | null | null | null | backend/workers/tasks/data.py | uwer/coco-annotator | 03f33aee2f1bb00c3b5f93b299f7c45dd7ab36d4 | [
"MIT"
] | null | null | null | backend/workers/tasks/data.py | uwer/coco-annotator | 03f33aee2f1bb00c3b5f93b299f7c45dd7ab36d4 | [
"MIT"
] | null | null | null |
from database import (
fix_ids,
ImageModel,
CategoryModel,
AnnotationModel,
DatasetModel,
TaskModel,
ExportModel
)
# import pycocotools.mask as mask
import numpy as np
import time
import json
import os
from celery import shared_task
from ..socket import create_socket
from mongoengine impo... | 32.492492 | 109 | 0.614325 |
from database import (
fix_ids,
ImageModel,
CategoryModel,
AnnotationModel,
DatasetModel,
TaskModel,
ExportModel
)
import numpy as np
import time
import json
import os
from celery import shared_task
from ..socket import create_socket
from mongoengine import Q
from config import Config
fr... | true | true |
f70fe15e691eebb7b57139f7a24cfd21bcde7dd8 | 516 | py | Python | tests/r/test_biomass.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 199 | 2017-07-24T01:34:27.000Z | 2022-01-29T00:50:55.000Z | tests/r/test_biomass.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 46 | 2017-09-05T19:27:20.000Z | 2019-01-07T09:47:26.000Z | tests/r/test_biomass.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 45 | 2017-07-26T00:10:44.000Z | 2022-03-16T20:44:59.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.biomass import biomass
def test_biomass():
"""Test module biomass.py by downloading
biomass.csv and testing shape of
extracted data has 15... | 21.5 | 44 | 0.753876 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.biomass import biomass
def test_biomass():
test_path = tempfile.mkdtemp()
x_train, metadata = biomass(test_path)
try:
assert x_train.sha... | true | true |
f70fe1b1005484c82991bd4f9673404e1958f315 | 1,236 | py | Python | examples/satellite-monitor-example.py | VLiu7/mobileinsight-core | a007f18230e09a5102d8035a929c284de0007938 | [
"Apache-2.0"
] | null | null | null | examples/satellite-monitor-example.py | VLiu7/mobileinsight-core | a007f18230e09a5102d8035a929c284de0007938 | [
"Apache-2.0"
] | null | null | null | examples/satellite-monitor-example.py | VLiu7/mobileinsight-core | a007f18230e09a5102d8035a929c284de0007938 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Filename: monitor-example.py
import os
import sys
# Import MobileInsight modules
from mobile_insight.monitor import OnlineMonitor
from mobile_insight.analyzer import MsgLogger
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Error: please specify physical port name and baudrate... | 32.526316 | 77 | 0.703074 |
import os
import sys
from mobile_insight.monitor import OnlineMonitor
from mobile_insight.analyzer import MsgLogger
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Error: please specify physical port name and baudrate.")
print((__file__, "SERIAL_PORT_NAME BAUNRATE"))
sys.exit(1... | true | true |
f70fe2034157cdb53e2d92c4774b7dc656a4f901 | 1,572 | bzl | Python | bazel/repos.bzl | 4rdparty/bazel-rules-libcurl | 6cc892f41b93d6f11eb15da981f7ef113baa9242 | [
"Apache-2.0"
] | null | null | null | bazel/repos.bzl | 4rdparty/bazel-rules-libcurl | 6cc892f41b93d6f11eb15da981f7ef113baa9242 | [
"Apache-2.0"
] | null | null | null | bazel/repos.bzl | 4rdparty/bazel-rules-libcurl | 6cc892f41b93d6f11eb15da981f7ef113baa9242 | [
"Apache-2.0"
] | null | null | null | """Adds repostories/archives."""
########################################################################
# DO NOT EDIT THIS FILE unless you are inside the
# https://github.com/3rdparty/bazel-rules-curl repository. If you
# encounter it anywhere else it is because it has been copied there in
# order to simplify adding... | 49.125 | 108 | 0.641221 | true | true | |
f70fe2f85bb409f227eb7abc62201aa095f369f2 | 863 | py | Python | setup.py | rlji/pinsage-pytorch | 2f275ca916ce21d0d2c0e022eec664cfd09d06cf | [
"Apache-2.0"
] | null | null | null | setup.py | rlji/pinsage-pytorch | 2f275ca916ce21d0d2c0e022eec664cfd09d06cf | [
"Apache-2.0"
] | null | null | null | setup.py | rlji/pinsage-pytorch | 2f275ca916ce21d0d2c0e022eec664cfd09d06cf | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from setuptools import setup, find_packages
VERSION = '0.1.0'
NAME = 'pinsage-pytorch'
DESCRIPTION = 'This is a PinSage pytorch library.'
URL = 'https://github.com/rlji/pinsage-pytorch'
EMAIL = 'me@example.com'
AUTHOR = 'rlji'
# What python versions are suppor... | 21.04878 | 60 | 0.701043 | from __future__ import absolute_import, unicode_literals
from setuptools import setup, find_packages
VERSION = '0.1.0'
NAME = 'pinsage-pytorch'
DESCRIPTION = 'This is a PinSage pytorch library.'
URL = 'https://github.com/rlji/pinsage-pytorch'
EMAIL = 'me@example.com'
AUTHOR = 'rlji'
REQUIRES_PYTHON = ">=3.6"
REQU... | true | true |
f70fe33ba97c88acc056615ad526b5b4f292cf98 | 9,924 | py | Python | packit/utils/repo.py | wickdChromosome/packit | ee31b8bbab579679f928a05db8125897bf2cad62 | [
"MIT"
] | null | null | null | packit/utils/repo.py | wickdChromosome/packit | ee31b8bbab579679f928a05db8125897bf2cad62 | [
"MIT"
] | null | null | null | packit/utils/repo.py | wickdChromosome/packit | ee31b8bbab579679f928a05db8125897bf2cad62 | [
"MIT"
] | null | null | null | # Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import logging
import re
import subprocess
import tempfile
from pathlib import Path
from typing import Tuple, Optional, Union, List
import git
import yaml
from ogr.parsing import RepoUrl, parse_git_repo
from packit.exceptions import Packi... | 31.305994 | 100 | 0.637948 |
import logging
import re
import subprocess
import tempfile
from pathlib import Path
from typing import Tuple, Optional, Union, List
import git
import yaml
from ogr.parsing import RepoUrl, parse_git_repo
from packit.exceptions import PackitException
logger = logging.getLogger(__name__)
class RepositoryCache:
... | true | true |
f70fe4521b71231fe23de14972ca86fefa3f06d0 | 709 | py | Python | returning.py | EnescanAkyuz/Python_Beginner | 84c32d39ec0727f39655bd88c57ccdeba1929532 | [
"MIT"
] | 4 | 2022-03-16T20:49:07.000Z | 2022-03-17T14:55:39.000Z | returning.py | EnescanAkyuz/Python_Beginner | 84c32d39ec0727f39655bd88c57ccdeba1929532 | [
"MIT"
] | null | null | null | returning.py | EnescanAkyuz/Python_Beginner | 84c32d39ec0727f39655bd88c57ccdeba1929532 | [
"MIT"
] | null | null | null | # def yetki_sorgula(page):
# def inner(role):
# if role == "admin" :
# print("{0} rolü {1} sayfasına ulaşabilir." .format(page, role))
# else:
# print("{0} rolü {1} sayfasına ulaşamaz." .format(page, role))
# return inner
# user1 = yetki_sorgula('arayüz')
# print(user1("... | 22.15625 | 77 | 0.533145 |
def islem(islem_adi):
def toplam(*args):
toplam = 0
for i in args:
toplam+=i
return toplam
def carpma(*args):
carpim = 1
for i in args:
carpim*=i
return carpim
if islem_adi == "toplam":
return toplam
else:
... | true | true |
f70fe4678dd09d611f534904898182e688634ba5 | 302 | py | Python | utils/all_utils.py | codersatyam/Perceptron | 8df4975405020c40aaec0179757f185d9ebbdff8 | [
"MIT"
] | null | null | null | utils/all_utils.py | codersatyam/Perceptron | 8df4975405020c40aaec0179757f185d9ebbdff8 | [
"MIT"
] | null | null | null | utils/all_utils.py | codersatyam/Perceptron | 8df4975405020c40aaec0179757f185d9ebbdff8 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
import joblib
def preparedata(df):
x=df.drop("y",axis=1)
y=df["y"]
return x,y
def save_model(model,filename):
model_dir="model"
os.makedirs(model_dir,exist_ok=True)
filepath=os.path.join(model_dir,filename)
joblib.dump(model,filepath) | 20.133333 | 43 | 0.731788 | import numpy as np
import pandas as pd
import os
import joblib
def preparedata(df):
x=df.drop("y",axis=1)
y=df["y"]
return x,y
def save_model(model,filename):
model_dir="model"
os.makedirs(model_dir,exist_ok=True)
filepath=os.path.join(model_dir,filename)
joblib.dump(model,filepath) | true | true |
f70fe4c61d30fb5146ad4f79eb060ce3710ed779 | 1,178 | py | Python | examples/flask_app.py | cristianMeli/ubatch | fb3c6dccf0a9e25e25f5956e2e91ed70e9ea01ee | [
"Apache-2.0"
] | null | null | null | examples/flask_app.py | cristianMeli/ubatch | fb3c6dccf0a9e25e25f5956e2e91ed70e9ea01ee | [
"Apache-2.0"
] | null | null | null | examples/flask_app.py | cristianMeli/ubatch | fb3c6dccf0a9e25e25f5956e2e91ed70e9ea01ee | [
"Apache-2.0"
] | null | null | null | import random
import numpy as np
from typing import Dict, List
from flask import Flask
from flask_restx import Resource, Api
# from numpy import genfromtxt
from ubatch import ubatch_decorator
# from keras.models import load_model
from sklearn.datasets import fetch_20newsgroups
from sklearn.model_selection import t... | 23.098039 | 63 | 0.724109 | import random
import numpy as np
from typing import Dict, List
from flask import Flask
from flask_restx import Resource, Api
from ubatch import ubatch_decorator
from sklearn.datasets import fetch_20newsgroups
from sklearn.model_selection import train_test_split
from joblib import load
ngd = fetch_20newsgroups... | true | true |
f70fe5076940addc4ee562f410471d9471696de1 | 178 | py | Python | api/geocode/geocode_clear_cache.py | michael-pryor/GeoTweetSearch | cb6d0a7732a0584022f3720e3f696fb709dd45b5 | [
"Apache-2.0"
] | 1 | 2016-04-08T08:40:34.000Z | 2016-04-08T08:40:34.000Z | api/geocode/geocode_clear_cache.py | watfordxp/GeoTweetSearch | cb6d0a7732a0584022f3720e3f696fb709dd45b5 | [
"Apache-2.0"
] | null | null | null | api/geocode/geocode_clear_cache.py | watfordxp/GeoTweetSearch | cb6d0a7732a0584022f3720e3f696fb709dd45b5 | [
"Apache-2.0"
] | 2 | 2015-08-28T17:08:26.000Z | 2016-12-30T21:59:46.000Z | from api.caching.caching_shared import getDatabase
__author__ = 'Michael Pryor'
if __name__ == '__main__':
db = getDatabase()
db.place.remove()
db.geocode.remove() | 19.777778 | 50 | 0.707865 | from api.caching.caching_shared import getDatabase
__author__ = 'Michael Pryor'
if __name__ == '__main__':
db = getDatabase()
db.place.remove()
db.geocode.remove() | true | true |
f70fe77c34822d34426ad7b00c5ac679b16a18e2 | 2,689 | py | Python | tests/initialisations/test_bradleyfayyad1998.py | simonharris/pykmeans | 256e0c6c7284182aae9c10783cf50778af120514 | [
"MIT"
] | 1 | 2021-12-30T01:25:03.000Z | 2021-12-30T01:25:03.000Z | tests/initialisations/test_bradleyfayyad1998.py | simonharris/pycluster | 4d47eb12a2bbaf1b05d7ccfd0cfc9ccf78ddf86d | [
"MIT"
] | 3 | 2020-11-12T12:36:00.000Z | 2021-06-18T12:46:59.000Z | tests/initialisations/test_bradleyfayyad1998.py | simonharris/pycluster | 4d47eb12a2bbaf1b05d7ccfd0cfc9ccf78ddf86d | [
"MIT"
] | 1 | 2021-12-30T01:32:32.000Z | 2021-12-30T01:32:32.000Z | """
Test for Bradley & Fayyad 1998 initialisation algorithm
"""
import unittest
import numpy as np
from datasets import testloader
from initialisations import bradley as bfinit
import kmeans
# pylint: disable=R0201,W0212
class BfTestSuite(unittest.TestCase):
"""Test suite for B&F"""
def test_code_runs(se... | 29.877778 | 77 | 0.550019 |
import unittest
import numpy as np
from datasets import testloader
from initialisations import bradley as bfinit
import kmeans
class BfTestSuite(unittest.TestCase):
def test_code_runs(self):
dataset = testloader.load_iris()
centroids = bfinit.generate(dataset.data, 3)
self.assertEqu... | true | true |
f70fe7c61417fc91a75e5addb50e54ff45c99f58 | 10,424 | py | Python | ultracart/models/item_revguard.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | 1 | 2018-03-15T16:56:23.000Z | 2018-03-15T16:56:23.000Z | ultracart/models/item_revguard.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | ultracart/models/item_revguard.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ItemRevguard(object):
... | 36.447552 | 284 | 0.684574 |
import pprint
import re
import six
class ItemRevguard(object):
swagger_types = {
'revguard_canceled_csr_prompt_group': 'int',
'revguard_canceled_ivr_prompt_group': 'int',
'revguard_canceled_web_prompt_group': 'int',
'revguard_client_brand': 'int',
'revguard_csr_prom... | true | true |
f70fe7e6b28f7caeabf6ae69e9564f3ee8605915 | 4,249 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_shellutil_filesystem_oper.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_shellutil_filesystem_oper.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_shellutil_filesystem_oper.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | 42.069307 | 183 | 0.534243 |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | true | true |
f70fe802d4a25dbb1db4f6162b56cf2586d5e4a1 | 22,011 | py | Python | codalab/worker/bundle_manager.py | ethancaballero/codalab-cli | b9dbe569ef12e22242bf3ad8c1961443f1b736f4 | [
"Apache-2.0"
] | null | null | null | codalab/worker/bundle_manager.py | ethancaballero/codalab-cli | b9dbe569ef12e22242bf3ad8c1961443f1b736f4 | [
"Apache-2.0"
] | null | null | null | codalab/worker/bundle_manager.py | ethancaballero/codalab-cli | b9dbe569ef12e22242bf3ad8c1961443f1b736f4 | [
"Apache-2.0"
] | null | null | null | import datetime
import logging
import os
import random
import re
import sys
import threading
import time
import traceback
from codalab.objects.permission import check_bundles_have_read_permission
from codalab.common import PermissionError
from codalab.lib import bundle_util, formatting, path_util
from codalabworker.fi... | 41.846008 | 140 | 0.621008 | import datetime
import logging
import os
import random
import re
import sys
import threading
import time
import traceback
from codalab.objects.permission import check_bundles_have_read_permission
from codalab.common import PermissionError
from codalab.lib import bundle_util, formatting, path_util
from codalabworker.fi... | true | true |
f70fe8cd388780589f821fdeb68e298ecd437657 | 2,365 | py | Python | azure-servicemanagement-legacy/setup.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-servicemanagement-legacy/setup.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-servicemanagement-legacy/setup.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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... | 34.275362 | 86 | 0.614799 |
from setuptools import setup
try:
import azure
try:
ver = azure.__version__
raise Exception(
'This package is incompatible with azure=={}. '.format(ver) +
'Uninstall it with "pip uninstall azure".'
)
except AttributeError:
pass
exce... | true | true |
f70fe8e5aa412881ec6f288fac376593ff84e297 | 74 | py | Python | tests/unit/test_version.py | HoverHell/python-gron | 21977c36b5fafde6be351b5488673e97a7cb4aeb | [
"MIT"
] | 10 | 2018-06-23T11:32:14.000Z | 2021-12-15T09:45:53.000Z | tests/unit/test_version.py | HoverHell/python-gron | 21977c36b5fafde6be351b5488673e97a7cb4aeb | [
"MIT"
] | null | null | null | tests/unit/test_version.py | HoverHell/python-gron | 21977c36b5fafde6be351b5488673e97a7cb4aeb | [
"MIT"
] | 1 | 2021-04-06T10:56:37.000Z | 2021-04-06T10:56:37.000Z | import gron
def test_version():
assert hasattr(gron, '__VERSION__')
| 12.333333 | 39 | 0.716216 | import gron
def test_version():
assert hasattr(gron, '__VERSION__')
| true | true |
f70fe9543b5a7ed3a240ddb45d836fbfea8bd6f1 | 2,147 | py | Python | podaac/tests/oceancolor_test.py | wongvh07/SPAC4C | d8186bd4dab25472f3a45a7b0464aa95553c92f9 | [
"Apache-2.0"
] | null | null | null | podaac/tests/oceancolor_test.py | wongvh07/SPAC4C | d8186bd4dab25472f3a45a7b0464aa95553c92f9 | [
"Apache-2.0"
] | null | null | null | podaac/tests/oceancolor_test.py | wongvh07/SPAC4C | d8186bd4dab25472f3a45a7b0464aa95553c92f9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2019 California Institute of Technology.
#
# 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... | 37.666667 | 101 | 0.681416 |
from ..oceancolor import OceanColor
import os
from nose.tools import assert_raises
import unittest
class TestOceanColor(unittest.TestCase):
@classmethod
def setUp(self):
self.oceancolor = OceanColor()
def test_file_search(self):
data = self.oceancolor.file_search(senso... | true | true |
f70fe95b85d78d30cacb9a1b024c50b672432093 | 591 | py | Python | PokeType/compiler/data_types.py | Daggy1234/PokeType | a79c8115ca9bb13e24c4fd4db4931b3094a96549 | [
"MIT"
] | 2 | 2021-11-06T14:09:40.000Z | 2021-11-14T21:24:56.000Z | PokeType/compiler/data_types.py | Daggy1234/PokeType | a79c8115ca9bb13e24c4fd4db4931b3094a96549 | [
"MIT"
] | null | null | null | PokeType/compiler/data_types.py | Daggy1234/PokeType | a79c8115ca9bb13e24c4fd4db4931b3094a96549 | [
"MIT"
] | null | null | null | from rply import ParserGenerator
from poketype.ast import Number, Boolean, NegNumber
class DataTypes():
def __init__(self, pg: ParserGenerator) -> None:
@pg.production('expression : NUMBER')
def expression_number(p):
return Number(int(p[0].getstr()))
@pg.production('expression : BOOLEAN')
def expressio... | 24.625 | 51 | 0.681895 | from rply import ParserGenerator
from poketype.ast import Number, Boolean, NegNumber
class DataTypes():
def __init__(self, pg: ParserGenerator) -> None:
@pg.production('expression : NUMBER')
def expression_number(p):
return Number(int(p[0].getstr()))
@pg.production('expression : BOOLEAN')
def expressio... | true | true |
f70fea670ad876700ffca4a80a4ba82548c929e5 | 1,300 | py | Python | cinder/brick/initiator/executor.py | hopem/cinder | 7df656ff0be9fef34a4e19f7b83a0cae554db1e7 | [
"Apache-2.0"
] | null | null | null | cinder/brick/initiator/executor.py | hopem/cinder | 7df656ff0be9fef34a4e19f7b83a0cae554db1e7 | [
"Apache-2.0"
] | null | null | null | cinder/brick/initiator/executor.py | hopem/cinder | 7df656ff0be9fef34a4e19f7b83a0cae554db1e7 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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.apa... | 35.135135 | 78 | 0.718462 |
from cinder.openstack.common import processutils as putils
class Executor(object):
def __init__(self, execute=putils.execute, root_helper="sudo",
*args, **kwargs):
self.set_execute(execute)
self.set_root_helper(root_helper)
def set_execute(self, execute):
... | true | true |
f70feab366fbb1f7eb3273b9e7e6a5b34188a5d9 | 8,461 | py | Python | doc/oldcode/swhlab/core/memtest.py | swharden/SWHLab | a86c3c65323cec809a4bd4f81919644927094bf5 | [
"MIT"
] | 15 | 2017-03-09T03:08:32.000Z | 2021-11-16T11:31:55.000Z | doc/oldcode/swhlab/core/memtest.py | swharden/SWHLab | a86c3c65323cec809a4bd4f81919644927094bf5 | [
"MIT"
] | 2 | 2016-12-06T16:27:54.000Z | 2017-11-04T23:48:49.000Z | doc/oldcode/swhlab/core/memtest.py | swharden/SWHLab | a86c3c65323cec809a4bd4f81919644927094bf5 | [
"MIT"
] | 9 | 2016-10-19T13:32:10.000Z | 2020-04-01T21:53:40.000Z | """
Membrane test routines for voltage clamp experiments.
creates abf.MTs[sweep]={} #with keys like Ih, Ra, Rm, etc
Example usage:
abf=swhlab.ABF('../abfs/group/16701010.abf')
swhlab.memtest.memtest(abf) #performs memtest on all sweeps
swhlab.memtest.checkSweep(abf) #lets you eyeball check how it did
p... | 38.811927 | 94 | 0.630304 |
import os
import sys
import pylab
import numpy as np
import time
import swhlab
import swhlab.core.common as cm
exampleABF=swhlab.ABF()
def memtestSweepVC(abf=exampleABF):
if abf.protoSeqY[1]>abf.protoSeqY[0] or len(abf.protoSeqY)<3:
return "protocol doesn't step down and back up"
TA,TB=int(abf.protoS... | true | true |
f70feac9370b5f157bc2c9998745353b5bf8bb67 | 17,023 | py | Python | lenstronomy/LensModel/MultiPlane/multi_plane_base.py | JelleAalbers/lenstronomy | 6db785667ff099fa8338e972b66253b2901b2827 | [
"MIT"
] | null | null | null | lenstronomy/LensModel/MultiPlane/multi_plane_base.py | JelleAalbers/lenstronomy | 6db785667ff099fa8338e972b66253b2901b2827 | [
"MIT"
] | null | null | null | lenstronomy/LensModel/MultiPlane/multi_plane_base.py | JelleAalbers/lenstronomy | 6db785667ff099fa8338e972b66253b2901b2827 | [
"MIT"
] | null | null | null | import numpy as np
from lenstronomy.Cosmo.background import Background
from lenstronomy.LensModel.profile_list_base import ProfileListBase
import lenstronomy.Util.constants as const
__all__ = ['MultiPlaneBase']
class MultiPlaneBase(ProfileListBase):
"""
Multi-plane lensing class
The lens model deflecti... | 46.638356 | 135 | 0.641661 | import numpy as np
from lenstronomy.Cosmo.background import Background
from lenstronomy.LensModel.profile_list_base import ProfileListBase
import lenstronomy.Util.constants as const
__all__ = ['MultiPlaneBase']
class MultiPlaneBase(ProfileListBase):
def __init__(self, lens_model_list, lens_redshift_list, z_sou... | true | true |
f70fec6a4bb9f9aa6a836ce5a5311f9889db362b | 3,307 | py | Python | Friendly/LaTeX/figures/cosinecomparison.py | benvcutilli/CountingPlusFriendly | 1947e2a765e20c87e080da22b4ecc4da1f272b02 | [
"MIT"
] | null | null | null | Friendly/LaTeX/figures/cosinecomparison.py | benvcutilli/CountingPlusFriendly | 1947e2a765e20c87e080da22b4ecc4da1f272b02 | [
"MIT"
] | null | null | null | Friendly/LaTeX/figures/cosinecomparison.py | benvcutilli/CountingPlusFriendly | 1947e2a765e20c87e080da22b4ecc4da1f272b02 | [
"MIT"
] | null | null | null | # The Plotly^^^plotly^^^ package
import plotly
# Importing ^^^numpy^^^
import numpy
def sigmoid(x):
return (1 + numpy.exp(-x)) ** -1
samplesPerDimension = 500
# Using numpy.linspace to create x and y values is from somewhere on ^^^plotly^^^'s website, most
# likely. It is a convenient way to do this, ... | 40.329268 | 100 | 0.498639 |
import plotly
import numpy
def sigmoid(x):
return (1 + numpy.exp(-x)) ** -1
samplesPerDimension = 500
# likely. It is a convenient way to do this, so that's why.
evaluationRange = numpy.linspace([-5, -5], [5, 5], samplesPerDimension, axis=1)
# actually broadcast, but it mimics broadcasting w... | true | true |
f70fec80d037fd24ce2c291102597e64ad2034bd | 2,186 | py | Python | python/maya/site-packages/pymel-1.0.5/extras/completion/py/maya/app/general/adjustBackgroundImageWin.py | CountZer0/PipelineConstructionSet | 0aa73a8a63c72989b2d1c677efd78dad4388d335 | [
"BSD-3-Clause"
] | 21 | 2015-04-27T05:01:36.000Z | 2021-11-22T13:45:14.000Z | python/maya/site-packages/pymel-1.0.5/extras/completion/py/maya/app/general/adjustBackgroundImageWin.py | 0xb1dd1e/PipelineConstructionSet | 621349da1b6d1437e95d0c9e48ee9f36d59f19fd | [
"BSD-3-Clause"
] | null | null | null | python/maya/site-packages/pymel-1.0.5/extras/completion/py/maya/app/general/adjustBackgroundImageWin.py | 0xb1dd1e/PipelineConstructionSet | 621349da1b6d1437e95d0c9e48ee9f36d59f19fd | [
"BSD-3-Clause"
] | 7 | 2015-04-11T11:37:19.000Z | 2020-05-22T09:49:04.000Z | import maya.mel as mel
import maya
import maya.cmds as cmds
import sys
class TselectionWin(object):
"""
Base class for a dialog which works on the user's selection
"""
def __del__(self):
pass
def __init__(self, title, selectionFilter='<function <lambda>>', objects=[... | 16.073529 | 81 | 0.524245 | import maya.mel as mel
import maya
import maya.cmds as cmds
import sys
class TselectionWin(object):
def __del__(self):
pass
def __init__(self, title, selectionFilter='<function <lambda>>', objects=[]):
pass
def activate(self, window):
pas... | true | true |
f70feca6b4336b31b7b0568bb1b1409e4206f656 | 1,454 | py | Python | modules/runtime/runtime.py | Lizhu-Chen/bark | fad029f658e462eb1772c28c2c0971faf5176dc1 | [
"MIT"
] | null | null | null | modules/runtime/runtime.py | Lizhu-Chen/bark | fad029f658e462eb1772c28c2c0971faf5176dc1 | [
"MIT"
] | null | null | null | modules/runtime/runtime.py | Lizhu-Chen/bark | fad029f658e462eb1772c28c2c0971faf5176dc1 | [
"MIT"
] | 1 | 2020-08-12T17:09:05.000Z | 2020-08-12T17:09:05.000Z | # Copyright (c) 2020 Julian Bernhard, Klemens Esterle, Patrick Hart and
# Tobias Kessler
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
from bark.world.opendrive import *
from bark.world import *
from bark.geometry import *
from bark.runtime impor... | 27.433962 | 71 | 0.683631 |
from bark.world.opendrive import *
from bark.world import *
from bark.geometry import *
from bark.runtime import PyRuntime
class Runtime(PyRuntime):
def __init__(self,
step_time,
viewer,
scenario_generator=None,
render=False):
self._step_time = s... | true | true |
f70fecd8c30479e0a7ac5310738add8af3fd85d6 | 14,799 | py | Python | salt/payload.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 19 | 2016-01-29T14:37:52.000Z | 2022-03-30T18:08:01.000Z | salt/payload.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 223 | 2016-03-02T16:39:41.000Z | 2022-03-03T12:26:35.000Z | salt/payload.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 64 | 2016-02-04T19:45:26.000Z | 2021-12-15T02:02:31.000Z | # -*- coding: utf-8 -*-
"""
Many aspects of the salt payload need to be managed, from the return of
encrypted keys to general payload dynamics and packaging, these happen
in here
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import gc
# import sys ... | 38.043702 | 100 | 0.547064 |
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import gc
mport salt.transport.frame
import salt.utils.immutabletypes as immutabletypes
import salt.utils.msgpack
import salt.utils.stringutils
from salt.exceptions import SaltDeserializationError, SaltReqTimeoutError
from s... | true | true |
f70fed361316e184c2d287967078dd0420d8ce66 | 6,658 | py | Python | enquiry/migrations/0007_auto__add_field_enquiry_is_published.py | bitlabstudio/django-enquiry | 2e82b68ea0631ae824d88282daf38b8d28d8f0ee | [
"MIT"
] | null | null | null | enquiry/migrations/0007_auto__add_field_enquiry_is_published.py | bitlabstudio/django-enquiry | 2e82b68ea0631ae824d88282daf38b8d28d8f0ee | [
"MIT"
] | 2 | 2020-02-11T22:02:26.000Z | 2020-06-05T16:58:26.000Z | enquiry/migrations/0007_auto__add_field_enquiry_is_published.py | bitlabstudio/django-enquiry | 2e82b68ea0631ae824d88282daf38b8d28d8f0ee | [
"MIT"
] | null | null | null | # flake8: noqa
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Enquiry.is_published'
db.add_column('enquiry_enquiry', 'is_published',
... | 65.920792 | 182 | 0.560829 |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column('enquiry_enquiry', 'is_published',
self.gf('django.db.models.fields.BooleanField')(default=Fa... | true | true |
f70fed5e21d5b67955d3f6a157574fc6d76f5cfd | 3,434 | py | Python | examples/sac.py | RushikeshJoshi4/rlkit | 85db399565a45d8151f95c855f608ea9d827a0d0 | [
"MIT"
] | null | null | null | examples/sac.py | RushikeshJoshi4/rlkit | 85db399565a45d8151f95c855f608ea9d827a0d0 | [
"MIT"
] | null | null | null | examples/sac.py | RushikeshJoshi4/rlkit | 85db399565a45d8151f95c855f608ea9d827a0d0 | [
"MIT"
] | null | null | null | from gym.envs.mujoco import HalfCheetahEnv
import rlkit.torch.pytorch_util as ptu
from rlkit.data_management.env_replay_buffer import EnvReplayBuffer
from rlkit.envs.wrappers import NormalizedBoxEnv
from rlkit.launchers.launcher_util import setup_logger
from rlkit.samplers.data_collector import MdpPathCollector
from r... | 29.350427 | 74 | 0.657833 | from gym.envs.mujoco import HalfCheetahEnv
import rlkit.torch.pytorch_util as ptu
from rlkit.data_management.env_replay_buffer import EnvReplayBuffer
from rlkit.envs.wrappers import NormalizedBoxEnv
from rlkit.launchers.launcher_util import setup_logger
from rlkit.samplers.data_collector import MdpPathCollector
from r... | true | true |
f70fed9caefe330512d53a8d653194961fe8edf4 | 412 | py | Python | data_structure/recursion/example/example2.py | russellgao/algorithm | ad5e724d20a8492b8eba03fc0f24e4ff5964b3ea | [
"Apache-2.0"
] | 3 | 2020-05-18T00:47:18.000Z | 2020-06-08T01:57:13.000Z | data_structure/recursion/example/example2.py | russellgao/algorithm | ad5e724d20a8492b8eba03fc0f24e4ff5964b3ea | [
"Apache-2.0"
] | null | null | null | data_structure/recursion/example/example2.py | russellgao/algorithm | ad5e724d20a8492b8eba03fc0f24e4ff5964b3ea | [
"Apache-2.0"
] | null | null | null |
def reverseLists(list1) :
"""
原地用递归的方法反转list
:param list1:
:return:
"""
def helper(list1,left,right) :
if left < right :
list1[left] , list1[right] = list1[right] , list1[left]
helper(list1,left + 1 , right -1)
helper(list1,0,len(list1) - 1)
if __name__ == "... | 22.888889 | 67 | 0.524272 |
def reverseLists(list1) :
def helper(list1,left,right) :
if left < right :
list1[left] , list1[right] = list1[right] , list1[left]
helper(list1,left + 1 , right -1)
helper(list1,0,len(list1) - 1)
if __name__ == "__main__" :
list1 = ["a", "b", "c" , "d" , "d","e"]
revers... | true | true |
f70fee4c9a0ab1f2c9ea59edc727df7573e770f1 | 2,531 | py | Python | jina/clients/base/websocket.py | Satya2234/jina | bc4fa6ed8b2bdbc4885bf4a8f4b44722f0fc2deb | [
"Apache-2.0"
] | 15,179 | 2020-04-28T10:23:56.000Z | 2022-03-31T14:35:25.000Z | jina/clients/base/websocket.py | manavshah123/jina | f18b04eb82d18a3c554e2892bbae4b95fc0cb13e | [
"Apache-2.0"
] | 3,912 | 2020-04-28T13:01:29.000Z | 2022-03-31T14:36:46.000Z | jina/clients/base/websocket.py | manavshah123/jina | f18b04eb82d18a3c554e2892bbae4b95fc0cb13e | [
"Apache-2.0"
] | 1,955 | 2020-04-28T10:50:49.000Z | 2022-03-31T12:28:34.000Z | """A module for the websockets-based Client for Jina."""
from typing import Callable, Optional
from contextlib import nullcontext, AsyncExitStack
from ..helper import callback_exec
from .helper import WebsocketClientlet
from ...importer import ImportExtensions
from ..base import BaseClient, InputType
from ...logging.p... | 35.647887 | 81 | 0.568945 | from typing import Callable, Optional
from contextlib import nullcontext, AsyncExitStack
from ..helper import callback_exec
from .helper import WebsocketClientlet
from ...importer import ImportExtensions
from ..base import BaseClient, InputType
from ...logging.profile import ProgressBar
from ...peapods.stream.client i... | true | true |
f70fee9cb2b1dd8ce5770618cf71782ee9238674 | 367 | py | Python | 2_dictionaries/3_storing_dict_in_binary_file.py | nicholasjamesbaker/asd-class | c524971f800d649f4e18cc1e555c348029f6af1b | [
"MIT"
] | 2 | 2022-01-17T13:13:23.000Z | 2022-03-02T18:25:24.000Z | 2_dictionaries/3_storing_dict_in_binary_file.py | nicholasjamesbaker/asd-class | c524971f800d649f4e18cc1e555c348029f6af1b | [
"MIT"
] | null | null | null | 2_dictionaries/3_storing_dict_in_binary_file.py | nicholasjamesbaker/asd-class | c524971f800d649f4e18cc1e555c348029f6af1b | [
"MIT"
] | 3 | 2022-01-12T17:58:44.000Z | 2022-01-16T15:17:58.000Z | import pickle
pranjal = {
'first_name': 'Pranjal',
'last_name': 'Patra',
'age': 35,
'NetWorth': 420.69,
'Vaccinated': True
}
with open("pranjal.bin", 'wb') as pranjal_file:
pickle.dump(pranjal, pranjal_file)
with open('pranjal.bin', 'rb') as pranjal_file:
pranjal_from_bin_file = pickle.lo... | 20.388889 | 53 | 0.675749 | import pickle
pranjal = {
'first_name': 'Pranjal',
'last_name': 'Patra',
'age': 35,
'NetWorth': 420.69,
'Vaccinated': True
}
with open("pranjal.bin", 'wb') as pranjal_file:
pickle.dump(pranjal, pranjal_file)
with open('pranjal.bin', 'rb') as pranjal_file:
pranjal_from_bin_file = pickle.lo... | true | true |
f70feefa39ebf9ab6d2dcc47e911d388f5415e72 | 855 | py | Python | mysite/urls.py | kmayank39/kmayank | 6ba102d239443949a2aa2e6f05fa8a977d92bc1e | [
"Apache-2.0"
] | null | null | null | mysite/urls.py | kmayank39/kmayank | 6ba102d239443949a2aa2e6f05fa8a977d92bc1e | [
"Apache-2.0"
] | null | null | null | mysite/urls.py | kmayank39/kmayank | 6ba102d239443949a2aa2e6f05fa8a977d92bc1e | [
"Apache-2.0"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... | 35.625 | 78 | 0.691228 | from django.contrib import admin
from django.urls import path
from django.conf.urls import include
urlpatterns = [
path('admin/', admin.site.urls),
path('kumarmayank', include('home.urls')),
]
| true | true |
f70fef6228bd5c8669c5f12614b1af75010ac45f | 1,255 | py | Python | model/ops.py | 530824679/YOLOv2 | eff9ddbab58da970e7fb449cd1974fb810fd6023 | [
"MIT"
] | null | null | null | model/ops.py | 530824679/YOLOv2 | eff9ddbab58da970e7fb449cd1974fb810fd6023 | [
"MIT"
] | null | null | null | model/ops.py | 530824679/YOLOv2 | eff9ddbab58da970e7fb449cd1974fb810fd6023 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# --------------------------------------
# @Time : 2020/11/01
# @Author : Oscar Chen
# @Email : 530824679@qq.com
# @File : ops.py
# Description :base operators.
# --------------------------------------
import tensorflow as tf
def leaky_relu(x):
return tf.nn.leaky_relu(x, alpha=0.1... | 35.857143 | 161 | 0.647012 |
import tensorflow as tf
def leaky_relu(x):
return tf.nn.leaky_relu(x, alpha=0.1, name='leaky_relu')
def conv2d(inputs, filters_num, filters_size, pad_size=0, stride=1, batch_normalize=True, activation=leaky_relu, use_bias=False, is_train=True, name='conv2d'):
if pad_size > 0:
inputs = tf.pad(... | true | true |
f70ff03cf96fe013976425cf2112c255fa1ca390 | 15,840 | py | Python | src/sentry/plugins/bases/issue2.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | null | null | null | src/sentry/plugins/bases/issue2.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | null | null | null | src/sentry/plugins/bases/issue2.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import six
from rest_framework.response import Response
from social_auth.models import UserSocialAuth
from django.conf import settings
from django.conf.urls import url
from django.core.urlresolvers import reverse
from django.utils.html import format_html
from sentry.api.serial... | 35.357143 | 115 | 0.594192 | from __future__ import absolute_import
import six
from rest_framework.response import Response
from social_auth.models import UserSocialAuth
from django.conf import settings
from django.conf.urls import url
from django.core.urlresolvers import reverse
from django.utils.html import format_html
from sentry.api.serial... | true | true |
f70ff08456cae98acf4a012e994d88495cb533a7 | 2,886 | py | Python | nova/api/openstack/compute/schemas/volumes.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/api/openstack/compute/schemas/volumes.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 11 | 2017-06-19T01:28:55.000Z | 2017-06-23T02:01:47.000Z | nova/api/openstack/compute/schemas/volumes.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Copyright 2014 IBM 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 ... | 32.066667 | 78 | 0.517672 |
import copy
from nova.api.validation import parameter_types
create = {
'type': 'object',
'properties': {
'volume': {
'type': 'object',
'properties': {
'volume_type': {'type': 'string'},
'metadata': {'type': 'object'},
... | true | true |
f70ff0a6e57c3271138f94f558d78ab6c1ab11ea | 37,879 | py | Python | safe_control_gym/controllers/mpc/gp_mpc_hexa.py | thaipduong/safe-control-gym | 69f8f627d232d50813a7fff6113dd6d5caccf930 | [
"MIT"
] | null | null | null | safe_control_gym/controllers/mpc/gp_mpc_hexa.py | thaipduong/safe-control-gym | 69f8f627d232d50813a7fff6113dd6d5caccf930 | [
"MIT"
] | null | null | null | safe_control_gym/controllers/mpc/gp_mpc_hexa.py | thaipduong/safe-control-gym | 69f8f627d232d50813a7fff6113dd6d5caccf930 | [
"MIT"
] | null | null | null | """Model Predictive Control with a Gaussian Process model.
Based on:
* L. Hewing, J. Kabzan and M. N. Zeilinger, "Cautious Model Predictive Control Using Gaussian Process Regression,"
in IEEE Transactions on Control Systems Technology, vol. 28, no. 6, pp. 2736-2743, Nov. 2020, doi: 10.1109/TCST.2019.2949757.
... | 50.237401 | 229 | 0.590248 | import scipy
import numpy as np
import casadi as cs
import time
import torch
import gpytorch
from copy import deepcopy
from skopt.sampler import Lhs
from functools import partial
from sklearn.model_selection import train_test_split
from safe_control_gym.controllers.mpc.linear_mpc import LinearMPC, MPC
from safe_contr... | true | true |
f70ff12f7fd786d101d3916da05e94855ad2e161 | 3,381 | py | Python | test/Base/FrontEndTest.py | PLOS/rhino | e9a0b595421664aabd21f0f8117cf04f4456db95 | [
"MIT"
] | 5 | 2017-03-04T13:35:27.000Z | 2018-10-30T20:46:03.000Z | test/Base/FrontEndTest.py | PLOS/rhino | e9a0b595421664aabd21f0f8117cf04f4456db95 | [
"MIT"
] | 65 | 2017-03-14T20:36:38.000Z | 2021-06-01T21:57:50.000Z | test/Base/FrontEndTest.py | PLOS/rhino | e9a0b595421664aabd21f0f8117cf04f4456db95 | [
"MIT"
] | 1 | 2017-02-10T00:29:21.000Z | 2017-02-10T00:29:21.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Public Library of Science
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitat... | 35.589474 | 100 | 0.697723 |
import unittest
import random
from teamcity import is_running_under_teamcity
from teamcity.unittestpy import TeamcityTestRunner
from .WebDriverFactory import WebDriverFactory
__author__ = 'jkrzemien@plos.org'
class FrontEndTest(unittest.TestCase):
_multiprocess_can_split_ = Tr... | true | true |
f70ff1e700306a5c895e23510f6547d0391e8b9a | 1,253 | py | Python | configs/selfsup/_base_/datasets/imagenet_rotation-pred.py | mitming/mmselfsup | 5b5cb474776291cfcb9a1140afd11b696e11fcab | [
"Apache-2.0"
] | 355 | 2021-12-16T04:32:49.000Z | 2022-03-31T22:15:23.000Z | configs/selfsup/_base_/datasets/imagenet_rotation-pred.py | mitming/mmselfsup | 5b5cb474776291cfcb9a1140afd11b696e11fcab | [
"Apache-2.0"
] | 89 | 2021-12-16T05:15:42.000Z | 2022-03-31T10:57:39.000Z | configs/selfsup/_base_/datasets/imagenet_rotation-pred.py | mitming/mmselfsup | 5b5cb474776291cfcb9a1140afd11b696e11fcab | [
"Apache-2.0"
] | 74 | 2021-12-16T04:40:02.000Z | 2022-03-31T08:40:32.000Z | # dataset settings
data_source = 'ImageNet'
dataset_type = 'RotationPredDataset'
img_norm_cfg = dict(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
train_pipeline = [
dict(type='RandomResizedCrop', size=224),
dict(type='RandomHorizontalFlip'),
]
test_pipeline = [
dict(type='Resize', size=256),
d... | 27.23913 | 74 | 0.614525 |
data_source = 'ImageNet'
dataset_type = 'RotationPredDataset'
img_norm_cfg = dict(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
train_pipeline = [
dict(type='RandomResizedCrop', size=224),
dict(type='RandomHorizontalFlip'),
]
test_pipeline = [
dict(type='Resize', size=256),
dict(type='CenterCr... | true | true |
f70ff2005d248bf2316ed76965ea609b3718b1e9 | 1,643 | py | Python | annotate_txt.py | MuhammedAshraf2020/yolo_using_pytorch | c6de8fd6c725db13792239bc7e4b4d4a71d3cd50 | [
"MIT"
] | 1 | 2021-08-03T13:33:35.000Z | 2021-08-03T13:33:35.000Z | annotate_txt.py | MuhammedAshraf2020/yolo_using_pytorch | c6de8fd6c725db13792239bc7e4b4d4a71d3cd50 | [
"MIT"
] | null | null | null | annotate_txt.py | MuhammedAshraf2020/yolo_using_pytorch | c6de8fd6c725db13792239bc7e4b4d4a71d3cd50 | [
"MIT"
] | null | null | null |
import argparse
from xml.etree import ElementTree as ET
import os
from pickle import dump
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_argument("dir")
parser.add_argument("save")
args = parser.parse_args()
path = os.path.join(args.dir)
classes_nums = {"cat" : 0 , "dog" : 1}
keys = list(classe... | 29.872727 | 95 | 0.584297 |
import argparse
from xml.etree import ElementTree as ET
import os
from pickle import dump
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_argument("dir")
parser.add_argument("save")
args = parser.parse_args()
path = os.path.join(args.dir)
classes_nums = {"cat" : 0 , "dog" : 1}
keys = list(classe... | true | true |
f70ff2c39f33dd888d631eafd160e6a0bc3e455e | 29,175 | py | Python | Plotters/Results/Plots_Paper_One.py | PouyaREZ/Wastewater_Energy_Optimization | ead604b715337dc8c76871910d38965d1b8b1856 | [
"MIT"
] | 2 | 2021-02-18T19:36:18.000Z | 2021-05-20T03:32:20.000Z | Plotters/Results/Plots_Paper_One.py | PouyaREZ/Wastewater_Energy_Optimization | ead604b715337dc8c76871910d38965d1b8b1856 | [
"MIT"
] | null | null | null | Plotters/Results/Plots_Paper_One.py | PouyaREZ/Wastewater_Energy_Optimization | ead604b715337dc8c76871910d38965d1b8b1856 | [
"MIT"
] | 1 | 2022-01-21T18:39:45.000Z | 2022-01-21T18:39:45.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 4 2020
@Author: PouyaRZ
____________________________________________________
Plots to produce:
1. LCC of equipment for each scenario for all the individuals
2, SCC of equipment for each scenario for all the individuals
3. SCC vs LCC scatter plot.
4. SCC vs chiller typ... | 34.982014 | 162 | 0.637943 |
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
def DF_Filter(filename):
file = np.loadtxt(filename, dtype='float')
inputDF = pd.DataFrame(file)
error_tol = 1.15
print('+++++ processing %s +++++\n'%(filename))
print('Count duplicates:')
c... | true | true |
f70ff38ed88161f522ef82bebd021101b440decd | 35,221 | py | Python | lib/galaxy/tool_shed/util/repository_util.py | reid-wagner/galaxy | 52175e60d52ae64a5c8e428fa277538c8cbddd7f | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tool_shed/util/repository_util.py | reid-wagner/galaxy | 52175e60d52ae64a5c8e428fa277538c8cbddd7f | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tool_shed/util/repository_util.py | reid-wagner/galaxy | 52175e60d52ae64a5c8e428fa277538c8cbddd7f | [
"CC-BY-3.0"
] | null | null | null | import logging
import os
import re
import shutil
from urllib.error import HTTPError
from markupsafe import escape
from sqlalchemy import (
and_,
false,
or_,
)
from sqlalchemy.orm import joinedload
from galaxy import util
from galaxy import web
from galaxy.tool_shed.util import basic_util
from galaxy.util.... | 54.186154 | 171 | 0.691406 | import logging
import os
import re
import shutil
from urllib.error import HTTPError
from markupsafe import escape
from sqlalchemy import (
and_,
false,
or_,
)
from sqlalchemy.orm import joinedload
from galaxy import util
from galaxy import web
from galaxy.tool_shed.util import basic_util
from galaxy.util.... | true | true |
f70ff3f6f11cf8baea1e696d4186195c3535c42f | 2,126 | py | Python | src/sequence_generator.py | Felihong/wikidata-sequence-analysis | 1d86ad9812c90864eb2c9ab72e5e61474d439f1e | [
"MIT"
] | null | null | null | src/sequence_generator.py | Felihong/wikidata-sequence-analysis | 1d86ad9812c90864eb2c9ab72e5e61474d439f1e | [
"MIT"
] | 1 | 2019-11-04T12:45:02.000Z | 2019-11-04T12:45:02.000Z | src/sequence_generator.py | Felihong/wikidata-sequence-analysis | 1d86ad9812c90864eb2c9ab72e5e61474d439f1e | [
"MIT"
] | null | null | null | import pandas as pd
from itertools import groupby
from operator import itemgetter
class SequenceGenerator:
def __init__(self, csvfile, jsThreshold):
self.datafile = csvfile
self.jsThreshold = jsThreshold
"""
Convert the input csv file into dataframe
"""
def _csv2df(self):
... | 40.884615 | 155 | 0.625118 | import pandas as pd
from itertools import groupby
from operator import itemgetter
class SequenceGenerator:
def __init__(self, csvfile, jsThreshold):
self.datafile = csvfile
self.jsThreshold = jsThreshold
def _csv2df(self):
return pd.read_csv(self.datafile, dtype={'item_id':int, 'user_... | true | true |
f70ff59c20d1954f8016e360c1dc77483ec2a266 | 586 | py | Python | actions/read_kv.py | RyanCopley/stackstorm-vault | 0b7f611bc34423a4a853daa99ec6c754d2169cd2 | [
"Apache-2.0"
] | null | null | null | actions/read_kv.py | RyanCopley/stackstorm-vault | 0b7f611bc34423a4a853daa99ec6c754d2169cd2 | [
"Apache-2.0"
] | null | null | null | actions/read_kv.py | RyanCopley/stackstorm-vault | 0b7f611bc34423a4a853daa99ec6c754d2169cd2 | [
"Apache-2.0"
] | null | null | null | from lib import action
class VaultReadAction(action.VaultBaseAction):
def run(self, path, kv_version, mount_point, version):
value = None
if kv_version == 1:
value = self.vault.kv.v1.read_secret(path=path, mount_point=mount_point)
elif kv_version == 2:
value = self... | 32.555556 | 92 | 0.578498 | from lib import action
class VaultReadAction(action.VaultBaseAction):
def run(self, path, kv_version, mount_point, version):
value = None
if kv_version == 1:
value = self.vault.kv.v1.read_secret(path=path, mount_point=mount_point)
elif kv_version == 2:
value = self... | true | true |
f70ff5a1f8ceb3f00386cd39ca25c564aab1d602 | 2,730 | py | Python | SERVER/control.py | azzhu/deeps | dda178497be3d62067a2f2a7a0a5aa1d793a89bc | [
"MIT"
] | 1 | 2022-03-04T10:18:05.000Z | 2022-03-04T10:18:05.000Z | SERVER/control.py | azzhu/deeps | dda178497be3d62067a2f2a7a0a5aa1d793a89bc | [
"MIT"
] | null | null | null | SERVER/control.py | azzhu/deeps | dda178497be3d62067a2f2a7a0a5aa1d793a89bc | [
"MIT"
] | null | null | null | #!/home/zhuqingjie/env/py3_tf_low/bin/python
'''
@Time : 07.26 0026 下午 01:19
@Author : zhuqingjie
@User : zhu
@FileName: control.py
@Software: PyCharm
'''
'''
总的控制逻辑
1,control只向外部暴露一个端口,外部向control发请求,control根据mode来去调用其他server模块
2,同时还解决了外部不能直接访问ai节点的问题。主服务跑在ai节点,control服务跑在登陆节点,这样外部就能访问了
'''
import json, os, r... | 25.754717 | 105 | 0.567399 |
import json, os, requests, sys, time
from flask import Flask, request
ai01_ip = '10.11.1.81'
ai02_ip = '10.11.1.82'
ai03_ip = '10.11.1.83'
ai04_ip = '10.11.1.84'
ai05_ip = '10.11.1.85'
IP = ai05_ip
app = Flask(__name__)
print_ = lambda x: print(f"--> [{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time(... | true | true |
f70ff636a28fe34d71cffa801e0ffe548d58bc39 | 26,074 | py | Python | src/openfermion/resource_estimates/molecule/pyscf_utils.py | cvmxn1/OpenFermion | cf53c063d0f124a02ff8776bb7f8afb110d4bde6 | [
"Apache-2.0"
] | null | null | null | src/openfermion/resource_estimates/molecule/pyscf_utils.py | cvmxn1/OpenFermion | cf53c063d0f124a02ff8776bb7f8afb110d4bde6 | [
"Apache-2.0"
] | null | null | null | src/openfermion/resource_estimates/molecule/pyscf_utils.py | cvmxn1/OpenFermion | cf53c063d0f124a02ff8776bb7f8afb110d4bde6 | [
"Apache-2.0"
] | null | null | null | #coverage:ignore
""" Drivers for various PySCF electronic structure routines """
from typing import Tuple, Optional
import sys
import h5py
import numpy as np
from pyscf import gto, scf, ao2mo, mcscf, lo, tools, cc
from pyscf.mcscf import avas
def stability(pyscf_mf):
"""
Test wave function stability and re-op... | 40.677067 | 80 | 0.586523 |
from typing import Tuple, Optional
import sys
import h5py
import numpy as np
from pyscf import gto, scf, ao2mo, mcscf, lo, tools, cc
from pyscf.mcscf import avas
def stability(pyscf_mf):
new_orbitals = pyscf_mf.stability()[0]
new_1rdm = pyscf_mf.make_rdm1(new_orbitals, pyscf_mf.mo_occ)
pyscf_mf = pyscf_m... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.