hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9a7956d0b3e6e8a3a0914f423ea223c7608b6bc6 | 32,193 | py | Python | provision/env/lib/python3.6/site-packages/ansible/modules/cloud/vmware/vmware_guest_disk.py | brightkan/tukole-frontend | 45e1d82a4ae5a65e88e7434f67d4d1a88f462e96 | [
"MIT"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/cloud/vmware/vmware_guest_disk.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/cloud/vmware/vmware_guest_disk.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2019-03-20T13:25:24.000Z | 2019-03-20T13:25:24.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | 48.556561 | 137 | 0.564377 |
d9b008987634f5198d8506e8d19bd07031509dff | 63,953 | py | Python | web/app/lib/dist/werkzeug/wrappers.py | geary/claslite | 83c49cf98eceae633034b82d35ed7991d943b857 | [
"Unlicense"
] | 5 | 2018-05-28T08:02:11.000Z | 2022-01-22T11:34:08.000Z | permit/lib/dist/werkzeug/wrappers.py | stanlee321/pysolper | 5fa7a5424281ddac2957821b6e1cdc42a0931387 | [
"Apache-2.0"
] | null | null | null | permit/lib/dist/werkzeug/wrappers.py | stanlee321/pysolper | 5fa7a5424281ddac2957821b6e1cdc42a0931387 | [
"Apache-2.0"
] | 3 | 2016-01-18T09:37:14.000Z | 2020-07-10T10:57:56.000Z | # -*- coding: utf-8 -*-
"""
werkzeug.wrappers
~~~~~~~~~~~~~~~~~
The wrappers are simple request and response objects which you can
subclass to do whatever you want them to do. The request object contains
the information transmitted by the client (webbrowser) and the response
object contains al... | 42.749332 | 83 | 0.645755 |
ed3cd7f168dae552bf62ca500dd95c9eabe4c8e8 | 14,927 | py | Python | tf_agents/train/ppo_learner.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | 3,175 | 2017-09-08T18:28:32.000Z | 2022-03-31T01:32:22.000Z | tf_agents/train/ppo_learner.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | 703 | 2017-09-18T05:51:57.000Z | 2022-03-31T17:37:50.000Z | tf_agents/train/ppo_learner.py | Francis777/agents | 24e878a697be418307cfbff69724d86be767719d | [
"Apache-2.0"
] | 844 | 2017-09-08T23:28:57.000Z | 2022-03-30T09:29:32.000Z | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 45.096677 | 80 | 0.708783 |
fbdf4a1cfd1ac0a23ac0853271042e0a5a090385 | 6,363 | py | Python | python/paddle/fluid/tests/unittests/test_group_norm_op_v2.py | heliqi/Paddle | feb0ed1b912b66de55c30d8af1ccc61cc1fdf59b | [
"Apache-2.0"
] | 1 | 2021-09-03T14:11:48.000Z | 2021-09-03T14:11:48.000Z | python/paddle/fluid/tests/unittests/test_group_norm_op_v2.py | glisca/Paddle | 266fcbe0aed3e566c167ea8de5114f62c428c013 | [
"Apache-2.0"
] | 9 | 2021-08-03T11:39:03.000Z | 2021-09-16T08:03:58.000Z | python/paddle/fluid/tests/unittests/test_group_norm_op_v2.py | glisca/Paddle | 266fcbe0aed3e566c167ea8de5114f62c428c013 | [
"Apache-2.0"
] | 1 | 2021-07-15T09:23:23.000Z | 2021-07-15T09:23:23.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 40.528662 | 80 | 0.557284 |
bd8dbd5f7b53630440a7222a7b66d88efdd60181 | 2,958 | py | Python | caffe2/python/operator_test/sparse_normalize_test.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 40 | 2021-06-01T07:37:59.000Z | 2022-03-25T01:42:09.000Z | caffe2/python/operator_test/sparse_normalize_test.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 14 | 2021-06-01T11:52:46.000Z | 2022-03-25T02:13:08.000Z | caffe2/python/operator_test/sparse_normalize_test.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 7 | 2021-07-20T19:34:26.000Z | 2022-03-13T21:07:36.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import hypothesis
from hypothesis import given, settings, HealthCheck
import hypothesis.strategies as st
import numpy as np
from caffe2.python import core
import caffe2.... | 33.235955 | 79 | 0.593306 |
6bc941c51d290f79b67d2880c5016c5dcd4ebd0c | 1,029 | py | Python | tests/bugs/gh_3886_test.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2022-02-05T11:37:13.000Z | 2022-02-05T11:37:13.000Z | tests/bugs/gh_3886_test.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-09-03T11:47:00.000Z | 2021-09-03T12:42:10.000Z | tests/bugs/gh_3886_test.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-06-30T14:14:16.000Z | 2021-06-30T14:14:16.000Z | #coding:utf-8
#
# id: bugs.gh_3886
# title: recreate table T with PK or UK is impossible after duplicate typing w/o commit when ISQL is launched in AUTODDL=OFF mode [CORE3529]
# decription:
# https://github.com/FirebirdSQL/firebird/issues/3886
#
# C... | 23.930233 | 147 | 0.621963 |
176e6fcb8bf361ed3f48452bcc94651adb476215 | 718 | py | Python | src/abaqus/Sketcher/ConstrainedSketchVertex/Spot.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | 7 | 2022-01-21T09:15:45.000Z | 2022-02-15T09:31:58.000Z | src/abaqus/Sketcher/ConstrainedSketchVertex/Spot.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | src/abaqus/Sketcher/ConstrainedSketchVertex/Spot.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | from .ConstrainedSketchVertex import ConstrainedSketchVertex
class Spot(ConstrainedSketchVertex):
def __init__(self, point: tuple[float]):
"""This method creates a spot (construction point) located at the specified coordinates.
Notes
-----
This function can be accessed by:
... | 26.592593 | 96 | 0.568245 |
520f8756b84359cebb69699864b5c50b00d2df88 | 1,973 | py | Python | modules/neighbour_covariance_op.py | shahrukhqasim/HGCalML | 2808564b31c89d9b7eb882734f6aebc6f35e94f3 | [
"BSD-3-Clause"
] | null | null | null | modules/neighbour_covariance_op.py | shahrukhqasim/HGCalML | 2808564b31c89d9b7eb882734f6aebc6f35e94f3 | [
"BSD-3-Clause"
] | null | null | null | modules/neighbour_covariance_op.py | shahrukhqasim/HGCalML | 2808564b31c89d9b7eb882734f6aebc6f35e94f3 | [
"BSD-3-Clause"
] | null | null | null |
import tensorflow as tf
from tensorflow.python.framework import ops
from accknn_op import AccumulateKnn
def NeighbourCovariance(coordinates, distsq, features, n_idxs):
'''
expands to V x F x C**2, but not in the neighbour dimension
Feed features without activation!
'''
fea... | 31.31746 | 81 | 0.642169 |
0201a0e6f702c4b69115df86d34b36e2ce7f3b47 | 38,892 | py | Python | debug_prints.py | mit-ll/gds2-score | b7a0682c2994c39fdda01694aa38c4bf18aa6f5b | [
"BSD-2-Clause"
] | 8 | 2019-05-24T22:46:18.000Z | 2022-01-18T06:56:10.000Z | debug_prints.py | mit-ll/gds2-score | b7a0682c2994c39fdda01694aa38c4bf18aa6f5b | [
"BSD-2-Clause"
] | null | null | null | debug_prints.py | mit-ll/gds2-score | b7a0682c2994c39fdda01694aa38c4bf18aa6f5b | [
"BSD-2-Clause"
] | 3 | 2020-12-11T09:10:57.000Z | 2022-01-24T09:18:12.000Z | # Import GDSII Library
from gdsii.library import Library
from gdsii.elements import *
# Import matplotlib
# import matplotlib.pyplot as plt
# Import custom modules
from polygon import *
from trigger_space import *
# Other Imports
import time
import pprint
import copy
import numpy
import sys
def debug_print_lib_obj(... | 28.534116 | 130 | 0.683508 |
f006258c185099d14e9bebc75f9c286027fd3194 | 1,924 | py | Python | emtf_nnet/keras/callbacks.py | jiafulow/emtf-nnet | 70a6c747c221178f9db940197ea886bdb60bf3ba | [
"Apache-2.0"
] | null | null | null | emtf_nnet/keras/callbacks.py | jiafulow/emtf-nnet | 70a6c747c221178f9db940197ea886bdb60bf3ba | [
"Apache-2.0"
] | null | null | null | emtf_nnet/keras/callbacks.py | jiafulow/emtf-nnet | 70a6c747c221178f9db940197ea886bdb60bf3ba | [
"Apache-2.0"
] | null | null | null | # The following source code was originally obtained from:
# https://github.com/keras-team/keras/blob/r2.6/keras/callbacks.py#L1899-L1962
# ==============================================================================
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, ... | 40.93617 | 82 | 0.68763 |
bdb14b218b15bd58887fc8086b9edb6a4f3b5ac3 | 8,867 | py | Python | apps/volontulo/views/__init__.py | fredfalcon/owasp-volunteer-portal | 9b90455deb7817e0b537a39b43533e384ce51a6f | [
"MIT"
] | 4 | 2018-05-19T23:34:08.000Z | 2022-03-31T23:26:41.000Z | apps/volontulo/views/__init__.py | fredfalcon/owasp-volunteer-portal | 9b90455deb7817e0b537a39b43533e384ce51a6f | [
"MIT"
] | null | null | null | apps/volontulo/views/__init__.py | fredfalcon/owasp-volunteer-portal | 9b90455deb7817e0b537a39b43533e384ce51a6f | [
"MIT"
] | 1 | 2021-01-28T12:12:28.000Z | 2021-01-28T12:12:28.000Z | # -*- coding: utf-8 -*-
u"""
.. module:: __init__
"""
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import Http404
from django.shortcuts import redirect
from django.shortcuts im... | 30.159864 | 78 | 0.607421 |
5f157f50b77b9a3ad4cc1a44fe3a26b821f57d40 | 34 | py | Python | Practice/Practice/Leetcode/Python/Hello.py | kushalbhola/MyStuff | 3f1064866487e489af41f8662a875b9954d5d8b0 | [
"Apache-2.0"
] | null | null | null | Practice/Practice/Leetcode/Python/Hello.py | kushalbhola/MyStuff | 3f1064866487e489af41f8662a875b9954d5d8b0 | [
"Apache-2.0"
] | 1 | 2020-04-29T23:00:26.000Z | 2020-04-29T23:00:26.000Z | Practice/Practice/Leetcode/Python/Hello.py | kushalbhola/MyStuff | 3f1064866487e489af41f8662a875b9954d5d8b0 | [
"Apache-2.0"
] | null | null | null | msg = "Hello World"
print (msg)
| 6.8 | 19 | 0.617647 |
dee75c151906fa9233662be277c11a7cda0a0686 | 586 | py | Python | jp.atcoder/abc161/abc161_f/11548410.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc161/abc161_f/11548410.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc161/abc161_f/11548410.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
from math import floor, sqrt
def divisors(n):
res = set()
for i in range(1, floor(sqrt(n)) + 1):
if n % i == 0:
res.add(i)
res.add(n // i)
return res
n = int(sys.stdin.readline().rstrip())
def main():
res = divisors(n - 1)
cnt = len(res)... | 20.206897 | 43 | 0.426621 |
e7653fcb832d5edfc7e392627b9edf877e05f9f5 | 607 | py | Python | thread_graph_construction_demo.py | xiaohan2012/lst | 793944d1dd8235adbe2f651270ab12e46ff8f6f7 | [
"MIT"
] | 1 | 2016-07-05T13:10:27.000Z | 2016-07-05T13:10:27.000Z | thread_graph_construction_demo.py | xiaohan2012/lst | 793944d1dd8235adbe2f651270ab12e46ff8f6f7 | [
"MIT"
] | null | null | null | thread_graph_construction_demo.py | xiaohan2012/lst | 793944d1dd8235adbe2f651270ab12e46ff8f6f7 | [
"MIT"
] | null | null | null | import networkx as nx
a, b, c = 'a', 'b', 'c'
# high density graph
g1 = nx.DiGraph()
g1.add_edges_from([(a, 1), (1, b), (1, c),
(b, 2), (2, a), (2, c),
(c, 3), (3, b), (3, a)])
print(nx.pagerank(g1))
# medium density graph
g2 = nx.DiGraph()
g2.add_edges_from([(a, 1), (1, b),
... | 20.233333 | 43 | 0.410214 |
549b275fa0613f8771997249c934d89ced1fe5d5 | 2,610 | py | Python | gui/qt/address_dialog.py | Anfauglith/fermatum | 0cd0a612d70a5fd8936404594f0f83328cf9406d | [
"MIT"
] | null | null | null | gui/qt/address_dialog.py | Anfauglith/fermatum | 0cd0a612d70a5fd8936404594f0f83328cf9406d | [
"MIT"
] | null | null | null | gui/qt/address_dialog.py | Anfauglith/fermatum | 0cd0a612d70a5fd8936404594f0f83328cf9406d | [
"MIT"
] | 1 | 2018-03-06T17:25:55.000Z | 2018-03-06T17:25:55.000Z | #!/usr/bin/env python
#
# Fermatum - lightweight IoP client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without l... | 34.342105 | 83 | 0.699234 |
bafdb74c576b0f9edaa5f5604a83895748a24540 | 1,000 | py | Python | generator/group.py | anastas11a/python_training | 1daceddb193d92542f7f7313026a7e67af4d89bb | [
"Apache-2.0"
] | null | null | null | generator/group.py | anastas11a/python_training | 1daceddb193d92542f7f7313026a7e67af4d89bb | [
"Apache-2.0"
] | null | null | null | generator/group.py | anastas11a/python_training | 1daceddb193d92542f7f7313026a7e67af4d89bb | [
"Apache-2.0"
] | null | null | null | from model.group import Group
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 2
f = "data/groups.json"
for o, a in opt... | 27.027027 | 113 | 0.655 |
258aca113db4759270f2047d3294e88ef5498306 | 102 | py | Python | 25/02/hasattr.py | pylangstudy/201707 | c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6 | [
"CC0-1.0"
] | null | null | null | 25/02/hasattr.py | pylangstudy/201707 | c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6 | [
"CC0-1.0"
] | 46 | 2017-06-30T22:19:07.000Z | 2017-07-31T22:51:31.000Z | 25/02/hasattr.py | pylangstudy/201707 | c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6 | [
"CC0-1.0"
] | null | null | null | #hasattr(object, name)
class C:
def A(self): pass
print(hasattr(C, 'A'))
print(hasattr(C, 'B'))
| 12.75 | 22 | 0.617647 |
7afed8f4f2d6f674ee083de5bb0ce9a7a3e92e44 | 966 | py | Python | setup.py | appukuttan-shailesh/eFELunit | 055385254875249293da72c1daf2d489033cb9da | [
"BSD-3-Clause"
] | null | null | null | setup.py | appukuttan-shailesh/eFELunit | 055385254875249293da72c1daf2d489033cb9da | [
"BSD-3-Clause"
] | null | null | null | setup.py | appukuttan-shailesh/eFELunit | 055385254875249293da72c1daf2d489033cb9da | [
"BSD-3-Clause"
] | null | null | null | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='eFELunit',
version='1.1.5',
author='Shailesh Appukuttan, Andrew Davison',
author_email='shailesh.appukuttan@unic.cnrs-gif.fr, andrew.davison@unic.cnrs-gif.fr',
packages=['eFELunit',
... | 38.64 | 95 | 0.652174 |
cbf5e518678de77888c77de7f4b364215572fa7d | 3,692 | py | Python | wrapper/StyleGanWrapper.py | sr-cafe/stylegan2-ada | 3387925b52fd0cc23846fc3b2f89d7c19174b903 | [
"BSD-Source-Code"
] | null | null | null | wrapper/StyleGanWrapper.py | sr-cafe/stylegan2-ada | 3387925b52fd0cc23846fc3b2f89d7c19174b903 | [
"BSD-Source-Code"
] | null | null | null | wrapper/StyleGanWrapper.py | sr-cafe/stylegan2-ada | 3387925b52fd0cc23846fc3b2f89d7c19174b903 | [
"BSD-Source-Code"
] | null | null | null | import numpy as np
import dnnlib
import dnnlib.tflib as tflib
import pickle
from .GeneratedImage import GeneratedImage
from .Latent import Latent
from .NetworkLoader import NetworkLoader
class StyleGanWrapper:
@staticmethod
def expand_seed(seed, z_space_dims=512):
rnd = np.random.RandomState(seed)
return (rnd.r... | 29.536 | 112 | 0.739707 |
cb4aab0655d5fa987a058eaaec993fc1292f6315 | 650 | py | Python | mythril/laser/plugin/signals.py | RainOfPhone/mythril | 53886999de82e587ad3782e1b0083a62e83684f7 | [
"MIT"
] | 1 | 2022-02-28T14:35:05.000Z | 2022-02-28T14:35:05.000Z | mythril/laser/plugin/signals.py | RainOfPhone/mythril | 53886999de82e587ad3782e1b0083a62e83684f7 | [
"MIT"
] | null | null | null | mythril/laser/plugin/signals.py | RainOfPhone/mythril | 53886999de82e587ad3782e1b0083a62e83684f7 | [
"MIT"
] | 1 | 2022-01-10T00:51:07.000Z | 2022-01-10T00:51:07.000Z | class PluginSignal(Exception):
"""Base plugin signal
These signals are used by the laser plugins to create intent for certain actions in the symbolic virtual machine
"""
pass
class PluginSkipWorldState(PluginSignal):
"""Plugin to skip world state
Plugins that raise this signal while the add... | 23.214286 | 116 | 0.724615 |
6a77c74e79295c56c42555b7316ce942d4c66bbe | 1,310 | py | Python | raxcli/apps/loadbalancer/commands/protocols/list.py | racker/python-raxcli | c59d7ef9abca0a7cea56882113bd71feb6c5c6ef | [
"Apache-2.0"
] | 1 | 2020-01-16T09:45:28.000Z | 2020-01-16T09:45:28.000Z | raxcli/apps/loadbalancer/commands/protocols/list.py | racker/python-raxcli | c59d7ef9abca0a7cea56882113bd71feb6c5c6ef | [
"Apache-2.0"
] | null | null | null | raxcli/apps/loadbalancer/commands/protocols/list.py | racker/python-raxcli | c59d7ef9abca0a7cea56882113bd71feb6c5c6ef | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Rackspace
#
# 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... | 35.405405 | 74 | 0.755725 |
b5fb8b303031feb3916edf14a96ea9b37a4d5de6 | 1,085 | py | Python | omoide/jobs/downloader/download.py | IgorZyktin/omoide | 4dc92fc52e56963993dc6aa7abef85cea9b164ef | [
"MIT"
] | null | null | null | omoide/jobs/downloader/download.py | IgorZyktin/omoide | 4dc92fc52e56963993dc6aa7abef85cea9b164ef | [
"MIT"
] | 1 | 2022-01-31T18:29:15.000Z | 2022-01-31T18:29:15.000Z | omoide/jobs/downloader/download.py | IgorZyktin/omoide | 4dc92fc52e56963993dc6aa7abef85cea9b164ef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Downloader implementation.
"""
import os
import random
from pathlib import Path
from omoide import utils
from omoide.jobs.downloader import filesystem
from omoide.storage.database.models import Media
def download_single_entry(media: Media, paths: list[Path]) -> None:
"""Perform full do... | 27.820513 | 72 | 0.636866 |
7211ae9c1641bb1c6cac10b69dd3d2bdfbf20cfa | 1,530 | py | Python | src/yolo_preparing.py | vikasg603/Thesis_KSH | c31cf032c8b6a2e977b30c5bc38db63a5e77aeb3 | [
"MIT"
] | 19 | 2020-02-15T16:31:03.000Z | 2022-03-08T20:53:00.000Z | src/yolo_preparing.py | vikasg603/Thesis_KSH | c31cf032c8b6a2e977b30c5bc38db63a5e77aeb3 | [
"MIT"
] | 3 | 2020-02-20T09:49:40.000Z | 2020-09-08T14:26:29.000Z | src/yolo_preparing.py | vikasg603/Thesis_KSH | c31cf032c8b6a2e977b30c5bc38db63a5e77aeb3 | [
"MIT"
] | 8 | 2020-02-19T14:43:33.000Z | 2022-01-17T21:35:55.000Z | """
This file is used to delete the images without labels
(Delete the images without corresponding txt file)
AND THEN
Generate the train.txt and test.txt for YOLO
"""
from os import remove
from os.path import splitext, isfile, join, basename
from glob import iglob
from src.img_utility import read_img_from_dir
'''
Fi... | 24.677419 | 102 | 0.71634 |
0d72b271d6282035f5c33b55df3c60e7534a127d | 3,265 | py | Python | utils_snippets.py | enricoros/vc-analysis-tools | 5137b5202c570d07f20aa25a71a538edff26a5d0 | [
"BSD-3-Clause"
] | null | null | null | utils_snippets.py | enricoros/vc-analysis-tools | 5137b5202c570d07f20aa25a71a538edff26a5d0 | [
"BSD-3-Clause"
] | null | null | null | utils_snippets.py | enricoros/vc-analysis-tools | 5137b5202c570d07f20aa25a71a538edff26a5d0 | [
"BSD-3-Clause"
] | null | null | null | #
# This file only contains misc functions that were tried, but we decided to not use/proceed in that direction.
# Aka: random snippets of code
#
# import heatmap as hmz
# import matplotlib.pyplot as plt
# import seaborn as sns
import tensorflow as tf
import tensorflow_hub as hub
test_sentences = [
'3D Technology,... | 41.858974 | 138 | 0.703216 |
c77eb84d2aa7289b4a5c5ba2233eee2f8879452e | 1,742 | py | Python | WEEKS/CD_Sata-Structures/_MISC/algorithms/graph/traversal.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 11 | 2021-02-18T04:53:44.000Z | 2022-01-16T10:57:39.000Z | WEEKS/CD_Sata-Structures/_MISC/algorithms/graph/traversal.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 162 | 2021-03-09T01:52:11.000Z | 2022-03-12T01:09:07.000Z | WEEKS/CD_Sata-Structures/_MISC/algorithms/graph/traversal.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 8 | 2021-02-18T05:12:34.000Z | 2022-03-06T19:02:14.000Z | graph = {
"A": set(["B", "C", "F"]),
"B": set(["A", "D", "E"]),
"C": set(["A", "F"]),
"D": set(["B"]),
"E": set(["B", "F"]),
"F": set(["A", "C", "E"]),
}
# dfs and bfs are the ultimately same except that they are visiting nodes in
# different order. To simulate this ordering we would use stack ... | 24.194444 | 76 | 0.588404 |
22e81e5712a658641da8ddb1ce1687a89b81a50c | 16,748 | py | Python | fathom/speech/speech.py | Aetf/fathom | 1f0dafa9fe3b7988708522d93ecda7f282cb2090 | [
"Apache-2.0"
] | 1 | 2021-06-30T04:59:22.000Z | 2021-06-30T04:59:22.000Z | fathom/speech/speech.py | Aetf/fathom | 1f0dafa9fe3b7988708522d93ecda7f282cb2090 | [
"Apache-2.0"
] | null | null | null | fathom/speech/speech.py | Aetf/fathom | 1f0dafa9fe3b7988708522d93ecda7f282cb2090 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import, print_function, division
from builtins import range
from datetime import datetime
from timeit import default_timer
from pkg_resources import resource_filename
import numpy as np
import tensorflow as tf
import h5py
import os
import time
import random
from .... | 44.424403 | 114 | 0.599236 |
9816d197b8a1223547372eace30cb2e60094f35d | 1,290 | py | Python | test/pytorch/communication/sync_p2p.py | tingshua-yts/BetterDL | bb17f5d503deb7a844aae984f96c16dc4778a256 | [
"Apache-2.0"
] | null | null | null | test/pytorch/communication/sync_p2p.py | tingshua-yts/BetterDL | bb17f5d503deb7a844aae984f96c16dc4778a256 | [
"Apache-2.0"
] | null | null | null | test/pytorch/communication/sync_p2p.py | tingshua-yts/BetterDL | bb17f5d503deb7a844aae984f96c16dc4778a256 | [
"Apache-2.0"
] | 2 | 2022-03-20T06:57:30.000Z | 2022-03-31T11:38:13.000Z | import os
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
def run(rank_id, size):
tensor = torch.zeros(1)
if rank_id == 0:
tensor += 1
# Send the tensor to process 1
dist.send(tensor=tensor, dst=1)
print('after send, Rank ', rank_id, ' has data '... | 30 | 68 | 0.611628 |
8b137dfef8bb866ff962d672c5c218ceda5d8bda | 14,589 | py | Python | airflow/kubernetes/worker_configuration.py | is2co/airflow | 48f400541d19601d1571d07cf65f55c649884b87 | [
"Apache-2.0"
] | 2 | 2020-10-12T05:21:27.000Z | 2021-07-07T09:23:47.000Z | airflow/kubernetes/worker_configuration.py | is2co/airflow | 48f400541d19601d1571d07cf65f55c649884b87 | [
"Apache-2.0"
] | null | null | null | airflow/kubernetes/worker_configuration.py | is2co/airflow | 48f400541d19601d1571d07cf65f55c649884b87 | [
"Apache-2.0"
] | 1 | 2019-08-21T10:13:08.000Z | 2019-08-21T10:13:08.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 39.42973 | 109 | 0.605113 |
c9b2aea1bcb231f25943f66cc34505f08669b6d8 | 2,509 | py | Python | test/functional/feature_help.py | minblock/picscoin | db81f0f3468a131685fd27b1ea3f51028e1e87e7 | [
"MIT"
] | 2 | 2019-07-13T00:29:52.000Z | 2020-02-13T17:24:29.000Z | test/functional/feature_help.py | minblock/picscoin | db81f0f3468a131685fd27b1ea3f51028e1e87e7 | [
"MIT"
] | 2 | 2019-03-05T10:03:26.000Z | 2021-12-18T17:33:26.000Z | test/functional/feature_help.py | minblock/picscoin | db81f0f3468a131685fd27b1ea3f51028e1e87e7 | [
"MIT"
] | 1 | 2019-05-08T17:40:58.000Z | 2019-05-08T17:40:58.000Z | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Verify that starting picscoin with -h works as expected."""
from test_framework.test_framework import ... | 39.825397 | 85 | 0.664408 |
2f9559ed15a389fde2b774ba864de6b4d156e953 | 4,986 | py | Python | venv/Lib/site-packages/dateparser/data/date_translation_data/hu.py | realwaynesun/cryptotradedata | 4bd4d3f80438507fbb2b611a9cf451ed1aa2bde1 | [
"MIT"
] | 2 | 2021-03-27T20:11:56.000Z | 2021-05-04T19:34:44.000Z | venv/Lib/site-packages/dateparser/data/date_translation_data/hu.py | realwaynesun/cryptotradedata | 4bd4d3f80438507fbb2b611a9cf451ed1aa2bde1 | [
"MIT"
] | 21 | 2021-02-04T01:37:44.000Z | 2022-03-12T01:00:55.000Z | venv/Lib/site-packages/dateparser/data/date_translation_data/hu.py | realwaynesun/cryptotradedata | 4bd4d3f80438507fbb2b611a9cf451ed1aa2bde1 | [
"MIT"
] | 1 | 2021-03-27T19:41:10.000Z | 2021-03-27T19:41:10.000Z | info = {
"name": "hu",
"date_order": "YMD",
"january": [
"január",
"jan",
"I"
],
"february": [
"február",
"febr",
"feb",
"II"
],
"march": [
"március",
"márc",
"már",
"III"
],
"april": [
"á... | 16.731544 | 41 | 0.268953 |
48c54bb1d8c4a5f7e7bce5bd3ae606b26a9053dc | 2,542 | py | Python | matplotlib/komand_matplotlib/actions/create_scatter_plot/action.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | 1 | 2020-03-18T09:14:55.000Z | 2020-03-18T09:14:55.000Z | matplotlib/komand_matplotlib/actions/create_scatter_plot/action.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | 1 | 2021-02-23T23:57:37.000Z | 2021-02-23T23:57:37.000Z | matplotlib/komand_matplotlib/actions/create_scatter_plot/action.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | import komand
from .schema import CreateScatterPlotInput, CreateScatterPlotOutput
# Custom imports below
import base64
import pandas as pd
import seaborn as sns
from io import BytesIO
class CreateScatterPlot(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name='c... | 31.382716 | 109 | 0.555862 |
316d68a1c84dffbd60529588577d90f66e0934f3 | 15,890 | py | Python | tests/unit/modules/test_win_groupadd.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_win_groupadd.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 1 | 2017-07-10T21:44:39.000Z | 2017-07-10T21:44:39.000Z | tests/unit/modules/test_win_groupadd.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import salt.modules.win_groupadd as win_groupadd
import salt.utils.win_functions
from tests.support.helpers import TstSuiteLoggingHandler
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, Mock, patch
from tes... | 35.627803 | 119 | 0.587665 |
2d2e4b4b1666da74da514e47b256de61da805465 | 4,204 | py | Python | bitmovin_api_sdk/encoding/encodings/sidecars/sidecars_api.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/encoding/encodings/sidecars/sidecars_api.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/encoding/encodings/sidecars/sidecars_api.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | # coding: utf-8
from __future__ import absolute_import
from bitmovin_api_sdk.common import BaseApi, BitmovinApiLoggerBase
from bitmovin_api_sdk.common.poscheck import poscheck_except
from bitmovin_api_sdk.models.bitmovin_response import BitmovinResponse
from bitmovin_api_sdk.models.response_envelope import ResponseEn... | 35.033333 | 114 | 0.65295 |
3d3dfbd59037a899d4573671d534630b7fa7261d | 641 | py | Python | openapi_core/templating/responses/finders.py | MichaelCurrin/openapi-core | e0637b5d70b338929870a69c91ab1202bdebc0fd | [
"BSD-3-Clause"
] | null | null | null | openapi_core/templating/responses/finders.py | MichaelCurrin/openapi-core | e0637b5d70b338929870a69c91ab1202bdebc0fd | [
"BSD-3-Clause"
] | null | null | null | openapi_core/templating/responses/finders.py | MichaelCurrin/openapi-core | e0637b5d70b338929870a69c91ab1202bdebc0fd | [
"BSD-3-Clause"
] | null | null | null | from openapi_core.templating.responses.exceptions import ResponseNotFound
class ResponseFinder:
def __init__(self, responses):
self.responses = responses
def find(self, http_status='default'):
if http_status in self.responses:
return self.responses / http_status
# try ra... | 29.136364 | 76 | 0.678627 |
1847053387f1e3e2a76296778df96a20d2ddc818 | 4,857 | py | Python | heat/engine/clients/os/keystone/__init__.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:26.000Z | 2018-07-04T07:59:26.000Z | heat/engine/clients/os/keystone/__init__.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | heat/engine/clients/os/keystone/__init__.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 3 | 2018-07-19T17:43:37.000Z | 2019-11-15T22:13:30.000Z | #
# 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
# ... | 36.518797 | 78 | 0.616842 |
b4fe17ae8c713cf3c502c6f39b42782c2b4096eb | 293 | py | Python | nomaj/rs/rs_with_status.py | monomonedula/nomaj | d81e8919966bd2fc649594be647d8d98f0ff6a8f | [
"MIT"
] | null | null | null | nomaj/rs/rs_with_status.py | monomonedula/nomaj | d81e8919966bd2fc649594be647d8d98f0ff6a8f | [
"MIT"
] | null | null | null | nomaj/rs/rs_with_status.py | monomonedula/nomaj | d81e8919966bd2fc649594be647d8d98f0ff6a8f | [
"MIT"
] | null | null | null | from dataclasses import replace
from typing import Optional
from nomaj.nomaj import Resp
from nomaj.rs.rs_empty import rs_empty
def rs_with_status(status: int, resp: Optional[Resp] = None) -> Resp:
assert status in range(100, 1000)
return replace(resp or rs_empty(), status=status)
| 26.636364 | 69 | 0.764505 |
40129b6cf269fa97c9e742762f22f346db9eaa51 | 13,511 | py | Python | Jamdo/Jamdo/routes.py | asianswagstorm/SOEN487_Project | d56420b744613b1e57e030b3be459d74531695c1 | [
"MIT"
] | null | null | null | Jamdo/Jamdo/routes.py | asianswagstorm/SOEN487_Project | d56420b744613b1e57e030b3be459d74531695c1 | [
"MIT"
] | null | null | null | Jamdo/Jamdo/routes.py | asianswagstorm/SOEN487_Project | d56420b744613b1e57e030b3be459d74531695c1 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, abort, session, flash, jsonify, make_response, url_for, redirect
from datetime import date, time
from time import strftime
from models import db, User
import jwt, datetime, time, requests, re
from main import app, bcrypt, APPLICATION_AUTH_TOKEN as SERVER_TOKEN
@app.e... | 47.911348 | 178 | 0.583599 |
ffe57cc8c39449cc98086dafecc2161da771c3e0 | 8,871 | py | Python | test/functional/rpc_blockchain.py | RPGCoin/RPG-Core | bf0efd6f3d4426e11d195efe5aee7b7acabd9a3d | [
"MIT"
] | 5 | 2019-02-19T10:27:59.000Z | 2021-03-22T03:59:19.000Z | test/functional/rpc_blockchain.py | Matthelonianxl/RPG-Core | bf0efd6f3d4426e11d195efe5aee7b7acabd9a3d | [
"MIT"
] | 2 | 2019-02-19T09:46:38.000Z | 2019-02-25T19:09:41.000Z | test/functional/rpc_blockchain.py | Matthelonianxl/RPG-Core | bf0efd6f3d4426e11d195efe5aee7b7acabd9a3d | [
"MIT"
] | 2 | 2019-08-03T11:43:48.000Z | 2020-04-29T07:19:13.000Z | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Copyright (c) 2017 The Raven Core developers
# Copyright (c) 2018 The RPG Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPCs relate... | 38.737991 | 142 | 0.653252 |
57e37925f094e4238f67992ad10f595e081404ac | 41,760 | py | Python | neuronlp2/models/parsing.py | danifg/BottomUp-Hierarchical-PtrNet | 2b6ebdb63825eafd63d86700bbbc278cabfafeb2 | [
"MIT"
] | 1 | 2021-05-24T16:10:00.000Z | 2021-05-24T16:10:00.000Z | neuronlp2/models/parsing.py | danifg/BottomUp-Hierarchical-PtrNet | 2b6ebdb63825eafd63d86700bbbc278cabfafeb2 | [
"MIT"
] | null | null | null | neuronlp2/models/parsing.py | danifg/BottomUp-Hierarchical-PtrNet | 2b6ebdb63825eafd63d86700bbbc278cabfafeb2 | [
"MIT"
] | null | null | null | __author__ = 'max'
import numpy as np
from enum import Enum
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..nn import TreeCRF, VarMaskedGRU, VarMaskedRNN, VarMaskedLSTM, VarMaskedFastLSTM
from ..nn import SkipConnectFastLSTM, SkipConnectGRU, SkipConnectLSTM, SkipConnectRNN
from ..nn import Bi... | 45.991189 | 178 | 0.606513 |
846c63a357e426126cece11093fcab0d2a9f4121 | 563 | py | Python | spy/migrations/0002_category.py | Kaundu/espy | 7eb10e82960e073670d46edb6fcb0ff997ce356a | [
"Unlicense"
] | null | null | null | spy/migrations/0002_category.py | Kaundu/espy | 7eb10e82960e073670d46edb6fcb0ff997ce356a | [
"Unlicense"
] | null | null | null | spy/migrations/0002_category.py | Kaundu/espy | 7eb10e82960e073670d46edb6fcb0ff997ce356a | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-07-12 09:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spy', '0001_initial'),
]
operations = [
migrations.CreateModel(
n... | 24.478261 | 114 | 0.586146 |
8663f48697d92c8a5a7adf6bee064df9fc63beba | 6,412 | py | Python | mapillary_tools/process_video.py | testbalda/mapillary_tools | 07c00bb83815e512e1b85f5957b7d1ac9dfdeb0c | [
"BSD-2-Clause"
] | null | null | null | mapillary_tools/process_video.py | testbalda/mapillary_tools | 07c00bb83815e512e1b85f5957b7d1ac9dfdeb0c | [
"BSD-2-Clause"
] | null | null | null | mapillary_tools/process_video.py | testbalda/mapillary_tools | 07c00bb83815e512e1b85f5957b7d1ac9dfdeb0c | [
"BSD-2-Clause"
] | null | null | null | from ffprobe import FFProbe
import datetime
import os
import processing
import subprocess
import sys
import uploader
from exif_write import ExifEdit
ZERO_PADDING = 6
TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
TIME_FORMAT_2 = "%Y-%m-%dT%H:%M:%S.000000Z"
def timestamp_from_filename(video_filename,
... | 34.659459 | 130 | 0.552714 |
931c82685f1065f13451a94d66b42f76d2e7afec | 714 | py | Python | tcp_send.py | EnsekiTT/tcpforall | 0953aedff1e119b3a37231f2f63cfd2189c55d9b | [
"MIT"
] | null | null | null | tcp_send.py | EnsekiTT/tcpforall | 0953aedff1e119b3a37231f2f63cfd2189c55d9b | [
"MIT"
] | null | null | null | tcp_send.py | EnsekiTT/tcpforall | 0953aedff1e119b3a37231f2f63cfd2189c55d9b | [
"MIT"
] | null | null | null | import socket
import sys
import time
HOST, PORT = "localhost", 9999
# Create a socket (SOCK_STREAM means a TCP socket)
def sendnum(target=100):
count = 0
for i in range(target):
data = str(count)
count += 1
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
# ... | 24.62069 | 71 | 0.584034 |
76b2c968a68ec9cbe5a53ef732c3a5059537d5df | 1,576 | py | Python | evaluation_cyclegan/model/base_model.py | samxuxiang/mcmi | e639b7b8a95ccd675fa94efdbcfa355672649a78 | [
"MIT"
] | 3 | 2020-07-10T22:04:53.000Z | 2020-10-03T06:29:27.000Z | evaluation_cyclegan/model/base_model.py | samxuxiang/mcmi | e639b7b8a95ccd675fa94efdbcfa355672649a78 | [
"MIT"
] | 4 | 2021-04-30T21:22:24.000Z | 2022-03-12T00:39:22.000Z | evaluation_cyclegan/model/base_model.py | samxuxiang/mcmi | e639b7b8a95ccd675fa94efdbcfa355672649a78 | [
"MIT"
] | null | null | null | import os
import torch
from torch.autograd import Variable
from pdb import set_trace as st
class BaseModel():
def __init__(self):
pass;
def name(self):
return 'BaseModel'
def initialize(self, use_gpu=True, gpu_ids=[0]):
self.use_gpu = use_gpu
self.gpu_ids = gpu_id... | 26.711864 | 77 | 0.656091 |
0f35245e558058fbe98a383583ba595a7cd6ad22 | 4,817 | py | Python | tests/func/parsing/test_error_recovery.py | SupraSummus/parglare | da9c4992ac6f7f6bb05f657733cb4221da88782a | [
"MIT"
] | null | null | null | tests/func/parsing/test_error_recovery.py | SupraSummus/parglare | da9c4992ac6f7f6bb05f657733cb4221da88782a | [
"MIT"
] | 1 | 2019-09-22T18:01:34.000Z | 2019-09-22T18:01:34.000Z | tests/func/parsing/test_error_recovery.py | SupraSummus/parglare-slim | da9c4992ac6f7f6bb05f657733cb4221da88782a | [
"MIT"
] | null | null | null | import pytest # noqa
from parglare import Parser, ParseError, Grammar
from parglare.actions import pass_single
grammar = r"""
Result: E EOF;
E: E '+' E {left, 1}
| E '-' E {left, 1}
| E '*' E {left, 2}
| E '/' E {left, 2}
| E '^' E {right, 3}
| '(' E ')'
| number;
terminals
number: /\d+(\.\d+)?/;
"""
act... | 29.193939 | 79 | 0.619888 |
d51713715a015216b4e99b2fa9d3f9123f989630 | 5,974 | py | Python | model.py | SriMethan/Lichess-Bot | a03fbbc47edab85ea47d68572aa6f5e6d5cc4e11 | [
"MIT"
] | null | null | null | model.py | SriMethan/Lichess-Bot | a03fbbc47edab85ea47d68572aa6f5e6d5cc4e11 | [
"MIT"
] | null | null | null | model.py | SriMethan/Lichess-Bot | a03fbbc47edab85ea47d68572aa6f5e6d5cc4e11 | [
"MIT"
] | 1 | 2021-09-14T04:49:54.000Z | 2021-09-14T04:49:54.000Z | import time
from urllib.parse import urljoin
class Challenge:
def __init__(self, c_info):
self.id = c_info["id"]
self.rated = c_info["rated"]
self.variant = c_info["variant"]["key"]
self.perf_name = c_info["perf"]["name"]
self.speed = c_info["speed"]
self.increment =... | 43.605839 | 175 | 0.65082 |
ff994a06d5baa5142c7670bb29e97029503a1b91 | 572 | py | Python | example/example/app/views.py | sittizen/django_dropimages | dd42502c18324f37cae7b124b30a36ece5112dc6 | [
"MIT"
] | 1 | 2018-10-24T14:58:19.000Z | 2018-10-24T14:58:19.000Z | example/example/app/views.py | sittizen/django_dropimages | dd42502c18324f37cae7b124b30a36ece5112dc6 | [
"MIT"
] | null | null | null | example/example/app/views.py | sittizen/django_dropimages | dd42502c18324f37cae7b124b30a36ece5112dc6 | [
"MIT"
] | null | null | null | from django.core.urlresolvers import reverse_lazy
from django.views.generic import CreateView, DetailView
from .models import SomeGallery
class SomeGalleryCreateView(CreateView):
model = SomeGallery
template_name = 'create.html'
fields = (
'title',
'dropimages_gallery', # this field will... | 26 | 91 | 0.722028 |
675e1dfb66028e64bcbdfc9122eff944444865f5 | 188 | py | Python | bigstore/backends/__init__.py | dubois/git-bigstore | b1438723c08d4f7066a757d092565f9fc4bbc544 | [
"Apache-2.0"
] | null | null | null | bigstore/backends/__init__.py | dubois/git-bigstore | b1438723c08d4f7066a757d092565f9fc4bbc544 | [
"Apache-2.0"
] | null | null | null | bigstore/backends/__init__.py | dubois/git-bigstore | b1438723c08d4f7066a757d092565f9fc4bbc544 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from .s3 import S3Backend
from .rackspace import RackspaceBackend
from .google import GoogleBackend
__all__ = ['S3Backend', 'RackspaceBackend', 'GoogleBackend']
| 20.888889 | 60 | 0.744681 |
1c945e36f0e18d00ced7baac01ce6bc0e1eec3a3 | 6,520 | py | Python | jaxns/examples/ray_integral/main.py | fehiepsi/jaxns | 9cf9366f11ace564e21f938edf4d090fb5de137d | [
"Apache-2.0"
] | null | null | null | jaxns/examples/ray_integral/main.py | fehiepsi/jaxns | 9cf9366f11ace564e21f938edf4d090fb5de137d | [
"Apache-2.0"
] | null | null | null | jaxns/examples/ray_integral/main.py | fehiepsi/jaxns | 9cf9366f11ace564e21f938edf4d090fb5de137d | [
"Apache-2.0"
] | null | null | null | from jaxns.examples.ray_integral.build_prior import build_prior
from jaxns.gaussian_process.kernels import RBF
from jaxns.examples.ray_integral.generate_data import rbf_dtec
from jaxns.nested_sampling import NestedSampler
from jaxns.plotting import plot_cornerplot, plot_diagnostics
from jax import random, jit
from jax.... | 39.277108 | 158 | 0.591258 |
3788dda483b0ab2a88e2d8351f18074ddd32dc28 | 7,593 | py | Python | tests/test_app.py | JayveeHe/senz.app.staticinfo.inferrence | 98748506adcbb28b074337e261fe79b2141f31a5 | [
"MIT"
] | null | null | null | tests/test_app.py | JayveeHe/senz.app.staticinfo.inferrence | 98748506adcbb28b074337e261fe79b2141f31a5 | [
"MIT"
] | null | null | null | tests/test_app.py | JayveeHe/senz.app.staticinfo.inferrence | 98748506adcbb28b074337e261fe79b2141f31a5 | [
"MIT"
] | null | null | null | # coding:utf8
import json
import unittest
from app import app
__author__ = 'Jayvee'
class TestFlaskApp(unittest.TestCase):
def setUp(self):
super(TestFlaskApp, self).setUp()
app.config['TESTING'] = True
self.app = app.test_client()
def tearDown(self):
super(TestFlaskApp, self... | 42.183333 | 108 | 0.574345 |
70865a19521a620e3a6e181c8c621a3b05ca91b7 | 716 | py | Python | exporters/deserializers.py | scrapinghub/exporters | b14f70530826bbbd6163d9e56e74345e762a9189 | [
"BSD-3-Clause"
] | 41 | 2016-06-16T15:29:39.000Z | 2021-08-06T03:29:13.000Z | exporters/deserializers.py | bbotella/fluxo | c9fb01db1771ada4672bbffd67cb46e1f7802ab9 | [
"BSD-3-Clause"
] | 52 | 2016-06-20T12:46:57.000Z | 2018-02-08T12:22:03.000Z | exporters/deserializers.py | bbotella/fluxo | c9fb01db1771ada4672bbffd67cb46e1f7802ab9 | [
"BSD-3-Clause"
] | 10 | 2016-06-23T08:49:36.000Z | 2018-01-13T10:12:10.000Z | from exporters.pipeline.base_pipeline_item import BasePipelineItem
from exporters.records.base_record import BaseRecord
import json
import csv
__all__ = ['BaseDeserializer', 'JsonLinesDeserializer', 'CSVDeserializer']
class BaseDeserializer(BasePipelineItem):
def deserialize(self, stream):
raise NotImple... | 27.538462 | 74 | 0.730447 |
bf1e6401ada8cd386d710bcbcd2af8a1f8a57db5 | 6,093 | py | Python | ooobuild/lo/xforms/x_model.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/xforms/x_model.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/xforms/x_model.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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.423729 | 133 | 0.653865 |
774312d4a5317f9e48accd789783306a49abe5e1 | 6,584 | py | Python | analyzer/libs/z3/scripts/mk_unix_dist.py | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 23 | 2016-01-06T07:01:46.000Z | 2022-02-12T15:53:20.000Z | analyzer/libs/z3/scripts/mk_unix_dist.py | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 1 | 2019-04-02T00:42:29.000Z | 2019-04-02T00:42:29.000Z | analyzer/libs/z3/scripts/mk_unix_dist.py | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 16 | 2016-01-06T07:01:46.000Z | 2021-11-29T11:43:16.000Z | ############################################
# Copyright (c) 2013 Microsoft Corporation
#
# Scripts for automatically generating
# Linux/OSX/BSD distribution zip files.
#
# Author: Leonardo de Moura (leonardo)
############################################
import os
import glob
import re
import getopt
import sys
import s... | 30.341014 | 123 | 0.556652 |
dff50e4faea9c84850fd9a286cfb642760238fed | 90 | py | Python | portal/apps.py | DE0CH/vmserver | 21da458891c90443d7afb4c19fcc3d19b5db6631 | [
"MIT"
] | null | null | null | portal/apps.py | DE0CH/vmserver | 21da458891c90443d7afb4c19fcc3d19b5db6631 | [
"MIT"
] | null | null | null | portal/apps.py | DE0CH/vmserver | 21da458891c90443d7afb4c19fcc3d19b5db6631 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CodeStudyConfig(AppConfig):
name = 'portal'
| 15 | 33 | 0.755556 |
b726dd00e3627c8c609550a84dbc6f2ef4b2f5bd | 15,996 | py | Python | google/cloud/dialogflow/cx/v3beta1/dialogflow-cx-v3beta1-py/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/dialogflow/cx/v3beta1/dialogflow-cx-v3beta1-py/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/dialogflow/cx/v3beta1/dialogflow-cx-v3beta1-py/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.066116 | 87 | 0.623593 |
98b913fcb10611c25810ff501a16efa980668d40 | 3,952 | py | Python | tests/client.py | Stamper/django-ninja | 39479db2937b0a8a918cfe1c0790ad7016db7edc | [
"MIT"
] | 1 | 2021-05-02T13:26:13.000Z | 2021-05-02T13:26:13.000Z | tests/client.py | Stamper/django-ninja | 39479db2937b0a8a918cfe1c0790ad7016db7edc | [
"MIT"
] | null | null | null | tests/client.py | Stamper/django-ninja | 39479db2937b0a8a918cfe1c0790ad7016db7edc | [
"MIT"
] | null | null | null | from json import loads as json_loads, dumps as json_dumps
from ninja import NinjaAPI
from unittest.mock import Mock
import django
from django.http import QueryDict
# TODO: this should be changed
# maybe add here urlconf object and add urls from here
class NinjaClientBase:
def __init__(self, router_or_app):
... | 34.068966 | 87 | 0.611589 |
585cf51587698010b2636844fadbb6f783d1ed27 | 47,976 | py | Python | sympy/functions/elementary/hyperbolic.py | V1krant/sympy | f8e7019feded4e4d0852f49fe0ccfa777f0e8744 | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/elementary/hyperbolic.py | V1krant/sympy | f8e7019feded4e4d0852f49fe0ccfa777f0e8744 | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/elementary/hyperbolic.py | V1krant/sympy | f8e7019feded4e4d0852f49fe0ccfa777f0e8744 | [
"BSD-3-Clause"
] | 1 | 2020-02-06T17:54:20.000Z | 2020-02-06T17:54:20.000Z | from __future__ import print_function, division
from sympy.core import S, sympify, cacheit, pi, I, Rational
from sympy.core.add import Add
from sympy.core.function import Function, ArgumentIndexError, _coeff_isneg
from sympy.functions.combinatorial.factorials import factorial, RisingFactorial
from sympy.functions.elem... | 29.076364 | 82 | 0.508754 |
01a80f741670bb259182e32a6dd1c4bda66c5172 | 892 | py | Python | detect_secrets/core/constants.py | digjanaik/detect-secrets | 624024ad5fd8a608e09ed719e5edab6ca95ef47e | [
"Apache-2.0"
] | null | null | null | detect_secrets/core/constants.py | digjanaik/detect-secrets | 624024ad5fd8a608e09ed719e5edab6ca95ef47e | [
"Apache-2.0"
] | 1 | 2020-08-12T21:57:16.000Z | 2020-08-12T21:57:16.000Z | detect_secrets/core/constants.py | digjanaik/detect-secrets | 624024ad5fd8a608e09ed719e5edab6ca95ef47e | [
"Apache-2.0"
] | null | null | null | from enum import Enum
# We don't scan files with these extensions.
# Note: We might be able to do this better with
# `subprocess.check_output(['file', filename])`
# and look for "ASCII text", but that might be more expensive.
#
# Definitely something to look into, if this list gets unruly long.
IGNO... | 18.978723 | 73 | 0.441704 |
0c8bec610de1a29c8589b679f20b91cd3f5b0979 | 56,851 | py | Python | main/fhd_delay_spectrum_lstbin_data_analysis.py | dannyjacobs/PRISim | 89e544d771cf5c4113a4d5787a57c9586fa98eac | [
"MIT"
] | null | null | null | main/fhd_delay_spectrum_lstbin_data_analysis.py | dannyjacobs/PRISim | 89e544d771cf5c4113a4d5787a57c9586fa98eac | [
"MIT"
] | null | null | null | main/fhd_delay_spectrum_lstbin_data_analysis.py | dannyjacobs/PRISim | 89e544d771cf5c4113a4d5787a57c9586fa98eac | [
"MIT"
] | null | null | null | import glob
import numpy as NP
import healpy as HP
from astropy.io import fits
from astropy.io import ascii
import astropy.cosmology as CP
import scipy.constants as FCNST
import matplotlib.pyplot as PLT
import matplotlib.colors as PLTC
import matplotlib.cm as CM
import matplotlib.gridspec as GS
import progressbar as P... | 55.14161 | 538 | 0.72887 |
75a0954c6b29852477cdcd89b894807f2cb4e7ac | 121,153 | py | Python | gclient.py | tomrittervg/depot_tools | ad7b2d79aab0737e285ff120c1ed0bef0ab6c0b6 | [
"BSD-3-Clause"
] | 1 | 2021-09-01T06:16:55.000Z | 2021-09-01T06:16:55.000Z | gclient.py | tomrittervg/depot_tools | ad7b2d79aab0737e285ff120c1ed0bef0ab6c0b6 | [
"BSD-3-Clause"
] | null | null | null | gclient.py | tomrittervg/depot_tools | ad7b2d79aab0737e285ff120c1ed0bef0ab6c0b6 | [
"BSD-3-Clause"
] | 4 | 2020-03-15T13:28:11.000Z | 2021-12-13T08:57:39.000Z | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Meta checkout dependency manager for Git."""
# Files
# .gclient : Current client configuration, written by 'config' comma... | 37.485458 | 80 | 0.635345 |
25a56508c08048b68be82846249defdd79c74c98 | 1,811 | py | Python | misc/config_tools/acpi_gen/acpi_const.py | Kunhui-Li/acrn-hypervisor | f3305b6373494f3051888fe8c22b4293745cd1e7 | [
"BSD-3-Clause"
] | 1 | 2021-05-27T09:39:48.000Z | 2021-05-27T09:39:48.000Z | misc/config_tools/acpi_gen/acpi_const.py | Kunhui-Li/acrn-hypervisor | f3305b6373494f3051888fe8c22b4293745cd1e7 | [
"BSD-3-Clause"
] | null | null | null | misc/config_tools/acpi_gen/acpi_const.py | Kunhui-Li/acrn-hypervisor | f3305b6373494f3051888fe8c22b4293745cd1e7 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2019 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause
"""constant for offline ACPI generator.
"""
import os, sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
import common
VM_CONFIGS_PATH = os.path.join(common.SOURCE_ROOT_DIR, 'misc', 'config_... | 33.537037 | 96 | 0.702927 |
338fba220a7aeb39d81a82a931d2c884badbfcbc | 2,098 | py | Python | planning_and_simulation_modules/VITO/Prioritization_algorithm.py | Planheat/Planheat-Tool | 9764fcb86d3898b232c4cc333dab75ebe41cd421 | [
"MIT"
] | 2 | 2020-04-07T03:43:33.000Z | 2021-03-23T13:17:42.000Z | planning_and_simulation_modules/VITO/Prioritization_algorithm.py | Planheat/Planheat-Tool | 9764fcb86d3898b232c4cc333dab75ebe41cd421 | [
"MIT"
] | 1 | 2020-07-20T09:56:13.000Z | 2020-07-22T10:26:06.000Z | planning_and_simulation_modules/VITO/Prioritization_algorithm.py | Planheat/Planheat-Tool | 9764fcb86d3898b232c4cc333dab75ebe41cd421 | [
"MIT"
] | 1 | 2020-07-20T09:40:15.000Z | 2020-07-20T09:40:15.000Z | import pandas
import os
tb_rows = 10
tb_columns = 8
vito_criteria = 16
offset_x = 1
offset_y = 59
delta_x = 11
delta_y = 16
def prioritization_algorithm(weights=(10, 0, 10, 2, 5, 7, 0, 5, 4, 0, 3, 0, 0, 0, 0, 0)):
output_vito = {"Space heating high temperature": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
... | 37.464286 | 106 | 0.555291 |
e25ae69da6597d649b47d2fcc6f85394ae8b7ab2 | 7,071 | py | Python | ga/selection.py | dollking/optimize | 4918c059d1db44f17520c8edca82071665fc459f | [
"MIT"
] | null | null | null | ga/selection.py | dollking/optimize | 4918c059d1db44f17520c8edca82071665fc459f | [
"MIT"
] | null | null | null | ga/selection.py | dollking/optimize | 4918c059d1db44f17520c8edca82071665fc459f | [
"MIT"
] | 1 | 2018-10-17T10:59:48.000Z | 2018-10-17T10:59:48.000Z | """
optimize.ga.mutation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implements class for all selection operation to select chromosome for crossover operation and using next generation.
:copyright: Hwang.S.J.
:license: MIT LICENSE 1.0 .
"""
from random import randrange, uniform, random
class ChromosomeSelection(o... | 42.089286 | 188 | 0.604724 |
cb6c62fc490bdc7676ca80d0334569f636941e14 | 34,899 | py | Python | nengo/builder/optimizer.py | seankmartin/nengo | de345f6d201ac5063fc4c5a7e56c0b16c26785c1 | [
"BSD-2-Clause"
] | null | null | null | nengo/builder/optimizer.py | seankmartin/nengo | de345f6d201ac5063fc4c5a7e56c0b16c26785c1 | [
"BSD-2-Clause"
] | null | null | null | nengo/builder/optimizer.py | seankmartin/nengo | de345f6d201ac5063fc4c5a7e56c0b16c26785c1 | [
"BSD-2-Clause"
] | null | null | null | """Operator graph optimizers."""
from collections import defaultdict, namedtuple
from itertools import zip_longest
import logging
import warnings
import numpy as np
from nengo.builder.neurons import SimNeurons
from nengo.builder import operator as op
from nengo.builder.signal import Signal
from nengo.rc import rc
fr... | 36.052686 | 88 | 0.586091 |
e7bd16cfdf190f39d85b40359e7e35ba9ebc268c | 820 | py | Python | apps/users/migrations/0002_auto_20170601_1045.py | sunzhongyuan/MxOnline | 62fedb55b312a9b9257b7ea01533809545ae6039 | [
"MIT"
] | null | null | null | apps/users/migrations/0002_auto_20170601_1045.py | sunzhongyuan/MxOnline | 62fedb55b312a9b9257b7ea01533809545ae6039 | [
"MIT"
] | null | null | null | apps/users/migrations/0002_auto_20170601_1045.py | sunzhongyuan/MxOnline | 62fedb55b312a9b9257b7ea01533809545ae6039 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-06-01 10:45
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterFiel... | 30.37037 | 177 | 0.635366 |
fa626d28077dcacf5e78ecc504ea25454a1ebf68 | 8,854 | py | Python | tensorflow/tools/compatibility/testdata/test_file_v0_11.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/tools/compatibility/testdata/test_file_v0_11.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/tools/compatibility/testdata/test_file_v0_11.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.000Z | # Copyright 2016 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 | 80 | 0.58482 |
f8fe62da2caf1e500c24012e0f930677a2ccad8b | 5,805 | py | Python | src/training/data_parameters.py | kungfuai/d3m-segmentation-research | 5bc44ddd0e8522fb2b369866ad47aa62a24a8f63 | [
"MIT"
] | 1 | 2020-12-07T02:25:53.000Z | 2020-12-07T02:25:53.000Z | src/training/data_parameters.py | kungfuai/d3m-segmentation-research | 5bc44ddd0e8522fb2b369866ad47aa62a24a8f63 | [
"MIT"
] | null | null | null | src/training/data_parameters.py | kungfuai/d3m-segmentation-research | 5bc44ddd0e8522fb2b369866ad47aa62a24a8f63 | [
"MIT"
] | null | null | null | # From https://github.com/apple/ml-data-parameters
# Copyright (C) 2019 Apple Inc. All Rights Reserved. See
# https://github.com/apple/ml-data-parameters/blob/master/LICENSE
import numpy as np
import torch
def get_class_inst_data_params_n_optimizer(nr_classes, nr_instances, device):
"""Returns class and instance ... | 42.683824 | 121 | 0.585013 |
500403676ca301260684f909534edef3ea8cf288 | 281 | py | Python | CodeWars_RemoveTheMin.py | amukher3/Problem_solutions | 8fa6014a91f295d08cafb989024caa91d99211d9 | [
"Apache-2.0"
] | 1 | 2021-12-28T08:58:51.000Z | 2021-12-28T08:58:51.000Z | CodeWars_RemoveTheMin.py | amukher3/Coding | a330cb04b5dd5cc1c3cf69249417a71586441bc7 | [
"Apache-2.0"
] | null | null | null | CodeWars_RemoveTheMin.py | amukher3/Coding | a330cb04b5dd5cc1c3cf69249417a71586441bc7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 1 19:39:48 2019
@author: amukher3
"""
def remove_smallest(numbers):
a=numbers[:]
if a ==[]:
return a
else:
a.remove(min(a))
return a
| 13.380952 | 36 | 0.409253 |
be87434060f41d16b1e15d94390d44b7d5adb9a1 | 6,103 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_model_versions_response.py | AdamHillier/polyaxon | a6407f4b22eddcd970bb4be17e111cbc8d6bca6d | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_model_versions_response.py | AdamHillier/polyaxon | a6407f4b22eddcd970bb4be17e111cbc8d6bca6d | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_model_versions_response.py | AdamHillier/polyaxon | a6407f4b22eddcd970bb4be17e111cbc8d6bca6d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | 28.25463 | 120 | 0.605112 |
72a4134fe07aeb6993ae5982083f7fbc32d57a91 | 17,051 | py | Python | bot.py | proguy914629bot/LyricMasterOutdated | 61f4f92a3e84d62427460eda058e40d78cb28924 | [
"MIT"
] | 1 | 2021-06-01T10:12:07.000Z | 2021-06-01T10:12:07.000Z | bot.py | proguy914629bot/LyricMasterOutdated | 61f4f92a3e84d62427460eda058e40d78cb28924 | [
"MIT"
] | null | null | null | bot.py | proguy914629bot/LyricMasterOutdated | 61f4f92a3e84d62427460eda058e40d78cb28924 | [
"MIT"
] | null | null | null | import discord
import os
os.chdir('/home/gilb/LyricMaster/')
from discord.ext import commands
import json
import logging
import collections
import random
import motor.motor_asyncio
from pathlib import Path
import os
import asyncio
import aiohttp
import json, asyncio
import copy
import traceback
import s... | 33.831349 | 271 | 0.583309 |
1f37e64f6acae7669cc6a4658904a00cb939584e | 2,647 | py | Python | docanchors/search/objectives/objectives.py | kluge-ai/docanchors | 15108f8fb1bab9f356ef7ca8f5a21a1ff6bd08ba | [
"Apache-2.0"
] | null | null | null | docanchors/search/objectives/objectives.py | kluge-ai/docanchors | 15108f8fb1bab9f356ef7ca8f5a21a1ff6bd08ba | [
"Apache-2.0"
] | null | null | null | docanchors/search/objectives/objectives.py | kluge-ai/docanchors | 15108f8fb1bab9f356ef7ca8f5a21a1ff6bd08ba | [
"Apache-2.0"
] | null | null | null | from multiprocessing import Queue
from typing import Union
import numpy as np
from .objective import Objective
EPSILON = 1e-6
class Zero(Objective):
"""Zero objective.
Takes on 0.0 regardless of the candidate.
"""
def value(self, candidate: np.ndarray) -> float:
return 0.0
class Consta... | 24.509259 | 98 | 0.651681 |
a6707035141ee259227382bdbbceb59c77f1a199 | 2,939 | py | Python | redash/models/changes.py | feeltheajf/redash | 05c22337822661e56f53a20e29b7797270eaeda9 | [
"BSD-2-Clause"
] | 2 | 2019-11-11T17:00:14.000Z | 2020-05-10T16:27:17.000Z | redash/models/changes.py | feeltheajf/redash | 05c22337822661e56f53a20e29b7797270eaeda9 | [
"BSD-2-Clause"
] | 4 | 2020-03-03T07:35:44.000Z | 2020-06-10T11:12:41.000Z | redash/models/changes.py | AbhishekSinhaCoder/redash | 13c353195602dd2a862f7fcc9f09cd5a6b10c957 | [
"BSD-2-Clause"
] | 2 | 2020-07-17T03:04:21.000Z | 2022-02-07T01:55:31.000Z | from sqlalchemy.inspection import inspect
from sqlalchemy_utils.models import generic_repr
from .base import GFKBase, db, Column
from .types import PseudoJSON
@generic_repr("id", "object_type", "object_id", "created_at")
class Change(GFKBase, db.Model):
id = Column(db.Integer, primary_key=True)
# 'object' de... | 31.265957 | 87 | 0.58081 |
e394cc6e0dd1f10c2e20e98a2a95f9958b8d563c | 32,830 | py | Python | yandex/cloud/billing/v1/budget_pb2.py | korsar182/python-sdk | 873bf2a9b136a8f2faae72e86fae1f5b5c3d896a | [
"MIT"
] | 36 | 2018-12-23T13:51:50.000Z | 2022-03-25T07:48:24.000Z | yandex/cloud/billing/v1/budget_pb2.py | korsar182/python-sdk | 873bf2a9b136a8f2faae72e86fae1f5b5c3d896a | [
"MIT"
] | 15 | 2019-02-28T04:55:09.000Z | 2022-03-06T23:17:24.000Z | yandex/cloud/billing/v1/budget_pb2.py | korsar182/python-sdk | 873bf2a9b136a8f2faae72e86fae1f5b5c3d896a | [
"MIT"
] | 18 | 2019-02-23T07:10:57.000Z | 2022-03-28T14:41:08.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/billing/v1/budget.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mes... | 48.637037 | 3,227 | 0.770027 |
3ca621bcbdb1471b5eb70ce18cb04ed008c7aa41 | 306 | py | Python | live.py | ritza-co/nix.dev | 85e23ca44bd4b049beff54fda9013bdaedd61c1c | [
"CC0-1.0"
] | 623 | 2020-07-07T09:10:57.000Z | 2022-03-31T15:01:42.000Z | live.py | ritza-co/nix.dev | 85e23ca44bd4b049beff54fda9013bdaedd61c1c | [
"CC0-1.0"
] | 160 | 2020-07-07T09:06:26.000Z | 2022-03-31T10:24:03.000Z | live.py | ritza-co/nix.dev | 85e23ca44bd4b049beff54fda9013bdaedd61c1c | [
"CC0-1.0"
] | 52 | 2020-07-09T18:07:15.000Z | 2022-03-21T22:33:42.000Z | from livereload import Server, shell
server = Server()
build_docs = shell("make html")
print("Doing an initial build of the docs...")
build_docs()
server.watch("source/*", build_docs)
server.watch("source/**/*", build_docs)
server.watch("_templates/*.html", build_docs)
server.serve(root="build/html")
| 21.857143 | 46 | 0.72549 |
e066a997e7bc093e769a89cbebd15827277f9dfc | 555 | py | Python | flask/test/endpoint_tests/test_product_categories.py | boxwise/boxtribute | b87d3bf52e29cb485d98e669b4b43d1934abf310 | [
"Apache-2.0"
] | 3 | 2020-10-17T06:37:10.000Z | 2021-06-08T16:58:38.000Z | flask/test/endpoint_tests/test_product_categories.py | boxwise/boxtribute | b87d3bf52e29cb485d98e669b4b43d1934abf310 | [
"Apache-2.0"
] | 166 | 2020-10-25T20:45:32.000Z | 2022-03-28T08:18:26.000Z | flask/test/endpoint_tests/test_product_categories.py | boxwise/boxtribute | b87d3bf52e29cb485d98e669b4b43d1934abf310 | [
"Apache-2.0"
] | 4 | 2021-01-01T18:03:57.000Z | 2022-03-10T08:43:23.000Z | import pytest
@pytest.mark.usefixtures("default_product_category")
def test_product_categorys(client, default_product_category):
graph_ql_query_string = """query {
productCategories {
name
}
}"""
data = {"query": graph_ql_query_string}
respon... | 34.6875 | 76 | 0.663063 |
1fa64db22a92f99fd1ba366ae0a506aaaf99afe1 | 4,979 | py | Python | configs/fashion/2d_kpt_sview_rgb_img/topdown_heatmap/deepfashion/hrnet_w48_deepfashion_full_256x192_udp.py | SummerVideoAnalysis/mmpose | 70d60e03b7eaa0ae1ec66cc7a22c00916f00c9e1 | [
"Apache-2.0"
] | 1 | 2022-01-11T09:31:53.000Z | 2022-01-11T09:31:53.000Z | configs/fashion/2d_kpt_sview_rgb_img/topdown_heatmap/deepfashion/hrnet_w48_deepfashion_full_256x192_udp.py | connor-john/mmpose | f5eabbf33ba514a1ddaf914e835d6abc7accee39 | [
"Apache-2.0"
] | null | null | null | configs/fashion/2d_kpt_sview_rgb_img/topdown_heatmap/deepfashion/hrnet_w48_deepfashion_full_256x192_udp.py | connor-john/mmpose | f5eabbf33ba514a1ddaf914e835d6abc7accee39 | [
"Apache-2.0"
] | null | null | null | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='PCK', key_indicator='PCK')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learnin... | 28.129944 | 79 | 0.586463 |
d86038715222b260ef9784fd9e432cc6dfe6b3dd | 27,332 | py | Python | substrateinterface/contracts.py | imstar15/py-substrate-interface | fdcb33d0c111f9ca57927a22ac82b47b52c42370 | [
"Apache-2.0"
] | null | null | null | substrateinterface/contracts.py | imstar15/py-substrate-interface | fdcb33d0c111f9ca57927a22ac82b47b52c42370 | [
"Apache-2.0"
] | null | null | null | substrateinterface/contracts.py | imstar15/py-substrate-interface | fdcb33d0c111f9ca57927a22ac82b47b52c42370 | [
"Apache-2.0"
] | null | null | null | # Python Substrate Interface Library
#
# Copyright 2018-2020 Stichting Polkascan (Polkascan Foundation).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | 35.450065 | 131 | 0.590553 |
9fe744555cfe0467f1ce09869c30430c2775b696 | 69 | py | Python | fluent_python/inherit/__init__.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:07:56.000Z | 2018-12-19T22:07:56.000Z | fluent_python/inherit/__init__.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 12 | 2020-03-14T05:32:26.000Z | 2022-03-12T00:08:49.000Z | fluent_python/inherit/__init__.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:08:00.000Z | 2018-12-19T22:08:00.000Z | """
@author: magician
@file: __init__.py.py
@date: 2020/11/18
""" | 13.8 | 23 | 0.608696 |
df28931c21c88ebcd83ba57d25488e7c654d0215 | 3,212 | py | Python | welib/weio/excel_file.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | 24 | 2019-07-24T23:37:10.000Z | 2022-03-30T20:40:40.000Z | welib/weio/excel_file.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | null | null | null | welib/weio/excel_file.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | 11 | 2019-03-14T13:47:04.000Z | 2022-03-31T15:47:27.000Z | from __future__ import division,unicode_literals,print_function,absolute_import
from builtins import map, range, chr, str
from io import open
from future import standard_library
standard_library.install_aliases()
from .file import File, WrongFormatError, BrokenFormatError
import numpy as np
import pandas as pd
# from... | 36.089888 | 90 | 0.545455 |
c9e217d1b267dba0939a4fe7316469756737a9cd | 99 | py | Python | cassandra_snap/__init__.py | gamunu/cassandra_snap | 526be2ff446cc1cebb81b1e8ab14cce0cfbd17f8 | [
"BSD-3-Clause"
] | 9 | 2018-03-09T20:59:16.000Z | 2022-03-06T09:23:50.000Z | cassandra_snap/__init__.py | gamunu/cassandra_snap | 526be2ff446cc1cebb81b1e8ab14cce0cfbd17f8 | [
"BSD-3-Clause"
] | 4 | 2018-04-30T12:06:34.000Z | 2019-04-25T23:26:52.000Z | cassandra_snap/__init__.py | pearsontechnology/cassandra_snap | 80127ad34e6aedce7d304a752fad41bf591bd575 | [
"BSD-3-Clause"
] | 3 | 2018-02-23T23:33:51.000Z | 2020-09-07T03:34:42.000Z | __version__ = '1.2.1'
__maintainer__ = 'Gamunu Balagalla'
__email__ = 'gamunu.balagalla@gmail.com'
| 24.75 | 40 | 0.757576 |
25cb9e45486a337e665d75e5d248d82ad2bbdf1e | 1,380 | py | Python | src/mock.py | cosmodesi/snsurvey | 2dfb57e7b094362b979ecf300be42ff21c13524d | [
"BSD-3-Clause"
] | null | null | null | src/mock.py | cosmodesi/snsurvey | 2dfb57e7b094362b979ecf300be42ff21c13524d | [
"BSD-3-Clause"
] | null | null | null | src/mock.py | cosmodesi/snsurvey | 2dfb57e7b094362b979ecf300be42ff21c13524d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import h5py
import matplotlib.pyplot as plt
import numpy
import scipy.stats
fname = '/project/projectdirs/desi/mocks/bgs/MXXL/desi_footprint/v0.0.4/BGS_r20.0.hdf5'
f = h5py.File(fname, "r")
w=numpy.logical_and(f['Data']['z_cos'].value < 0.004, f['Data']['z_cos'].value > 0.002)
abs_mag = f['Data... | 31.363636 | 101 | 0.681159 |
02eec0000ee52658818d14624f1875ecd5eadd1a | 947 | py | Python | brownies/legacy/endl/test/test_endlProject.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 14 | 2019-08-29T23:46:24.000Z | 2022-03-21T10:16:25.000Z | brownies/legacy/endl/test/test_endlProject.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 1 | 2020-08-04T16:14:45.000Z | 2021-12-01T01:54:34.000Z | brownies/legacy/endl/test/test_endlProject.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 2 | 2022-03-03T22:41:41.000Z | 2022-03-03T22:54:43.000Z | # <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
import unittest
import os
from brownies.legacy.endl import fudgeParameters
from brownies.legacy.endl import __path__
from br... | 29.59375 | 79 | 0.655755 |
761691d637553e05d7e6a0794f6eb6db21c1bd44 | 23,147 | py | Python | holoviews/tests/plotting/bokeh/testpathplot.py | Jacob-Barhak/holoviews | 5df0269595ca7befca202f9d05522c68983dc974 | [
"BSD-3-Clause"
] | null | null | null | holoviews/tests/plotting/bokeh/testpathplot.py | Jacob-Barhak/holoviews | 5df0269595ca7befca202f9d05522c68983dc974 | [
"BSD-3-Clause"
] | null | null | null | holoviews/tests/plotting/bokeh/testpathplot.py | Jacob-Barhak/holoviews | 5df0269595ca7befca202f9d05522c68983dc974 | [
"BSD-3-Clause"
] | null | null | null | import datetime as dt
from unittest import SkipTest
import numpy as np
from holoviews.core import NdOverlay, HoloMap
from holoviews.core.options import Cycle
from holoviews.element import Path, Polygons, Contours
from holoviews.plotting.bokeh.util import bokeh_version
from holoviews.streams import PolyDraw
from .test... | 47.82438 | 120 | 0.550352 |
fc645e947b045d78d7f9d984300825956d1c1f0b | 2,391 | py | Python | retrievalnet/retrievalnet/models/mobilenetvlad.py | xuzhuang1996/hierarchical_loc | 807c32d9ed823f01a3fe5523df85201fe7e573f1 | [
"BSD-3-Clause"
] | 143 | 2018-09-04T12:00:53.000Z | 2022-03-16T01:15:03.000Z | retrievalnet/retrievalnet/models/mobilenetvlad.py | xiehongle/hierarchical_loc | 05a1be3d3c6a7f9bf0ff46525f8b4af8878f3e3e | [
"BSD-3-Clause"
] | 8 | 2018-09-06T08:31:56.000Z | 2021-02-05T17:29:41.000Z | retrievalnet/retrievalnet/models/mobilenetvlad.py | xiehongle/hierarchical_loc | 05a1be3d3c6a7f9bf0ff46525f8b4af8878f3e3e | [
"BSD-3-Clause"
] | 36 | 2018-09-05T03:54:31.000Z | 2021-12-14T12:47:37.000Z | import tensorflow as tf
from tensorflow.contrib import slim
from .base_model import BaseModel, Mode
from .backbones import mobilenet_v2 as mobilenet
from .layers import vlad, dimensionality_reduction, image_normalization
class Mobilenetvlad(BaseModel):
input_spec = {
'image': {'shape': [None, None, N... | 41.947368 | 89 | 0.612714 |
7c100ece796a34278de505054874604a7d8c63eb | 2,579 | py | Python | src/bindings/python/tests_compatibility/test_ngraph/test_adaptive_pool.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | src/bindings/python/tests_compatibility/test_ngraph/test_adaptive_pool.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | src/bindings/python/tests_compatibility/test_ngraph/test_adaptive_pool.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import ngraph as ng
import numpy as np
from tests_compatibility.runtime import get_runtime
def test_adaptive_avg_pool():
runtime = get_runtime()
input = np.reshape([0.0, 4, 1, 3, -2, -5, -2,
-2, 1, -3, 1... | 38.492537 | 83 | 0.437379 |
a035d530102634e55a76d14ed9f894f10945bcb5 | 1,001 | py | Python | declare_qtquick/widgets/api/qt3d/animation/__list__.py | likianta/declare-qtquick | 93c2ce49d841ccdeb0272085c5f731139927f0d7 | [
"MIT"
] | 3 | 2021-11-02T03:45:27.000Z | 2022-03-27T05:33:36.000Z | declare_qtquick/widgets/api/qt3d/animation/__list__.py | likianta/declare-qtquick | 93c2ce49d841ccdeb0272085c5f731139927f0d7 | [
"MIT"
] | null | null | null | declare_qtquick/widgets/api/qt3d/animation/__list__.py | likianta/declare-qtquick | 93c2ce49d841ccdeb0272085c5f731139927f0d7 | [
"MIT"
] | null | null | null | from .__base__ import *
from ...qtqml import QtObject
class AbstractAnimation(C, W.PsAbstractAnimation):
pass
class AbstractClipAnimator(C, W.PsAbstractClipAnimator):
pass
class AbstractClipBlendNode(C, W.PsAbstractClipBlendNode):
pass
class AdditiveClipBlend(C, W.PsAdditiveClipBlend):
pass
cl... | 16.966102 | 73 | 0.777223 |
29107c9d83cb0c21d3d375c2567d3162024235c1 | 2,683 | py | Python | source/buildVersion.py | raza-al-pakistani/raza-al-pakistani--v20022.3.1 | ac7febbbf4a32a476ee2f15994bbb3e77356c3ca | [
"bzip2-1.0.6"
] | null | null | null | source/buildVersion.py | raza-al-pakistani/raza-al-pakistani--v20022.3.1 | ac7febbbf4a32a476ee2f15994bbb3e77356c3ca | [
"bzip2-1.0.6"
] | null | null | null | source/buildVersion.py | raza-al-pakistani/raza-al-pakistani--v20022.3.1 | ac7febbbf4a32a476ee2f15994bbb3e77356c3ca | [
"bzip2-1.0.6"
] | null | null | null | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2022 NV Access Limited
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
import os
"""
This module contains non-localizable version information for NVDA such as the version string and major and minor numb... | 32.719512 | 125 | 0.713008 |
c027db7a7ae668ce2fc2ad5c5a3b2be34eddbc8d | 16,512 | py | Python | google/cloud/debugger_v2/services/debugger2/transports/grpc.py | nicain/python-debugger-client | c0a031e007935c9cc23f5a46346f1df1c3da4f13 | [
"Apache-2.0"
] | null | null | null | google/cloud/debugger_v2/services/debugger2/transports/grpc.py | nicain/python-debugger-client | c0a031e007935c9cc23f5a46346f1df1c3da4f13 | [
"Apache-2.0"
] | null | null | null | google/cloud/debugger_v2/services/debugger2/transports/grpc.py | nicain/python-debugger-client | c0a031e007935c9cc23f5a46346f1df1c3da4f13 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.268097 | 87 | 0.640807 |
8dc864fd440281949f5e5aac12c72a2cc8fc2585 | 19,755 | py | Python | TM1py/Services/ProcessService.py | cubewise-code/TM1py | 3748e4d471bc3090e674393e708d7c55b2527fe2 | [
"MIT"
] | 30 | 2017-09-01T08:11:21.000Z | 2018-12-28T10:42:12.000Z | TM1py/Services/ProcessService.py | cubewise-code/TM1py | 3748e4d471bc3090e674393e708d7c55b2527fe2 | [
"MIT"
] | 45 | 2017-09-01T15:30:55.000Z | 2019-01-24T07:33:14.000Z | TM1py/Services/ProcessService.py | cubewise-code/TM1py | 3748e4d471bc3090e674393e708d7c55b2527fe2 | [
"MIT"
] | 21 | 2017-10-25T15:38:30.000Z | 2018-12-11T11:34:21.000Z | # -*- coding: utf-8 -*-
import json
import time
import uuid
from typing import List, Dict, Tuple, Iterable
from requests import Response
from TM1py.Exceptions.Exceptions import TM1pyRestException
from TM1py.Objects.Process import Process
from TM1py.Services.ObjectService import ObjectService
from TM1py.Services.Rest... | 45.20595 | 123 | 0.618628 |
f9a50824cf397ec8f9630105068c82c4fcf99d2e | 3,254 | py | Python | tests/unit/test_pytest_hooks.py | brenordv/tavern | f88f954c0bfc0883c3027ab009a74e65fd892f67 | [
"MIT"
] | 3 | 2020-04-17T15:30:51.000Z | 2020-08-15T05:51:38.000Z | tests/unit/test_pytest_hooks.py | brenordv/tavern | f88f954c0bfc0883c3027ab009a74e65fd892f67 | [
"MIT"
] | null | null | null | tests/unit/test_pytest_hooks.py | brenordv/tavern | f88f954c0bfc0883c3027ab009a74e65fd892f67 | [
"MIT"
] | 1 | 2020-04-19T10:08:50.000Z | 2020-04-19T10:08:50.000Z | import pytest
from faker import Faker
from mock import Mock
from tavern.testutils.pytesthook.file import YamlFile
def mock_args():
"""Get a basic test config to initialise a YamlFile object with"""
fspath = "abc"
cargs = {"rootdir": "abc", "fspath": fspath}
config = Mock(**cargs)
session = Mo... | 23.926471 | 87 | 0.534112 |
954fc34f3df9ce4d6ae601a7f3c3856bb8785058 | 1,493 | py | Python | python/lib/packet/spse/parse.py | cschutijser/scion | 054cef53b31a577ed224a090d6a4fd3883fd520b | [
"Apache-2.0"
] | null | null | null | python/lib/packet/spse/parse.py | cschutijser/scion | 054cef53b31a577ed224a090d6a4fd3883fd520b | [
"Apache-2.0"
] | 1 | 2020-03-20T01:28:56.000Z | 2020-03-20T01:28:56.000Z | python/lib/packet/spse/parse.py | cschutijser/scion | 054cef53b31a577ed224a090d6a4fd3883fd520b | [
"Apache-2.0"
] | 2 | 2020-03-14T16:03:27.000Z | 2020-03-18T08:13:19.000Z | # Copyright 2017 ETH Zurich
#
# 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, sof... | 38.282051 | 81 | 0.745479 |
d9d2383b84bd097e9347da896cfd171b1bc7e9c1 | 8,133 | py | Python | Distributional RL/D4PG/AgentWorker.py | HzcIrving/DLRL_PlayGround | 0db9a4bdb87130d1d26aea1591ef74cbe6aaa43b | [
"MIT"
] | 27 | 2022-01-27T09:22:59.000Z | 2022-02-22T03:22:52.000Z | Distributional RL/D4PG/AgentWorker.py | HzcIrving/DLRL-PlayGround | 0db9a4bdb87130d1d26aea1591ef74cbe6aaa43b | [
"MIT"
] | null | null | null | Distributional RL/D4PG/AgentWorker.py | HzcIrving/DLRL-PlayGround | 0db9a4bdb87130d1d26aea1591ef74cbe6aaa43b | [
"MIT"
] | null | null | null | #! /usr/bin/enc python
# -*- coding: utf-8 -*-
# author: Irving He
# email: 1910646@tongji.edu.cn
import shutil
import os
import time
from collections import deque
from copy import deepcopy
import torch
from utils import OUNoise, make_gif, empty_torch_queue
from utils import Logger
from utils import create_env_wrapp... | 40.665 | 126 | 0.5699 |
e143528dff2610db9c591ea1652f3f0a10023bbe | 5,643 | py | Python | openstack_metrics.py | bilalbinameer/collectd-openstack | db45a6c23d153899aae4756b23617d6d168fc91e | [
"Apache-2.0"
] | null | null | null | openstack_metrics.py | bilalbinameer/collectd-openstack | db45a6c23d153899aae4756b23617d6d168fc91e | [
"Apache-2.0"
] | null | null | null | openstack_metrics.py | bilalbinameer/collectd-openstack | db45a6c23d153899aae4756b23617d6d168fc91e | [
"Apache-2.0"
] | null | null | null | import collectd
from NovaMetrics import NovaMetrics
from CinderMetrics import CinderMetrics
from NeutronMetrics import NeutronMetrics
def config_callback(conf):
"""Receive configuration block"""
project_name = 'demo'
project_domainid = 'default'
user_domainid = 'default'
interval = 10
testing ... | 33.790419 | 97 | 0.597377 |
12bb0b81420aca9192f82b9922999551935f3cda | 1,661 | py | Python | tests/extension/types_/mul_/without_all/types_mul_without_all.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/types_/mul_/without_all/types_mul_without_all.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/types_/mul_/without_all/types_mul_without_all.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
import math
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))))
from ... | 21.025316 | 84 | 0.603853 |
8a10db02cc522e0e42bedf00896c9a8651099b0f | 1,152 | py | Python | topaccuracy-fastai.py | kesaven/DeepLearning-IDS-Kesaven | 024448b4022915ea868d8bd616ab1d8d7d117125 | [
"MIT"
] | 67 | 2019-06-12T14:44:51.000Z | 2022-03-27T02:11:25.000Z | topaccuracy-fastai.py | Zeref97/Intrusion-Detection-System-using-Deep-Learning | 7a9e3c7123f227af23be0506b66e2f9d97cbe22d | [
"MIT"
] | 13 | 2019-07-18T18:19:53.000Z | 2021-08-28T17:23:37.000Z | topaccuracy-fastai.py | Zeref97/Intrusion-Detection-System-using-Deep-Learning | 7a9e3c7123f227af23be0506b66e2f9d97cbe22d | [
"MIT"
] | 33 | 2019-08-07T23:50:38.000Z | 2021-10-14T07:26:54.000Z | import sys
import operator
import os
folderPath = 'results/fastai'
def main(inputFile):
results = []
inputFile = os.path.join(folderPath, inputFile)
outputFile = '{}.ordered'.format(inputFile)
with open(inputFile, 'r') as fin:
data = fin.readlines()
for line in data:
values = lin... | 27.428571 | 68 | 0.605035 |
434413c9c6952c3e1bc9bb1941ea42e8d5b190f1 | 4,473 | py | Python | examples/applications/vader_ring.py | sibonyves/amuse | 5557bf88d14df1aa02133a199b6d60c0c57dcab7 | [
"Apache-2.0"
] | null | null | null | examples/applications/vader_ring.py | sibonyves/amuse | 5557bf88d14df1aa02133a199b6d60c0c57dcab7 | [
"Apache-2.0"
] | 12 | 2021-11-15T09:13:03.000Z | 2022-02-02T14:53:04.000Z | examples/applications/vader_ring.py | sibonyves/amuse | 5557bf88d14df1aa02133a199b6d60c0c57dcab7 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import scipy.constants as physcons
from scipy.special import ive
from amuse.units import units
from amuse.community.vader.interface import Vader
kB = physcons.k*1e7 | units.erg/units.K
mH = 1e3*physcons.physical_constants['atomic mass constant'][0]*1.00794 | units.g... | 29.427632 | 84 | 0.675162 |
f3402e3279b5a0aeb53dafc750edcaea2c321d4d | 4,553 | py | Python | tests/ut/python/dataset/test_opt_pass.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/ut/python/dataset/test_opt_pass.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/ut/python/dataset/test_opt_pass.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020 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... | 44.637255 | 118 | 0.682846 |
645824aa2e5ea84e1167d8e792af9b171a2a8490 | 5,294 | py | Python | examples/abod_example.py | paragon520/cascoKNN | 1de6ce6ca6615ef4cde4b6111727a55a26998594 | [
"BSD-2-Clause"
] | null | null | null | examples/abod_example.py | paragon520/cascoKNN | 1de6ce6ca6615ef4cde4b6111727a55a26998594 | [
"BSD-2-Clause"
] | null | null | null | examples/abod_example.py | paragon520/cascoKNN | 1de6ce6ca6615ef4cde4b6111727a55a26998594 | [
"BSD-2-Clause"
] | 1 | 2021-03-03T08:45:04.000Z | 2021-03-03T08:45:04.000Z | # -*- coding: utf-8 -*-
"""Example of using Angle-base outlier detection (ABOD) for outlier detection
"""
# Author: Yue Zhao <yuezhao@cs.toronto.edu>
# License: BSD 2 clause
from __future__ import division
from __future__ import print_function
import os
import sys
# temporary solution for relative imports in case py... | 36.510345 | 79 | 0.666981 |
4790b4afdee33f433fb6d31ffb99a43bf9d7a87d | 57,070 | py | Python | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import division
import copy
from fnmatch import translate
from math import isinf, isnan
from os.path import isfile
from re import compile
import requests
from prometheus_client.samples im... | 47.757322 | 120 | 0.628228 |
f7d4ab4bc5a73fa69f4c1397ff55316c0dfed9fb | 2,063 | py | Python | pkinter/colourpickerbutton.py | not7cd/pkinter | 5236ccaf78d211f1113bdd58478a1d5b16a8c8b0 | [
"MIT"
] | 33 | 2017-01-08T13:20:02.000Z | 2022-03-02T20:10:39.000Z | pkinter/colourpickerbutton.py | not7cd/pkinter | 5236ccaf78d211f1113bdd58478a1d5b16a8c8b0 | [
"MIT"
] | 10 | 2017-05-12T11:16:25.000Z | 2020-11-12T18:39:22.000Z | pkinter/colourpickerbutton.py | not7cd/pkinter | 5236ccaf78d211f1113bdd58478a1d5b16a8c8b0 | [
"MIT"
] | 6 | 2017-01-29T21:40:55.000Z | 2021-04-08T18:13:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""""""
import tkinter as tk
from tkinter import ttk
from tkinter.colorchooser import *
# link
__title__ = "ColourPickerButton"
__version__ = "1.3.5"
__author__ = "DeflatedPickle"
class ColourPickerButton(ttk.Button):
"""
-----DESCRIPTION-----
A TTK ... | 27.144737 | 109 | 0.588948 |
cf9e6654728912346264e6dd546065178d3fb28c | 23,067 | py | Python | tests/postgres/builder/test_postgres_query_builder.py | marcelovieirahonorio/orm | f4eab30f147244ae4255d66f956664ae41241694 | [
"MIT"
] | null | null | null | tests/postgres/builder/test_postgres_query_builder.py | marcelovieirahonorio/orm | f4eab30f147244ae4255d66f956664ae41241694 | [
"MIT"
] | null | null | null | tests/postgres/builder/test_postgres_query_builder.py | marcelovieirahonorio/orm | f4eab30f147244ae4255d66f956664ae41241694 | [
"MIT"
] | null | null | null | import inspect
import unittest
from src.masoniteorm.connections import ConnectionFactory
from src.masoniteorm.models import Model
from src.masoniteorm.query import QueryBuilder
from src.masoniteorm.query.grammars import PostgresGrammar
from tests.utils import MockConnectionFactory
class MockConnection:
connecti... | 30.962416 | 167 | 0.541336 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.