hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c6329045412e41f2f17e5a9133e88f0e2022bda2 | 29,067 | py | Python | shenfun/jacobi/bases.py | spectralDNS/shenfun | 956633aa0f1638db5ebdc497ff68a438aa22b932 | [
"BSD-2-Clause"
] | 138 | 2017-06-17T13:30:27.000Z | 2022-03-20T02:33:47.000Z | shenfun/jacobi/bases.py | spectralDNS/shenfun | 956633aa0f1638db5ebdc497ff68a438aa22b932 | [
"BSD-2-Clause"
] | 73 | 2017-05-16T06:53:04.000Z | 2022-02-04T10:40:44.000Z | shenfun/jacobi/bases.py | spectralDNS/shenfun | 956633aa0f1638db5ebdc497ff68a438aa22b932 | [
"BSD-2-Clause"
] | 38 | 2018-01-31T14:37:01.000Z | 2022-03-31T15:07:27.000Z | """
Module for function spaces of generalized Jacobi type
Note the configuration setting
from shenfun.config import config
config['bases']['jacobi']['mode']
Setting this to 'mpmath' can make use of extended precision.
The precision can also be set in the configuration.
from mpmath import mp
mp.dps =... | 38.756 | 124 | 0.593491 |
4400e4440740d531181034ce0ec825c4151d52f1 | 2,304 | py | Python | tools/update_cli_readme_documentation.py | howardjohn/nighthawk | dafeb17e4a191eaff396cd54873d46d78c69d7c4 | [
"Apache-2.0"
] | null | null | null | tools/update_cli_readme_documentation.py | howardjohn/nighthawk | dafeb17e4a191eaff396cd54873d46d78c69d7c4 | [
"Apache-2.0"
] | null | null | null | tools/update_cli_readme_documentation.py | howardjohn/nighthawk | dafeb17e4a191eaff396cd54873d46d78c69d7c4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Tool to automatically update README.md files that contain --help output of c++ TCLAP binaries
import logging
import argparse
import os
import pathlib
import re
import sys
import subprocess
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Tool to update README.md CLI... | 36.571429 | 95 | 0.667101 |
f4ad55897db3f07236ea6c8a505eb68352dc3ad8 | 1,101 | py | Python | scripts/prisecon_prototype.py | glieb/dilemma | f61d564314f3f5494da19fb4212d9dd04d77b284 | [
"MIT"
] | null | null | null | scripts/prisecon_prototype.py | glieb/dilemma | f61d564314f3f5494da19fb4212d9dd04d77b284 | [
"MIT"
] | null | null | null | scripts/prisecon_prototype.py | glieb/dilemma | f61d564314f3f5494da19fb4212d9dd04d77b284 | [
"MIT"
] | null | null | null | import pickle
import sys
sys.path.append("../dilemma")
from biases import bias_dict
def save_prototype(biases, filename):
open(filename, "w+") # creates the file
with open(filename, "wb") as prototype:
pickle.dump(biases, prototype)
def load_prototype(file):
with open(file, "rb") a... | 26.214286 | 70 | 0.621253 |
c3b6e95ec4810f8754247281ab6a5842c1902d02 | 4,236 | py | Python | benchmark/startQiskit1350.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1350.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1350.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=52
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 31.849624 | 82 | 0.614023 |
176307982b4e78c64531286b754de3308cdd7243 | 6,751 | py | Python | lib/base_wizard.py | Andymeows/electrum-doge | e5e8c8e3e301cccb53de58445445e9e7fd0e9665 | [
"MIT"
] | 1 | 2017-02-21T17:52:54.000Z | 2017-02-21T17:52:54.000Z | lib/base_wizard.py | Andymeows/electrum-doge | e5e8c8e3e301cccb53de58445445e9e7fd0e9665 | [
"MIT"
] | null | null | null | lib/base_wizard.py | Andymeows/electrum-doge | e5e8c8e3e301cccb53de58445445e9e7fd0e9665 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2016 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... | 40.184524 | 151 | 0.653088 |
070fb86171845062c7fc24a28acd90660006212e | 521 | py | Python | ufdl-core-app/src/ufdl/core_app/models/mixins/_UserRestrictedQuerySet.py | waikato-ufdl/ufdl-backend | 776fc906c61eba6c2f2e6324758e7b8a323e30d7 | [
"Apache-2.0"
] | null | null | null | ufdl-core-app/src/ufdl/core_app/models/mixins/_UserRestrictedQuerySet.py | waikato-ufdl/ufdl-backend | 776fc906c61eba6c2f2e6324758e7b8a323e30d7 | [
"Apache-2.0"
] | 85 | 2020-07-24T00:04:28.000Z | 2022-02-10T10:35:15.000Z | ufdl-core-app/src/ufdl/core_app/models/mixins/_UserRestrictedQuerySet.py | waikato-ufdl/ufdl-backend | 776fc906c61eba6c2f2e6324758e7b8a323e30d7 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class UserRestrictedQuerySet(models.QuerySet):
"""
Query-set base class for models which apply per-instance permissions
based on the user accessing them.
"""
def for_user(self, user):
"""
Filters the query-set to those instances that the
given u... | 28.944444 | 79 | 0.658349 |
820a22153af701f5f54838c193be496175c25346 | 5,761 | py | Python | mne/channels/tests/test_interpolation.py | dokato/mne-python | a188859b57044fa158af05852bcce2870fabde91 | [
"BSD-3-Clause"
] | null | null | null | mne/channels/tests/test_interpolation.py | dokato/mne-python | a188859b57044fa158af05852bcce2870fabde91 | [
"BSD-3-Clause"
] | null | null | null | mne/channels/tests/test_interpolation.py | dokato/mne-python | a188859b57044fa158af05852bcce2870fabde91 | [
"BSD-3-Clause"
] | 1 | 2021-04-12T12:45:31.000Z | 2021-04-12T12:45:31.000Z | import os.path as op
import warnings
import numpy as np
from numpy.testing import (assert_allclose, assert_array_equal)
import pytest
from nose.tools import assert_raises, assert_equal, assert_true
from mne import io, pick_types, pick_channels, read_events, Epochs
from mne.channels.interpolation import _make_interpol... | 38.66443 | 79 | 0.676619 |
6ec772cc792badf7234d4904d0df1060a1ed45e1 | 856 | py | Python | analysis/plot_provide_latencies.py | dennis-tra/optimistic-provide | 6211073e56fafb8e8f141a49b3b914c48d67d964 | [
"Apache-2.0"
] | 1 | 2021-11-15T12:37:20.000Z | 2021-11-15T12:37:20.000Z | analysis/plot_provide_latencies.py | dennis-tra/optimistic-provide | 6211073e56fafb8e8f141a49b3b914c48d67d964 | [
"Apache-2.0"
] | null | null | null | analysis/plot_provide_latencies.py | dennis-tra/optimistic-provide | 6211073e56fafb8e8f141a49b3b914c48d67d964 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import seaborn as sns
from model_loader import ModelLoader
import matplotlib.pyplot as plt
def plot():
sns.set_theme()
provide_latencies = [m.provider.duration.total_seconds() for m in ModelLoader.open("../data")]
fig, ax = plt.subplots(figsize=(15, 6))
p50 = "%.2f" % np.percent... | 26.75 | 135 | 0.672897 |
9367066d25f7568f63c47c8fa0df5faccbfd974a | 8,712 | py | Python | orchestrator_object.py | UWB-C4D/droneport_traffic_control | a57169e092a5b2a8303bc039f28d0b1c7460a0ef | [
"BSD-3-Clause"
] | null | null | null | orchestrator_object.py | UWB-C4D/droneport_traffic_control | a57169e092a5b2a8303bc039f28d0b1c7460a0ef | [
"BSD-3-Clause"
] | null | null | null | orchestrator_object.py | UWB-C4D/droneport_traffic_control | a57169e092a5b2a8303bc039f28d0b1c7460a0ef | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
class Battery(object):
"""Battery representation in DronePort system.
It can be placed in DronePort charging/storage station or drone.
Input:
id: Battery id number
max_cap: maximum capacity of battery
current_cap: current capacity of battery
"""
def __i... | 34.987952 | 140 | 0.613292 |
be192229bbc68180976a518419ad726550e6fb74 | 6,913 | py | Python | minihack/agent/common/models/embed.py | samvelyan/minihack-1 | 441eba33ba0d240b98aeabe1ff7a0c0b33cd236c | [
"Apache-2.0"
] | 217 | 2021-09-28T01:40:39.000Z | 2022-03-22T15:12:23.000Z | minihack/agent/common/models/embed.py | samvelyan/minihack-1 | 441eba33ba0d240b98aeabe1ff7a0c0b33cd236c | [
"Apache-2.0"
] | 10 | 2021-10-01T14:10:47.000Z | 2022-02-28T15:37:08.000Z | minihack/agent/common/models/embed.py | samvelyan/minihack-1 | 441eba33ba0d240b98aeabe1ff7a0c0b33cd236c | [
"Apache-2.0"
] | 24 | 2021-09-28T06:43:34.000Z | 2022-03-24T06:13:43.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... | 34.738693 | 82 | 0.623318 |
15f0123bc12372a4b42e7ac32923581c33b93a47 | 3,930 | py | Python | kuryr/tests/unit/segmentation_type_drivers/test_vlan.py | mail2nsrajesh/kuryr | df421a9b2e743f00ac27c030e5094f784f72599a | [
"Apache-2.0"
] | null | null | null | kuryr/tests/unit/segmentation_type_drivers/test_vlan.py | mail2nsrajesh/kuryr | df421a9b2e743f00ac27c030e5094f784f72599a | [
"Apache-2.0"
] | null | null | null | kuryr/tests/unit/segmentation_type_drivers/test_vlan.py | mail2nsrajesh/kuryr | df421a9b2e743f00ac27c030e5094f784f72599a | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Red Hat, 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, ... | 39.3 | 78 | 0.716031 |
d4df4869bcb0378b20bd2ed0f8e7237de841c74f | 7,022 | py | Python | examples/Al__eam__born_exp_fs/pareto_optimization_3.5NN/make_new_parallel_coordinates_plot.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 4 | 2018-01-18T19:59:56.000Z | 2020-08-25T11:56:52.000Z | examples/Al__eam__born_exp_fs/pareto_optimization_3.5NN/make_new_parallel_coordinates_plot.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 1 | 2018-04-22T23:02:13.000Z | 2018-04-22T23:02:13.000Z | examples/Al__eam__born_exp_fs/pareto_optimization_3.5NN/make_new_parallel_coordinates_plot.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 1 | 2019-09-14T07:04:42.000Z | 2019-09-14T07:04:42.000Z | import copy,os
import numpy as np
import pandas as pd
from collections import OrderedDict
from pypospack.pyposmat.data import PyposmatDataFile
from pypospack.pyposmat.data import PyposmatConfigurationFile
results_PunMishin2015 = OrderedDict([
('sim_id','PunMishin2015'),
('Al_fcc.E_coh', -4.449999985713825),
... | 32.063927 | 90 | 0.627741 |
467d0521b6727d3af9a5c01bf15a0794e0321445 | 191 | py | Python | Thoron/thoron/auth/views.py | lvnar/Thorondor | b2d2887548c6ad8e00e1a872f0cb522e3a54f598 | [
"MIT"
] | null | null | null | Thoron/thoron/auth/views.py | lvnar/Thorondor | b2d2887548c6ad8e00e1a872f0cb522e3a54f598 | [
"MIT"
] | null | null | null | Thoron/thoron/auth/views.py | lvnar/Thorondor | b2d2887548c6ad8e00e1a872f0cb522e3a54f598 | [
"MIT"
] | null | null | null | from rest_framework.authentication import TokenAuthentication
from rest_auth.views import LogoutView
class CustomLogoutView(LogoutView):
authentication_classes = (TokenAuthentication,)
| 27.285714 | 61 | 0.853403 |
f49bebe46a7b91e86ab26a44c93c2d8d8d08a5c6 | 1,025 | py | Python | lib/dyson/keywords/__init__.py | luna-test/luna | 6d94439f2747daf96e295837684bdc6607f507dc | [
"Apache-2.0"
] | 3 | 2018-05-21T14:35:11.000Z | 2021-03-25T12:32:25.000Z | lib/dyson/keywords/__init__.py | dyson-framework/dyson | e5a2e12c7bb0ba21ff274feff34c184576d08ff5 | [
"Apache-2.0"
] | 13 | 2018-05-22T01:01:08.000Z | 2018-09-16T22:12:10.000Z | lib/dyson/keywords/__init__.py | luna-test/luna | 6d94439f2747daf96e295837684bdc6607f507dc | [
"Apache-2.0"
] | 1 | 2018-05-21T14:35:17.000Z | 2018-05-21T14:35:17.000Z | import glob
import os
from dyson.vars import merge_dict
def load_keywords(keywords_path=None):
all_keywords = dict()
keyword_paths = (
os.path.abspath("/etc/dyson/keywords"),
os.path.abspath(os.path.join(os.path.dirname(os.path.curdir), "keywords"))
)
if keywords_path is not None:
... | 30.147059 | 91 | 0.693659 |
c6b65a205635f5147b9bedb2d9c18b572bb9705c | 48,093 | py | Python | spts/utils/eval.py | FilipeMaia/spts | de4eb2920b675537da611c7301d4d5a9565a1ab1 | [
"BSD-2-Clause"
] | null | null | null | spts/utils/eval.py | FilipeMaia/spts | de4eb2920b675537da611c7301d4d5a9565a1ab1 | [
"BSD-2-Clause"
] | 5 | 2021-03-26T11:37:40.000Z | 2021-03-31T09:20:40.000Z | spts/utils/eval.py | FilipeMaia/spts | de4eb2920b675537da611c7301d4d5a9565a1ab1 | [
"BSD-2-Clause"
] | 1 | 2021-03-24T11:07:41.000Z | 2021-03-24T11:07:41.000Z | import os
import numpy as np
import h5py
import scipy.interpolate
import itertools
import requests
from distutils.version import LooseVersion
import logging
logger = logging.getLogger('spts')
from matplotlib import pyplot as pypl
from matplotlib.patches import Circle
from matplotlib.colors import LogNorm
import s... | 38.351675 | 234 | 0.524567 |
1bfc6c5c94183d49f2f9087102904ed10441fcbe | 5,475 | py | Python | tools/telemetry/telemetry/page/page_test_runner.py | hujiajie/pa-chromium | 1816ff80336a6efd1616f9e936880af460b1e105 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2020-05-03T06:33:56.000Z | 2021-11-14T18:39:42.000Z | tools/telemetry/telemetry/page/page_test_runner.py | hujiajie/pa-chromium | 1816ff80336a6efd1616f9e936880af460b1e105 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/telemetry/telemetry/page/page_test_runner.py | hujiajie/pa-chromium | 1816ff80336a6efd1616f9e936880af460b1e105 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
from telemetry.core import browser_options
from telemetry.core import discover
from telemetry.core import profile_types
from telemet... | 32.784431 | 78 | 0.691142 |
404fe6d651c29aa79456e71c72b0bb900e4728b8 | 12,718 | py | Python | kivy/uix/dropdown.py | quadropoly/kivy | 15a125c046b793c56406cafb47359245dfb6edd6 | [
"MIT"
] | 2 | 2020-06-19T13:59:23.000Z | 2020-09-08T17:08:35.000Z | kivy/uix/dropdown.py | quadropoly/kivy | 15a125c046b793c56406cafb47359245dfb6edd6 | [
"MIT"
] | null | null | null | kivy/uix/dropdown.py | quadropoly/kivy | 15a125c046b793c56406cafb47359245dfb6edd6 | [
"MIT"
] | 1 | 2020-03-06T07:08:30.000Z | 2020-03-06T07:08:30.000Z | '''
Drop-Down List
==============
.. image:: images/dropdown.gif
:align: right
.. versionadded:: 1.4.0
A versatile drop-down list that can be used with custom widgets. It allows you
to display a list of widgets under a displayed widget. Unlike other toolkits,
the list of widgets can contain any type of widget: s... | 32.948187 | 79 | 0.637758 |
c9513246fb891acca7c9d10673dd08b11ba2ed75 | 2,343 | py | Python | PreprocessData/all_class_files/InternetCafe.py | wkid-neu/Schema | 4854720a15894dd814691a55e03329ecbbb6f558 | [
"MIT"
] | 3 | 2021-11-06T12:29:05.000Z | 2022-03-22T12:48:55.000Z | PreprocessData/all_class_files/InternetCafe.py | DylanNEU/Schema | 4854720a15894dd814691a55e03329ecbbb6f558 | [
"MIT"
] | null | null | null | PreprocessData/all_class_files/InternetCafe.py | DylanNEU/Schema | 4854720a15894dd814691a55e03329ecbbb6f558 | [
"MIT"
] | 1 | 2021-11-06T12:29:12.000Z | 2021-11-06T12:29:12.000Z | from PreprocessData.all_class_files.LocalBusiness import LocalBusiness
import global_data
class InternetCafe(LocalBusiness):
def __init__(self, additionalType=None, alternateName=None, description=None, disambiguatingDescription=None, identifier=None, image=None, mainEntityOfPage=None, name=None, potentialAc... | 292.875 | 1,273 | 0.832266 |
380aaf05b421d94ca36de64cc8a9ec3d81460520 | 437 | py | Python | apps/keyboard/core/load.py | ZhuoZhuoCrayon/AcousticKeyBoard-Web | 0a0ead78aec7ed03898fd51e076aa57df966508c | [
"MIT"
] | null | null | null | apps/keyboard/core/load.py | ZhuoZhuoCrayon/AcousticKeyBoard-Web | 0a0ead78aec7ed03898fd51e076aa57df966508c | [
"MIT"
] | null | null | null | apps/keyboard/core/load.py | ZhuoZhuoCrayon/AcousticKeyBoard-Web | 0a0ead78aec7ed03898fd51e076aa57df966508c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import pickle
from djangocli.constants import LogModule
from in_python.core.pre.load import DataSetUnit
logger = logging.getLogger(LogModule.APPS)
def load_dataset_unit(save_path: str) -> DataSetUnit:
with open(file=save_path, mode="rb") as ds_unit_reader:
dataset_... | 27.3125 | 59 | 0.748284 |
527fd484b89a3114848d859efed578496371a8af | 5,998 | py | Python | gdata/calendar_resource/data.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | 2 | 2015-05-15T20:28:45.000Z | 2017-07-23T20:35:59.000Z | lib/gdata/calendar_resource/data.py | motord/Motorcycle-Diaries | bb5e5e2d4d79573b4231e760d7662db26c03a55e | [
"BSD-3-Clause"
] | null | null | null | lib/gdata/calendar_resource/data.py | motord/Motorcycle-Diaries | bb5e5e2d4d79573b4231e760d7662db26c03a55e | [
"BSD-3-Clause"
] | 2 | 2021-05-03T01:30:32.000Z | 2022-03-23T19:53:08.000Z | #!/usr/bin/python
#
# Copyright 2009 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 b... | 30.917526 | 82 | 0.722908 |
295ea072dcd126aedc9cbfdde389f959429e528e | 5,815 | py | Python | test_ms.py | Spritea/pytorch-semseg-fp16-one-titan | 33dcd61b1f703f52a5f7ba4ac758c3a1726e4273 | [
"MIT"
] | null | null | null | test_ms.py | Spritea/pytorch-semseg-fp16-one-titan | 33dcd61b1f703f52a5f7ba4ac758c3a1726e4273 | [
"MIT"
] | null | null | null | test_ms.py | Spritea/pytorch-semseg-fp16-one-titan | 33dcd61b1f703f52a5f7ba4ac758c3a1726e4273 | [
"MIT"
] | null | null | null | import sys, os
import torch
import argparse
import timeit
import numpy as np
import scipy.misc as misc
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
from torch.utils import data
from tqdm import tqdm
from ptsemseg.models import get_model
from ptsemseg.loader import get_load... | 31.775956 | 123 | 0.607911 |
3728628b015a560c85154e4feb29a1d119f61e8b | 1,949 | py | Python | read_data/read_TCGA_data.py | fuhrmanj/TRANSACT_manuscript | 71ca2ec42bdd5d547d4b965aa7f84838bfd5b812 | [
"MIT"
] | 5 | 2020-10-26T13:18:40.000Z | 2022-02-21T10:03:09.000Z | read_data/read_TCGA_data.py | fuhrmanj/TRANSACT_manuscript | 71ca2ec42bdd5d547d4b965aa7f84838bfd5b812 | [
"MIT"
] | 1 | 2022-03-21T09:55:53.000Z | 2022-03-23T13:48:47.000Z | read_data/read_TCGA_data.py | fuhrmanj/TRANSACT_manuscript | 71ca2ec42bdd5d547d4b965aa7f84838bfd5b812 | [
"MIT"
] | 2 | 2020-11-04T15:40:58.000Z | 2021-01-26T09:37:33.000Z | # -*- coding: utf-8 -*-
"""
@author: Soufiane Mourragui
2020/01/16
READ TCGA DATA
"""
import os
import pandas as pd
import numpy as np
from functools import reduce
def read_one_TCGA_modality(tissues,
projects,
data_type,
folder):
if type(tissues)... | 30.453125 | 103 | 0.590559 |
363e6578718b4b4025ce68c6890669884631b5da | 2,861 | py | Python | neurotic/nlp/twitter/test.py | necromuralist/Neurotic-Networking | 20f46dec5d890bd57abd802b6ebf219f0e8e7611 | [
"MIT"
] | null | null | null | neurotic/nlp/twitter/test.py | necromuralist/Neurotic-Networking | 20f46dec5d890bd57abd802b6ebf219f0e8e7611 | [
"MIT"
] | 3 | 2021-01-11T01:42:31.000Z | 2021-11-10T19:44:25.000Z | neurotic/nlp/twitter/test.py | necromuralist/Neurotic-Networking | 20f46dec5d890bd57abd802b6ebf219f0e8e7611 | [
"MIT"
] | null | null | null | # from pypi
import attr
import numpy
# this project
from .counter import WordCounter
from .sentiment import TweetSentiment
from .vectorizer import TweetVectorizer
@attr.s(auto_attribs=True)
class LogisticRegression:
"""train and predict tweet sentiment
Args:
iterations: number of times to run gradient d... | 30.43617 | 83 | 0.600839 |
1b15caf66808765a4050212986decaeff4b41fd3 | 140 | py | Python | skgpytorch/models/__init__.py | palak-purohit/skgpytorch | f1143a0f6a4858be4485ff465b3d6da7b28067f0 | [
"MIT"
] | 5 | 2022-01-16T00:12:48.000Z | 2022-03-04T12:59:26.000Z | skgpytorch/models/__init__.py | palak-purohit/skgpytorch | f1143a0f6a4858be4485ff465b3d6da7b28067f0 | [
"MIT"
] | 3 | 2022-02-25T10:52:46.000Z | 2022-03-18T12:30:51.000Z | skgpytorch/models/__init__.py | palak-purohit/skgpytorch | f1143a0f6a4858be4485ff465b3d6da7b28067f0 | [
"MIT"
] | null | null | null | from .exact_gp import ExactGPRegressor
from .base import BaseRegressor
from .sv_gp import SVGPRegressor
from .sparse_gp import SGPRegressor
| 28 | 38 | 0.857143 |
d80e1874aa88f7518eef457b71615679cc74f1a7 | 1,058 | py | Python | BugTracker/bugzillaProjectBugs.py | luisibanez/CommunityAnalyzer | dc408405cf00d189ec764e37a45f83f09d2710ce | [
"Apache-2.0"
] | 2 | 2019-01-20T21:49:03.000Z | 2019-04-28T17:56:24.000Z | BugTracker/bugzillaProjectBugs.py | luisibanez/CommunityAnalyzer | dc408405cf00d189ec764e37a45f83f09d2710ce | [
"Apache-2.0"
] | null | null | null | BugTracker/bugzillaProjectBugs.py | luisibanez/CommunityAnalyzer | dc408405cf00d189ec764e37a45f83f09d2710ce | [
"Apache-2.0"
] | 3 | 2015-04-27T16:49:18.000Z | 2019-05-19T01:26:38.000Z | import requests
import sys
import json
import time
import pymongo
import dateutil
base_url = sys.argv[1]
project = sys.argv[2]
output_host = sys.argv[3]
output_db = sys.argv[4]
output_collection = sys.argv[5]
# output_file = sys.argv[3]
coll = pymongo.MongoClient(output_host)[output_db][output_collection]
url = base... | 28.594595 | 91 | 0.642722 |
c5c1254e925b6d85a1d87eeda4555bdb2da29f1e | 622 | py | Python | src/probnum/quad/policies/sample_measure.py | NinaEffenberger/probnum | 595f55f9f235fd0396d02b9a6f828aba2383dceb | [
"MIT"
] | 4 | 2020-12-07T11:56:48.000Z | 2021-04-16T14:50:40.000Z | src/probnum/quad/policies/sample_measure.py | NinaEffenberger/probnum | 595f55f9f235fd0396d02b9a6f828aba2383dceb | [
"MIT"
] | 42 | 2021-04-12T08:11:41.000Z | 2022-03-28T00:21:55.000Z | src/probnum/quad/policies/sample_measure.py | NinaEffenberger/probnum | 595f55f9f235fd0396d02b9a6f828aba2383dceb | [
"MIT"
] | null | null | null | """Randomly draw nodes from the measure to use for integration."""
import numpy as np
from probnum.quad._integration_measures import IntegrationMeasure
def sample_from_measure(nevals: int, measure: IntegrationMeasure) -> np.ndarray:
r"""Acquisition policy: Draw random samples from the integration measure.
... | 24.88 | 80 | 0.680064 |
a2a0483b595091f311315b13580c1d9c13ff4eef | 10,903 | py | Python | camd3/infrastructure/component/component.py | mamrhein/CAmD3 | d20f62295771a297c3fbb314beef314e5ec7a2b5 | [
"BSD-2-Clause"
] | null | null | null | camd3/infrastructure/component/component.py | mamrhein/CAmD3 | d20f62295771a297c3fbb314beef314e5ec7a2b5 | [
"BSD-2-Clause"
] | null | null | null | camd3/infrastructure/component/component.py | mamrhein/CAmD3 | d20f62295771a297c3fbb314beef314e5ec7a2b5 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Name: component
# Purpose: Basic component infrastructure
#
# Author: Michael Amrhein (michael@adrhinum.de)
#
# Copyright: (c) 2014 Michael Amrhein
# License: This program is part of a larger a... | 36.102649 | 78 | 0.553976 |
a02dc0264a1b64bccc54ee514aaed9c471dee560 | 230 | py | Python | lang.py | wongalvis/WiktionaryCrawler | 4a61e5f28d4bca591b10f9bcc2b3c0d29138fc15 | [
"Unlicense"
] | null | null | null | lang.py | wongalvis/WiktionaryCrawler | 4a61e5f28d4bca591b10f9bcc2b3c0d29138fc15 | [
"Unlicense"
] | null | null | null | lang.py | wongalvis/WiktionaryCrawler | 4a61e5f28d4bca591b10f9bcc2b3c0d29138fc15 | [
"Unlicense"
] | 1 | 2019-03-28T00:25:46.000Z | 2019-03-28T00:25:46.000Z | import config
if config.lang == "zh":
from filters import zh as filter
from parsers import zh as parser
## the list goes on
def can(page):
return filter.can(page)
def parse(page, htmldoc):
return parser.parse(page, htmldoc) | 19.166667 | 35 | 0.734783 |
b46060daff2c376ad61cd828f5f2709f4c2fb195 | 776 | py | Python | db_cassandra.py | Sparab16/Flask-API-Demonstration | 19c0d82fe5ea22cdf83b3c7603a2a2a55707027c | [
"MIT"
] | 1 | 2022-02-23T03:45:04.000Z | 2022-02-23T03:45:04.000Z | db_cassandra.py | KrishAleti/Flask-API-Demonstration | 19c0d82fe5ea22cdf83b3c7603a2a2a55707027c | [
"MIT"
] | null | null | null | db_cassandra.py | KrishAleti/Flask-API-Demonstration | 19c0d82fe5ea22cdf83b3c7603a2a2a55707027c | [
"MIT"
] | 2 | 2021-11-20T10:43:08.000Z | 2022-02-23T03:09:09.000Z | from cassandra.auth import PlainTextAuthProvider
from cassandra.cluster import Cluster
from flask import render_template
from Logging import Log
# Init the log
log = Log().create_log()
class Cassandra:
def create_connection(self, username, password, secure_bundle_path):
try:
c... | 28.740741 | 79 | 0.630155 |
3abe12eb013018d9f079a43204667e9f67d0bbe5 | 4,495 | py | Python | normalize/property/json.py | mattrowe/normalize | 1034e9a2660c7ae7aaa09993ef9ff27a981e0396 | [
"MIT"
] | null | null | null | normalize/property/json.py | mattrowe/normalize | 1034e9a2660c7ae7aaa09993ef9ff27a981e0396 | [
"MIT"
] | null | null | null | normalize/property/json.py | mattrowe/normalize | 1034e9a2660c7ae7aaa09993ef9ff27a981e0396 | [
"MIT"
] | null | null | null | #
# This file is a part of the normalize python library
#
# normalize is free software: you can redistribute it and/or modify
# it under the terms of the MIT License.
#
# normalize is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FI... | 35.674603 | 78 | 0.671413 |
d2a7fb13201480f6050d1e371099d369938bc05d | 798 | py | Python | src/frontend/authenticator/authenticator.py | Marco9412/PyMusicServer3 | fa264c4344a56ff15d08ec5ffdc9b24cc61db29e | [
"Apache-2.0"
] | null | null | null | src/frontend/authenticator/authenticator.py | Marco9412/PyMusicServer3 | fa264c4344a56ff15d08ec5ffdc9b24cc61db29e | [
"Apache-2.0"
] | null | null | null | src/frontend/authenticator/authenticator.py | Marco9412/PyMusicServer3 | fa264c4344a56ff15d08ec5ffdc9b24cc61db29e | [
"Apache-2.0"
] | null | null | null | #
# Marco Panato
# 2016-03-11
# Authenticator for frontend
#
# Each user has a role
# 1 -> min privileges
# 5 -> max privileges
from hashlib import md5
import logging
from database.DataManager import DataManager
class Authenticator(object):
def authenticate(self, user, password):
"""
Re... | 24.9375 | 76 | 0.617794 |
f3ca6757fa62088634f55db7787b65856891dd36 | 7,004 | py | Python | Unibooks/models.py | forbesmiyasato/Unibooks | a56c810b751db7296f8540e4729270d3e28ed007 | [
"PostgreSQL"
] | null | null | null | Unibooks/models.py | forbesmiyasato/Unibooks | a56c810b751db7296f8540e4729270d3e28ed007 | [
"PostgreSQL"
] | 3 | 2020-10-16T06:59:39.000Z | 2021-09-08T01:40:13.000Z | Unibooks/models.py | forbesmiyasato/Unibooks | a56c810b751db7296f8540e4729270d3e28ed007 | [
"PostgreSQL"
] | null | null | null | from . import db, login_manager
from datetime import datetime
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return Users.query.get(int(user_id))
class Users(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(320), nullabl... | 47.006711 | 108 | 0.691605 |
e0a1c01672330e13f510a9e1c505facac76535f4 | 5,671 | py | Python | igit/models/reference.py | jmosbacher/igit | 62b613fd5bed28b603160dc998c02106ee4fdef0 | [
"Apache-2.0"
] | null | null | null | igit/models/reference.py | jmosbacher/igit | 62b613fd5bed28b603160dc998c02106ee4fdef0 | [
"Apache-2.0"
] | 107 | 2021-06-28T02:10:11.000Z | 2022-03-30T02:38:03.000Z | igit/models/reference.py | jmosbacher/igit | 62b613fd5bed28b603160dc998c02106ee4fdef0 | [
"Apache-2.0"
] | null | null | null | import time
from collections.abc import Iterable
from datetime import datetime
from typing import ClassVar, List, Mapping, Optional, Sequence, Tuple
from pydantic import BaseModel, Field
from ..utils import assign_branches, hierarchy_pos, min_ch, roundrobin
from .base import BaseObject
from .user import User
class ... | 26.5 | 78 | 0.554047 |
9d29bc931d16d646edfc75474e241c71afaf814b | 16,450 | py | Python | fastflix/widgets/panels/queue_panel.py | ObviousInRetrospect/FastFlix | 26c53d10fb9b2d9e73382a78a7276bb2389bd5c5 | [
"MIT"
] | 388 | 2019-03-11T12:45:36.000Z | 2022-03-29T19:18:21.000Z | fastflix/widgets/panels/queue_panel.py | neoOpus/FastFlix | 26c53d10fb9b2d9e73382a78a7276bb2389bd5c5 | [
"MIT"
] | 239 | 2019-02-19T20:05:59.000Z | 2022-03-30T23:27:49.000Z | fastflix/widgets/panels/queue_panel.py | neoOpus/FastFlix | 26c53d10fb9b2d9e73382a78a7276bb2389bd5c5 | [
"MIT"
] | 44 | 2019-08-22T21:41:29.000Z | 2022-03-03T08:16:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
import sys
import logging
import reusables
from box import Box
from PySide6 import QtCore, QtGui, QtWidgets
from fastflix.language import t
from fastflix.models.fastflix_app import FastFlixApp
from fastflix.models.video import Video
from fastflix.ff_queue imp... | 40.41769 | 116 | 0.636049 |
96149676fec352db0b2196b4965d170e58a06d61 | 8,442 | py | Python | badger/feeds.py | lmorchard/badges.mozilla.org | 2f00782eb40f187b9c0cd70763090b8c46ec448e | [
"BSD-3-Clause"
] | 21 | 2015-01-04T22:30:46.000Z | 2017-09-12T03:03:27.000Z | badger/feeds.py | lmorchard/badges.mozilla.org | 2f00782eb40f187b9c0cd70763090b8c46ec448e | [
"BSD-3-Clause"
] | 76 | 2015-01-04T21:23:35.000Z | 2019-03-28T12:36:17.000Z | badger/feeds.py | lmorchard/badges.mozilla.org | 2f00782eb40f187b9c0cd70763090b8c46ec448e | [
"BSD-3-Clause"
] | 41 | 2015-01-08T04:47:10.000Z | 2019-03-28T04:12:57.000Z | """Feeds for badge"""
import datetime
import hashlib
import urllib
from django.contrib.syndication.views import Feed, FeedDoesNotExist
from django.utils.feedgenerator import (SyndicationFeed, Rss201rev2Feed,
Atom1Feed, get_tag_uri)
import json
from django.shortcuts import get_ob... | 32.098859 | 80 | 0.630419 |
81cb876348e3aa306dc50cecd333dd5845fa8e8b | 1,053 | py | Python | application/application/models/Event.py | Terkea/kiosk | 86a6520f9d91d7bacca915d3740da802e3efb510 | [
"MIT"
] | null | null | null | application/application/models/Event.py | Terkea/kiosk | 86a6520f9d91d7bacca915d3740da802e3efb510 | [
"MIT"
] | null | null | null | application/application/models/Event.py | Terkea/kiosk | 86a6520f9d91d7bacca915d3740da802e3efb510 | [
"MIT"
] | null | null | null | from sqlalchemy import Column, Integer, String, ForeignKey, Sequence, Text, Boolean
from sqlalchemy.orm import relationship
from application.database import Base
class Event(Base):
__tablename__ = 'event'
id = Column(Integer, Sequence('id_seq'), primary_key=True)
user_id = Column(Integer, ForeignKey... | 40.5 | 84 | 0.695157 |
adf85bff0b5153c9ff057d0c11fceafed14d01a2 | 4,021 | py | Python | hubspot/crm/extensions/accounting/models/import_invoice_feature.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/extensions/accounting/models/import_invoice_feature.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/extensions/accounting/models/import_invoice_feature.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Accounting Extension
These APIs allow you to interact with HubSpot's Accounting Extension. It allows you to: * Specify the URLs that HubSpot will use when making webhook requests to your external accounting system. * Respond to webhook calls made to your external accounting system by HubSp... | 31.912698 | 290 | 0.59612 |
7b45363e6eba306c519b5deeca2bc38d6535cec8 | 13,445 | py | Python | detectron2/modeling/meta_arch/rcnn.py | mmabrouk/detectron2 | 158e395acdb8ca6ed6d488b43475f9ef9d200405 | [
"Apache-2.0"
] | 21,274 | 2019-10-10T17:50:46.000Z | 2022-03-31T17:58:45.000Z | detectron2/modeling/meta_arch/rcnn.py | mmabrouk/detectron2 | 158e395acdb8ca6ed6d488b43475f9ef9d200405 | [
"Apache-2.0"
] | 3,253 | 2019-10-10T20:39:47.000Z | 2022-03-31T22:27:53.000Z | detectron2/modeling/meta_arch/rcnn.py | mmabrouk/detectron2 | 158e395acdb8ca6ed6d488b43475f9ef9d200405 | [
"Apache-2.0"
] | 6,288 | 2019-10-10T18:00:27.000Z | 2022-03-31T21:22:58.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
import logging
import numpy as np
from typing import Dict, List, Optional, Tuple
import torch
from torch import nn
from detectron2.config import configurable
from detectron2.data.detection_utils import convert_image_to_rgb
from detectron2.structures import ImageList, ... | 40.990854 | 98 | 0.635552 |
c812451c2d8d122df7957dc13014ffc333c7af5c | 19,607 | py | Python | lego/apps/events/views.py | ion05/lego | 873f6898e35ed2d9a33bdfb8339eaf6c9a61470c | [
"MIT"
] | null | null | null | lego/apps/events/views.py | ion05/lego | 873f6898e35ed2d9a33bdfb8339eaf6c9a61470c | [
"MIT"
] | null | null | null | lego/apps/events/views.py | ion05/lego | 873f6898e35ed2d9a33bdfb8339eaf6c9a61470c | [
"MIT"
] | null | null | null | from django.db import transaction
from django.db.models import Count, Prefetch, Q
from django.utils import timezone
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import decorators, filters, mixins, permissions, status, viewsets
from rest_framework.exceptions import PermissionDenied, ... | 36.648598 | 95 | 0.627582 |
693c3b79d60a21355f60dc7e2e7131f438f67c8d | 629 | py | Python | src/blog_posts/api/serializers.py | rooneyrulz/django_blog_post_api | 33335074fa3ed78ba0f3a371093552cb7381528c | [
"MIT"
] | 3 | 2019-10-29T08:45:22.000Z | 2020-04-15T05:10:58.000Z | src/blog_posts/api/serializers.py | rooneyrulz/django_blog_post_api | 33335074fa3ed78ba0f3a371093552cb7381528c | [
"MIT"
] | 5 | 2020-06-06T00:02:31.000Z | 2021-06-10T19:09:56.000Z | src/blog_posts/api/serializers.py | rooneyrulz/django_blog_post_api | 33335074fa3ed78ba0f3a371093552cb7381528c | [
"MIT"
] | null | null | null | from rest_framework import serializers
from blog_posts.models import BlogPost
class BlogPostSerializer(serializers.ModelSerializer):
class Meta:
model = BlogPost
fields = ['id', 'title', 'body', 'author', 'created_at']
def validate_title(self, value):
qs = BlogPost.objects.filter(title__iexact=value)
... | 33.105263 | 75 | 0.72814 |
6144244d2e296ebe6b8acb89fa9507140b280986 | 9,895 | py | Python | plugins/modules/oci_waas_address_list_facts.py | A7rMtWE57x/oci-ansible-collection | 80548243a085cd53fd5dddaa8135b5cb43612c66 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_waas_address_list_facts.py | A7rMtWE57x/oci-ansible-collection | 80548243a085cd53fd5dddaa8135b5cb43612c66 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_waas_address_list_facts.py | A7rMtWE57x/oci-ansible-collection | 80548243a085cd53fd5dddaa8135b5cb43612c66 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2017, 2020 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 34.238754 | 159 | 0.616069 |
a9cec3ca05fc6dcc8528166758b86d678386c916 | 4,893 | py | Python | methods/VQVAE2/test.py | IvanNik17/Seasonal-Changes-in-Thermal-Surveillance-Imaging | 753ecd2751ac318d4a304c28404ae60dd8e3060c | [
"MIT"
] | 2 | 2021-11-30T06:26:21.000Z | 2022-02-26T10:57:55.000Z | methods/VQVAE2/test.py | IvanNik17/Seasonal-Changes-in-Thermal-Surveillance-Imaging | 753ecd2751ac318d4a304c28404ae60dd8e3060c | [
"MIT"
] | null | null | null | methods/VQVAE2/test.py | IvanNik17/Seasonal-Changes-in-Thermal-Surveillance-Imaging | 753ecd2751ac318d4a304c28404ae60dd8e3060c | [
"MIT"
] | null | null | null | import argparse
import os, sys
import cv2
import numpy as np
import csv
import torch
import pytorch_lightning as pl
#from torchsummary import summary
import torch.nn.functional as F
from torchvision import transforms
from models.vqvae2 import VQVAE2
from config import hparams
from glob import glob
sys.path.append('... | 28.447674 | 115 | 0.595953 |
428ecd4e949e1519fb5d46643583d2e6c261ad8a | 5,322 | py | Python | sdks/python/apache_beam/io/gcp/tests/utils.py | hengfengli/beam | 83a8855e5997e0311e6274c03bcb38f94efbf8ef | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2022-01-11T19:43:12.000Z | 2022-01-15T15:45:20.000Z | sdks/python/apache_beam/io/gcp/tests/utils.py | hengfengli/beam | 83a8855e5997e0311e6274c03bcb38f94efbf8ef | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 8 | 2021-04-15T02:46:05.000Z | 2022-01-17T02:19:04.000Z | sdks/python/apache_beam/io/gcp/tests/utils.py | hengfengli/beam | 83a8855e5997e0311e6274c03bcb38f94efbf8ef | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 17 | 2021-12-15T19:31:54.000Z | 2022-01-31T18:54:23.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 us... | 31.491124 | 79 | 0.734686 |
74928b04474e53c61ba41643a520e641fc3b3b09 | 506 | py | Python | code/pose-invariant-face-recognition/test.py | FRH-Code-Data/Appendix | 106a7c65c178d2b446e3bd8fb192ac2f4b7e323f | [
"CC-BY-4.0"
] | 5 | 2020-02-28T09:28:55.000Z | 2021-06-03T02:15:42.000Z | code/pose-invariant-face-recognition/test.py | FRH-Code-Data/Appendix | 106a7c65c178d2b446e3bd8fb192ac2f4b7e323f | [
"CC-BY-4.0"
] | 6 | 2020-03-08T22:58:13.000Z | 2022-03-12T00:15:14.000Z | code/pose-invariant-face-recognition/test.py | FRH-Code-Data/Appendix | 106a7c65c178d2b446e3bd8fb192ac2f4b7e323f | [
"CC-BY-4.0"
] | 3 | 2020-02-28T09:29:03.000Z | 2020-03-09T05:08:07.000Z | import torch
import sys
sys.path.append('/home/zhangjunhao/options')
from test_options import TestOptions
sys.path.append('/home/zhangjunhao/data')
from data_loader import CreateDataLoader
sys.path.append('/home/zhangjunhao/model')
from model_Loader import CreateModel
opt = TestOptions().parse()
data_loader = CreateD... | 24.095238 | 44 | 0.768775 |
cbb9fa43399478010745d4262b5b07ec32029991 | 337 | py | Python | profiles_api/migrations/0002_auto_20200213_2002.py | TanishqGupta11/profiles-rest-api | 60e6fff08844a5c34897f189eb9b76d475781180 | [
"MIT"
] | 1 | 2020-01-27T14:21:51.000Z | 2020-01-27T14:21:51.000Z | profiles_api/migrations/0002_auto_20200213_2002.py | TanishqGupta11/profiles-rest-api | 60e6fff08844a5c34897f189eb9b76d475781180 | [
"MIT"
] | 5 | 2020-06-06T01:24:34.000Z | 2022-02-10T12:55:38.000Z | profiles_api/migrations/0002_auto_20200213_2002.py | TanishqGupta11/profiles-rest-api | 60e6fff08844a5c34897f189eb9b76d475781180 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-02-13 20:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('profiles_api', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
name='userprofile',
managers=[
],
... | 17.736842 | 45 | 0.566766 |
38b497be13a693e5dcb84c0e1d9fe4b68e4981d0 | 1,896 | py | Python | stdplugins/antivirus.py | ppppspsljdhdd/Pepe | 1e57825ddb0ab3ba15a19cad0ecfbf2622f6b851 | [
"Apache-2.0"
] | 20 | 2020-01-25T05:08:26.000Z | 2022-01-18T07:37:53.000Z | stdplugins/antivirus.py | ishaizz/PepeBot | 7440cadc8228106d221fc8e436a0809a86be5159 | [
"Apache-2.0"
] | 15 | 2019-11-07T07:53:56.000Z | 2022-01-23T09:21:17.000Z | stdplugins/antivirus.py | ishaizz/PepeBot | 7440cadc8228106d221fc8e436a0809a86be5159 | [
"Apache-2.0"
] | 62 | 2019-10-20T06:35:19.000Z | 2021-01-23T17:26:05.000Z | # Lots of lub to @r4v4n4 for gibing the base <3
# copied from @A_Dark_Prince3
"""Type .scan
\nReply to a file/media."""
import logging
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from uniborg.util import admin_cmd
logging.basicConfig(
format="%(asctime)s - %(name)s -... | 33.857143 | 110 | 0.613397 |
9c6f4a3fe4c260ba9047a7631b676fd6d6987086 | 2,896 | py | Python | libs/GoodOvernight.py | bioinformagic/monica | a9e8c7b75ce6cb4294f3c5e1d772a5acc980cc6a | [
"MIT"
] | 7 | 2018-11-20T21:10:52.000Z | 2019-04-17T05:49:30.000Z | libs/GoodOvernight.py | bioinformagic/monica | a9e8c7b75ce6cb4294f3c5e1d772a5acc980cc6a | [
"MIT"
] | 7 | 2018-12-07T06:50:28.000Z | 2018-12-11T23:40:35.000Z | libs/GoodOvernight.py | bioinformagic/monica | a9e8c7b75ce6cb4294f3c5e1d772a5acc980cc6a | [
"MIT"
] | null | null | null | import subprocess
import os
import xml.etree.ElementTree as parXML
import wget
from src.piper_pan import shell_runner
# TODO add documentation to your code!
class GoodOvernight():
def __init__(self):
pass
def unmapped_extractor(self, exp_output, unmapped_path): # this creates fasta files over unmappe... | 43.223881 | 271 | 0.609461 |
0808c13e49de9e055666da4435be6921ecf21227 | 1,765 | py | Python | esnpy/init.py | NiZiL/esnpy | 8a29b5fefb67d5fd2f1f3efcbd1dbcd4b8cb6e7f | [
"MIT"
] | 6 | 2018-04-19T21:25:41.000Z | 2021-06-03T10:19:06.000Z | esnpy/init.py | NiZiL/esnpy | 8a29b5fefb67d5fd2f1f3efcbd1dbcd4b8cb6e7f | [
"MIT"
] | 2 | 2021-01-18T16:14:58.000Z | 2021-03-12T11:38:49.000Z | esnpy/init.py | NiZiL/esnpy | 8a29b5fefb67d5fd2f1f3efcbd1dbcd4b8cb6e7f | [
"MIT"
] | 3 | 2018-07-23T10:15:06.000Z | 2021-06-03T09:24:52.000Z | # -*- coding: utf-8 -*-
import numpy as np
import scipy.sparse
def _uniform(shape, bmin, bmax):
return np.random.rand(*shape).dot(bmax-bmin) + bmin
def _normal(shape, mu, sigma):
return np.random.randn(*shape).dot(sigma) + mu
class CompositeInit():
def __init__(self, *args):
self.args = args
... | 24.513889 | 72 | 0.627762 |
66c477ff18e3593164694dfce08278578f4c6c6a | 12,452 | py | Python | qnapstats/qnap_stats.py | colinodell/python-qnapstats | 1e4a130aa178e11c1fdb21aca95ee9d60d128cdb | [
"MIT"
] | 42 | 2017-04-28T13:35:43.000Z | 2022-02-03T06:53:36.000Z | qnapstats/qnap_stats.py | colinodell/python-qnapstats | 1e4a130aa178e11c1fdb21aca95ee9d60d128cdb | [
"MIT"
] | 60 | 2017-02-12T09:09:36.000Z | 2022-03-26T11:59:57.000Z | qnapstats/qnap_stats.py | colinodell/python-qnapstats | 1e4a130aa178e11c1fdb21aca95ee9d60d128cdb | [
"MIT"
] | 17 | 2017-02-12T08:12:50.000Z | 2021-12-26T09:52:36.000Z | """Module containing multiple classes to obtain QNAP system stats via cgi calls."""
# -*- coding:utf-8 -*-
import base64
import json
import xmltodict
import requests
# pylint: disable=too-many-instance-attributes
class QNAPStats:
"""Class containing the main functions."""
# pylint: disable=too-many-arguments... | 36.409357 | 112 | 0.543768 |
de433a5cd93247f39d27204045e395c7d44e45cc | 2,538 | py | Python | xadmin/plugins/portal.py | charles820/django-xadmin | 605a8657ede430a458dfb1980db14414cac9fb0e | [
"BSD-3-Clause"
] | 1 | 2015-07-02T13:15:40.000Z | 2015-07-02T13:15:40.000Z | xadmin/plugins/portal.py | charles820/django-xadmin | 605a8657ede430a458dfb1980db14414cac9fb0e | [
"BSD-3-Clause"
] | null | null | null | xadmin/plugins/portal.py | charles820/django-xadmin | 605a8657ede430a458dfb1980db14414cac9fb0e | [
"BSD-3-Clause"
] | null | null | null | #coding:utf-8
from xadmin.sites import site
from xadmin.models import UserSettings
from xadmin.views import BaseAdminPlugin, ModelFormAdminView, DetailAdminView
from xadmin.layout import Fieldset, Column
class BasePortalPlugin(BaseAdminPlugin):
# Media
def get_media(self, media):
return media + self.... | 33.84 | 89 | 0.635146 |
223d7893c9cb5ff5e66ae5b796895baa31b7c2c6 | 4,910 | py | Python | test/swe2d/test_standing_wave.py | jrper/thetis | 3c08a2e6947552119232fefd7380fa61b2a9b84b | [
"MIT"
] | null | null | null | test/swe2d/test_standing_wave.py | jrper/thetis | 3c08a2e6947552119232fefd7380fa61b2a9b84b | [
"MIT"
] | null | null | null | test/swe2d/test_standing_wave.py | jrper/thetis | 3c08a2e6947552119232fefd7380fa61b2a9b84b | [
"MIT"
] | null | null | null | # Test for temporal convergence of CrankNicolson and pressureprojection picard timesteppers,
# tests convergence of a single period of a standing wave in a rectangular channel.
# This only tests against a linear solution, so does not really test whether the splitting
# in PressureProjectionPicard between nonlinear mome... | 43.839286 | 124 | 0.698778 |
6a6fe2e1db2848d378ee72e0101bcd9f884e95c5 | 10,394 | py | Python | mnelab/utils/io.py | stralu/mnelab | 3165fa40e137cf4369b11bdcb47ca70afaf0c2fd | [
"BSD-3-Clause"
] | 1 | 2020-02-16T16:39:00.000Z | 2020-02-16T16:39:00.000Z | mnelab/utils/io.py | stralu/mnelab | 3165fa40e137cf4369b11bdcb47ca70afaf0c2fd | [
"BSD-3-Clause"
] | null | null | null | mnelab/utils/io.py | stralu/mnelab | 3165fa40e137cf4369b11bdcb47ca70afaf0c2fd | [
"BSD-3-Clause"
] | null | null | null | # Authors: Clemens Brunner <clemens.brunner@gmail.com>
#
# License: BSD (3-clause)
from pathlib import Path
import gzip
import struct
import xml.etree.ElementTree as ETree
from collections import defaultdict
import numpy as np
import mne
from ..utils import have
IMPORT_FORMATS = {"BioSemi Data Format": ".bdf",
... | 30.934524 | 79 | 0.556956 |
8db6656e9ae0cb0333ff8f5e9e1d7b6a427a8b6f | 8,046 | py | Python | pyflux/arma/tests/test_arima_skewt.py | ThomasHoppe/pyflux | 297f2afc2095acd97c12e827dd500e8ea5da0c0f | [
"BSD-3-Clause"
] | 2,091 | 2016-04-01T02:52:10.000Z | 2022-03-29T11:38:15.000Z | pyflux/arma/tests/test_arima_skewt.py | EricSchles/pyflux | 297f2afc2095acd97c12e827dd500e8ea5da0c0f | [
"BSD-3-Clause"
] | 160 | 2016-04-26T14:52:18.000Z | 2022-03-15T02:09:07.000Z | pyflux/arma/tests/test_arima_skewt.py | EricSchles/pyflux | 297f2afc2095acd97c12e827dd500e8ea5da0c0f | [
"BSD-3-Clause"
] | 264 | 2016-05-02T14:03:31.000Z | 2022-03-29T07:48:20.000Z | import numpy as np
from pyflux.arma import ARIMA
from pyflux.families import Skewt
noise = np.random.normal(0,1,300)
data = np.zeros(300)
for i in range(1,len(data)):
data[i] = 0.9*data[i-1] + noise[i]
def test_no_terms():
"""
Tests an ARIMA model with no AR or MA terms, and that
the latent variable ... | 43.491892 | 113 | 0.697241 |
1a0c3de4b35e98f9e342719bd87e6a0fd0c1af19 | 23,488 | py | Python | py3/nn/experiments/recurrent_gan/rnn_gan_lm.py | fr42k/gap-wgan-gp | 4e373c43d606a1b83f76893d93f9cf8be8cd460d | [
"MIT"
] | null | null | null | py3/nn/experiments/recurrent_gan/rnn_gan_lm.py | fr42k/gap-wgan-gp | 4e373c43d606a1b83f76893d93f9cf8be8cd460d | [
"MIT"
] | null | null | null | py3/nn/experiments/recurrent_gan/rnn_gan_lm.py | fr42k/gap-wgan-gp | 4e373c43d606a1b83f76893d93f9cf8be8cd460d | [
"MIT"
] | null | null | null | """Generative Adversarial Network for MNIST."""
# Ideas:
# Penalize information retention by the discriminator (to prevent time-wise sparse gradients); i.e. encourage forget-gate activation
# EBGAN
import os, sys
sys.path.append(os.getcwd())
try: # This only matters on Ishaan's computer
import experiment_tools
... | 40.150427 | 226 | 0.665702 |
981f3f9780c8c3b1ab82d5c65def948c329f92b5 | 4,035 | py | Python | netket/hilbert/spin.py | yannra/netket | 7adc7ba04ff8e912629952cf4fa0e3f27148c424 | [
"Apache-2.0"
] | null | null | null | netket/hilbert/spin.py | yannra/netket | 7adc7ba04ff8e912629952cf4fa0e3f27148c424 | [
"Apache-2.0"
] | 9 | 2022-01-14T10:25:14.000Z | 2022-03-30T10:19:59.000Z | netket/hilbert/spin.py | yannra/netket | 7adc7ba04ff8e912629952cf4fa0e3f27148c424 | [
"Apache-2.0"
] | null | null | null | from .custom_hilbert import CustomHilbert
from ._deprecations import graph_to_N_depwarn
from fractions import Fraction
import numpy as _np
from netket import random as _random
from netket.graph import AbstractGraph
from numba import jit
from typing import Optional, List
class Spin(CustomHilbert):
r"""Hilbert s... | 29.452555 | 89 | 0.563569 |
61f8f0415723fbacd0fbff36296572eb05862375 | 3,426 | py | Python | blasteroids/client/world.py | smallarmyofnerds/blasteroids | 082bc010ed6d2ec6098a8848edcbee433a5b6961 | [
"MIT"
] | null | null | null | blasteroids/client/world.py | smallarmyofnerds/blasteroids | 082bc010ed6d2ec6098a8848edcbee433a5b6961 | [
"MIT"
] | 7 | 2021-09-04T18:49:13.000Z | 2021-09-05T19:37:39.000Z | blasteroids/client/world.py | smallarmyofnerds/blasteroids | 082bc010ed6d2ec6098a8848edcbee433a5b6961 | [
"MIT"
] | null | null | null | from blasteroids.lib.constants import ANIMATION_OBJECT_ID, ASTEROID_OBJECT_ID, PICKUP_OBJECT_ID, PROJECTILE_OBJECT_ID, SHIP_OBJECT_ID, SOUND_OBJECT_ID
from .game_objects import AnimationObject, ProjectileObject, AsteroidObject, PickupObject, ShipObject, SoundEffectObject
from .hud import Hud
class World:
def __in... | 43.367089 | 150 | 0.644191 |
e88e63b6b129694c2fa8ce54b1560ae10dde5955 | 512 | py | Python | get_handler.py | Ginkooo/maillogger | def0a9184eb034b8afe3ca59aacac0f529aaebd0 | [
"MIT"
] | null | null | null | get_handler.py | Ginkooo/maillogger | def0a9184eb034b8afe3ca59aacac0f529aaebd0 | [
"MIT"
] | null | null | null | get_handler.py | Ginkooo/maillogger | def0a9184eb034b8afe3ca59aacac0f529aaebd0 | [
"MIT"
] | null | null | null | import os
def get_logs(logdir):
currdir = os.path.abspath(os.path.curdir)
os.chdir(logdir)
ret = ''
files = os.listdir()
for f_name in files:
try:
year, month, day = f_name.split('-')
except:
pass
with open(f_name, 'r') as f:
for line in ... | 24.380952 | 56 | 0.455078 |
3dff6fe799fe1071479ff50e0b1f06b3a628e5ca | 1,715 | py | Python | update_meta.py | skratchdot/media-tools | bca0c683fb637aeefda1c49454a118f809047d97 | [
"MIT"
] | null | null | null | update_meta.py | skratchdot/media-tools | bca0c683fb637aeefda1c49454a118f809047d97 | [
"MIT"
] | null | null | null | update_meta.py | skratchdot/media-tools | bca0c683fb637aeefda1c49454a118f809047d97 | [
"MIT"
] | 1 | 2021-05-25T08:11:10.000Z | 2021-05-25T08:11:10.000Z | # -*- coding: utf-8 -*-
import argparse
from lib.io_utils import *
from lib.math_utils import *
from lib.processing_utils import *
import os
from pprint import pprint
import re
import sys
# input
parser = argparse.ArgumentParser()
parser.add_argument('-in', dest="INPUT_FILE", default="tmp/samples.csv", help="Input fi... | 35 | 132 | 0.741691 |
424aa31b6c00eb74e13c8f89facdb2e61816cd79 | 81 | py | Python | ivipcv/ivipcv/ops/__init__.py | QiuHeqian/CrossDet | 2781006d1cafb42bd059fed0f8d14aca885fb6c8 | [
"Apache-2.0"
] | 27 | 2021-08-10T08:33:24.000Z | 2022-03-07T12:16:50.000Z | ivipcv/ivipcv/ops/__init__.py | QiuHeqian/CrossDet | 2781006d1cafb42bd059fed0f8d14aca885fb6c8 | [
"Apache-2.0"
] | 3 | 2021-08-10T08:35:37.000Z | 2021-12-10T12:28:00.000Z | ivipcv/ivipcv/ops/__init__.py | QiuHeqian/CrossDet | 2781006d1cafb42bd059fed0f8d14aca885fb6c8 | [
"Apache-2.0"
] | 1 | 2022-02-15T06:40:36.000Z | 2022-02-15T06:40:36.000Z | from .cross_pool import CrossPool
__all__ = [
'CrossPool', 'cross_pool'
]
| 13.5 | 33 | 0.679012 |
63c6f8cc24a8646b5a3aad33b6c044d98aba357e | 3,631 | py | Python | tests/connectors/test_opcua_connector.py | MarcelMann/thingsboard-gateway | 87fe9ba1f20c6b1e1e7920db56f7d9b3db6b178d | [
"Apache-2.0"
] | 1,123 | 2017-02-07T13:09:40.000Z | 2022-03-30T10:40:48.000Z | tests/connectors/test_opcua_connector.py | MarcelMann/thingsboard-gateway | 87fe9ba1f20c6b1e1e7920db56f7d9b3db6b178d | [
"Apache-2.0"
] | 655 | 2017-03-07T17:25:55.000Z | 2022-03-31T07:59:53.000Z | tests/connectors/test_opcua_connector.py | MarcelMann/thingsboard-gateway | 87fe9ba1f20c6b1e1e7920db56f7d9b3db6b178d | [
"Apache-2.0"
] | 648 | 2017-02-07T13:32:30.000Z | 2022-03-31T05:17:55.000Z | # Copyright 2021. ThingsBoard
# #
# 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 ... | 37.822917 | 122 | 0.675021 |
771a700679a7c6fbc8d0272f01df135ba8f55bfe | 10,071 | py | Python | pytorch_DQNdrone.py | subinlab/dqn | e1b9175a5c9dc2fb7b633b4df54c33fbba7e1e15 | [
"MIT"
] | 1 | 2021-01-11T14:42:42.000Z | 2021-01-11T14:42:42.000Z | pytorch_DQNdrone.py | subinlab/dqn | e1b9175a5c9dc2fb7b633b4df54c33fbba7e1e15 | [
"MIT"
] | null | null | null | pytorch_DQNdrone.py | subinlab/dqn | e1b9175a5c9dc2fb7b633b4df54c33fbba7e1e15 | [
"MIT"
] | null | null | null | import gym
import math
import random
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from collections import namedtuple
from itertools import count
from PIL import Image
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torchvision.transforms as ... | 34.372014 | 95 | 0.666468 |
8b6d38bb003def29c15e126b2f7f1218a47585e1 | 400 | py | Python | redirecttest/redirecttest/urls.py | spothero/django-robust-redirects | 14e13c2765315d0eb214791ba03a5588a0dd9953 | [
"Apache-2.0"
] | 2 | 2015-09-02T11:01:19.000Z | 2020-07-02T19:01:27.000Z | redirecttest/redirecttest/urls.py | spothero/django-robust-redirects | 14e13c2765315d0eb214791ba03a5588a0dd9953 | [
"Apache-2.0"
] | 1 | 2017-06-14T21:47:36.000Z | 2017-06-14T21:47:36.000Z | redirecttest/redirecttest/urls.py | spothero/django-robust-redirects | 14e13c2765315d0eb214791ba03a5588a0dd9953 | [
"Apache-2.0"
] | 3 | 2015-05-30T12:12:23.000Z | 2020-07-02T19:47:21.000Z | from django.contrib import admin
from django.urls import re_path
from django.http import HttpResponse
from django.views.generic import View
class TestView(View):
def dispatch(self, request, *args, **kwargs):
return HttpResponse('Testing')
admin.autodiscover()
urlpatterns = [
re_path(r'^partialtest/... | 22.222222 | 62 | 0.7125 |
d32b9b58307fa9e2e271baed7ab3ee671fc52a86 | 2,482 | py | Python | cirq/contrib/qcircuit/qcircuit_diagram_info_test.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | null | null | null | cirq/contrib/qcircuit/qcircuit_diagram_info_test.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | null | null | null | cirq/contrib/qcircuit/qcircuit_diagram_info_test.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 36.5 | 74 | 0.662772 |
178e8362863742bac4cedb70e932b5ea5e0ee1b2 | 311 | py | Python | dev/modules/physics/continuum_mechanics/beam_problems-10.py | oscarbenjamin/sympy_doc | a31c46735370f4ed24540d020791cacc598d5a51 | [
"BSD-3-Clause"
] | null | null | null | dev/modules/physics/continuum_mechanics/beam_problems-10.py | oscarbenjamin/sympy_doc | a31c46735370f4ed24540d020791cacc598d5a51 | [
"BSD-3-Clause"
] | null | null | null | dev/modules/physics/continuum_mechanics/beam_problems-10.py | oscarbenjamin/sympy_doc | a31c46735370f4ed24540d020791cacc598d5a51 | [
"BSD-3-Clause"
] | null | null | null | b.shear_force()
# -1 0 1 -1 1 0
# - 258⋅<x> + 52⋅<x> - 8⋅<x> + 50⋅<x - 5> + 8⋅<x - 5> - 12⋅<x - 9>
b.bending_moment()
# 0 1 2 0 2 1
# - 258⋅<x> + 52⋅<x> - 4⋅<x> + 50⋅<x - 5> + 4⋅<x - 5> - 12⋅<x - 9>
| 44.428571 | 73 | 0.254019 |
b6c8ebb15bf1b63d7bb88adf83898974335b624b | 8,438 | py | Python | scripts/lib/wic/plugins/source/syslinux-alix.py | klihub/meta-alix | 46853c83c0bde12053a8d6288e1a038363448d38 | [
"MIT"
] | 2 | 2017-11-13T21:00:40.000Z | 2017-11-16T18:57:57.000Z | scripts/lib/wic/plugins/source/syslinux-alix.py | klihub/meta-alix | 46853c83c0bde12053a8d6288e1a038363448d38 | [
"MIT"
] | null | null | null | scripts/lib/wic/plugins/source/syslinux-alix.py | klihub/meta-alix | 46853c83c0bde12053a8d6288e1a038363448d38 | [
"MIT"
] | null | null | null | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (c) 2014, Intel Corporation.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free ... | 37.336283 | 80 | 0.600261 |
c38d932a0d7ecf237713c5d98a75847860b4d280 | 160 | py | Python | thumt/utils/sample.py | Demon-JieHao/Modeling-Structure-for-Transformer-Network | 329831964731ccb7361b847e0ff7c2d809ab7231 | [
"BSD-3-Clause"
] | 145 | 2018-12-03T05:47:26.000Z | 2022-02-25T07:55:52.000Z | thumt/utils/sample.py | Demon-JieHao/Modeling-Structure-for-Transformer-Network | 329831964731ccb7361b847e0ff7c2d809ab7231 | [
"BSD-3-Clause"
] | 11 | 2018-12-03T06:03:25.000Z | 2021-11-16T12:18:59.000Z | thumt/utils/sample.py | Demon-JieHao/Modeling-Structure-for-Transformer-Network | 329831964731ccb7361b847e0ff7c2d809ab7231 | [
"BSD-3-Clause"
] | 24 | 2018-12-16T08:42:38.000Z | 2021-07-13T04:08:47.000Z | # coding=utf-8
# Copyright 2018 The THUMT Authors
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
| 22.857143 | 38 | 0.84375 |
97c89c2dc27e82259fa6e9e4e2eaa156893e3c96 | 4,622 | py | Python | tests/pytracer/spectral/test_spectral.py | zjiayao/pyTracer | c2b4ef299ecbdca1c519059488f7cd2438943ee4 | [
"MIT"
] | 9 | 2017-11-20T18:17:27.000Z | 2022-01-27T23:00:31.000Z | tests/pytracer/spectral/test_spectral.py | zjiayao/pyTracer | c2b4ef299ecbdca1c519059488f7cd2438943ee4 | [
"MIT"
] | 4 | 2021-06-08T19:03:51.000Z | 2022-03-11T23:18:44.000Z | tests/pytracer/spectral/test_spectral.py | zjiayao/pyTracer | c2b4ef299ecbdca1c519059488f7cd2438943ee4 | [
"MIT"
] | 1 | 2017-11-20T22:48:01.000Z | 2017-11-20T22:48:01.000Z | """
test_spectral.py
A test script that (roughly) test
the implementation of various classes
Created by Jiayao on 15 Aug, 2017
"""
from __future__ import absolute_import
import numpy as np
from numpy.testing import assert_array_almost_equal
import pytest
from pytracer.spectral.spectrum import (xyz2rgb, rgb2xyz, Spec... | 25.119565 | 116 | 0.684119 |
e22937ab818d642c94ae0cde9de0472fc19c7e28 | 658 | py | Python | esphome/components/as3935_i2c/__init__.py | huhuhugo1/esphome | eb895d2095861a4d51f1a5fcd582a97389c27b4f | [
"MIT"
] | null | null | null | esphome/components/as3935_i2c/__init__.py | huhuhugo1/esphome | eb895d2095861a4d51f1a5fcd582a97389c27b4f | [
"MIT"
] | null | null | null | esphome/components/as3935_i2c/__init__.py | huhuhugo1/esphome | eb895d2095861a4d51f1a5fcd582a97389c27b4f | [
"MIT"
] | null | null | null | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import as3935, i2c
from esphome.const import CONF_ID
AUTO_LOAD = ['as3935']
DEPENDENCIES = ['i2c']
as3935_i2c_ns = cg.esphome_ns.namespace('as3935_i2c')
I2CAS3935 = as3935_i2c_ns.class_('I2CAS3935Component', as3935.AS3935, i2c... | 31.333333 | 84 | 0.778116 |
28d430ae2909bba60e4acb342356c4641a19e7f8 | 19,541 | py | Python | torchio/transforms/transform.py | searobbersduck/torchio | 67f9e0d19cefa98d5efed9c3f712ae6e3d8af791 | [
"Apache-2.0"
] | 1 | 2021-04-29T05:08:58.000Z | 2021-04-29T05:08:58.000Z | torchio/transforms/transform.py | searobbersduck/torchio | 67f9e0d19cefa98d5efed9c3f712ae6e3d8af791 | [
"Apache-2.0"
] | null | null | null | torchio/transforms/transform.py | searobbersduck/torchio | 67f9e0d19cefa98d5efed9c3f712ae6e3d8af791 | [
"Apache-2.0"
] | null | null | null | import copy
import numbers
import warnings
from abc import ABC, abstractmethod
from contextlib import contextmanager
from typing import Union, Tuple, Optional, Dict
import torch
import numpy as np
import SimpleITK as sitk
from ..utils import to_tuple
from ..data.subject import Subject
from ..data.io import nib_to_sit... | 39.961145 | 85 | 0.591116 |
8ac97637073b5038f3c9453a6c1e7e581d9602b6 | 10,344 | py | Python | docs/examples/use_cases/tensorflow/resnet-n/nvutils/runner.py | L-Net-1992/DALI | 982224d8b53e1156ae092f73f5a7d600982a1eb9 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2022-02-17T19:54:05.000Z | 2022-02-17T19:54:08.000Z | docs/examples/use_cases/tensorflow/resnet-n/nvutils/runner.py | L-Net-1992/DALI | 982224d8b53e1156ae092f73f5a7d600982a1eb9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | docs/examples/use_cases/tensorflow/resnet-n/nvutils/runner.py | L-Net-1992/DALI | 982224d8b53e1156ae092f73f5a7d600982a1eb9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 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
#
# Unle... | 40.564706 | 95 | 0.70901 |
1e47f8e2697ec00ec8eabb0cc8739024b54f09b2 | 3,371 | py | Python | experiments/decision_tree.py | brenowca/comp-263-essay-on-explainability | 1c7024ed77eaec5d4bea2e9626084a5cd15b13a2 | [
"MIT"
] | null | null | null | experiments/decision_tree.py | brenowca/comp-263-essay-on-explainability | 1c7024ed77eaec5d4bea2e9626084a5cd15b13a2 | [
"MIT"
] | null | null | null | experiments/decision_tree.py | brenowca/comp-263-essay-on-explainability | 1c7024ed77eaec5d4bea2e9626084a5cd15b13a2 | [
"MIT"
] | null | null | null | """
Here we describe experiments with both "vanilla" decision trees and state of the art decision tree settings for the
CIFAR 10 dataset.
"""
import torch
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import numpy as np
from sklearn import tree
from sklearn.metrics im... | 35.114583 | 138 | 0.694453 |
408952df71d6d29b621a43f71bc1b402367ff9f3 | 5,340 | py | Python | src/gtk3-libhandy/leaflet/LeafletsSync.py | alexandrebarbaruiva/gui-python-gtk | 7b8e8ab05645271ae55e1e2165eefc9c8f5b0250 | [
"MIT"
] | 42 | 2020-05-09T16:23:23.000Z | 2022-03-28T13:05:32.000Z | src/gtk3-libhandy/leaflet/LeafletsSync.py | alexandrebarbaruiva/gui-python-gtk | 7b8e8ab05645271ae55e1e2165eefc9c8f5b0250 | [
"MIT"
] | 2 | 2020-05-27T19:23:54.000Z | 2022-03-08T01:42:59.000Z | src/gtk3-libhandy/leaflet/LeafletsSync.py | alexandrebarbaruiva/gui-python-gtk | 7b8e8ab05645271ae55e1e2165eefc9c8f5b0250 | [
"MIT"
] | 8 | 2020-05-09T16:23:28.000Z | 2022-03-31T22:44:45.000Z | # -*- coding: utf-8 -*-
"""Handy.Leaflet() sync."""
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Handy', '1')
from gi.repository import Gtk, Gio, GObject
from gi.repository import Handy
class MainWindow(Gtk.ApplicationWindow):
def __init__(self, **kwargs):
super().__init__(**kwargs)
... | 33.797468 | 80 | 0.657491 |
64779b0b04c368bf3e472aa79e1cecc180ed24cf | 1,370 | py | Python | pkg/workloads/cortex/lib/model/__init__.py | ourobouros/cortex | 1b3aaf909816b93f6a6e3edd0da8c10891e05be9 | [
"Apache-2.0"
] | 1 | 2022-02-23T08:45:19.000Z | 2022-02-23T08:45:19.000Z | pkg/workloads/cortex/lib/model/__init__.py | ourobouros/cortex | 1b3aaf909816b93f6a6e3edd0da8c10891e05be9 | [
"Apache-2.0"
] | null | null | null | pkg/workloads/cortex/lib/model/__init__.py | ourobouros/cortex | 1b3aaf909816b93f6a6e3edd0da8c10891e05be9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Cortex Labs, 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 wri... | 34.25 | 97 | 0.783212 |
9410f10d9938d94a04b8128c2bdf8752bca49d8e | 6,368 | py | Python | Python/kth-largest-element-in-a-stream.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2022-01-30T06:55:28.000Z | 2022-01-30T06:55:28.000Z | Python/kth-largest-element-in-a-stream.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | null | null | null | Python/kth-largest-element-in-a-stream.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2021-12-31T03:56:39.000Z | 2021-12-31T03:56:39.000Z | '''
Design a class to find the kth largest element in a stream. Note that it is the kth largest element
in the sorted order, not the kth distinct element.
Your KthLargest class will have a constructor which accepts an integer k and an integer array nums,
which contains initial elements from the stream. For each call t... | 30.4689 | 127 | 0.564856 |
2aa02674fef9b6f3802a50d2b1184c95701917f4 | 378 | py | Python | include/build/toolchain/get_default_posix_goma_dir.py | jackz314/libgestures | 7a91f7cba9f0c5b6abde2f2b887bb7c6b70a6245 | [
"BSD-3-Clause"
] | 19 | 2015-02-19T21:08:27.000Z | 2021-11-19T07:16:49.000Z | include/build/toolchain/get_default_posix_goma_dir.py | jackz314/libgestures | 7a91f7cba9f0c5b6abde2f2b887bb7c6b70a6245 | [
"BSD-3-Clause"
] | 8 | 2015-08-31T06:39:59.000Z | 2021-12-04T14:53:28.000Z | include/build/toolchain/get_default_posix_goma_dir.py | jackz314/libgestures | 7a91f7cba9f0c5b6abde2f2b887bb7c6b70a6245 | [
"BSD-3-Clause"
] | 10 | 2015-08-28T16:44:03.000Z | 2019-07-17T17:37:34.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script returns the default goma directory for Posix systems, which is
# relative to the user's home directory. On Windows, goma.gypi hardcodes a
# val... | 31.5 | 76 | 0.740741 |
afbef633996920f3ac5eb60521b9f78082a4430d | 146 | py | Python | website-backend/ava/test.py | kbladin/ava-capture | 2fc24f4a3712f721c3a229b499631e00697209a5 | [
"BSD-3-Clause"
] | 49 | 2017-08-18T15:25:09.000Z | 2022-02-20T19:07:00.000Z | website-backend/ava/test.py | kbladin/ava-capture | 2fc24f4a3712f721c3a229b499631e00697209a5 | [
"BSD-3-Clause"
] | 50 | 2021-11-07T18:24:34.000Z | 2022-03-19T01:16:48.000Z | website-backend/ava/test.py | samqws-marketing/electronicarts_ava-capture | a04e5f9a7ee817317d0d58ce800eefc6bf4bd150 | [
"BSD-3-Clause"
] | 13 | 2017-12-04T19:33:20.000Z | 2021-07-17T02:17:00.000Z |
# testing django
def application(env, start_response):
start_response('200 OK', [('Content-type', 'text/html')])
return ["hello prod!"]
| 20.857143 | 61 | 0.664384 |
094a25dde0496034c5b57c6b5ef09119e497817f | 146 | py | Python | geolocation/types/__init__.py | sourcerer0/geolocation | 21a2932e7d85897344f4a78c429f6c06691272f0 | [
"Apache-2.0"
] | 2 | 2021-04-16T16:42:23.000Z | 2021-06-17T09:45:51.000Z | geolocation/types/__init__.py | sourcerer0/geolocation | 21a2932e7d85897344f4a78c429f6c06691272f0 | [
"Apache-2.0"
] | 13 | 2021-03-30T22:14:36.000Z | 2022-03-04T23:36:15.000Z | geolocation/types/__init__.py | sourcerer0/geolocation | 21a2932e7d85897344f4a78c429f6c06691272f0 | [
"Apache-2.0"
] | null | null | null | from geolocation.types.coordinate import Coordinate
from geolocation.types.files import ReadOnlyFile
from geolocation.types.address import Address | 48.666667 | 51 | 0.883562 |
f4cab85c71ffeb99fa70dc2e9480e064f81de1ea | 127,795 | py | Python | src/transformers/tokenization_utils_base.py | poudro/transformers | b6b2f2270fe6c32852fc1b887afe354b7b79d18c | [
"Apache-2.0"
] | null | null | null | src/transformers/tokenization_utils_base.py | poudro/transformers | b6b2f2270fe6c32852fc1b887afe354b7b79d18c | [
"Apache-2.0"
] | null | null | null | src/transformers/tokenization_utils_base.py | poudro/transformers | b6b2f2270fe6c32852fc1b887afe354b7b79d18c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... | 47.436897 | 252 | 0.625361 |
b3a2b4779fc1bc0d6eeecf244571feca2ea6cb63 | 6,113 | py | Python | benchmarks/f3_wrong_hints/scaling_nonlinear_software/5-19_18.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_nonlinear_software/5-19_18.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_nonlinear_software/5-19_18.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 33.587912 | 78 | 0.50777 |
369160cc5ed10563874c306801da38068d1d0228 | 2,496 | py | Python | setup.py | barslmn/django-genome | bba8f5dd8795ebfa70ec8633cee01d7e9c0502c6 | [
"MIT"
] | 10 | 2018-03-07T09:40:55.000Z | 2022-01-24T12:31:30.000Z | setup.py | barslmn/django-genome | bba8f5dd8795ebfa70ec8633cee01d7e9c0502c6 | [
"MIT"
] | 236 | 2017-12-30T14:59:15.000Z | 2022-03-29T14:45:09.000Z | setup.py | barslmn/django-genome | bba8f5dd8795ebfa70ec8633cee01d7e9c0502c6 | [
"MIT"
] | 1 | 2021-01-18T09:48:43.000Z | 2021-01-18T09:48:43.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def get_version(*file_paths):
"""Retrieves the version from genome/__init__.py"""
filename = os.path.join(os.path.dirname(__file__), *fil... | 30.439024 | 85 | 0.625801 |
edcdc1296013bcf2b88d383a5bf1a95fb1d4c9eb | 2,509 | py | Python | data/p4VQE/R4/benchmark/startQiskit_QC41.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_QC41.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_QC41.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=9
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collection... | 27.271739 | 118 | 0.634516 |
87222aa805c7555a19dc95696014105de54a2a64 | 2,343 | py | Python | examples/exm2_mpl.py | opetlund/TMM4135-CALFEM | e15621a6fec3bef7f07cfbc9abb80ad10551d6d0 | [
"MIT"
] | null | null | null | examples/exm2_mpl.py | opetlund/TMM4135-CALFEM | e15621a6fec3bef7f07cfbc9abb80ad10551d6d0 | [
"MIT"
] | null | null | null | examples/exm2_mpl.py | opetlund/TMM4135-CALFEM | e15621a6fec3bef7f07cfbc9abb80ad10551d6d0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Example 02
Creating geometry from B-Splines and circle arcs.
Also shows how to set ID numbers for geometry entities and how to specify element density.
'''
import matplotlib.pyplot as plt
import matplotlib.collections
import numpy as np
import calfem.geometry as cfg
import calfem.mesh as... | 22.747573 | 98 | 0.624413 |
418c91eefdb42d8d6d224ad598479d7d452c2dc2 | 8,579 | py | Python | ydr/operators.py | Markus1812/Sollumz | 8d407bd04e47b5f1869930093ee7583b4e4fd3bf | [
"MIT"
] | 1 | 2022-02-10T20:50:20.000Z | 2022-02-10T20:50:20.000Z | ydr/operators.py | Markus1812/Sollumz | 8d407bd04e47b5f1869930093ee7583b4e4fd3bf | [
"MIT"
] | null | null | null | ydr/operators.py | Markus1812/Sollumz | 8d407bd04e47b5f1869930093ee7583b4e4fd3bf | [
"MIT"
] | null | null | null | from ..sollumz_helper import SOLLUMZ_OT_base
from ..sollumz_properties import SOLLUMZ_UI_NAMES, LightType, SollumType, TimeFlags
from ..sollumz_operators import SelectTimeFlagsRange, ClearTimeFlags
from ..ydr.shader_materials import create_shader, create_tinted_shader_graph, shadermats
from ..tools.drawablehelper impor... | 36.198312 | 147 | 0.653689 |
940d9d10e10bd5ff5b1a1aef1da95c705a854a4a | 597 | py | Python | src/gazebo_server/__init__.py | mvukov/gazebo_server | e1a30fee043e14a31ca5a70d441f375d155f9a65 | [
"Apache-2.0"
] | null | null | null | src/gazebo_server/__init__.py | mvukov/gazebo_server | e1a30fee043e14a31ca5a70d441f375d155f9a65 | [
"Apache-2.0"
] | null | null | null | src/gazebo_server/__init__.py | mvukov/gazebo_server | e1a30fee043e14a31ca5a70d441f375d155f9a65 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Milan Vukov. 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 ... | 42.642857 | 74 | 0.763819 |
aaade5219f9d2ad2ff7a0b1fdf63f708214082b1 | 1,163 | py | Python | deprecated_examples/affect/humor_early_fusion.py | TianhaoFu/MultiBench | b174a3187124d6f92be1ff3b487eef292f7883bb | [
"MIT"
] | null | null | null | deprecated_examples/affect/humor_early_fusion.py | TianhaoFu/MultiBench | b174a3187124d6f92be1ff3b487eef292f7883bb | [
"MIT"
] | null | null | null | deprecated_examples/affect/humor_early_fusion.py | TianhaoFu/MultiBench | b174a3187124d6f92be1ff3b487eef292f7883bb | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.getcwd())
import torch
from training_structures.Simple_Early_Fusion import train, test
from fusions.common_fusions import ConcatEarly
from get_data import get_dataloader
from unimodals.common_models import GRU, MLP
traindata, validdata, testdata = get_dataloader('../affect/pro... | 33.228571 | 91 | 0.750645 |
043c34967b0578fa10c25bbf8dfbbcdc1521ef74 | 1,305 | py | Python | monk/system_unit_tests/keras/test_layer_max_pooling1d.py | Shreyashwaghe/monk_v1 | 4ee4d9483e8ffac9b73a41f3c378e5abf5fc799b | [
"Apache-2.0"
] | 7 | 2020-07-26T08:37:29.000Z | 2020-10-30T10:23:11.000Z | monk/system_unit_tests/keras/test_layer_max_pooling1d.py | mursalfk/monk_v1 | 62f34a52f242772186ffff7e56764e958fbcd920 | [
"Apache-2.0"
] | null | null | null | monk/system_unit_tests/keras/test_layer_max_pooling1d.py | mursalfk/monk_v1 | 62f34a52f242772186ffff7e56764e958fbcd920 | [
"Apache-2.0"
] | 1 | 2020-10-07T12:57:44.000Z | 2020-10-07T12:57:44.000Z | import os
import sys
sys.path.append("../../../monk/");
import psutil
from keras_prototype import prototype
from compare_prototype import compare
from common import print_start
from common import print_status
import tensorflow as tf
import numpy as np
def test_layer_max_pooling1d(system_dict):
forward = True;
... | 27.765957 | 76 | 0.629885 |
8ab4ecd28e5704c59249a66883d3c3faca1bbd59 | 4,018 | py | Python | data_integration/logging/system_statistics.py | ierosodin/data-integration | f3ee414e8b8994e5b740a374c0594e40862ff6e9 | [
"MIT"
] | null | null | null | data_integration/logging/system_statistics.py | ierosodin/data-integration | f3ee414e8b8994e5b740a374c0594e40862ff6e9 | [
"MIT"
] | null | null | null | data_integration/logging/system_statistics.py | ierosodin/data-integration | f3ee414e8b8994e5b740a374c0594e40862ff6e9 | [
"MIT"
] | null | null | null | """Generation of system statistics events (cpu, io, net, ram)"""
import datetime
import multiprocessing
import time
from .. import config
from ..logging import events
class SystemStatistics(events.Event):
def __init__(self, timestamp: datetime.datetime, *, disc_read: float = None, disc_write: float = None,
... | 37.90566 | 106 | 0.655301 |
3f22d26e98dcf9da820b534beabdb31416905645 | 253 | py | Python | sample_app/manage.py | cpersico/django-objectcounters | 695e61d07ec4a07dea45164a876288b7bad30cea | [
"BSD-3-Clause"
] | null | null | null | sample_app/manage.py | cpersico/django-objectcounters | 695e61d07ec4a07dea45164a876288b7bad30cea | [
"BSD-3-Clause"
] | null | null | null | sample_app/manage.py | cpersico/django-objectcounters | 695e61d07ec4a07dea45164a876288b7bad30cea | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sample_app.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23 | 74 | 0.774704 |
caa9c7f3a746d782ab10c84b81995f2e87199da6 | 111 | py | Python | go_space/go_types/action_lib.py | gaffney2010/go-space | 928a743ce913dec30db5226fb4588e056128725e | [
"Apache-2.0"
] | null | null | null | go_space/go_types/action_lib.py | gaffney2010/go-space | 928a743ce913dec30db5226fb4588e056128725e | [
"Apache-2.0"
] | null | null | null | go_space/go_types/action_lib.py | gaffney2010/go-space | 928a743ce913dec30db5226fb4588e056128725e | [
"Apache-2.0"
] | null | null | null | import enum
class Action(enum.Enum):
ACK = 1
# Should remove this chonk now, it's dead.
KILL = 2
| 13.875 | 46 | 0.621622 |
b4d51f6d1a0c59749e7feb27e427b53eb1b7b0da | 2,388 | py | Python | tensorflow_datasets/summarization/cnn_dailymail_test.py | daniel-trejobanos/tf-ds-321 | e3f5b1771a176dc552c3a99f51f3a5ffbe105852 | [
"Apache-2.0"
] | 2 | 2020-10-12T07:09:38.000Z | 2021-03-05T12:48:23.000Z | tensorflow_datasets/summarization/cnn_dailymail_test.py | javierespinozat/datasets | 1465d97b2e8b2a030f5df7872e8390b90dba8926 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/summarization/cnn_dailymail_test.py | javierespinozat/datasets | 1465d97b2e8b2a030f5df7872e8390b90dba8926 | [
"Apache-2.0"
] | 1 | 2021-06-30T17:45:23.000Z | 2021-06-30T17:45:23.000Z | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 30.615385 | 80 | 0.688023 |
6c3aca7eddba39e30b9cac64b77985cb75f9243d | 25,506 | py | Python | src/compas_fea/fea/steps.py | franaudo/fea | e164256bac179116520d19d6fc54c98de0610896 | [
"MIT"
] | null | null | null | src/compas_fea/fea/steps.py | franaudo/fea | e164256bac179116520d19d6fc54c98de0610896 | [
"MIT"
] | null | null | null | src/compas_fea/fea/steps.py | franaudo/fea | e164256bac179116520d19d6fc54c98de0610896 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import json
# Author(s): Andrew Liew (github.com/andrewliew)
__all__ = [
'Steps',
]
dofs = ['x', 'y', 'z', 'xx', 'yy', 'zz']
class Steps(object):
def __init__(self):
pass
de... | 39.728972 | 119 | 0.336117 |
96c38e7386656952066f8d84052dad78df7a5579 | 2,084 | py | Python | examples/ad_manager/v201811/base_rate_service/create_product_base_rates.py | beamc83/python-googleads | 6039d08e2d85850a46a70f24359d362ffde2f7ed | [
"Apache-2.0"
] | 2 | 2019-07-11T13:01:56.000Z | 2019-07-11T13:01:58.000Z | examples/ad_manager/v201811/base_rate_service/create_product_base_rates.py | SoungMo/googleads-python-lib | fe86335c416e0571328c0a481c4b0cff863c01d9 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201811/base_rate_service/create_product_base_rates.py | SoungMo/googleads-python-lib | fe86335c416e0571328c0a481c4b0cff863c01d9 | [
"Apache-2.0"
] | 1 | 2020-07-19T14:24:05.000Z | 2020-07-19T14:24:05.000Z | #!/usr/bin/env python
#
# Copyright 2015 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 requir... | 31.575758 | 74 | 0.692898 |
656dade1b443384639d630f4e3ead902587fb4bb | 188 | py | Python | btcdet/models/backbones_3d/vfe/__init__.py | collector-m/BtcDet | 80bee34f2f40931600f812a6edbcb27e51cb7ec3 | [
"Apache-2.0"
] | 108 | 2021-12-03T09:42:32.000Z | 2022-03-30T03:22:13.000Z | btcdet/models/backbones_3d/vfe/__init__.py | collector-m/BtcDet | 80bee34f2f40931600f812a6edbcb27e51cb7ec3 | [
"Apache-2.0"
] | 22 | 2021-12-07T17:20:00.000Z | 2022-03-27T18:28:59.000Z | btcdet/models/backbones_3d/vfe/__init__.py | collector-m/BtcDet | 80bee34f2f40931600f812a6edbcb27e51cb7ec3 | [
"Apache-2.0"
] | 14 | 2021-12-07T03:37:59.000Z | 2022-03-29T03:35:47.000Z | from .mean_vfe import MeanVFE
from .occ_vfe import OccVFE
from .vfe_template import VFETemplate
__all__ = {
'VFETemplate': VFETemplate,
'MeanVFE': MeanVFE,
'OccVFE': OccVFE
}
| 18.8 | 37 | 0.723404 |
8bc4bf699d50d44b3e1a28eb6f0040b89be60923 | 3,352 | py | Python | neutron/extensions/extra_dhcp_opt.py | glove747/liberty-neutron | 35a4c85e781d10da4521565c3a367e4ecb50739d | [
"Apache-2.0"
] | null | null | null | neutron/extensions/extra_dhcp_opt.py | glove747/liberty-neutron | 35a4c85e781d10da4521565c3a367e4ecb50739d | [
"Apache-2.0"
] | null | null | null | neutron/extensions/extra_dhcp_opt.py | glove747/liberty-neutron | 35a4c85e781d10da4521565c3a367e4ecb50739d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 30.472727 | 75 | 0.648866 |
e46503d760967575d0d9e89a2960b2efbdbd3b81 | 7,199 | py | Python | selfdrive/controls/lib/driver_monitor.py | cron410/openpilot | 9d1201882fd9b97341de736a6f931b0caf50aeb5 | [
"MIT"
] | null | null | null | selfdrive/controls/lib/driver_monitor.py | cron410/openpilot | 9d1201882fd9b97341de736a6f931b0caf50aeb5 | [
"MIT"
] | null | null | null | selfdrive/controls/lib/driver_monitor.py | cron410/openpilot | 9d1201882fd9b97341de736a6f931b0caf50aeb5 | [
"MIT"
] | null | null | null | import numpy as np
from common.realtime import sec_since_boot
from selfdrive.controls.lib.drive_helpers import create_event, EventTypes as ET
from common.filter_simple import FirstOrderFilter
import selfdrive.kegman_conf as kegman
_DT = 0.01 # update runs at 100Hz
_DTM = 0.1 # DM runs... | 40.672316 | 154 | 0.733296 |
7b3c93fb88b7e3b0c633243bb58650d1925c634a | 241 | py | Python | .history/my_classes/basic/for_loop_20210430195415.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/basic/for_loop_20210430195415.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/basic/for_loop_20210430195415.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | i = 0
while i < 5:
print(i)
i += 1
i = None # 0
# 1
# 2
# 3
# 4
for i in range(5):
print(i) # 0
# 1
# 2
# 3
# 4 | 14.176471 | 20 | 0.207469 |
0e152e4024b7a74f88791641cfa41754e6d4970f | 8,681 | py | Python | tests/notifier/notifier_test.py | perambulist/forseti-security | 5b87bc536f3d33fdeaa0c2a1f20eea3f56c79060 | [
"Apache-2.0"
] | 1 | 2018-10-06T23:16:59.000Z | 2018-10-06T23:16:59.000Z | tests/notifier/notifier_test.py | perambulist/forseti-security | 5b87bc536f3d33fdeaa0c2a1f20eea3f56c79060 | [
"Apache-2.0"
] | null | null | null | tests/notifier/notifier_test.py | perambulist/forseti-security | 5b87bc536f3d33fdeaa0c2a1f20eea3f56c79060 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security 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 ap... | 45.213542 | 97 | 0.718235 |
505b2bedcaa6d8b2b7546a376ac1fec47c1a7262 | 27,596 | py | Python | tools/conan/conans/client/manager.py | aversiveplusplus/aversiveplusplus | 5f5fe9faca50197fd6207e2c816efa7e9af6c804 | [
"BSD-3-Clause"
] | 29 | 2016-01-27T09:43:44.000Z | 2020-03-12T04:16:02.000Z | tools/conan/conans/client/manager.py | aversiveplusplus/aversiveplusplus | 5f5fe9faca50197fd6207e2c816efa7e9af6c804 | [
"BSD-3-Clause"
] | 20 | 2016-01-22T15:59:33.000Z | 2016-10-28T10:22:45.000Z | tools/conan/conans/client/manager.py | aversiveplusplus/aversiveplusplus | 5f5fe9faca50197fd6207e2c816efa7e9af6c804 | [
"BSD-3-Clause"
] | 6 | 2016-02-11T14:09:04.000Z | 2018-03-17T00:18:35.000Z | import os
import time
from collections import OrderedDict
from conans.paths import (CONANFILE, CONANINFO, CONANFILE_TXT, BUILD_INFO, CONANENV)
from conans.client.loader import ConanFileLoader
from conans.client.export import export_conanfile
from conans.client.deps_builder import DepsBuilder
from conans.client.userio ... | 50.542125 | 99 | 0.648282 |
c873f3d9458fa2eb40491f0582969e3c472218be | 7,141 | py | Python | examples/python_scripts/plot_sf_and_necr.py | kamilrakoczy/j-pet-gate-tools | 0bd40b42dd333d742f34f9c2134737bfd5612281 | [
"Apache-2.0"
] | 2 | 2019-01-29T15:11:07.000Z | 2020-07-28T21:51:35.000Z | examples/python_scripts/plot_sf_and_necr.py | kamilrakoczy/j-pet-gate-tools | 0bd40b42dd333d742f34f9c2134737bfd5612281 | [
"Apache-2.0"
] | 15 | 2017-07-05T08:15:46.000Z | 2022-02-02T01:32:10.000Z | examples/python_scripts/plot_sf_and_necr.py | kamilrakoczy/j-pet-gate-tools | 0bd40b42dd333d742f34f9c2134737bfd5612281 | [
"Apache-2.0"
] | 11 | 2017-06-27T06:40:11.000Z | 2022-01-02T16:00:19.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt2
from numpy import *
from scipy import interpolate
from matplotlib import rcParams, rcParamsDefault
import argparse
from nema_common import *
outputformat = ""
def plot_rates(geometry,float_activity,N_true,... | 31.45815 | 122 | 0.622462 |
3624dcc70fad1fe3bc52c117811fb6ebf7980d4b | 93 | py | Python | pymt_heatc/lib/__init__.py | mdpiper/pymt-heatc | 4492bd0ed967f09fc9979d273c48f8d912ff966f | [
"MIT"
] | null | null | null | pymt_heatc/lib/__init__.py | mdpiper/pymt-heatc | 4492bd0ed967f09fc9979d273c48f8d912ff966f | [
"MIT"
] | 1 | 2021-09-01T20:37:33.000Z | 2021-09-01T20:38:24.000Z | pymt_heatc/lib/__init__.py | mdpiper/pymt_heatc | 4492bd0ed967f09fc9979d273c48f8d912ff966f | [
"MIT"
] | null | null | null | #! /usr/bin/env python
from .heatmodelc import HeatModelC
__all__ = [
"HeatModelC",
]
| 10.333333 | 34 | 0.666667 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.