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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
917dd4fbe5fe3f01d17527951428baefbf9dad35 | 414 | py | Python | 2016-12-03/manager.py | awesome-archive/mp | e904c7c858fe5df5859f6282e5d4906a96abd6e5 | [
"Apache-2.0"
] | 90 | 2016-11-29T07:21:58.000Z | 2022-03-29T06:41:01.000Z | 2016-12-03/manager.py | awesome-archive/mp | e904c7c858fe5df5859f6282e5d4906a96abd6e5 | [
"Apache-2.0"
] | 1 | 2020-01-19T10:03:12.000Z | 2020-01-19T10:03:12.000Z | 2016-12-03/manager.py | awesome-archive/mp | e904c7c858fe5df5859f6282e5d4906a96abd6e5 | [
"Apache-2.0"
] | 34 | 2016-12-07T09:26:34.000Z | 2020-09-14T01:57:11.000Z | from multiprocessing import Manager, Process
def modify(ns, lproxy, dproxy):
ns.a **= 2
lproxy.extend(['b', 'c'])
dproxy['b'] = 0
manager = Manager()
ns = manager.Namespace()
ns.a = 1
lproxy = manager.list()
lproxy.append('a')
dproxy = manager.dict()
dproxy['b'] = 2
p = Process(target=modify, args=(ns, ... | 16.56 | 53 | 0.652174 |
f7b79ddef6d013b580ada4bc829633a496a93dd1 | 4,199 | py | Python | stanCode_Projects/break_out_game/extension.py | calvin0123/sc-projects | 88ac98e3543a1399387c2033f36dc5c6b86c488c | [
"MIT"
] | null | null | null | stanCode_Projects/break_out_game/extension.py | calvin0123/sc-projects | 88ac98e3543a1399387c2033f36dc5c6b86c488c | [
"MIT"
] | null | null | null | stanCode_Projects/break_out_game/extension.py | calvin0123/sc-projects | 88ac98e3543a1399387c2033f36dc5c6b86c488c | [
"MIT"
] | 1 | 2021-12-04T22:50:23.000Z | 2021-12-04T22:50:23.000Z | """
stanCode Breakout Project
Adapted from Eric Roberts's Breakout by
Sonja Johnson-Yu, Kylie Jue, Nick Bowman,
and Jerry Liao
-----------------------------------------------
File : extension.py
Name : Calvin Chen
This file try to write the extension of breakout game.
But I think there is a little bit wrong. When the s... | 38.87963 | 111 | 0.601095 |
4639948051d4738ccf2e827aa99e80dd623c6e77 | 3,494 | py | Python | CorrectingImageOrientation/utilities/nn/cnn/minivggnet.py | gopalchettri/DeepLearningPractitioners | 475e764471e1a4280ae94fea5d4a56f7a7c40b29 | [
"Apache-2.0"
] | null | null | null | CorrectingImageOrientation/utilities/nn/cnn/minivggnet.py | gopalchettri/DeepLearningPractitioners | 475e764471e1a4280ae94fea5d4a56f7a7c40b29 | [
"Apache-2.0"
] | null | null | null | CorrectingImageOrientation/utilities/nn/cnn/minivggnet.py | gopalchettri/DeepLearningPractitioners | 475e764471e1a4280ae94fea5d4a56f7a7c40b29 | [
"Apache-2.0"
] | null | null | null | # importing required libraries
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import MaxPool2D
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Flatten
from te... | 41.105882 | 105 | 0.672582 |
a592a7e232617a9cb7891f617f1c18ea018e5e11 | 1,439 | py | Python | vespene/config/workers.py | Conan-Kudo/vespene | 9e9977523f45586e1326ccd77d8cc0cb10591a07 | [
"Apache-2.0"
] | 680 | 2018-10-29T12:12:10.000Z | 2019-04-27T09:52:58.000Z | vespene/config/workers.py | Conan-Kudo/vespene | 9e9977523f45586e1326ccd77d8cc0cb10591a07 | [
"Apache-2.0"
] | 110 | 2018-10-29T12:33:34.000Z | 2019-02-14T02:31:43.000Z | vespene/config/workers.py | Conan-Kudo/vespene | 9e9977523f45586e1326ccd77d8cc0cb10591a07 | [
"Apache-2.0"
] | 92 | 2018-10-29T12:21:12.000Z | 2019-06-08T11:08:08.000Z | # Copyright 2018, Michael DeHaan LLC
# License: Apache License Version 2.0
# ---------------------------------------------------------------------------
# workers.py - configuration related to worker setup. This file *CAN* be
# different per worker.
# -----------------------------------------------------------------... | 41.114286 | 86 | 0.642113 |
36782faa6c709f4b7e84876792ee200d25e69bc2 | 320 | py | Python | flickrsmartsync_oauth/__main__.py | inspector2211/flickrsmartsync_oauth | bf5e3ccb4089c491512e458d48cad851df4ccd55 | [
"MIT"
] | 4 | 2017-07-11T20:26:15.000Z | 2018-02-26T05:59:03.000Z | flickrsmartsync_oauth/__main__.py | inspector2211/flickrsmartsync_oauth | bf5e3ccb4089c491512e458d48cad851df4ccd55 | [
"MIT"
] | 2 | 2017-07-20T13:21:02.000Z | 2017-11-27T05:35:42.000Z | flickrsmartsync_oauth/__main__.py | inspector2211/flickrsmartsync_oauth | bf5e3ccb4089c491512e458d48cad851df4ccd55 | [
"MIT"
] | 4 | 2017-09-01T20:45:39.000Z | 2018-08-26T14:15:01.000Z | import os
import sys
if __name__ == "__main__": # if running from source
module_dir = os.path.dirname(__file__)
parent_dir = os.path.dirname(module_dir)
sys.path.insert(0, parent_dir) # insert parent directory at start of module search path
import flickrsmartsync_oauth
flickrsmartsync_oauth.main()
| 32 | 91 | 0.75 |
9c4b7085db299f3c21d470ecb81df57f6a54f2d6 | 11,142 | py | Python | api/base/exceptions.py | mattclark/osf.io | 7a362ceb6af3393d3d0423aafef336ee13277303 | [
"Apache-2.0"
] | null | null | null | api/base/exceptions.py | mattclark/osf.io | 7a362ceb6af3393d3d0423aafef336ee13277303 | [
"Apache-2.0"
] | null | null | null | api/base/exceptions.py | mattclark/osf.io | 7a362ceb6af3393d3d0423aafef336ee13277303 | [
"Apache-2.0"
] | null | null | null | import httplib as http
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException, AuthenticationFailed
def get_resource_object_member(error_key, context):
from api.base.serializers import RelationshipField
field = context['vie... | 39.232394 | 205 | 0.705529 |
56e7913a82135cd4924211448e72394c413b0ecc | 16,279 | py | Python | src/rna/steps/coverage.py | nellore/rail | 8827a7a0b1195c04cddf6d7a23ec7885619716ca | [
"MIT"
] | 78 | 2015-04-13T19:50:16.000Z | 2022-02-02T10:39:42.000Z | src/rna/steps/coverage.py | nellore/rail | 8827a7a0b1195c04cddf6d7a23ec7885619716ca | [
"MIT"
] | 37 | 2015-04-30T16:31:27.000Z | 2020-11-30T18:58:55.000Z | src/rna/steps/coverage.py | nellore/rail | 8827a7a0b1195c04cddf6d7a23ec7885619716ca | [
"MIT"
] | 17 | 2015-04-12T00:02:57.000Z | 2021-12-01T05:16:15.000Z | #!/usr/bin/env python
"""
Rail-RNA-coverage
Follows Rail-RNA-coverage_pre
Reduce step in MapReduce pipelines that outputs normalization factors for
sample coverages, both for all primary alignments and for "uniquely mapping"
reads. Each normalization factor is computed from the histogram of
base coverage (horizontal ... | 44.6 | 79 | 0.589287 |
6143f4240406325e29bfd0cc43d0ecf55edd6f5e | 16,349 | py | Python | spyder/plugins/editor/panels/scrollflag.py | keepiru/spyder | b9d4bf1719fcd0d3c209163e82a67abad8129ffc | [
"MIT"
] | null | null | null | spyder/plugins/editor/panels/scrollflag.py | keepiru/spyder | b9d4bf1719fcd0d3c209163e82a67abad8129ffc | [
"MIT"
] | null | null | null | spyder/plugins/editor/panels/scrollflag.py | keepiru/spyder | b9d4bf1719fcd0d3c209163e82a67abad8129ffc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
This module contains the Scroll Flag panel
"""
# Standard library imports
from __future__ import division
from math import ceil
# Third party imports
from qtpy.Q... | 38.92619 | 79 | 0.616735 |
1537ab9c6a637e93db96a660f893de4dd2dd8ec1 | 152 | py | Python | hackerrank/itertools/product.py | alex-d-bondarev/learn-python | b119cb1e09a57e93abc73383c014cc8ceba18acf | [
"MIT"
] | null | null | null | hackerrank/itertools/product.py | alex-d-bondarev/learn-python | b119cb1e09a57e93abc73383c014cc8ceba18acf | [
"MIT"
] | null | null | null | hackerrank/itertools/product.py | alex-d-bondarev/learn-python | b119cb1e09a57e93abc73383c014cc8ceba18acf | [
"MIT"
] | null | null | null | from itertools import product
if __name__ == '__main__':
A = map(int, input().split())
B = map(int, input().split())
print(*product(A, B)) | 21.714286 | 33 | 0.605263 |
2381257cc21168f167f669c9af4f2c3997dd554a | 2,793 | py | Python | asphalt/wamp/component.py | Asphalt-framework/asphalt-wamp | 2eb3f36cf537af8caedac080b34e661b24445923 | [
"Apache-2.0"
] | 10 | 2015-11-27T17:48:23.000Z | 2017-10-30T04:28:36.000Z | asphalt/wamp/component.py | Asphalt-framework/asphalt-wamp | 2eb3f36cf537af8caedac080b34e661b24445923 | [
"Apache-2.0"
] | null | null | null | asphalt/wamp/component.py | Asphalt-framework/asphalt-wamp | 2eb3f36cf537af8caedac080b34e661b24445923 | [
"Apache-2.0"
] | 2 | 2017-01-31T07:39:43.000Z | 2017-03-02T05:56:04.000Z | import logging
from typing import Any, Dict, Tuple, Optional, List # noqa: F401
import txaio
from asphalt.core import Component, Context, merge_config, context_teardown
from async_generator import yield_
from typeguard import check_argument_types
from asphalt.exceptions import ExtrasProvider
from asphalt.wamp.client... | 40.478261 | 98 | 0.67884 |
492d661208b3c4ea5ecda9849f0d2d518b6fd8ef | 571 | py | Python | exercises/fundamentals/test/test_mammal.py | bmazey/summer2020 | 0e943c356677f1d0ec55da5fe4b30a54b37507cd | [
"MIT"
] | null | null | null | exercises/fundamentals/test/test_mammal.py | bmazey/summer2020 | 0e943c356677f1d0ec55da5fe4b30a54b37507cd | [
"MIT"
] | null | null | null | exercises/fundamentals/test/test_mammal.py | bmazey/summer2020 | 0e943c356677f1d0ec55da5fe4b30a54b37507cd | [
"MIT"
] | null | null | null | from exercises.fundamentals.src.zoo.mammal import Mammal
def test_is_warm_blooded():
microbat = Mammal('microbat', True, True)
mandrill = Mammal('mandrill', True, True)
culpeo = Mammal('culpeo', True, True)
assert microbat.is_warm_blooded() == 'microbat is warm-blooded!'
assert mandrill.is_warm_b... | 33.588235 | 69 | 0.714536 |
7c45e16ad8a65f0c6e76e5c6e67411842f48b6a8 | 218 | py | Python | __init__.py | jackievilladsen/dynspec | 87101b188d7891644d848e781bca00f044fe3f0b | [
"MIT"
] | 2 | 2019-05-01T00:34:28.000Z | 2021-02-10T09:18:10.000Z | __init__.py | jackievilladsen/dynspec | 87101b188d7891644d848e781bca00f044fe3f0b | [
"MIT"
] | null | null | null | __init__.py | jackievilladsen/dynspec | 87101b188d7891644d848e781bca00f044fe3f0b | [
"MIT"
] | null | null | null | __all__ = ['tbavg','extract_dynspec','__plot__','custom_colormap']
from numpy import load
def load_dict(savefile):
# load a dictionary that has been saved using numpy.save
return load(savefile).reshape(1)[0]
| 27.25 | 66 | 0.738532 |
d627f8b67d4a63be93d08b15e84ab0ace4d23b3c | 1,940 | py | Python | data/p4VQE/R4/benchmark/startCirq793.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startCirq793.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startCirq793.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=14
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 29.393939 | 77 | 0.692784 |
3cab08629b30111114e01484ab49b594bbdb9dd0 | 3,948 | py | Python | apt_repoman/connection.py | memory/repoman | 4c5cdfba85afcab5a1219fa5629abc457de27ed5 | [
"Apache-2.0"
] | 1 | 2017-07-01T21:46:40.000Z | 2017-07-01T21:46:40.000Z | apt_repoman/connection.py | memory/repoman | 4c5cdfba85afcab5a1219fa5629abc457de27ed5 | [
"Apache-2.0"
] | null | null | null | apt_repoman/connection.py | memory/repoman | 4c5cdfba85afcab5a1219fa5629abc457de27ed5 | [
"Apache-2.0"
] | 6 | 2017-07-13T21:41:14.000Z | 2020-08-07T19:40:25.000Z |
# stdlib imports
import logging
import time
# pypi imports
from boto3 import Session
LOG = logging.getLogger(__name__)
class Connection(object):
def __init__(self, role_arn='', profile_name='', region=None):
self._log = LOG or logging.getLogger(__name__)
self.role_arn = role_arn
self.... | 31.584 | 76 | 0.563323 |
502d57dff9f935a1fde08efc0fe73238061be9b9 | 5,046 | py | Python | src/tests/ftest/pool/multiple_creates_test.py | vatelzh/daos | 3aca9ae033946ca24179ba0a180c0b8422cd2738 | [
"Apache-2.0"
] | 1 | 2019-11-28T07:26:38.000Z | 2019-11-28T07:26:38.000Z | src/tests/ftest/pool/multiple_creates_test.py | vatelzh/daos | 3aca9ae033946ca24179ba0a180c0b8422cd2738 | [
"Apache-2.0"
] | 52 | 2019-12-04T05:47:10.000Z | 2020-06-09T03:26:12.000Z | src/tests/ftest/pool/multiple_creates_test.py | vatelzh/daos | 3aca9ae033946ca24179ba0a180c0b8422cd2738 | [
"Apache-2.0"
] | 8 | 2019-12-04T08:26:00.000Z | 2020-06-09T07:40:11.000Z | #!/usr/bin/python
'''
(C) Copyright 2018-2019 Intel Corporation.
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 applic... | 32.980392 | 79 | 0.601467 |
539929170c60458d45328b54d37d8713afe38ab8 | 13,888 | py | Python | value_iteration/cartpole.py | milutter/value_iteration | c2e68af2d8dbc37c4f0d396e9c620c06c3dd0cf6 | [
"MIT"
] | 2 | 2021-11-10T12:25:28.000Z | 2021-11-25T08:17:48.000Z | value_iteration/cartpole.py | milutter/value_iteration | c2e68af2d8dbc37c4f0d396e9c620c06c3dd0cf6 | [
"MIT"
] | null | null | null | value_iteration/cartpole.py | milutter/value_iteration | c2e68af2d8dbc37c4f0d396e9c620c06c3dd0cf6 | [
"MIT"
] | 1 | 2021-11-10T12:25:16.000Z | 2021-11-10T12:25:16.000Z | import numpy as np
import torch
from value_iteration.pendulum import BaseSystem
from value_iteration.cost_functions import ArcTangent, SineQuadraticCost, BarrierCost
CUDA_AVAILABLE = torch.cuda.is_available()
class Cartpole(BaseSystem):
name = "Cartpole"
labels = ('x', 'theta', 'x_dot', 'theta_dot')
def... | 42.212766 | 143 | 0.558324 |
f236ef22492d0dc82e980fa6efe1d1f858814254 | 1,572 | py | Python | blender/blender_world_to_camera_coordinates_with_depth.py | quickgrid/code-lab | 634f97af389df7e1d120c4e0fcb5072a8e8f8d99 | [
"MIT"
] | null | null | null | blender/blender_world_to_camera_coordinates_with_depth.py | quickgrid/code-lab | 634f97af389df7e1d120c4e0fcb5072a8e8f8d99 | [
"MIT"
] | null | null | null | blender/blender_world_to_camera_coordinates_with_depth.py | quickgrid/code-lab | 634f97af389df7e1d120c4e0fcb5072a8e8f8d99 | [
"MIT"
] | null | null | null | """Get world coordinates to image coordinates with depth.
Warning: The image coordinates are flipped, so they or the image must be flipped horizontally to match.
References:
- https://blender.stackexchange.com/questions/882/how-to-find-image-coordinates-of-the-rendered-vertex
"""
import bpy
from bpy_extras.objec... | 26.644068 | 106 | 0.715649 |
1fb036d01ead758e157ef52afb9904ccb1eba510 | 3,857 | py | Python | HandTrackingModule.py | dreamboysatvik/AIR-MOUSE | 4ccc8ced5b035f307e0b437b7166e619a1b5ae5d | [
"Apache-2.0"
] | null | null | null | HandTrackingModule.py | dreamboysatvik/AIR-MOUSE | 4ccc8ced5b035f307e0b437b7166e619a1b5ae5d | [
"Apache-2.0"
] | null | null | null | HandTrackingModule.py | dreamboysatvik/AIR-MOUSE | 4ccc8ced5b035f307e0b437b7166e619a1b5ae5d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 17 17:51:02 2021
@author: hp
"""
import cv2
import mediapipe as mp
import time
import math
import numpy as np
class handDetector():
def __init__(self, mode=False, maxHands=2, detectionCon=0.5, trackCon=0.5):
self.mode = mode
self.maxHan... | 31.357724 | 86 | 0.504278 |
b006c94ca8f0a16e4632d878a1b45d168a2550cb | 371 | py | Python | config.py | daixiangzi/Grad_Cam-pytorch-resnet50 | c9e9c3b2ddcd520d4893645fab36fdb236f88865 | [
"Apache-2.0"
] | 19 | 2020-03-05T12:01:01.000Z | 2021-11-25T07:18:06.000Z | config.py | daixiangzi/Grad_Cam-pytorch-resnet50 | c9e9c3b2ddcd520d4893645fab36fdb236f88865 | [
"Apache-2.0"
] | null | null | null | config.py | daixiangzi/Grad_Cam-pytorch-resnet50 | c9e9c3b2ddcd520d4893645fab36fdb236f88865 | [
"Apache-2.0"
] | 5 | 2020-10-03T07:43:28.000Z | 2022-02-01T12:30:08.000Z | class Config(object):
train_data='/home/daixiangzi/dataset/dog_cat/shell/train.txt'
test_data = '/home/daixiangzi/dataset/dog_cat/shell/val.txt'
save_dir = '/home/project/save_model/'
gpu_id = '0'
train_batch = 64
test_batch = 16
epochs = 100
seed = 666
workers=4
num_class=2
fre_print=2
weight_decay = 1e-4
... | 21.823529 | 62 | 0.714286 |
43474dba7921279e9942b5fc76db4f2a859329cc | 3,044 | py | Python | commander/thirdparty/covertutils/datamanipulation/compressor.py | how2how/ToyHome | 4457b1d28e21ed6fd4ab980a0f7fed345c570ae3 | [
"Apache-2.0"
] | 1 | 2020-07-26T01:08:30.000Z | 2020-07-26T01:08:30.000Z | commander/thirdparty/covertutils/datamanipulation/compressor.py | how2how/ToyHome | 4457b1d28e21ed6fd4ab980a0f7fed345c570ae3 | [
"Apache-2.0"
] | null | null | null | commander/thirdparty/covertutils/datamanipulation/compressor.py | how2how/ToyHome | 4457b1d28e21ed6fd4ab980a0f7fed345c570ae3 | [
"Apache-2.0"
] | null | null | null | import bz2
import zlib
class Compressor :
"""
The Compressor class initializes the **bz2** and **zlib** compression routines.
It detects the used compression on a **trial and error** base, eliminating the need of flag bytes containing such information.
"""
def __init__( self ) :
self.comps = [bz2.compress, zli... | 29.269231 | 193 | 0.703351 |
397c43649e0e4d6d680ed78b0257c3e4f48eeb76 | 570 | py | Python | apps/misc_tests/resources/lib/builder/none.py | PremierLangage/premierlangage | 7134a2aadffee2bf264abee6c4b23ea33f1b390b | [
"CECILL-B"
] | 8 | 2019-01-30T13:51:59.000Z | 2022-01-08T03:26:53.000Z | apps/misc_tests/resources/lib/builder/none.py | PremierLangage/premierlangage | 7134a2aadffee2bf264abee6c4b23ea33f1b390b | [
"CECILL-B"
] | 286 | 2019-01-18T21:35:51.000Z | 2022-03-24T18:53:59.000Z | home/lib/builder/none.py | PremierLangage/premierlangage | 7134a2aadffee2bf264abee6c4b23ea33f1b390b | [
"CECILL-B"
] | 4 | 2019-02-11T13:38:30.000Z | 2021-03-02T20:59:00.000Z | #!/usr/bin/env python3
# coding: utf-8
import sys, json, jsonpickle
if __name__ == "__main__":
if len(sys.argv) < 3:
msg = ("Sandbox did not call builder properly:\n"
+"Usage: python3 builder.py [input_json] [output_json]")
print(msg, file=sys.stderr)
sys.exit(1)
input_... | 24.782609 | 71 | 0.578947 |
4941a81f08ca460855badcf767a89d0b7a6d0636 | 1,500 | py | Python | eden/integration/lib/util.py | jmswen/eden | 5e0b051703fa946cc77fc43004435ae6b20599a1 | [
"BSD-3-Clause"
] | null | null | null | eden/integration/lib/util.py | jmswen/eden | 5e0b051703fa946cc77fc43004435ae6b20599a1 | [
"BSD-3-Clause"
] | null | null | null | eden/integration/lib/util.py | jmswen/eden | 5e0b051703fa946cc77fc43004435ae6b20599a1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
... | 34.090909 | 77 | 0.69 |
1980e6d3014a413ffd6662caabfc00c90a42dc1e | 50,208 | py | Python | lib/python/pyflyby/_parse.py | rahasurana/pyflyby | 72fdd902972d61c8a283fee6072bd75695787f12 | [
"BSD-3-Clause"
] | 1 | 2019-09-06T07:10:08.000Z | 2019-09-06T07:10:08.000Z | lib/python/pyflyby/_parse.py | rahasurana/pyflyby | 72fdd902972d61c8a283fee6072bd75695787f12 | [
"BSD-3-Clause"
] | 1 | 2019-08-20T15:35:27.000Z | 2019-08-20T15:49:19.000Z | lib/python/pyflyby/_parse.py | rahasurana/pyflyby | 72fdd902972d61c8a283fee6072bd75695787f12 | [
"BSD-3-Clause"
] | 1 | 2021-04-17T15:31:30.000Z | 2021-04-17T15:31:30.000Z | # pyflyby/_parse.py.
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT
from __future__ import (absolute_import, division, print_function,
with_statement)
import ast
from collections import namedtuple
from functools ... | 37.357143 | 103 | 0.594606 |
778c7c08982527db71d71a1375bdbb14ecd9ab77 | 1,700 | py | Python | openpecha/core/layer.py | ta4tsering/openpecha-toolkit | ff24b4813fb8146a4327e746e4024890b6807bea | [
"Apache-2.0"
] | 1 | 2020-01-28T05:10:14.000Z | 2020-01-28T05:10:14.000Z | openpecha/core/layer.py | ta4tsering/openpecha-toolkit | ff24b4813fb8146a4327e746e4024890b6807bea | [
"Apache-2.0"
] | 38 | 2019-11-12T10:49:25.000Z | 2021-04-07T12:10:24.000Z | openpecha/core/layer.py | ta4tsering/openpecha-toolkit | ff24b4813fb8146a4327e746e4024890b6807bea | [
"Apache-2.0"
] | 6 | 2019-11-14T12:30:35.000Z | 2020-05-12T01:50:13.000Z | from datetime import datetime
from enum import Enum
from typing import Dict, Optional
from pydantic import BaseModel, validator
from .ids import get_pecha_id, get_uuid
class LayerEnum(Enum):
index = "index"
book_title = "BookTitle"
sub_title = "SubTitle"
book_number = "BookNumber"
poti_title = ... | 22.368421 | 64 | 0.645294 |
7100f1b6122d8c4203f3bedaddbd90e4ce2a966d | 6,081 | py | Python | tests/resource/generics/test_git.py | NickHugi/PyKotor | cab1089f8a8a135861bef45340203718d39f5e1f | [
"MIT"
] | 1 | 2022-02-21T15:17:28.000Z | 2022-02-21T15:17:28.000Z | tests/resource/generics/test_git.py | NickHugi/PyKotor | cab1089f8a8a135861bef45340203718d39f5e1f | [
"MIT"
] | 1 | 2022-03-12T16:06:23.000Z | 2022-03-12T16:06:23.000Z | tests/resource/generics/test_git.py | NickHugi/PyKotor | cab1089f8a8a135861bef45340203718d39f5e1f | [
"MIT"
] | null | null | null | from unittest import TestCase
from pykotor.common.language import LocalizedString
from pykotor.common.misc import EquipmentSlot, Game, Color
from pykotor.resource.formats.gff import load_gff
from pykotor.resource.generics.git import construct_git, dismantle_git
TEST_FILE = "../../files/test.git"
class TestGIT(TestC... | 54.294643 | 89 | 0.691169 |
cd29365ca09399b754039b92cea3ec91c3ecd346 | 148 | py | Python | icevision/models/mmdet/models/faster_rcnn/backbones/__init__.py | matt-deboer/icevision | bf886e558cc0c5ba5c84559514b8330c64d72f8d | [
"Apache-2.0"
] | null | null | null | icevision/models/mmdet/models/faster_rcnn/backbones/__init__.py | matt-deboer/icevision | bf886e558cc0c5ba5c84559514b8330c64d72f8d | [
"Apache-2.0"
] | null | null | null | icevision/models/mmdet/models/faster_rcnn/backbones/__init__.py | matt-deboer/icevision | bf886e558cc0c5ba5c84559514b8330c64d72f8d | [
"Apache-2.0"
] | null | null | null | from icevision.models.mmdet.models.faster_rcnn.backbones.resnet_fpn import *
from icevision.models.mmdet.models.faster_rcnn.backbones.swin import *
| 49.333333 | 76 | 0.851351 |
5f1e62cc47587406b4741d3d7cd5a2aad0b6e1ab | 9,546 | py | Python | src/neuro_comma/dataset.py | marlon-br/neuro-comma | 575883efa30387dae3366034147e915ec2b19866 | [
"MIT"
] | 5 | 2021-09-09T11:30:34.000Z | 2021-12-13T19:37:06.000Z | src/neuro_comma/dataset.py | marlon-br/neuro-comma | 575883efa30387dae3366034147e915ec2b19866 | [
"MIT"
] | null | null | null | src/neuro_comma/dataset.py | marlon-br/neuro-comma | 575883efa30387dae3366034147e915ec2b19866 | [
"MIT"
] | null | null | null | from typing import Dict, List, Optional, Tuple, Union
from typing_extensions import TypedDict
import numpy as np
import torch
from torch.tensor import Tensor
from tqdm import tqdm
from transformers import PreTrainedTokenizer
from neuro_comma.augmentation import AUGMENTATIONS
from neuro_comma.pretrained import TOKEN_I... | 38.184 | 163 | 0.528913 |
f23dbfa14bda6ff2db7419059e94da495c662ee5 | 1,893 | py | Python | tests/builtins/test_enumerate.py | jacebrowning/voc | 7bc84e8a870674d300ad5083748cf6b826e7fb68 | [
"BSD-3-Clause"
] | 850 | 2015-08-17T16:45:22.000Z | 2019-03-24T07:50:15.000Z | tests/builtins/test_enumerate.py | jacebrowning/voc | 7bc84e8a870674d300ad5083748cf6b826e7fb68 | [
"BSD-3-Clause"
] | 506 | 2015-09-26T18:20:00.000Z | 2019-03-19T18:16:18.000Z | tests/builtins/test_enumerate.py | jacebrowning/voc | 7bc84e8a870674d300ad5083748cf6b826e7fb68 | [
"BSD-3-Clause"
] | 670 | 2015-09-12T21:57:44.000Z | 2019-03-19T13:15:33.000Z | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class EnumerateTests(TranspileTestCase):
def test_enumerate(self):
self.assertCodeExecution("""
lst=['a','b','c','d','e']
print(list(enumerate(lst)))
lst=['a','b','c','d','e']
print(list(enumera... | 30.047619 | 80 | 0.493925 |
694e6e8f59d1dd9bf02240fa7ff9fe3f833b6274 | 2,177 | py | Python | examples/advanced/exogenous/run.py | suddhu/pddlstream | 0a027154a24ce06a1ca074f6f2053fde7fb0a190 | [
"MIT"
] | 1 | 2019-02-08T17:06:41.000Z | 2019-02-08T17:06:41.000Z | examples/advanced/exogenous/run.py | suddhu/pddlstream | 0a027154a24ce06a1ca074f6f2053fde7fb0a190 | [
"MIT"
] | 1 | 2020-03-21T16:53:53.000Z | 2020-03-21T16:53:53.000Z | examples/advanced/exogenous/run.py | yijiangh/pddlstream | d0eb256e88b8b5174fbd136a82867fd9e9cebc67 | [
"MIT"
] | 1 | 2018-12-14T09:12:03.000Z | 2018-12-14T09:12:03.000Z | #!/usr/bin/env python
from __future__ import print_function
import cProfile
import pstats
import numpy as np
from pddlstream.algorithms.focused import solve_focused
from pddlstream.algorithms.incremental import solve_incremental
from pddlstream.language.generator import from_fn
from pddlstream.utils import print_sol... | 28.644737 | 97 | 0.629766 |
9d7ab812e943f6ad8e465c956a36af1cf93a2eb9 | 15,721 | py | Python | afqinsight/tests/test_datasets.py | richford/AFQ-Insight | 3bf80e389f423361b7e942815bd06c77f3ef4785 | [
"BSD-3-Clause"
] | null | null | null | afqinsight/tests/test_datasets.py | richford/AFQ-Insight | 3bf80e389f423361b7e942815bd06c77f3ef4785 | [
"BSD-3-Clause"
] | 66 | 2019-05-03T22:10:11.000Z | 2022-02-20T18:33:38.000Z | afqinsight/tests/test_datasets.py | richford/AFQ-Insight | 3bf80e389f423361b7e942815bd06c77f3ef4785 | [
"BSD-3-Clause"
] | 8 | 2018-05-17T04:16:30.000Z | 2022-02-07T18:00:57.000Z | import numpy as np
import os.path as op
import pandas as pd
import pytest
import tempfile
import torch
import afqinsight as afqi
from afqinsight.datasets import (
bundles2channels,
load_afq_data,
download_sarica,
download_weston_havens,
AFQDataset,
standardize_subject_id,
)
data_path = op.join... | 37.430952 | 86 | 0.614974 |
b4a213980b8bfc4388a321adc4e7fe68e8cfe038 | 24,847 | py | Python | pgmpy/estimators/ConstraintBasedEstimator.py | Lostefra/pgmpy | d39a0c86005f86a7543d93ae7703f22f026bf3e6 | [
"MIT"
] | 1 | 2022-01-18T08:37:04.000Z | 2022-01-18T08:37:04.000Z | pgmpy/estimators/ConstraintBasedEstimator.py | Lostefra/pgmpy | d39a0c86005f86a7543d93ae7703f22f026bf3e6 | [
"MIT"
] | null | null | null | pgmpy/estimators/ConstraintBasedEstimator.py | Lostefra/pgmpy | d39a0c86005f86a7543d93ae7703f22f026bf3e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from warnings import warn
from itertools import combinations
from pgmpy.base import UndirectedGraph
from pgmpy.base import DAG
from pgmpy.estimators import StructureEstimator
from pgmpy.independencies import Independencies, IndependenceAssertion
class ConstraintBasedEstimator(StructureEstimato... | 43.212174 | 115 | 0.568439 |
efff3cf42cac9a3ada269941b6c067bb73a60c70 | 4,055 | py | Python | lib/python2.7/site-packages/networkx/readwrite/tests/test_sparse6.py | nishaero/wifi-userseg-ryu | 1132f2c813b79eff755bdd1a9e73e7ad3980af7c | [
"Apache-2.0"
] | 15 | 2018-04-26T08:17:18.000Z | 2021-03-05T08:44:13.000Z | lib/python2.7/site-packages/networkx/readwrite/tests/test_sparse6.py | nishaero/wifi-userseg-ryu | 1132f2c813b79eff755bdd1a9e73e7ad3980af7c | [
"Apache-2.0"
] | null | null | null | lib/python2.7/site-packages/networkx/readwrite/tests/test_sparse6.py | nishaero/wifi-userseg-ryu | 1132f2c813b79eff755bdd1a9e73e7ad3980af7c | [
"Apache-2.0"
] | 6 | 2018-04-12T15:49:27.000Z | 2022-01-27T12:34:50.000Z | #!/usr/bin/env python
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from nose.tools import *
import networkx as nx
import networkx.readwrite.sparse6 as sg6
import os,tempfile
class TestSparseGraph6(object):
def test_parse_sparse6(self):
data=""":Q___eDcdFcDeFcE`GaJ... | 39.368932 | 77 | 0.545993 |
16d26c77ca8ec6eab37d0c88914cde725bd28845 | 7,457 | py | Python | tests/python/relay/test_depthwise_conv2d_nhwc_texture.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | tests/python/relay/test_depthwise_conv2d_nhwc_texture.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2,863 | 2017-08-17T19:55:50.000Z | 2019-11-04T17:18:41.000Z | tests/python/relay/test_depthwise_conv2d_nhwc_texture.py | shengxinhu/tvm | 06c443e9959452c6da3a911fe0c11e08c5554477 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.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... | 31.867521 | 75 | 0.653748 |
835ebd2e8fb20370d26bab61eabf079b536011aa | 451 | py | Python | tests/codec/der/__main__.py | pysnmp/pyasn1 | d52a38c74df682d0b82d771028c145e8aba23ff4 | [
"BSD-2-Clause"
] | null | null | null | tests/codec/der/__main__.py | pysnmp/pyasn1 | d52a38c74df682d0b82d771028c145e8aba23ff4 | [
"BSD-2-Clause"
] | 3 | 2021-11-16T20:28:20.000Z | 2021-11-24T20:27:24.000Z | tests/codec/der/__main__.py | pysnmp/pyasn1 | d52a38c74df682d0b82d771028c145e8aba23ff4 | [
"BSD-2-Clause"
] | null | null | null | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
try:
import unittest2 as unittest
except ImportError:
import unittest
suite = unittest.TestLoader().loadTestsFromNames(
["tests.codec.der.test_encode... | 22.55 | 80 | 0.733925 |
18cac0129bff79996f6442ff16408c3b7d473796 | 10,801 | py | Python | bin/gene_test.py | fuxialexander/marvel | 7fed7515ebe0a3fde9e842c0ee81a39f4413b457 | [
"MIT"
] | 8 | 2020-02-20T15:28:43.000Z | 2021-06-09T04:08:21.000Z | bin/gene_test.py | fuxialexander/marvel | 7fed7515ebe0a3fde9e842c0ee81a39f4413b457 | [
"MIT"
] | 3 | 2020-12-26T09:07:55.000Z | 2021-09-08T17:32:40.000Z | bin/gene_test.py | fuxialexander/marvel | 7fed7515ebe0a3fde9e842c0ee81a39f4413b457 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import os
import sys
from glob import glob
from os.path import basename
import numpy as np
import pandas as pd
import rpy2
import rpy2.robjects as ro
import rpy2.robjects.numpy2ri as n2r
from rpy2.rinterface import RRuntimeWarning
from scipy.sparse import csr_matrix, load_npz, sav... | 34.18038 | 152 | 0.594297 |
22d67fd9f9e1124e8b02a094c7a3e906845eb9b0 | 1,466 | py | Python | infoblox_netmri/api/remote/models/auth_server_grid_remote.py | infobloxopen/infoblox_netmri | aa1c744df7e439dbe163bb9edd165e4e85a9771b | [
"Apache-2.0"
] | 12 | 2016-02-19T12:37:54.000Z | 2022-03-04T20:11:08.000Z | infoblox_netmri/api/remote/models/auth_server_grid_remote.py | azinfoblox/infoblox-netmri | 02372c5231e2677ab6299cb659a73c9a41b4b0f4 | [
"Apache-2.0"
] | 18 | 2015-11-12T18:37:00.000Z | 2021-05-19T07:59:55.000Z | infoblox_netmri/api/remote/models/auth_server_grid_remote.py | azinfoblox/infoblox-netmri | 02372c5231e2677ab6299cb659a73c9a41b4b0f4 | [
"Apache-2.0"
] | 18 | 2016-01-07T12:04:34.000Z | 2022-03-31T11:05:41.000Z | from ..remote import RemoteModel
class AuthServerGridRemote(RemoteModel):
"""
| ``id:`` none
| ``attribute type:`` string
| ``priority:`` none
| ``attribute type:`` string
| ``auth_server:`` none
| ``attribute type:`` string
| ``auth_port:`` none
| ``attribute type:``... | 21.558824 | 40 | 0.474079 |
1bf4a9044125d7f7fc06023311141c170fcf9cf4 | 4,497 | py | Python | src/models/mnist_module.py | KLOSYX/lightning-hydra-template | f522f50fa2e38c476e27cacbd5f656dc45870948 | [
"Unlicense",
"MIT"
] | 996 | 2021-04-05T08:50:09.000Z | 2022-03-31T20:22:11.000Z | src/models/mnist_module.py | KLOSYX/lightning-hydra-template | f522f50fa2e38c476e27cacbd5f656dc45870948 | [
"Unlicense",
"MIT"
] | 114 | 2021-04-04T00:22:27.000Z | 2022-03-27T15:57:27.000Z | src/models/mnist_module.py | KLOSYX/lightning-hydra-template | f522f50fa2e38c476e27cacbd5f656dc45870948 | [
"Unlicense",
"MIT"
] | 182 | 2021-04-05T01:50:57.000Z | 2022-03-31T09:45:44.000Z | from typing import Any, List
import torch
from pytorch_lightning import LightningModule
from torchmetrics import MaxMetric
from torchmetrics.classification.accuracy import Accuracy
from src.models.components.simple_dense_net import SimpleDenseNet
class MNISTLitModule(LightningModule):
"""
Example of Lightni... | 35.409449 | 112 | 0.651101 |
6517072c7e216e694b7d851dffb245ed67414bb3 | 26,374 | py | Python | trax/layers/combinators_test.py | dedsec-9/trax | c394f9df7ee9dfe918cd67f4af2217d361f0f733 | [
"Apache-2.0"
] | 7,220 | 2019-10-07T23:46:53.000Z | 2022-03-31T16:28:05.000Z | trax/layers/combinators_test.py | dedsec-9/trax | c394f9df7ee9dfe918cd67f4af2217d361f0f733 | [
"Apache-2.0"
] | 301 | 2019-10-08T06:42:04.000Z | 2022-03-12T07:03:46.000Z | trax/layers/combinators_test.py | dedsec-9/trax | c394f9df7ee9dfe918cd67f4af2217d361f0f733 | [
"Apache-2.0"
] | 783 | 2019-10-08T06:36:36.000Z | 2022-03-25T02:00:29.000Z | # coding=utf-8
# Copyright 2021 The Trax 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 applicable law or a... | 32.803483 | 78 | 0.588458 |
d9dbc7a201378c5dcda059b7e60214ae5053e324 | 2,388 | py | Python | userbot/plugins/gmute.py | UNIQUEXD/UNIQUEBOT | 09c22f417b994d0774aea46ee1246fbfb4369394 | [
"MIT"
] | 1 | 2020-05-30T22:19:12.000Z | 2020-05-30T22:19:12.000Z | userbot/plugins/gmute.py | UNIQUEXD/UniqueBot | 09c22f417b994d0774aea46ee1246fbfb4369394 | [
"MIT"
] | null | null | null | userbot/plugins/gmute.py | UNIQUEXD/UniqueBot | 09c22f417b994d0774aea46ee1246fbfb4369394 | [
"MIT"
] | null | null | null | '''
ThankYou @pureindialover
'''
from userbot.plugins.sql_helper.mute_sql import is_muted, mute, unmute
import asyncio
from userbot.utils import admin_cmd
#@command(outgoing=True, pattern=r"^.gmute ?(\d+)?")
@borg.on(admin_cmd(pattern=r"gmute ?(\d+)?"))
async def startgmute(event):
private = False
if event.fwd... | 33.633803 | 104 | 0.657873 |
76d52723499d65593345e9c4673ebb8b8a18ffbe | 5,741 | py | Python | evaluation/IJB/mapping_results-full-rotonly.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | null | null | null | evaluation/IJB/mapping_results-full-rotonly.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | null | null | null | evaluation/IJB/mapping_results-full-rotonly.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import matplotlib.pyplot as plt
import traceback
# In[2]:
import IJB_evals as IJB
# In[3]:
from IPython.display import display
# In[4]:
class Args:
def __init__(self, subset='IJBC', is_bunch=False, restore_embs_left=None, restore_embs_... | 30.375661 | 253 | 0.642048 |
a704cb06a87b2833d5e4c868963c619f6dd2ec63 | 7,940 | py | Python | script.module.exodus/lib/resources/lib/sources/de/seriesever.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2019-03-05T09:38:10.000Z | 2019-03-05T09:38:10.000Z | script.module.exodus/lib/resources/lib/sources/de/seriesever.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | null | null | null | script.module.exodus/lib/resources/lib/sources/de/seriesever.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2021-11-05T20:48:09.000Z | 2021-11-05T20:48:09.000Z | # -*- coding: utf-8 -*-
"""
Exodus Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... | 38.173077 | 170 | 0.516499 |
fdc4c9f016a6fafaa9a7869f9a51a3c6a4e05d5b | 968 | py | Python | core/src/zeit/wochenmarkt/browser/ingredients.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 5 | 2019-05-16T09:51:29.000Z | 2021-05-31T09:30:03.000Z | core/src/zeit/wochenmarkt/browser/ingredients.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 107 | 2019-05-24T12:19:02.000Z | 2022-03-23T15:05:56.000Z | core/src/zeit/wochenmarkt/browser/ingredients.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 3 | 2020-08-14T11:01:17.000Z | 2022-01-08T17:32:19.000Z | from zeit.wochenmarkt.sources import ingredientsSource
import grokcore.component as grok
import logging
import zeit.cms.browser.interfaces
import zeit.cms.browser.view
import zeit.wochenmarkt.interfaces
import zope.component
import zope.component.hooks
log = logging.getLogger(__name__)
class IngredientsSearch(zeit.... | 27.657143 | 62 | 0.713843 |
902b186bd4fc5781a22f31c73b53398174c86841 | 1,263 | py | Python | tests/test_cli_v1.py | NovaDev94/pip-compile-multi | 5ec43dd5c54bde2ac7d1f4770f7e27a97802a7c1 | [
"MIT"
] | null | null | null | tests/test_cli_v1.py | NovaDev94/pip-compile-multi | 5ec43dd5c54bde2ac7d1f4770f7e27a97802a7c1 | [
"MIT"
] | null | null | null | tests/test_cli_v1.py | NovaDev94/pip-compile-multi | 5ec43dd5c54bde2ac7d1f4770f7e27a97802a7c1 | [
"MIT"
] | null | null | null | """End to end tests for CLI v2"""
import sys
from click.testing import CliRunner
import pytest
from pipcompilemulti.cli_v1 import cli
from pipcompilemulti.options import OPTIONS
from .utils import temp_dir
@pytest.fixture(autouse=True)
def requirements_dir():
"""Create temporary requirements directory for test t... | 28.704545 | 68 | 0.627078 |
2ddf7737c3560fadbc544f9a488716622f8551b0 | 7,093 | py | Python | pipeline/mk_all_level1_fsf_bbr.py | lbconner/openfMRI | 265d8ef013dad14fd1741d5817d00f9411d85103 | [
"BSD-2-Clause"
] | 33 | 2015-02-17T17:21:43.000Z | 2021-08-23T08:27:10.000Z | pipeline/mk_all_level1_fsf_bbr.py | lbconner/openfMRI | 265d8ef013dad14fd1741d5817d00f9411d85103 | [
"BSD-2-Clause"
] | 13 | 2015-01-14T15:17:09.000Z | 2017-07-10T02:17:06.000Z | pipeline/mk_all_level1_fsf_bbr.py | lbconner/openfMRI | 265d8ef013dad14fd1741d5817d00f9411d85103 | [
"BSD-2-Clause"
] | 24 | 2015-01-27T10:02:47.000Z | 2021-03-19T20:05:35.000Z | #!/usr/bin/env python
""" mk_all_level1_fsf.py - make fsf files for all subjects
USAGE: python mk_all_level1_fsf_bbr.py <name of dataset> <modelnum> <basedir - default is staged> <nonlinear - default=1> <smoothing - default=0> <tasknum - default to all>
"""
## Copyright 2011, Russell Poldrack. All rights reserved.
... | 41.238372 | 172 | 0.661638 |
7afa7264569cb15afeaba3dccca69bb9a360ca51 | 10,230 | py | Python | modin/core/io/text/excel_dispatcher.py | Rubtsowa/modin | 6550939753c76e896ef2bfd65bb9468d6ad161d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/io/text/excel_dispatcher.py | Rubtsowa/modin | 6550939753c76e896ef2bfd65bb9468d6ad161d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/io/text/excel_dispatcher.py | Rubtsowa/modin | 6550939753c76e896ef2bfd65bb9468d6ad161d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 43.164557 | 90 | 0.598631 |
e14dd916a75b19338befb59cd8e20500ac2eef91 | 591 | py | Python | test/code/d1/t0.py | BBN-Q/pyqgl2 | 7acc8b244ee7799c21df03ecff8325e15cdb94d3 | [
"Apache-2.0"
] | 10 | 2017-09-30T14:31:42.000Z | 2021-12-12T07:52:05.000Z | test/code/d1/t0.py | BBN-Q/pyqgl2 | 7acc8b244ee7799c21df03ecff8325e15cdb94d3 | [
"Apache-2.0"
] | 56 | 2017-04-11T15:47:15.000Z | 2019-10-11T15:50:35.000Z | test/code/d1/t0.py | BBN-Q/pyqgl2 | 7acc8b244ee7799c21df03ecff8325e15cdb94d3 | [
"Apache-2.0"
] | 3 | 2019-06-20T07:08:39.000Z | 2020-10-24T19:29:05.000Z |
from qgl2.qgl2 import concur, seq
from qgl2.qgl2 import qgl2decl, qgl2main
from qgl2.qgl2 import classical, pulse, qreg
from qgl2.qgl1 import QubitFactory
# Note that for this next import to work you must run from the directory containing this file
import t1
from t2 import second_level as fred
@qgl2main
def main():... | 22.730769 | 93 | 0.700508 |
39a2d24d03adbca68622b766cf30797dc980282b | 2,359 | py | Python | scripts/markovian_features.py | aametwally/MC_MicroSimilarities | b625fcbe7eb1fcd8f04fedec1a111b4d3a1bde3a | [
"MIT"
] | 2 | 2019-02-22T03:08:56.000Z | 2019-11-17T02:30:58.000Z | scripts/markovian_features.py | aametwally/MC_MicroSimilarities | b625fcbe7eb1fcd8f04fedec1a111b4d3a1bde3a | [
"MIT"
] | 7 | 2019-02-24T13:13:35.000Z | 2019-02-26T10:10:58.000Z | scripts/markovian_features.py | aametwally/MC_MicroSimilarities | b625fcbe7eb1fcd8f04fedec1a111b4d3a1bde3a | [
"MIT"
] | null | null | null | import numpy as np
import os
from sklearn.decomposition import PCA
path = '/media/asem/store/experimental/build-markovian_features-Desktop_Qt_5_9_1_GCC_64bit-Release/src/app/data'
consensus_gprofile_files = sorted([ f for f in os.listdir(path) \
if f.startswith('consensus_gprofile') ])
c... | 38.048387 | 112 | 0.732514 |
7a860ea6c16fd38dc5bb11486c237de11f0cc287 | 2,002 | py | Python | tests/metrics/test_metric_lightning.py | daeyun/pytorch-lightning | 96785b99df878ebc45bc455eb7902a6dd4661139 | [
"Apache-2.0"
] | 1 | 2020-10-26T09:02:08.000Z | 2020-10-26T09:02:08.000Z | tests/metrics/test_metric_lightning.py | vivektalwar13071999/pytorch-lightning | 7c4f80a1afe3d7b0f1e9ee834aacaf8439195cdf | [
"Apache-2.0"
] | null | null | null | tests/metrics/test_metric_lightning.py | vivektalwar13071999/pytorch-lightning | 7c4f80a1afe3d7b0f1e9ee834aacaf8439195cdf | [
"Apache-2.0"
] | null | null | null | import torch
from pytorch_lightning import Trainer
from pytorch_lightning.metrics import Metric
from tests.base.boring_model import BoringModel
class SumMetric(Metric):
def __init__(self):
super().__init__()
self.add_state("x", torch.tensor(0.0), dist_reduce_fx="sum")
def update(self, x):
... | 24.716049 | 70 | 0.597902 |
e7c7bc7d85d7fcffb9d9c24d82c0a819ccb22889 | 310 | py | Python | polyaxon/action_manager/utils/discord.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/action_manager/utils/discord.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/action_manager/utils/discord.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | from event_manager.event_context import get_event_context, get_readable_event
def serialize_event_to_context(event):
event_context = get_event_context(event)
logo_url = ''
payload = {
'content': get_readable_event(event_context),
'avatar_url': logo_url
}
return payload
| 22.142857 | 77 | 0.722581 |
d145a9dde4efed62c6a214c96208b0213d9d9a32 | 1,923 | py | Python | jacket/objects/compute/hv_spec.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/objects/compute/hv_spec.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/objects/compute/hv_spec.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | 2 | 2016-08-10T02:21:49.000Z | 2020-07-24T01:57:21.000Z | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | 36.283019 | 78 | 0.688508 |
a7c582460d994c8fde66c9baaa205d1d9661ef79 | 44,464 | py | Python | src/python/datastore/data_types.py | mi-ac/clusterfuzz | 0b5c023eca9e3aac41faba17da8f341c0ca2ddc7 | [
"Apache-2.0"
] | 1 | 2020-12-23T02:49:09.000Z | 2020-12-23T02:49:09.000Z | src/python/datastore/data_types.py | mi-ac/clusterfuzz | 0b5c023eca9e3aac41faba17da8f341c0ca2ddc7 | [
"Apache-2.0"
] | 2 | 2021-09-28T05:36:03.000Z | 2021-12-13T20:48:34.000Z | src/python/datastore/data_types.py | mi-ac/clusterfuzz | 0b5c023eca9e3aac41faba17da8f341c0ca2ddc7 | [
"Apache-2.0"
] | 1 | 2020-12-21T16:24:36.000Z | 2020-12-21T16:24:36.000Z | # Copyright 2019 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 agreed to in writing, ... | 30.002699 | 80 | 0.732098 |
c09b615b2bfbef9eb35612bde05cd989042d2b88 | 6,616 | py | Python | tensorflow_riemopt/optimizers/constrained_rmsprop_test.py | vishalbelsare/tensorflow-riemopt | 4814b0c4a8bc74bf98f34ba99440f24ea21ab93b | [
"MIT"
] | 33 | 2021-07-12T14:03:55.000Z | 2022-03-30T11:44:11.000Z | tensorflow_riemopt/optimizers/constrained_rmsprop_test.py | vishalbelsare/tensorflow-riemopt | 4814b0c4a8bc74bf98f34ba99440f24ea21ab93b | [
"MIT"
] | 2 | 2021-08-02T18:39:06.000Z | 2022-02-14T21:01:22.000Z | tensorflow_riemopt/optimizers/constrained_rmsprop_test.py | vishalbelsare/tensorflow-riemopt | 4814b0c4a8bc74bf98f34ba99440f24ea21ab93b | [
"MIT"
] | 5 | 2020-11-06T05:22:07.000Z | 2021-06-15T03:21:58.000Z | """Tests for RMSprop."""
from absl.testing import parameterized
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.keras import combinations
... | 42.683871 | 80 | 0.472642 |
8b70008666db6981df40778f6eec201d3c3264c1 | 161 | py | Python | ex049.py | paulo-caixeta/Exercicios_Curso_Python | 3b77925499c174ea9ff81dec65d6319125219b9a | [
"MIT"
] | null | null | null | ex049.py | paulo-caixeta/Exercicios_Curso_Python | 3b77925499c174ea9ff81dec65d6319125219b9a | [
"MIT"
] | null | null | null | ex049.py | paulo-caixeta/Exercicios_Curso_Python | 3b77925499c174ea9ff81dec65d6319125219b9a | [
"MIT"
] | null | null | null | # Exercício de tabuada utilizando comando for.
n = int(input('Digite um número inteiro: '))
for c in range(1, 11):
print('{} x {} = {}'.format(n, c, n*c))
| 23 | 46 | 0.608696 |
709c325e018a28697033561dbad454d0ba98319d | 169 | py | Python | mysite/urls.py | krystacassidy/djangoblog | 37dec5360c27b2622212ced1abdda1dfedf480cb | [
"MIT"
] | 8 | 2017-01-16T16:36:21.000Z | 2018-05-08T05:55:42.000Z | mysite/urls.py | krystacassidy/djangoblog | 37dec5360c27b2622212ced1abdda1dfedf480cb | [
"MIT"
] | null | null | null | mysite/urls.py | krystacassidy/djangoblog | 37dec5360c27b2622212ced1abdda1dfedf480cb | [
"MIT"
] | 1 | 2018-02-18T17:30:17.000Z | 2018-02-18T17:30:17.000Z | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('blog.urls')),
]
| 21.125 | 41 | 0.674556 |
01bc8f34b45812f6d6b1c4937bcbc749a4464dbe | 109 | py | Python | data_cache/__init__.py | statnett/data_cache | cd76456906f7bad409eb5e581ae7f81637527fab | [
"MIT"
] | 23 | 2020-05-19T08:01:24.000Z | 2022-02-17T21:40:58.000Z | data_cache/__init__.py | statnett/data_cache | cd76456906f7bad409eb5e581ae7f81637527fab | [
"MIT"
] | 3 | 2020-05-19T19:46:06.000Z | 2022-03-16T07:09:00.000Z | data_cache/__init__.py | statnett/data_cache | cd76456906f7bad409eb5e581ae7f81637527fab | [
"MIT"
] | 3 | 2021-07-28T18:31:14.000Z | 2021-09-09T14:56:40.000Z | from data_cache.cache_tools import numpy_cache, pandas_cache, read_metadata # noqa: F401
VERSION = "0.1.6"
| 27.25 | 89 | 0.779817 |
956d25c67580f673c99078eb82cbf5fabf7c3f44 | 3,555 | py | Python | software/client/motion_handler.py | seanwatson/ece4416-project | ce048d84d2bc054fdb24848a32bb0219c4708fdc | [
"MIT"
] | 1 | 2020-07-26T12:55:27.000Z | 2020-07-26T12:55:27.000Z | software/client/motion_handler.py | seanwatson/ece4416-project | ce048d84d2bc054fdb24848a32bb0219c4708fdc | [
"MIT"
] | null | null | null | software/client/motion_handler.py | seanwatson/ece4416-project | ce048d84d2bc054fdb24848a32bb0219c4708fdc | [
"MIT"
] | null | null | null | """
Handles incoming motion commands and translates them to actions.
Copyright (c) 2013 Sean Watson
Licensed under the MIT license
"""
import threading
import logging
import time
class MotionHandler(threading.Thread):
"""Translates motion commands to actions.
When a new motion command is received over the ... | 34.182692 | 76 | 0.590717 |
a9b0748be3810ec13d7ca08368d63f1cd8719654 | 873 | py | Python | example.py | hagenr/gpio-events | 9a53fb952499fc65b4b2f070fa392dc2f7da8223 | [
"MIT"
] | null | null | null | example.py | hagenr/gpio-events | 9a53fb952499fc65b4b2f070fa392dc2f7da8223 | [
"MIT"
] | null | null | null | example.py | hagenr/gpio-events | 9a53fb952499fc65b4b2f070fa392dc2f7da8223 | [
"MIT"
] | null | null | null | #
# Example Code GPIO Events
# Hagen Richter <hagen.richter@informatik.uni-hamburg.de>
# <https://github.com/hagenr/gpio-events>
#
import rotary_encoder_events
import button_events
import time
CW_PIN = 35
ACW_PIN = 36
SW_PIN = 37
def cb_up(CallingPin):
btn_new = btn.gpio.input(CallingPin)
print 'UP Pin: %... | 22.973684 | 78 | 0.68614 |
b85562359f3115a56d86e0bb483c61919b926576 | 10,637 | py | Python | scripts/xiangshan.py | shinezyy/XiangShan | ffba40a0863135d3185f5b4fb947625c4e13a8e2 | [
"MulanPSL-1.0"
] | 1 | 2021-08-01T14:26:52.000Z | 2021-08-01T14:26:52.000Z | scripts/xiangshan.py | yutiansky/XiangShan | 29fcb828156fbf1789fae87055e1ab757d718d9d | [
"MulanPSL-1.0"
] | null | null | null | scripts/xiangshan.py | yutiansky/XiangShan | 29fcb828156fbf1789fae87055e1ab757d718d9d | [
"MulanPSL-1.0"
] | null | null | null | #***************************************************************************************
# Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences
# Copyright (c) 2020-2021 Peng Cheng Laboratory
#
# XiangShan is licensed under Mulan PSL v2.
# You can use this software according to the ter... | 39.396296 | 104 | 0.605152 |
7896dc44e1bdc5f6d4c29d94b8482a5a34658df8 | 7,896 | py | Python | ica/ica/ica_gpu.py | MRN-Code/coinstac_gica | 46fd9274b80bae9a5731bd77c5a3bc2d7002bb4c | [
"MIT"
] | 1 | 2019-03-01T05:30:06.000Z | 2019-03-01T05:30:06.000Z | ica/ica/ica_gpu.py | MRN-Code/coinstac_gica | 46fd9274b80bae9a5731bd77c5a3bc2d7002bb4c | [
"MIT"
] | null | null | null | ica/ica/ica_gpu.py | MRN-Code/coinstac_gica | 46fd9274b80bae9a5731bd77c5a3bc2d7002bb4c | [
"MIT"
] | null | null | null | '''
Independent Component Analysis (ICA):
This script computes ICA using the INFOMAX criteria.
The preprocessing steps include demeaning and whitening.
'''
import numpy as np
from numpy import dot
from numpy.linalg import matrix_rank, inv
from numpy.random import permutation
from scipy.linalg import eigh
# Theano Impo... | 34.938053 | 117 | 0.535968 |
1e2d1ec5bf1f3c59d03350398b6a1c1fa3b03927 | 71,375 | py | Python | sdks/python/apache_beam/runners/dataflow/dataflow_runner.py | chishankar-work/beam | b822366d7ab72c609de276255faadd9475e4e2d2 | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/runners/dataflow/dataflow_runner.py | chishankar-work/beam | b822366d7ab72c609de276255faadd9475e4e2d2 | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/runners/dataflow/dataflow_runner.py | chishankar-work/beam | b822366d7ab72c609de276255faadd9475e4e2d2 | [
"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 us... | 42.688397 | 114 | 0.707895 |
e82ad0b03850129eb32f3d4dcbf8cb1d1c9bcc08 | 1,221 | py | Python | examples/resource.py | ROZBEH/rdflib | 5b9da927714a92a8888407f42b46249002964e8e | [
"BSD-3-Clause"
] | 2 | 2021-02-06T17:36:05.000Z | 2021-04-21T07:33:39.000Z | examples/resource.py | ROZBEH/rdflib | 5b9da927714a92a8888407f42b46249002964e8e | [
"BSD-3-Clause"
] | 8 | 2021-07-19T07:05:46.000Z | 2022-03-28T07:08:07.000Z | examples/resource.py | ROZBEH/rdflib | 5b9da927714a92a8888407f42b46249002964e8e | [
"BSD-3-Clause"
] | 4 | 2020-05-08T08:36:19.000Z | 2020-05-28T07:23:23.000Z | """
RDFLib has a :class:`~rdflib.resource.Resource` class, for a resource-centric API.
A resource acts like a URIRef with an associated graph, and allows
quickly adding or querying for triples where this resource is the
subject.
"""
from rdflib import Graph, RDF, RDFS, Literal
from rdflib.namespace import FOAF
if __... | 26.543478 | 82 | 0.671581 |
5dc721fbc6163ab0e93a01c8a66ea267b0719514 | 1,426 | py | Python | algos/patterns/heaps/k_ClosestPoints.py | iamlmn/PyDS | 11b00629a91e8231eea7f8feb7c3c6065fdb1ce5 | [
"MIT"
] | null | null | null | algos/patterns/heaps/k_ClosestPoints.py | iamlmn/PyDS | 11b00629a91e8231eea7f8feb7c3c6065fdb1ce5 | [
"MIT"
] | null | null | null | algos/patterns/heaps/k_ClosestPoints.py | iamlmn/PyDS | 11b00629a91e8231eea7f8feb7c3c6065fdb1ce5 | [
"MIT"
] | null | null | null | # Given an array of points in the a 2D2D plane, find ‘K’ closest points to the origin.
# Example 1:
# Input: points = [[1,2],[1,3]], K = 1
# Output: [[1,2]]
# Explanation: The Euclidean distance between (1, 2) and the origin is sqrt(5).
# The Euclidean distance between (1, 3) and the origin is sqrt(10).
# Since sqrt(... | 26.407407 | 86 | 0.569425 |
08027d5807d8efa11c907d7fbed9ed83ab5cd415 | 112,898 | py | Python | venv/lib/python3.8/site-packages/pandas/tests/frame/test_constructors.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 1 | 2022-03-17T12:56:14.000Z | 2022-03-17T12:56:14.000Z | venv/lib/python3.8/site-packages/pandas/tests/frame/test_constructors.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 5 | 2022-02-13T14:38:04.000Z | 2022-02-15T00:13:07.000Z | venv/lib/python3.8/site-packages/pandas/tests/frame/test_constructors.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 4 | 2022-02-04T22:58:27.000Z | 2022-02-14T19:29:18.000Z | from collections import (
OrderedDict,
abc,
)
from datetime import (
date,
datetime,
timedelta,
)
import functools
import itertools
import re
import warnings
import numpy as np
import numpy.ma as ma
import numpy.ma.mrecords as mrecords
import pytest
import pytz
from pandas.compat import np_version... | 36.560233 | 88 | 0.560373 |
8948ae2eb66e21bb200a6f0da8ab8d626721351f | 332 | py | Python | schrodinger/cli.py | dgiambra/schrodinger | ac1e283242d662f5bab151b46770f21f0ff0bbe0 | [
"MIT"
] | null | null | null | schrodinger/cli.py | dgiambra/schrodinger | ac1e283242d662f5bab151b46770f21f0ff0bbe0 | [
"MIT"
] | null | null | null | schrodinger/cli.py | dgiambra/schrodinger | ac1e283242d662f5bab151b46770f21f0ff0bbe0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import click
@click.command()
def main(args=None):
"""Console script for schrodinger"""
click.echo("Replace this message by putting your code into "
"schrodinger.cli.main")
click.echo("See click documentation at http://click.pocoo.org/")
if __name__ == "__main__":... | 20.75 | 68 | 0.638554 |
d751b8b1fd6c64bc0ef29b4f0a1a6db007c0ad00 | 13,104 | py | Python | differential_evolution.py | oleksandrr/differential_evolution | ee57db1317f79b9492fdee4ff1fe154fdb9129d7 | [
"Apache-2.0"
] | 4 | 2015-12-23T17:14:24.000Z | 2020-03-22T15:04:02.000Z | differential_evolution.py | oleksandrr/differential_evolution | ee57db1317f79b9492fdee4ff1fe154fdb9129d7 | [
"Apache-2.0"
] | null | null | null | differential_evolution.py | oleksandrr/differential_evolution | ee57db1317f79b9492fdee4ff1fe154fdb9129d7 | [
"Apache-2.0"
] | 2 | 2017-03-29T12:49:40.000Z | 2018-10-19T15:53:35.000Z | #!/usr/bin/python
from __future__ import division
__all__ = ['mutate', 'crossover', 'select', 'minimize']
import numpy; from numpy import (array, random)
def mutate(original_population, original_population_costs, F, method="rand/1"):
# In some cases random_unique_indices can become a bottleneck for the whole al... | 49.263158 | 109 | 0.68956 |
98fb6abc9db9906a939ab7a10492d73e4c3df175 | 11,841 | py | Python | tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/iam.py | Littlecowherd/grpc | d85552acf82e8376e46228dfc74052e2d404249f | [
"Apache-2.0"
] | 1 | 2021-06-21T19:56:01.000Z | 2021-06-21T19:56:01.000Z | tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/iam.py | Littlecowherd/grpc | d85552acf82e8376e46228dfc74052e2d404249f | [
"Apache-2.0"
] | null | null | null | tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/iam.py | Littlecowherd/grpc | d85552acf82e8376e46228dfc74052e2d404249f | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 gRPC 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 applicable law or agreed to in writing... | 37.951923 | 97 | 0.637615 |
f16e870591e004ae8cfe6a89a4608c5a45b1ceff | 1,248 | py | Python | src/oci/resource_search/resource_search_client_composite_operations.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/resource_search/resource_search_client_composite_operations.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/resource_search/resource_search_client_composite_operations.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 49.92 | 245 | 0.737981 |
d143568df431a31b3005ecb403c9baacba2c61bb | 735 | py | Python | examples/Simple/simple_client.py | vongostev/NumpySocket | f34d8c98af2961fc177151c2fd9306c1ab26b216 | [
"MIT"
] | 41 | 2018-03-04T14:50:46.000Z | 2022-03-15T22:01:38.000Z | examples/Simple/simple_client.py | vongostev/NumpySocket | f34d8c98af2961fc177151c2fd9306c1ab26b216 | [
"MIT"
] | 5 | 2019-03-05T21:10:12.000Z | 2021-05-06T07:57:41.000Z | examples/Simple/simple_client.py | vongostev/NumpySocket | f34d8c98af2961fc177151c2fd9306c1ab26b216 | [
"MIT"
] | 21 | 2018-06-01T06:49:58.000Z | 2022-03-22T11:09:49.000Z | #!/usr/bin/python3
import logging
from time import sleep
import numpy as np
from numpysocket import NumpySocket
logger = logging.getLogger('simple client')
logger.setLevel(logging.INFO)
host_ip = 'localhost' # change me
npSocket = NumpySocket()
while(True):
try:
npSocket.startClient(host_ip, 9999)
... | 20.416667 | 75 | 0.711565 |
6e1f4b2f397e28b9a8ee8715b5b17395580eb9ac | 47,204 | py | Python | Lib/test/test_compileall.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 953 | 2021-10-08T17:12:34.000Z | 2022-03-31T18:31:50.000Z | Lib/test/test_compileall.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 27 | 2021-10-13T20:54:09.000Z | 2022-03-27T14:41:13.000Z | Lib/test/test_compileall.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 42 | 2021-10-08T16:05:57.000Z | 2022-03-18T13:06:12.000Z | import compileall
import contextlib
import filecmp
import importlib.util
import io
import itertools
import os
import pathlib
import py_compile
import shutil
import struct
import sys
import tempfile
import test.test_importlib.util
import time
import unittest
from unittest import mock, skipUnless
try:
from concurren... | 43.108676 | 98 | 0.614079 |
246c8686c6bacd19d5f185a0d5db10cc12d2ffaa | 4,119 | py | Python | gcal.py | frangiz/birthday-reminder | 92ec6d5e93f0e2428c94d22795cdb994c2024b4f | [
"MIT"
] | null | null | null | gcal.py | frangiz/birthday-reminder | 92ec6d5e93f0e2428c94d22795cdb994c2024b4f | [
"MIT"
] | null | null | null | gcal.py | frangiz/birthday-reminder | 92ec6d5e93f0e2428c94d22795cdb994c2024b4f | [
"MIT"
] | null | null | null | import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import googleapiclient.errors
from models import EventResponse
from pydantic import parse_obj_as
from datetime import datetime
from ... | 38.495327 | 114 | 0.595047 |
bac33723c00df6463daa9ec5d8ecb411a2c9290a | 12,553 | py | Python | design_baselines/cma_es/relabel_experiments.py | young-geng/design-baselines-icml | ce4183babac304ed5f83151a602d75de6c4740c4 | [
"MIT"
] | 28 | 2020-06-30T00:40:33.000Z | 2022-03-22T05:16:27.000Z | design_baselines/cma_es/relabel_experiments.py | young-geng/design-baselines-icml | ce4183babac304ed5f83151a602d75de6c4740c4 | [
"MIT"
] | 5 | 2020-09-17T07:15:52.000Z | 2022-03-31T23:33:27.000Z | design_baselines/cma_es/relabel_experiments.py | young-geng/design-baselines-icml | ce4183babac304ed5f83151a602d75de6c4740c4 | [
"MIT"
] | 3 | 2020-09-17T06:55:53.000Z | 2021-08-09T20:27:26.000Z | from ray import tune
import click
import ray
import os
@click.group()
def cli():
"""A group of experiments for training Conservative Score Models
and reproducing our ICLR 2021 results.
"""
#############
@cli.command()
@click.option('--local-dir', type=str, default='cma-es-dkitty')
@click.option('--cpu... | 32.022959 | 71 | 0.582889 |
a3a9b21b037a7735cb67a7cf2c803facb0c85819 | 4,918 | py | Python | tests/approaches/test_random_options_approach.py | Learning-and-Intelligent-Systems/predicators | 0b2e71cacf86ba2bfdc1d9059c3a78016d0a4d7e | [
"MIT"
] | 24 | 2021-11-20T16:35:41.000Z | 2022-03-30T03:49:52.000Z | tests/approaches/test_random_options_approach.py | Learning-and-Intelligent-Systems/predicators | 0b2e71cacf86ba2bfdc1d9059c3a78016d0a4d7e | [
"MIT"
] | 214 | 2021-10-12T01:17:50.000Z | 2022-03-31T20:18:36.000Z | tests/approaches/test_random_options_approach.py | Learning-and-Intelligent-Systems/predicators | 0b2e71cacf86ba2bfdc1d9059c3a78016d0a4d7e | [
"MIT"
] | 1 | 2022-02-15T20:24:17.000Z | 2022-02-15T20:24:17.000Z | """Test cases for the random options approach class."""
from gym.spaces import Box
from predicators.src import utils
from predicators.src.approaches.random_options_approach import \
RandomOptionsApproach
from predicators.src.structs import Action, DefaultState, \
ParameterizedOption, Predicate, State, Task, T... | 44.709091 | 548 | 0.580724 |
b7d24f1ba810cf673dd976b6ca446d3f7a770fd9 | 1,876 | py | Python | scripts/code_tutorials/predict_EL.py | mickvanhulst-TomTom/REL | 2c62807cf11f8f4b97ccf730c83b9758211a012e | [
"MIT"
] | null | null | null | scripts/code_tutorials/predict_EL.py | mickvanhulst-TomTom/REL | 2c62807cf11f8f4b97ccf730c83b9758211a012e | [
"MIT"
] | null | null | null | scripts/code_tutorials/predict_EL.py | mickvanhulst-TomTom/REL | 2c62807cf11f8f4b97ccf730c83b9758211a012e | [
"MIT"
] | null | null | null | from REL.entity_disambiguation import EntityDisambiguation
from REL.mention_detection import MentionDetection
from REL.ner import Cmns, load_flair_ner
from REL.utils import process_results
def example_preprocessing():
# Example splitting, should be of format {doc_1: {sent_idx: [sentence, []]}, .... }}
text = ... | 37.52 | 119 | 0.747868 |
93b318e898fcf9cf008c4cc2f7bcfd96ee6e2316 | 1,585 | py | Python | tests/test_utils/test_util_plots.py | moonson619/AI4Water-1 | 285d46824502b6a787e42570b72432f4f6acf45e | [
"MIT"
] | 17 | 2021-05-21T13:01:52.000Z | 2022-03-19T15:17:10.000Z | tests/test_utils/test_util_plots.py | moonson619/AI4Water-1 | 285d46824502b6a787e42570b72432f4f6acf45e | [
"MIT"
] | 3 | 2021-10-31T22:40:28.000Z | 2021-11-08T02:28:35.000Z | tests/test_utils/test_util_plots.py | moonson619/AI4Water-1 | 285d46824502b6a787e42570b72432f4f6acf45e | [
"MIT"
] | 7 | 2021-08-06T07:27:50.000Z | 2022-01-26T00:38:32.000Z |
import unittest
import numpy as np
import matplotlib.pyplot as plt
from ai4water.utils.visualizations import murphy_diagram, fdc_plot
class TestMurphyDiagrams(unittest.TestCase):
y = np.random.randint(1, 1000, 100)
f1 = np.random.randint(1, 1000, 100)
f2 = np.random.randint(1, 1000, 100)
def test... | 26.864407 | 78 | 0.577918 |
52226fb81897960859a6fa297c62ad0f96e18ff1 | 1,228 | py | Python | docs/tools/nb_to_doc.py | Keris/yasc | eb55000e730fb2e60515a39dac82b851239a2c57 | [
"MIT"
] | 4 | 2020-05-21T06:35:48.000Z | 2021-04-12T10:49:55.000Z | docs/tools/nb_to_doc.py | Keris/yasc | eb55000e730fb2e60515a39dac82b851239a2c57 | [
"MIT"
] | null | null | null | docs/tools/nb_to_doc.py | Keris/yasc | eb55000e730fb2e60515a39dac82b851239a2c57 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""
Convert empty IPython notebook to a sphinx doc page.
"""
import sys
from subprocess import check_call as sh
def convert_nb(nbname):
# Execute the notebook
sh(
[
"jupyter",
"nbconvert",
"--to",
"notebook",
"--execu... | 20.466667 | 78 | 0.482085 |
899f50179fbea94df448603f7a74fc92f6f19a5d | 36,674 | py | Python | mmdet/core/anchor/anchor_generator.py | Bin-ze/Food_detection | 1c1a067f12644f2b0289e49aec4637d580722f70 | [
"Apache-2.0"
] | 4 | 2021-08-15T04:31:49.000Z | 2022-03-10T07:11:48.000Z | mmdet/core/anchor/anchor_generator.py | Bin-ze/Food_detection | 1c1a067f12644f2b0289e49aec4637d580722f70 | [
"Apache-2.0"
] | null | null | null | mmdet/core/anchor/anchor_generator.py | Bin-ze/Food_detection | 1c1a067f12644f2b0289e49aec4637d580722f70 | [
"Apache-2.0"
] | null | null | null | import warnings
import mmcv
import numpy as np
import torch
from torch.nn.modules.utils import _pair
from .builder import PRIOR_GENERATORS
@PRIOR_GENERATORS.register_module()
class AnchorGenerator:
"""Standard anchor generator for 2D anchor-based detectors.
Args:
strides (list[int] | list[tuple[int... | 42.793466 | 79 | 0.570977 |
1245552c15aa7009842a797583daa87aba0a6961 | 50,276 | py | Python | allennlp/training/trainer.py | eitanhaimashiah/allennlp | 8f0baa229fe0312d140d18dc1bdb894beb2150c7 | [
"Apache-2.0"
] | null | null | null | allennlp/training/trainer.py | eitanhaimashiah/allennlp | 8f0baa229fe0312d140d18dc1bdb894beb2150c7 | [
"Apache-2.0"
] | 1 | 2018-06-08T21:12:54.000Z | 2018-06-08T21:12:54.000Z | allennlp/training/trainer.py | eitanhaimashiah/allennlp | 8f0baa229fe0312d140d18dc1bdb894beb2150c7 | [
"Apache-2.0"
] | 1 | 2018-10-22T18:52:14.000Z | 2018-10-22T18:52:14.000Z | """
A :class:`~allennlp.training.trainer.Trainer` is responsible for training a
:class:`~allennlp.models.model.Model`.
Typically you might create a configuration file specifying the model and
training parameters and then use :mod:`~allennlp.commands.train`
rather than instantiating a ``Trainer`` yourself.
"""
# pylint... | 49.097656 | 114 | 0.607129 |
8d983c7c5b8c9675dae4653164da9a28df98ed17 | 2,683 | gyp | Python | syzygy/trace/rpc/rpc.gyp | nzeh/syzygy | 3573e3d458dbb4285753c28a7cb42ced739f9f55 | [
"Apache-2.0"
] | 343 | 2015-01-07T05:58:44.000Z | 2022-03-15T14:55:21.000Z | syzygy/trace/rpc/rpc.gyp | nzeh/syzygy-nzeh | 3757e53f850644721284073de318e218224dd411 | [
"Apache-2.0"
] | 61 | 2015-03-19T18:20:21.000Z | 2019-10-23T12:58:23.000Z | syzygy/trace/rpc/rpc.gyp | nzeh/syzygy-nzeh | 3757e53f850644721284073de318e218224dd411 | [
"Apache-2.0"
] | 66 | 2015-01-20T15:35:05.000Z | 2021-11-25T16:49:41.000Z | # Copyright 2012 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 a... | 37.263889 | 80 | 0.657846 |
e18fe0209231f479c5989ac428717aad07b303b4 | 4,701 | py | Python | app.py | JohannesJolkkonen/mock-business-data-generator | 64c93d4e722bffa78aa72c1fd31ab959a2f9771f | [
"MIT"
] | null | null | null | app.py | JohannesJolkkonen/mock-business-data-generator | 64c93d4e722bffa78aa72c1fd31ab959a2f9771f | [
"MIT"
] | null | null | null | app.py | JohannesJolkkonen/mock-business-data-generator | 64c93d4e722bffa78aa72c1fd31ab959a2f9771f | [
"MIT"
] | null | null | null | import pandas as pd
import datetime
from mimesis import Generic
import random
import numpy as np
products_head = ['ID', 'Name', 'Price', 'Unit Cost', 'Manufacturer']
customers_head = ['id', 'Name', 'Address', 'City', 'Country', 'Website', 'Email', 'Phone', 'Registration Date']
staff_head = ['id', 'Name', 'Title', 'Add... | 39.504202 | 127 | 0.64348 |
694f37d612d4c46e673dc894b05a0a446190732c | 1,400 | py | Python | python/paddle/v2/framework/tests/test_top_k_op.py | AI-books/Paddle | 5b5f4f514047975ac09ec42b31e46dabf235e7dd | [
"Apache-2.0"
] | null | null | null | python/paddle/v2/framework/tests/test_top_k_op.py | AI-books/Paddle | 5b5f4f514047975ac09ec42b31e46dabf235e7dd | [
"Apache-2.0"
] | null | null | null | python/paddle/v2/framework/tests/test_top_k_op.py | AI-books/Paddle | 5b5f4f514047975ac09ec42b31e46dabf235e7dd | [
"Apache-2.0"
] | 1 | 2020-06-04T04:27:15.000Z | 2020-06-04T04:27:15.000Z | import unittest
import numpy as np
from op_test import OpTest
class TestTopkOp(OpTest):
def setUp(self):
self.op_type = "top_k"
k = 1
input = np.random.random((32, 84)).astype("float32")
output = np.ndarray((32, k))
indices = np.ndarray((32, k))
self.inputs = {'X':... | 25.925926 | 63 | 0.55 |
6a835d3b001efaa29e71486e6b86d6597cd63fa4 | 670 | py | Python | angel-ps/python/pyangel/ml/regression/__init__.py | weien8899/angel | 829ce1a02e147d1f93b6375c2d07208ea31e53a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2017-11-24T07:40:30.000Z | 2017-11-24T07:40:30.000Z | angel-ps/python/pyangel/ml/regression/__init__.py | weien8899/angel | 829ce1a02e147d1f93b6375c2d07208ea31e53a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | angel-ps/python/pyangel/ml/regression/__init__.py | weien8899/angel | 829ce1a02e147d1f93b6375c2d07208ea31e53a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2018-09-28T00:31:04.000Z | 2018-09-28T00:31:04.000Z | #
# Tencent is pleased to support the open source community by making Angel available.
#
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of ... | 41.875 | 102 | 0.770149 |
0bc8c93bdb51323da52274bd9d27a91524604558 | 66,517 | py | Python | src/models/sklearnwrapper.py | softsys4ai/athena | 26f60aaf431fa8e9c9f5498ed52cdf10cfd7acdd | [
"MIT"
] | 38 | 2020-01-03T19:25:54.000Z | 2022-01-26T09:22:01.000Z | src/models/sklearnwrapper.py | softsys4ai/athena | 26f60aaf431fa8e9c9f5498ed52cdf10cfd7acdd | [
"MIT"
] | 11 | 2020-01-06T19:31:50.000Z | 2021-09-18T05:32:48.000Z | src/models/sklearnwrapper.py | softsys4ai/athena | 26f60aaf431fa8e9c9f5498ed52cdf10cfd7acdd | [
"MIT"
] | 10 | 2020-01-07T00:50:10.000Z | 2022-03-21T09:45:23.000Z | """
Implement weak defense model for Athena on top of IBM Trusted-AI ART 1.2.0.
@author: Ying Meng (y(dot)meng201011(at)gmail(dot)com)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# MIT License
#
# Copyright (C) IBM Corporation 2018
#
# Permission is hereby granted, free of ch... | 43.503597 | 123 | 0.606356 |
0665ec84c5b902d0afd5fea227ebb748721af55d | 2,182 | py | Python | src/utils/graph_utils.py | tumeteor/ST-GCN | aaf682df01c5ce6cca94b4b6d43513e87755f094 | [
"Apache-2.0"
] | 1 | 2021-01-05T21:48:02.000Z | 2021-01-05T21:48:02.000Z | src/utils/graph_utils.py | tumeteor/ST-GCN | aaf682df01c5ce6cca94b4b6d43513e87755f094 | [
"Apache-2.0"
] | null | null | null | src/utils/graph_utils.py | tumeteor/ST-GCN | aaf682df01c5ce6cca94b4b6d43513e87755f094 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
def get_berlin_graph(g, berlin_lat=52, berlin_lon=13):
"""
Get only the berlin area from JURBEY
Args:
g (JURBEY):
berlin_lat (int): the rounded Berlin lat
berlin_lon (int): the rounded Berlin lon
Returns:
"""
nodes = list(g.nodes... | 28.710526 | 101 | 0.623281 |
90b7043b4eef2e27eaae577e250534a4b7dc3362 | 689 | py | Python | Networks/CNNCifar.py | Soptq/Overlap-FedAvg | dbdbb77a6fc83979a710f88922fabbf540433a7e | [
"MIT"
] | 7 | 2021-06-21T16:39:29.000Z | 2022-03-17T05:11:59.000Z | Networks/CNNCifar.py | Soptq/Overlap-FedAvg | dbdbb77a6fc83979a710f88922fabbf540433a7e | [
"MIT"
] | null | null | null | Networks/CNNCifar.py | Soptq/Overlap-FedAvg | dbdbb77a6fc83979a710f88922fabbf540433a7e | [
"MIT"
] | 1 | 2021-12-23T08:20:22.000Z | 2021-12-23T08:20:22.000Z | import torch
from torch import nn
import torch.nn.functional as F
class CNNCifar(nn.Module):
def __init__(self, num_classes):
super(CNNCifar, self).__init__()
self.conv1 = nn.Conv2d(3, 32, 5)
self.pool = nn.MaxPool2d(2, 2)
self.conv2 = nn.Conv2d(32, 64, 5)
self.fc1 = nn.Lin... | 29.956522 | 46 | 0.561684 |
e8eb084843b5350c98e92ffddf6b2ea05ee444cb | 13,066 | py | Python | cdr_plugin_folder_to_folder/processing/Loops.py | samarthdd/cdr-plugin-folder-to-folder | def780f5590f63066194ff7b348fd256d7f74a10 | [
"Apache-2.0"
] | null | null | null | cdr_plugin_folder_to_folder/processing/Loops.py | samarthdd/cdr-plugin-folder-to-folder | def780f5590f63066194ff7b348fd256d7f74a10 | [
"Apache-2.0"
] | null | null | null | cdr_plugin_folder_to_folder/processing/Loops.py | samarthdd/cdr-plugin-folder-to-folder | def780f5590f63066194ff7b348fd256d7f74a10 | [
"Apache-2.0"
] | null | null | null | import os
import os.path
import sys
import threading
import asyncio
import subprocess
import shutil
from multiprocessing.pool import ThreadPool
from osbot_utils.testing.Duration import Duration
from osbot_utils.utils.Files import create_folder, folder_exists, folder_delete_all
from cdr_plugin_folder_to_folder.common_... | 39.355422 | 154 | 0.650543 |
1578852a68f7a6d2c6c5dfecd6b5cfc2c062ab29 | 255 | py | Python | foundryapp/foundryapp/doctype/mapping/mapping.py | umaepoch/foundryapp | 75e20cb399b114d416d3bdd286edd8c5a4690c75 | [
"MIT"
] | null | null | null | foundryapp/foundryapp/doctype/mapping/mapping.py | umaepoch/foundryapp | 75e20cb399b114d416d3bdd286edd8c5a4690c75 | [
"MIT"
] | null | null | null | foundryapp/foundryapp/doctype/mapping/mapping.py | umaepoch/foundryapp | 75e20cb399b114d416d3bdd286edd8c5a4690c75 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, yashwanth and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class Mapping(Document):
pass
| 23.181818 | 49 | 0.772549 |
fbf53c7146e3ca7f0d19f6405176785d9dbbd2c3 | 3,028 | py | Python | neuralprocess/data/step.py | MIC-DKFZ/gpconvcnp | 4f29412f9a928362c5d3626703df4a5d5b1489d1 | [
"MIT"
] | 8 | 2021-07-03T01:48:32.000Z | 2021-12-17T13:11:07.000Z | neuralprocess/data/step.py | MIC-DKFZ/gpconvcnp | 4f29412f9a928362c5d3626703df4a5d5b1489d1 | [
"MIT"
] | null | null | null | neuralprocess/data/step.py | MIC-DKFZ/gpconvcnp | 4f29412f9a928362c5d3626703df4a5d5b1489d1 | [
"MIT"
] | 3 | 2021-08-04T12:58:58.000Z | 2021-09-18T18:34:58.000Z | import numpy as np
import torch
from neuralprocess.data.base import FunctionGenerator
class StepFunctionGenerator(FunctionGenerator):
"""
Generate step functions.
Args:
batch_size (int): Batch size.
y_range (tuple): Allowed y range.
number_of_steps (int): Number of steps in the i... | 34.409091 | 88 | 0.588177 |
83ab5d37c9f2c8599fd47ca852b3c217e3e7a1a2 | 5,509 | py | Python | wagtail/images/forms.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 8,851 | 2016-12-09T19:01:45.000Z | 2022-03-31T04:45:06.000Z | wagtail/images/forms.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 5,197 | 2016-12-09T19:24:37.000Z | 2022-03-31T22:17:55.000Z | wagtail/images/forms.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 2,548 | 2016-12-09T18:16:55.000Z | 2022-03-31T21:34:38.000Z | from django import forms
from django.conf import settings
from django.forms.models import modelform_factory
from django.utils.text import capfirst
from django.utils.translation import gettext as _
from wagtail.admin import widgets
from wagtail.admin.forms.collections import (
BaseCollectionMemberForm, CollectionCh... | 37.732877 | 122 | 0.672173 |
edca1d68600070456de1772820b62287b9b2d4a9 | 1,466 | py | Python | geo/app/app/backend/eclipse2017_app.py | isabella232/eclipse2017 | a328c6d437638b1fe89aa8a24579406f01fe970d | [
"Apache-2.0"
] | 18 | 2017-03-17T18:10:55.000Z | 2022-03-30T17:35:55.000Z | geo/app/app/backend/eclipse2017_app.py | google/eclipse2017 | a328c6d437638b1fe89aa8a24579406f01fe970d | [
"Apache-2.0"
] | 1 | 2021-06-27T16:01:10.000Z | 2021-06-27T16:21:50.000Z | geo/app/app/backend/eclipse2017_app.py | isabella232/eclipse2017 | a328c6d437638b1fe89aa8a24579406f01fe970d | [
"Apache-2.0"
] | 8 | 2017-03-28T13:34:50.000Z | 2021-06-27T15:39:10.000Z | #
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 29.918367 | 80 | 0.706685 |
419430a0b5ee11430d108335867ffe836d0deec0 | 7,648 | py | Python | flopco/flopco.py | ABaaaC/flopco-pytorch | 85465b493fade1b73b8209caa38d82d1c8d2a0ef | [
"MIT"
] | null | null | null | flopco/flopco.py | ABaaaC/flopco-pytorch | 85465b493fade1b73b8209caa38d82d1c8d2a0ef | [
"MIT"
] | null | null | null | flopco/flopco.py | ABaaaC/flopco-pytorch | 85465b493fade1b73b8209caa38d82d1c8d2a0ef | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
from collections import defaultdict
from functools import partial
import copy
from flopco.compute_layer_flops import *
class FlopCo():
def __init__(self, model, img_size = (1, 3, 224, 224), custom_tensor = None, device = 'cpu', instances = None):
... | 34.295964 | 115 | 0.504446 |
256a936eca18ba091adf9a6db3118de56833f342 | 4,258 | py | Python | locallibrary/settings.py | valerie528/django_local_library | 9e7827f45b2c0dc6d9bd89b7038a2f8dcf7a048f | [
"Apache-2.0"
] | null | null | null | locallibrary/settings.py | valerie528/django_local_library | 9e7827f45b2c0dc6d9bd89b7038a2f8dcf7a048f | [
"Apache-2.0"
] | null | null | null | locallibrary/settings.py | valerie528/django_local_library | 9e7827f45b2c0dc6d9bd89b7038a2f8dcf7a048f | [
"Apache-2.0"
] | null | null | null | """
Django settings for locallibrary project.
Generated by 'django-admin startproject' using Django 2.2.16.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import... | 28.77027 | 102 | 0.719587 |
e8b2ffd1eb21914b567b8a521e07baf296cbef6e | 3,416 | py | Python | certbot-dns-ovh/setup.py | silverbacknet/certbot | 270b5535e24fd3dab4c05fa8929adca8117942f1 | [
"Apache-2.0"
] | null | null | null | certbot-dns-ovh/setup.py | silverbacknet/certbot | 270b5535e24fd3dab4c05fa8929adca8117942f1 | [
"Apache-2.0"
] | null | null | null | certbot-dns-ovh/setup.py | silverbacknet/certbot | 270b5535e24fd3dab4c05fa8929adca8117942f1 | [
"Apache-2.0"
] | null | null | null | from distutils.version import LooseVersion
import os
import sys
from setuptools import __version__ as setuptools_version
from setuptools import find_packages
from setuptools import setup
from setuptools.command.test import test as TestCommand
version = '1.7.0.dev0'
# Remember to update local-oldest-requirements.txt ... | 33.165049 | 97 | 0.647834 |
31672554d7790e95af3c77ace000773f82a2ed2d | 41,020 | py | Python | psono/restapi/tests/recoverycode.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 48 | 2018-04-19T15:50:58.000Z | 2022-01-23T15:58:11.000Z | psono/restapi/tests/recoverycode.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 9 | 2018-09-13T14:56:18.000Z | 2020-01-17T16:44:33.000Z | psono/restapi/tests/recoverycode.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 11 | 2019-09-20T11:53:47.000Z | 2021-07-18T22:41:31.000Z | from django.urls import reverse
from django.conf import settings
from django.contrib.auth.hashers import check_password, make_password
from django.utils import timezone
from rest_framework import status
from restapi import models
from .base import APITestCaseExtended
from datetime import timedelta
from ..utils impo... | 36.723366 | 117 | 0.670624 |
60387fc7215a34ece20e860661209110d8f6ad7d | 1,448 | py | Python | flask_headless_cms/skeleton/app/helpers/json_builder.py | sartim/flask-headless-cms | ff568acd1687661bcdf62c5d05babf5ab446c877 | [
"MIT"
] | 5 | 2019-04-28T12:52:51.000Z | 2021-05-24T07:05:31.000Z | flask_headless_cms/skeleton/app/helpers/json_builder.py | sartim/flask-headless-cms | ff568acd1687661bcdf62c5d05babf5ab446c877 | [
"MIT"
] | 59 | 2020-03-19T07:57:32.000Z | 2021-07-14T05:52:03.000Z | flask_headless_cms/skeleton/app/helpers/json_builder.py | sartim/flask-headless-cms | ff568acd1687661bcdf62c5d05babf5ab446c877 | [
"MIT"
] | null | null | null | import flask
from flask import jsonify
from app.helpers.exceptions import JsonException
def success_js_response(dict_ctx={}, success=True, message=None):
dict_ctx["success"] = success
if not success and message is None:
raise JsonException("must define a message if returning an error")
else:
... | 37.128205 | 111 | 0.585635 |
6288f71c531a0077b15dfeba8f959cdbe32a6979 | 528 | py | Python | nelfurion/nelfurion/wsgi.py | nelfurion/nelfurion | dd4623fa2f04629231b25092fa8f4bb284cbe879 | [
"MIT"
] | null | null | null | nelfurion/nelfurion/wsgi.py | nelfurion/nelfurion | dd4623fa2f04629231b25092fa8f4bb284cbe879 | [
"MIT"
] | null | null | null | nelfurion/nelfurion/wsgi.py | nelfurion/nelfurion | dd4623fa2f04629231b25092fa8f4bb284cbe879 | [
"MIT"
] | null | null | null | """
WSGI config for nelfurion 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.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from whitenoise import WhiteNoise
... | 26.4 | 78 | 0.806818 |
e7900acef9478d60666bc488172937ef14e33dda | 10,187 | py | Python | src/BERT_experiments/tokenization.py | danieldeutsch/SumQE | 98ffbf57adc072a32a3478f6acc91bf0664433a8 | [
"MIT"
] | 20 | 2019-09-04T13:01:02.000Z | 2021-03-05T08:50:45.000Z | src/BERT_experiments/tokenization.py | danieldeutsch/SumQE | 98ffbf57adc072a32a3478f6acc91bf0664433a8 | [
"MIT"
] | 6 | 2019-11-04T22:19:55.000Z | 2022-03-11T23:58:41.000Z | src/BERT_experiments/tokenization.py | danieldeutsch/SumQE | 98ffbf57adc072a32a3478f6acc91bf0664433a8 | [
"MIT"
] | 5 | 2019-10-12T14:10:46.000Z | 2020-12-07T11:58:00.000Z | import collections
import unicodedata
import six
import tensorflow as tf
from numpy import unicode
def convert_to_unicode(text):
"""Converts `text` to Unicode (if it's not already), assuming utf-8 input."""
if six.PY3:
if isinstance(text, str):
return text
elif isinstance(text, byt... | 33.18241 | 84 | 0.579955 |
4a7c7664af3211c5afc6847bdc43fb5bffda7bd9 | 1,300 | py | Python | https.py | crazyguitar/ktls.py | c1f4f9707d21f2f4c2accc7492c9c9ea2398d3c9 | [
"MIT"
] | 5 | 2017-12-07T08:13:49.000Z | 2019-08-02T14:51:39.000Z | https.py | crazyguitar/ktls.py | c1f4f9707d21f2f4c2accc7492c9c9ea2398d3c9 | [
"MIT"
] | null | null | null | https.py | crazyguitar/ktls.py | c1f4f9707d21f2f4c2accc7492c9c9ea2398d3c9 | [
"MIT"
] | 1 | 2020-10-22T06:49:47.000Z | 2020-10-22T06:49:47.000Z | #!/usr/bin/env python3.6
import types
import ssl
import os
from http.server import (
HTTPServer,
SimpleHTTPRequestHandler)
from ktls.utils import set_ktls_sockopt
def sendall(self, b):
""" overwrite origin socket.sendall
ref: cpython/Lib/socketserver.py +791
"""
fd = self.fileno()
os.w... | 21.666667 | 57 | 0.643846 |
8af87da12ccf92e87ba6953829ccb0f892b57bed | 2,531 | py | Python | src/borland/file.py | glgomes/clonebuilder | ab8cd12536d201cc3f228877307705f8e20ceb8f | [
"MIT"
] | 1 | 2020-06-23T17:02:55.000Z | 2020-06-23T17:02:55.000Z | src/borland/file.py | glgomes/clonebuilder | ab8cd12536d201cc3f228877307705f8e20ceb8f | [
"MIT"
] | null | null | null | src/borland/file.py | glgomes/clonebuilder | ab8cd12536d201cc3f228877307705f8e20ceb8f | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
@author rpereira
Apr 18, 2012
Colocar aqui todo tratamento especifico de arquivo da borland:
bpk
bpg
bpr
res
rc
"""
import re
import os
from controller.front import FrontController
GROUP_EXTS = ["bpg"]
PACKAGE_EXTS = ["bpk"]
EXE_EXTS = ["bpr"]
"""Wildcards para abr... | 28.761364 | 95 | 0.472936 |
f7dbe8ac0c6793a82e012209701e89be028fc50a | 8,099 | py | Python | vitrage_tempest_plugin/tests/common/tempest_clients.py | openstack/vitrage-tempest-plugin | 69acc7f3ea26f8c3a652cdf9d1fd842dbf9af58f | [
"Apache-2.0"
] | 6 | 2018-08-02T12:11:09.000Z | 2019-03-05T11:45:09.000Z | vitrage_tempest_plugin/tests/common/tempest_clients.py | openstack/vitrage-tempest-plugin | 69acc7f3ea26f8c3a652cdf9d1fd842dbf9af58f | [
"Apache-2.0"
] | null | null | null | vitrage_tempest_plugin/tests/common/tempest_clients.py | openstack/vitrage-tempest-plugin | 69acc7f3ea26f8c3a652cdf9d1fd842dbf9af58f | [
"Apache-2.0"
] | 1 | 2018-08-22T12:29:54.000Z | 2018-08-22T12:29:54.000Z | # Copyright 2016 Nokia
#
# 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... | 30.794677 | 78 | 0.621064 |
08b839624d3509d757e299d31f5f7c8e83c2704e | 3,307 | py | Python | examples/cube_mesh.py | lukius/mlab-tools | 04b0f64a26305354febcbf3f235e2817cbe9077c | [
"MIT"
] | null | null | null | examples/cube_mesh.py | lukius/mlab-tools | 04b0f64a26305354febcbf3f235e2817cbe9077c | [
"MIT"
] | 1 | 2017-07-13T04:33:55.000Z | 2017-07-13T04:40:35.000Z | examples/cube_mesh.py | lukius/mlab-tools | 04b0f64a26305354febcbf3f235e2817cbe9077c | [
"MIT"
] | null | null | null | import sys
sys.path.append('../')
from mlab_tools.animation import Animation, StopAnimation
from mlab_tools.geometry import GeometryParser
from mlab_tools.polyline import AnimatedPolyLine
class CubeMeshAnimation(Animation):
"""This example shows how to use a VTK geometry file to render a 3D polyhedron mesh.... | 33.744898 | 91 | 0.554279 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.