hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0813c956b911c2322c1cd36156a1cf073714b499 | 1,730 | py | Python | venv/Lib/site-packages/tensorflow/python/keras/api/_v2/keras/applications/nasnet/__init__.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/python/keras/api/_v2/keras/applications/nasnet/__init__.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/python/keras/api/_v2/keras/applications/nasnet/__init__.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | 1 | 2020-06-28T11:47:47.000Z | 2020-06-28T11:47:47.000Z | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""NASNet-A models for Keras.
NASNet refers to Neural Architecture Search Network, a family of models
that were designed automatically by learning the model architectures
directly on the da... | 44.358974 | 82 | 0.645087 |
0813d19f085a56bfac7cf19df533b2f31b6e1481 | 3,303 | py | Python | core/permissions.py | DerrazSofiane/DjangoREST_To-Do_App | 5d2743ff8f20ff08d9e98e88a4ec35c7c29d9879 | [
"CC0-1.0"
] | null | null | null | core/permissions.py | DerrazSofiane/DjangoREST_To-Do_App | 5d2743ff8f20ff08d9e98e88a4ec35c7c29d9879 | [
"CC0-1.0"
] | 8 | 2021-03-19T00:35:00.000Z | 2022-03-12T00:18:20.000Z | core/permissions.py | DerrazSofiane/DjangoREST_To-Do_App | 5d2743ff8f20ff08d9e98e88a4ec35c7c29d9879 | [
"CC0-1.0"
] | null | null | null | from rest_framework import permissions
from core.models import UserProfileModel, TodoGroupModel, TodoModel
class UserProfilePermissions(permissions.BasePermission):
"""The Permission class used by UserProfileView."""
safe_methods = {'GET', 'POST', 'HEAD', 'OPTIONS'}
def has_permission(self, request, vi... | 33.03 | 78 | 0.628217 |
0813d2a7a63b686369970d02bfa8d790dd1bd4c2 | 5,732 | py | Python | tests/_display/test_width_and_height_interfaces_for_ellipse.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | tests/_display/test_width_and_height_interfaces_for_ellipse.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | tests/_display/test_width_and_height_interfaces_for_ellipse.py | simon-ritchie/apyscript | c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279 | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | from random import randint
from retrying import retry
import apysc as ap
from apysc._display.width_and_height_interfaces_for_ellipse import \
WidthAndHeightInterfacesForEllipse
from apysc._expression import expression_data_util
class TestWidthAndHeightInterfacesForEllipse:
@retry(stop_max_attem... | 43.424242 | 79 | 0.687718 |
0813fe5a022a6bf0f5e5bf4b3f68900cc08574d5 | 3,658 | py | Python | hytra/plugins/merger_resolver/gmm_merger_resolver.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | hytra/plugins/merger_resolver/gmm_merger_resolver.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | hytra/plugins/merger_resolver/gmm_merger_resolver.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | from hytra.pluginsystem import merger_resolver_plugin
import numpy as np
from sklearn import mixture
class GMMMergerResolver(merger_resolver_plugin.MergerResolverPlugin):
"""
Computes the subtraction of features in the feature vector
"""
def initGMM(self, mergerCount, object_init_list=None):
... | 41.568182 | 116 | 0.661564 |
08143afd1d3ba5fe36d2ca26371650669a66d4d7 | 1,106 | py | Python | pyglacier/settings.py | perrette/pyglacier | e29ca10f7ad2ebfb6a3bdd0db246e6d24536d95f | [
"MIT"
] | null | null | null | pyglacier/settings.py | perrette/pyglacier | e29ca10f7ad2ebfb6a3bdd0db246e6d24536d95f | [
"MIT"
] | null | null | null | pyglacier/settings.py | perrette/pyglacier | e29ca10f7ad2ebfb6a3bdd0db246e6d24536d95f | [
"MIT"
] | null | null | null | """ General pyglacier settings
"""
import os
# CODEDIR = os.path.dirname(__file__)+'/../'
# Assume the program is started from the code directory, unless otherwise indicated
CODEDIR = './'
OUTDIR = './out/' # out directory in calling directory
INFILE = "./input/glacier.nc"
RSTFILE = "" # not restart file by default
... | 29.105263 | 98 | 0.644665 |
081448042eb0461f3ebdfb43d3ef072fabb98180 | 4,882 | py | Python | spikewidgets/widgets/mapswidget/activitymapwidget.py | samuelgarcia/spikewidgets | b7bce4a5e5da38f1e91b522ff12a9c97e7b5b9f8 | [
"MIT"
] | null | null | null | spikewidgets/widgets/mapswidget/activitymapwidget.py | samuelgarcia/spikewidgets | b7bce4a5e5da38f1e91b522ff12a9c97e7b5b9f8 | [
"MIT"
] | null | null | null | spikewidgets/widgets/mapswidget/activitymapwidget.py | samuelgarcia/spikewidgets | b7bce4a5e5da38f1e91b522ff12a9c97e7b5b9f8 | [
"MIT"
] | 1 | 2020-09-11T06:54:44.000Z | 2020-09-11T06:54:44.000Z | import numpy as np
import spiketoolkit as st
import matplotlib.pylab as plt
from ..utils import LabeledRectangle
from spikewidgets.widgets.basewidget import BaseWidget
def plot_activity_map(recording, channel_ids=None, trange=None, cmap='viridis', background='on', label_color='r',
transpose=Fals... | 37.553846 | 119 | 0.567595 |
081449f7e292d2cdceaa4f22c512b13d5978ad5b | 9,194 | py | Python | neuropype/nodes/RunningAverage.py | ablot/Pinceau | ae8f3dd088349f8976a5ddf91d83c60ca1ef39e2 | [
"MIT"
] | null | null | null | neuropype/nodes/RunningAverage.py | ablot/Pinceau | ae8f3dd088349f8976a5ddf91d83c60ca1ef39e2 | [
"MIT"
] | null | null | null | neuropype/nodes/RunningAverage.py | ablot/Pinceau | ae8f3dd088349f8976a5ddf91d83c60ca1ef39e2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from neuropype import node
from neuropype.datatypes.Sweep import Sweep
#from neuropype.datatypes import Time_list, Sweep
#from neuropype.ressources._common import boxfilter, findextrema, cross_threshold
from neuropype import tag as tagModule
import numpy as np
from neuropype import parameter
... | 38.793249 | 100 | 0.511529 |
08146c9183f59009b96f9301868e6a55ed0343d1 | 393 | py | Python | core/migrations/0022_awardcategory_iswinner.py | lcbiplove/nepfdb | 56e48bb0dcae34d409b7d75d210d2938e763a953 | [
"MIT"
] | null | null | null | core/migrations/0022_awardcategory_iswinner.py | lcbiplove/nepfdb | 56e48bb0dcae34d409b7d75d210d2938e763a953 | [
"MIT"
] | null | null | null | core/migrations/0022_awardcategory_iswinner.py | lcbiplove/nepfdb | 56e48bb0dcae34d409b7d75d210d2938e763a953 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-20 12:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0021_auto_20210317_1401'),
]
operations = [
migrations.AddField(
model_name='awardcategory',
name='isWinner'... | 20.684211 | 53 | 0.605598 |
0814739b06bf91f4c7895f78277696eb5106b0e0 | 435 | py | Python | PlayStackCharm/playstackDjango/playstackDjango/App/PlayStack/migrations/0002_auto_20200521_0944.py | UNIZAR-30226-2020-02/Back-End | 3b650a899284cadef6db3e8b0952ab2e0f5c0951 | [
"BSD-2-Clause"
] | null | null | null | PlayStackCharm/playstackDjango/playstackDjango/App/PlayStack/migrations/0002_auto_20200521_0944.py | UNIZAR-30226-2020-02/Back-End | 3b650a899284cadef6db3e8b0952ab2e0f5c0951 | [
"BSD-2-Clause"
] | 49 | 2020-03-07T12:02:26.000Z | 2021-04-12T16:55:57.000Z | PlayStackCharm/playstackDjango/playstackDjango/App/PlayStack/migrations/0002_auto_20200521_0944.py | UNIZAR-30226-2020-02/Back-End | 3b650a899284cadef6db3e8b0952ab2e0f5c0951 | [
"BSD-2-Clause"
] | 1 | 2020-02-20T11:32:58.000Z | 2020-02-20T11:32:58.000Z | # Generated by Django 3.0.6 on 2020-05-21 09:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('PlayStack', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='podcast',
name='Capitulos',
... | 22.894737 | 104 | 0.618391 |
081475e527c3adaaed8900973b145501d96abfe9 | 11,516 | py | Python | rlkit/launchers/cvae_experiments.py | naomilwx/rlkit | d4514f89e4cef0a93a936c4f6b34b2099ae3a523 | [
"MIT"
] | null | null | null | rlkit/launchers/cvae_experiments.py | naomilwx/rlkit | d4514f89e4cef0a93a936c4f6b34b2099ae3a523 | [
"MIT"
] | null | null | null | rlkit/launchers/cvae_experiments.py | naomilwx/rlkit | d4514f89e4cef0a93a936c4f6b34b2099ae3a523 | [
"MIT"
] | null | null | null | import os.path as osp
import time
#import cv2
import numpy as np
from rlkit.samplers.data_collector.path_collector import VAEWrappedEnvPathCollector
from rlkit.torch.her.her import HERTrainer
from rlkit.util.video import VideoSaveFunction
from rlkit.launchers.common import *
def train_vae(variant):
variant['gr... | 32.715909 | 97 | 0.703977 |
081495011c12f8d392c91aecef3f878f9b831aba | 4,460 | py | Python | experiments/ashvin/icml2020/hand/adaptive/unnormalized1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/adaptive/unnormalized1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/adaptive/unnormalized1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment, process_args
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
from rlkit.torch.sac.policies im... | 30.972222 | 77 | 0.572197 |
0814a455b0efc8c5d629e38592ee4f292f544a67 | 1,329 | py | Python | tests/test_utils.py | d1g1tinc/drf-haystack | 7bf138948562ebcf3470954a4627dc12f6b09b96 | [
"MIT"
] | null | null | null | tests/test_utils.py | d1g1tinc/drf-haystack | 7bf138948562ebcf3470954a4627dc12f6b09b96 | [
"MIT"
] | null | null | null | tests/test_utils.py | d1g1tinc/drf-haystack | 7bf138948562ebcf3470954a4627dc12f6b09b96 | [
"MIT"
] | null | null | null | from django.test import TestCase
from drf_haystack.utils import merge_dict
class MergeDictTestCase(TestCase):
def setUp(self):
self.dict_a = {
"person": {"lastname": "Holmes", "combat_proficiency": ["Pistol", "boxing"]},
}
self.dict_b = {
"person": {
... | 30.204545 | 89 | 0.426637 |
08152787d152de0142c80820b5c131f16db1d4e1 | 10,054 | py | Python | archive/nexus-api-v2/Utility/Color.py | cloud-hybrid/delta | 402b00ed5aaa32ccef628361e9635879b7ace44f | [
"BSD-3-Clause"
] | null | null | null | archive/nexus-api-v2/Utility/Color.py | cloud-hybrid/delta | 402b00ed5aaa32ccef628361e9635879b7ace44f | [
"BSD-3-Clause"
] | null | null | null | archive/nexus-api-v2/Utility/Color.py | cloud-hybrid/delta | 402b00ed5aaa32ccef628361e9635879b7ace44f | [
"BSD-3-Clause"
] | 1 | 2022-01-03T05:33:15.000Z | 2022-01-03T05:33:15.000Z | #!/usr/bin/env python3
# -*- Coding: UTF-8 -*- #
# -*- System: Linux -*- #
# -*- Usage: *.py -*- #
#
# Copyright (c) 2021. Jacob B. Sanders, Cloud Hybrid LLC. & Affiliates.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions ... | 31.320872 | 113 | 0.536403 |
081533de27bd6ba2fd83c29c5d700b1dee268041 | 7,438 | py | Python | medical/STN.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:09:33.000Z | 2018-06-18T12:09:33.000Z | medical/STN.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | null | null | null | medical/STN.py | transcendentsky/py_tutorials | fed8e6c8d79f854a1cebcfd5c37297a163846208 | [
"Apache-2.0"
] | 1 | 2018-06-18T12:13:21.000Z | 2018-06-18T12:13:21.000Z | # coding: utf-8
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
from torchvision import datasets, transforms
from torch.autograd import Variable
import matplotlib.pyplot as plt
import numpy as np
import os
import sys... | 30.609053 | 75 | 0.577978 |
0815502aa91edbaa171c837fa2689cf223cb9cc1 | 10,004 | py | Python | magenta/models/polyamp/full_model.py | Jss7268/magenta | 10e0b2c50baaa01a9c942ed3334b5b2cca761bef | [
"Apache-2.0"
] | null | null | null | magenta/models/polyamp/full_model.py | Jss7268/magenta | 10e0b2c50baaa01a9c942ed3334b5b2cca761bef | [
"Apache-2.0"
] | 1 | 2020-03-01T16:02:10.000Z | 2020-03-01T16:02:10.000Z | magenta/models/polyamp/full_model.py | Jss7268/magenta | 10e0b2c50baaa01a9c942ed3334b5b2cca761bef | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Jack Spencer Smith.
#
# 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 w... | 47.412322 | 100 | 0.62455 |
08157058ec024c29adb8b83c2f670bc03bbe0ac1 | 123 | py | Python | example_cycles/check_record.py | swryan/pyCycleOld | fbab35b74d0e5487abe686ae0823ff52e75afb3b | [
"Apache-2.0"
] | null | null | null | example_cycles/check_record.py | swryan/pyCycleOld | fbab35b74d0e5487abe686ae0823ff52e75afb3b | [
"Apache-2.0"
] | null | null | null | example_cycles/check_record.py | swryan/pyCycleOld | fbab35b74d0e5487abe686ae0823ff52e75afb3b | [
"Apache-2.0"
] | null | null | null | from openmdao.recorders.case_reader import CaseReader
cr = CaseReader('propulsor.db')
print(cr.system_cases.list_cases()) | 24.6 | 53 | 0.813008 |
081570635a080e021b5531fabb9b279ef9f99e04 | 661 | py | Python | hnlp/sampler/sampler_tf.py | hscspring/hnlp | 20eb3172e6b3ecfe47fa6d657e7db4b3cf445404 | [
"MIT"
] | 2 | 2022-01-07T05:58:48.000Z | 2022-03-08T01:47:03.000Z | hnlp/sampler/sampler_tf.py | hscspring/hnlp | 20eb3172e6b3ecfe47fa6d657e7db4b3cf445404 | [
"MIT"
] | null | null | null | hnlp/sampler/sampler_tf.py | hscspring/hnlp | 20eb3172e6b3ecfe47fa6d657e7db4b3cf445404 | [
"MIT"
] | null | null | null | import tensorflow as tf
tf.random.set_seed(42)
def gen_input(
batch_size: int = 3, seq_len: int = 20, inp_num: int = 1, label_num: int = 2
):
res = []
for i in range(inp_num):
inp = tf.random.uniform(
shape=(batch_size, seq_len), minval=0, maxval=1000, dtype=tf.int32
)
... | 23.607143 | 84 | 0.602118 |
0815a3a7b0720c13ec40989824fa13fc6b11bd75 | 1,822 | py | Python | docs/tutorial_2.py | bopopescu/pypipegraph-2 | 3a3f9ba565789d8d73c8cd503703a957de2be9d8 | [
"MIT"
] | 4 | 2017-05-24T16:57:42.000Z | 2017-09-21T19:55:27.000Z | docs/tutorial_2.py | bopopescu/pypipegraph-2 | 3a3f9ba565789d8d73c8cd503703a957de2be9d8 | [
"MIT"
] | 2 | 2019-11-22T15:33:47.000Z | 2020-07-27T11:59:44.000Z | docs/tutorial_2.py | bopopescu/pypipegraph-2 | 3a3f9ba565789d8d73c8cd503703a957de2be9d8 | [
"MIT"
] | 4 | 2015-08-26T15:43:00.000Z | 2020-07-20T03:36:40.000Z | import pypipegraph
import urllib2
import hashlib
pypipegraph.new_pipegraph()
output_filename = "result.tab" # where to store the final counts
# each call to download_job will return a job that downloads just this url.
def download_job(url):
target_file = (
"website_%s" % hashlib.md5(url).hexdigest()
... | 28.030769 | 92 | 0.673436 |
0816036da9710505e5e21278c013111a9e4067eb | 9,293 | py | Python | moler/io/raw/memory.py | AdamKlekowski/moler | 9d032bad402d9863685b2a8624320566512c14cc | [
"BSD-3-Clause"
] | 2 | 2021-03-14T15:17:10.000Z | 2021-03-15T07:12:12.000Z | moler/io/raw/memory.py | Laymer/moler | 2d7b89efdc2ca5e9975112b97934b396e24b5505 | [
"BSD-3-Clause"
] | null | null | null | moler/io/raw/memory.py | Laymer/moler | 2d7b89efdc2ca5e9975112b97934b396e24b5505 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
External-IO connections based on memory buffer.
The only 3 requirements for these connections are:
(1) store Moler's connection inside self.moler_connection attribute
(2) plugin into Moler's connection the way IO outputs data to external world:
self.moler_connection.how2send = self.sen... | 35.334601 | 89 | 0.593242 |
081677e3239ff61e54655310c24808b7db6ffc23 | 221 | py | Python | py2env/bin/mdexport.py | JonathanRowe/python-saml-master | 81dad60667191e6e1443a770bf779f175ed6beac | [
"MIT"
] | null | null | null | py2env/bin/mdexport.py | JonathanRowe/python-saml-master | 81dad60667191e6e1443a770bf779f175ed6beac | [
"MIT"
] | 2 | 2020-06-06T00:11:05.000Z | 2021-06-10T22:19:47.000Z | py2env/bin/mdexport.py | JonathanRowe/python-saml-master | 81dad60667191e6e1443a770bf779f175ed6beac | [
"MIT"
] | null | null | null | #!/Users/jonathan/Desktop/python-saml-master/py2env/bin/python
# EASY-INSTALL-SCRIPT: 'pysaml2==4.9.0','mdexport.py'
__requires__ = 'pysaml2==4.9.0'
__import__('pkg_resources').run_script('pysaml2==4.9.0', 'mdexport.py')
| 44.2 | 71 | 0.737557 |
0816910033fe85140e693354334bb10534525cc4 | 1,099 | py | Python | biobb_disgenet/test/unitests/test_template/test_template_container.py | mapoferri/biobb_disgenet | b261e3c1ec412897fe2f480eb588458c4c41cf5e | [
"Apache-2.0"
] | 1 | 2020-06-23T22:39:51.000Z | 2020-06-23T22:39:51.000Z | biobb_disgenet/test/unitests/test_template/test_template_container.py | mapoferri/biobb_disgenet | b261e3c1ec412897fe2f480eb588458c4c41cf5e | [
"Apache-2.0"
] | 1 | 2019-03-04T15:27:44.000Z | 2020-03-05T16:26:25.000Z | biobb_disgenet/test/unitests/test_template/test_template_container.py | mapoferri/biobb_disgenet | b261e3c1ec412897fe2f480eb588458c4c41cf5e | [
"Apache-2.0"
] | null | null | null | from biobb_common.tools import test_fixtures as fx
from biobb_template.template.template_container import template_container
class TestTemplateDocker():
def setUp(self):
fx.test_setup(self, 'template_container')
def tearDown(self):
fx.test_teardown(self)
pass
def test_template_doc... | 35.451613 | 91 | 0.718835 |
0816a0b2470968959a28058fcbc435bd63e3bab8 | 21,808 | py | Python | eegip/clustering.py | christian-oreilly/eegip | 521a408b65ec99b11ca7903f67288807704015e4 | [
"BSD-3-Clause"
] | null | null | null | eegip/clustering.py | christian-oreilly/eegip | 521a408b65ec99b11ca7903f67288807704015e4 | [
"BSD-3-Clause"
] | null | null | null | eegip/clustering.py | christian-oreilly/eegip | 521a408b65ec99b11ca7903f67288807704015e4 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pandas as pd
import pickle
import scipy
from scipy.cluster import hierarchy
from scipy.spatial import distance
from scipy.cluster.hierarchy import _LINKAGE_METHODS
from multiprocessing import Pool
from itertools import product, combinations
from functools import partial
from warnings import wa... | 40.535316 | 118 | 0.656319 |
0816ae6cdfdbb24b3b470ba54194d3953e8ff882 | 34,529 | py | Python | tests/unit/test_client.py | schlitzered/pyredis | 4f5049aae7ae2702f22ccfb661ca3f13869a3c31 | [
"MIT"
] | 43 | 2015-12-15T12:39:18.000Z | 2021-05-13T08:52:26.000Z | tests/unit/test_client.py | schlitzered/pyredis | 4f5049aae7ae2702f22ccfb661ca3f13869a3c31 | [
"MIT"
] | 7 | 2016-03-07T14:16:33.000Z | 2019-10-17T15:24:23.000Z | tests/unit/test_client.py | schlitzered/pyredis | 4f5049aae7ae2702f22ccfb661ca3f13869a3c31 | [
"MIT"
] | 15 | 2015-11-19T03:22:26.000Z | 2021-10-16T15:29:56.000Z | __author__ = 'schlitzer'
from unittest import TestCase
from unittest.mock import Mock, MagicMock, PropertyMock, call, patch
from collections import deque
import pyredis.client
from pyredis.exceptions import *
try:
from hiredis import ReplyError
except ImportError:
from pyredis.exceptions import ReplyError
... | 38.027533 | 105 | 0.647514 |
0816cfd4849c0ba4ca13803ea156cf0256a12b3d | 4,546 | py | Python | leetcode/2-medium/1-arraystring/4-longestsubstr/longest_substring.py | ai7/study | be490336dc70ade62a8ff8d7866af7ac52bef4c1 | [
"MIT"
] | null | null | null | leetcode/2-medium/1-arraystring/4-longestsubstr/longest_substring.py | ai7/study | be490336dc70ade62a8ff8d7866af7ac52bef4c1 | [
"MIT"
] | null | null | null | leetcode/2-medium/1-arraystring/4-longestsubstr/longest_substring.py | ai7/study | be490336dc70ade62a8ff8d7866af7ac52bef4c1 | [
"MIT"
] | null | null | null | # https://leetcode.com/explore/interview/card/top-interview-questions-medium/103/array-and-strings/779/
# https://leetcode.com/problems/longest-substring-without-repeating-characters/
# Longest Substring Without Repeating Characters
#
# Given a string, find the length of the longest substring without
# repeating chara... | 31.351724 | 103 | 0.555873 |
0816e2d465ff2ead09a1baf8296a415a2be9e9db | 1,882 | py | Python | Algorithm1/validation.py | bharatmonga/Supervised-learning-algorithms | de2ecf6bd608870a3ef2a799763ef33815a33c04 | [
"MIT"
] | null | null | null | Algorithm1/validation.py | bharatmonga/Supervised-learning-algorithms | de2ecf6bd608870a3ef2a799763ef33815a33c04 | [
"MIT"
] | null | null | null | Algorithm1/validation.py | bharatmonga/Supervised-learning-algorithms | de2ecf6bd608870a3ef2a799763ef33815a33c04 | [
"MIT"
] | 1 | 2021-01-25T13:26:49.000Z | 2021-01-25T13:26:49.000Z | import numpy as np
import pickle
from duffing import Duffing
import matplotlib.pyplot as plt
""" Initialize duffing object by loading parameters from the training data file """
f = open("learning_algorithm1_training_data", "rb")
d=pickle.load(f)
delta = d['delta']
df = Duffing(delta)
df.X = d['X']
df.U ... | 43.767442 | 127 | 0.697662 |
08170690f6b027c49c591c2563c924beda3627fb | 263 | py | Python | terrascript/mssql/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/mssql/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/mssql/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/mssql/__init__.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class mssql(terrascript.Provider):
pass
| 17.533333 | 79 | 0.768061 |
081709b7261dbd6e88be6cb9e7bc817cf7347f85 | 1,114 | py | Python | test/temp/temp_testing_channel.py | geolovic/topopy | 0ccfc4bfc0364b99489d08a1d4b87582deb08b81 | [
"MIT"
] | 5 | 2020-04-05T18:42:45.000Z | 2022-02-17T11:15:32.000Z | test/temp/temp_testing_channel.py | geolovic/topopy | 0ccfc4bfc0364b99489d08a1d4b87582deb08b81 | [
"MIT"
] | null | null | null | test/temp/temp_testing_channel.py | geolovic/topopy | 0ccfc4bfc0364b99489d08a1d4b87582deb08b81 | [
"MIT"
] | 5 | 2019-07-02T11:14:54.000Z | 2021-12-15T08:43:42.000Z | # -*- coding: utf-8 -*-
"""
Editor de Spyder
Este es un archivo temporal
"""
from topopy import Network, Channel, Flow, BNetwork
from osgeo import ogr
import numpy as np
#def rivers_to_channels(path, net, idfield=""):
path = "../data/in/jebja_channels.shp"
idfield=""
net = Network("../data/in/jebja30_net.dat")
... | 21.018868 | 51 | 0.675943 |
08173ad8dc46302e61c50e47faf1e5ed48911850 | 2,546 | py | Python | test/llc/low-level/AcceptanceTests/test_service_driven.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/llc/low-level/AcceptanceTests/test_service_driven.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/llc/low-level/AcceptanceTests/test_service_driven.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 1 | 2022-03-28T08:58:03.000Z | 2022-03-28T08:58:03.000Z |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | 39.169231 | 96 | 0.747447 |
081776fdc55101a4865761cd7aa2706cd672851e | 2,256 | py | Python | candlepb/Uno/structs/uno_mlp_baseline.py | deephyper/candlepb | e99cf34c74bbcf85721a3091b587bf16ab4b667a | [
"BSD-2-Clause"
] | 1 | 2021-01-21T04:25:50.000Z | 2021-01-21T04:25:50.000Z | candlepb/Uno/structs/uno_mlp_baseline.py | deephyper/candlepb | e99cf34c74bbcf85721a3091b587bf16ab4b667a | [
"BSD-2-Clause"
] | null | null | null | candlepb/Uno/structs/uno_mlp_baseline.py | deephyper/candlepb | e99cf34c74bbcf85721a3091b587bf16ab4b667a | [
"BSD-2-Clause"
] | 1 | 2021-02-01T01:37:30.000Z | 2021-02-01T01:37:30.000Z | import tensorflow as tf
from deephyper.search.nas.model.space.node import ConstantNode, VariableNode
from deephyper.search.nas.model.space.op.merge import AddByPadding, Concatenate
from deephyper.search.nas.model.space.op.op1d import Dense, Dropout, Identity
from deephyper.search.nas.model.space.struct import AutoOutp... | 28.2 | 120 | 0.670213 |
08178215b576ae3a998049998edb796d77b9eced | 109 | py | Python | partools/mail/__init__.py | paularnaud2/PyTools | 09accc33e1dcfdde45671ad5962727554648b30c | [
"MIT"
] | null | null | null | partools/mail/__init__.py | paularnaud2/PyTools | 09accc33e1dcfdde45671ad5962727554648b30c | [
"MIT"
] | null | null | null | partools/mail/__init__.py | paularnaud2/PyTools | 09accc33e1dcfdde45671ad5962727554648b30c | [
"MIT"
] | null | null | null | from .main import gmail
from .main import no_auth
from .main import outlook
from .functions import init_mail
| 21.8 | 32 | 0.816514 |
0817a1f0f3412a1e80b23ae3f8ef83b9a6d3ff9b | 2,929 | py | Python | improver/cli/between_thresholds.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 77 | 2017-04-26T07:47:40.000Z | 2022-03-31T09:40:49.000Z | improver/cli/between_thresholds.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 1,440 | 2017-03-29T10:04:15.000Z | 2022-03-28T10:11:29.000Z | improver/cli/between_thresholds.py | MoseleyS/improver | ca028e3a1c842e3ff00b188c8ea6eaedd0a07149 | [
"BSD-3-Clause"
] | 72 | 2017-03-17T16:53:45.000Z | 2022-02-16T09:41:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... | 43.073529 | 81 | 0.730625 |
0817a92d8eb2b875962985e5da2f0e5cf2d6c2a4 | 1,326 | py | Python | tests/frontend/logging/plugins/logtest.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | tests/frontend/logging/plugins/logtest.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | tests/frontend/logging/plugins/logtest.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | from buildstream import Element
class LogTest(Element):
BST_MIN_VERSION = "2.0"
def configure(self, node):
pass
def preflight(self):
pass
def get_unique_key(self):
return {}
def configure_sandbox(self, sandbox):
pass
def stage(self, sandbox):
# Here... | 29.466667 | 78 | 0.625943 |
0817e338fe921f38a9ccc0a50a297f004db50290 | 20,342 | py | Python | official/vision/image_classification/imagenet_preprocessing.py | chrisfilippis/models | df98ff0011a009694e72000b12c9ee4b21d7b659 | [
"Apache-2.0"
] | 1 | 2020-01-14T02:00:41.000Z | 2020-01-14T02:00:41.000Z | official/vision/image_classification/imagenet_preprocessing.py | chrisfilippis/models | df98ff0011a009694e72000b12c9ee4b21d7b659 | [
"Apache-2.0"
] | null | null | null | official/vision/image_classification/imagenet_preprocessing.py | chrisfilippis/models | df98ff0011a009694e72000b12c9ee4b21d7b659 | [
"Apache-2.0"
] | 1 | 2021-09-02T08:06:29.000Z | 2021-09-02T08:06:29.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... | 37.67037 | 80 | 0.717088 |
0817e40915bf8a879f7ba20e353a237a6ce9c0cd | 2,218 | py | Python | nicos_mlz/kompass/setups/aircontrol.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/kompass/setups/aircontrol.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/kompass/setups/aircontrol.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | description = 'Aircontrol PLC devices'
group = 'optional'
tango_base = 'tango://kompasshw.kompass.frm2:10000/kompass/aircontrol/plc_'
devices = dict(
spare_motor_x2 = device('nicos.devices.entangle.Motor',
description = 'spare motor',
tangodevice = tango_base + 'spare_mot_x2',
fmtstr = '%... | 34.65625 | 88 | 0.596032 |
0817fb70a4c314db14cfa7e470d013fe48d9eb07 | 2,718 | py | Python | python/examples/control_sim/plotting.py | Smart-Ag/xviz | 71c4470fdcb5c497793eb53666da6a5feb6832f0 | [
"Apache-2.0"
] | 1 | 2021-06-03T04:02:49.000Z | 2021-06-03T04:02:49.000Z | python/examples/control_sim/plotting.py | Smart-Ag/xviz | 71c4470fdcb5c497793eb53666da6a5feb6832f0 | [
"Apache-2.0"
] | null | null | null | python/examples/control_sim/plotting.py | Smart-Ag/xviz | 71c4470fdcb5c497793eb53666da6a5feb6832f0 | [
"Apache-2.0"
] | null | null | null | import math
import matplotlib.pyplot as plt
from control_sim.utils import get_value_list
from scenarios.utils.gis import get_wheel_angle
plt.rcParams['figure.figsize'] = [16, 10]
plt.rcParams['savefig.facecolor'] = 'black'
plt.rcParams['figure.facecolor'] = 'black'
plt.rcParams['figure.edgecolor'] = 'white'
plt.rcPa... | 34.846154 | 78 | 0.685063 |
0817fc5fbb3609fbaa9147a4d86f1b5ab572e9cd | 3,885 | py | Python | lib/galaxy/web/framework/middleware/sentry.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | lib/galaxy/web/framework/middleware/sentry.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 1 | 2019-02-04T16:21:27.000Z | 2019-02-04T16:45:17.000Z | lib/galaxy/web/framework/middleware/sentry.py | chambm/galaxy | fd1926767996a161cd2fc8bd184e6835fd688765 | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | """
raven.middleware
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
try:
from raven import Client
from raven.utils.wsgi import get_current_url, get_headers, get_environ
except:
Client = None
from galaxy... | 38.465347 | 88 | 0.612613 |
081813ec2394cbfa83eab3d44858363c145502cb | 722 | py | Python | codesnippets/asyncio_echo_S35.py | shuntingyard/flowproc | 6d6f32b021f5f71d8fa177c9a891d2080364856e | [
"MIT"
] | null | null | null | codesnippets/asyncio_echo_S35.py | shuntingyard/flowproc | 6d6f32b021f5f71d8fa177c9a891d2080364856e | [
"MIT"
] | null | null | null | codesnippets/asyncio_echo_S35.py | shuntingyard/flowproc | 6d6f32b021f5f71d8fa177c9a891d2080364856e | [
"MIT"
] | 1 | 2020-05-19T14:36:23.000Z | 2020-05-19T14:36:23.000Z | import asyncio
@asyncio.coroutine
def handle_echo(reader, writer):
data = yield from reader.read(100)
message = data.decode()
print("Received %r" % message)
print("Send: %r" % message)
writer.write(data)
yield from writer.drain()
print("Close the client socket")
writer.close()
loop... | 21.878788 | 72 | 0.714681 |
08181b45a2a8688899e7143be7349f42b7e9a5b5 | 1,670 | py | Python | applications/hw5_2/models/tables.py | ayeh9/ecommerce_site | 0010dbc2f0d378c449772eb3ed2dfe0cce8b932e | [
"BSD-3-Clause"
] | null | null | null | applications/hw5_2/models/tables.py | ayeh9/ecommerce_site | 0010dbc2f0d378c449772eb3ed2dfe0cce8b932e | [
"BSD-3-Clause"
] | null | null | null | applications/hw5_2/models/tables.py | ayeh9/ecommerce_site | 0010dbc2f0d378c449772eb3ed2dfe0cce8b932e | [
"BSD-3-Clause"
] | null | null | null | # Define your tables below (or better in another model file) for example
#
# >>> db.define_table('mytable', Field('myfield', 'string'))
#
# Fields can be 'string','text','password','integer','double','boolean'
# 'date','time','datetime','blob','upload', 'reference TABLENAME'
# There is an implicit 'id integer aut... | 32.115385 | 90 | 0.721557 |
08185f1ef1ae77bb89b1cc1e8137f2cb249051eb | 995 | py | Python | core/argo/core/optimizers/utilsOptimizers.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 4 | 2020-12-07T19:13:13.000Z | 2022-01-30T18:52:18.000Z | core/argo/core/optimizers/utilsOptimizers.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 12 | 2020-09-25T22:41:28.000Z | 2022-02-09T23:46:34.000Z | core/argo/core/optimizers/utilsOptimizers.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 2 | 2021-03-02T18:31:04.000Z | 2021-03-02T21:56:43.000Z | import tensorflow as tf
from ..utils.argo_utils import NUMTOL
def my_loss_full_logits(y, logits):
n = logits.get_shape().as_list()[1]
probabilities = tf.nn.softmax(logits)
clipped_probabilities = tf.clip_by_value(probabilities, NUMTOL, 1 - NUMTOL)
loss = tf.reduce_sum(-tf.one_hot(y,depth=n)*tf.log(... | 29.264706 | 103 | 0.671357 |
08189250afce1780cf431804813a7157d5f9c296 | 795 | py | Python | vmg30/tools/info.py | ikalevatykh/vmg30 | 2d36e488942a7d2075cd829252b72721a35da19d | [
"MIT"
] | 1 | 2020-07-08T09:52:42.000Z | 2020-07-08T09:52:42.000Z | vmg30/tools/info.py | ikalevatykh/vmg30 | 2d36e488942a7d2075cd829252b72721a35da19d | [
"MIT"
] | null | null | null | vmg30/tools/info.py | ikalevatykh/vmg30 | 2d36e488942a7d2075cd829252b72721a35da19d | [
"MIT"
] | null | null | null | """This application show information about of the glove."""
import argparse
from ..glove import Glove
from ..error import GloveError
parser = argparse.ArgumentParser('Glove info')
parser.add_argument('--port', type=str, default='/dev/ttyUSB0', help='Glove serial port')
def info(port):
"""Show info.
Args:
... | 24.84375 | 89 | 0.610063 |
0818945820e23e1038c8c97eb5cc6abbf6ea0d2b | 21,052 | py | Python | parser.py | gggfox/compiler_proyect | d6c1836a0c83777e58cdc6da2a54a504a8d5b633 | [
"MIT"
] | null | null | null | parser.py | gggfox/compiler_proyect | d6c1836a0c83777e58cdc6da2a54a504a8d5b633 | [
"MIT"
] | null | null | null | parser.py | gggfox/compiler_proyect | d6c1836a0c83777e58cdc6da2a54a504a8d5b633 | [
"MIT"
] | null | null | null | '''
#############################
# Gerardo Galan Garzafox #
# A00821196 #
# #
# alebrije_parser.py #
# Created_at 2021-09-25 #
# #
#############################
'''
import sys
import procedure_dir
import ply.yacc as yacc
from lexer impor... | 25.6419 | 137 | 0.620559 |
0818aea63103498452e811b41115de0e4d81da56 | 6,526 | py | Python | mslib/msui/_tests/test_linearview.py | aravindm711/MSS | 128687ec036d445656a70ff4b82c3cb7586715e4 | [
"Apache-2.0"
] | 33 | 2020-12-04T04:29:28.000Z | 2022-03-05T17:11:49.000Z | mslib/msui/_tests/test_linearview.py | aravindm711/MSS | 128687ec036d445656a70ff4b82c3cb7586715e4 | [
"Apache-2.0"
] | 614 | 2020-12-06T16:54:44.000Z | 2022-03-31T07:41:02.000Z | mslib/msui/_tests/test_linearview.py | aravindm711/MSS | 128687ec036d445656a70ff4b82c3cb7586715e4 | [
"Apache-2.0"
] | 51 | 2020-12-04T15:10:46.000Z | 2022-03-20T02:02:11.000Z | # -*- coding: utf-8 -*-
"""
mslib.msui._tests.test_linearview
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides pytest functions to tests msui.linearview
This file is part of mss.
:copyright: Copyright 2021 May Bär
:copyright: Copyright 2021 by the mss team, see AUTHORS.
:license: APA... | 38.163743 | 112 | 0.69338 |
0818b24f8410bcd315357c2a80826e4195492e87 | 14,151 | py | Python | lib/cherrypy/lib/auth_digest.py | nkvoronov/script.module.cherrypy | 2573349bb7bba9b46102387ef3105f75cc8a82f9 | [
"BSD-3-Clause"
] | null | null | null | lib/cherrypy/lib/auth_digest.py | nkvoronov/script.module.cherrypy | 2573349bb7bba9b46102387ef3105f75cc8a82f9 | [
"BSD-3-Clause"
] | null | null | null | lib/cherrypy/lib/auth_digest.py | nkvoronov/script.module.cherrypy | 2573349bb7bba9b46102387ef3105f75cc8a82f9 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of CherryPy <http://www.cherrypy.org/>
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab:fileencoding=utf-8
import time
from hashlib import md5
import cherrypy
from cherrypy._cpcompat import ntob, parse_http_list, parse_keqv_list
__doc__ = """An implementation of the server-side of HTTP Digest A... | 36.191816 | 82 | 0.606812 |
0818d84547345757a2f1913a5e6a7e073024c607 | 8,066 | py | Python | boa/core/solver.py | dhirschfeld/boa | e29aca2c458c211627874a568de3d71545881f27 | [
"BSD-3-Clause"
] | null | null | null | boa/core/solver.py | dhirschfeld/boa | e29aca2c458c211627874a568de3d71545881f27 | [
"BSD-3-Clause"
] | null | null | null | boa/core/solver.py | dhirschfeld/boa | e29aca2c458c211627874a568de3d71545881f27 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2021, QuantStack
# SPDX-License-Identifier: BSD-3-Clause
import os
import tempfile
from conda.core.solve import diff_for_unlink_link_precs
from conda.common.serialize import json_dump
from conda.models.prefix_graph import PrefixGraph
from conda.core.prefix_data import PrefixData
from conda._vendor.bol... | 33.057377 | 84 | 0.645797 |
08190b776ebf02763636416229e52dc63bffd7b4 | 1,863 | py | Python | scandeval/benchmarks/idt_pos.py | NbAiLab/ScandEval | 59eb1902a1880d7483d48a4ee213bbec0e2eb71a | [
"MIT"
] | 10 | 2021-07-21T10:47:42.000Z | 2022-03-03T13:45:25.000Z | scandeval/benchmarks/idt_pos.py | NbAiLab/ScandEval | 59eb1902a1880d7483d48a4ee213bbec0e2eb71a | [
"MIT"
] | 28 | 2021-07-29T12:21:15.000Z | 2022-03-09T12:46:49.000Z | scandeval/benchmarks/idt_pos.py | NbAiLab/ScandEval | 59eb1902a1880d7483d48a4ee213bbec0e2eb71a | [
"MIT"
] | 4 | 2022-01-17T12:11:58.000Z | 2022-03-14T18:42:01.000Z | '''POS evaluation of a language model on the IDT dataset'''
import logging
from .abstract import PosBenchmark
logger = logging.getLogger(__name__)
class IdtPosBenchmark(PosBenchmark):
'''Benchmark of language models on the POS part of the IDT dataset.
Args:
cache_dir (str, optional):
... | 39.638298 | 78 | 0.634997 |
08193ba5ab51434d9fb845e8b9a9fd05fa85f3d9 | 1,078 | py | Python | server/openapi_server/controllers/tool_controller.py | cascadianblue/phi-annotator | 0da6c102ec1068e6b15c613e2a90a78f79d15935 | [
"Apache-2.0"
] | null | null | null | server/openapi_server/controllers/tool_controller.py | cascadianblue/phi-annotator | 0da6c102ec1068e6b15c613e2a90a78f79d15935 | [
"Apache-2.0"
] | 19 | 2021-07-29T03:14:38.000Z | 2022-03-01T06:03:14.000Z | server/openapi_server/controllers/tool_controller.py | cascadianblue/phi-annotator | 0da6c102ec1068e6b15c613e2a90a78f79d15935 | [
"Apache-2.0"
] | null | null | null | from openapi_server.models.tool import Tool # noqa: E501
from openapi_server.models.tool_dependencies import ToolDependencies # noqa: E501
from openapi_server.models.tool_type import ToolType # noqa: E501
from openapi_server.models.license import License
def get_tool(): # noqa: E501
"""Get tool information
... | 27.641026 | 82 | 0.67718 |
08194c24e31495b4fd2fe462b66e280ce62112bd | 330 | py | Python | genienlp/ned/__init__.py | Krish-sysadmin/genienlp | 3586e4368eb0b0756a772294daedc043ce55454c | [
"BSD-3-Clause"
] | 6 | 2019-04-30T19:47:17.000Z | 2019-11-30T04:16:47.000Z | genienlp/ned/__init__.py | Krish-sysadmin/genienlp | 3586e4368eb0b0756a772294daedc043ce55454c | [
"BSD-3-Clause"
] | null | null | null | genienlp/ned/__init__.py | Krish-sysadmin/genienlp | 3586e4368eb0b0756a772294daedc043ce55454c | [
"BSD-3-Clause"
] | null | null | null | from .abstract import AbstractEntityDisambiguator # noqa
from .bootleg import BatchBootlegEntityDisambiguator, ServingBootlegEntityDisambiguator # noqa
from .main import ( # noqa
EntityAndTypeOracleEntityDisambiguator,
EntityOracleEntityDisambiguator,
NaiveEntityDisambiguator,
TypeOracleEntityDisambi... | 36.666667 | 95 | 0.830303 |
08194c98f32e67a0cf5ae99d36ccba248fc3d604 | 2,848 | py | Python | optml/formulation.py | or-fusion/OptML | c0aae08e8504cbf53a94df2b2da42d33c2bc0ff6 | [
"BSD-3-Clause"
] | 1 | 2022-03-17T19:44:44.000Z | 2022-03-17T19:44:44.000Z | optml/formulation.py | or-fusion/OptML | c0aae08e8504cbf53a94df2b2da42d33c2bc0ff6 | [
"BSD-3-Clause"
] | null | null | null | optml/formulation.py | or-fusion/OptML | c0aae08e8504cbf53a94df2b2da42d33c2bc0ff6 | [
"BSD-3-Clause"
] | null | null | null | import weakref
import abc
class _PyomoFormulationInterface(abc.ABC):
""" Base class interface for a Pyomo formulation object. This class
is largely internal, and developers of new formulations should derive from
:class:`pyoml.opt.neuralnet.PyomoFormulation`."""
def __init__(self):
pass
@ab... | 32.735632 | 97 | 0.687149 |
081959291e1e9f9eeb50857f5285f0cab63920ad | 17,445 | py | Python | plugins/robothor_plugin/robothor_models.py | prithv1/allenact | ee736e6a3aeed29b3661ee18fa0dc0a68a40201e | [
"MIT"
] | 1 | 2020-09-10T13:09:14.000Z | 2020-09-10T13:09:14.000Z | plugins/robothor_plugin/robothor_models.py | andrlima/allenact | f29dd6f0ec62425b02ca07fee815b1a82627a28e | [
"MIT"
] | null | null | null | plugins/robothor_plugin/robothor_models.py | andrlima/allenact | f29dd6f0ec62425b02ca07fee815b1a82627a28e | [
"MIT"
] | null | null | null | import typing
from typing import Tuple, Dict, Union, Sequence, Optional
import gym
import torch
import torch.nn as nn
from gym.spaces import Dict as SpaceDict
from core.models.basic_models import RNNStateEncoder
from core.algorithms.onpolicy_sync.policy import (
ActorCriticModel,
LinearActorCriticHead,
Di... | 33.939689 | 103 | 0.612554 |
08196d663c35a111c03db305792f7e3acc75dada | 3,138 | py | Python | tap_list_providers/test/test_rr_500ml.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 18 | 2018-12-06T01:46:37.000Z | 2021-10-17T10:37:17.000Z | tap_list_providers/test/test_rr_500ml.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 194 | 2018-11-04T12:50:49.000Z | 2022-01-06T22:43:43.000Z | tap_list_providers/test/test_rr_500ml.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 7 | 2019-03-18T05:36:06.000Z | 2020-12-25T03:27:29.000Z | """Test the parsing of digitalpour data"""
from decimal import Decimal
import json
import os
from django.core.management import call_command
from django.test import TestCase
import responses
from beers.models import Beer, Manufacturer, ServingSize
from venues.test.factories import VenueFactory
from venues.models impor... | 36.488372 | 83 | 0.585723 |
08199499d695f6631dc4f4ec1d301692e2dfcdeb | 12,807 | py | Python | intersight/models/iam_end_point_user.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/iam_end_point_user.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/iam_end_point_user.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class IamEndPointUser(object):
"""
NOTE: This class... | 27.841304 | 235 | 0.594362 |
0819951465f5c9cb00a224d2ded2d231df1df4ea | 11,820 | py | Python | neutron/tests/tempest/api/test_tag.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | null | null | null | neutron/tests/tempest/api/test_tag.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | null | null | null | neutron/tests/tempest/api/test_tag.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 33.579545 | 78 | 0.658122 |
081999c17ba45275348274b4d6387a0fce4cddf7 | 2,514 | py | Python | nova/objects/tag.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 1 | 2015-11-30T19:44:00.000Z | 2015-11-30T19:44:00.000Z | nova/objects/tag.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 11 | 2017-06-19T01:28:55.000Z | 2017-06-23T02:01:47.000Z | nova/objects/tag.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 7 | 2015-01-20T10:30:08.000Z | 2020-02-05T10:29:05.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
# d... | 32.649351 | 79 | 0.696897 |
0819a6826239a158690de2978623d702659abbc7 | 953 | py | Python | leetcode/medium/56-Merge_intervals.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | 1 | 2020-02-25T10:32:27.000Z | 2020-02-25T10:32:27.000Z | leetcode/medium/56-Merge_intervals.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | null | null | null | leetcode/medium/56-Merge_intervals.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | null | null | null | """
Leetcode #56
"""
from typing import List
class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
# to pass few test cases
# we hvae to sort
intervals.sort() # default by 0th index
merged = []
for i in range(len(intervals)):
if... | 25.756757 | 84 | 0.500525 |
0819b21b0e61a5089cb3cd81503ba880ccfdcba6 | 84 | py | Python | utils/__init__.py | XuezheMax/apollo | 7adf28f6af4606e4730e161473b33a9916211c61 | [
"Apache-2.0"
] | 166 | 2020-09-27T06:34:56.000Z | 2022-02-13T07:45:15.000Z | utils/__init__.py | JustCoolPig/apollo | 852991fd769f80689415abee8653c0a5eedbab40 | [
"Apache-2.0"
] | 9 | 2020-10-08T10:59:06.000Z | 2022-01-27T06:32:19.000Z | utils/__init__.py | JustCoolPig/apollo | 852991fd769f80689415abee8653c0a5eedbab40 | [
"Apache-2.0"
] | 15 | 2020-10-11T10:19:35.000Z | 2021-10-04T13:40:40.000Z | __author__ = 'max'
from utils.utils import AverageMeter, accuracy, clip_grad_norm_
| 21 | 63 | 0.809524 |
0819da8e086f4f5da32bd85117f503fb602772d1 | 2,578 | py | Python | python/cuML/test/test_pca.py | just4jc/cuml | bd7824bff0a60634b11c1f036dd41cc7f8c05bc1 | [
"Apache-2.0"
] | 1 | 2019-02-14T05:32:35.000Z | 2019-02-14T05:32:35.000Z | python/cuML/test/test_pca.py | just4jc/cuml | bd7824bff0a60634b11c1f036dd41cc7f8c05bc1 | [
"Apache-2.0"
] | 1 | 2020-02-20T06:08:23.000Z | 2020-02-20T06:08:23.000Z | python/cuML/test/test_pca.py | just4jc/cuml | bd7824bff0a60634b11c1f036dd41cc7f8c05bc1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018, NVIDIA 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 applicable law or agreed to... | 33.921053 | 119 | 0.674942 |
0819ebf6e7eb9ae796df215b52dce5cd7bcc35df | 3,233 | py | Python | Array/array_transformations.py | monocilindro/qgis-earthengine-examples | 82aea8926d34ed3f4ad4a4a345ddbd225819d28f | [
"MIT"
] | 646 | 2019-12-03T06:09:03.000Z | 2022-03-28T03:37:08.000Z | Array/array_transformations.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 10 | 2019-12-30T03:42:44.000Z | 2021-05-22T07:34:07.000Z | Array/array_transformations.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 219 | 2019-12-06T02:20:53.000Z | 2022-03-30T15:14:27.000Z | import ee
from ee_plugin import Map
import math
# This function masks the input with a threshold on the simple cloud score.
def cloudMask(img):
cloudscore = ee.Algorithms.Landsat.simpleCloudScore(img).select('cloud')
return img.updateMask(cloudscore.lt(50))
# cloudMask = function(img) {
# cloudscore = ee.Algo... | 38.951807 | 81 | 0.686359 |
081a088d0a5a80d5d750a1e938d258e3324e796c | 7,454 | py | Python | stdplugins/power_tools.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 1 | 2020-08-02T11:14:29.000Z | 2020-08-02T11:14:29.000Z | stdplugins/power_tools.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 1 | 2021-02-08T20:41:43.000Z | 2021-02-08T20:41:43.000Z | stdplugins/power_tools.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 1 | 2020-05-31T07:19:52.000Z | 2020-05-31T07:19:52.000Z | """Restart or Terminate the bot from any chat
Available Commands:
.restart
.shutdown"""
# This Source Code Form is subject to the terms of the GNU
# General Public License, v.3.0. If a copy of the GPL was not distributed with this
# file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html
from telethon ... | 78.463158 | 837 | 0.27663 |
081a2b425f3f4c41b06719628d803fd2dfaf2e8d | 1,654 | py | Python | Yandex_web_search/Code/loadSQLite.py | charlesjlee/Kaggle | d023365263fb727c9814b2078fb5b675aae208ea | [
"MIT"
] | 10 | 2016-09-29T18:20:52.000Z | 2021-08-20T16:48:00.000Z | Yandex_web_search/Code/loadSQLite.py | charlesjlee/Kaggle | d023365263fb727c9814b2078fb5b675aae208ea | [
"MIT"
] | null | null | null | Yandex_web_search/Code/loadSQLite.py | charlesjlee/Kaggle | d023365263fb727c9814b2078fb5b675aae208ea | [
"MIT"
] | 1 | 2019-10-08T07:33:33.000Z | 2019-10-08T07:33:33.000Z | #%% Initalize generator
import gzip, parse_sessions, sqlite3 as sqlite
#f = gzip.open('../data/test.gz', 'rb')
f = open('../data/test', 'r')
sp = parse_sessions.parse_sessions(f)
#%% Create database
dbconn = sqlite.connect('../Data/testData.sqlite')
dbconn.execute('create table Queries(User, Query)')
dbconn.execute('c... | 39.380952 | 69 | 0.46312 |
081a385eeb974a47bdca227cfdbc4a329f986c91 | 5,899 | py | Python | parlai/messenger/core/message_socket.py | hengyicai/Adaptive_Multi-curricula_Learning_for_Dialog | e2d2c613ac4075ce023d6b4acb0a5eddac4e7837 | [
"MIT"
] | 17 | 2020-03-27T17:25:52.000Z | 2021-11-19T03:46:25.000Z | parlai/messenger/core/message_socket.py | hengyicai/Adaptive_Multi-curricula_Learning_for_Dialog | e2d2c613ac4075ce023d6b4acb0a5eddac4e7837 | [
"MIT"
] | 3 | 2020-11-01T10:12:52.000Z | 2021-12-10T09:06:44.000Z | parlai/messenger/core/message_socket.py | hengyicai/Adaptive_Multi-curricula_Learning_for_Dialog | e2d2c613ac4075ce023d6b4acb0a5eddac4e7837 | [
"MIT"
] | 3 | 2020-05-04T04:37:42.000Z | 2021-07-19T11:09:37.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import errno
import json
import logging
import threading
import time
import websocket
import parlai.mturk.core.shared_ut... | 34.905325 | 79 | 0.537379 |
081a4f1a6fef705a0c804783d9db5c7768d8db29 | 3,350 | py | Python | hypothesisTest/weights_to_bets.py | pavandonthireddy/Project_V4 | 6dea85b6b2ac9b05056b1f8a859361427d642fed | [
"Apache-2.0"
] | null | null | null | hypothesisTest/weights_to_bets.py | pavandonthireddy/Project_V4 | 6dea85b6b2ac9b05056b1f8a859361427d642fed | [
"Apache-2.0"
] | null | null | null | hypothesisTest/weights_to_bets.py | pavandonthireddy/Project_V4 | 6dea85b6b2ac9b05056b1f8a859361427d642fed | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 8 17:15:16 2020
@author: Pavan
"""
import numpy as np
def get_valid_index(strategy_weights,delay=1):
valid_index = ~np.isnan(strategy_weights).all(axis=1)
valid_index[-1*delay]=False
return valid_index
def bets_to_pnl(starting_value,strategy_weights,clean... | 47.183099 | 200 | 0.657313 |
081a5988fdc46727c8b067aeec01f0900d9f3978 | 1,175 | py | Python | river/ensemble/__init__.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 1,105 | 2019-01-24T15:15:30.000Z | 2020-11-10T18:27:00.000Z | river/ensemble/__init__.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 328 | 2019-01-25T13:48:43.000Z | 2020-11-11T11:41:44.000Z | river/ensemble/__init__.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 150 | 2019-01-29T19:05:21.000Z | 2020-11-11T11:50:14.000Z | """Ensemble learning.
Broadly speaking, there are two kinds of ensemble approaches. There are those that copy a single
model several times and aggregate the predictions of said copies. This includes bagging as well as
boosting. Then there are those that are composed of an arbitrary list of models, and can therefore
ag... | 30.128205 | 98 | 0.781277 |
081a70b297d0090928121438673ff35ab7792940 | 1,166 | py | Python | hdltools/vcd/trigger/event.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | 2 | 2020-02-28T13:02:39.000Z | 2021-06-30T09:15:35.000Z | hdltools/vcd/trigger/event.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | 1 | 2020-03-22T17:32:45.000Z | 2020-03-23T15:43:39.000Z | hdltools/vcd/trigger/event.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | null | null | null | """Trigger event."""
from typing import Optional
from hdltools.vcd import VCDObject
from hdltools.vcd.trigger import VCDTriggerDescriptor
class VCDTriggerEvent(VCDObject):
"""VCD trigger event."""
EVENT_TYPES = ("condition", "trigger")
def __init__(
self,
evt_type: str,
time: in... | 24.291667 | 72 | 0.591767 |
081a8d84e947720a000c8439371359a70531e8ad | 2,012 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/input_privacy_key_phone_call.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/input_privacy_key_phone_call.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/input_privacy_key_phone_call.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.4375 | 103 | 0.63668 |
081a8fb3b9185ba92a4d74f2f64a6729387506e9 | 2,342 | py | Python | menu/forms.py | RevolutionTech/seared-quail | ef2b87146850509e2f6f4057344fdc037c8a2808 | [
"0BSD"
] | 1 | 2021-01-28T20:10:36.000Z | 2021-01-28T20:10:36.000Z | menu/forms.py | RevolutionTech/seared-quail | ef2b87146850509e2f6f4057344fdc037c8a2808 | [
"0BSD"
] | 150 | 2016-08-27T21:38:36.000Z | 2021-10-16T23:32:05.000Z | menu/forms.py | RevolutionTech/seared-quail | ef2b87146850509e2f6f4057344fdc037c8a2808 | [
"0BSD"
] | 2 | 2016-08-27T21:35:12.000Z | 2018-01-13T08:11:33.000Z | """
:Created: 6 May 2015
:Author: Lucas Connors
"""
from django import forms
from menu.models import MenuItem
from restaurant.models import Table
class MenuForm(forms.Form):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Create a field for each menu item
for m... | 35.484848 | 105 | 0.572161 |
081ab0d3eed87e2daddb273be1d8532df10c8bc6 | 2,945 | py | Python | code/inner_loop.py | katherinezhu01/TCRP | f6b3a703c24eeb8ad1698162511e506c6df8d76b | [
"MIT"
] | null | null | null | code/inner_loop.py | katherinezhu01/TCRP | f6b3a703c24eeb8ad1698162511e506c6df8d76b | [
"MIT"
] | null | null | null | code/inner_loop.py | katherinezhu01/TCRP | f6b3a703c24eeb8ad1698162511e506c6df8d76b | [
"MIT"
] | null | null | null | import numpy as np
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.autograd import Variable
from layers import *
from score import *
from data_loading import *
from mlp import mlp
class InnerLoop(mlp):
# This module performs the inner loop of MAML
# The forward method updates weig... | 34.647059 | 129 | 0.723939 |
081ac94c4bb33f635a61ef4b9ea922c01015f7a1 | 341 | py | Python | mctweetyface/views.py | jacebrowning/mctweetface | 13299bc93a0563bc1c64d648b381183bd30bf45d | [
"MIT"
] | 1 | 2016-05-17T14:52:51.000Z | 2016-05-17T14:52:51.000Z | mctweetyface/views.py | jacebrowning/mctweetface | 13299bc93a0563bc1c64d648b381183bd30bf45d | [
"MIT"
] | 5 | 2016-05-17T04:22:09.000Z | 2017-05-22T18:19:31.000Z | mctweetyface/views.py | jacebrowning/mctweetface | 13299bc93a0563bc1c64d648b381183bd30bf45d | [
"MIT"
] | 2 | 2016-05-17T05:08:47.000Z | 2017-05-22T19:12:47.000Z | import logging
import bottle
from . import models, utils
app = bottle.app()
log = logging.getLogger(__name__)
@bottle.get("/")
def index():
"""Return a name."""
word = bottle.request.query.get('name')
name = models.get_name(word)
utils.tweet(name, token=bottle.request.headers.get('Authorization... | 14.826087 | 72 | 0.671554 |
081acc5093146a1fafcac63f2b1fced5ab925173 | 5,423 | py | Python | plastering/helper/ucb.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | null | null | null | plastering/helper/ucb.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | null | null | null | plastering/helper/ucb.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | null | null | null | import pdb
import json
from functools import reduce
import re
from ..metadata_interface import *
from ..common import *
with open('../../groundtruth/ucb_brick_map.json', 'r') as fp:
brick_map = json.load(fp)
def brickify_arka_data():
buildings = ['SDH', 'SODA']
for building in buildings:
filename... | 36.891156 | 79 | 0.521114 |
081ad6393371a2b46f291cf6022ac8c5365e1026 | 30 | py | Python | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/Main/EventPanel/MainMenuEventPanel/main_menu_event_panel.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/Main/EventPanel/MainMenuEventPanel/main_menu_event_panel.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/Main/EventPanel/MainMenuEventPanel/main_menu_event_panel.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class MainMenuEventPanel: pass | 30 | 30 | 0.9 |
081afc2c4d36573fb283a81c1d7f5232b599255f | 18,101 | py | Python | moto/dynamodb2/responses.py | argos83/moto | d3df810065c9c453d40fcc971f9be6b7b2846061 | [
"Apache-2.0"
] | 1 | 2021-03-06T22:01:41.000Z | 2021-03-06T22:01:41.000Z | moto/dynamodb2/responses.py | marciogh/moto | d3df810065c9c453d40fcc971f9be6b7b2846061 | [
"Apache-2.0"
] | null | null | null | moto/dynamodb2/responses.py | marciogh/moto | d3df810065c9c453d40fcc971f9be6b7b2846061 | [
"Apache-2.0"
] | 1 | 2017-10-19T00:53:28.000Z | 2017-10-19T00:53:28.000Z | from __future__ import unicode_literals
import json
import six
import re
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from .models import dynamodb_backend2, dynamo_json_dump
GET_SESSION_TOKEN_RESULT = """
<GetSessionTokenResponse xmlns="https://sts.amazonaws.com/d... | 41.516055 | 163 | 0.596265 |
081b0638b054f6fd70098d44c3c4fc56a051fcaf | 2,648 | py | Python | somaticseq/utilities/dockered_pipelines/alignments/spreadFastq.py | bioinform/somaticseq | 71f058dcdfea78ec056aa46f96a40cc737cc559f | [
"BSD-2-Clause"
] | 159 | 2015-07-26T15:14:44.000Z | 2022-03-31T03:29:25.000Z | somaticseq/utilities/dockered_pipelines/alignments/spreadFastq.py | lethalfang/somaticseq | e6f5b1c6b98b324d418407154392778164215a65 | [
"BSD-2-Clause"
] | 77 | 2016-06-12T21:44:43.000Z | 2022-03-31T19:33:49.000Z | somaticseq/utilities/dockered_pipelines/alignments/spreadFastq.py | lethalfang/somaticseq | e6f5b1c6b98b324d418407154392778164215a65 | [
"BSD-2-Clause"
] | 64 | 2015-10-26T01:34:32.000Z | 2022-03-14T14:43:08.000Z | import os, re
import subprocess
from datetime import datetime
import somaticseq.utilities.dockered_pipelines.container_option as container
import somaticseq.genomicFileHandler.concat as concat
from somaticseq._version import __version__ as VERSION
ts = re.sub(r'[:-]', '.', datetime.now().isoformat(sep='.', timespec='m... | 42.031746 | 175 | 0.594033 |
081b277ef63e609e761742f89b329756f8c6e389 | 19,372 | py | Python | Sklearn_scipy_numpy/source/sklearn/datasets/lfw.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 4 | 2018-01-21T21:18:35.000Z | 2022-03-23T21:57:56.000Z | Sklearn_scipy_numpy/source/sklearn/datasets/lfw.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | Sklearn_scipy_numpy/source/sklearn/datasets/lfw.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | 37.835938 | 87 | 0.671794 |
081b3335e7af16bf6a1565182339f28db525e664 | 40,674 | py | Python | tests/jstests/15_atomicswap_refund.py | xmonader/pytfchain | ef28238eeaedda1dd5ea8055ea6dc2ca6baa263c | [
"Apache-2.0"
] | null | null | null | tests/jstests/15_atomicswap_refund.py | xmonader/pytfchain | ef28238eeaedda1dd5ea8055ea6dc2ca6baa263c | [
"Apache-2.0"
] | null | null | null | tests/jstests/15_atomicswap_refund.py | xmonader/pytfchain | ef28238eeaedda1dd5ea8055ea6dc2ca6baa263c | [
"Apache-2.0"
] | null | null | null | from Jumpscale import j
import pytest
from Jumpscale.clients.blockchain.tfchain.stub.ExplorerClientStub import TFChainExplorerGetClientStub
def main(self):
"""
to run:
js_shell 'j.clients.tfchain.test(name="atomicswap_refund")'
"""
# create a tfchain client for devnet
c = j.clients.tfch... | 572.873239 | 9,567 | 0.8427 |
081b8416e20de2af3b4270c07e5672e19e12bab2 | 33,978 | py | Python | genienlp/util.py | saligrama/genienlp | 35659911883c43fdbe38c4391e75ca106763eb40 | [
"BSD-3-Clause"
] | null | null | null | genienlp/util.py | saligrama/genienlp | 35659911883c43fdbe38c4391e75ca106763eb40 | [
"BSD-3-Clause"
] | null | null | null | genienlp/util.py | saligrama/genienlp | 35659911883c43fdbe38c4391e75ca106763eb40 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) 2018, Salesforce, Inc.
# The Board of Trustees of the Leland Stanford Junior University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions ... | 37.379538 | 161 | 0.59721 |
081bcbb29ce8c07812fef3a35bd5fa8f09085c06 | 381 | py | Python | leetcode/412-fizz-buzz.py | AmrMKayid/KayAlgo | df6e2b5b0f74174d5c0950520f0c47b04212dfaa | [
"MIT"
] | 1 | 2019-02-11T13:29:32.000Z | 2019-02-11T13:29:32.000Z | leetcode/412-fizz-buzz.py | AmrMKayid/KayAlgo | df6e2b5b0f74174d5c0950520f0c47b04212dfaa | [
"MIT"
] | 1 | 2019-02-11T15:26:36.000Z | 2019-02-11T15:26:36.000Z | leetcode/412-fizz-buzz.py | AmrMKayid/KayAlgo | df6e2b5b0f74174d5c0950520f0c47b04212dfaa | [
"MIT"
] | null | null | null | class Solution(object):
def fizzBuzz(self, n):
"""
:type n: int
:rtype: List[str]
"""
out = []
for i in range(1, n + 1):
if i % 3 == 0 and i % 5 == 0:
out.append('FizzBuzz')
elif i % 5 == 0:
out.append('Buzz')
elif i % 3 == 0:
out.append('... | 20.052632 | 35 | 0.435696 |
081befd56a3797f35cac05ed5cff4a8dd314cdc5 | 5,448 | py | Python | tests/test_cancel.py | jmptbl/puka | bc6e845c8a5f4319ffc54cc71959c56a8893edaf | [
"MIT"
] | 81 | 2015-01-22T10:09:37.000Z | 2022-01-25T04:38:29.000Z | tests/test_cancel.py | jmptbl/puka | bc6e845c8a5f4319ffc54cc71959c56a8893edaf | [
"MIT"
] | 17 | 2015-05-13T01:51:53.000Z | 2021-03-05T04:01:39.000Z | tests/test_cancel.py | jmptbl/puka | bc6e845c8a5f4319ffc54cc71959c56a8893edaf | [
"MIT"
] | 25 | 2015-02-12T14:02:41.000Z | 2020-05-15T14:08:43.000Z | from __future__ import with_statement
from builtins import range
import os
import puka
import base
class TestCancel(base.TestCase):
@base.connect
def test_cancel_single(self, client):
promise = client.queue_declare(queue=self.name)
client.wait(promise)
self.cleanup_promise(client.qu... | 34.700637 | 81 | 0.606461 |
081bfd43ab5ee33244706a438c518d163e73aaf5 | 3,975 | py | Python | tests/test_log_help.py | deisthree/wal-e | c6cee1f706f629257f7e7fbd75102e5de51827c6 | [
"BSD-3-Clause"
] | null | null | null | tests/test_log_help.py | deisthree/wal-e | c6cee1f706f629257f7e7fbd75102e5de51827c6 | [
"BSD-3-Clause"
] | null | null | null | tests/test_log_help.py | deisthree/wal-e | c6cee1f706f629257f7e7fbd75102e5de51827c6 | [
"BSD-3-Clause"
] | null | null | null | import os
import re
from logging import handlers
from wal_e import log_help
def sanitize_log(log):
return re.sub(r'time=[0-9T:\-\.]+ pid=\d+',
'time=2012-01-01T00.1234-00 pid=1234',
log)
def test_nonexisting_socket(tmpdir, monkeypatch):
# Must not raise an exception, sil... | 32.581967 | 76 | 0.71195 |
081c01331959442ddb9975bd1c2b2f027c45faa3 | 21,959 | py | Python | yt/frontends/gadget/data_structures.py | philchang/yt | 5fae744569cd0719db61838c0fd2b20fe29c7184 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/frontends/gadget/data_structures.py | philchang/yt | 5fae744569cd0719db61838c0fd2b20fe29c7184 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/frontends/gadget/data_structures.py | philchang/yt | 5fae744569cd0719db61838c0fd2b20fe29c7184 | [
"BSD-3-Clause-Clear"
] | null | null | null | """
Data structures for Gadget frontend
"""
from __future__ import print_function
#-----------------------------------------------------------------------------
# Copyright (c) 2014, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, d... | 39.637184 | 106 | 0.599344 |
081c09061bbc2956a89796736388043b26de4e64 | 3,394 | py | Python | createDataset.py | carsault/ace_pytorch | fbed64990001afdafe44ef7b0d5567f94c81a3c3 | [
"MIT"
] | null | null | null | createDataset.py | carsault/ace_pytorch | fbed64990001afdafe44ef7b0d5567f94c81a3c3 | [
"MIT"
] | null | null | null | createDataset.py | carsault/ace_pytorch | fbed64990001afdafe44ef7b0d5567f94c81a3c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 27 15:31:58 2019
@author: carsault
"""
#%%
import argparse
import os
import numpy as np
import torch
import torch.utils.data as data_utils
from torch.utils.data.dataset import *
from torch.utils import data
import pickle
from sklearn.model_selection... | 34.989691 | 140 | 0.728933 |
081c442415357dd5c75115f905b8b123dbb797eb | 5,484 | py | Python | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 40.029197 | 133 | 0.663749 |
081c44a02df081da314cf3a4bb619f20fc02910d | 1,009 | py | Python | toontown/shtiker/NPCFriendPage.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/shtiker/NPCFriendPage.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/shtiker/NPCFriendPage.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from toontown.shtiker import ShtikerPage
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from toontown.toon import NPCFriendPanel
from toontown.toonbase import TTLocalizer
class NPCFriendPage(ShtikerPage.ShtikerPage):
def __init__(self):
ShtikerPage.ShtikerPage.__init__(self)
def... | 32.548387 | 146 | 0.718533 |
081c541c7eb2e8ba888b248c34b532e8810d2727 | 3,000 | py | Python | tests/grab_request.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 2,266 | 2015-01-01T08:47:33.000Z | 2022-03-21T05:02:55.000Z | tests/grab_request.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 221 | 2015-01-13T01:55:57.000Z | 2022-02-25T23:23:35.000Z | tests/grab_request.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 315 | 2015-01-23T06:38:55.000Z | 2022-03-27T08:33:33.000Z | # coding: utf-8
from grab.error import (GrabInternalError, GrabCouldNotResolveHostError,
GrabTimeoutError, GrabInvalidUrl)
from tests.util import build_grab, exclude_grab_transport
from tests.util import BaseGrabTestCase
class GrabRequestTestCase(BaseGrabTestCase):
def setUp(self):
... | 36.144578 | 79 | 0.602 |
081c562d01c7c133753bfcd1519a5060af1d083f | 2,667 | py | Python | teafacto/scripts/rescal.py | lukovnikov/teafacto | 5e863df8d061106ad705c0837f2d2ca4e08db0e4 | [
"MIT"
] | 2 | 2016-06-28T23:41:42.000Z | 2017-01-14T12:41:36.000Z | teafacto/scripts/rescal.py | lukovnikov/teafacto | 5e863df8d061106ad705c0837f2d2ca4e08db0e4 | [
"MIT"
] | 1 | 2016-04-20T20:09:20.000Z | 2016-08-17T19:02:47.000Z | teafacto/scripts/rescal.py | lukovnikov/teafacto | 5e863df8d061106ad705c0837f2d2ca4e08db0e4 | [
"MIT"
] | 5 | 2016-07-18T17:05:18.000Z | 2018-10-13T05:40:05.000Z | from teafacto.core.base import Block, param, tensorops as T
from teafacto.blocks.basic import VectorEmbed
from teafacto.blocks.match import MatchScore, EuclideanDistance, DotDistance
from teafacto.util import argprun, ticktock
import numpy as np
import pickle
from IPython import embed
class Rescal(Block):
def __i... | 29.966292 | 91 | 0.604049 |
081c5cc0c6745eead9544bda7a6f246c4c4809bc | 98,267 | py | Python | nova/tests/unit/virt/vmwareapi/test_vm_util.py | mariusleu/nova | b19e37cbfddfce0839dbeeb0d556ed1ffae664ad | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/vmwareapi/test_vm_util.py | mariusleu/nova | b19e37cbfddfce0839dbeeb0d556ed1ffae664ad | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/vmwareapi/test_vm_util.py | mariusleu/nova | b19e37cbfddfce0839dbeeb0d556ed1ffae664ad | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Canonical Corp.
# 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
#
# htt... | 45.388915 | 79 | 0.615893 |
081c785c802f078b698db99548f84c53f4c0f11a | 20,070 | py | Python | test/test_client_sync.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | test/test_client_sync.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | 1 | 2020-10-29T12:01:38.000Z | 2022-03-21T02:39:59.000Z | test/test_client_sync.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import unittest
from itertools import count
from io import StringIO
from unittest.mock import patch, Mock, MagicMock
import socket
import serial
import ssl
import sys
import pytest
from pymodbus.client.sync import ModbusTcpClient, ModbusUdpClient
from pymodbus.client.sync import ModbusSerialCl... | 37.304833 | 91 | 0.600797 |
081c7e0618ce0e3793bb049c870644586a914e52 | 19,351 | py | Python | febio_python/feb/FEBio_xml_handler.py | Nobregaigor/febio-python | 6895b4e2f8959444a66b6f77a000ce193c3357a7 | [
"MIT"
] | null | null | null | febio_python/feb/FEBio_xml_handler.py | Nobregaigor/febio-python | 6895b4e2f8959444a66b6f77a000ce193c3357a7 | [
"MIT"
] | null | null | null | febio_python/feb/FEBio_xml_handler.py | Nobregaigor/febio-python | 6895b4e2f8959444a66b6f77a000ce193c3357a7 | [
"MIT"
] | null | null | null | from tkinter import E
import xml.etree.ElementTree as ET
from os.path import isfile, join
# from .. logger import console_log as log
from .enums import *
from pathlib import Path
import numpy as np
from febio_python.utils.enum_utils import *
class FEBio_xml_handler():
def __init__(self, tree, root=None, filepath=... | 38.935614 | 114 | 0.552116 |
081c833accd844b7b1c195973c1d9bb7490b6ec6 | 6,111 | py | Python | bayes_vae/examples/mnist_bayes_nn.py | zhoudoao/bayes_vae | 8e7477dc1369a9ba17086a9c6982d7cd83f7e94b | [
"Apache-2.0"
] | 1 | 2019-07-03T00:49:34.000Z | 2019-07-03T00:49:34.000Z | bayes_vae/examples/mnist_bayes_nn.py | zhoudoao/bayes_vae | 8e7477dc1369a9ba17086a9c6982d7cd83f7e94b | [
"Apache-2.0"
] | null | null | null | bayes_vae/examples/mnist_bayes_nn.py | zhoudoao/bayes_vae | 8e7477dc1369a9ba17086a9c6982d7cd83f7e94b | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, zhoudoao@gmail.com.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | 29.239234 | 80 | 0.688267 |
081cc253371ddc934b711b63794235f4efa4e96a | 4,389 | py | Python | acl_version/src/reflection_based_transfer/evals.py | ahclab/reflection | d09fd500e9ff74211e1eb15711d479bb204c7a83 | [
"MIT"
] | 4 | 2020-07-14T10:36:30.000Z | 2021-04-22T04:20:42.000Z | acl_version/src/reflection_based_transfer/evals.py | ahclab/reflection | d09fd500e9ff74211e1eb15711d479bb204c7a83 | [
"MIT"
] | null | null | null | acl_version/src/reflection_based_transfer/evals.py | ahclab/reflection | d09fd500e9ff74211e1eb15711d479bb204c7a83 | [
"MIT"
] | 2 | 2021-02-25T09:19:13.000Z | 2021-08-18T09:16:29.000Z | import numpy
import chainer
from chainer import Variable
from tqdm import tqdm
from statistics import mean
import random
import data_loader
import copy
import json
def evaluation1_acc(xs, ts, zs, net, word2vec, n_top, dtype):
results = get_accuracy(xs, ts, zs, net, word2vec, n_top, show=False) # n_top = [1,2,3]
... | 31.804348 | 108 | 0.587605 |
081d0ad20835ee52dbd97e33138bce626054ab3a | 1,573 | py | Python | geopandas/io/tests/test_pickle.py | nickhand/geopandas | 9fdeb1474185c8d2edaede428f57d258810d87b7 | [
"BSD-3-Clause"
] | 1 | 2020-07-03T06:49:35.000Z | 2020-07-03T06:49:35.000Z | geopandas/io/tests/test_pickle.py | nickhand/geopandas | 9fdeb1474185c8d2edaede428f57d258810d87b7 | [
"BSD-3-Clause"
] | null | null | null | geopandas/io/tests/test_pickle.py | nickhand/geopandas | 9fdeb1474185c8d2edaede428f57d258810d87b7 | [
"BSD-3-Clause"
] | null | null | null | """
See generate_legacy_storage_files.py for the creation of the legacy files.
"""
from distutils.version import LooseVersion
import glob
import os
import pathlib
import pandas as pd
import pyproj
import pytest
from geopandas.testing import assert_geodataframe_equal
from geopandas import _compat as compat
DATA_PA... | 25.786885 | 81 | 0.732359 |
081d2917f067c54bf218bef6b91ee7e667b58aba | 5,560 | py | Python | tools/filters/ucsc_gene_bed_to_exon_bed.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | tools/filters/ucsc_gene_bed_to_exon_bed.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 1 | 2019-02-04T16:21:27.000Z | 2019-02-04T16:45:17.000Z | tools/filters/ucsc_gene_bed_to_exon_bed.py | chambm/galaxy | fd1926767996a161cd2fc8bd184e6835fd688765 | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | #!/usr/bin/env python
"""
Read a table dump in the UCSC gene table format and print a tab separated
list of intervals corresponding to requested features of each gene.
usage: ucsc_gene_table_to_intervals.py [options]
options:
-h, --help show this help message and exit
-rREGION, --region=REGION
... | 39.714286 | 116 | 0.516007 |
081d3503cb9c58d76efa561d1025c61870d45e35 | 18,489 | py | Python | yt/data_objects/level_sets/clump_handling.py | philchang/yt | 5fae744569cd0719db61838c0fd2b20fe29c7184 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/data_objects/level_sets/clump_handling.py | philchang/yt | 5fae744569cd0719db61838c0fd2b20fe29c7184 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/data_objects/level_sets/clump_handling.py | philchang/yt | 5fae744569cd0719db61838c0fd2b20fe29c7184 | [
"BSD-3-Clause-Clear"
] | null | null | null | """
Clump finding helper classes
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#--------------... | 37.579268 | 85 | 0.548596 |
081d58fa863c8fa8e89a3ed10ce734d59b01dec8 | 13,592 | py | Python | pyramid/extract2dzi_rgb.py | toringerhartCAMM/czi2tiff | d341a92d4949bbe021ad4de4c816294faf4e8a93 | [
"Apache-2.0"
] | 3 | 2016-02-07T19:26:32.000Z | 2017-07-11T22:42:10.000Z | pyramid/extract2dzi_rgb.py | toringerhartCAMM/czi2tiff | d341a92d4949bbe021ad4de4c816294faf4e8a93 | [
"Apache-2.0"
] | 36 | 2015-09-04T22:56:31.000Z | 2019-02-13T01:44:32.000Z | pyramid/extract2dzi_rgb.py | toringerhartCAMM/czi2tiff | d341a92d4949bbe021ad4de4c816294faf4e8a93 | [
"Apache-2.0"
] | 1 | 2018-08-09T06:52:04.000Z | 2018-08-09T06:52:04.000Z | #!/usr/bin/env python
import sys
import os
import re
import numpy
from PIL import Image
import StringIO
# you need to install this library yourself
# recent versions handle bigtiff too...
import tifffile
"""
Extract pyramidal TIFF files with JPEG tiled storage into a tree of
separate JPEG files into DZI compliant di... | 31.609302 | 142 | 0.612861 |
081d92c9afa6a3f184ab4598af733a24de552cc4 | 2,218 | py | Python | workalendar/asia/singapore.py | vanadium23/workalendar | 4c67b5a7900fa56d7a93b767c6cbd8f1cc6b70a7 | [
"MIT"
] | null | null | null | workalendar/asia/singapore.py | vanadium23/workalendar | 4c67b5a7900fa56d7a93b767c6cbd8f1cc6b70a7 | [
"MIT"
] | null | null | null | workalendar/asia/singapore.py | vanadium23/workalendar | 4c67b5a7900fa56d7a93b767c6cbd8f1cc6b70a7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import date
from workalendar.core import ChineseNewYearCalendar, WesternCalendar
from workalendar.core import (
ChristianMixin, IslamicMixin
)
class Singapore(WesternCalendar,
ChineseNewYearCalendar, ChristianMixin, IslamicMixin):
"Singapore"
include_... | 31.685714 | 76 | 0.603697 |
081d96f33f843106c670ddd15cc9f0c1661905b7 | 7,319 | py | Python | python3/base/game.py | LetMeR00t/SA4BG | 260046db25e68651600bef1d53efabc1e1461d16 | [
"Apache-2.0"
] | null | null | null | python3/base/game.py | LetMeR00t/SA4BG | 260046db25e68651600bef1d53efabc1e1461d16 | [
"Apache-2.0"
] | null | null | null | python3/base/game.py | LetMeR00t/SA4BG | 260046db25e68651600bef1d53efabc1e1461d16 | [
"Apache-2.0"
] | null | null | null | ## IMPORTS ##
from abc import ABCMeta, abstractmethod
from base.equipments import Equipments
from base.wincondition import WinCondition
from base.player import Player
from base.history import History
## CLASS ##
class Game(metaclass=ABCMeta):
"""
Define a Game class
"""
def __init__(self, name="Unamed", equi... | 22.800623 | 110 | 0.629048 |
081dbd09d777c5e5d348183d378d0f6028379774 | 3,047 | py | Python | quizzer/loader.py | debrando/pyquiz | 0450eddeb72923ba67f67b19cf5dd43e653c4d67 | [
"MIT"
] | null | null | null | quizzer/loader.py | debrando/pyquiz | 0450eddeb72923ba67f67b19cf5dd43e653c4d67 | [
"MIT"
] | null | null | null | quizzer/loader.py | debrando/pyquiz | 0450eddeb72923ba67f67b19cf5dd43e653c4d67 | [
"MIT"
] | null | null | null | """Loader of quizzes"""
from typing import List, Generator
import copy
import yaml
import hashlib
def repeatable_random(seed: int, unique=True):
"""Repeatable random sequence
from: https://stackoverflow.com/a/18992474/2004580
"""
produced = set()
mdseed = bytes(range(seed, seed+64))
while True... | 31.412371 | 90 | 0.603216 |
081dd84ef526908a36f40cb30f515e8ab2974045 | 5,366 | py | Python | test/integration/ggrc_workflows/models/test_cycle_task_group_object_task.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc_workflows/models/test_cycle_task_group_object_task.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc_workflows/models/test_cycle_task_group_object_task.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Module for integration tests for CycleTaskGroupObjectTask specifics."""
import ddt
from ggrc import db
from ggrc.models import all_models
from integration.ggrc import TestCase as BaseTestCase
from inte... | 38.884058 | 79 | 0.682072 |
081dee995d3e8752e938dd2a4b1eaadbe6714589 | 15,761 | py | Python | oscar/apps/partner/abstract_models.py | makielab/django-oscar | 0a325cd0f04a4278201872b2e163868b72b6fabe | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/partner/abstract_models.py | makielab/django-oscar | 0a325cd0f04a4278201872b2e163868b72b6fabe | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/partner/abstract_models.py | makielab/django-oscar | 0a325cd0f04a4278201872b2e163868b72b6fabe | [
"BSD-3-Clause"
] | null | null | null | from decimal import Decimal as D
import warnings
from django.db import models
from django.conf import settings
from django.db.models import get_model
from django.utils.translation import ugettext_lazy as _
from django.utils.importlib import import_module as django_import_module
from oscar.core.compat import AUTH_USER_... | 37.887019 | 119 | 0.656304 |
081e12e35f73e039ce96ced0c340d66135b7bde6 | 2,258 | py | Python | dpkt/vrrp.py | vinjn/net-doctor | 02c6271c13593a21becba760db23b1c0ca34158c | [
"MIT"
] | 1 | 2017-08-13T13:20:11.000Z | 2017-08-13T13:20:11.000Z | dpkt/vrrp.py | vinjn/net-doctor | 02c6271c13593a21becba760db23b1c0ca34158c | [
"MIT"
] | null | null | null | dpkt/vrrp.py | vinjn/net-doctor | 02c6271c13593a21becba760db23b1c0ca34158c | [
"MIT"
] | null | null | null | # $Id: vrrp.py 88 2013-03-05 19:43:17Z andrewflnr@gmail.com $
# -*- coding: utf-8 -*-
"""Virtual Router Redundancy Protocol."""
from __future__ import print_function
from __future__ import absolute_import
from . import dpkt
class VRRP(dpkt.Packet):
"""Virtual Router Redundancy Protocol.
TODO: Longer class i... | 23.278351 | 91 | 0.538087 |
081e33b9dca6d79a055f4bca97296cda484b6737 | 42,996 | py | Python | sirepo/template/webcon.py | yeeon/sirepo | 081595df256d40fbc7959614689d64ad2bc745d4 | [
"Apache-2.0"
] | 1 | 2019-06-06T08:08:11.000Z | 2019-06-06T08:08:11.000Z | sirepo/template/webcon.py | yeeon/sirepo | 081595df256d40fbc7959614689d64ad2bc745d4 | [
"Apache-2.0"
] | null | null | null | sirepo/template/webcon.py | yeeon/sirepo | 081595df256d40fbc7959614689d64ad2bc745d4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
u"""Webcon execution template.
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkcollections
from pykern import pkio
from pykern ... | 33.124807 | 148 | 0.569448 |
081e4bf7ec220c6628120f1eaa7a917d77659129 | 659 | py | Python | util/plot.py | shadowgamefly/osf_analysis | e5f22b01220016d7058e76e411a79aff1e912f08 | [
"MIT"
] | null | null | null | util/plot.py | shadowgamefly/osf_analysis | e5f22b01220016d7058e76e411a79aff1e912f08 | [
"MIT"
] | 1 | 2017-10-31T18:33:31.000Z | 2017-10-31T18:33:31.000Z | util/plot.py | shadowgamefly/osf_analysis | e5f22b01220016d7058e76e411a79aff1e912f08 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
def plot(data):
if 'key' not in data:
raise KeyError("x-axis label needs to be named as key in the data dict.")
key = data['key']
fig, ax1 = plt.subplots()
ax1.set_xlabel('Threshold of possibility to categorize')
ax1.set_ylabel('Percentage in total population... | 27.458333 | 81 | 0.599393 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.