hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7018a9b751e10e71b44550771f8a399e9aa4f9a | 22,519 | py | Python | experiments/validation_wrapper.py | aquemy/HCBR | bc61cf0ca0629119c8d29b146890873f92a46835 | [
"MIT"
] | 5 | 2018-03-20T09:59:13.000Z | 2020-09-17T05:45:05.000Z | experiments/validation_wrapper.py | aquemy/HCBR | bc61cf0ca0629119c8d29b146890873f92a46835 | [
"MIT"
] | null | null | null | experiments/validation_wrapper.py | aquemy/HCBR | bc61cf0ca0629119c8d29b146890873f92a46835 | [
"MIT"
] | 3 | 2020-05-03T23:33:24.000Z | 2020-11-10T18:54:14.000Z | import json
import os, errno
import sys
import time
import shutil
import subprocess
from subprocess import Popen, PIPE
EXECUTABLE = 'hcbr_learning'
BUILD_FOLDER = '../build'
DATA_FOLDER = '../data'
KFOLD_SCRIPT = 'kfold_validation.py'
ACCURACY_ROW = 4
#METAOPTIMIZATION = '../tuning/hyperopt_wrapper.py'
#METAOPTIMIZAT... | 52.369767 | 185 | 0.607931 | import json
import os, errno
import sys
import time
import shutil
import subprocess
from subprocess import Popen, PIPE
EXECUTABLE = 'hcbr_learning'
BUILD_FOLDER = '../build'
DATA_FOLDER = '../data'
KFOLD_SCRIPT = 'kfold_validation.py'
ACCURACY_ROW = 4
METAOPTIMIZATION = '../script/genetic_algorithm.py'
def conver... | true | true |
f7018ac86c15a5146e9c8fcde8a6f279fdfb8f77 | 4,302 | py | Python | bpycv/scene_setting.py | Avinash2468/bpycv | 3638e58dfba7ce6397a6422cfb96173cee74db50 | [
"MIT"
] | 1 | 2021-05-04T15:13:38.000Z | 2021-05-04T15:13:38.000Z | bpycv/scene_setting.py | ethnhe/bpycv | f91373855c1fb6534fd240461af76ab0076f8330 | [
"MIT"
] | null | null | null | bpycv/scene_setting.py | ethnhe/bpycv | f91373855c1fb6534fd240461af76ab0076f8330 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: DIYer22@github
@mail: ylxx@live.com
Created on Thu Jan 16 18:17:20 2020
"""
from boxx import *
from boxx import deg2rad, np, pi
import bpy
import random
def set_cam_pose(cam_radius=1, cam_deg=45, cam_x_deg=None, cam=None):
cam_rad = deg2rad(cam_deg)
... | 29.265306 | 83 | 0.615993 |
from boxx import *
from boxx import deg2rad, np, pi
import bpy
import random
def set_cam_pose(cam_radius=1, cam_deg=45, cam_x_deg=None, cam=None):
cam_rad = deg2rad(cam_deg)
if cam_x_deg is None:
cam_x_deg = random.uniform(0, 360)
cam_x_rad = deg2rad(cam_x_deg)
z = cam_radius * np.sin(cam_... | true | true |
f7018bb7234e923366e80dfdf0fde1be51c3f094 | 25,751 | py | Python | generator/txmultigeneratormultisite.py | zarppy/MUREIL_2014 | 25ba16554ce8f614b9337e0fffce75da3fa259a4 | [
"MIT"
] | null | null | null | generator/txmultigeneratormultisite.py | zarppy/MUREIL_2014 | 25ba16554ce8f614b9337e0fffce75da3fa259a4 | [
"MIT"
] | null | null | null | generator/txmultigeneratormultisite.py | zarppy/MUREIL_2014 | 25ba16554ce8f614b9337e0fffce75da3fa259a4 | [
"MIT"
] | null | null | null | #
#
# Copyright (C) University of Melbourne 2013
#
#
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify... | 41.533871 | 127 | 0.604015 |
from tools import mureilexception, mureilbuilder
import copy
import numpy
from generator import txmultigeneratorbase
import logging
logger = logging.getLogger(__name__)
class TxMultiGeneratorMultiSite(txmultigeneratorbase.TxMultiGeneratorBase):
def __init__(self):
... | true | true |
f7018c4dff48a441d964a2ebd1a3bec5932d5d50 | 6,704 | py | Python | cartoframes/data/observatory/catalog/variable.py | CartoDB/cartoframes | 7c7392be5d15d0472ff428546c4791ed1a3842b0 | [
"BSD-3-Clause"
] | 236 | 2017-02-28T15:17:09.000Z | 2021-12-28T23:29:38.000Z | cartoframes/data/observatory/catalog/variable.py | CartoDB/cartoframes | 7c7392be5d15d0472ff428546c4791ed1a3842b0 | [
"BSD-3-Clause"
] | 1,332 | 2017-02-27T15:34:52.000Z | 2022-03-07T01:31:10.000Z | cartoframes/data/observatory/catalog/variable.py | CartoDB/cartoframes | 7c7392be5d15d0472ff428546c4791ed1a3842b0 | [
"BSD-3-Clause"
] | 63 | 2017-03-14T19:02:37.000Z | 2021-08-03T03:36:05.000Z | import pandas as pd
from .entity import CatalogEntity
from .repository.dataset_repo import get_dataset_repo
from .repository.variable_repo import get_variable_repo
from .repository.constants import VARIABLE_FILTER
from .summary import variable_describe, head, tail, counts, quantiles, top_values, histogram
_DESCRIPTI... | 33.353234 | 117 | 0.602924 | import pandas as pd
from .entity import CatalogEntity
from .repository.dataset_repo import get_dataset_repo
from .repository.variable_repo import get_variable_repo
from .repository.constants import VARIABLE_FILTER
from .summary import variable_describe, head, tail, counts, quantiles, top_values, histogram
_DESCRIPTI... | true | true |
f7018c8e09cd0883cd4c4b032d2a2a08d23843ea | 1,961 | py | Python | Set1/challenge6.py | BKreisel/Matasano-Crypto | 6906d352fda4665cc60fdcfe7b95a3296d313cb6 | [
"MIT"
] | null | null | null | Set1/challenge6.py | BKreisel/Matasano-Crypto | 6906d352fda4665cc60fdcfe7b95a3296d313cb6 | [
"MIT"
] | null | null | null | Set1/challenge6.py | BKreisel/Matasano-Crypto | 6906d352fda4665cc60fdcfe7b95a3296d313cb6 | [
"MIT"
] | null | null | null | from libcrypto import hamming_distance
from libcrypto import split_blocks
from libcrypto import xor
from libcrypto import freq_score
from base64 import b64decode
from operator import itemgetter
def main():
file64 = ""
for line in open("../assets/inputS1C6.txt","r"):
file64 += line.rstrip()
file... | 28.014286 | 75 | 0.559918 | from libcrypto import hamming_distance
from libcrypto import split_blocks
from libcrypto import xor
from libcrypto import freq_score
from base64 import b64decode
from operator import itemgetter
def main():
file64 = ""
for line in open("../assets/inputS1C6.txt","r"):
file64 += line.rstrip()
file... | true | true |
f7018d7d290f789306ee6408d401f7694b5d77f5 | 9,853 | py | Python | ML/tf-cifar-10/cifar10_input.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | null | null | null | ML/tf-cifar-10/cifar10_input.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | null | null | null | ML/tf-cifar-10/cifar10_input.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | 1 | 2019-12-09T21:40:46.000Z | 2019-12-09T21:40:46.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.488281 | 80 | 0.703745 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from six.moves import xrange
import tensorflow as tf
IMAGE_SIZE = 24
NUM_CLASSES = 10
NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = 50000
NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = 10000
def re... | true | true |
f7018e781d7c288b0bd46b3550d3a7ddf6a5d2d6 | 4,842 | py | Python | pulsar/managers/util/cli/job/lsf.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | pulsar/managers/util/cli/job/lsf.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | pulsar/managers/util/cli/job/lsf.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | # A simple CLI runner for slurm that can be used when running Galaxy from a
# non-submit host and using a Slurm cluster.
from logging import getLogger
try:
from galaxy.model import Job
job_states = Job.states
except ImportError:
# Not in Galaxy, map Galaxy job states to Pulsar ones.
from pulsar.util im... | 37.246154 | 98 | 0.581991 |
from logging import getLogger
try:
from galaxy.model import Job
job_states = Job.states
except ImportError:
from pulsar.util import enum
job_states = enum(RUNNING='running', OK='complete', QUEUED='queued', ERROR="failed")
from ..job import BaseJobExec
log = getLogger(__name__)
argmap = {
'... | true | true |
f7018e954099790a05cbbdee6167be18b7c2ecc6 | 10,867 | py | Python | keras_frcnn/densenet.py | Heyjuke58/frcnn-wind-turbine-detection | 29311020188d3a26c8935cae710bd2c5013653ab | [
"Apache-2.0"
] | null | null | null | keras_frcnn/densenet.py | Heyjuke58/frcnn-wind-turbine-detection | 29311020188d3a26c8935cae710bd2c5013653ab | [
"Apache-2.0"
] | null | null | null | keras_frcnn/densenet.py | Heyjuke58/frcnn-wind-turbine-detection | 29311020188d3a26c8935cae710bd2c5013653ab | [
"Apache-2.0"
] | null | null | null | """DenseNet models for Keras.
# Reference paper
- [Densely Connected Convolutional Networks]
(https://arxiv.org/abs/1608.06993) (CVPR 2017 Best Paper Award)
# Reference implementation
- [Torch DenseNets]
(https://github.com/liuzhuang13/DenseNet/blob/master/models/densenet.lua)
- [TensorNets]
(https://gith... | 41.477099 | 155 | 0.625104 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from keras import backend as K
from keras.layers import Input, Add, Dense, Activation, Flatten, Convolution2D, MaxPooling2D, ZeroPadding2D, \
AveragePooling2D, TimeDistributed, BatchNormali... | true | true |
f7019023ce6c6a82f163a45aaf9b53f99160d360 | 3,618 | py | Python | oneartplease.py | schlarpc/oneartplease | 042ced4a57cbd8fd8ca36130ddd8650b0af282e9 | [
"MIT"
] | null | null | null | oneartplease.py | schlarpc/oneartplease | 042ced4a57cbd8fd8ca36130ddd8650b0af282e9 | [
"MIT"
] | null | null | null | oneartplease.py | schlarpc/oneartplease | 042ced4a57cbd8fd8ca36130ddd8650b0af282e9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import gevent.monkey
gevent.monkey.patch_all()
import argparse
import json
import re
import string
import socket
import urllib.parse
import webbrowser
import flask
import gevent.pool
import gevent.pywsgi
import requests
app = flask.Flask(__name__, template_folder='.')
con... | 35.470588 | 108 | 0.647872 |
import gevent.monkey
gevent.monkey.patch_all()
import argparse
import json
import re
import string
import socket
import urllib.parse
import webbrowser
import flask
import gevent.pool
import gevent.pywsgi
import requests
app = flask.Flask(__name__, template_folder='.')
config = {
'host': '1... | true | true |
f701902720c7854f5876c62a4f31115e0d9748bc | 1,100 | py | Python | Coursera/Week.3/Task.13.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.3/Task.13.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.3/Task.13.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | '''
Система линейных уравнений - 2
'''
a = float(input())
b = float(input())
c = float(input())
d = float(input())
e = float(input())
f = float(input())
if a == 0 and b == 0 and c == 0 and d == 0 and e == 0 and f == 0:
print(5)
elif a * d == b * c and a * f != c * e:
print(0)
elif a == 0 and b == 0 and e != 0:
... | 24.444444 | 65 | 0.377273 | a = float(input())
b = float(input())
c = float(input())
d = float(input())
e = float(input())
f = float(input())
if a == 0 and b == 0 and c == 0 and d == 0 and e == 0 and f == 0:
print(5)
elif a * d == b * c and a * f != c * e:
print(0)
elif a == 0 and b == 0 and e != 0:
print(0)
elif c == 0 and d == 0 and... | true | true |
f701930267eb677de0ff92fb8288386877a8c15a | 4,824 | py | Python | bopy/spec/lamost.py | hypergravity/bopy | 90cf5bf695c4ae4f53d9a9bec7cdc9ba16994267 | [
"BSD-3-Clause"
] | 1 | 2016-03-11T02:16:34.000Z | 2016-03-11T02:16:34.000Z | bopy/spec/lamost.py | hypergravity/bopy | 90cf5bf695c4ae4f53d9a9bec7cdc9ba16994267 | [
"BSD-3-Clause"
] | 4 | 2016-01-22T14:44:47.000Z | 2016-12-16T11:07:31.000Z | bopy/spec/lamost.py | hypergravity/bopy | 90cf5bf695c4ae4f53d9a9bec7cdc9ba16994267 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Author
------
Bo Zhang
Email
-----
bozhang@nao.cas.cn
Created on
----------
- Fri Jul 3 13:13:06 2015 read_spectrum
Modifications
-------------
- Fri Nov 20 10:16:59 2015 reformatting code
- Sun Feb 28 14:39:16 2016 migrated to bopy.spec.lamost
- Fri Jul 15 16:08:00 2016 mig... | 27.409091 | 78 | 0.541459 |
import os
import numpy as np
def lamost_filepath(planid, mjd, spid, fiberid, dirpath="", extname=".fits"):
if np.isscalar(planid):
planid = planid.strip()
else:
planid = [_.strip() for _ in planid]
if dirpath == "" or dirpath is None:
if np.isscalar(mjd):
... | true | true |
f70193699f0c4868dccc5ae5430f654b94ba4982 | 1,760 | py | Python | moonstone/normalization/reads/base.py | motleystate/moonstone | 37c38fabf361722f7002626ef13c68c443ace4ac | [
"MIT"
] | null | null | null | moonstone/normalization/reads/base.py | motleystate/moonstone | 37c38fabf361722f7002626ef13c68c443ace4ac | [
"MIT"
] | 84 | 2020-07-27T13:01:12.000Z | 2022-03-16T17:10:23.000Z | moonstone/normalization/reads/base.py | motleystate/moonstone | 37c38fabf361722f7002626ef13c68c443ace4ac | [
"MIT"
] | null | null | null | class BaseDownsizing:
def __init__(self, raw_file_f, raw_file_r=None):
self.raw_file_f = raw_file_f
self.raw_file_f = raw_file_f
self._downsized_f = None
if raw_file_r:
self.raw_file_r = raw_file_r
self.raw_file_r = raw_file_r
self._downsized_r = ... | 38.26087 | 110 | 0.673864 | class BaseDownsizing:
def __init__(self, raw_file_f, raw_file_r=None):
self.raw_file_f = raw_file_f
self.raw_file_f = raw_file_f
self._downsized_f = None
if raw_file_r:
self.raw_file_r = raw_file_r
self.raw_file_r = raw_file_r
self._downsized_r = ... | true | true |
f701939035f7fb6a21d19379da73cb9e2f9f3826 | 23,293 | py | Python | netbox/dcim/api/views.py | aslafy-z/netbox | a5512dd4c46c005df8752fc330c1382ac22b31ea | [
"Apache-2.0"
] | null | null | null | netbox/dcim/api/views.py | aslafy-z/netbox | a5512dd4c46c005df8752fc330c1382ac22b31ea | [
"Apache-2.0"
] | null | null | null | netbox/dcim/api/views.py | aslafy-z/netbox | a5512dd4c46c005df8752fc330c1382ac22b31ea | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from django.conf import settings
from django.db.models import Count, F
from django.http import HttpResponseForbidden, HttpResponse
from django.shortcuts import get_object_or_404
from drf_yasg import openapi
from drf_yasg.openapi import Parameter
from drf_yasg.utils import swagger_au... | 35.027068 | 117 | 0.710814 | from collections import OrderedDict
from django.conf import settings
from django.db.models import Count, F
from django.http import HttpResponseForbidden, HttpResponse
from django.shortcuts import get_object_or_404
from drf_yasg import openapi
from drf_yasg.openapi import Parameter
from drf_yasg.utils import swagger_au... | true | true |
f70193fe6ae26eba52826e7bbf17c7d0494676aa | 1,305 | py | Python | sa/profiles/Angtel/Topaz/get_interface_status.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | sa/profiles/Angtel/Topaz/get_interface_status.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | sa/profiles/Angtel/Topaz/get_interface_status.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# Angtel.Topaz.get_interface_status
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
... | 35.27027 | 100 | 0.508812 |
import re
from noc.core.script.base import BaseScript
from noc.sa.interfaces.igetinterfacestatus import IGetInterfaceStatus
class Script(BaseScript):
name = "Angtel.Topaz.get_interface_status"
interface = IGetInterfaceStatus
cache = True
rx_port = re.compile(
r"^(?P<port>(?:Fa|Gi|Te... | true | true |
f7019440290b694e69787f2fa909cb9fd6add0b0 | 4,873 | py | Python | wandb/vendor/pygments/lexers/diff.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 3,968 | 2017-08-23T21:27:19.000Z | 2022-03-31T22:00:19.000Z | wandb/vendor/pygments/lexers/diff.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 2,725 | 2017-04-17T00:29:15.000Z | 2022-03-31T21:01:53.000Z | wandb/vendor/pygments/lexers/diff.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 351 | 2018-04-08T19:39:34.000Z | 2022-03-30T19:38:08.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.diff
~~~~~~~~~~~~~~~~~~~~
Lexers for diff/patch formats.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups
from pygments.tok... | 29.355422 | 86 | 0.477324 |
import re
from pygments.lexer import RegexLexer, include, bygroups
from pygments.token import Text, Comment, Operator, Keyword, Name, Generic, \
Literal
__all__ = ['DiffLexer', 'DarcsPatchLexer', 'WDiffLexer']
class DiffLexer(RegexLexer):
name = 'Diff'
aliases = ['diff', 'udiff']
filenames = ['*.... | true | true |
f70194a792e7d2b8b7d98d4ca7fae67585114899 | 735 | py | Python | config.py | vabarboza/Torre-de-Hanoi | 089d3daa5aa78b9d2197d09e86ff27136aef22bf | [
"MIT"
] | null | null | null | config.py | vabarboza/Torre-de-Hanoi | 089d3daa5aa78b9d2197d09e86ff27136aef22bf | [
"MIT"
] | null | null | null | config.py | vabarboza/Torre-de-Hanoi | 089d3daa5aa78b9d2197d09e86ff27136aef22bf | [
"MIT"
] | null | null | null | from disco import Disco
class Config:
def __init__(self):
self._numero_discos = int(input("\nInforme a quantidade de discos: "))
def adiciona_discos(self, torre_inicial):
discos = self.add_disco()
for ix in range(self._numero_discos):
torre_inicial.empilha(discos[ix])
... | 23.709677 | 78 | 0.609524 | from disco import Disco
class Config:
def __init__(self):
self._numero_discos = int(input("\nInforme a quantidade de discos: "))
def adiciona_discos(self, torre_inicial):
discos = self.add_disco()
for ix in range(self._numero_discos):
torre_inicial.empilha(discos[ix])
... | true | true |
f70194cedfde30f4c6fd6c44b9d3193b0d9a8861 | 51,979 | py | Python | flopy/export/netcdf.py | aleaf/flopy | a5777a4d4a745e473110a167c69603ac4ad3106c | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/export/netcdf.py | aleaf/flopy | a5777a4d4a745e473110a167c69603ac4ad3106c | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/export/netcdf.py | aleaf/flopy | a5777a4d4a745e473110a167c69603ac4ad3106c | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | import os
import platform
import socket
import copy
import json
import numpy as np
from datetime import datetime
import time
from .metadata import acdd
import flopy
# globals
FILLVALUE = -99999.9
ITMUNI = {
0: "undefined",
1: "seconds",
2: "minutes",
3: "hours",
4: "days",
5: "years",
}
PRECISI... | 34.468833 | 97 | 0.520133 | import os
import platform
import socket
import copy
import json
import numpy as np
from datetime import datetime
import time
from .metadata import acdd
import flopy
FILLVALUE = -99999.9
ITMUNI = {
0: "undefined",
1: "seconds",
2: "minutes",
3: "hours",
4: "days",
5: "years",
}
PRECISION_STRS =... | true | true |
f701952e324b29325e0950a0fc07100cde7c3a5b | 244 | py | Python | enviopack/__init__.py | adrianpaesani/enviopack | 7387cc78c76e589e95ac65345a9196738689cc0b | [
"MIT"
] | null | null | null | enviopack/__init__.py | adrianpaesani/enviopack | 7387cc78c76e589e95ac65345a9196738689cc0b | [
"MIT"
] | null | null | null | enviopack/__init__.py | adrianpaesani/enviopack | 7387cc78c76e589e95ac65345a9196738689cc0b | [
"MIT"
] | 1 | 2021-07-12T00:05:55.000Z | 2021-07-12T00:05:55.000Z | # -*- coding: utf-8 -*-
from .Enviopack import Enviopack
from .Auth.Auth import Auth
from .Quote.Quote import Quote
from .Pickings.Pickings import Pickings
from .Orders.Orders import Orders
__version__ = "0.4.6"
__author__ = "Federico Gobea"
| 22.181818 | 39 | 0.754098 |
from .Enviopack import Enviopack
from .Auth.Auth import Auth
from .Quote.Quote import Quote
from .Pickings.Pickings import Pickings
from .Orders.Orders import Orders
__version__ = "0.4.6"
__author__ = "Federico Gobea"
| true | true |
f70195a36662791fd3e1eb4b6744c001727d1c5d | 411 | py | Python | backend/billsengine_31836/wsgi.py | crowdbotics-apps/billsengine-31836 | f67d69303f16f3612b32f66f139e93d3a382effb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/billsengine_31836/wsgi.py | crowdbotics-apps/billsengine-31836 | f67d69303f16f3612b32f66f139e93d3a382effb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/billsengine_31836/wsgi.py | crowdbotics-apps/billsengine-31836 | f67d69303f16f3612b32f66f139e93d3a382effb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for billsengine_31836 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJ... | 24.176471 | 78 | 0.79562 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'billsengine_31836.settings')
application = get_wsgi_application()
| true | true |
f701962016b67a8ff9257acba3cbef163454f9e8 | 765 | py | Python | gettoken.py | kim3-sudo/moodletesting | 93adb08e84bf4e2299cb9a989d66de68dfe4cb67 | [
"MIT"
] | null | null | null | gettoken.py | kim3-sudo/moodletesting | 93adb08e84bf4e2299cb9a989d66de68dfe4cb67 | [
"MIT"
] | 1 | 2022-01-31T22:29:56.000Z | 2022-02-16T18:49:51.000Z | gettoken.py | kim3-sudo/moodletesting | 93adb08e84bf4e2299cb9a989d66de68dfe4cb67 | [
"MIT"
] | null | null | null | import requests
import threading
import random
import json
usernames = json.loads(open("usernames.json", "r").read())
password = '%4B%65%6E%79%6F%6E%35%25' # A hex encoded password
siteurl = '192.168.122.61'
def run():
username = random.choice(usernames)
token = requests.get('http://' + siteurl + '/login/toke... | 27.321429 | 160 | 0.618301 | import requests
import threading
import random
import json
usernames = json.loads(open("usernames.json", "r").read())
password = '%4B%65%6E%79%6F%6E%35%25'
siteurl = '192.168.122.61'
def run():
username = random.choice(usernames)
token = requests.get('http://' + siteurl + '/login/token.php?username=' + usern... | true | true |
f701966dbcbde2e302dd356581a77f271b483d27 | 1,420 | py | Python | vision/tests/unittests/test_gluoncv_object_detection.py | huibinshen/autogluon | 18c182c90df89762a916128327a6792b8887c5c6 | [
"Apache-2.0"
] | null | null | null | vision/tests/unittests/test_gluoncv_object_detection.py | huibinshen/autogluon | 18c182c90df89762a916128327a6792b8887c5c6 | [
"Apache-2.0"
] | null | null | null | vision/tests/unittests/test_gluoncv_object_detection.py | huibinshen/autogluon | 18c182c90df89762a916128327a6792b8887c5c6 | [
"Apache-2.0"
] | null | null | null | import pytest
from autogluon.core.space import Categorical
from autogluon.vision._gluoncv import ObjectDetection
def get_dataset(path):
return ObjectDetection.Dataset.from_voc(path)
@pytest.mark.skip(reason="ObjectDetector is not stable to test, and fails due to transient errors occasionally.")
def test_object... | 48.965517 | 171 | 0.759155 | import pytest
from autogluon.core.space import Categorical
from autogluon.vision._gluoncv import ObjectDetection
def get_dataset(path):
return ObjectDetection.Dataset.from_voc(path)
@pytest.mark.skip(reason="ObjectDetector is not stable to test, and fails due to transient errors occasionally.")
def test_object... | true | true |
f70197fc6a79be6feea98dd6115376e99549f28a | 1,644 | py | Python | KnowledgeMapping/puppeteer_exp/demo_ip.py | nickliqian/ralph_doc_to_chinese | be120ce2bb94a8e8395630218985f5e51ae087d9 | [
"MIT"
] | 8 | 2018-05-22T01:11:33.000Z | 2020-03-19T01:44:55.000Z | KnowledgeMapping/puppeteer_exp/demo_ip.py | yangliangguang/keep_learning | 47ab39c726cb28713ad22bf4cf39d6b146715910 | [
"MIT"
] | null | null | null | KnowledgeMapping/puppeteer_exp/demo_ip.py | yangliangguang/keep_learning | 47ab39c726cb28713ad22bf4cf39d6b146715910 | [
"MIT"
] | 3 | 2018-07-25T09:31:53.000Z | 2019-09-14T14:05:31.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import asyncio
import pyppeteer
import time
import os
import random
from exe_js import js1, js3, js4, js5
# http://www.mamicode.com/info-detail-2302923.html
# https://segmentfault.com/a/1190000011627343
"""
{
proxy: "127.0.0.1:1234",
proxy-auth: "userx:passx",
prox... | 28.842105 | 145 | 0.652068 |
import asyncio
import pyppeteer
import time
import os
import random
from exe_js import js1, js3, js4, js5
def input_time_random():
return random.randint(300, 500)
async def main():
print("in main ")
print(os.environ.get('PYPPETEER_CHROMIUM_REVISION'))
browser = await pyppeteer.launch(
exe... | true | true |
f701981ccf648a9810af3604f8f36ca0e814c54e | 170 | py | Python | api_yamdb/api_yamdb/wsgi.py | 4madeuz/DRF_exampe | ab4f155fcc0ed10912f8a05f57de6b45d4d836fd | [
"MIT"
] | null | null | null | api_yamdb/api_yamdb/wsgi.py | 4madeuz/DRF_exampe | ab4f155fcc0ed10912f8a05f57de6b45d4d836fd | [
"MIT"
] | 3 | 2021-06-05T00:11:14.000Z | 2021-09-22T19:57:18.000Z | api_yamdb/api_yamdb/wsgi.py | 4madeuz/DRF_exampe | ab4f155fcc0ed10912f8a05f57de6b45d4d836fd | [
"MIT"
] | 1 | 2022-02-16T07:46:34.000Z | 2022-02-16T07:46:34.000Z | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api_yamdb.settings')
application = get_wsgi_application()
| 21.25 | 69 | 0.829412 | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api_yamdb.settings')
application = get_wsgi_application()
| true | true |
f7019845428c7fc64ebcc3c40f655114efc7e296 | 4,330 | py | Python | bingo/settings.py | Rekha-Pal/Bingo-Buddy | 1ba705e049122faa6efb8b193d8bcd03680d9cb6 | [
"MIT"
] | null | null | null | bingo/settings.py | Rekha-Pal/Bingo-Buddy | 1ba705e049122faa6efb8b193d8bcd03680d9cb6 | [
"MIT"
] | null | null | null | bingo/settings.py | Rekha-Pal/Bingo-Buddy | 1ba705e049122faa6efb8b193d8bcd03680d9cb6 | [
"MIT"
] | null | null | null | """
Django settings for bingo project.
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# B... | 27.232704 | 100 | 0.706236 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR = os.path.join(BASE_DIR,'templates')
STATIC_DIR=os.path.join(BASE_DIR,'static')
MEDIA_ROOT=os.path.join(BASE_DIR,'static')
SECRET_KEY = '@k0#p3kidu)yaaa3u1hplxz)f@^6xiy384*(+n@@s5x#1bx@m5'
DEBUG = True
ALLOWED_HOSTS... | true | true |
f701988043815716192816ee9d1943d869d9d5e0 | 1,438 | py | Python | atari-game-play/steps/configs.py | zenml-io/zenfiles | b45e0effb22d9bb109262b997e60c9d356a69b2f | [
"Apache-2.0"
] | 15 | 2022-02-01T13:56:20.000Z | 2022-02-08T14:15:14.000Z | atari-game-play/steps/configs.py | zenml-io/zenfiles | b45e0effb22d9bb109262b997e60c9d356a69b2f | [
"Apache-2.0"
] | 2 | 2022-02-17T09:35:26.000Z | 2022-03-08T14:23:05.000Z | atari-game-play/steps/configs.py | zenml-io/zenfiles | b45e0effb22d9bb109262b997e60c9d356a69b2f | [
"Apache-2.0"
] | 5 | 2022-02-01T13:59:28.000Z | 2022-03-07T08:44:34.000Z | from zenml.steps import BaseStepConfig
class PreTrainingConfigs(BaseStepConfig):
# The configuration for the pre-training of the agent
ENV_NAME: str = "BreakoutDeterministic-v4"
WRITE_TENSORBOARD: bool = True
TENSORBOARD_DIR: str = "tensorboard/"
LEARNING_RATE: float = 0.00001
INP... | 35.073171 | 165 | 0.692629 | from zenml.steps import BaseStepConfig
class PreTrainingConfigs(BaseStepConfig):
ENV_NAME: str = "BreakoutDeterministic-v4"
WRITE_TENSORBOARD: bool = True
TENSORBOARD_DIR: str = "tensorboard/"
LEARNING_RATE: float = 0.00001
INPUT_SHAPE: tuple = (84, 84)
BATCH_SIZE: int = 32
... | true | true |
f70198ed9246ec768bc297a4af607b887745c332 | 1,677 | py | Python | educative/course1/stacks_queues/ch5_sort_stack_1.py | liveroot/ambition2020 | f312aa684caab5da82504c2bcd98bef64d102caf | [
"MIT"
] | null | null | null | educative/course1/stacks_queues/ch5_sort_stack_1.py | liveroot/ambition2020 | f312aa684caab5da82504c2bcd98bef64d102caf | [
"MIT"
] | null | null | null | educative/course1/stacks_queues/ch5_sort_stack_1.py | liveroot/ambition2020 | f312aa684caab5da82504c2bcd98bef64d102caf | [
"MIT"
] | 1 | 2019-12-27T01:08:08.000Z | 2019-12-27T01:08:08.000Z | import educative.course1.stacks_queues.stack as s
input_data = [23, 60, 12, 42, 4, 97, 2]
expected_output_data = [2, 4, 12, 23, 42, 60, 97]
# This solution uses a second stack
# 1. until input stack is not empty, we pop the top value and compare it
# with the top value of the second stack
# 2. if value > top of s... | 35.680851 | 95 | 0.634466 | import educative.course1.stacks_queues.stack as s
input_data = [23, 60, 12, 42, 4, 97, 2]
expected_output_data = [2, 4, 12, 23, 42, 60, 97]
def sort_stack_1(stack):
result = s.Stack(stack.capacity, True)
while not stack.is_empty():
value = stack.pop()
if not result.is_empty() and ... | true | true |
f7019b7e9ff96813b178c0a284d211839bedd0c6 | 113,274 | py | Python | cassandra/metadata.py | mikefero/python-driver | 3a5bd85f0cccb4a74399dc5eb3b9e69e9af532c7 | [
"Apache-2.0"
] | null | null | null | cassandra/metadata.py | mikefero/python-driver | 3a5bd85f0cccb4a74399dc5eb3b9e69e9af532c7 | [
"Apache-2.0"
] | null | null | null | cassandra/metadata.py | mikefero/python-driver | 3a5bd85f0cccb4a74399dc5eb3b9e69e9af532c7 | [
"Apache-2.0"
] | null | null | null | # Copyright DataStax, 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 or agreed to in writing, softwa... | 38.307068 | 194 | 0.627929 |
from binascii import unhexlify
from bisect import bisect_left
from collections import defaultdict
from functools import total_ordering
from hashlib import md5
import json
import logging
import re
import six
from six.moves import zip
import sys
from threading import RLock
import struct
import random
murmu... | true | true |
f7019bcbba493a7e75313d52037640e545c8fb0a | 72 | py | Python | src/__init__.py | adaliuBC/DropEdge | c2bc536fec052559a3bbcbbe3dd27af2aae57440 | [
"MIT"
] | 380 | 2019-10-09T16:18:52.000Z | 2022-03-23T11:47:18.000Z | src/__init__.py | adaliuBC/DropEdge | c2bc536fec052559a3bbcbbe3dd27af2aae57440 | [
"MIT"
] | 16 | 2019-10-17T16:47:50.000Z | 2022-03-04T13:02:32.000Z | src/__init__.py | adaliuBC/DropEdge | c2bc536fec052559a3bbcbbe3dd27af2aae57440 | [
"MIT"
] | 72 | 2019-10-13T08:03:37.000Z | 2022-03-24T21:42:24.000Z | from __future__ import print_function
from __future__ import division
| 24 | 38 | 0.861111 | from __future__ import print_function
from __future__ import division
| true | true |
f7019c079af370cd129ec31bd1709f5d25f0a4d5 | 2,375 | py | Python | openstack_plugin/common/clients.py | aiorchestra/aiorchestra-openstack-plugin | d44dd0a2744a857cda243dfb5fe7d314949a5dc4 | [
"Apache-2.0"
] | 5 | 2016-06-22T20:08:31.000Z | 2021-08-30T11:40:11.000Z | openstack_plugin/common/clients.py | aiorchestra/aiorchestra-openstack-plugin | d44dd0a2744a857cda243dfb5fe7d314949a5dc4 | [
"Apache-2.0"
] | 61 | 2016-06-23T11:49:08.000Z | 2016-07-13T10:03:51.000Z | openstack_plugin/common/clients.py | aiorchestra/aiorchestra-openstack-plugin | d44dd0a2744a857cda243dfb5fe7d314949a5dc4 | [
"Apache-2.0"
] | 1 | 2016-06-22T20:08:32.000Z | 2016-06-22T20:08:32.000Z | # Author: Denys Makogon
#
# 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... | 34.42029 | 78 | 0.685474 |
from glanceclient.v2 import client as glanceclient
from keystoneauth1 import loading
from keystoneauth1 import session
from keystoneclient import client as keystoneclient
from novaclient import client as novaclient
from neutronclient.v2_0 import client as neutronclient
class OpenStackClients(object):
... | true | true |
f7019d3e8de57db347a5428bc4bb44c24cb31213 | 3,332 | py | Python | fetcher/masterchef_apr_fetcher.py | Avalanche-FR-community/apr-fetcher | 25b12e8fe3da4a7ee678017b80dabc07990144f8 | [
"MIT"
] | null | null | null | fetcher/masterchef_apr_fetcher.py | Avalanche-FR-community/apr-fetcher | 25b12e8fe3da4a7ee678017b80dabc07990144f8 | [
"MIT"
] | null | null | null | fetcher/masterchef_apr_fetcher.py | Avalanche-FR-community/apr-fetcher | 25b12e8fe3da4a7ee678017b80dabc07990144f8 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from .apr_fetcher import APRFetcher
from typing import Dict, List, Union, Any
from .dapp_apr_fetcher import DappAPRFetcher
from .utils.utils import (
calculate_lp_token_price,
get_block_average_time,
get_token_price_from_dexs,
open_contract,
usdt_address,
platform_... | 40.144578 | 137 | 0.704982 | from abc import abstractmethod
from .apr_fetcher import APRFetcher
from typing import Dict, List, Union, Any
from .dapp_apr_fetcher import DappAPRFetcher
from .utils.utils import (
calculate_lp_token_price,
get_block_average_time,
get_token_price_from_dexs,
open_contract,
usdt_address,
platform_... | true | true |
f7019d6ec2203928ab2ee798997a992aada51e7e | 547 | py | Python | app/questionary/tests/test_quiz.py | brakebrinker/django-englishtest | 787d7fbdf8ab7da3d11f94a534963857770b88b5 | [
"MIT"
] | null | null | null | app/questionary/tests/test_quiz.py | brakebrinker/django-englishtest | 787d7fbdf8ab7da3d11f94a534963857770b88b5 | [
"MIT"
] | null | null | null | app/questionary/tests/test_quiz.py | brakebrinker/django-englishtest | 787d7fbdf8ab7da3d11f94a534963857770b88b5 | [
"MIT"
] | 1 | 2021-05-25T05:43:02.000Z | 2021-05-25T05:43:02.000Z | from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
QUIZZES_URL = reverse('questionary:quiz-list')
class PublicQuizzesApiTests(TestCase):
"""Test the publicly available tags API"""
def setUp(self):
self.client ... | 27.35 | 71 | 0.740402 | from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
QUIZZES_URL = reverse('questionary:quiz-list')
class PublicQuizzesApiTests(TestCase):
def setUp(self):
self.client = APIClient()
def test_login_required(self... | true | true |
f7019d7f6a6aad808f7a45c350dcbed3e0f01bc0 | 4,053 | py | Python | PythonApp/qc_serial/SerialStateMachine.py | CallMeCCLemon/queercon16-pillars | fc58ec21a62c4a8bc8f475e265edefeac0ebc129 | [
"BSD-3-Clause"
] | null | null | null | PythonApp/qc_serial/SerialStateMachine.py | CallMeCCLemon/queercon16-pillars | fc58ec21a62c4a8bc8f475e265edefeac0ebc129 | [
"BSD-3-Clause"
] | null | null | null | PythonApp/qc_serial/SerialStateMachine.py | CallMeCCLemon/queercon16-pillars | fc58ec21a62c4a8bc8f475e265edefeac0ebc129 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
# Author: CallMeCCLemon
# Date: 2019
# Copyright: 2019 Thomas Littlejohn (@CallMeCCLemon) - Modified BSD License
###############################################################################
from enum import Enum
from Py... | 39.735294 | 97 | 0.625216 | true | true | |
f7019e9c6ca4456265e110317834c674537e93ef | 24,901 | py | Python | extras/openslides_gui/gui.py | DebVortex/OpenSlides | f17f1a723a034dd7ebe80cd4ff4385d97d020c5f | [
"MIT"
] | null | null | null | extras/openslides_gui/gui.py | DebVortex/OpenSlides | f17f1a723a034dd7ebe80cd4ff4385d97d020c5f | [
"MIT"
] | null | null | null | extras/openslides_gui/gui.py | DebVortex/OpenSlides | f17f1a723a034dd7ebe80cd4ff4385d97d020c5f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import Queue
import datetime
import errno
import gettext
import itertools
import json
import locale
import os
import subprocess
import sys
import threading
import wx
import openslides
from openslides.utils.main import (
detect_openslides_type,
filesystem2unicode,
... | 32.89432 | 80 | 0.615517 | from __future__ import unicode_literals
import Queue
import datetime
import errno
import gettext
import itertools
import json
import locale
import os
import subprocess
import sys
import threading
import wx
import openslides
from openslides.utils.main import (
detect_openslides_type,
filesystem2unicode,
... | true | true |
f7019f0d737cd3d77e15b898a760b40f9eb97817 | 4,711 | py | Python | djangocms_blog/migrations/0010_auto_20150923_1151.py | skirsdeda/djangocms-blog | 23d28962e5eb3fa6a82efbd3f7cce85679ae04e1 | [
"BSD-3-Clause"
] | null | null | null | djangocms_blog/migrations/0010_auto_20150923_1151.py | skirsdeda/djangocms-blog | 23d28962e5eb3fa6a82efbd3f7cce85679ae04e1 | [
"BSD-3-Clause"
] | null | null | null | djangocms_blog/migrations/0010_auto_20150923_1151.py | skirsdeda/djangocms-blog | 23d28962e5eb3fa6a82efbd3f7cce85679ae04e1 | [
"BSD-3-Clause"
] | null | null | null | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
import aldryn_apphooks_config.fields
import app_data.fields
import djangocms_text_ckeditor.fields
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '__first__'),
('djangocms_blo... | 49.072917 | 249 | 0.624708 |
from __future__ import unicode_literals
import aldryn_apphooks_config.fields
import app_data.fields
import djangocms_text_ckeditor.fields
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '__first__'),
('djangocms_blog', '0009_latestpostsp... | true | true |
f7019f169af8f3f2b62f63f2c035f85dc91e1411 | 2,277 | py | Python | paragraph2actions/augmentation/compound_name_augmenter.py | rxn4chemistry/paragraph2actions | 2a922a96d77cd796855fdf0322dc314351e29979 | [
"MIT"
] | 17 | 2020-04-09T06:04:56.000Z | 2022-03-21T09:22:37.000Z | paragraph2actions/augmentation/compound_name_augmenter.py | rxn4chemistry/paragraph2actions | 2a922a96d77cd796855fdf0322dc314351e29979 | [
"MIT"
] | 1 | 2021-09-02T00:56:57.000Z | 2021-09-06T07:20:59.000Z | paragraph2actions/augmentation/compound_name_augmenter.py | rxn4chemistry/paragraph2actions | 2a922a96d77cd796855fdf0322dc314351e29979 | [
"MIT"
] | 7 | 2020-07-21T01:15:30.000Z | 2022-03-21T09:23:31.000Z | import copy
import re
from collections import defaultdict
from typing import List, Dict
from .substitution_augmenter import SubstitutionAugmenter
from ..actions import Chemical
from ..utils import extract_chemicals
from paragraph2actions.misc import TextWithActions
class CompoundNameAugmenter(SubstitutionAugmenter):... | 38.59322 | 117 | 0.665788 | import copy
import re
from collections import defaultdict
from typing import List, Dict
from .substitution_augmenter import SubstitutionAugmenter
from ..actions import Chemical
from ..utils import extract_chemicals
from paragraph2actions.misc import TextWithActions
class CompoundNameAugmenter(SubstitutionAugmenter):... | true | true |
f7019fc569cb74e3d15397e3f62c30f72325dab6 | 6,038 | py | Python | app/stac_api/migrations/0016_auto_20210902_1731.py | geoadmin/service-stac | ee5064558133142160bd4fa15850f7528f5d70aa | [
"BSD-3-Clause"
] | 9 | 2020-08-17T11:01:48.000Z | 2022-01-17T22:24:13.000Z | app/stac_api/migrations/0016_auto_20210902_1731.py | geoadmin/service-stac | ee5064558133142160bd4fa15850f7528f5d70aa | [
"BSD-3-Clause"
] | 100 | 2020-08-14T05:56:40.000Z | 2022-03-01T22:39:58.000Z | app/stac_api/migrations/0016_auto_20210902_1731.py | geoadmin/service-stac | ee5064558133142160bd4fa15850f7528f5d70aa | [
"BSD-3-Clause"
] | 3 | 2020-09-02T14:01:07.000Z | 2021-07-27T06:30:26.000Z | # Generated by Django 3.1.13 on 2021-09-02 17:31
import django.contrib.postgres.fields
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('stac_api', '0015_data_collection_summaries'),
]
operations = [
migrations.AddFie... | 50.316667 | 114 | 0.47052 |
import django.contrib.postgres.fields
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('stac_api', '0015_data_collection_summaries'),
]
operations = [
migrations.AddField(
model_name='collection',
... | true | true |
f701a0734a4a1d19b5d201689491ebbaa931e073 | 20 | py | Python | dnd/constants/references.py | Saevon/webdnd | 4dd5d30ae105ede51bbd92bf5281a6965b7d55f4 | [
"MIT"
] | 4 | 2015-09-26T01:12:36.000Z | 2020-01-04T19:36:58.000Z | dnd/constants/references.py | Saevon/webdnd | 4dd5d30ae105ede51bbd92bf5281a6965b7d55f4 | [
"MIT"
] | null | null | null | dnd/constants/references.py | Saevon/webdnd | 4dd5d30ae105ede51bbd92bf5281a6965b7d55f4 | [
"MIT"
] | null | null | null | SOURCE_DOC_PATH = '' | 20 | 20 | 0.75 | SOURCE_DOC_PATH = '' | true | true |
f701a0d7186cec3acc6b2d5419f28cc2f64ee5c4 | 4,658 | py | Python | i3Deep/merge_labels.py | Karol-G/nnUNet | a30bdbd64254c94c515ee03617173eb217eea505 | [
"Apache-2.0"
] | 2 | 2022-03-18T12:49:28.000Z | 2022-03-24T14:39:20.000Z | i3Deep/merge_labels.py | Karol-G/nnUNet | a30bdbd64254c94c515ee03617173eb217eea505 | [
"Apache-2.0"
] | null | null | null | i3Deep/merge_labels.py | Karol-G/nnUNet | a30bdbd64254c94c515ee03617173eb217eea505 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from i3Deep import utils
from tqdm import tqdm
import os
# name = "KGU-53317EB91645"
# load_mask = "D:/Datasets/medical_data/ExportKGU/3D Slicer 2/" + name + "/mask.nii.gz"
# load_label_table = "D:/Datasets/medical_data/ExportKGU/3D Slicer 2/" + name + "/label_table.txt"
# save_mask = "D:/... | 39.474576 | 157 | 0.61915 | import numpy as np
from i3Deep import utils
from tqdm import tqdm
import os
load_path = "D:/Datasets/medical_data/ExportKGU/3D Slicer 2/"
def rename(case_path):
filenames = utils.load_filenames(case_path + "/", extensions=None)
for filename in filenames:
name = os.path.basename(filen... | true | true |
f701a0e0bac8930e8e013a4c8abaa3726fc575f7 | 14,150 | py | Python | mlflow/utils/rest_utils.py | devlibx/mlflowx | 291c51161ec26450b1e79c8e4a32af960da79591 | [
"Apache-2.0"
] | 1 | 2021-12-02T19:00:59.000Z | 2021-12-02T19:00:59.000Z | mlflow/utils/rest_utils.py | devlibx/mlflowx | 291c51161ec26450b1e79c8e4a32af960da79591 | [
"Apache-2.0"
] | 2 | 2022-02-14T21:58:58.000Z | 2022-02-27T21:44:09.000Z | mlflow/utils/rest_utils.py | devlibx/mlflowx | 291c51161ec26450b1e79c8e4a32af960da79591 | [
"Apache-2.0"
] | null | null | null | import base64
import json
import requests
import urllib3
from contextlib import contextmanager
from packaging.version import Version
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
from requests.exceptions import HTTPError
from mlflow import __version__
from mlflow.protos import databricks_pb2... | 40.31339 | 127 | 0.687067 | import base64
import json
import requests
import urllib3
from contextlib import contextmanager
from packaging.version import Version
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
from requests.exceptions import HTTPError
from mlflow import __version__
from mlflow.protos import databricks_pb2... | true | true |
f701a2d5a7e3f8a3cda2bdf2b032006a0d23d1da | 12,777 | py | Python | difflikelihoods/sampling.py | pnkraemer/differentiable_likelihoods | a07876dbf8fcd4aa14bf36bd3e98e06ea10d2a94 | [
"MIT"
] | 7 | 2020-07-29T13:15:09.000Z | 2022-01-04T15:16:16.000Z | difflikelihoods/sampling.py | pnkraemer/differentiable_likelihoods | a07876dbf8fcd4aa14bf36bd3e98e06ea10d2a94 | [
"MIT"
] | null | null | null | difflikelihoods/sampling.py | pnkraemer/differentiable_likelihoods | a07876dbf8fcd4aa14bf36bd3e98e06ea10d2a94 | [
"MIT"
] | null | null | null | """
sampling.py
We sample Metropolis-Hastings:
* Random walk proposals
* Langevin proposals
* Langevin proposals with preconditioning
* Hamiltonian MC
* Hamiltonian MC with preconditioning
NOTE:
The functionality of this module is restricted to log-densities,
i.e. densities of the form p(s... | 32.677749 | 86 | 0.632386 |
import collections
from abc import ABC, abstractmethod
import numpy as np
from difflikelihoods import logdensity
def metropolishastings_rw(logpdf, nsamps, initstate, pwidth, ninits):
logdens = logdensity.LogDensity(logpdf)
rwmh = RandomWalkMH(logdens)
return rwmh.sample_nd(nsamps, initstate, pwidth, nini... | true | true |
f701a3bd912ec7dd82ad514397f651ce74c46977 | 16,336 | py | Python | tests/ut/python/dataset/test_random_crop_and_resize.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | 1 | 2021-06-02T02:46:20.000Z | 2021-06-02T02:46:20.000Z | tests/ut/python/dataset/test_random_crop_and_resize.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/dataset/test_random_crop_and_resize.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"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... | 43.102902 | 112 | 0.711741 |
import numpy as np
import cv2
import mindspore.dataset.transforms.py_transforms
import mindspore.dataset.vision.c_transforms as c_vision
import mindspore.dataset.vision.py_transforms as py_vision
import mindspore.dataset.vision.utils as mode
import mindspore.dataset as ds
from mindspore import log as log... | true | true |
f701a3f297c60253d22a493d95df26355ef4e656 | 52,558 | py | Python | test/augmentation/test_random_generator.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/augmentation/test_random_generator.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/augmentation/test_random_generator.py | ChristophReich1996/kornia | 35f955b46e8015da1cb9faa28c6943ec2b09cc2a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import pytest
import torch
from torch.testing import assert_allclose
from kornia.augmentation.random_generator import (
random_prob_generator,
random_color_jitter_generator,
random_perspective_generator,
random_affine_generator,
random_rotation_generator,
random_crop_generator,
random_crop_... | 45.114163 | 119 | 0.589121 | import pytest
import torch
from torch.testing import assert_allclose
from kornia.augmentation.random_generator import (
random_prob_generator,
random_color_jitter_generator,
random_perspective_generator,
random_affine_generator,
random_rotation_generator,
random_crop_generator,
random_crop_... | true | true |
f701a42275067e59f8ec099af3df99ce24399797 | 5,853 | py | Python | env/lib/python3.8/site-packages/ask_sdk_model/interfaces/alexa/presentation/apl/parallel_command.py | adamash99/alexa-play-pot-of-greed | dc2d18dae55692a4bf1becb72685a5777870c643 | [
"MIT"
] | null | null | null | env/lib/python3.8/site-packages/ask_sdk_model/interfaces/alexa/presentation/apl/parallel_command.py | adamash99/alexa-play-pot-of-greed | dc2d18dae55692a4bf1becb72685a5777870c643 | [
"MIT"
] | null | null | null | env/lib/python3.8/site-packages/ask_sdk_model/interfaces/alexa/presentation/apl/parallel_command.py | adamash99/alexa-play-pot-of-greed | dc2d18dae55692a4bf1becb72685a5777870c643 | [
"MIT"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 44.007519 | 310 | 0.658466 |
import pprint
import re
import six
import typing
from enum import Enum
from ask_sdk_model.interfaces.alexa.presentation.apl.command import Command
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union, Any
from datetime import datetime
from ask_sdk_model.interfaces.alexa... | true | true |
f701a4e8d6c62f14457b5a5fe5464b1abcbc021e | 2,399 | py | Python | test/functional/p2p_timeouts.py | Jiankun-Huang/Testcoin | 4f6454f6f8c8e020a3d206ad370ad725f92caac4 | [
"MIT"
] | null | null | null | test/functional/p2p_timeouts.py | Jiankun-Huang/Testcoin | 4f6454f6f8c8e020a3d206ad370ad725f92caac4 | [
"MIT"
] | null | null | null | test/functional/p2p_timeouts.py | Jiankun-Huang/Testcoin | 4f6454f6f8c8e020a3d206ad370ad725f92caac4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Test Coin Super Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various net timeouts.
- Create three testcoinsuperd nodes:
no_verack_node - we never... | 32.418919 | 116 | 0.738224 |
from time import sleep
from test_framework.messages import msg_ping
from test_framework.mininode import P2PInterface
from test_framework.test_framework import TestCoinSuperTestFramework
class TestP2PConn(P2PInterface):
def on_version(self, message):
pass
class TimeoutsTest(TestCoinSuperTest... | true | true |
f701a4ef419edbf2ea2af74486dcd82605f2aa39 | 401 | py | Python | mrpython/version.py | Ikzue/MrPython | 2fb12d010c0b67b1119803080574a792ade6f289 | [
"PSF-2.0"
] | 5 | 2020-02-05T14:44:29.000Z | 2020-04-15T19:24:26.000Z | mrpython/version.py | Botsaa/MrPython | 264696204860b4e269b98c9ee4f4419b5ab5e039 | [
"PSF-2.0"
] | null | null | null | mrpython/version.py | Botsaa/MrPython | 264696204860b4e269b98c9ee4f4419b5ab5e039 | [
"PSF-2.0"
] | null | null | null |
MRPYTHON_VERSION_MAJOR = 3
MRPYTHON_VERSION_MINOR = 0
MRPYTHON_VERSION_PATCH = 9
MRPYTHON_VERSION_TAG = "beta"
def version_string():
return "{}.{}.{}{}".format(MRPYTHON_VERSION_MAJOR,
MRPYTHON_VERSION_MINOR,
MRPYTHON_VERSION_PATCH,
... | 28.642857 | 98 | 0.583541 |
MRPYTHON_VERSION_MAJOR = 3
MRPYTHON_VERSION_MINOR = 0
MRPYTHON_VERSION_PATCH = 9
MRPYTHON_VERSION_TAG = "beta"
def version_string():
return "{}.{}.{}{}".format(MRPYTHON_VERSION_MAJOR,
MRPYTHON_VERSION_MINOR,
MRPYTHON_VERSION_PATCH,
... | true | true |
f701a625c2071f626b47318c752e19e835dda579 | 577 | py | Python | train/optimize.py | creaiter/Classification-PyTorch | 2feabf4b3d0d561420399bdf65840a58af76069d | [
"MIT"
] | 1 | 2021-04-02T05:13:58.000Z | 2021-04-02T05:13:58.000Z | train/optimize.py | creaiter/Classification-PyTorch | 2feabf4b3d0d561420399bdf65840a58af76069d | [
"MIT"
] | null | null | null | train/optimize.py | creaiter/Classification-PyTorch | 2feabf4b3d0d561420399bdf65840a58af76069d | [
"MIT"
] | null | null | null | import torch
import torch.optim as optim
def set_optimizer(model, cfg):
r"""Sets the optimizer
"""
if cfg.optimizer == 'SGD':
optimizer = optim.SGD(model.parameters(), lr=cfg.lr,
momentum=cfg.momentum, weight_decay=cfg.weight_decay,
neste... | 33.941176 | 83 | 0.551127 | import torch
import torch.optim as optim
def set_optimizer(model, cfg):
if cfg.optimizer == 'SGD':
optimizer = optim.SGD(model.parameters(), lr=cfg.lr,
momentum=cfg.momentum, weight_decay=cfg.weight_decay,
nesterov=cfg.nesterov)
elif cfg.opti... | true | true |
f701a6a9a29c899827f6c090c2cc3954d90b3ede | 21,559 | py | Python | src/pytypes/onefuzztypes/models.py | chkeita/onefuzz | e413aec03dcd682c049855b77cf0b0042407ddc1 | [
"MIT"
] | null | null | null | src/pytypes/onefuzztypes/models.py | chkeita/onefuzz | e413aec03dcd682c049855b77cf0b0042407ddc1 | [
"MIT"
] | null | null | null | src/pytypes/onefuzztypes/models.py | chkeita/onefuzz | e413aec03dcd682c049855b77cf0b0042407ddc1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from datetime import datetime
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from uuid import UUID, uuid4
from pydantic import BaseModel, Field, root_validator, validator
from pydantic.datacl... | 25.819162 | 84 | 0.692611 |
from datetime import datetime
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from uuid import UUID, uuid4
from pydantic import BaseModel, Field, root_validator, validator
from pydantic.dataclasses import dataclass
from .consts import ONE_HOUR, SEVEN_DAYS
from .enums import (
OS,... | true | true |
f701a7a19672d4a369f690670c7acd3cd38db635 | 22,035 | py | Python | Software_project/primary_gui/test.py | fanghaow/srtp_project | d490f706dc5d2f26dd00563a0a0724cb442ff98d | [
"MIT"
] | 1 | 2021-07-06T14:27:39.000Z | 2021-07-06T14:27:39.000Z | Software_project/primary_gui/test.py | fanghaow/srtp_project | d490f706dc5d2f26dd00563a0a0724cb442ff98d | [
"MIT"
] | null | null | null | Software_project/primary_gui/test.py | fanghaow/srtp_project | d490f706dc5d2f26dd00563a0a0724cb442ff98d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'test.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, ... | 58.603723 | 101 | 0.718039 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(873, 697)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
... | true | true |
f701a8683774ddb24cb2f16bec478bfc6819e465 | 26 | py | Python | hackernews/__init__.py | samisnotinsane/hackernews-client | c1c6e7791c366a7df0dbec544e18104bccfa93c8 | [
"MIT"
] | 5 | 2020-03-15T10:35:29.000Z | 2021-09-07T18:50:16.000Z | hackernews/__init__.py | samisnotinsane/hackernews-client | c1c6e7791c366a7df0dbec544e18104bccfa93c8 | [
"MIT"
] | 9 | 2019-08-13T16:51:45.000Z | 2019-08-21T13:23:08.000Z | hackernews/__init__.py | samisnotinsane/hackernews-client | c1c6e7791c366a7df0dbec544e18104bccfa93c8 | [
"MIT"
] | null | null | null | from .hn import NewsClient | 26 | 26 | 0.846154 | from .hn import NewsClient | true | true |
f701a87736fbc584f7e9ffd3e6d8d63f457be0ba | 2,204 | py | Python | lhotse/manipulation.py | freewym/lhotse | 66e9bbaf25b75011388ab00189baa162c3c1d435 | [
"Apache-2.0"
] | null | null | null | lhotse/manipulation.py | freewym/lhotse | 66e9bbaf25b75011388ab00189baa162c3c1d435 | [
"Apache-2.0"
] | null | null | null | lhotse/manipulation.py | freewym/lhotse | 66e9bbaf25b75011388ab00189baa162c3c1d435 | [
"Apache-2.0"
] | null | null | null | from functools import reduce
from itertools import chain
from operator import add
from typing import Iterable, Optional, TypeVar
from lhotse.audio import Recording, RecordingSet
from lhotse.cut import Cut, CutSet, MixedCut
from lhotse.features import FeatureSet, Features
from lhotse.supervision import SupervisionSegme... | 38 | 120 | 0.72686 | from functools import reduce
from itertools import chain
from operator import add
from typing import Iterable, Optional, TypeVar
from lhotse.audio import Recording, RecordingSet
from lhotse.cut import Cut, CutSet, MixedCut
from lhotse.features import FeatureSet, Features
from lhotse.supervision import SupervisionSegme... | true | true |
f701a89de548f767ba7b5a94b01d7537f9814e22 | 7,659 | py | Python | magenta/models/improv_rnn/improv_rnn_sequence_generator.py | bugrevelio/magenta | a54c6e4aa8b32f2625d416fb1b39b03d123e1e51 | [
"Apache-2.0"
] | 51 | 2016-11-06T16:48:47.000Z | 2021-11-12T08:59:58.000Z | magenta/models/improv_rnn/improv_rnn_sequence_generator.py | bugrevelio/magenta | a54c6e4aa8b32f2625d416fb1b39b03d123e1e51 | [
"Apache-2.0"
] | 1 | 2017-06-27T20:05:51.000Z | 2017-06-27T20:05:51.000Z | magenta/models/improv_rnn/improv_rnn_sequence_generator.py | bugrevelio/magenta | a54c6e4aa8b32f2625d416fb1b39b03d123e1e51 | [
"Apache-2.0"
] | 16 | 2016-11-10T06:31:02.000Z | 2020-01-22T12:07:28.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 44.789474 | 80 | 0.727118 |
from functools import partial
from magenta.models.improv_rnn import improv_rnn_model
import magenta.music as mm
class ImprovRnnSequenceGenerator(mm.BaseSequenceGenerator):
def __init__(self, model, details, steps_per_quarter=4, checkpoint=None,
bundle=None):
super(ImprovRnnSeque... | true | true |
f701a95e256e4511c3c6997f44261b1ac28e3d32 | 1,625 | py | Python | csrv/model/cards/runner/card01003.py | mrroach/CentralServer | e377c65d8f3adf5a2d3273acd4f459be697aea56 | [
"Apache-2.0"
] | null | null | null | csrv/model/cards/runner/card01003.py | mrroach/CentralServer | e377c65d8f3adf5a2d3273acd4f459be697aea56 | [
"Apache-2.0"
] | null | null | null | csrv/model/cards/runner/card01003.py | mrroach/CentralServer | e377c65d8f3adf5a2d3273acd4f459be697aea56 | [
"Apache-2.0"
] | 1 | 2020-09-20T11:26:20.000Z | 2020-09-20T11:26:20.000Z | from csrv.model import actions
from csrv.model.actions import play_run_event
from csrv.model import cost
from csrv.model import events
from csrv.model import timing_phases
from csrv.model.cards import card_info
from csrv.model.cards import event
class TrashForFree(actions.TrashOnAccess):
COST_CLASS = cost.NullCost
... | 29.017857 | 80 | 0.755692 | from csrv.model import actions
from csrv.model.actions import play_run_event
from csrv.model import cost
from csrv.model import events
from csrv.model import timing_phases
from csrv.model.cards import card_info
from csrv.model.cards import event
class TrashForFree(actions.TrashOnAccess):
COST_CLASS = cost.NullCost
... | true | true |
f701a97d3784b5f4cbf25b14e0548467c94684a3 | 27,688 | py | Python | Tests/test_integration.py | sergiooylo/content | 60b3a1022cffe536fdef2a94920c1e9d521dbdda | [
"MIT"
] | null | null | null | Tests/test_integration.py | sergiooylo/content | 60b3a1022cffe536fdef2a94920c1e9d521dbdda | [
"MIT"
] | null | null | null | Tests/test_integration.py | sergiooylo/content | 60b3a1022cffe536fdef2a94920c1e9d521dbdda | [
"MIT"
] | 1 | 2020-12-03T10:03:59.000Z | 2020-12-03T10:03:59.000Z | from __future__ import print_function
import copy
import time
from pprint import pformat
import uuid
import ast
import urllib
import urllib3
import requests.exceptions
from demisto_client.demisto_api.rest import ApiException
import demisto_client
import json
from Tests.test_utils import print_error, print_warning, pri... | 47.903114 | 120 | 0.631176 | from __future__ import print_function
import copy
import time
from pprint import pformat
import uuid
import ast
import urllib
import urllib3
import requests.exceptions
from demisto_client.demisto_api.rest import ApiException
import demisto_client
import json
from Tests.test_utils import print_error, print_warning, pri... | true | true |
f701a99f506b09342af3659b73251e1900d227a5 | 3,189 | py | Python | docs/conf.py | tpajurek-dtml/pydata-sphinx-theme | 925ac87225cf1e303b180e35a59809ac9db2e3b2 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | tpajurek-dtml/pydata-sphinx-theme | 925ac87225cf1e303b180e35a59809ac9db2e3b2 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | tpajurek-dtml/pydata-sphinx-theme | 925ac87225cf1e303b180e35a59809ac9db2e3b2 | [
"BSD-3-Clause"
] | 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... | 30.961165 | 87 | 0.644403 |
project = "PyData Sphinx Theme"
copyright = "2019, PyData Community"
author = "PyData Community"
release = "0.0.1dev0"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"numpydoc",
"recommonmark",
"jupyter_sphinx",
]
autosummary_generate = True
templates_... | true | true |
f701ab2ec78d85a7e8989abbfce1a933b877897f | 922 | py | Python | interfaces/gearman/requires.py | centauri-charmers/charm-zuul-executor | 2fb4adc1b042d7efe294574e3ce3b23cca9df6bb | [
"Apache-2.0"
] | null | null | null | interfaces/gearman/requires.py | centauri-charmers/charm-zuul-executor | 2fb4adc1b042d7efe294574e3ce3b23cca9df6bb | [
"Apache-2.0"
] | null | null | null | interfaces/gearman/requires.py | centauri-charmers/charm-zuul-executor | 2fb4adc1b042d7efe294574e3ce3b23cca9df6bb | [
"Apache-2.0"
] | null | null | null | from charms.reactive import Endpoint, when, set_flag, clear_flag
import charmhelpers.core.hookenv as hookenv
from charmhelpers.core.hookenv import log
class GearmanRequires(Endpoint):
@when('endpoint.{endpoint_name}.joined')
def joined(self):
# if any(unit.received['port'] for unit in self.all_joined_... | 36.88 | 74 | 0.650759 | from charms.reactive import Endpoint, when, set_flag, clear_flag
import charmhelpers.core.hookenv as hookenv
from charmhelpers.core.hookenv import log
class GearmanRequires(Endpoint):
@when('endpoint.{endpoint_name}.joined')
def joined(self):
set_flag(self.expand_name('available'))
@when... | true | true |
f701abc28c2e475986674f70ad2db19f55a743ca | 4,112 | py | Python | flee/InputGeography_food.py | timvink/flee | c7901e2a0de70f18c3267236e127ab1c26c8f5e5 | [
"BSD-3-Clause"
] | null | null | null | flee/InputGeography_food.py | timvink/flee | c7901e2a0de70f18c3267236e127ab1c26c8f5e5 | [
"BSD-3-Clause"
] | null | null | null | flee/InputGeography_food.py | timvink/flee | c7901e2a0de70f18c3267236e127ab1c26c8f5e5 | [
"BSD-3-Clause"
] | null | null | null | import csv
import sys
from flee import flee
from flee import SimulationSettings
class InputGeography:
"""
Class which reads in Geographic information.
"""
def __init__(self):
self.locations = []
self.links = []
def ReadLocationsFromCSV(self, csv_name, columns=["name", "region", "... | 32.377953 | 147 | 0.467656 | import csv
import sys
from flee import flee
from flee import SimulationSettings
class InputGeography:
def __init__(self):
self.locations = []
self.links = []
def ReadLocationsFromCSV(self, csv_name, columns=["name", "region", "country", "gps_x", "gps_y", "location_type", "conflict_date", "po... | true | true |
f701ac12f403dff5d5ffd0d52254d851cf2cca58 | 901 | py | Python | tpot_output _pipeline.py | vermaakarsh/Code-Vulnerability | 38791e2f2bc970bed4c4e8af397ac1f4ac4d7363 | [
"Apache-2.0"
] | null | null | null | tpot_output _pipeline.py | vermaakarsh/Code-Vulnerability | 38791e2f2bc970bed4c4e8af397ac1f4ac4d7363 | [
"Apache-2.0"
] | null | null | null | tpot_output _pipeline.py | vermaakarsh/Code-Vulnerability | 38791e2f2bc970bed4c4e8af397ac1f4ac4d7363 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
# NOTE: Make sure that the outcome column is labeled 'target' in the data file
tpot_data = pd.read_csv('PATH/TO/DATA/FILE', sep='COLUMN_SEPARATOR', dtype=np.float64)
features =... | 45.05 | 86 | 0.801332 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
tpot_data = pd.read_csv('PATH/TO/DATA/FILE', sep='COLUMN_SEPARATOR', dtype=np.float64)
features = tpot_data.drop('target', axis=1)
training_features, testing_features, trainin... | true | true |
f701ad039addc3139e0d9bb52293365f52a99e55 | 5,544 | py | Python | tests/unit/modules/brew_test.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 2 | 2017-09-17T21:10:35.000Z | 2019-08-26T03:00:12.000Z | tests/unit/modules/brew_test.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/brew_test.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 3 | 2021-02-23T08:12:48.000Z | 2021-02-23T08:13:13.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@satlstack.com>`
'''
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.mock import MagicMock, patch
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt Libs
from salt.modules i... | 33.197605 | 79 | 0.628066 |
from salttesting import TestCase
from salttesting.mock import MagicMock, patch
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
from salt.modules import brew
brew.__context__ = {}
brew.__salt__ = {}
TAPS_STRING = 'homebrew/dupes\nhomebrew/science\nhomebrew/x11'
TAPS_LIST = ['homebr... | true | true |
f701adc7789e0923c53cf8d6186000a9a0af4fa7 | 305,992 | py | Python | ibm_watson/compare_comply_v1.py | BuiQuangAnh/python-sdk | f9726a4f74d0a5a3ea901044af8565b4eea4d05e | [
"Apache-2.0"
] | null | null | null | ibm_watson/compare_comply_v1.py | BuiQuangAnh/python-sdk | f9726a4f74d0a5a3ea901044af8565b4eea4d05e | [
"Apache-2.0"
] | null | null | null | ibm_watson/compare_comply_v1.py | BuiQuangAnh/python-sdk | f9726a4f74d0a5a3ea901044af8565b4eea4d05e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# (C) Copyright IBM Corp. 2019, 2020.
#
# 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 la... | 42.043419 | 155 | 0.603382 |
import json
from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator
from .common import get_sdk_headers
from datetime import date
from datetime import datetime
from enum import Enum
from ibm_cloud_sdk_core import BaseService
from ibm_cloud_sdk_core import DetailedResponse
from ibm_clou... | true | true |
f701ae34f77efd8ff4cc435f28951c39d6332715 | 2,985 | py | Python | dassl/engine/dg/crossgrad.py | DMIRLAB-Group/Dassl.pytorch | 79052448cc0b0622f14e9768dbd6e6c0598fe6d1 | [
"MIT"
] | 1 | 2021-12-11T23:37:02.000Z | 2021-12-11T23:37:02.000Z | dassl/engine/dg/crossgrad.py | DMIRLAB-Group/Dassl.pytorch | 79052448cc0b0622f14e9768dbd6e6c0598fe6d1 | [
"MIT"
] | null | null | null | dassl/engine/dg/crossgrad.py | DMIRLAB-Group/Dassl.pytorch | 79052448cc0b0622f14e9768dbd6e6c0598fe6d1 | [
"MIT"
] | 1 | 2020-09-21T03:16:10.000Z | 2020-09-21T03:16:10.000Z | import torch
from torch.nn import functional as F
from dassl.optim import build_optimizer, build_lr_scheduler
from dassl.utils import count_num_param
from dassl.engine import TRAINER_REGISTRY, TrainerX
from dassl.engine.trainer import SimpleNet
@TRAINER_REGISTRY.register()
class CrossGrad(TrainerX):
"""Cross-gra... | 33.920455 | 70 | 0.634506 | import torch
from torch.nn import functional as F
from dassl.optim import build_optimizer, build_lr_scheduler
from dassl.utils import count_num_param
from dassl.engine import TRAINER_REGISTRY, TrainerX
from dassl.engine.trainer import SimpleNet
@TRAINER_REGISTRY.register()
class CrossGrad(TrainerX):
def __init_... | true | true |
f701aec6e638ee242787e854aea47bb65ae4772d | 2,327 | py | Python | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/DeleteGlobalAccelerationInstanceRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/DeleteGlobalAccelerationInstanceRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vpc/aliyunsdkvpc/request/v20160428/DeleteGlobalAccelerationInstanceRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.147541 | 90 | 0.788139 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkvpc.endpoint import endpoint_data
class DeleteGlobalAccelerationInstanceRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Vpc', '2016-04-28', 'DeleteGlobalAccelerationInstance','vpc')
if hasattr(self, "endpoint_map"):... | true | true |
f701aee858154e8cb77d9a32cdd49a298245ef0c | 4,748 | py | Python | AI-lec8-rnn/classify.py | 0HenryH/ai2021s | 1cadc3f963f7f2fba99441607e62c8da88183327 | [
"MIT"
] | null | null | null | AI-lec8-rnn/classify.py | 0HenryH/ai2021s | 1cadc3f963f7f2fba99441607e62c8da88183327 | [
"MIT"
] | null | null | null | AI-lec8-rnn/classify.py | 0HenryH/ai2021s | 1cadc3f963f7f2fba99441607e62c8da88183327 | [
"MIT"
] | null | null | null | import time
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import itertools
import collections
import matplotlib.pyplot as plt
# Read in data
df = pd.read_csv("Chinese_Names_Corpus_Gender(120W).txt", header=2)
df = df[df.sex != "未知"]
names = df["dict"].values
# Compute charact... | 27.766082 | 88 | 0.614153 | import time
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import itertools
import collections
import matplotlib.pyplot as plt
df = pd.read_csv("Chinese_Names_Corpus_Gender(120W).txt", header=2)
df = df[df.sex != "未知"]
names = df["dict"].values
chars = [list(name) for name in... | true | true |
f701af063627ad31533a04cbfc26bc4587ca9308 | 11,996 | py | Python | tests/test_integration.py | Jerry2001Qu/pennylane-qiskit | 7ba24ac6ab695d83508cd0f5064f7dfb1670a79b | [
"Apache-2.0"
] | null | null | null | tests/test_integration.py | Jerry2001Qu/pennylane-qiskit | 7ba24ac6ab695d83508cd0f5064f7dfb1670a79b | [
"Apache-2.0"
] | null | null | null | tests/test_integration.py | Jerry2001Qu/pennylane-qiskit | 7ba24ac6ab695d83508cd0f5064f7dfb1670a79b | [
"Apache-2.0"
] | null | null | null | import sys
import numpy as np
import pennylane as qml
import pytest
import qiskit
from pennylane_qiskit import AerDevice, BasicAerDevice
from conftest import state_backends
pldevices = [("qiskit.aer", qiskit.Aer), ("qiskit.basicaer", qiskit.BasicAer)]
class TestDeviceIntegration:
"""Test the devices work corr... | 35.808955 | 106 | 0.615038 | import sys
import numpy as np
import pennylane as qml
import pytest
import qiskit
from pennylane_qiskit import AerDevice, BasicAerDevice
from conftest import state_backends
pldevices = [("qiskit.aer", qiskit.Aer), ("qiskit.basicaer", qiskit.BasicAer)]
class TestDeviceIntegration:
@pytest.mark.parametrize("d"... | true | true |
f701af7f21d797ec05eaafd75fcf08aa25842a12 | 1,041 | py | Python | tensorflow_datasets/core/utils/__init__.py | haideraltahan/datasets | aad5c7ea705949d20817fcc49a892bb2a21532f0 | [
"Apache-2.0"
] | 14 | 2019-03-30T02:11:29.000Z | 2021-11-16T12:06:32.000Z | tensorflow_datasets/core/utils/__init__.py | haideraltahan/datasets | aad5c7ea705949d20817fcc49a892bb2a21532f0 | [
"Apache-2.0"
] | 1 | 2019-09-13T15:10:18.000Z | 2019-09-13T21:05:46.000Z | tensorflow_datasets/core/utils/__init__.py | haideraltahan/datasets | aad5c7ea705949d20817fcc49a892bb2a21532f0 | [
"Apache-2.0"
] | 10 | 2019-03-31T08:35:29.000Z | 2021-09-01T06:28:43.000Z | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 40.038462 | 74 | 0.793468 |
from tensorflow_datasets.core.utils.image_utils import *
from tensorflow_datasets.core.utils.py_utils import *
from tensorflow_datasets.core.utils.tf_utils import *
from tensorflow_datasets.core.utils.tqdm_utils import *
from tensorflow_datasets.core.utils.version import Experiment
from tensorflow_data... | true | true |
f701afa198407aba031878919da8b1a0c0c97bbb | 3,875 | py | Python | server/data_common/rwlock.py | atong01/cellxgene | 147830a87d100a33537121b277a5ac921e7cb250 | [
"MIT"
] | 3 | 2019-11-11T15:41:07.000Z | 2020-12-14T08:47:35.000Z | server/data_common/rwlock.py | atong01/cellxgene | 147830a87d100a33537121b277a5ac921e7cb250 | [
"MIT"
] | 7 | 2021-01-07T19:20:57.000Z | 2021-06-15T18:17:55.000Z | server/data_common/rwlock.py | atong01/cellxgene | 147830a87d100a33537121b277a5ac921e7cb250 | [
"MIT"
] | 1 | 2021-05-12T15:15:05.000Z | 2021-05-12T15:15:05.000Z | # -*- coding: utf-8 -*-
""" rwlock.py
A class to implement read-write locks on top of the standard threading
library.
This is implemented with two mutexes (threading.Lock instances) as per this
wikipedia pseudocode:
https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Using_two_mutexes
... | 28.492647 | 89 | 0.634323 |
from contextlib import contextmanager
from threading import Lock
class RWLock(object):
def __init__(self):
self.w_lock = Lock()
self.num_r_lock = Lock()
self.num_r = 0
self.d_lock = Lock()
def r_acquire(self)... | true | true |
f701b0663ae322a7d89698146ffc17a3ffd54c29 | 257 | py | Python | mycode/src/def_Net_u_B.py | darkxaze/PINNs | f344a907cf8b585e5f667465178c4442b907024d | [
"MIT"
] | null | null | null | mycode/src/def_Net_u_B.py | darkxaze/PINNs | f344a907cf8b585e5f667465178c4442b907024d | [
"MIT"
] | null | null | null | mycode/src/def_Net_u_B.py | darkxaze/PINNs | f344a907cf8b585e5f667465178c4442b907024d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed May 20 11:36:58 2020
@author: nastavirs
"""
import numpy as np
import tensorflow as tf
def net_u(self, x, t):
u = self.neural_net(tf.concat([x,t],1), self.weights, self.biases)
return u | 23.363636 | 75 | 0.603113 |
import numpy as np
import tensorflow as tf
def net_u(self, x, t):
u = self.neural_net(tf.concat([x,t],1), self.weights, self.biases)
return u | true | true |
f701b20352404c4faaee1be82c31f131651d29b3 | 7,717 | py | Python | tests/contrib/aiopg/test.py | tancnle/dd-trace-py | 4313f388383b90ccf2bcbca9d7ef1c400c827ece | [
"BSD-3-Clause"
] | null | null | null | tests/contrib/aiopg/test.py | tancnle/dd-trace-py | 4313f388383b90ccf2bcbca9d7ef1c400c827ece | [
"BSD-3-Clause"
] | null | null | null | tests/contrib/aiopg/test.py | tancnle/dd-trace-py | 4313f388383b90ccf2bcbca9d7ef1c400c827ece | [
"BSD-3-Clause"
] | null | null | null | # flake8: noqa
# DEV: Skip linting, we lint with Python 2, we'll get SyntaxErrors from `yield from`
# stdlib
import time
import asyncio
# 3p
import aiopg
from psycopg2 import extras
# project
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.aiopg.patch import patch, unpatch
from ddtrace im... | 31.88843 | 84 | 0.618375 |
# stdlib
import time
import asyncio
# 3p
import aiopg
from psycopg2 import extras
# project
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.contrib.aiopg.patch import patch, unpatch
from ddtrace import Pin
# testing
from tests.opentracer.utils import init_tracer
from tests.contrib.config impor... | true | true |
f701b264e4efe7ddcef5722e06cf332a1fd1560f | 1,379 | py | Python | coherent_gradients/weak_and_strong/datasets/dataset_with_indices.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | coherent_gradients/weak_and_strong/datasets/dataset_with_indices.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | coherent_gradients/weak_and_strong/datasets/dataset_with_indices.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.475 | 78 | 0.758521 |
import torchvision
class VisionDatasetWithIndices(torchvision.datasets.vision.VisionDataset):
def __init__(self, dataset):
super(VisionDatasetWithIndices, self).__init__(None)
self.dataset = dataset
def __getitem__(self, index):
data, target = self.dataset.__getitem__(index)
retu... | true | true |
f701b2c2137f85722d1a877a79dd4df5230da338 | 1,178 | py | Python | compile_shaders.py | SmartPhoenix/Persistent-Kingdoms | 772574471279825b43788c87df4eab44444912a3 | [
"Unlicense"
] | 3 | 2018-04-13T15:45:21.000Z | 2018-12-16T16:50:37.000Z | compile_shaders.py | SmartPhoenix/Persistent-Kingdoms | 772574471279825b43788c87df4eab44444912a3 | [
"Unlicense"
] | 249 | 2018-03-26T14:04:11.000Z | 2020-04-13T22:32:36.000Z | compile_shaders.py | SmartPhoenix/Persistent-Kingdoms | 772574471279825b43788c87df4eab44444912a3 | [
"Unlicense"
] | 11 | 2018-04-10T15:56:01.000Z | 2019-12-10T21:39:32.000Z | #!/usr/bin/python -tt
import os
import argparse
import subprocess
import shutil
parser = argparse.ArgumentParser(description="Compile the Mount&Blade Warband shaders.")
parser.add_argument("-b", "--compile-b", action="store_true", help="compile the ps_2_b profile as well")
args = parser.parse_args()
if no... | 29.45 | 113 | 0.672326 |
import os
import argparse
import subprocess
import shutil
parser = argparse.ArgumentParser(description="Compile the Mount&Blade Warband shaders.")
parser.add_argument("-b", "--compile-b", action="store_true", help="compile the ps_2_b profile as well")
args = parser.parse_args()
if not os.access(os.path.jo... | false | true |
f701b364ce2fce6e6dfb12c50a12a53ff3dfaa6d | 319 | py | Python | tests/Hello/Hello.py | timkrentz/riaps-pycom | 5b4d9b3c80f9191ec9f680264e6d0ccb14f171ba | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2019-02-24T10:14:46.000Z | 2020-07-08T16:22:17.000Z | tests/Hello/Hello.py | timkrentz/riaps-pycom | 5b4d9b3c80f9191ec9f680264e6d0ccb14f171ba | [
"ECL-2.0",
"Apache-2.0"
] | 36 | 2018-10-16T04:39:54.000Z | 2022-02-09T17:38:05.000Z | tests/Hello/Hello.py | timkrentz/riaps-pycom | 5b4d9b3c80f9191ec9f680264e6d0ccb14f171ba | [
"ECL-2.0",
"Apache-2.0"
] | 8 | 2018-10-23T22:09:18.000Z | 2021-04-23T02:53:24.000Z | # import riaps
from riaps.run.comp import Component
import logging
class Hello(Component):
def __init__(self):
super(Hello, self).__init__()
def on_clock(self):
now = self.clock.recv_pyobj() # Receive time.time() as float
self.logger.info('on_clock(): %s' % str(now))
| 21.266667 | 70 | 0.623824 |
from riaps.run.comp import Component
import logging
class Hello(Component):
def __init__(self):
super(Hello, self).__init__()
def on_clock(self):
now = self.clock.recv_pyobj()
self.logger.info('on_clock(): %s' % str(now))
| true | true |
f701b44598f469f78fdd2c04701671f5c382aebe | 5,337 | py | Python | sdk/python/pulumi_azure_nextgen/securityinsights/v20200101/data_connector.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/securityinsights/v20200101/data_connector.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/securityinsights/v20200101/data_connector.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 40.431818 | 196 | 0.636125 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._enums import *
__all__ = ['DataConnector']
class DataConnector(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
... | true | true |
f701b469709e4b7ce9ab7cdd6a4669708f0e4bab | 1,186 | py | Python | rpi-dp/leaveprob-dttor/lenet.py | khoaDLuu/plantinum | 6c371bc2fe5a2e85eeb9a755cde84daff1dde1e3 | [
"MIT"
] | null | null | null | rpi-dp/leaveprob-dttor/lenet.py | khoaDLuu/plantinum | 6c371bc2fe5a2e85eeb9a755cde84daff1dde1e3 | [
"MIT"
] | 15 | 2020-06-17T08:24:10.000Z | 2022-02-13T16:11:12.000Z | rpi-dp/planttp-clfier/lenet.py | khoaDLuu/plantinum | 6c371bc2fe5a2e85eeb9a755cde84daff1dde1e3 | [
"MIT"
] | null | null | null | from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers.core import Activation
from keras.layers.core import Flatten
from keras.layers.core import Dense
from keras import backend as K
class LeNet:
@staticmethod
def... | 31.210526 | 77 | 0.632378 | from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers.core import Activation
from keras.layers.core import Flatten
from keras.layers.core import Dense
from keras import backend as K
class LeNet:
@staticmethod
def... | true | true |
f701b4a374c74580f619e923008a71b9b2a99b99 | 1,068 | py | Python | test/fixtures/teststream.py | tmehnert/complate-cpp-for-python | fd089f40104b25d437c4bf71639e534372511baf | [
"Apache-2.0"
] | 1 | 2022-01-28T17:42:39.000Z | 2022-01-28T17:42:39.000Z | test/fixtures/teststream.py | tmehnert/complate-cpp-for-python | fd089f40104b25d437c4bf71639e534372511baf | [
"Apache-2.0"
] | null | null | null | test/fixtures/teststream.py | tmehnert/complate-cpp-for-python | fd089f40104b25d437c4bf71639e534372511baf | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Torsten Mehnert
#
# 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 wri... | 28.864865 | 75 | 0.675094 |
from complatecpp import Stream
class TestStream(Stream):
__test__ = False
def __init__(self, *args, **kwargs):
Stream.__init__(self, *args, **kwargs)
self.data = str()
def write(self, string, length):
self.data += string[0:length]
def writeln(self, stri... | true | true |
f701b50160bd279e359fca39ed40b647c9d2aa30 | 4,529 | py | Python | samples/RiskManagement/Verification/multiple-line-items.py | snavinch/cybersource-rest-samples-python | adb7a6b4b55dff6ac833295192d6677b53003c16 | [
"MIT"
] | 21 | 2019-01-22T17:48:32.000Z | 2022-02-07T17:40:58.000Z | samples/RiskManagement/Verification/multiple-line-items.py | broadpay/cybersource-rest-samples-python | f7af6f58c70ea3bf725d34929b40ee4b5fd4d77c | [
"MIT"
] | 10 | 2018-12-03T22:45:17.000Z | 2021-04-19T20:40:14.000Z | samples/RiskManagement/Verification/multiple-line-items.py | broadpay/cybersource-rest-samples-python | f7af6f58c70ea3bf725d34929b40ee4b5fd4d77c | [
"MIT"
] | 29 | 2018-11-09T11:44:53.000Z | 2022-03-18T08:56:46.000Z | from CyberSource import *
import os
import json
from importlib.machinery import SourceFileLoader
config_file = os.path.join(os.getcwd(), "data", "Configuration.py")
configuration = SourceFileLoader("module.name", config_file).load_module()
# To delete None values in Input Request Json body
def del_none(d):
for ke... | 36.821138 | 92 | 0.739678 | from CyberSource import *
import os
import json
from importlib.machinery import SourceFileLoader
config_file = os.path.join(os.getcwd(), "data", "Configuration.py")
configuration = SourceFileLoader("module.name", config_file).load_module()
def del_none(d):
for key, value in list(d.items()):
if value is N... | true | true |
f701b5d10713e0b10dd7948288a9644afa6766b6 | 861 | py | Python | Ex082.py | raphaeltertuliano/Python | ffa9813aaa13ccca807f7c08be9489a2d88d3d62 | [
"MIT"
] | 1 | 2021-11-23T21:38:46.000Z | 2021-11-23T21:38:46.000Z | Ex082.py | raphaeltertuliano/Python | ffa9813aaa13ccca807f7c08be9489a2d88d3d62 | [
"MIT"
] | null | null | null | Ex082.py | raphaeltertuliano/Python | ffa9813aaa13ccca807f7c08be9489a2d88d3d62 | [
"MIT"
] | null | null | null | #Crie um programa que vai ler vários números e colocar em uma lista.
#Depois disso, crie duas listas extras que vão conter apenas valores pares
#e os valores impares digitados, respectivamente.
#Ao final, mostre o conteúdo das três listas geradas
principal = []
par = []
impar = []
while True:
n = int(input('Digite... | 29.689655 | 74 | 0.610918 |
principal = []
par = []
impar = []
while True:
n = int(input('Digite um valor: '))
principal.append(n)
if n % 2 == 0:
par.append(n)
else:
impar.append(n)
while True:
opção = str(input('Quer continuar? [S/N]: ')).upper()
if opção == 'S':
break
... | true | true |
f701b64a83d4fad74752f11c9de67ca20ba37308 | 1,925 | py | Python | docs/generator.py | chibisov/cli-bdd | 579e2d9a07f9985b268aa9aaba42dee33021e163 | [
"MIT"
] | 8 | 2016-05-17T21:32:28.000Z | 2022-02-12T08:59:59.000Z | docs/generator.py | chibisov/cli-bdd | 579e2d9a07f9985b268aa9aaba42dee33021e163 | [
"MIT"
] | 7 | 2016-04-24T07:54:07.000Z | 2020-06-16T15:38:52.000Z | docs/generator.py | chibisov/cli-bdd | 579e2d9a07f9985b268aa9aaba42dee33021e163 | [
"MIT"
] | 4 | 2018-02-21T11:19:24.000Z | 2019-06-10T17:53:29.000Z | # -*- coding: utf-8 -*-
import sys
import os
import re
sys.path.append('../') # noqa
from jinja2 import Template
from cli_bdd.core.steps import (
command,
environment,
file as file_steps,
)
BASE_PATH = os.path.dirname(os.path.normpath(__file__))
TEMPLATES_PATH = os.path.join(BASE_PATH, 'templates')
S... | 22.647059 | 64 | 0.577662 |
import sys
import os
import re
sys.path.append('../')
from jinja2 import Template
from cli_bdd.core.steps import (
command,
environment,
file as file_steps,
)
BASE_PATH = os.path.dirname(os.path.normpath(__file__))
TEMPLATES_PATH = os.path.join(BASE_PATH, 'templates')
STEPS_MODULES = [
command,... | true | true |
f701b651ffc596d8a3269548b9676a5ee60d5fb7 | 5,219 | py | Python | test/functional/wallet_hd.py | sighttviewliu/michaellaoliu_coin | 5d6d3eb2e2a0d4273bd7108744e1a362339697a9 | [
"MIT"
] | 2 | 2018-12-05T12:47:59.000Z | 2019-06-27T12:01:59.000Z | test/functional/wallet_hd.py | sighttviewliu/michaellaoliu_coin | 5d6d3eb2e2a0d4273bd7108744e1a362339697a9 | [
"MIT"
] | null | null | null | test/functional/wallet_hd.py | sighttviewliu/michaellaoliu_coin | 5d6d3eb2e2a0d4273bd7108744e1a362339697a9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2017 The Michaellaoliu Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Hierarchical Deterministic wallet function."""
from test_framework.test_framework import Mi... | 42.430894 | 113 | 0.647634 |
from test_framework.test_framework import MichaellaoliuTestFramework
from test_framework.util import (
assert_equal,
connect_nodes_bi,
)
import shutil
import os
class WalletHDTest(MichaellaoliuTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
... | true | true |
f701b88c9b0507c1ecd656ff36e2482d02c7b69a | 52,391 | py | Python | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/locale.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 9 | 2019-11-22T04:58:40.000Z | 2022-02-26T16:47:28.000Z | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/locale.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | null | null | null | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/locale.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 8 | 2017-09-27T10:31:18.000Z | 2022-01-08T10:30:46.000Z | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: locale.py
""" Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as ... | 31.185119 | 116 | 0.598557 |
""" Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable for... | false | true |
f701b8e4102b4d078dab74fc6655620decfbed24 | 665 | py | Python | themodelshop/utils/data/handlers.py | laraib-sidd/themodelshop | e811036eaf22f0d1b56b7b9c60912930a1fed3cb | [
"MIT"
] | 1 | 2021-01-12T16:13:14.000Z | 2021-01-12T16:13:14.000Z | themodelshop/utils/data/handlers.py | laraib-sidd/themodelshop | e811036eaf22f0d1b56b7b9c60912930a1fed3cb | [
"MIT"
] | 4 | 2020-11-30T12:32:39.000Z | 2021-01-08T12:20:39.000Z | themodelshop/utils/data/handlers.py | laraib-sidd/themodelshop | e811036eaf22f0d1b56b7b9c60912930a1fed3cb | [
"MIT"
] | 1 | 2021-01-12T16:13:20.000Z | 2021-01-12T16:13:20.000Z | """Utilities for working with data.
These are intended to be used predominantly by the filing cabinet
in order to read and write datasets appropriately.
"""
from typing import Any
def _get_handlers(location:str=""):
"""Returns available file handlers.
This checks for a handlers folder at this location and w... | 26.6 | 67 | 0.705263 |
from typing import Any
def _get_handlers(location:str=""):
| true | true |
f701ba3fa91512a9d99c2bac3f0e9fddf9d82770 | 3,759 | py | Python | examples/play_pachi.py | beenfhb/AlphaGo | efb092308fe834ddae4226e3f2f12e1cadec8db4 | [
"MIT"
] | 721 | 2016-04-14T22:19:28.000Z | 2022-03-30T17:32:04.000Z | examples/play_pachi.py | tanmayb123/betago | b5ad8ad9f9a5dd8db1be5d78673dcdc3d07e3f84 | [
"MIT"
] | 48 | 2016-04-15T05:17:53.000Z | 2020-12-12T22:08:28.000Z | examples/play_pachi.py | tanmayb123/betago | b5ad8ad9f9a5dd8db1be5d78673dcdc3d07e3f84 | [
"MIT"
] | 185 | 2016-04-15T11:22:29.000Z | 2022-03-09T13:37:01.000Z | from __future__ import print_function
import yaml
import subprocess
import re
import argparse
from keras.models import model_from_yaml
from betago.model import KerasBot
from betago.processor import SevenPlaneProcessor
from betago.gtp.board import gtp_position_to_coords, coords_to_gtp_position
argparser = argparse.Arg... | 29.598425 | 94 | 0.61958 | from __future__ import print_function
import yaml
import subprocess
import re
import argparse
from keras.models import model_from_yaml
from betago.model import KerasBot
from betago.processor import SevenPlaneProcessor
from betago.gtp.board import gtp_position_to_coords, coords_to_gtp_position
argparser = argparse.Arg... | true | true |
f701ba757a6ae229d32381d1ef87f1aa6197ba1a | 393 | py | Python | main.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | 1 | 2020-11-22T22:22:59.000Z | 2020-11-22T22:22:59.000Z | main.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | null | null | null | main.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | 1 | 2020-11-22T22:24:19.000Z | 2020-11-22T22:24:19.000Z | import os
import sys
from time import sleep
import threading
import window
import comunication
import DisplayActions
debugMode = True
def main():
print("starting...",end='')
state = True
print("[" + ("OK" if state else "ERROR" ) + "]")
winThread.start()
comunication.start()
winThread = thre... | 14.555556 | 53 | 0.669211 | import os
import sys
from time import sleep
import threading
import window
import comunication
import DisplayActions
debugMode = True
def main():
print("starting...",end='')
state = True
print("[" + ("OK" if state else "ERROR" ) + "]")
winThread.start()
comunication.start()
winThread = thre... | true | true |
f701bba607c7fe613014a28a599917b8211d664b | 2,804 | py | Python | panama-papers-solutions/pp-solution-6.py | jtmorgan/ds4ux | 14c4ece59b367fe7c8db09a126161693b9a640b3 | [
"MIT"
] | null | null | null | panama-papers-solutions/pp-solution-6.py | jtmorgan/ds4ux | 14c4ece59b367fe7c8db09a126161693b9a640b3 | [
"MIT"
] | null | null | null | panama-papers-solutions/pp-solution-6.py | jtmorgan/ds4ux | 14c4ece59b367fe7c8db09a126161693b9a640b3 | [
"MIT"
] | null | null | null | # Write a script that generates daily edit AND view counts for Panama Papers over its first 30 days of existence, and prints them to a CSV or TSV file in reverse-chronological order. You file should have three colums with the headers "date", "edits" and "views".
import csv
import json
import requests
import operator
f... | 32.229885 | 262 | 0.587019 |
import csv
import json
import requests
import operator
from urllib.parse import quote
ENDPOINT = 'https://en.wikipedia.org/w/api.php'
parameters = { 'action' : 'query',
'prop' : 'revisions',
'titles' : 'Panama_Papers',
'format' : 'json',
'rvdir' : 'newer',... | true | true |
f701bbb5eb365727210f47ca73154593772e20df | 2,642 | py | Python | txweb/tests/test_resources_routing.py | devdave/txWeb | e447fbefd16134cb2f83323c04c20c41638d7da3 | [
"MIT"
] | null | null | null | txweb/tests/test_resources_routing.py | devdave/txWeb | e447fbefd16134cb2f83323c04c20c41638d7da3 | [
"MIT"
] | 4 | 2020-11-03T19:59:05.000Z | 2021-06-02T03:22:25.000Z | txweb/tests/test_resources_routing.py | devdave/txWeb | e447fbefd16134cb2f83323c04c20c41638d7da3 | [
"MIT"
] | null | null | null | from unittest.mock import MagicMock
from twisted.web.resource import NoResource
from txweb.resources import RoutingResource
from txweb import App
from txweb.http_codes import Unrenderable
from txweb.resources import ViewClassResource
from unittest.mock import sentinel
import typing as T
from .helper import RequestR... | 23.175439 | 103 | 0.716881 | from unittest.mock import MagicMock
from twisted.web.resource import NoResource
from txweb.resources import RoutingResource
from txweb import App
from txweb.http_codes import Unrenderable
from txweb.resources import ViewClassResource
from unittest.mock import sentinel
import typing as T
from .helper import RequestR... | true | true |
f701bcf97badc3db13f081431a166db21e865c8f | 20,382 | py | Python | test/distribution/test_distribution_inference.py | jgasthaus/gluon-ts | 4d044a2dcd9f3f5282e72a5324db12a6b7b30c50 | [
"Apache-2.0"
] | 1 | 2021-08-03T09:09:31.000Z | 2021-08-03T09:09:31.000Z | test/distribution/test_distribution_inference.py | Happiness20/gluon-ts | e14ad69058e58e1ce51c40551674318341781331 | [
"Apache-2.0"
] | null | null | null | test/distribution/test_distribution_inference.py | Happiness20/gluon-ts | e14ad69058e58e1ce51c40551674318341781331 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 31.797192 | 112 | 0.647385 |
from typing import Iterable, List, Tuple
import mxnet as mx
import numpy as np
import pytest
from pydantic import PositiveFloat, PositiveInt
from gluonts.model.common import NPArrayLike
from gluonts.distribution.box_cox_tranform import (
InverseBoxCoxTransform,
InverseBoxCoxTransformOutput,
)
... | true | true |
f701bd47787bb3e9effa1e72e02589a4fb89873b | 69,852 | py | Python | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/image/nitf.py | Mikevin/hobbits | 0a99aa97a34abe06a8c0542acd5c96e1a7078ec4 | [
"MIT"
] | null | null | null | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/image/nitf.py | Mikevin/hobbits | 0a99aa97a34abe06a8c0542acd5c96e1a7078ec4 | [
"MIT"
] | null | null | null | src/hobbits-plugins/analyzers/KaitaiStruct/ksy_py/image/nitf.py | Mikevin/hobbits | 0a99aa97a34abe06a8c0542acd5c96e1a7078ec4 | [
"MIT"
] | null | null | null | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
import collections
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
raise E... | 58.69916 | 811 | 0.607055 |
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
import collections
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kai... | true | true |
f701be017cb6068bb7180d6b49d93e3d329c70f9 | 5,741 | py | Python | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_valid_minnesota_zip.py | mmi333/great_expectations | cc9df78596610002c24e2d46f737179e04f31d29 | [
"Apache-2.0"
] | 1 | 2022-03-17T08:05:44.000Z | 2022-03-17T08:05:44.000Z | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_valid_minnesota_zip.py | Tchibo/great_expectations | 27220336190039148ab91138cb2fd489d2159183 | [
"Apache-2.0"
] | null | null | null | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_valid_minnesota_zip.py | Tchibo/great_expectations | 27220336190039148ab91138cb2fd489d2159183 | [
"Apache-2.0"
] | null | null | null | import json
from typing import Optional
import zipcodes
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.exceptions import InvalidExpectationConfigurationError
from great_expectations.execution_engine import (
PandasExecutionEngine,
SparkD... | 39.593103 | 116 | 0.643964 | import json
from typing import Optional
import zipcodes
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.exceptions import InvalidExpectationConfigurationError
from great_expectations.execution_engine import (
PandasExecutionEngine,
SparkD... | true | true |
f701bed5f06cf5ca6d955a109586871d6cfe103f | 817 | py | Python | setup.py | jdurgin/radosgw-agent | 8f304e58fd24430990f43b1dde788e393e30e4ab | [
"MIT"
] | null | null | null | setup.py | jdurgin/radosgw-agent | 8f304e58fd24430990f43b1dde788e393e30e4ab | [
"MIT"
] | null | null | null | setup.py | jdurgin/radosgw-agent | 8f304e58fd24430990f43b1dde788e393e30e4ab | [
"MIT"
] | null | null | null | #!/usr/bin/python
from setuptools import setup, find_packages
import sys
install_requires = []
pyversion = sys.version_info[:2]
if pyversion < (2, 7) or (3, 0) <= pyversion <= (3, 1):
install_requires.append('argparse')
setup(
name='radosgw-agent',
version='1.0',
packages=find_packages(),
author... | 23.342857 | 70 | 0.615667 |
from setuptools import setup, find_packages
import sys
install_requires = []
pyversion = sys.version_info[:2]
if pyversion < (2, 7) or (3, 0) <= pyversion <= (3, 1):
install_requires.append('argparse')
setup(
name='radosgw-agent',
version='1.0',
packages=find_packages(),
author='Josh Durgin',
... | true | true |
f701bee115cbe92b692ea9957fcaa3b7e8eabfd0 | 806 | py | Python | app/api/core.py | Aneureka/njuapi | f45f703e20451f12d0900c5c38b93cdd6e9b672c | [
"MIT"
] | 6 | 2017-09-16T13:50:28.000Z | 2019-10-24T03:06:49.000Z | app/api/core.py | Aneureka/njuapi | f45f703e20451f12d0900c5c38b93cdd6e9b672c | [
"MIT"
] | null | null | null | app/api/core.py | Aneureka/njuapi | f45f703e20451f12d0900c5c38b93cdd6e9b672c | [
"MIT"
] | 1 | 2017-09-16T13:58:35.000Z | 2017-09-16T13:58:35.000Z | from flask import Blueprint, request
from app.spiders.core import *
from app.utils import build_result
from app.constants import code
core = Blueprint('core', __name__)
@core.route('/login', methods=['POST'])
def login():
data = request.form
username = data.get('username')
password = data.get('password'... | 23.028571 | 53 | 0.708437 | from flask import Blueprint, request
from app.spiders.core import *
from app.utils import build_result
from app.constants import code
core = Blueprint('core', __name__)
@core.route('/login', methods=['POST'])
def login():
data = request.form
username = data.get('username')
password = data.get('password'... | true | true |
f701c2d3525f9a249070c919385a3b355d9997f5 | 2,386 | py | Python | venv/Scripts/pygal_gen.py | adityasagam/azurePy | bf6c61c1d6f52521602bae2ab3f06ffba4e30444 | [
"MIT"
] | null | null | null | venv/Scripts/pygal_gen.py | adityasagam/azurePy | bf6c61c1d6f52521602bae2ab3f06ffba4e30444 | [
"MIT"
] | null | null | null | venv/Scripts/pygal_gen.py | adityasagam/azurePy | bf6c61c1d6f52521602bae2ab3f06ffba4e30444 | [
"MIT"
] | null | null | null | #!C:\Users\Aditya\PycharmProjects\python-docs-azure-app\venv\Scripts\python.exe
# -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2016 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser Gener... | 34.57971 | 79 | 0.657167 |
import argparse
import pygal
parser = argparse.ArgumentParser(
description='Generate pygal chart in command line',
prog='pygal_gen')
parser.add_argument('-t', '--type', dest='type', default='Line',
choices=map(lambda x: x.__name__, pygal.CHARTS),
hel... | true | true |
f701c3fa430078a4a4c6025fa8ea7d47ced68f14 | 1,911 | py | Python | pylibui/libui/combobox.py | superzazu/pylibui | 2e74db787bfea533f3ae465670963daedcaec344 | [
"MIT"
] | 222 | 2016-05-20T19:12:05.000Z | 2022-03-09T14:59:48.000Z | pylibui/libui/combobox.py | superzazu/pylibui | 2e74db787bfea533f3ae465670963daedcaec344 | [
"MIT"
] | 66 | 2016-05-29T00:11:53.000Z | 2018-10-14T20:01:38.000Z | pylibui/libui/combobox.py | superzazu/pylibui | 2e74db787bfea533f3ae465670963daedcaec344 | [
"MIT"
] | 32 | 2016-06-03T07:08:29.000Z | 2021-05-12T07:41:41.000Z | """
Python wrapper for libui.
"""
import ctypes
from . import clibui
class uiCombobox(ctypes.Structure):
"""Wrapper for the uiCombobox C struct."""
pass
def uiComboboxPointer(obj):
"""
Casts an object to uiCombobox pointer type.
:param obj: a generic object
:return: uiCombobox
"""
... | 20.115789 | 95 | 0.679749 |
import ctypes
from . import clibui
class uiCombobox(ctypes.Structure):
pass
def uiComboboxPointer(obj):
return ctypes.cast(obj, ctypes.POINTER(uiCombobox))
def uiComboboxAppend(combobox, text):
clibui.uiComboboxAppend(combobox, bytes(text, 'utf-8'))
def uiComboboxSelected(combobox):
retur... | true | true |
f701c4842e2415839a30e2f078a2fcdf68f16ab3 | 1,773 | py | Python | pre-process.py | nicoperetti/metadata-sadosky-santander | a0d686ba8dfa6c3929727248fc52d802d74f4c45 | [
"MIT"
] | null | null | null | pre-process.py | nicoperetti/metadata-sadosky-santander | a0d686ba8dfa6c3929727248fc52d802d74f4c45 | [
"MIT"
] | null | null | null | pre-process.py | nicoperetti/metadata-sadosky-santander | a0d686ba8dfa6c3929727248fc52d802d74f4c45 | [
"MIT"
] | null | null | null | import click
import pandas as pd
# Due textacy problems
try:
from textacy.preprocess import preprocess_text
except Exception:
from textacy.preprocess import preprocess_text
def preprocess_f(text, fix_unicode=True, lowercase=True,
no_urls=True, no_emails=True,
no_phone_numbers... | 33.45283 | 76 | 0.605189 | import click
import pandas as pd
try:
from textacy.preprocess import preprocess_text
except Exception:
from textacy.preprocess import preprocess_text
def preprocess_f(text, fix_unicode=True, lowercase=True,
no_urls=True, no_emails=True,
no_phone_numbers=True,
... | true | true |
f701c4c31af1aa206d2ecb2f6f56d4723ce57c34 | 4,477 | py | Python | core/action/list.py | caostorm/smng | f1cff4010a0645ae8e1182cd3c961d97cecf4a6e | [
"MIT"
] | null | null | null | core/action/list.py | caostorm/smng | f1cff4010a0645ae8e1182cd3c961d97cecf4a6e | [
"MIT"
] | null | null | null | core/action/list.py | caostorm/smng | f1cff4010a0645ae8e1182cd3c961d97cecf4a6e | [
"MIT"
] | 1 | 2019-06-26T13:05:45.000Z | 2019-06-26T13:05:45.000Z | #coding=utf-8
import sys
import getopt
from core.interface.action import server_action
from core.helper.usage import usage_helper
from prettytable import PrettyTable
from core.helper.parser import config_parser
import re
class action_list(server_action):
# 参数列表示例,可以在这边增加参数描述,最终代码将根据argname生成对对应的参数
_parameters ... | 34.438462 | 93 | 0.53786 |
import sys
import getopt
from core.interface.action import server_action
from core.helper.usage import usage_helper
from prettytable import PrettyTable
from core.helper.parser import config_parser
import re
class action_list(server_action):
_parameters = [
{"name":"h", "needarg":False, "desc":"显示这条帮助... | true | true |
f701c4c68ea3dc6f108a4fb7a2d844def96a3dd3 | 50,706 | py | Python | cinder/volume/flows/manager/create_volume.py | netsec/cinder | 435b2300149bece70dd2f42f05d1b5d0f0eb9aa6 | [
"Apache-2.0"
] | null | null | null | cinder/volume/flows/manager/create_volume.py | netsec/cinder | 435b2300149bece70dd2f42f05d1b5d0f0eb9aa6 | [
"Apache-2.0"
] | null | null | null | cinder/volume/flows/manager/create_volume.py | netsec/cinder | 435b2300149bece70dd2f42f05d1b5d0f0eb9aa6 | [
"Apache-2.0"
] | null | null | null | # 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, software
# d... | 45.598921 | 79 | 0.568789 |
import traceback
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import fileutils
from oslo_utils import timeutils
import taskflow.engines
from taskflow.patterns import linear_flow
from taskflow.types import failure as ft
from cinder import b... | true | true |
f701c5f7e8e6742e853467d6e7e8f7bc7fc593a7 | 625 | py | Python | pyEdda/test_uni_gaussian.py | GRAVITYLab/edda | 2acd00373db1003922db9f5959644e7506de5726 | [
"MIT"
] | 3 | 2016-01-15T20:17:21.000Z | 2021-01-21T02:32:15.000Z | pyEdda/test_uni_gaussian.py | GRAVITYLab/edda | 2acd00373db1003922db9f5959644e7506de5726 | [
"MIT"
] | 11 | 2016-07-26T01:37:46.000Z | 2018-06-19T16:50:25.000Z | pyEdda/test_uni_gaussian.py | GRAVITYLab/edda | 2acd00373db1003922db9f5959644e7506de5726 | [
"MIT"
] | 12 | 2016-02-09T04:31:41.000Z | 2021-12-03T01:04:04.000Z | #make print in python 2, 3 compatible
from __future__ import print_function
import numpy as np
import pyedda as edda
#Univariate Gaussian
print("//////////Univariate Gaussian///////")
dummy_data = np.random.rand(100)
gaussian = edda.Gaussian(100, 20)
print("gaussian.getMean():", gaussian.getMean())
print("gaussian.g... | 31.25 | 63 | 0.736 |
from __future__ import print_function
import numpy as np
import pyedda as edda
print("//////////Univariate Gaussian///////")
dummy_data = np.random.rand(100)
gaussian = edda.Gaussian(100, 20)
print("gaussian.getMean():", gaussian.getMean())
print("gaussian.getVar():", gaussian.getVar())
print("gaussian.getPdf(105)... | true | true |
f701c606e9f0cf64783a10a36270e8694918d0e6 | 1,910 | py | Python | src/contact/schema.py | mesherinovivan/graphql-django | 732fb284fd3b1ad9270b1539e1d7b53c80bb4cdf | [
"MIT"
] | null | null | null | src/contact/schema.py | mesherinovivan/graphql-django | 732fb284fd3b1ad9270b1539e1d7b53c80bb4cdf | [
"MIT"
] | null | null | null | src/contact/schema.py | mesherinovivan/graphql-django | 732fb284fd3b1ad9270b1539e1d7b53c80bb4cdf | [
"MIT"
] | null | null | null | import graphene
from graphene import Node
from graphene_django.filter import DjangoFilterConnectionField
from graphene_django.rest_framework.mutation import SerializerMutation
from graphene_django.types import DjangoObjectType
from rest_framework.generics import get_object_or_404
from contact.models import Contact
fro... | 27.681159 | 70 | 0.731937 | import graphene
from graphene import Node
from graphene_django.filter import DjangoFilterConnectionField
from graphene_django.rest_framework.mutation import SerializerMutation
from graphene_django.types import DjangoObjectType
from rest_framework.generics import get_object_or_404
from contact.models import Contact
fro... | true | true |
f701c6373cd2ec48e39c87c6d61a464dbb1a4fda | 8,277 | py | Python | upyutils/uping.py | Naohiro2g/upydev | a07d5966fc4cd132bdc769a73ccd3b2476a0a2bf | [
"MIT"
] | 36 | 2019-08-14T15:59:44.000Z | 2022-01-17T17:33:47.000Z | upyutils/uping.py | Naohiro2g/upydev | a07d5966fc4cd132bdc769a73ccd3b2476a0a2bf | [
"MIT"
] | 21 | 2019-08-15T06:11:38.000Z | 2021-01-30T22:05:24.000Z | upyutils/uping.py | Naohiro2g/upydev | a07d5966fc4cd132bdc769a73ccd3b2476a0a2bf | [
"MIT"
] | 3 | 2020-05-01T22:32:34.000Z | 2021-01-30T20:16:19.000Z | # µPing (MicroPing) for MicroPython
# copyright (c) 2018 Shawwwn <shawwwn1@gmail.com>
# License: MIT
# Internet Checksum Algorithm
# Author: Olav Morken
# https://github.com/olavmrk/python-ping/blob/master/ping.py
# @data: bytes
# ping statistics, loop mode and KeyboardInterrupt handler, + esp8266 compatible
# copyri... | 37.116592 | 170 | 0.423342 |
def checksum(data):
if len(data) & 0x1:
data += b'\0'
cs = 0
for pos in range(0, len(data), 2):
b1 = data[pos]
b2 = data[pos + 1]
cs += (b1 << 8) + b2
while cs >= 0x10000:
cs = (cs & 0xffff) + (cs >> 16)
cs = ~cs & 0xffff
return cs
def st... | true | true |
f701c6c64208dfe1a447075a36f01d47f9da0f28 | 531 | py | Python | venv/Lib/site-packages/celery/tests/concurrency/test_solo.py | Verckolf/MyInterfaceTest | e05674bd673a6a43cfb33f7cb4318886ba92a05c | [
"MIT"
] | 39 | 2016-12-05T14:36:37.000Z | 2021-07-29T18:22:34.000Z | microblog/flask/venv/lib/python2.7/site-packages/celery/tests/concurrency/test_solo.py | johankaito/fufuka | 32a96ecf98ce305c2206c38443e58fdec88c788d | [
"Apache-2.0"
] | 68 | 2016-12-12T20:38:47.000Z | 2020-07-26T18:28:49.000Z | microblog/flask/venv/lib/python2.7/site-packages/celery/tests/concurrency/test_solo.py | johankaito/fufuka | 32a96ecf98ce305c2206c38443e58fdec88c788d | [
"Apache-2.0"
] | 120 | 2016-08-18T14:53:03.000Z | 2020-06-16T13:27:20.000Z | from __future__ import absolute_import
import operator
from celery.concurrency import solo
from celery.utils.functional import noop
from celery.tests.case import AppCase
class test_solo_TaskPool(AppCase):
def test_on_start(self):
x = solo.TaskPool()
x.on_start()
def test_on_apply(self):
... | 21.24 | 56 | 0.655367 | from __future__ import absolute_import
import operator
from celery.concurrency import solo
from celery.utils.functional import noop
from celery.tests.case import AppCase
class test_solo_TaskPool(AppCase):
def test_on_start(self):
x = solo.TaskPool()
x.on_start()
def test_on_apply(self):
... | true | true |
f701c6f320981fb5b4389ff053785d02cd02a20e | 6,513 | py | Python | hybrid/opensubtitle/hyb/bid/type1/len2/hybrid_len2_t1_predict.py | 1130310223/Static-Dynamic-Attention | 1da223b06ae41f14575960e247fb13506ed8a124 | [
"MIT"
] | 1 | 2020-04-16T08:42:38.000Z | 2020-04-16T08:42:38.000Z | hybrid/opensubtitle/hyb/bid/type1/len2/hybrid_len2_t1_predict.py | 1130310223/Static-Dynamic-Attention | 1da223b06ae41f14575960e247fb13506ed8a124 | [
"MIT"
] | null | null | null | hybrid/opensubtitle/hyb/bid/type1/len2/hybrid_len2_t1_predict.py | 1130310223/Static-Dynamic-Attention | 1da223b06ae41f14575960e247fb13506ed8a124 | [
"MIT"
] | 1 | 2020-04-16T08:41:53.000Z | 2020-04-16T08:41:53.000Z | #-*- coding: utf-8 -*-
import sys
import os
import random
import re
import time
import torch
from torch.autograd import Variable
from torch import optim
import torch.nn as nn
#sys.path.append('../')
from hybrid_bid_t1_model import Seq2Seq
from hybrid_data_utils import *
sub = '-'*20
def init_command_l... | 35.016129 | 120 | 0.729464 |
import sys
import os
import random
import re
import time
import torch
from torch.autograd import Variable
from torch import optim
import torch.nn as nn
from hybrid_bid_t1_model import Seq2Seq
from hybrid_data_utils import *
sub = '-'*20
def init_command_line(argv):
from argparse import ArgumentParse... | true | true |
f701c8a0e57e7bfda97acfc93d52ee215f8b23f6 | 3,259 | py | Python | frameworks/shared/callee.py | aligapaul/automlbenchmark | 97c1ef8f7529f9814c5228ae0ff91d4055223d50 | [
"MIT"
] | 2 | 2020-12-06T22:09:12.000Z | 2022-02-09T00:02:29.000Z | frameworks/shared/callee.py | automl/automlbenchmark | 59e796fe6632637233a7104dfffe65f210f9eef5 | [
"MIT"
] | null | null | null | frameworks/shared/callee.py | automl/automlbenchmark | 59e796fe6632637233a7104dfffe65f210f9eef5 | [
"MIT"
] | null | null | null | import json
import logging
import os
import re
import sys
import time
def setup_logger():
console = logging.StreamHandler(sys.stdout)
handlers = [console]
logging.basicConfig(handlers=handlers)
root = logging.getLogger()
root.setLevel(logging.INFO)
setup_logger()
log = logging.getLogger(__name_... | 23.963235 | 84 | 0.572261 | import json
import logging
import os
import re
import sys
import time
def setup_logger():
console = logging.StreamHandler(sys.stdout)
handlers = [console]
logging.basicConfig(handlers=handlers)
root = logging.getLogger()
root.setLevel(logging.INFO)
setup_logger()
log = logging.getLogger(__name_... | true | true |
f701c8ad9ef2bfd1a87e7c7045808347a887c250 | 1,225 | py | Python | feature_extract/label_clean_data.py | bradysalz/MinVAD | 4d4a396b381bbb4714b434f60e09fb2fa7d3c474 | [
"MIT"
] | null | null | null | feature_extract/label_clean_data.py | bradysalz/MinVAD | 4d4a396b381bbb4714b434f60e09fb2fa7d3c474 | [
"MIT"
] | 2 | 2016-12-09T21:16:28.000Z | 2016-12-09T21:29:10.000Z | feature_extract/label_clean_data.py | bradysalz/MinVAD | 4d4a396b381bbb4714b434f60e09fb2fa7d3c474 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Goes through the clean dataset and determines when audio is occuring by
measuring across a simple threshold
We use these labels for the 15, 10 5, 0dB SNR samples
Created on Sun Dec 4 15:37:11 2016
@author: brady
"""
import os
import wavio
from fe_utils import *
from config import TRAI... | 25 | 72 | 0.606531 |
import os
import wavio
from fe_utils import *
from config import TRAIN_CLEAN
os.chdir(TRAIN_CLEAN)
for file in os.listdir():
if not file.endswith('.wav'):
continue
mWav = wavio.read(file)
frame_len = int(getFrameSize(mWav.rate))
mWav.data = normalizeAudio(mWav.data, mWav.sampwidth... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.