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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2d09d10838cadfefbbcfa8cf8df881bb3dadde80 | 67,417 | py | Python | capstone-project/Q-learning-cart.py | marcionicolau/personal_mle | 00510e2c275835d006c5794cf65d8a31ebab921c | [
"MIT"
] | null | null | null | capstone-project/Q-learning-cart.py | marcionicolau/personal_mle | 00510e2c275835d006c5794cf65d8a31ebab921c | [
"MIT"
] | null | null | null | capstone-project/Q-learning-cart.py | marcionicolau/personal_mle | 00510e2c275835d006c5794cf65d8a31ebab921c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Deep $Q$-learning
#
# In this notebook, we'll build a neural network that can learn to play games through reinforcement learning. More specifically, we'll use $Q$-learning to train an agent to play a game called [Cart-Pole](https://gym.openai.com/envs/CartPole-v0). In this ga... | 61.176951 | 408 | 0.725766 |
9b57ca29b73179c1cb29363de366b8f4d93c6230 | 2,684 | py | Python | libspn_keras/layers/spatial_to_regions.py | twebr/libspn-keras | b5f107899795634f011b0e0bfedce182c0e87568 | [
"MIT"
] | 45 | 2020-02-23T22:01:13.000Z | 2021-09-10T19:24:40.000Z | libspn_keras/layers/spatial_to_regions.py | twebr/libspn-keras | b5f107899795634f011b0e0bfedce182c0e87568 | [
"MIT"
] | 16 | 2020-03-12T06:12:44.000Z | 2022-01-19T19:44:33.000Z | libspn_keras/layers/spatial_to_regions.py | twebr/libspn-keras | b5f107899795634f011b0e0bfedce182c0e87568 | [
"MIT"
] | 9 | 2020-02-24T13:06:16.000Z | 2021-11-09T22:59:32.000Z | from typing import Optional
from typing import Tuple
import tensorflow as tf
from tensorflow import keras
class SpatialToRegions(keras.layers.Layer):
"""
Reshapes spatial SPN layer to a dense layer.
The dense output has leading dimensions for scopes and decomps (which will be ``[1, 1]``).
"""
d... | 33.135802 | 94 | 0.616617 |
eb02b7a5acfe49973df065f6e07d325d5c394c40 | 4,608 | py | Python | scripts/video.py | smxsm/facerec | a70a5f168b36dbc042cc2d9d433900c65a3db65b | [
"Apache-2.0"
] | null | null | null | scripts/video.py | smxsm/facerec | a70a5f168b36dbc042cc2d9d433900c65a3db65b | [
"Apache-2.0"
] | null | null | null | scripts/video.py | smxsm/facerec | a70a5f168b36dbc042cc2d9d433900c65a3db65b | [
"Apache-2.0"
] | null | null | null | import face_recognition
import cv2
import os
import time
import imutils
from imutils.video import VideoStream
from imutils.video import FPS
# This is a demo of running face recognition on live video from your webcam. It's a little more complicated than the
# other example, but it includes some basic performance tweaks... | 40.069565 | 116 | 0.687066 |
8d7c237baa56a71961f7c17a8cca6654aa135362 | 12,694 | py | Python | tests/test_lib.py | git4satya/koleksyon | 966f3f6ea16a9c5c0bb12d2aec52c5c89e42090c | [
"MIT"
] | null | null | null | tests/test_lib.py | git4satya/koleksyon | 966f3f6ea16a9c5c0bb12d2aec52c5c89e42090c | [
"MIT"
] | null | null | null | tests/test_lib.py | git4satya/koleksyon | 966f3f6ea16a9c5c0bb12d2aec52c5c89e42090c | [
"MIT"
] | null | null | null | # the inclusion of the tests module is not meant to offer best practices for
# testing in general, but rather to support the `find_packages` example in
# setup.py that excludes installing the "tests" package
import unittest
import pandas as pd
import hashlib #should just be needed in testing to see if the contents o... | 45.335714 | 172 | 0.650544 |
f5c72c54a120771f77a4012c5850c64376b2d21c | 9,453 | py | Python | sdk/storage/azure-storage-queue/samples/queue_samples_message.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/storage/azure-storage-queue/samples/queue_samples_message.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-queue/samples/queue_samples_message.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # 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.
# --------------------------------------------------------------------... | 33.168421 | 102 | 0.602031 |
aedc65a505792ce89b7ef7e5b4ce9f9e0203a237 | 38,024 | py | Python | members/crm/migrations/0001_initial.py | ocwc/ocwc-members | 3ede8e0ff830e2aaff4ae09f9aaefd3eaa83146b | [
"MIT"
] | null | null | null | members/crm/migrations/0001_initial.py | ocwc/ocwc-members | 3ede8e0ff830e2aaff4ae09f9aaefd3eaa83146b | [
"MIT"
] | 7 | 2015-11-27T15:59:52.000Z | 2022-01-13T00:38:38.000Z | members/crm/migrations/0001_initial.py | ocwc/ocwc-members | 3ede8e0ff830e2aaff4ae09f9aaefd3eaa83146b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
operations = [
migrations.CreateModel(
... | 41.018339 | 169 | 0.381917 |
3d40537e043d125442bd81a1cedc883deca3e871 | 293 | py | Python | __init__.py | ponyatov/metaLpy | 96149313e8083536ade1c331825242f6996f05b3 | [
"MIT"
] | null | null | null | __init__.py | ponyatov/metaLpy | 96149313e8083536ade1c331825242f6996f05b3 | [
"MIT"
] | null | null | null | __init__.py | ponyatov/metaLpy | 96149313e8083536ade1c331825242f6996f05b3 | [
"MIT"
] | null | null | null | ## @file
## `metaL`: homoiconic interpreter engine
## (c) Dmitry Ponyatov <<dponyatov@gmail.com>> 2020 MIT
## * homoiconic interpreter engine
## * in-memory object graph database
## * interactive programming system
from .core import *
from .geo import *
from .gui import *
from .web import *
| 24.416667 | 55 | 0.716724 |
b0a79b256b1d75520f8e80e30cfa42a49a26fa40 | 1,396 | py | Python | pyfakefs/pytest_tests/pytest_plugin_test.py | pexip/os-python-pyfakefs | 72a3de0608582f4d25df0ff0528c5a45a5668443 | [
"Apache-2.0"
] | null | null | null | pyfakefs/pytest_tests/pytest_plugin_test.py | pexip/os-python-pyfakefs | 72a3de0608582f4d25df0ff0528c5a45a5668443 | [
"Apache-2.0"
] | null | null | null | pyfakefs/pytest_tests/pytest_plugin_test.py | pexip/os-python-pyfakefs | 72a3de0608582f4d25df0ff0528c5a45a5668443 | [
"Apache-2.0"
] | null | null | null | """Tests that the pytest plugin properly provides the "fs" fixture"""
import os
import tempfile
from pyfakefs.fake_filesystem_unittest import Pause
def test_fs_fixture(fs):
fs.create_file('/var/data/xx1.txt')
assert os.path.exists('/var/data/xx1.txt')
def test_pause_resume(fs):
fake_temp_f... | 34.9 | 70 | 0.725645 |
d0eaa43b0025c952520d763665a4e6d19899e070 | 13,177 | py | Python | gamestonk_terminal/fundamental_analysis/yahoo_finance_view.py | keshabb/GamestonkTerminal | a0acdfb13f806c35c82a7c4dc81ea98de52814e0 | [
"MIT"
] | null | null | null | gamestonk_terminal/fundamental_analysis/yahoo_finance_view.py | keshabb/GamestonkTerminal | a0acdfb13f806c35c82a7c4dc81ea98de52814e0 | [
"MIT"
] | 1 | 2022-02-10T06:49:37.000Z | 2022-02-10T06:49:37.000Z | gamestonk_terminal/fundamental_analysis/yahoo_finance_view.py | hcksystem/GamestonkTerminal | 7a8a4f868c548505c36287d16f969e80daeed431 | [
"MIT"
] | null | null | null | """ Yahoo Finance View """
__docformat__ = "numpy"
import argparse
from typing import List
from datetime import datetime
import webbrowser
import yfinance as yf
import pandas as pd
from gamestonk_terminal.fundamental_analysis.fa_helper import clean_df_index
from gamestonk_terminal.helper_funcs import (
long_numbe... | 35.138667 | 100 | 0.61319 |
ca55552d1e3f21bc82a50b25febed67e25d84010 | 3,338 | py | Python | pdc/apps/common/hacks.py | bliuredhat/PDC | 48c7761d360225d6f4073adc2e7938348844e909 | [
"MIT"
] | 1 | 2018-05-02T08:39:37.000Z | 2018-05-02T08:39:37.000Z | pdc/apps/common/hacks.py | bliuredhat/PDC | 48c7761d360225d6f4073adc2e7938348844e909 | [
"MIT"
] | null | null | null | pdc/apps/common/hacks.py | bliuredhat/PDC | 48c7761d360225d6f4073adc2e7938348844e909 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import re
from django.db import connection
from django.conf import settings
from django.core.exceptions import ValidationError
from rest_framework import serializers
from pkg_resources ... | 28.529915 | 105 | 0.645596 |
0edf8b5e9890c9048cbe436c9067d6876be2c29b | 389 | py | Python | travel/travel/wsgi.py | Neeraj2701/numpy | bbc3167427eb8ecafeee3c5c9606b3532405dd96 | [
"BSD-3-Clause"
] | null | null | null | travel/travel/wsgi.py | Neeraj2701/numpy | bbc3167427eb8ecafeee3c5c9606b3532405dd96 | [
"BSD-3-Clause"
] | null | null | null | travel/travel/wsgi.py | Neeraj2701/numpy | bbc3167427eb8ecafeee3c5c9606b3532405dd96 | [
"BSD-3-Clause"
] | null | null | null | """
WSGI config for travel project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
51898f56b60cd495c477ad270447f3714aa032c3 | 1,734 | py | Python | table.py | ZePedroResende/CC | 8644a518aeda3dc48f3e1c9700eff8b50b49b214 | [
"MIT"
] | 1 | 2021-04-06T13:44:41.000Z | 2021-04-06T13:44:41.000Z | table.py | ZePedroResende/CC | 8644a518aeda3dc48f3e1c9700eff8b50b49b214 | [
"MIT"
] | null | null | null | table.py | ZePedroResende/CC | 8644a518aeda3dc48f3e1c9700eff8b50b49b214 | [
"MIT"
] | null | null | null | import threading
class table:
def __init__(self):
self.server_list = {}
self.lock = threading.RLock()
def add_server(self, info):
with self.lock:
self.server_list[info['ip']] = info
def remove_server(self, server):
with self.lock:
del self.server_l... | 28.9 | 60 | 0.471165 |
62551cfc9cad599093e7245a3ce733e9df1a0edb | 855 | py | Python | var/spack/repos/builtin/packages/py-pythonqwt/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/py-pythonqwt/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/py-pythonqwt/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPythonqwt(PythonPackage):
"""Qt plotting widgets for Python"""
homepage = "https://... | 35.625 | 80 | 0.669006 |
a71feaac7ac5930f5cb3661ef5607610d8f5c9d0 | 4,031 | py | Python | main.py | nshttpd/gcf-bb-slack | 5e5a63076ef2b33cd19f450eb99d710f30f1d498 | [
"BSD-3-Clause"
] | null | null | null | main.py | nshttpd/gcf-bb-slack | 5e5a63076ef2b33cd19f450eb99d710f30f1d498 | [
"BSD-3-Clause"
] | 1 | 2018-11-28T16:40:29.000Z | 2018-11-28T16:40:29.000Z | main.py | nshttpd/gcf-bb-slack | 5e5a63076ef2b33cd19f450eb99d710f30f1d498 | [
"BSD-3-Clause"
] | null | null | null | #
# simple GCF to handle a BB Webhook to Slack Webhook. i.e. a Thunk layer.
#
from flask import abort
import hashlib
import hmac
import os
import json
import logging
from urllib import request
#
# Validate the request based on a shared secret signature based on the body
#
# https://confluence.atlassian.com/bitbucket... | 37.672897 | 157 | 0.577276 |
9ece7d7268cb3240737567b192484f343226bfc5 | 999 | py | Python | selfdrive/debug/get_fingerprint.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 85 | 2019-06-14T17:51:31.000Z | 2022-02-09T22:18:20.000Z | selfdrive/debug/get_fingerprint.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 4 | 2020-04-12T21:34:03.000Z | 2020-04-15T22:22:15.000Z | selfdrive/debug/get_fingerprint.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 73 | 2018-12-03T19:34:42.000Z | 2020-07-27T05:10:23.000Z | #!/usr/bin/env python3
# simple script to get a vehicle fingerprint.
# Instructions:
# - connect to a Panda
# - run selfdrive/boardd/boardd
# - launching this script
# - turn on the car in STOCK MODE (set giraffe switches properly).
# Note: it's very important that the car is in stock mode, in order to collect a co... | 33.3 | 103 | 0.700701 |
c57cdbb31754286f6171b33571f0a576ef502002 | 98 | py | Python | backend/init_db.py | daniilmotsniy/FinancialAssistantBot | 2ca965a0ccfb8da72500c3da8da34ed48405cbaa | [
"MIT"
] | 1 | 2022-01-28T14:58:24.000Z | 2022-01-28T14:58:24.000Z | backend/init_db.py | daniilmotsniy/FinancialAssistantBot | 2ca965a0ccfb8da72500c3da8da34ed48405cbaa | [
"MIT"
] | 9 | 2021-08-07T11:25:18.000Z | 2021-11-14T15:49:51.000Z | backend/init_db.py | daniilmotsniy/FinancialAssistantBot | 2ca965a0ccfb8da72500c3da8da34ed48405cbaa | [
"MIT"
] | null | null | null | from models.user import User, db
from models.assets import Asset, AssetTypes, db
db.create_all()
| 19.6 | 47 | 0.785714 |
b389e58be274f06c0803095e0dbc385d5cd39079 | 2,052 | py | Python | src/openbiolink/graph_creation/metadata_edge/edge/edgeMetaGeneBindInhGene.py | jerryhluo/OpenBioLink | 6fc073af978daec0b0db5938b73beed37f57f495 | [
"MIT"
] | 97 | 2019-11-26T09:53:18.000Z | 2022-03-19T10:33:10.000Z | src/openbiolink/graph_creation/metadata_edge/edge/edgeMetaGeneBindInhGene.py | jerryhluo/OpenBioLink | 6fc073af978daec0b0db5938b73beed37f57f495 | [
"MIT"
] | 67 | 2019-12-09T21:01:52.000Z | 2021-12-21T15:19:41.000Z | src/openbiolink/graph_creation/metadata_edge/edge/edgeMetaGeneBindInhGene.py | jerryhluo/OpenBioLink | 6fc073af978daec0b0db5938b73beed37f57f495 | [
"MIT"
] | 20 | 2020-01-13T23:02:25.000Z | 2022-03-16T21:43:31.000Z | import os
from openbiolink.graph_creation import graphCreationConfig as glob
from openbiolink.graph_creation.metadata_edge.edgeRegularMetadata import EdgeRegularMetadata
from openbiolink.graph_creation.metadata_infile import InMetaEdgeStringBindInh
from openbiolink.graph_creation.metadata_infile.mapping.inMetaMapStrin... | 45.6 | 94 | 0.75 |
049ebc0cc34c6f91fe4c60a882ee37e0bc753ca2 | 1,824 | py | Python | examples/point_cloud_example.py | foxglove/python-mcap-protobuf-support | ae325c9cbe49710fe397dff74939b5907b52aae9 | [
"Apache-2.0"
] | 1 | 2022-03-10T17:18:05.000Z | 2022-03-10T17:18:05.000Z | examples/point_cloud_example.py | foxglove/python-mcap-protobuf-support | ae325c9cbe49710fe397dff74939b5907b52aae9 | [
"Apache-2.0"
] | null | null | null | examples/point_cloud_example.py | foxglove/python-mcap-protobuf-support | ae325c9cbe49710fe397dff74939b5907b52aae9 | [
"Apache-2.0"
] | null | null | null | # This example writes a single point cloud message.
import os
import struct
import sys
from io import BytesIO
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import time
from random import random
from mcap.mcap0.writer import Writer as McapWriter
from mcap_protobuf.schema import register_schema
from ... | 26.057143 | 84 | 0.720395 |
c752feba56cb8418ab3f98a29841b195abb82735 | 2,151 | py | Python | tests/aggregate/test_backrefs.py | jd/sqlalchemy-utils | fa78e45f9bd38b46d5aface41914dad022c0099b | [
"BSD-3-Clause"
] | null | null | null | tests/aggregate/test_backrefs.py | jd/sqlalchemy-utils | fa78e45f9bd38b46d5aface41914dad022c0099b | [
"BSD-3-Clause"
] | null | null | null | tests/aggregate/test_backrefs.py | jd/sqlalchemy-utils | fa78e45f9bd38b46d5aface41914dad022c0099b | [
"BSD-3-Clause"
] | null | null | null | import sqlalchemy as sa
from sqlalchemy_utils.aggregates import aggregated
from tests import TestCase
class TestAggregateValueGenerationForSimpleModelPaths(TestCase):
def create_models(self):
class Thread(self.Base):
__tablename__ = 'thread'
id = sa.Column(sa.Integer, primary_key=T... | 35.262295 | 73 | 0.637843 |
6ee9b1d0191d5ed3ed652b459fb925265b51a272 | 6,879 | py | Python | examples/basic.py | grimen/python-envjoy | e4abcc7251a400850c67419a96d29fe97f000fef | [
"MIT"
] | null | null | null | examples/basic.py | grimen/python-envjoy | e4abcc7251a400850c67419a96d29fe97f000fef | [
"MIT"
] | null | null | null | examples/basic.py | grimen/python-envjoy | e4abcc7251a400850c67419a96d29fe97f000fef | [
"MIT"
] | null | null | null |
# =========================================
# IMPORTS
# --------------------------------------
from __future__ import print_function # Optional: Python 2 support for `env.print`
import rootpath
rootpath.append()
# =========================================
# EXAMPLE
# ----------------------------------... | 23.885417 | 89 | 0.490188 |
9b4e9bca9ed86f17e168c1870733f3c9e6cd62fb | 4,743 | py | Python | msaf/pymf/aa.py | m-tian/msaf-copy | 614bba6686fd0abf3c5866b92d78fccf5186b6a3 | [
"MIT"
] | 1 | 2020-02-17T08:14:16.000Z | 2020-02-17T08:14:16.000Z | msaf/pymf/aa.py | m-tian/msaf-copy | 614bba6686fd0abf3c5866b92d78fccf5186b6a3 | [
"MIT"
] | null | null | null | msaf/pymf/aa.py | m-tian/msaf-copy | 614bba6686fd0abf3c5866b92d78fccf5186b6a3 | [
"MIT"
] | 1 | 2020-02-14T08:57:35.000Z | 2020-02-14T08:57:35.000Z | #!/usr/bin/python
#
# Copyright (C) Christian Thurau, 2010.
# Licensed under the GNU General Public License (GPL).
# http://www.gnu.org/licenses/gpl.txt
"""
PyMF Archetypal Analysis [1]
AA: class for Archetypal Analysis
[1] Cutler, A. Breiman, L. (1994), "Archetypal Analysis", Technometrics 36(4),
338-347.
"""
... | 34.122302 | 82 | 0.596669 |
7f8d4e4c6a7a1ab2094cebef82e0846148a1419d | 263 | py | Python | hydrobr/__init__.py | wallissoncarvalho/hydrobr | 0374d6352a2d361486d41c6713059ddc4bdd30db | [
"BSD-3-Clause"
] | 17 | 2020-07-02T23:28:24.000Z | 2021-03-10T12:25:01.000Z | hydrobr/__init__.py | LucasAgro/hydrobr | f84cf02998ab3db693d925e4c6f89b274595b117 | [
"BSD-3-Clause"
] | 8 | 2020-07-07T14:12:45.000Z | 2020-07-07T20:03:11.000Z | hydrobr/__init__.py | LucasAgro/hydrobr | f84cf02998ab3db693d925e4c6f89b274595b117 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T15:39:19.000Z | 2021-10-29T18:30:50.000Z | """HydroBr is an open-source package to work with Brazilian hydrometeorological time series."""
__version__ = '0.1.1'
from hydrobr import get_data
from hydrobr.graphics import Plot
from hydrobr.preprocessing import PreProcessing
from hydrobr.save import SaveAs
| 29.222222 | 95 | 0.813688 |
f2b753c22e58acc6a9534dc7151218f5f66bc851 | 11,678 | py | Python | phi/torch/torch_backend.py | tum-pbs/CG-Solver-in-the-Loop | f6cb28819c7559d4afa972abc02f810c0c81515f | [
"MIT"
] | 13 | 2020-12-05T13:40:59.000Z | 2021-12-26T09:58:59.000Z | phi/torch/torch_backend.py | tum-pbs/CG-Solver-in-the-Loop | f6cb28819c7559d4afa972abc02f810c0c81515f | [
"MIT"
] | null | null | null | phi/torch/torch_backend.py | tum-pbs/CG-Solver-in-the-Loop | f6cb28819c7559d4afa972abc02f810c0c81515f | [
"MIT"
] | null | null | null | import warnings
import numpy as np
import torch
import torch.nn.functional as torchf
from phi.backend.backend import Backend
class TorchBackend(Backend):
def __init__(self):
Backend.__init__(self, 'PyTorch')
def is_tensor(self, x):
return isinstance(x, (torch.Tensor, ComplexTensor))
... | 32.082418 | 166 | 0.599161 |
19c7f273191b9e1286d007807759d42f42b87daa | 42,109 | py | Python | test/python/compiler/test_transpiler.py | georgios-ts/qiskit-terra | 44e0a7ae967be2a95808f47b42ddef26704fc5b7 | [
"Apache-2.0"
] | null | null | null | test/python/compiler/test_transpiler.py | georgios-ts/qiskit-terra | 44e0a7ae967be2a95808f47b42ddef26704fc5b7 | [
"Apache-2.0"
] | 2 | 2020-02-20T19:44:42.000Z | 2020-09-25T20:34:17.000Z | test/python/compiler/test_transpiler.py | georgios-ts/qiskit-terra | 44e0a7ae967be2a95808f47b42ddef26704fc5b7 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 38.73873 | 100 | 0.594196 |
711ab040d7f36bb981855ef874ffe67211edd915 | 3,253 | py | Python | tests/python/test_integration.py | sjanssen2/empress | 39a342de88b19ea41bf7adabd1016878e24de0d8 | [
"Apache-2.0",
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | tests/python/test_integration.py | sjanssen2/empress | 39a342de88b19ea41bf7adabd1016878e24de0d8 | [
"Apache-2.0",
"CC0-1.0",
"BSD-3-Clause"
] | 1 | 2019-11-18T20:38:12.000Z | 2019-11-18T20:38:12.000Z | tests/python/test_integration.py | sjanssen2/empress | 39a342de88b19ea41bf7adabd1016878e24de0d8 | [
"Apache-2.0",
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, empress development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 41.705128 | 132 | 0.648017 |
f5b42bfd655f005dd97dd47c0f29499d96b5c223 | 794 | py | Python | accounts/models.py | towhid135/EasyApply | 0cb4a16405d70d48b1a06dc0f7206651d2fd353d | [
"MIT"
] | null | null | null | accounts/models.py | towhid135/EasyApply | 0cb4a16405d70d48b1a06dc0f7206651d2fd353d | [
"MIT"
] | null | null | null | accounts/models.py | towhid135/EasyApply | 0cb4a16405d70d48b1a06dc0f7206651d2fd353d | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
from accounts.managers import UserManager
GENDER_CHOICES = (
('male', 'Male'),
('female', 'Female'))
class User(AbstractUser):
username = None
role = models.CharField(max_length=12, error_messages={
'required': ... | 24.8125 | 85 | 0.602015 |
b715abd31d940bf28f8a1650d690409f9161bddd | 841 | py | Python | lab/device/protocol.py | ParanoiaSYT/Qulab-backup | 09ec5457145b3789d4c1ac02c43dd3e6dfafc96f | [
"MIT"
] | null | null | null | lab/device/protocol.py | ParanoiaSYT/Qulab-backup | 09ec5457145b3789d4c1ac02c43dd3e6dfafc96f | [
"MIT"
] | null | null | null | lab/device/protocol.py | ParanoiaSYT/Qulab-backup | 09ec5457145b3789d4c1ac02c43dd3e6dfafc96f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pickle
import base64
import json
DEFAULT_PORT = 8123
class Transport():
def __init__(self):
self.protocol = pickle.HIGHEST_PROTOCOL
def pack(self, obj):
buff = pickle.dumps(obj, protocol=self.protocol)
return base64.b64encode(buff).decode()
... | 24.735294 | 67 | 0.587396 |
04ac3e36b008c0861a5a064884b8fe44c41fa7dd | 15,490 | py | Python | uc-dpc/model_3d.py | lovish1234/TPC | 10e93eeb0e22e411579cfb9f94fac7870f6e2039 | [
"MIT"
] | null | null | null | uc-dpc/model_3d.py | lovish1234/TPC | 10e93eeb0e22e411579cfb9f94fac7870f6e2039 | [
"MIT"
] | null | null | null | uc-dpc/model_3d.py | lovish1234/TPC | 10e93eeb0e22e411579cfb9f94fac7870f6e2039 | [
"MIT"
] | null | null | null | # get the model as DPC-RNN
import sys
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
sys.path.append('../uc-backbone')
# to extract the features
from select_backbone import select_resnet
# to aggregate the features in one
from convrnn import ConvGRU
class DPC_RNN(nn.Module):
'''... | 38.152709 | 120 | 0.548031 |
d63ac8130ce0602008d67e956f34d70154c33824 | 1,029 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/vqd/client/VqdClient.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/vqd/client/VqdClient.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/vqd/client/VqdClient.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.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 ... | 34.3 | 83 | 0.74344 |
8d753c3a70719e75e183676ee66dc5cff5bfecd3 | 2,175 | py | Python | setup.py | AakashGfude/jupyter-cache | ffdbe9b541e97f60f4123bd66fa450c8ba0bfe26 | [
"MIT"
] | null | null | null | setup.py | AakashGfude/jupyter-cache | ffdbe9b541e97f60f4123bd66fa450c8ba0bfe26 | [
"MIT"
] | null | null | null | setup.py | AakashGfude/jupyter-cache | ffdbe9b541e97f60f4123bd66fa450c8ba0bfe26 | [
"MIT"
] | null | null | null | """jupyter-cache package setup."""
from importlib import import_module
from setuptools import find_packages, setup
setup(
name="jupyter-cache",
version=import_module("jupyter_cache").__version__,
description=("A defined interface for working with a cache of jupyter notebooks."),
long_description=open("... | 35.080645 | 87 | 0.584828 |
6df3dcd55ef9f82efbe0fabdd9ce1c28a8782d35 | 3,188 | py | Python | qiskit/circuit/library/standard_gates/iswap.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/standard_gates/iswap.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/standard_gates/iswap.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | 1 | 2020-07-13T17:56:46.000Z | 2020-07-13T17:56:46.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 26.789916 | 77 | 0.440088 |
64e025296dd76c7046ecdb35b08dd9cb55092d34 | 238 | py | Python | pycouchdb/__init__.py | almararamara/py-couchdb | cb85366023f65e50387c07b93549150801115a08 | [
"BSD-3-Clause"
] | 62 | 2015-03-30T07:39:24.000Z | 2021-12-07T08:54:10.000Z | pycouchdb/__init__.py | almararamara/py-couchdb | cb85366023f65e50387c07b93549150801115a08 | [
"BSD-3-Clause"
] | 31 | 2015-04-26T20:21:28.000Z | 2021-11-06T11:31:35.000Z | pycouchdb/__init__.py | almararamara/py-couchdb | cb85366023f65e50387c07b93549150801115a08 | [
"BSD-3-Clause"
] | 19 | 2015-06-05T13:03:45.000Z | 2021-11-04T04:53:24.000Z | # -*- coding: utf-8 -*-
__author__ = "Andrey Antukh"
__license__ = "BSD"
__version__ = "1.14.1"
__maintainer__ = "Rinat Sabitov"
__email__ = "rinat.sabitov@gmail.com"
__status__ = "Development"
from .client import Server # noqa: F401
| 19.833333 | 40 | 0.701681 |
053aeb190b0f1714ddfe1e1174fd8db973aeccef | 380 | py | Python | hijack/urls.py | pennersr/django-hijack | 0b97745be1eb7f0ebbf2946f7bdb32f7fc90f736 | [
"MIT"
] | null | null | null | hijack/urls.py | pennersr/django-hijack | 0b97745be1eb7f0ebbf2946f7bdb32f7fc90f736 | [
"MIT"
] | null | null | null | hijack/urls.py | pennersr/django-hijack | 0b97745be1eb7f0ebbf2946f7bdb32f7fc90f736 | [
"MIT"
] | 1 | 2019-09-29T04:50:23.000Z | 2019-09-29T04:50:23.000Z | try:
from django.conf.urls import patterns, url
except ImportError:
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('hijack.views',
url(r'^email/(?P<email>[\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/$', 'login_with_email'),
url(r'^username/(?P<username>\w+)/$', 'login_with_use... | 31.666667 | 92 | 0.626316 |
129f1a4cf432b2a4f9d8250e94e41076836e9e9b | 2,481 | py | Python | __scraping__/medium.com/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | __scraping__/medium.com/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | __scraping__/medium.com/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z | #!/usr/bin/env python3
# date: 2020.02.24
# https://stackoverflow.com/questions/60383237/itemloader-in-scrapy/
import scrapy
from scrapy.loader import ItemLoader
from scrapy.spiders import CrawlSpider
import logging
from scrapy.utils.log import configure_logging
class MediumItem(scrapy.Item):
Title = scrapy.Fiel... | 42.050847 | 171 | 0.654172 |
f4165a257ca8edcf93a8c836fc0916ef701bf094 | 2,801 | py | Python | nova/tests/datastore_unittest.py | bopopescu/cc | 5c14efcda95c4987532484c84a885a3b07efc984 | [
"Apache-2.0"
] | null | null | null | nova/tests/datastore_unittest.py | bopopescu/cc | 5c14efcda95c4987532484c84a885a3b07efc984 | [
"Apache-2.0"
] | 1 | 2020-08-02T15:40:49.000Z | 2020-08-02T15:40:49.000Z | nova/tests/datastore_unittest.py | bopopescu/cc | 5c14efcda95c4987532484c84a885a3b07efc984 | [
"Apache-2.0"
] | 1 | 2020-07-25T17:56:39.000Z | 2020-07-25T17:56:39.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2010 Anso Labs, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | 34.580247 | 78 | 0.647269 |
80d6c226fd66b00de6e1e673817a7c261e17effe | 2,076 | py | Python | save_beta_residue.py | helloTC/Rest_activation_prediction | f67cfe221d9f63afd67a2a5ef6330b8519ca7641 | [
"MIT"
] | null | null | null | save_beta_residue.py | helloTC/Rest_activation_prediction | f67cfe221d9f63afd67a2a5ef6330b8519ca7641 | [
"MIT"
] | null | null | null | save_beta_residue.py | helloTC/Rest_activation_prediction | f67cfe221d9f63afd67a2a5ef6330b8519ca7641 | [
"MIT"
] | null | null | null | import framework_rt as fr
from os.path import join as pjoin
import cifti
from ATT.iofunc import iofiles
from sklearn import linear_model
import numpy as np
from scipy import stats
from ATT.algorithm import tools
with open('/nfs/s2/userhome/huangtaicheng/hworkingshop/hcp_test/tables/subjIC_sessid', 'r') as f:
subjI... | 42.367347 | 186 | 0.755299 |
62ded20ed115292d2b1a0ba6f5d7917e1cf49b4f | 27,310 | py | Python | ml-agents/mlagents/trainers/settings.py | J-Travnik/ml-agents | c392380ab32bd762536a83501483dd5e7d1898c8 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/settings.py | J-Travnik/ml-agents | c392380ab32bd762536a83501483dd5e7d1898c8 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/settings.py | J-Travnik/ml-agents | c392380ab32bd762536a83501483dd5e7d1898c8 | [
"Apache-2.0"
] | null | null | null | import warnings
import attr
import cattr
from typing import Dict, Optional, List, Any, DefaultDict, Mapping, Tuple, Union
from enum import Enum
import collections
import argparse
import abc
import numpy as np
import math
from mlagents.trainers.cli_utils import StoreConfigFile, DetectDefault, parser
from mlagents.trai... | 37.513736 | 109 | 0.655181 |
50eed5454c3f0afc7c0dd18a1b05db23ca21f1d4 | 151 | py | Python | tests/__init__.py | caominhduy/epicas | 989b792380ffd47e879c54881447c1d6b1caf67e | [
"Apache-2.0"
] | null | null | null | tests/__init__.py | caominhduy/epicas | 989b792380ffd47e879c54881447c1d6b1caf67e | [
"Apache-2.0"
] | null | null | null | tests/__init__.py | caominhduy/epicas | 989b792380ffd47e879c54881447c1d6b1caf67e | [
"Apache-2.0"
] | null | null | null | from .data_loading_test import StructuredDataTest
from .feature_engineering_test import FeatureEngineeringTest
from .model_test import SingleModelTest
| 37.75 | 60 | 0.900662 |
e7043672bc1e35842735620464e1d8636dbcd68f | 1,049 | py | Python | lib/spack/spack/test/cmd/arch.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | lib/spack/spack/test/cmd/arch.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | lib/spack/spack/test/cmd/arch.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.main import SpackCommand
arch = SpackCommand('arch')
def test_arch():
"""Sanity check ``spack arch`` to ... | 20.98 | 79 | 0.601525 |
26201e864403fe9e8549d75291573e79dd767d18 | 478 | py | Python | recipes/migrations/0009_alter_recipe_servings.py | sergeant-savage/my-recipe-app | cb1b5c05928689aed2c1637d8b4cf1ab08daf4b6 | [
"MIT"
] | 1 | 2021-08-11T11:43:06.000Z | 2021-08-11T11:43:06.000Z | recipes/migrations/0009_alter_recipe_servings.py | sergeant-savage/my-recipe-app | cb1b5c05928689aed2c1637d8b4cf1ab08daf4b6 | [
"MIT"
] | 8 | 2021-08-11T00:55:32.000Z | 2021-08-15T20:48:59.000Z | recipes/migrations/0009_alter_recipe_servings.py | sergeant-savage/my-recipe-app | cb1b5c05928689aed2c1637d8b4cf1ab08daf4b6 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-24 21:16
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipes', '0008_alter_recipe_servings'),
]
operations = [
migrations.AlterField(
model_name='recip... | 23.9 | 107 | 0.646444 |
42cef4905b4319ac091db49a348812043b96faef | 3,997 | py | Python | services/service_manager/public/tools/manifest/manifest_collator.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | services/service_manager/public/tools/manifest/manifest_collator.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | services/service_manager/public/tools/manifest/manifest_collator.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #!/usr/bin/env python
# Copyright 2016 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.
""" A collator for Service Manifests """
import argparse
import json
import os
import shutil
import sys
import urlparse
# Keys which... | 29.175182 | 76 | 0.694021 |
5560e199aac68e390d0d8c9f15e4f64ab1d15f1c | 1,460 | py | Python | numpy/distutils/fcompiler/hpux.py | WeatherGod/numpy | 5be45b280b258e158b93163b937f8f9c08d30393 | [
"BSD-3-Clause"
] | 4 | 2020-01-28T08:48:27.000Z | 2022-02-09T18:45:34.000Z | numpy/distutils/fcompiler/hpux.py | WeatherGod/numpy | 5be45b280b258e158b93163b937f8f9c08d30393 | [
"BSD-3-Clause"
] | null | null | null | numpy/distutils/fcompiler/hpux.py | WeatherGod/numpy | 5be45b280b258e158b93163b937f8f9c08d30393 | [
"BSD-3-Clause"
] | 1 | 2015-10-08T10:27:03.000Z | 2015-10-08T10:27:03.000Z | from __future__ import division, absolute_import, print_function
from numpy.distutils.fcompiler import FCompiler
compilers = ['HPUXFCompiler']
class HPUXFCompiler(FCompiler):
compiler_type = 'hpux'
description = 'HP Fortran 90 Compiler'
version_pattern = r'HP F90 (?P<version>[^\s*,]*)'
executables... | 31.73913 | 64 | 0.612329 |
e106b2f00fe254cf234ec39b6ade4b0a24480846 | 213 | py | Python | tatau_core/nn/torch/summarizer/median.py | makar21/core | e6a0c8d5456567dd3139ee3fd3cf6cd4acdd4a05 | [
"Apache-2.0"
] | null | null | null | tatau_core/nn/torch/summarizer/median.py | makar21/core | e6a0c8d5456567dd3139ee3fd3cf6cd4acdd4a05 | [
"Apache-2.0"
] | null | null | null | tatau_core/nn/torch/summarizer/median.py | makar21/core | e6a0c8d5456567dd3139ee3fd3cf6cd4acdd4a05 | [
"Apache-2.0"
] | null | null | null | from .model import ModelSummarizer
import numpy as np
class Median(ModelSummarizer):
"""
Median State Summarizer
"""
def __init__(self):
super(Median, self).__init__(np_sum_fn=np.median)
| 19.363636 | 57 | 0.690141 |
5005503ccffe9e23891bbcef6ee608dfc86fde28 | 2,026 | py | Python | pps/pps.py | evanscottgray/dtaas | 97bed659e1598094905e083e2a9261a3b1cb7219 | [
"MIT"
] | 3 | 2015-02-26T22:38:59.000Z | 2019-09-17T22:22:28.000Z | pps/pps.py | evanscottgray/dtaas | 97bed659e1598094905e083e2a9261a3b1cb7219 | [
"MIT"
] | null | null | null | pps/pps.py | evanscottgray/dtaas | 97bed659e1598094905e083e2a9261a3b1cb7219 | [
"MIT"
] | null | null | null | #!/bin/python
import sys
import threading
from scapy.config import conf
conf.ipv6_enabled = False
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
import fcntl, socket, struct
from collections import OrderedDict
from time import sleep
from httplib import HTTPConnection, ... | 33.213115 | 197 | 0.653504 |
8acea70ede149f8c662b46cf0e9c0302f98d1126 | 5,107 | py | Python | ppgan/models/discriminators/discriminator_styleganv2.py | pcwuyu/PaddleGAN | b4ff90f0c92c4d8dcaa8e25267151b82fc7aa268 | [
"Apache-2.0"
] | 3 | 2022-02-20T11:40:50.000Z | 2022-02-20T11:46:29.000Z | ppgan/models/discriminators/discriminator_styleganv2.py | pcwuyu/PaddleGAN | b4ff90f0c92c4d8dcaa8e25267151b82fc7aa268 | [
"Apache-2.0"
] | 38 | 2021-10-14T12:55:45.000Z | 2021-12-24T06:09:10.000Z | ppgan/models/discriminators/discriminator_styleganv2.py | pcwuyu/PaddleGAN | b4ff90f0c92c4d8dcaa8e25267151b82fc7aa268 | [
"Apache-2.0"
] | 1 | 2021-09-22T09:29:19.000Z | 2021-09-22T09:29:19.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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... | 29.350575 | 77 | 0.574114 |
74c05c62bfd4ff7e339c65e80af8369cb9254fef | 2,593 | py | Python | tests/base/test_options.py | gboehl/sequence-jacobian | 01d177cc254a2ccee57a3ed273117bea58554be2 | [
"MIT"
] | null | null | null | tests/base/test_options.py | gboehl/sequence-jacobian | 01d177cc254a2ccee57a3ed273117bea58554be2 | [
"MIT"
] | null | null | null | tests/base/test_options.py | gboehl/sequence-jacobian | 01d177cc254a2ccee57a3ed273117bea58554be2 | [
"MIT"
] | null | null | null | import numpy as np
import pytest
from sequence_jacobian.examples import krusell_smith
def test_jacobian_h(krusell_smith_dag):
_, ss, dag, *_ = krusell_smith_dag
hh = dag['hh']
lowacc = hh.jacobian(ss, inputs=['r'], outputs=['C'], T=10, h=0.05)
midacc = hh.jacobian(ss, inputs=['r'], outputs=['C'], T=10... | 43.949153 | 110 | 0.576552 |
3bd29e6a9a3c3115b29c7865ac3245a673a7b68b | 9,429 | py | Python | builder/generate.py | Acidburn0zzz/ionicons | d99d7f98b918f1679ff3f07d0e95a0300a1aa493 | [
"MIT"
] | null | null | null | builder/generate.py | Acidburn0zzz/ionicons | d99d7f98b918f1679ff3f07d0e95a0300a1aa493 | [
"MIT"
] | null | null | null | builder/generate.py | Acidburn0zzz/ionicons | d99d7f98b918f1679ff3f07d0e95a0300a1aa493 | [
"MIT"
] | null | null | null | from subprocess import call
import os
import json
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts')
CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css')
SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss')
LESS_FOLDER_... | 29.557994 | 113 | 0.617033 |
ba50c8bbafa0140b7cc9f1f2facafba5fbda8afa | 15,083 | py | Python | Text RPG project/projeto RPG texto.py | Hipparcus/Python-Learning | a3bd5787ceb67f20a0a053e3db4cf77a18e12112 | [
"MIT"
] | null | null | null | Text RPG project/projeto RPG texto.py | Hipparcus/Python-Learning | a3bd5787ceb67f20a0a053e3db4cf77a18e12112 | [
"MIT"
] | null | null | null | Text RPG project/projeto RPG texto.py | Hipparcus/Python-Learning | a3bd5787ceb67f20a0a053e3db4cf77a18e12112 | [
"MIT"
] | null | null | null | #Prototipo#
def RPG():
nome=input("Qual nome de seu personagem? ")
raca=input("Qual sua raca entre humano, orc ou elfo?: ")
raca=str.lower(raca)
if raca=="orc":
introd="Bem-vindo, caro orc "+ nome+". Gostariamos de saber qual sera a sua classe preferida? Tenha em mente que nao eh necessario se ... | 40.114362 | 373 | 0.610555 |
84b6dc393cd509588c124b4cafe4a8a149433c2d | 422 | py | Python | mmdet/apis/__init__.py | XiaoyuHuang96/mmdetection | e2ff08b68e2f5907a59976dcedb055036c03eecf | [
"Apache-2.0"
] | null | null | null | mmdet/apis/__init__.py | XiaoyuHuang96/mmdetection | e2ff08b68e2f5907a59976dcedb055036c03eecf | [
"Apache-2.0"
] | null | null | null | mmdet/apis/__init__.py | XiaoyuHuang96/mmdetection | e2ff08b68e2f5907a59976dcedb055036c03eecf | [
"Apache-2.0"
] | null | null | null | from .env import get_root_logger, init_dist, set_random_seed
from .inference import (inference_detector, init_detector, show_result,
show_result_pyplot)
from .train import train_detector
from .myutils import OurRunner
__all__ = [
'init_dist', 'get_root_logger', 'set_random_seed', 'train_de... | 35.166667 | 90 | 0.746445 |
aaa9308bc6ca3de3fae08dad6e5631dd6aeb1655 | 2,096 | py | Python | pbx_gs_python_utils/Update_Lambda_Functions.py | owasp-sbot/pbx-gs-python-utils | f448aa36c4448fc04d30c3a5b25640ea4d44a267 | [
"Apache-2.0"
] | 3 | 2018-12-14T15:43:46.000Z | 2019-04-25T07:44:58.000Z | pbx_gs_python_utils/Update_Lambda_Functions.py | owasp-sbot/pbx-gs-python-utils | f448aa36c4448fc04d30c3a5b25640ea4d44a267 | [
"Apache-2.0"
] | 1 | 2019-05-11T14:19:37.000Z | 2019-05-11T14:51:04.000Z | pbx_gs_python_utils/Update_Lambda_Functions.py | owasp-sbot/pbx-gs-python-utils | f448aa36c4448fc04d30c3a5b25640ea4d44a267 | [
"Apache-2.0"
] | 4 | 2018-12-27T04:54:14.000Z | 2019-05-11T14:07:47.000Z | # import sys
# sys.path.append('..')
#
# import json
#
# from pbx_gs_python_utils.utils.Dev import Dev
# from pbx_gs_python_utils.utils.Lambdas_Helpers import slack_message
# from osbot_aws.apis.Lambda import Lambda
#
#
# class Update_Lambda_Functions:
#
# def update_lambda_function(self, na... | 41.098039 | 137 | 0.594943 |
77145b78603a87cea8541430a2ff9fb64cd6654c | 10,843 | py | Python | gnn_pygan/gan_attack/attacker/attacker_sup.py | Guo-lab/Graph | c4c5fbc8fb5d645c16da20351b9746019cf75aab | [
"MIT"
] | null | null | null | gnn_pygan/gan_attack/attacker/attacker_sup.py | Guo-lab/Graph | c4c5fbc8fb5d645c16da20351b9746019cf75aab | [
"MIT"
] | null | null | null | gnn_pygan/gan_attack/attacker/attacker_sup.py | Guo-lab/Graph | c4c5fbc8fb5d645c16da20351b9746019cf75aab | [
"MIT"
] | null | null | null | import torch as ch
import torch.nn as nn
from tqdm import tqdm
from utils import helpers
from . import attack_steps
from estimator.estimator import mi_loss, mi_loss_neg
import time, gc
class Attacker(ch.nn.Module):
"""
Attacker class, used to make adversarial examples.
This is primarily an internal class... | 43.721774 | 148 | 0.564143 |
b900d491f7619c1134430f85f667338aa9f5f9c5 | 7,796 | py | Python | v1.0.0.test/toontown/building/DistributedToonInterior.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v1.0.0.test/toontown/building/DistributedToonInterior.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v1.0.0.test/toontown/building/DistributedToonInterior.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | from toontown.toonbase.ToonBaseGlobal import *
from panda3d.core import *
from panda3d.toontown import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from toontown.toonbase import ToontownGlobals
import ToonInterior
from direct.directnotify import DirectNotifyGlobal
from dire... | 39.175879 | 295 | 0.611852 |
245b08cf6141a4b19eeffc90c2f731d3af3471db | 11,063 | py | Python | sdks/python/setup.py | chermenin/beam | 53d5ebf812f57fc48827475552109399274d772e | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | sdks/python/setup.py | chermenin/beam | 53d5ebf812f57fc48827475552109399274d772e | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | sdks/python/setup.py | chermenin/beam | 53d5ebf812f57fc48827475552109399274d772e | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 33.122754 | 80 | 0.670975 |
81abd9447837a736af19063458b954ed2b49e934 | 1,795 | py | Python | py/examples/table_download.py | angelosaleh/wave | 06f5601e13c23e021429dbdb9f6140ddfed27644 | [
"Apache-2.0"
] | 1 | 2021-01-02T04:47:28.000Z | 2021-01-02T04:47:28.000Z | py/examples/table_download.py | MaxCodeXTC/wave | b16bcd99b9752aae93aacf84d5c160093d775131 | [
"Apache-2.0"
] | null | null | null | py/examples/table_download.py | MaxCodeXTC/wave | b16bcd99b9752aae93aacf84d5c160093d775131 | [
"Apache-2.0"
] | 1 | 2021-02-01T05:07:56.000Z | 2021-02-01T05:07:56.000Z | # Table / Download
# Allow downloading a table's data as CSV file.
# #table #download
# ---
import random
from faker import Faker
from h2o_wave import main, app, Q, ui
fake = Faker()
_id = 0
class Issue:
def __init__(self, text: str, status: str, progress: float, icon: str, notifications: str):
global _... | 28.951613 | 120 | 0.607242 |
375068ef537e3074e807ef6eab51eaadddba56dc | 6,710 | py | Python | caffe2/python/sparse_to_dense_mask_test.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 40 | 2021-06-01T07:37:59.000Z | 2022-03-25T01:42:09.000Z | caffe2/python/sparse_to_dense_mask_test.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 14 | 2021-06-01T11:52:46.000Z | 2022-03-25T02:13:08.000Z | caffe2/python/sparse_to_dense_mask_test.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 7 | 2021-07-20T19:34:26.000Z | 2022-03-13T21:07:36.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, workspace
from caffe2.python.test_util import TestCase
import numpy as np
class TestSparseToDenseMask(TestCase):
def test_sparse_to... | 42.468354 | 77 | 0.581371 |
e502132afad2126337227688ca11b3751a48a78e | 2,035 | py | Python | v2.5.7/toontown/speedchat/TTSCWinterMenu.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v2.5.7/toontown/speedchat/TTSCWinterMenu.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v2.5.7/toontown/speedchat/TTSCWinterMenu.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | from otp.otpbase import PythonUtil
from otp.speedchat.SCMenu import SCMenu
from otp.speedchat.SCMenuHolder import SCMenuHolder
from otp.speedchat.SCStaticTextTerminal import SCStaticTextTerminal
from toontown.speedchat.TTSCIndexedTerminal import TTSCIndexedTerminal
from otp.otpbase import OTPLocalizer
WinterMenu = [
(... | 34.491525 | 116 | 0.608845 |
5a1145df58acfce07b22110993cc707f5ae62207 | 6,446 | py | Python | sd/algorithms/extra/kmedoids.py | shibaji7/SuperDARN-Clustering | d7427ba609fb7f5e50c26f52364e5e9e118bbc31 | [
"Apache-2.0"
] | 1 | 2020-12-02T20:13:34.000Z | 2020-12-02T20:13:34.000Z | sd/algorithms/extra/kmedoids.py | shibaji7/SuperDARN-Clustering | d7427ba609fb7f5e50c26f52364e5e9e118bbc31 | [
"Apache-2.0"
] | null | null | null | sd/algorithms/extra/kmedoids.py | shibaji7/SuperDARN-Clustering | d7427ba609fb7f5e50c26f52364e5e9e118bbc31 | [
"Apache-2.0"
] | null | null | null | from scipy.sparse import csr_matrix
import numpy as np
import random
class KMedoids:
def __init__(self, n_clusters=2, max_iter=10, tol=0.1, start_prob=0.8, end_prob=0.99):
"""Kmedoids constructor called"""
if start_prob < 0 or start_prob >= 1 or end_prob < 0 or end_prob >= 1 or start_prob > end_pro... | 39.790123 | 103 | 0.624263 |
b49076b62fad277962af24bb0d2f20cfbe32cabf | 26,967 | py | Python | tests/cache/test_region.py | shanesaravia/dogpile.cache | 21a8248bb7a20863a0267e0069225fb416e73ca9 | [
"BSD-3-Clause"
] | null | null | null | tests/cache/test_region.py | shanesaravia/dogpile.cache | 21a8248bb7a20863a0267e0069225fb416e73ca9 | [
"BSD-3-Clause"
] | null | null | null | tests/cache/test_region.py | shanesaravia/dogpile.cache | 21a8248bb7a20863a0267e0069225fb416e73ca9 | [
"BSD-3-Clause"
] | null | null | null | from collections import defaultdict
import datetime
import itertools
import time
from unittest import TestCase
import mock
from dogpile.cache import CacheRegion
from dogpile.cache import exception
from dogpile.cache import make_region
from dogpile.cache.api import CacheBackend
from dogpile.cache.api import CachedValu... | 32.027316 | 79 | 0.585382 |
e476a0dc5a44a251427d75977a9b0e04fd75f916 | 281 | py | Python | common_migration/tests/migration_files/new/central/migrations/0002_add_ideacopy.py | Wazoku/django-common-migration | 51bbb4d3a5a5c76fc5dcf569da9eb7751b82c9eb | [
"BSD-2-Clause"
] | 1 | 2021-06-03T13:49:50.000Z | 2021-06-03T13:49:50.000Z | common_migration/tests/migration_files/old/central/migrations/0002_add_ideacopy.py | Wazoku/django-common-migration | 51bbb4d3a5a5c76fc5dcf569da9eb7751b82c9eb | [
"BSD-2-Clause"
] | 1 | 2020-11-20T09:17:47.000Z | 2020-11-20T09:17:47.000Z | common_migration/tests/migration_files/old/central/migrations/0002_add_ideacopy.py | Wazoku/django-common-migration | 51bbb4d3a5a5c76fc5dcf569da9eb7751b82c9eb | [
"BSD-2-Clause"
] | 1 | 2020-11-16T16:09:22.000Z | 2020-11-16T16:09:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-29 11:26
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('central', '0001_squashed'),
]
operations = [
]
| 17.5625 | 49 | 0.658363 |
7edf6ca1018b331f9221a2d1c2a92ed9b91f80a8 | 4,526 | py | Python | pymeasure/display/listeners.py | dphaas/pymeasure | 580c33bf5f1e409bb575c46bbd1df682bf27cfe1 | [
"MIT"
] | null | null | null | pymeasure/display/listeners.py | dphaas/pymeasure | 580c33bf5f1e409bb575c46bbd1df682bf27cfe1 | [
"MIT"
] | null | null | null | pymeasure/display/listeners.py | dphaas/pymeasure | 580c33bf5f1e409bb575c46bbd1df682bf27cfe1 | [
"MIT"
] | null | null | null | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2022 PyMeasure Developers
#
# 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 limit... | 35.359375 | 81 | 0.653999 |
65dce11f353a0d4e0539751544b8f31b381da854 | 2,918 | py | Python | 1_module/D_Graph.py | L4mborg1n1-D14610/Algoritms_and_DataStructure | f61b7434dbc600da02e8ec38648fa84beb160f17 | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | 1_module/D_Graph.py | L4mborg1n1-D14610/Algoritms_and_DataStructure | f61b7434dbc600da02e8ec38648fa84beb160f17 | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | 1_module/D_Graph.py | L4mborg1n1-D14610/Algoritms_and_DataStructure | f61b7434dbc600da02e8ec38648fa84beb160f17 | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
from collections import deque
class Graph:
def __init__(self):
try:
while True:
line = input().strip('\n')
if line != "":
break
if (line[0:2] == "u ") | (line[0:2] == "d "):
self.__graph_type = line[0]
... | 32.422222 | 87 | 0.48218 |
6938a64cce025ab87630f604571680b033c62556 | 6,780 | py | Python | src/braket/ir/jaqcd/program_v1.py | orclassiq/amazon-braket-schemas-python | 895ccb6c15a678975894b7b13fc91febe914719e | [
"Apache-2.0"
] | null | null | null | src/braket/ir/jaqcd/program_v1.py | orclassiq/amazon-braket-schemas-python | 895ccb6c15a678975894b7b13fc91febe914719e | [
"Apache-2.0"
] | null | null | null | src/braket/ir/jaqcd/program_v1.py | orclassiq/amazon-braket-schemas-python | 895ccb6c15a678975894b7b13fc91febe914719e | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompany... | 28.368201 | 98 | 0.642625 |
c7528dcabc0793e7539426aa82e0cc946cc27231 | 70,775 | py | Python | Tests/test_cliclass.py | caoyongxu/ironpython3 | a3e245dd4803b82ffcf6836de522a8ab4ed8e5d5 | [
"Apache-2.0"
] | null | null | null | Tests/test_cliclass.py | caoyongxu/ironpython3 | a3e245dd4803b82ffcf6836de522a8ab4ed8e5d5 | [
"Apache-2.0"
] | null | null | null | Tests/test_cliclass.py | caoyongxu/ironpython3 | a3e245dd4803b82ffcf6836de522a8ab4ed8e5d5 | [
"Apache-2.0"
] | null | null | null | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import sys
import unittest
from iptest import IronPythonTestCase, is_cli, is_debug, is_mono, is_netcoreapp, is_n... | 35.835443 | 188 | 0.613098 |
253903cbd5286b07da7db3077a7bbe4830db4edc | 1,754 | py | Python | temba_client/exceptions.py | AfricasVoices/rapidpro-python | 1d5ce00d23a9b28c1f8d70cd18da82f18031b804 | [
"BSD-3-Clause"
] | 1 | 2021-03-02T03:00:47.000Z | 2021-03-02T03:00:47.000Z | temba_client/exceptions.py | AfricasVoices/rapidpro-python | 1d5ce00d23a9b28c1f8d70cd18da82f18031b804 | [
"BSD-3-Clause"
] | null | null | null | temba_client/exceptions.py | AfricasVoices/rapidpro-python | 1d5ce00d23a9b28c1f8d70cd18da82f18031b804 | [
"BSD-3-Clause"
] | null | null | null | class TembaException(Exception):
def __str__(self):
return self.message
class TembaConnectionError(TembaException):
message = "Unable to connect to host"
class TembaBadRequestError(TembaException):
def __init__(self, errors):
self.errors = errors
def __str__(self):
msgs = []... | 27.40625 | 91 | 0.649943 |
2f7c83b83136f3ace2e3d0b60b1c6d3709c58797 | 700 | py | Python | scripts/model/cat_model.py | usert5432/vlne | e3cafd30ecce3a2dbc4a37cc4257d07fb1a1785d | [
"MIT"
] | null | null | null | scripts/model/cat_model.py | usert5432/vlne | e3cafd30ecce3a2dbc4a37cc4257d07fb1a1785d | [
"MIT"
] | null | null | null | scripts/model/cat_model.py | usert5432/vlne | e3cafd30ecce3a2dbc4a37cc4257d07fb1a1785d | [
"MIT"
] | null | null | null | """Pretty Print training configuration and model structure"""
import argparse
from vlne.utils.io import load_model
def parse_cmdargs():
"""Parse command line arguments"""
parser = argparse.ArgumentParser("Pretty print model")
parser.add_argument(
'outdir',
metavar = 'OUTDIR',
type ... | 24.137931 | 61 | 0.658571 |
1797a203d7279891920c0ef3eecb7044567857da | 3,627 | py | Python | config.py | springto/brat | cfc1d0109388cd7d9a5fe3a1e41f20277605dbab | [
"CC-BY-3.0"
] | null | null | null | config.py | springto/brat | cfc1d0109388cd7d9a5fe3a1e41f20277605dbab | [
"CC-BY-3.0"
] | null | null | null | config.py | springto/brat | cfc1d0109388cd7d9a5fe3a1e41f20277605dbab | [
"CC-BY-3.0"
] | null | null | null | # This configuration was automatically generated by install.sh
from os.path import dirname, join as path_join
# This configuration file specifies the global setup of the brat
# server. It is recommended that you use the installation script
# instead of editing this file directly. To do this, run the following
# command... | 39.857143 | 87 | 0.740006 |
71974268d6dd6a8406acbba6b91310ba74815108 | 8,391 | py | Python | sdk/python/pulumi_azure_native/policyinsights/get_remediation_at_management_group.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/policyinsights/get_remediation_at_management_group.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/policyinsights/get_remediation_at_management_group.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 41.746269 | 254 | 0.685735 |
b3fd65db32486738567a6d6b313d1a2594fbc0b8 | 3,036 | py | Python | Project-NFC Reader/punchclock/punchclock.py | CurtisIreland/electronics | 99b2521bfde49587850ddaf224fa3ae52d55698c | [
"CC0-1.0"
] | 22 | 2018-01-07T05:59:44.000Z | 2022-03-04T03:22:27.000Z | Project-NFC Reader/punchclock/punchclock.py | CurtisIreland/electronics | 99b2521bfde49587850ddaf224fa3ae52d55698c | [
"CC0-1.0"
] | null | null | null | Project-NFC Reader/punchclock/punchclock.py | CurtisIreland/electronics | 99b2521bfde49587850ddaf224fa3ae52d55698c | [
"CC0-1.0"
] | 33 | 2016-05-30T03:45:52.000Z | 2022-03-29T10:26:43.000Z | import Tkinter as tk
import time
import clock_db
class Punchclock:
def __init__(self, master):
self.time1 = ''
self.card_read = ''
self.card_name = ''
self.rdwr_options = {
'targets': ['106A'],
'on-connect': lambda: scan_card(),
}
self.master = master
master.title('Punchclock... | 31.625 | 98 | 0.678195 |
c2c22b1aa45308b344bd8a26b921b0306bc6078d | 11,867 | py | Python | sysinv/sysinv/sysinv/sysinv/api/controllers/v1/load.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/api/controllers/v1/load.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/api/controllers/v1/load.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 1 | 2021-01-05T16:24:58.000Z | 2021-01-05T16:24:58.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 UnitedStack 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.or... | 34.100575 | 82 | 0.6165 |
72a925c649f9b430faf270d395076c25bb211eea | 4,262 | py | Python | resume/settings.py | KamilJakubczak/Resume | 6c4907f11d50e12efb8d0ea181dd0023fe254753 | [
"MIT"
] | null | null | null | resume/settings.py | KamilJakubczak/Resume | 6c4907f11d50e12efb8d0ea181dd0023fe254753 | [
"MIT"
] | null | null | null | resume/settings.py | KamilJakubczak/Resume | 6c4907f11d50e12efb8d0ea181dd0023fe254753 | [
"MIT"
] | null | null | null | """
Django settings for resume project.
Generated by 'django-admin startproject' using Django 3.0.10.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
#... | 26.308642 | 91 | 0.691929 |
d6b6581f63724aa0fccaadea572cac66fe861661 | 2,099 | py | Python | tests/functional/regressions/test_issue160.py | matt-koevort/tartiflette | 5777866b133d846ce4f8aa03f735fa81832896cd | [
"MIT"
] | 530 | 2019-06-04T11:45:36.000Z | 2022-03-31T09:29:56.000Z | tests/functional/regressions/test_issue160.py | matt-koevort/tartiflette | 5777866b133d846ce4f8aa03f735fa81832896cd | [
"MIT"
] | 242 | 2019-06-04T11:53:08.000Z | 2022-03-28T07:06:27.000Z | tests/functional/regressions/test_issue160.py | matt-koevort/tartiflette | 5777866b133d846ce4f8aa03f735fa81832896cd | [
"MIT"
] | 36 | 2019-06-21T06:40:27.000Z | 2021-11-04T13:11:16.000Z | import pytest
from tartiflette import create_engine
from tartiflette.types.exceptions.tartiflette import GraphQLSchemaError
@pytest.mark.asyncio
async def test_issue160():
with pytest.raises(
GraphQLSchemaError,
match="""
0: Field < F.a > is Invalid: the given Type < G > does not exist!
1: Field... | 23.322222 | 109 | 0.5293 |
f690eeb94b80f151d6968d31e21c0385a2443863 | 209 | py | Python | ex12.py | Eithandarphyo51/python-test-exercises | 85d1cbb82fc878315be46d168e5eb0f949c6ded4 | [
"MIT"
] | null | null | null | ex12.py | Eithandarphyo51/python-test-exercises | 85d1cbb82fc878315be46d168e5eb0f949c6ded4 | [
"MIT"
] | null | null | null | ex12.py | Eithandarphyo51/python-test-exercises | 85d1cbb82fc878315be46d168e5eb0f949c6ded4 | [
"MIT"
] | null | null | null | age = input("How old are you? ")
height = input("How tall are you? ")
weight = input("How much do you weigh? ")
print (f"So, you're {age} old, {height} tall and {weight} heavy." .format(age, height, weight))
| 34.833333 | 95 | 0.650718 |
8ad1e1185513767643ccdd7d104050df9adaab69 | 2,906 | py | Python | azure-mgmt-network/azure/mgmt/network/v2018_12_01/models/ip_configuration.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2018_12_01/models/ip_configuration.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-network/azure/mgmt/network/v2018_12_01/models/ip_configuration.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | null | null | null | # 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 ... | 46.126984 | 103 | 0.65554 |
4c9fcb3cca3cc8d9a33f13ba961cbe150227144e | 1,389 | py | Python | showers/pi/examples/ch09/photobooth.py | Playaowl/artworks | bfe2abc844851ce054e1233261364a502cd30561 | [
"MIT"
] | 1 | 2020-08-14T01:03:47.000Z | 2020-08-14T01:03:47.000Z | showers/pi/examples/ch09/photobooth.py | Playaowl/artworks | bfe2abc844851ce054e1233261364a502cd30561 | [
"MIT"
] | null | null | null | showers/pi/examples/ch09/photobooth.py | Playaowl/artworks | bfe2abc844851ce054e1233261364a502cd30561 | [
"MIT"
] | null | null | null | from time import sleep, time
from SimpleCV import Camera, Image, Display
import RPi.GPIO as GPIO
myCamera = Camera(prop_set={'width':320, 'height': 240})
myDisplay = Display(resolution=(320, 240))
stache = Image("mustache.png")
stacheMask = stache.createBinaryMask(color1=(0,0,0), color2=(254,254,254))
stacheMask = sta... | 30.866667 | 74 | 0.62059 |
9a6ca649d8a566f6583341846bad76528c2c8f19 | 7,418 | py | Python | dev_course/dl2/exp/nb_08.py | nebgor/fastai_docs | 9daa76023b701df07557332ef5e37d12f6e78828 | [
"Apache-2.0"
] | null | null | null | dev_course/dl2/exp/nb_08.py | nebgor/fastai_docs | 9daa76023b701df07557332ef5e37d12f6e78828 | [
"Apache-2.0"
] | null | null | null | dev_course/dl2/exp/nb_08.py | nebgor/fastai_docs | 9daa76023b701df07557332ef5e37d12f6e78828 | [
"Apache-2.0"
] | null | null | null |
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: dev_nb/08_data_block.ipynb
from exp.nb_07 import *
import PIL,os,mimetypes
Path.ls = lambda x: list(x.iterdir())
image_extensions = set(k for k,v in m... | 33.718182 | 103 | 0.644918 |
8dcf763c5f4437b43b08d5240f2ee2ba01255c54 | 33 | py | Python | helper.py | SreyaKamineni/cs3240-labdemo | 8a31ef331e4784f30a9d9da8f089c024d30409b4 | [
"MIT"
] | null | null | null | helper.py | SreyaKamineni/cs3240-labdemo | 8a31ef331e4784f30a9d9da8f089c024d30409b4 | [
"MIT"
] | null | null | null | helper.py | SreyaKamineni/cs3240-labdemo | 8a31ef331e4784f30a9d9da8f089c024d30409b4 | [
"MIT"
] | null | null | null |
def greetings(msg):
print(msg) | 11 | 19 | 0.69697 |
adb90d66963ebe687f2d029c6d677c8b2a36c446 | 10,360 | py | Python | build/util/desugared_compiler/parser.c.desugared.py | Anmol-007/l2l3_ACL_cartesian_product | 730f07f2c7ff4cdcd482a25491d8bd3883c835e1 | [
"Apache-2.0"
] | null | null | null | build/util/desugared_compiler/parser.c.desugared.py | Anmol-007/l2l3_ACL_cartesian_product | 730f07f2c7ff4cdcd482a25491d8bd3883c835e1 | [
"Apache-2.0"
] | null | null | null | build/util/desugared_compiler/parser.c.desugared.py | Anmol-007/l2l3_ACL_cartesian_product | 730f07f2c7ff4cdcd482a25491d8bd3883c835e1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Eotvos Lorand University, Budapest, Hungary
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 53.402062 | 225 | 0.60222 |
6030598e6a8abed013a11b643c449b8380c1e557 | 13,900 | py | Python | pycrostates/cluster/kmeans.py | mscheltienne/pycrostates | be87adf69c94b2b179064f337acd8a49d01c305d | [
"BSD-3-Clause"
] | 1 | 2021-12-14T09:58:57.000Z | 2021-12-14T09:58:57.000Z | pycrostates/cluster/kmeans.py | mscheltienne/pycrostates | be87adf69c94b2b179064f337acd8a49d01c305d | [
"BSD-3-Clause"
] | null | null | null | pycrostates/cluster/kmeans.py | mscheltienne/pycrostates | be87adf69c94b2b179064f337acd8a49d01c305d | [
"BSD-3-Clause"
] | null | null | null | """Class and functions to use modified Kmeans."""
from pathlib import Path
from typing import Optional, Tuple, Union
import numpy as np
from mne import BaseEpochs
from mne.io import BaseRaw
from mne.parallel import parallel_func
from numpy.random import Generator, RandomState
from numpy.typing import NDArray
from ..... | 33.174224 | 80 | 0.547482 |
ca5aa7f5713e60b3f34f2982e0b31931e7734451 | 14,415 | py | Python | tests/unit/build_tests/test_io_manager.py | satra/hdmf | fab5660b1e009151980939e266e63a6c408064aa | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/unit/build_tests/test_io_manager.py | satra/hdmf | fab5660b1e009151980939e266e63a6c408064aa | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/unit/build_tests/test_io_manager.py | satra/hdmf | fab5660b1e009151980939e266e63a6c408064aa | [
"BSD-3-Clause-LBNL"
] | null | null | null | import re
from hdmf.build import GroupBuilder, DatasetBuilder, ObjectMapper, BuildManager, TypeMap, ContainerConfigurationError
from hdmf.spec import GroupSpec, AttributeSpec, DatasetSpec, SpecCatalog, SpecNamespace, NamespaceCatalog
from hdmf.spec.spec import ZERO_OR_MANY
from hdmf.testing import TestCase
from abc i... | 42.272727 | 119 | 0.579188 |
ae010ebfdaddbb3dddd347501f4986f4a32cc01b | 2,439 | py | Python | setup.py | DamonLee5/mbircone | 680cfd9714dce240e2060cce7a15020b1a640d65 | [
"BSD-3-Clause"
] | 1 | 2022-03-15T06:47:20.000Z | 2022-03-15T06:47:20.000Z | setup.py | DamonLee5/mbircone | 680cfd9714dce240e2060cce7a15020b1a640d65 | [
"BSD-3-Clause"
] | 7 | 2021-12-05T21:16:54.000Z | 2022-03-29T20:59:11.000Z | setup.py | DamonLee5/mbircone | 680cfd9714dce240e2060cce7a15020b1a640d65 | [
"BSD-3-Clause"
] | 1 | 2021-12-06T15:14:37.000Z | 2021-12-06T15:14:37.000Z | import os
import sys
import numpy as np
from setuptools import setup, Extension
from Cython.Distutils import build_ext
NAME = "mbircone"
VERSION = "0.1"
DESCRIPTION = "Python Package for Cone Beam reconstruction"
REQUIRES = ['numpy','Cython','psutil','Pillow'] # external package dependencies
LICENSE = "BSD-3-Clause"
... | 32.959459 | 116 | 0.603526 |
f9ada37bde699213446c46c61c7f4636655f7cb4 | 16,857 | py | Python | fairseq/modules/transformer_layer.py | mpsilfve/fairseq | eb228ee74c6bc9803eb7dbd398d8cda16c55ccd2 | [
"MIT"
] | 115 | 2021-08-25T14:58:12.000Z | 2022-03-21T11:25:36.000Z | fairseq/modules/transformer_layer.py | mpsilfve/fairseq | eb228ee74c6bc9803eb7dbd398d8cda16c55ccd2 | [
"MIT"
] | 5 | 2021-09-13T10:48:28.000Z | 2021-12-21T13:52:25.000Z | fairseq/modules/transformer_layer.py | mpsilfve/fairseq | eb228ee74c6bc9803eb7dbd398d8cda16c55ccd2 | [
"MIT"
] | 11 | 2021-08-25T16:22:07.000Z | 2021-11-24T16:26:20.000Z | # 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.
from typing import Dict, List, Optional
import torch
import torch.nn as nn
from fairseq import utils
from fairseq.modules import LayerNorm, M... | 40.42446 | 101 | 0.622649 |
5d26fb6a59d1f8bc72de6daead3774133fa10e50 | 16,617 | py | Python | flytekit/common/translator.py | fediazgon/flytekit | 2c9fab495b7daf4504a927a4077b2e6799752a4e | [
"Apache-2.0"
] | null | null | null | flytekit/common/translator.py | fediazgon/flytekit | 2c9fab495b7daf4504a927a4077b2e6799752a4e | [
"Apache-2.0"
] | null | null | null | flytekit/common/translator.py | fediazgon/flytekit | 2c9fab495b7daf4504a927a4077b2e6799752a4e | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from typing import Callable, List, Optional, Union
from flytekit.common import constants as _common_constants
from flytekit.common.utils import _dnsify
from flytekit.core.base_task import PythonTask
from flytekit.core.condition import BranchNode
from flytekit.core.context_manager im... | 41.962121 | 122 | 0.70795 |
2f538a5280c56f599990fe1448e3f1c2433341c4 | 274 | py | Python | jobs/views.py | aiventimptner/farafmb | b9ac1439698dae83d70cbfdc1e1c03146a967699 | [
"MIT"
] | 1 | 2017-04-06T09:12:45.000Z | 2017-04-06T09:12:45.000Z | jobs/views.py | aiventimptner/farafmb | b9ac1439698dae83d70cbfdc1e1c03146a967699 | [
"MIT"
] | 2 | 2017-09-07T22:09:50.000Z | 2020-06-09T14:46:30.000Z | jobs/views.py | aiventimptner/farafmb | b9ac1439698dae83d70cbfdc1e1c03146a967699 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.utils import timezone
from django.views import generic
from .models import Job
class JobList(generic.ListView):
model = Job
queryset = Job.objects.exclude(expired_on__lt=timezone.now())
ordering = '-created_on'
| 22.833333 | 65 | 0.766423 |
f5a6b93e88c5f69bb3c2ce5570e48a045ca0c456 | 8,305 | py | Python | elit/layers/embeddings/word2vec_tf.py | emorynlp/levi-graph-amr-parser | f71f1056c13181b8db31d6136451fb8d57114819 | [
"Apache-2.0"
] | 9 | 2021-07-12T22:05:47.000Z | 2022-02-22T03:10:14.000Z | elit/layers/embeddings/word2vec_tf.py | emorynlp/levi-graph-amr-parser | f71f1056c13181b8db31d6136451fb8d57114819 | [
"Apache-2.0"
] | 4 | 2021-08-31T08:28:37.000Z | 2022-03-28T05:52:14.000Z | elit/layers/embeddings/word2vec_tf.py | emorynlp/levi-graph-amr-parser | f71f1056c13181b8db31d6136451fb8d57114819 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-08-24 21:49
import os
from typing import Tuple, Union, List
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import math_ops
from elit.common.vocab_tf import VocabTF
from elit.utils.io_util import load_word2vec, get_resource
from elit.utils.tf_... | 42.15736 | 119 | 0.624925 |
d7819266695791964a62614eefc8322a5120926d | 6,683 | py | Python | src/loanforms/admin.py | Deepak27004/carecoop | 01229c1f9d1c89e595d7f4ca62a07e780522118b | [
"MIT"
] | null | null | null | src/loanforms/admin.py | Deepak27004/carecoop | 01229c1f9d1c89e595d7f4ca62a07e780522118b | [
"MIT"
] | null | null | null | src/loanforms/admin.py | Deepak27004/carecoop | 01229c1f9d1c89e595d7f4ca62a07e780522118b | [
"MIT"
] | 5 | 2017-11-06T14:15:19.000Z | 2020-10-02T14:51:37.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
# from .models import (PersonalInformation, LoanApplication, LoanPaymentShareContribution, OutStandingLoans,
# Security, Declaration, ReviewedByCoOperativeManager,
# LoanAnalysisAndApprovalByLoans, NameSignatur... | 36.519126 | 122 | 0.781984 |
27811d5c9f1561995664152fd1fa51cd0da8321f | 7,876 | py | Python | sling/myelin/tests/transformer.py | anysql/sling | d521b27f1537608ddf3d8b4281edd585ffd90545 | [
"Apache-2.0"
] | 97 | 2020-03-11T07:44:05.000Z | 2022-03-27T14:24:15.000Z | sling/myelin/tests/transformer.py | anysql/sling | d521b27f1537608ddf3d8b4281edd585ffd90545 | [
"Apache-2.0"
] | 11 | 2020-10-23T09:26:26.000Z | 2021-08-25T09:31:28.000Z | sling/myelin/tests/transformer.py | anysql/sling | d521b27f1537608ddf3d8b4281edd585ffd90545 | [
"Apache-2.0"
] | 8 | 2018-06-11T07:59:18.000Z | 2021-06-09T09:19:05.000Z | """Myelin flow definition for Transformer model."""
import numpy as np
import sling.myelin as myelin
import sling.myelin.simulator as simulator
import sling.flags as flags
flags.define('--repeat', default=1, type=int)
flags.define('--flow')
class TransformerLayer:
"""Builds a flow graph for single transformer laye... | 31.630522 | 78 | 0.677628 |
67dfd815d056f597c992ac967d7c352183f84b92 | 3,963 | py | Python | api/migrations/0111_externalpartner_externalpartnercategory_fieldreportexternalpartner_fieldreportexternalpartnercategor.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | 11 | 2018-06-11T06:05:12.000Z | 2022-03-25T09:31:44.000Z | api/migrations/0111_externalpartner_externalpartnercategory_fieldreportexternalpartner_fieldreportexternalpartnercategor.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | 498 | 2017-11-07T21:20:13.000Z | 2022-03-31T14:37:18.000Z | api/migrations/0111_externalpartner_externalpartnercategory_fieldreportexternalpartner_fieldreportexternalpartnercategor.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | 6 | 2018-04-11T13:29:50.000Z | 2020-07-16T16:52:11.000Z | # Generated by Django 2.2.13 on 2021-02-02 18:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0110_auto_20210202_0950'),
]
operations = [
migrations.CreateModel(
name='ExternalPartn... | 47.178571 | 190 | 0.597275 |
e6b3ca041aac71420aebd0db0fc4f030fcc371c2 | 327 | py | Python | 30 Days of Code/day26_nested_logic.py | quqixun/Hackerrank_Python | 024084a5a77878ce2b4b99d731be28b221f58e41 | [
"MIT"
] | 1 | 2018-11-12T01:48:22.000Z | 2018-11-12T01:48:22.000Z | Algorithm/Implementation/library_fine.py | quqixun/Hackerrank_Python | 024084a5a77878ce2b4b99d731be28b221f58e41 | [
"MIT"
] | null | null | null | Algorithm/Implementation/library_fine.py | quqixun/Hackerrank_Python | 024084a5a77878ce2b4b99d731be28b221f58e41 | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
ad, am, ay = map(int, input().strip().split(" "))
ed, em, ey = map(int, input().strip().split(" "))
hackos = 0
if ay == ey:
if am == em:
if ad > ed:
hackos = 15 * (ad - ed)
elif am > em:
hackos = 500 * (am - em)
elif ay > ey:
hackos = 10000
print(h... | 15.571429 | 49 | 0.492355 |
56e6e179440414f3cb564000e6d35fbe167f46cc | 18,177 | py | Python | t2c/lightcone.py | dprelogo/tools21cm | 760ae64dc1aea8b03d270fd473161c577dff874d | [
"MIT"
] | null | null | null | t2c/lightcone.py | dprelogo/tools21cm | 760ae64dc1aea8b03d270fd473161c577dff874d | [
"MIT"
] | null | null | null | t2c/lightcone.py | dprelogo/tools21cm | 760ae64dc1aea8b03d270fd473161c577dff874d | [
"MIT"
] | null | null | null | '''
Methods to construct lightcones.
'''
from . import const, conv
import numpy as np
import os, glob
from .helper_functions import get_mesh_size, \
determine_redshift_from_filename, get_data_and_type, print_msg, find_idx
from .density_file import DensityFile
from .vel_file import VelocityFile
from . import cosmol... | 39.601307 | 116 | 0.643561 |
2d8a82911a67282c126d2c5f110f339b65bec27f | 2,462 | py | Python | s_tsvd_smlb.py | GrzegorzMika/Morozov-in-Poisson-Processes | cd1ea799fbc49a74c442df5af1bb2390539390a5 | [
"MIT"
] | null | null | null | s_tsvd_smlb.py | GrzegorzMika/Morozov-in-Poisson-Processes | cd1ea799fbc49a74c442df5af1bb2390539390a5 | [
"MIT"
] | null | null | null | s_tsvd_smlb.py | GrzegorzMika/Morozov-in-Poisson-Processes | cd1ea799fbc49a74c442df5af1bb2390539390a5 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from EstimatorSpectrum import TSVD
from Generator import LSW
from SVD import LordWillisSpektor
from test_functions import kernel_transformed, BIMODAL, BETA, SMLA, SMLB
replications = 10
size = [2000, 10000, 1000000]
max_size = 100
functions = [SMLB]
functions_name = ['SMLB']
tau... | 52.382979 | 119 | 0.540211 |
50295356585b3bfaabe24fca61c7d7fc8b621886 | 814 | py | Python | jetset/utils.py | AAGunya/jetset | 53cb0e3e1f308273f19fd4c9b288be12447fd43d | [
"BSD-3-Clause"
] | null | null | null | jetset/utils.py | AAGunya/jetset | 53cb0e3e1f308273f19fd4c9b288be12447fd43d | [
"BSD-3-Clause"
] | null | null | null | jetset/utils.py | AAGunya/jetset | 53cb0e3e1f308273f19fd4c9b288be12447fd43d | [
"BSD-3-Clause"
] | null | null | null |
from __future__ import absolute_import, division, print_function
from builtins import (bytes, str, open, super, range,
zip, round, input, int, pow, object, map, zip)
__author__ = "Andrea Tramacere"
__all__=['check_frame','unexpetced_behaviour']
import re
def check_frame(frame):
allowed... | 21.421053 | 80 | 0.653563 |
98702bda979c837225815ddaf23193db02a42c0d | 377 | py | Python | facebook-hacker-cup-2013/beautiful-strings/beautiful-strings.py | robertdimarco/puzzles | 61e1b62700503fdb8794fba7fa5d3156e7adf72b | [
"MIT"
] | 36 | 2015-05-11T20:22:55.000Z | 2021-09-26T07:36:49.000Z | facebook-hacker-cup-2013/beautiful-strings/beautiful-strings.py | robertdimarco/puzzles | 61e1b62700503fdb8794fba7fa5d3156e7adf72b | [
"MIT"
] | null | null | null | facebook-hacker-cup-2013/beautiful-strings/beautiful-strings.py | robertdimarco/puzzles | 61e1b62700503fdb8794fba7fa5d3156e7adf72b | [
"MIT"
] | 16 | 2016-03-08T16:25:46.000Z | 2022-03-16T06:28:51.000Z | #!/usr/bin/env python
import string, sys
m = int(sys.stdin.readline())
for i in range(1, m+1):
score, line = 0, sys.stdin.readline()
line = ''.join(char for char in line.lower() if 'a' <= char <= 'z')
freq = sorted([line.count(char) for char in set(line)])
for j, num in enumerate(freq):
score += num * (26... | 31.416667 | 69 | 0.596817 |
89f601a4c321a332c6ac92deb2a76e02ea40d16e | 7,218 | py | Python | mne/io/egi/tests/test_egi.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 1 | 2020-04-25T05:01:54.000Z | 2020-04-25T05:01:54.000Z | mne/io/egi/tests/test_egi.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 23 | 2017-09-12T11:08:26.000Z | 2019-10-04T11:11:29.000Z | mne/io/egi/tests/test_egi.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 3 | 2019-01-28T13:48:00.000Z | 2019-07-10T16:02:11.000Z | # -*- coding: utf-8 -*-
# Authors: Denis A. Engemann <denis.engemann@gmail.com>
# simplified BSD-3 license
import os.path as op
import inspect
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose, assert_equal
import pytest
from scipy import io as sio
from mne import find_even... | 35.732673 | 75 | 0.62829 |
c55ffc99d2d71cb5d3cdd8f7df79bafb297c6b98 | 3,510 | py | Python | examples/nr_create_waveform_batch.py | smooresni/batchwave | d2fb66942aadee142ed5da6ee74f9fc00a6c8720 | [
"MIT"
] | 2 | 2020-08-24T11:23:26.000Z | 2021-07-21T13:22:24.000Z | examples/nr_create_waveform_batch.py | smooresni/batchwave | d2fb66942aadee142ed5da6ee74f9fc00a6c8720 | [
"MIT"
] | null | null | null | examples/nr_create_waveform_batch.py | smooresni/batchwave | d2fb66942aadee142ed5da6ee74f9fc00a6c8720 | [
"MIT"
] | 1 | 2021-07-21T13:22:27.000Z | 2021-07-21T13:22:27.000Z | """
This example shows how to create multiple waveforms by sweeping various parameters.
"""
import wfmcreator
from wfmcreator import nr
carrier_counts = [1, 2, 4, 8]
channel_bandwidths = [20e6, 50e6, 100e6]
subcarrier_spacings = [30e3]
modulation_schemes = [nr.PuschModulationType.QPSK, nr.PuschModulationType.QAM16,
... | 45 | 114 | 0.621652 |
32fa2c5ab8bd9ec130f35ee7485dba6e73b151ff | 639 | py | Python | scripts/examples/Arduino/Nicla-Vision/09-Feature-Detection/hog.py | BreederBai/openmv | cb1a97198533dd1201ba8356d1c2f3835b48a347 | [
"MIT"
] | null | null | null | scripts/examples/Arduino/Nicla-Vision/09-Feature-Detection/hog.py | BreederBai/openmv | cb1a97198533dd1201ba8356d1c2f3835b48a347 | [
"MIT"
] | 3 | 2022-03-14T07:15:42.000Z | 2022-03-31T02:52:21.000Z | scripts/examples/Arduino/Nicla-Vision/09-Feature-Detection/hog.py | BreederBai/openmv | cb1a97198533dd1201ba8356d1c2f3835b48a347 | [
"MIT"
] | null | null | null | # Histogram of Oriented Gradients (HoG) Example
#
# This example demonstrates HoG visualization.
#
# Note: Due to JPEG artifacts, the HoG visualization looks blurry. To see the
# image without JPEG artifacts, uncomment the lines that save the image to uSD.
import sensor, image, time
sensor.reset()
sensor.set_framesiz... | 24.576923 | 79 | 0.719875 |
a9fad7ba6060330d7a0c46a3e463b5ddc871aceb | 4,334 | py | Python | nikola/plugins/task/rss.py | pellenilsson/nikola | 67a944a40b35584525a1bb363b3abd85582704cb | [
"MIT"
] | null | null | null | nikola/plugins/task/rss.py | pellenilsson/nikola | 67a944a40b35584525a1bb363b3abd85582704cb | [
"MIT"
] | null | null | null | nikola/plugins/task/rss.py | pellenilsson/nikola | 67a944a40b35584525a1bb363b3abd85582704cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights t... | 41.673077 | 107 | 0.614905 |
adbf9dac85d51e26c24c07483e7bd8fe4bdede09 | 1,187 | py | Python | pyramid_handy/tweens/basic_auth.py | fangpenlin/pyramid-handy | e3cbc19224ab1f0a14aab556990bceabd2d1f658 | [
"MIT"
] | null | null | null | pyramid_handy/tweens/basic_auth.py | fangpenlin/pyramid-handy | e3cbc19224ab1f0a14aab556990bceabd2d1f658 | [
"MIT"
] | null | null | null | pyramid_handy/tweens/basic_auth.py | fangpenlin/pyramid-handy | e3cbc19224ab1f0a14aab556990bceabd2d1f658 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import base64
import binascii
def get_remote_user(request):
"""Parse basic HTTP_AUTHORIZATION and return user name
"""
if 'HTTP_AUTHORIZATION' not in request.environ:
return
authorization = request.environ['HTTP_AUTHORIZATION']
try:
authmet... | 28.261905 | 79 | 0.670598 |
be0baa53cc7bec20e3b5bd473ec706952b85454f | 2,802 | py | Python | mss_customization/install.py | sunhoww/mss_customization | c68dd6ac77a5072b756bd7aba1c4a3c9586cf4e9 | [
"MIT"
] | null | null | null | mss_customization/install.py | sunhoww/mss_customization | c68dd6ac77a5072b756bd7aba1c4a3c9586cf4e9 | [
"MIT"
] | null | null | null | mss_customization/install.py | sunhoww/mss_customization | c68dd6ac77a5072b756bd7aba1c4a3c9586cf4e9 | [
"MIT"
] | 1 | 2018-03-15T13:49:35.000Z | 2018-03-15T13:49:35.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
settings_accounts = {
'loan_account': {
'account_name': 'Loans on Collateral',
'parent_account': 'Loans and Advances (Assets)',
},
'interest_income_account': {
'account_name': 'Interests on Loans',
... | 29.808511 | 77 | 0.592434 |
e86c7cb06f3f5a132b086eac50c8282f6b5444ee | 7,143 | py | Python | fastdl/downloader.py | r-salas/fastdl | 8bb63c8b9cf87b0ae7987ffd4b3ae25816007b43 | [
"MIT"
] | 3 | 2021-08-25T09:47:41.000Z | 2021-09-27T03:05:00.000Z | fastdl/downloader.py | r-salas/fastdl | 8bb63c8b9cf87b0ae7987ffd4b3ae25816007b43 | [
"MIT"
] | null | null | null | fastdl/downloader.py | r-salas/fastdl | 8bb63c8b9cf87b0ae7987ffd4b3ae25816007b43 | [
"MIT"
] | 1 | 2021-09-27T03:05:10.000Z | 2021-09-27T03:05:10.000Z | #
#
# Downloader
#
#
import os
import warnings
from .config import conf
from .hasher import validate_file
from .extractor import extract_file, can_extract
from .utils import splitext, guess_extension, filename_from_url
from tqdm.auto import tqdm
from urllib.request import urlopen, Request
from urllib.error import... | 37.203125 | 118 | 0.654067 |
a5fc7fac6aa51c0fa279a66ed698b75b4d61b9b6 | 50,875 | py | Python | seaborn/matrix.py | vinayakreddy/seaborn | 0fba83b47c7a2650f5549bd9b551d4057fb3c97a | [
"BSD-3-Clause"
] | 1 | 2020-08-05T10:55:54.000Z | 2020-08-05T10:55:54.000Z | seaborn/matrix.py | vinayakreddy/seaborn | 0fba83b47c7a2650f5549bd9b551d4057fb3c97a | [
"BSD-3-Clause"
] | null | null | null | seaborn/matrix.py | vinayakreddy/seaborn | 0fba83b47c7a2650f5549bd9b551d4057fb3c97a | [
"BSD-3-Clause"
] | null | null | null | """Functions to visualize matrices of data."""
from __future__ import division
import itertools
import warnings
import matplotlib as mpl
from matplotlib.collections import LineCollection
import matplotlib.pyplot as plt
from matplotlib import gridspec
import numpy as np
import pandas as pd
from scipy.cluster import hie... | 36.732852 | 97 | 0.593592 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.