hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a1179d145b552985cec412737cba87b50083678 | 16,704 | py | Python | third_party/blink/tools/blinkpy/w3c/import_notifier.py | iridium-browser/iridium-browser | 907e31cf5ce5ad14d832796e3a7c11e496828959 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 575 | 2015-06-18T23:58:20.000Z | 2022-03-23T09:32:39.000Z | third_party/blink/tools/blinkpy/w3c/import_notifier.py | iridium-browser/iridium-browser | 907e31cf5ce5ad14d832796e3a7c11e496828959 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | third_party/blink/tools/blinkpy/w3c/import_notifier.py | iridium-browser/iridium-browser | 907e31cf5ce5ad14d832796e3a7c11e496828959 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 52 | 2015-07-14T10:40:50.000Z | 2022-03-15T01:11:49.000Z | # Copyright 2017 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.
"""Sends notifications after automatic imports from web-platform-tests (WPT).
Automatically file bugs for new failures caused by WPT imports for opted-in
dir... | 43.162791 | 127 | 0.618475 |
4a117ad1dd74f72110c2751da884837fc80feb72 | 4,121 | py | Python | prep.py | jskrable/sarcasm-detection | d6bce5a6c428b6899194358b09ba94246908d483 | [
"Apache-2.0"
] | null | null | null | prep.py | jskrable/sarcasm-detection | d6bce5a6c428b6899194358b09ba94246908d483 | [
"Apache-2.0"
] | null | null | null | prep.py | jskrable/sarcasm-detection | d6bce5a6c428b6899194358b09ba94246908d483 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
"""
title: main.py
date: 2019-11-23
author: jskrable
description: Preprocessing
"""
import os
import re
import json
from pyspark import SparkContext
from pyspark.sql import SQLContext, Row
from pyspark.sql.types import ArrayType, StringType
from pyspark.sql.functions import lit, ... | 30.753731 | 120 | 0.646445 |
4a117ae2a800528dfcc580391edfc1fe8715d518 | 1,271 | py | Python | will/backends/storage/base.py | Ashex/will | eb57878db8c4e13a69ea670b9fda78daeea31436 | [
"MIT"
] | 349 | 2015-01-15T05:12:02.000Z | 2022-01-11T09:21:01.000Z | will/backends/storage/base.py | Ashex/will | eb57878db8c4e13a69ea670b9fda78daeea31436 | [
"MIT"
] | 350 | 2015-01-02T16:33:14.000Z | 2022-02-06T17:34:34.000Z | will/backends/storage/base.py | chillipeper/will | 4bd9a3f5cc4e2ea822cbf4f7a6f04996b3f20449 | [
"MIT"
] | 184 | 2015-01-08T13:20:50.000Z | 2021-12-31T05:57:21.000Z | import logging
import redis
from six.moves.urllib.parse import urlparse
from will.mixins import SettingsMixin, EncryptionMixin
class PrivateBaseStorageBackend(SettingsMixin, EncryptionMixin, object):
required_settings = []
def save(self, key, value, *args, **kwargs):
self.do_save(key, self.encrypt(va... | 30.261905 | 106 | 0.678206 |
4a117bb118238ce93c1e7c589fcc7079f88d06a0 | 4,402 | py | Python | nova/db/sqlalchemy/migrate_repo/versions/030_multi_nic.py | xushiwei/nova | f27956708b0aaeabb06125e6a72b4d61747934b7 | [
"Apache-2.0"
] | 1 | 2021-11-08T10:11:44.000Z | 2021-11-08T10:11:44.000Z | nova/db/sqlalchemy/migrate_repo/versions/030_multi_nic.py | xushiwei/nova | f27956708b0aaeabb06125e6a72b4d61747934b7 | [
"Apache-2.0"
] | null | null | null | nova/db/sqlalchemy/migrate_repo/versions/030_multi_nic.py | xushiwei/nova | f27956708b0aaeabb06125e6a72b4d61747934b7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack LLC.
# 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... | 34.936508 | 78 | 0.655838 |
4a117bea598a74e1c7f55d3c34c057b0911404ff | 5,848 | py | Python | docs/conf.py | flavio-fernandes/Adafruit_CircuitPython_PyPortal | 2ac9269ee959a1c8a04547328d87d2e536971f47 | [
"MIT"
] | 1 | 2020-12-30T22:07:09.000Z | 2020-12-30T22:07:09.000Z | docs/conf.py | flavio-fernandes/Adafruit_CircuitPython_PyPortal | 2ac9269ee959a1c8a04547328d87d2e536971f47 | [
"MIT"
] | null | null | null | docs/conf.py | flavio-fernandes/Adafruit_CircuitPython_PyPortal | 2ac9269ee959a1c8a04547328d87d2e536971f47 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
exten... | 28.666667 | 85 | 0.661252 |
4a117c8a427eb98683593f58ddf0374d22ae3a38 | 12,635 | py | Python | magnet/training/train.py | ysglh/magnet | cd37f0ebe46a17e0948158795c6715a60c34b9db | [
"MIT"
] | 343 | 2018-09-03T09:59:36.000Z | 2022-02-08T11:32:34.000Z | magnet/training/train.py | ysglh/magnet | cd37f0ebe46a17e0948158795c6715a60c34b9db | [
"MIT"
] | 7 | 2018-09-04T07:03:11.000Z | 2019-03-21T07:17:14.000Z | magnet/training/train.py | ysglh/magnet | cd37f0ebe46a17e0948158795c6715a60c34b9db | [
"MIT"
] | 23 | 2018-09-03T19:12:04.000Z | 2021-02-20T09:23:30.000Z | from torch import optim
from contextlib import contextmanager
class Trainer:
r"""Abstract base class for training models.
The Trainer class makes it incredibly simple and convinient to train,
monitor, debug and checkpoint entire Deep Learning projects.
Simply define your training loop by
implemen... | 36.836735 | 129 | 0.627622 |
4a117d94f01a88675e241504708fe678bcf9d1c5 | 69,362 | py | Python | trace/google/cloud/trace_v2/proto/trace_pb2.py | conwaychriscosmo/google-cloud-python | 8e7b7f8a5f4bb04d13f4d88ec3848f017faf834a | [
"Apache-2.0"
] | 1 | 2019-03-26T21:44:51.000Z | 2019-03-26T21:44:51.000Z | trace/google/cloud/trace_v2/proto/trace_pb2.py | conwaychriscosmo/google-cloud-python | 8e7b7f8a5f4bb04d13f4d88ec3848f017faf834a | [
"Apache-2.0"
] | 1 | 2019-03-29T22:03:48.000Z | 2019-04-02T22:24:45.000Z | trace/google/cloud/trace_v2/proto/trace_pb2.py | conwaychriscosmo/google-cloud-python | 8e7b7f8a5f4bb04d13f4d88ec3848f017faf834a | [
"Apache-2.0"
] | 1 | 2019-03-29T18:26:16.000Z | 2019-03-29T18:26:16.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/devtools/cloudtrace_v2/proto/trace.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import mes... | 36.050936 | 5,317 | 0.618393 |
4a117ebda0bc2968e2262aec9b8ed8214f722511 | 14,462 | py | Python | laske_export/tests/test_party.py | joonvena/mvj | 2191a6e23067f8e7fdda2bcbfe5e80a5dd749abc | [
"MIT"
] | 1 | 2021-01-12T08:14:10.000Z | 2021-01-12T08:14:10.000Z | laske_export/tests/test_party.py | joonvena/mvj | 2191a6e23067f8e7fdda2bcbfe5e80a5dd749abc | [
"MIT"
] | 249 | 2017-04-18T14:00:13.000Z | 2022-03-30T12:18:03.000Z | laske_export/tests/test_party.py | joonvena/mvj | 2191a6e23067f8e7fdda2bcbfe5e80a5dd749abc | [
"MIT"
] | 7 | 2017-04-18T08:43:54.000Z | 2021-07-28T07:29:30.000Z | import pytest
from django.core.exceptions import ValidationError
from laske_export.document.sales_order import Party
from leasing.enums import ContactType
@pytest.mark.django_db
@pytest.mark.parametrize(
"first_name, last_name, expected1, expected2, expected3, expected4",
[
(
# Name
... | 29.514286 | 94 | 0.567626 |
4a117f675a40626253635f35c641fa836e79b5b7 | 847 | py | Python | venues/migrations/0028_auto_20201014_1424.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 18 | 2018-12-06T01:46:37.000Z | 2021-10-17T10:37:17.000Z | venues/migrations/0028_auto_20201014_1424.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 194 | 2018-11-04T12:50:49.000Z | 2022-01-06T22:43:43.000Z | venues/migrations/0028_auto_20201014_1424.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 7 | 2019-03-18T05:36:06.000Z | 2020-12-25T03:27:29.000Z | # Generated by Django 3.0.8 on 2020-10-14 14:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("venues", "0027_auto_20200124_2059"),
]
operations = [
migrations.AddField(
model_name="venue",
name="tap_list_last_c... | 26.46875 | 80 | 0.539551 |
4a117fc2ea178ffe8c3df421213deb7d232befcc | 32,395 | py | Python | src/_pytest/main.py | MarkHoo/pytest | 04be900d0677791d97e955b42440627b1818fbcb | [
"MIT"
] | null | null | null | src/_pytest/main.py | MarkHoo/pytest | 04be900d0677791d97e955b42440627b1818fbcb | [
"MIT"
] | null | null | null | src/_pytest/main.py | MarkHoo/pytest | 04be900d0677791d97e955b42440627b1818fbcb | [
"MIT"
] | null | null | null | """Core implementation of the testing process: init, session, runtest loop."""
import argparse
import fnmatch
import functools
import importlib
import os
import sys
from pathlib import Path
from typing import Callable
from typing import Dict
from typing import FrozenSet
from typing import Iterator
from typing import Li... | 35.874862 | 105 | 0.588115 |
4a1180ad7a49be9881a495ddaa72e1ca9367016e | 11,229 | py | Python | Lib/site-packages/django/contrib/gis/geos/prototypes/io.py | Lucas11200/LocaPy | 5d1f214c091aa3703b2ff7d3c0713a91ed4a1f48 | [
"bzip2-1.0.6"
] | 61,676 | 2015-01-01T00:05:13.000Z | 2022-03-31T20:37:54.000Z | checkerista/.env/Lib/site-packages/django/contrib/gis/geos/prototypes/io.py | LybaFatimaNasir/CS311S20PID02 | bc29a8c4c9ee508c74d231c015a57b1ca4dfcb39 | [
"MIT"
] | 8,884 | 2015-01-01T00:12:05.000Z | 2022-03-31T19:53:11.000Z | checkerista/.env/Lib/site-packages/django/contrib/gis/geos/prototypes/io.py | LybaFatimaNasir/CS311S20PID02 | bc29a8c4c9ee508c74d231c015a57b1ca4dfcb39 | [
"MIT"
] | 33,143 | 2015-01-01T02:04:52.000Z | 2022-03-31T19:42:46.000Z | import threading
from ctypes import POINTER, Structure, byref, c_byte, c_char_p, c_int, c_size_t
from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.libgeos import (
GEOM_PTR, GEOSFuncFactory, geos_version_tuple,
)
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom,... | 33.026471 | 113 | 0.711996 |
4a1180c9d8e45a61a939851401ad7d5f0e1daf16 | 1,814 | py | Python | data_structures/stacks/infix_to_postfix_conversion.py | jenia90/Python | 696fb4a681ad9e4d84e0d2b894daf449a3e30b24 | [
"MIT"
] | 14 | 2020-10-03T05:43:48.000Z | 2021-11-01T21:02:26.000Z | data_structures/stacks/infix_to_postfix_conversion.py | jenia90/Python | 696fb4a681ad9e4d84e0d2b894daf449a3e30b24 | [
"MIT"
] | 2 | 2021-07-09T21:23:47.000Z | 2021-08-06T02:47:29.000Z | data_structures/stacks/infix_to_postfix_conversion.py | jenia90/Python | 696fb4a681ad9e4d84e0d2b894daf449a3e30b24 | [
"MIT"
] | 12 | 2020-10-03T05:44:19.000Z | 2022-01-16T05:37:54.000Z | import string
from .stack import Stack
__author__ = "Omkar Pathak"
def is_operand(char):
return char in string.ascii_letters or char in string.digits
def precedence(char):
"""Return integer value representing an operator's precedence, or
order of operation.
https://en.wikipedia.org/wiki/Order_of_... | 30.233333 | 88 | 0.605292 |
4a1181350a3b3613c9c5fcc8a0f82316360aae54 | 2,239 | py | Python | simple-backend/nlpviewer_backend/models.py | gxchris95/stave | 12239c189723d7325994e75fd1eb3e88364aaa32 | [
"Apache-2.0"
] | null | null | null | simple-backend/nlpviewer_backend/models.py | gxchris95/stave | 12239c189723d7325994e75fd1eb3e88364aaa32 | [
"Apache-2.0"
] | null | null | null | simple-backend/nlpviewer_backend/models.py | gxchris95/stave | 12239c189723d7325994e75fd1eb3e88364aaa32 | [
"Apache-2.0"
] | null | null | null | from django.db import models
<<<<<<< HEAD
from django.contrib.auth.models import User
class Project(models.Model):
# project: name, ontology, config
# realtionship:
# - Project.document
# - User
name = models.CharField(max_length=200)
project_type = models.CharField(max_length=100, default='s... | 26.034884 | 74 | 0.621259 |
4a11816a3be02fddedb19640f0b279f5c206107f | 4,821 | py | Python | src/olympia/shelves/tests/test_views.py | imsahil007/addons-server | 6cdaebe2b67110ad87c8d87558753bb93e41b036 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/shelves/tests/test_views.py | imsahil007/addons-server | 6cdaebe2b67110ad87c8d87558753bb93e41b036 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/shelves/tests/test_views.py | imsahil007/addons-server | 6cdaebe2b67110ad87c8d87558753bb93e41b036 | [
"BSD-3-Clause"
] | null | null | null | import json
from django.conf import settings
from olympia import amo
from olympia.amo.tests import addon_factory, ESTestCase, reverse_ns
from olympia.constants.promoted import RECOMMENDED
from olympia.promoted.models import PromotedAddon
from olympia.shelves.models import Shelf, ShelfManagement
class TestShelfViewS... | 38.879032 | 77 | 0.624767 |
4a1182c2344c406e99d8b9dfc30ec1f5db2bf0d8 | 3,444 | py | Python | unidef/models/base_model.py | qiujiangkun/unidef | 6d3ca31a6b1d498f38f483d4174f79f7fe920f65 | [
"MIT"
] | 4 | 2021-11-08T10:01:19.000Z | 2022-03-17T06:27:14.000Z | unidef/models/base_model.py | qiujiangkun/unidef | 6d3ca31a6b1d498f38f483d4174f79f7fe920f65 | [
"MIT"
] | null | null | null | unidef/models/base_model.py | qiujiangkun/unidef | 6d3ca31a6b1d498f38f483d4174f79f7fe920f65 | [
"MIT"
] | null | null | null | import copy
from unidef.utils.typing_ext import *
from typedmodel import *
from typedmodel.compat import *
from .typed_field import FieldValue, TypedField
class MixedModel(BaseModel):
extended: Dict[str, Any] = {}
frozen: bool = False
def __init__(self, **kwargs):
super().__init__(**kwargs)
... | 28.229508 | 97 | 0.58856 |
4a11858ef8ff13889d910ceac97c0c42fd259830 | 42,451 | py | Python | Blender/src/babylon-js/mesh.py | leroyron/Exporters | 663e3598046a485942ffcdf9eedfd4dce9c7b682 | [
"Apache-2.0"
] | null | null | null | Blender/src/babylon-js/mesh.py | leroyron/Exporters | 663e3598046a485942ffcdf9eedfd4dce9c7b682 | [
"Apache-2.0"
] | null | null | null | Blender/src/babylon-js/mesh.py | leroyron/Exporters | 663e3598046a485942ffcdf9eedfd4dce9c7b682 | [
"Apache-2.0"
] | null | null | null | from .logger import *
from .package_level import *
from .f_curve_animatable import *
from .armature import *
from .material import *
from .shape_key_group import *
import bpy
import math
from mathutils import Vector, Quaternion
from random import randint
# used in Mesh & Node constructors, defined in BA... | 43.990674 | 225 | 0.561447 |
4a11861b6c80b1a0bda07783f4235941dd68a16f | 1,242 | py | Python | vertex_metrics_experiment/code/results.py | wethepeopleonline/law-net | e8b01136360078c89b666e2b127672644ed0c54b | [
"MIT"
] | 17 | 2016-09-02T19:39:11.000Z | 2021-11-15T21:22:48.000Z | vertex_metrics_experiment/code/results.py | wethepeopleonline/law-net | e8b01136360078c89b666e2b127672644ed0c54b | [
"MIT"
] | 7 | 2016-09-04T17:19:13.000Z | 2017-01-19T19:17:10.000Z | vertex_metrics_experiment/code/results.py | idc9/law-net | e8b01136360078c89b666e2b127672644ed0c54b | [
"MIT"
] | 8 | 2017-01-19T04:24:09.000Z | 2021-09-13T20:22:58.000Z | import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
def plot_scores(results, exper='', metric='', network_name=''):
"""
plots the results
"""
# compute mean and std of data
data = pd.DataFrame(index=results.columns, columns=['score', 'error'])
data['score'] = results.median(... | 25.346939 | 74 | 0.582126 |
4a1186f7bc8641324d8eff052d5b843bf7a8a0f4 | 1,331 | py | Python | alg/gain/runner.py | gmbhat/tsgan | 4d5ed046a924995dd770832a2010779a8700f97f | [
"BSD-3-Clause"
] | null | null | null | alg/gain/runner.py | gmbhat/tsgan | 4d5ed046a924995dd770832a2010779a8700f97f | [
"BSD-3-Clause"
] | null | null | null | alg/gain/runner.py | gmbhat/tsgan | 4d5ed046a924995dd770832a2010779a8700f97f | [
"BSD-3-Clause"
] | 2 | 2021-10-04T03:13:00.000Z | 2022-01-05T22:41:22.000Z | import os
print("enter command: ")
command = input()
if "-i all" in command:
command1 = command.replace("-i all", "-i stretch_missing_train.csv")
command1 = "cmd /k python gain.py " + command1
print("-------------- running stretch_missing_train.csv --------------")
os.system(command1)
print("-------------- done ... | 30.25 | 78 | 0.601052 |
4a118865212a0a197fc347d6630bb49ab0218b75 | 4,001 | py | Python | tests/test_m3u_archive.py | elijahjpassmore/m3u-archive | fb7f4b103e7885c8628163e9ab462d99813a379b | [
"MIT"
] | null | null | null | tests/test_m3u_archive.py | elijahjpassmore/m3u-archive | fb7f4b103e7885c8628163e9ab462d99813a379b | [
"MIT"
] | null | null | null | tests/test_m3u_archive.py | elijahjpassmore/m3u-archive | fb7f4b103e7885c8628163e9ab462d99813a379b | [
"MIT"
] | null | null | null | import filecmp
import os
from distutils.dir_util import copy_tree
from pathlib import Path
import pytest
from m3u_archive import __author__, __email__, __license__, __version__
from m3u_archive.m3u_archive_writer import M3UArchiveWriter
def test_version():
assert __version__ == "1.0.0"
def test_author() -> No... | 33.90678 | 76 | 0.673832 |
4a118903e5a69ed2eae1baeb6e9cc19ab31a76b3 | 328 | py | Python | yolox/data/datasets/voc_classes.py | StephenStorm/YOLOX | 9b03f2c8c65ebde8c3fc6131827e11418686fb0b | [
"Apache-2.0"
] | null | null | null | yolox/data/datasets/voc_classes.py | StephenStorm/YOLOX | 9b03f2c8c65ebde8c3fc6131827e11418686fb0b | [
"Apache-2.0"
] | null | null | null | yolox/data/datasets/voc_classes.py | StephenStorm/YOLOX | 9b03f2c8c65ebde8c3fc6131827e11418686fb0b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
# VOC_CLASSES = ( '__background__', # always index 0
VOC_CLASSES = (
"beasts",
"bird",
"fish",
"insect",
"plant",
"person",
)
# class_map = {0:'beasts', 1:'bird', 2:'fish', 3:'insect', 4:'plant', 5:'p... | 21.866667 | 81 | 0.567073 |
4a1189375bf29d6cc90ae1d9b3de4843eaa84a0c | 732 | py | Python | setup.py | AGI-Labs/continual_rl | bcf17d879e8a983340be233ff8f740c424d0f303 | [
"MIT"
] | 19 | 2021-07-27T05:20:09.000Z | 2022-02-27T07:12:05.000Z | setup.py | AGI-Labs/continual_rl | bcf17d879e8a983340be233ff8f740c424d0f303 | [
"MIT"
] | 2 | 2021-11-05T07:36:50.000Z | 2022-03-11T00:21:50.000Z | setup.py | AGI-Labs/continual_rl | bcf17d879e8a983340be233ff8f740c424d0f303 | [
"MIT"
] | 3 | 2021-10-20T06:04:35.000Z | 2022-03-06T22:59:36.000Z | from setuptools import setup, find_packages
setup(
name='continual_rl',
version='1.0',
description='Continual reinforcement learning baselines and standard experiments.',
author='Sam Powers',
author_email='snpowers@cs.cmu.edu',
packages=find_packages(),
py_modules=['continual_rl.available_p... | 31.826087 | 87 | 0.497268 |
4a11895a712ac584ef4c59394371b8b49060ce66 | 516 | py | Python | egs/wsj/s5/utils/lang/bpe/prepend_words.py | shuipi100/kaldi | 8e30fddb300a87e7c79ef2c0b9c731a8a9fd23f0 | [
"Apache-2.0"
] | 370 | 2020-05-31T16:28:08.000Z | 2022-03-24T07:27:50.000Z | egs/wsj/s5/utils/lang/bpe/prepend_words.py | shuipi100/kaldi | 8e30fddb300a87e7c79ef2c0b9c731a8a9fd23f0 | [
"Apache-2.0"
] | 55 | 2020-10-20T02:18:56.000Z | 2021-07-26T04:52:23.000Z | egs/wsj/s5/utils/lang/bpe/prepend_words.py | shuipi100/kaldi | 8e30fddb300a87e7c79ef2c0b9c731a8a9fd23f0 | [
"Apache-2.0"
] | 119 | 2020-06-08T11:27:09.000Z | 2022-03-31T05:31:53.000Z | #!/usr/bin/env python3
# This script, prepend '|' to every words in the transcript to mark
# the beginning of the words for finding the initial-space of every word
# after decoding.
import sys
import io
import re
whitespace = re.compile("[ \t]+")
infile = io.TextIOWrapper(sys.stdin.buffer, encoding='latin-1')
output... | 30.352941 | 72 | 0.70155 |
4a11896ffe61382a044537ead98f442849ad7717 | 802 | py | Python | unittests/utils/test_statistics.py | tonio73/dnnviewer | 2abb89665d1d99cdb5d8b6d85d0353dc22d226f4 | [
"MIT"
] | 12 | 2020-03-22T20:57:40.000Z | 2022-02-25T13:47:07.000Z | unittests/utils/test_statistics.py | tonio73/dnnviewer | 2abb89665d1d99cdb5d8b6d85d0353dc22d226f4 | [
"MIT"
] | 59 | 2020-03-24T20:51:13.000Z | 2020-07-05T14:52:53.000Z | unittests/utils/test_statistics.py | tonio73/dnnviewer | 2abb89665d1d99cdb5d8b6d85d0353dc22d226f4 | [
"MIT"
] | 3 | 2020-04-01T17:00:58.000Z | 2020-09-29T03:18:55.000Z | import numpy as np
from dnnviewer.utils import statistics
def test_get_dense_strongest_weights():
weights = np.array([[1, 2], [2, 3], [3, 2]])
strongest_idx, strongest = statistics.get_strongest(weights, 1)
assert (strongest_idx.shape == (1, 2))
assert ((strongest_idx == np.array([[2, 1]])).all())
... | 32.08 | 70 | 0.609726 |
4a1189c191d78b55a30c13d1fb76068fd5a689a0 | 12,129 | py | Python | fastlmmhpc/pyplink/snpreader/Bed.py | epiproject/FaST-LMM-HPC | 5d6df81268aeff19015194ab0718a9163b8d33af | [
"Apache-2.0"
] | 2 | 2019-12-10T09:55:40.000Z | 2019-12-11T20:58:10.000Z | fastlmmhpc/pyplink/snpreader/Bed.py | epiproject/FaST-LMM-HPC | 5d6df81268aeff19015194ab0718a9163b8d33af | [
"Apache-2.0"
] | null | null | null | fastlmmhpc/pyplink/snpreader/Bed.py | epiproject/FaST-LMM-HPC | 5d6df81268aeff19015194ab0718a9163b8d33af | [
"Apache-2.0"
] | null | null | null | import numpy as SP
import subprocess, sys, os.path
from itertools import *
from fastlmmhpc.pyplink.snpset import *
from fastlmmhpc.pyplink.altset_list import *
import pandas as pd
import fastlmmhpc.util.preprocess as util
import logging
WRAPPED_PLINK_PARSER_PRESENT = None
def decide_once_on_plink_reader():
#This ... | 44.591912 | 163 | 0.610932 |
4a118afab6a0a0aab9034c58a5b2946aa80f34a5 | 1,463 | py | Python | socialregistration/contrib/openid/client.py | mpdaugherty/django-socialregistration-with-google-apps | 988c627995d48a0f861b1156401fe3e5e4c91826 | [
"MIT"
] | 1 | 2019-08-14T21:14:03.000Z | 2019-08-14T21:14:03.000Z | socialregistration/contrib/openid/client.py | mpdaugherty/django-socialregistration-with-google-apps | 988c627995d48a0f861b1156401fe3e5e4c91826 | [
"MIT"
] | null | null | null | socialregistration/contrib/openid/client.py | mpdaugherty/django-socialregistration-with-google-apps | 988c627995d48a0f861b1156401fe3e5e4c91826 | [
"MIT"
] | null | null | null | from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from openid.consumer import consumer
from socialregistration.clients import Client
from socialregistration.contrib.openid.storage import OpenIDStore
from socialregistration.settings import SESSION_KEY
import urlparse
class OpenID... | 32.511111 | 84 | 0.702666 |
4a118bcf1e32e4f93af2b4b58a8d777b76919230 | 3,268 | py | Python | src/sources/readnovelfull.py | Epicpkmn11/lightnovel-crawler | 6fc0bbd4970a669a7921819d98b00da5a177d4cc | [
"Apache-2.0"
] | 1 | 2019-03-10T13:02:23.000Z | 2019-03-10T13:02:23.000Z | src/sources/readnovelfull.py | Epicpkmn11/lightnovel-crawler | 6fc0bbd4970a669a7921819d98b00da5a177d4cc | [
"Apache-2.0"
] | 2 | 2021-06-08T21:01:15.000Z | 2021-09-08T01:45:07.000Z | src/sources/readnovelfull.py | Epicpkmn11/lightnovel-crawler | 6fc0bbd4970a669a7921819d98b00da5a177d4cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import logging
import re
from ..utils.crawler import Crawler
logger = logging.getLogger('READNOVELFULL')
search_url = 'https://readnovelfull.com/search?keyword=%s'
full_chapter_url = 'https://readnovelfull.com/ajax/chapter-archive?novelId=%s'
class ReadNovelFullCrawler(Crawler):
... | 34.041667 | 88 | 0.550796 |
4a118d2b42f36c6842f103beb33c4b3b7bce95bc | 2,342 | py | Python | shrapnel/polls/migrations/0001_create_poll_models.py | BLG411-Group6/shrapnel-api | 0cb1d6b1f4d57837c99f867d8ac80095de3e7330 | [
"Apache-2.0"
] | null | null | null | shrapnel/polls/migrations/0001_create_poll_models.py | BLG411-Group6/shrapnel-api | 0cb1d6b1f4d57837c99f867d8ac80095de3e7330 | [
"Apache-2.0"
] | 4 | 2021-03-19T04:38:51.000Z | 2021-06-09T18:49:10.000Z | shrapnel/polls/migrations/0001_create_poll_models.py | BLG411-Group6/shrapnel-api | 0cb1d6b1f4d57837c99f867d8ac80095de3e7330 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2 on 2019-12-03 20:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_... | 45.038462 | 159 | 0.615713 |
4a118e70b0cc59e0deaf1ba0d80c6dcbed0ec055 | 2,675 | py | Python | scripts/release/run_trigger_job.py | rhaschke/ros_buildfarm | 85dfccd37a590ebd5eb64966e0fab54032f6b981 | [
"Apache-2.0"
] | 57 | 2015-03-30T20:37:58.000Z | 2022-03-18T10:51:53.000Z | scripts/release/run_trigger_job.py | rhaschke/ros_buildfarm | 85dfccd37a590ebd5eb64966e0fab54032f6b981 | [
"Apache-2.0"
] | 680 | 2015-01-02T17:59:37.000Z | 2022-03-30T17:08:52.000Z | scripts/release/run_trigger_job.py | rhaschke/ros_buildfarm | 85dfccd37a590ebd5eb64966e0fab54032f6b981 | [
"Apache-2.0"
] | 107 | 2015-02-01T03:30:01.000Z | 2022-03-08T00:36:49.000Z | #!/usr/bin/env python3
# Copyright 2014-2015 Open Source Robotics Foundation, 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
#
# Unle... | 38.214286 | 76 | 0.804486 |
4a118f04c0bbe52b576cf244b8fc711216b27b01 | 196 | py | Python | Scraping/espirito_santo.py | Insper-Data/data_bcg_news | 49986db18095759adea00bb0dedc149acebb683b | [
"MIT"
] | null | null | null | Scraping/espirito_santo.py | Insper-Data/data_bcg_news | 49986db18095759adea00bb0dedc149acebb683b | [
"MIT"
] | null | null | null | Scraping/espirito_santo.py | Insper-Data/data_bcg_news | 49986db18095759adea00bb0dedc149acebb683b | [
"MIT"
] | null | null | null | import time
from selenium import webdriver
from selenium import webdriver
driver = webdriver.Firefox(executable_path= r"C:\Users\siddhartha\Downloads\geckodriver-v0.25.0-win64\geckodriver.exe")
| 32.666667 | 119 | 0.826531 |
4a118f33d6de219067c3589b3c1818a465e11f61 | 1,636 | py | Python | api/app.py | fuerederp/microblog-api | 894cd9184c8f80fb47d685a70f0e2bd357cf3560 | [
"MIT"
] | null | null | null | api/app.py | fuerederp/microblog-api | 894cd9184c8f80fb47d685a70f0e2bd357cf3560 | [
"MIT"
] | null | null | null | api/app.py | fuerederp/microblog-api | 894cd9184c8f80fb47d685a70f0e2bd357cf3560 | [
"MIT"
] | null | null | null | from flask import Flask, redirect, url_for
from alchemical.flask import Alchemical
from flask_migrate import Migrate
from flask_marshmallow import Marshmallow
from flask_cors import CORS
from flask_mail import Mail
from apifairy import APIFairy
from config import Config
db = Alchemical()
migrate = Migrate()
ma = Marsh... | 27.266667 | 60 | 0.677873 |
4a118fe18b9a894716d8760eb0ecf4f6477c8b65 | 12,521 | py | Python | examples/multimodal/layoutlm/funsd.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/multimodal/layoutlm/funsd.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/multimodal/layoutlm/funsd.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import paddle
from paddle.io import Dataset
logger = logging.getLogger(__name__)
import numpy as np
class FunsdDataset(Dataset):
def __init__(self, args, tokenizer, labels, pad_token_label_id, mode):
logger.info("Creating features from dataset file at %s", args.data_dir)
... | 39.374214 | 109 | 0.548279 |
4a1191df0714d9a91e86628b15ed5cef462f960a | 213 | py | Python | jetblack_datemath/weekdays.py | rob-blackbourn/jetblack-datemath | d2e51fb7ec9b2a49cb335e2ad788e793bb62a3a9 | [
"Apache-2.0"
] | null | null | null | jetblack_datemath/weekdays.py | rob-blackbourn/jetblack-datemath | d2e51fb7ec9b2a49cb335e2ad788e793bb62a3a9 | [
"Apache-2.0"
] | null | null | null | jetblack_datemath/weekdays.py | rob-blackbourn/jetblack-datemath | d2e51fb7ec9b2a49cb335e2ad788e793bb62a3a9 | [
"Apache-2.0"
] | null | null | null | """Week days"""
from enum import IntEnum
class DayOfWeek(IntEnum):
"""The days of the week"""
MONDAY = 0
TUESDAY = 1
WEDNESDAY = 2
THURSDAY = 3
FRIDAY = 4
SATURDAY = 5
SUNDAY = 6
| 15.214286 | 30 | 0.577465 |
4a1193a7df35c9873f4b5325fd3b63f57d88b803 | 951 | py | Python | iAS/core/devicemgt/Device.py | menaka121/team---iAS | b7ec04982425a0e3c590011a951e678db499c84a | [
"Apache-2.0"
] | null | null | null | iAS/core/devicemgt/Device.py | menaka121/team---iAS | b7ec04982425a0e3c590011a951e678db499c84a | [
"Apache-2.0"
] | null | null | null | iAS/core/devicemgt/Device.py | menaka121/team---iAS | b7ec04982425a0e3c590011a951e678db499c84a | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Team - iAS, University Of Peradeniya
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.964286 | 74 | 0.677182 |
4a1193ffcf4f587b2ebcb0b48dd91207ccdf45e4 | 15,904 | py | Python | app/databaseFuctions.py | scavicchio/easyWaltonTracker | 05fd5b12e9e6d9e21f7209baca3b8137c013f002 | [
"MIT"
] | 2 | 2018-05-10T04:50:11.000Z | 2018-05-10T04:50:13.000Z | app/databaseFuctions.py | scavicchio/easyWaltonTracker | 05fd5b12e9e6d9e21f7209baca3b8137c013f002 | [
"MIT"
] | 5 | 2018-06-11T22:23:06.000Z | 2020-02-28T02:20:52.000Z | app/databaseFuctions.py | scavicchio/easyWaltonTracker | 05fd5b12e9e6d9e21f7209baca3b8137c013f002 | [
"MIT"
] | null | null | null | import pymysql.cursors
# Lets make some global vars
with open("clientinfo.txt", "r") as ins:
data = []
for line in ins:
data.append(line)
host = data[0].strip()
port = data[1].strip()
dbUser = data[2].strip()
dbPassword = data[3].strip()
database = data[4].strip()
username = data[5].strip()
pass... | 30.409178 | 163 | 0.674736 |
4a1194e996a93c25f56a95f153c1484df0de6a8c | 4,547 | py | Python | arcade/particle.py | LiorAvrahami/arcade | fce254a9eb89629de1f99d57a63759a2953184e9 | [
"MIT"
] | 1 | 2020-04-04T01:03:24.000Z | 2020-04-04T01:03:24.000Z | arcade/particle.py | LiorAvrahami/arcade | fce254a9eb89629de1f99d57a63759a2953184e9 | [
"MIT"
] | 1 | 2019-08-11T18:47:27.000Z | 2019-08-12T03:02:11.000Z | arcade/particle.py | LiorAvrahami/arcade | fce254a9eb89629de1f99d57a63759a2953184e9 | [
"MIT"
] | null | null | null | """
Particle - Object produced by an Emitter. Often used in large quantity to produce visual effects effects
"""
from arcade.sprite import Sprite
from arcade.draw_commands import Texture
import arcade.utils
from arcade.arcade_types import Point, Vector
from typing import Union
FilenameOrTexture = Union[str, Texture]... | 31.358621 | 118 | 0.58896 |
4a11958845e1fc7a0c0232cdc22d3a6a33814286 | 1,211 | py | Python | Day-24/day-24.py | sirilalithaadapa/Hacker-Rank | c020c5e29cbbcc83210416c6be498450c4bbc879 | [
"MIT"
] | null | null | null | Day-24/day-24.py | sirilalithaadapa/Hacker-Rank | c020c5e29cbbcc83210416c6be498450c4bbc879 | [
"MIT"
] | null | null | null | Day-24/day-24.py | sirilalithaadapa/Hacker-Rank | c020c5e29cbbcc83210416c6be498450c4bbc879 | [
"MIT"
] | 1 | 2021-06-06T01:23:43.000Z | 2021-06-06T01:23:43.000Z | class Node:
def __init__(self,data):
self.data = data
self.next = None
class Solution:
def insert(self,head,data):
p = Node(data)
if head==None:
head=p
elif head.next==None:
head.next=p
else:
... | 24.714286 | 40 | 0.482246 |
4a1196401617375261cc3907a098e71be53d3230 | 2,537 | py | Python | source2/common.py | half5life/SourceIO | f3dc6db92daa537acbb487ce09f371866f6e3e7f | [
"MIT"
] | 1 | 2021-07-12T12:55:27.000Z | 2021-07-12T12:55:27.000Z | source2/common.py | half5life/SourceIO | f3dc6db92daa537acbb487ce09f371866f6e3e7f | [
"MIT"
] | null | null | null | source2/common.py | half5life/SourceIO | f3dc6db92daa537acbb487ce09f371866f6e3e7f | [
"MIT"
] | null | null | null | import numpy as np
from ..utilities.byte_io_mdl import ByteIO
def short_to_float(value):
value = int(value)
s = (value >> 14) & 2 # sign*2
e = (value >> 10) & 31 # exponent
m = (value & 1023) # mantissa
if e == 0:
# either zero or a subnormal number
if m != 0:
retur... | 25.118812 | 94 | 0.549862 |
4a11965a48733990e873e21e759882512bb6ef36 | 3,683 | py | Python | huaweicloud-sdk-cbr/huaweicloudsdkcbr/v1/model/tags_resp.py | Adek06/huaweicloud-sdk-python-v3 | 3d13b27d089e04a1ae567cd649b3c5509e0391d2 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-cbr/huaweicloudsdkcbr/v1/model/tags_resp.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-cbr/huaweicloudsdkcbr/v1/model/tags_resp.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
class TagsResp:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json k... | 26.688406 | 146 | 0.525115 |
4a11967cd84b89590cb9843613b9a1f48d144107 | 3,429 | py | Python | src/experiments/util/dataset.py | rg321/affective-2017-musa2-ode | abba8c84a5fe6624601cdf6d08bf48d54ca490ac | [
"MIT"
] | null | null | null | src/experiments/util/dataset.py | rg321/affective-2017-musa2-ode | abba8c84a5fe6624601cdf6d08bf48d54ca490ac | [
"MIT"
] | null | null | null | src/experiments/util/dataset.py | rg321/affective-2017-musa2-ode | abba8c84a5fe6624601cdf6d08bf48d54ca490ac | [
"MIT"
] | null | null | null | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.617647 | 80 | 0.606882 |
4a119794bb26f750422843c32e8872c2515f4f7f | 9,018 | py | Python | src/pt_analyzeaudio.py | timsum/harmonypartition | 8be5165a0e6361c6789ccbeb7e2d81f3667587d5 | [
"MIT"
] | null | null | null | src/pt_analyzeaudio.py | timsum/harmonypartition | 8be5165a0e6361c6789ccbeb7e2d81f3667587d5 | [
"MIT"
] | null | null | null | src/pt_analyzeaudio.py | timsum/harmonypartition | 8be5165a0e6361c6789ccbeb7e2d81f3667587d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 24 21:47:41 2020
@author: timsummers
"""
import numpy as np
import librosa
import librosa.display
from scipy.special import softmax
import harmony_state
import pt_utils
import pt_musicutils
import matplotlib.pyplot as plt
from matplotlib import g... | 30.883562 | 161 | 0.619871 |
4a11979770684079e8ef3a4dce38378c2373ab9c | 14,087 | py | Python | lib/coginvasion/toon/ToonDNA.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | 1 | 2020-03-12T16:44:10.000Z | 2020-03-12T16:44:10.000Z | lib/coginvasion/toon/ToonDNA.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | null | null | null | lib/coginvasion/toon/ToonDNA.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: lib.coginvasion.toon.ToonDNA
from direct.directnotify.DirectNotifyGlobal import directNotify
import types
from pprint import _id
from li... | 37.071053 | 106 | 0.588912 |
4a11980ad87c585932d8363f6b9d8857ce4e09f2 | 2,984 | py | Python | OoTRandomizer.py | dragonbane0/OoT-Randomizer | fbd906bb6fe5f65395c3ef49a4a5b5a2ec79e1c0 | [
"MIT"
] | null | null | null | OoTRandomizer.py | dragonbane0/OoT-Randomizer | fbd906bb6fe5f65395c3ef49a4a5b5a2ec79e1c0 | [
"MIT"
] | null | null | null | OoTRandomizer.py | dragonbane0/OoT-Randomizer | fbd906bb6fe5f65395c3ef49a4a5b5a2ec79e1c0 | [
"MIT"
] | 1 | 2019-06-21T14:59:39.000Z | 2019-06-21T14:59:39.000Z | #!/usr/bin/env python3
import argparse
import os
import logging
import random
import textwrap
import sys
import hashlib
from Gui import guiMain
from Main import main, from_patch_file, cosmetic_patch
from Utils import is_bundled, close_console, check_version, VersionError, check_python_version, default_output_path
from... | 35.105882 | 174 | 0.685657 |
4a11985f2b27617d92ffd462a401a979277242a0 | 1,091 | py | Python | src/dxtbx/format/FormatSMVADSCmlfsom.py | toastisme/dxtbx | fc24e215a8052e7e17be4ad4b41f9dbb474d852a | [
"BSD-3-Clause"
] | null | null | null | src/dxtbx/format/FormatSMVADSCmlfsom.py | toastisme/dxtbx | fc24e215a8052e7e17be4ad4b41f9dbb474d852a | [
"BSD-3-Clause"
] | null | null | null | src/dxtbx/format/FormatSMVADSCmlfsom.py | toastisme/dxtbx | fc24e215a8052e7e17be4ad4b41f9dbb474d852a | [
"BSD-3-Clause"
] | null | null | null | import sys
from dxtbx.format.FormatSMVADSC import FormatSMVADSC
class FormatSMVADSCmlfsom(FormatSMVADSC):
"""A class for reading SMV::ADSC-format images generated by MLFSOM
simulation."""
@staticmethod
def understand(image_file):
size, header = FormatSMVADSC.get_smv_header(image_file)
... | 26.609756 | 87 | 0.663611 |
4a119890d85a06981e46cb4bff3b5e5989fe14a8 | 537 | py | Python | server.py | emelianovss-yandex-praktikum/18_django | cb33becb2edde855ca81fc91d82ff208f1527034 | [
"MIT"
] | null | null | null | server.py | emelianovss-yandex-praktikum/18_django | cb33becb2edde855ca81fc91d82ff208f1527034 | [
"MIT"
] | null | null | null | server.py | emelianovss-yandex-praktikum/18_django | cb33becb2edde855ca81fc91d82ff208f1527034 | [
"MIT"
] | 1 | 2021-11-29T18:49:17.000Z | 2021-11-29T18:49:17.000Z | import random
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
class IndexHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type', 'application/json')
self.end_headers()
self.wfile.write(json.dumps({'random_in... | 24.409091 | 86 | 0.687151 |
4a119944d0968ae5968df38e7b802e57a49e6430 | 3,248 | py | Python | setup_console.py | karstenw/nodebox-pyobjc | 477aeaa53636944cd400ecdfe97f4ff2480761c7 | [
"MIT"
] | 6 | 2016-05-02T02:25:23.000Z | 2022-03-16T14:01:54.000Z | setup_console.py | karstenw/nodebox-pyobjc | 477aeaa53636944cd400ecdfe97f4ff2480761c7 | [
"MIT"
] | 2 | 2018-01-27T18:24:20.000Z | 2018-02-10T23:33:46.000Z | setup_console.py | karstenw/nodebox-pyobjc | 477aeaa53636944cd400ecdfe97f4ff2480761c7 | [
"MIT"
] | 1 | 2018-01-28T15:22:11.000Z | 2018-01-28T15:22:11.000Z | # This is a setup file for a command-line version of NodeBox.
# If you want to work on the Mac OS X version, go look in macsetup.py.
# This is your standard setup.py, so to install the package, use:
# python setup.py install
# We require some dependencies:
# - PyObjC
# - py2app
# - cPathMatics (included in the "l... | 34.189474 | 110 | 0.699815 |
4a11997f7162f402450c62da958f83dc83f0a67d | 322 | py | Python | apps/__init__.py | Lu0Hui/flask-app | 934b0231ad9fa138a42a8edeaa87251a4090e0a3 | [
"MIT"
] | null | null | null | apps/__init__.py | Lu0Hui/flask-app | 934b0231ad9fa138a42a8edeaa87251a4090e0a3 | [
"MIT"
] | null | null | null | apps/__init__.py | Lu0Hui/flask-app | 934b0231ad9fa138a42a8edeaa87251a4090e0a3 | [
"MIT"
] | null | null | null | from flask import Flask
def create_app():
app = Flask(__name__)
from apps.core.views import core as core_blueprint
app.register_blueprint(core_blueprint, url_prefix='/')
from apps.users.views import user as user_blueprint
app.register_blueprint(user_blueprint, url_prefix='/users')
return ap... | 23 | 63 | 0.745342 |
4a1199f8abe51ef447f07120b8839477c2037939 | 4,693 | py | Python | tools/make_nr/make_nr.py | bernt-matthias/galaxy_blast | 3ac00a9f99a93cbc8a6c136a302e7fbb17da8f71 | [
"MIT"
] | null | null | null | tools/make_nr/make_nr.py | bernt-matthias/galaxy_blast | 3ac00a9f99a93cbc8a6c136a302e7fbb17da8f71 | [
"MIT"
] | null | null | null | tools/make_nr/make_nr.py | bernt-matthias/galaxy_blast | 3ac00a9f99a93cbc8a6c136a302e7fbb17da8f71 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Make FASTA files non-redundant by combining duplicated sequences.
This script takes one or more (optionally gzipped) FASTA filenames as input,
and will return a non-zero error if any duplicate identifiers are found.
Writes output to stdout by default.
Keeps all the sequences in memory, bewa... | 31.709459 | 87 | 0.610484 |
4a119cc6a3179ace628fbc1839348c0ca1000ed9 | 18 | py | Python | horizon_telemetry/models.py | simonpasquier/horizon-telemetry-dashboard | f284ec6ae8b1932079852fe3e9ab4b7a27ff58d7 | [
"Apache-2.0"
] | null | null | null | horizon_telemetry/models.py | simonpasquier/horizon-telemetry-dashboard | f284ec6ae8b1932079852fe3e9ab4b7a27ff58d7 | [
"Apache-2.0"
] | 2 | 2017-10-10T07:30:41.000Z | 2017-10-19T18:34:13.000Z | horizon_telemetry/models.py | simonpasquier/horizon-telemetry-dashboard | f284ec6ae8b1932079852fe3e9ab4b7a27ff58d7 | [
"Apache-2.0"
] | null | null | null | # Placeholder file | 18 | 18 | 0.833333 |
4a119d2e7554eb76f1efd5f07151c512e4df0825 | 506 | py | Python | scripts/trim.py | SonicMastr/h-encore | 5ae59490605f6495f273ba72b9dacb185d94fd3f | [
"MIT"
] | null | null | null | scripts/trim.py | SonicMastr/h-encore | 5ae59490605f6495f273ba72b9dacb185d94fd3f | [
"MIT"
] | null | null | null | scripts/trim.py | SonicMastr/h-encore | 5ae59490605f6495f273ba72b9dacb185d94fd3f | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
from sys import argv, exit
import struct
def main():
if len(argv) != 2:
print("Usage: trim.py binary")
return -1
with open(argv[1], "rb") as f:
data = f.read()
new_len = len(data)
if new_len < 4:
return -1
for i in range(new_len-4, 0, -4):
word, ... | 18.740741 | 49 | 0.537549 |
4a119f5494b74a85b83d9e5535344a530a0d2071 | 4,481 | py | Python | python/datasets/pamap_common.py | icdm-extract/extract | 18d6e8509f2f35719535e1de6c88874ec533cfb9 | [
"MIT"
] | 1 | 2019-03-05T01:17:05.000Z | 2019-03-05T01:17:05.000Z | python/datasets/pamap_common.py | icdm-extract/extract | 18d6e8509f2f35719535e1de6c88874ec533cfb9 | [
"MIT"
] | null | null | null | python/datasets/pamap_common.py | icdm-extract/extract | 18d6e8509f2f35719535e1de6c88874ec533cfb9 | [
"MIT"
] | null | null | null |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from ..utils.files import basename
from ..utils.arrays import downsampleMat, zNormalizeCols, zeroOneScaleMat
from ..utils import sequence as seq
# ================================================================
# numeric consts
# clipping / val... | 28.360759 | 78 | 0.65231 |
4a119f8b8a89d8455e2c6696de294f5947837715 | 1,282 | py | Python | kafka/test_kafka.py | deep2064/initialization-actions | 13290bffe7eaef2576071218ada6195a2756ef76 | [
"Apache-2.0"
] | 127 | 2020-01-17T17:56:28.000Z | 2022-03-26T21:10:01.000Z | kafka/test_kafka.py | deep2064/initialization-actions | 13290bffe7eaef2576071218ada6195a2756ef76 | [
"Apache-2.0"
] | 258 | 2020-01-17T19:24:20.000Z | 2022-03-30T18:28:41.000Z | kafka/test_kafka.py | deep2064/initialization-actions | 13290bffe7eaef2576071218ada6195a2756ef76 | [
"Apache-2.0"
] | 136 | 2020-01-16T11:50:45.000Z | 2022-03-26T03:39:36.000Z | import os
from absl.testing import absltest
from absl.testing import parameterized
from integration_tests.dataproc_test_case import DataprocTestCase
class KafkaTestCase(DataprocTestCase):
COMPONENT = 'kafka'
INIT_ACTIONS = ['kafka/kafka.sh']
TEST_SCRIPT_FILE_NAME = 'validate.sh'
def verify_instance... | 32.05 | 70 | 0.650546 |
4a119fb1aba839d294db5c19a8fd263ddeae21ae | 11,594 | py | Python | mwr_raw2l1/measurement/measurement_construct_helpers.py | MeteoSwiss/mwr_raw2l1 | 6f8d8b80c203bcbd7f42a53b618ae63f321b68cb | [
"BSD-3-Clause"
] | null | null | null | mwr_raw2l1/measurement/measurement_construct_helpers.py | MeteoSwiss/mwr_raw2l1 | 6f8d8b80c203bcbd7f42a53b618ae63f321b68cb | [
"BSD-3-Clause"
] | null | null | null | mwr_raw2l1/measurement/measurement_construct_helpers.py | MeteoSwiss/mwr_raw2l1 | 6f8d8b80c203bcbd7f42a53b618ae63f321b68cb | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import xarray as xr
from mwr_raw2l1.errors import DimensionError, MissingInputArgument
from mwr_raw2l1.log import logger
from mwr_raw2l1.measurement.scan_transform import scan_to_timeseries_from_aux
def attex_to_datasets(data_all, dims, vars, vars_opt):
"""generate unique :class:`xarray.Datase... | 47.516393 | 120 | 0.669398 |
4a11a042b21fcfc29095bc5a81e025723b4a8c05 | 2,761 | py | Python | tests/api/test_metrics_api.py | ldbenitez/redis-python-course | 529bcf94cbba6358a940002e8568bb69e32cb53a | [
"MIT"
] | null | null | null | tests/api/test_metrics_api.py | ldbenitez/redis-python-course | 529bcf94cbba6358a940002e8568bb69e32cb53a | [
"MIT"
] | null | null | null | tests/api/test_metrics_api.py | ldbenitez/redis-python-course | 529bcf94cbba6358a940002e8568bb69e32cb53a | [
"MIT"
] | null | null | null | import datetime
from collections import deque
from typing import Deque
from typing import Generator
from typing import List
import pytest
from redisolar.dao.redis.metric_timeseries import MetricDaoRedisTimeseries
from redisolar.models import Measurement
from redisolar.models import MeterReading
from redisolar.schema ... | 30.677778 | 80 | 0.666787 |
4a11a0f097fc26d34f468e4abc8ca218382a47d5 | 1,363 | py | Python | term/commands.py | synw/django-terminal | 2a90f1445c59b92415893bd98e918e45e6a056eb | [
"MIT"
] | 2 | 2018-03-02T11:19:58.000Z | 2021-07-05T17:53:00.000Z | term/commands.py | synw/django-terminal | 2a90f1445c59b92415893bd98e918e45e6a056eb | [
"MIT"
] | null | null | null | term/commands.py | synw/django-terminal | 2a90f1445c59b92415893bd98e918e45e6a056eb | [
"MIT"
] | 1 | 2019-05-09T00:11:09.000Z | 2019-05-09T00:11:09.000Z | from goerr import err
from django.conf import settings
from django.utils.html import strip_tags
from instant.producers import publish
from term.conf import COMMAND_CHANNEL
class Command:
def __init__(self, name, runfunc, thelp):
self.name = name
self.runfunc = runfunc
self.help = thelp
... | 25.716981 | 70 | 0.597946 |
4a11a132aef4360787943f34ea02baaa67c09f11 | 565 | py | Python | var/spack/repos/builtin/packages/perl-number-format/package.py | whitfin/spack | aabd2be31a511d0e00c1017f7311a421659319d9 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | var/spack/repos/builtin/packages/perl-number-format/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 75 | 2016-07-27T11:43:00.000Z | 2020-12-08T15:56:53.000Z | var/spack/repos/builtin/packages/perl-number-format/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 8 | 2015-10-16T13:51:49.000Z | 2021-10-18T13:58:03.000Z | # Copyright 2013-2019 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 PerlNumberFormat(PerlPackage):
"""Number::Format - Perl extension for formatting numbers""... | 35.3125 | 94 | 0.748673 |
4a11a17ece139b1f75ae71f4f28accadaa593d0a | 1,528 | py | Python | userbot/Plugins/bash.py | its-leo-bitch/LEO-BITCH-USERBOT | b465dbebe06137682e604c36b40bf3020b1a01fd | [
"MIT"
] | null | null | null | userbot/Plugins/bash.py | its-leo-bitch/LEO-BITCH-USERBOT | b465dbebe06137682e604c36b40bf3020b1a01fd | [
"MIT"
] | null | null | null | userbot/Plugins/bash.py | its-leo-bitch/LEO-BITCH-USERBOT | b465dbebe06137682e604c36b40bf3020b1a01fd | [
"MIT"
] | 3 | 2020-12-20T15:58:16.000Z | 2021-09-07T04:39:02.000Z | from telethon import events
import subprocess
from telethon.errors import MessageEmptyError, MessageTooLongError, MessageNotModifiedError
import io
import asyncio
import time
@command(pattern="^.bash ?(.*)")
async def _(event):
if event.fwd_from:
return
DELAY_BETWEEN_EDITS = 0.3
PROCESS_RUN_TIME =... | 31.183673 | 118 | 0.607984 |
4a11a1b39d678a49c27aa171bbe056bc66d0c625 | 18,247 | py | Python | fairseq/modules/multihead_attention.py | layer6ai-labs/T-Fixup | b17e166d9f60671a92c3f39e24c9b8c93995e5a3 | [
"MIT"
] | 70 | 2020-07-12T12:07:05.000Z | 2022-03-24T03:09:56.000Z | fairseq/modules/multihead_attention.py | melody-rain/T-Fixup | b17e166d9f60671a92c3f39e24c9b8c93995e5a3 | [
"MIT"
] | 8 | 2020-07-12T12:12:17.000Z | 2022-01-07T18:37:42.000Z | fairseq/modules/multihead_attention.py | melody-rain/T-Fixup | b17e166d9f60671a92c3f39e24c9b8c93995e5a3 | [
"MIT"
] | 13 | 2020-07-20T15:17:14.000Z | 2022-02-01T06:30:51.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.
import math
from typing import Dict, Optional, Tuple
import torch
import torch.nn.functional as F
from fairseq import utils
from torch import... | 39.495671 | 96 | 0.57615 |
4a11a2545c09ed29736aaeb3f04c0cb866029bcb | 3,267 | py | Python | aliyun-python-sdk-vod/aliyunsdkvod/request/v20170321/DescribeVodRefreshTasksRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vod/aliyunsdkvod/request/v20170321/DescribeVodRefreshTasksRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-vod/aliyunsdkvod/request/v20170321/DescribeVodRefreshTasksRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.718447 | 81 | 0.759106 |
4a11a3e55706826bdaecd4bcd6c16fdcb61fe938 | 12,071 | py | Python | project/settings.py | xelaxela13/stock | ef7df50194be340e7faff915e9de4e3b1ade4eca | [
"MIT"
] | 1 | 2019-02-19T08:43:51.000Z | 2019-02-19T08:43:51.000Z | project/settings.py | xelaxela13/stock | ef7df50194be340e7faff915e9de4e3b1ade4eca | [
"MIT"
] | 6 | 2021-03-19T02:07:34.000Z | 2022-02-10T08:27:57.000Z | project/settings.py | xelaxela13/stock | ef7df50194be340e7faff915e9de4e3b1ade4eca | [
"MIT"
] | null | null | null | """
Django settings for project project.
Generated by 'django-admin startproject' using Django 2.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
from os impo... | 31.272021 | 116 | 0.632508 |
4a11a49d95efd8b44dd3b30ab4d40a155be15020 | 2,052 | py | Python | Soil Sensor/Soil sensor settings.py | ronpang/WIZnet-HK_Ron | d9df912ee9afe70c3aad17e0d703428afe2f2b4c | [
"Apache-2.0"
] | null | null | null | Soil Sensor/Soil sensor settings.py | ronpang/WIZnet-HK_Ron | d9df912ee9afe70c3aad17e0d703428afe2f2b4c | [
"Apache-2.0"
] | null | null | null | Soil Sensor/Soil sensor settings.py | ronpang/WIZnet-HK_Ron | d9df912ee9afe70c3aad17e0d703428afe2f2b4c | [
"Apache-2.0"
] | null | null | null | import board
import digitalio
import analogio
import time
import busio
# Set A0 for receving data from the soil hudmidity module
soil = analogio.AnalogIn(board.A0)
# Set LED for checking the network system working
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
#Waiti... | 29.73913 | 99 | 0.691033 |
4a11a5823a6a48ef4215fbd874a162fbf9f8b0dd | 3,420 | py | Python | python/inspect_func_test_decorator.py | fabianlee/blogcode | 55db576e0b789944ce2cf795e89e5dead2290345 | [
"MIT"
] | 34 | 2017-05-19T12:46:28.000Z | 2022-02-03T10:51:25.000Z | python/inspect_func_test_decorator.py | fabianlee/blogcode | 55db576e0b789944ce2cf795e89e5dead2290345 | [
"MIT"
] | 2 | 2018-05-10T15:33:02.000Z | 2019-02-21T13:10:14.000Z | python/inspect_func_test_decorator.py | fabianlee/blogcode | 55db576e0b789944ce2cf795e89e5dead2290345 | [
"MIT"
] | 32 | 2017-05-08T03:48:16.000Z | 2022-03-11T15:51:55.000Z | #!/usr/bin/env python
"""
Use Decorators and introspection to see the arguments passed to a function
https://fabianlee.org/2019/09/22/python-using-a-custom-decorator-to-inspect-function-arguments/
"""
import sys
import argparse
import inspect
import functools
def showargs_decorator(func):
"""custom decorator"... | 25.714286 | 96 | 0.626316 |
4a11a71d61e89793606b7df8c1bce5fb1d08e8b8 | 79,847 | py | Python | Lib/unittest/mock.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | 1 | 2018-06-21T18:21:24.000Z | 2018-06-21T18:21:24.000Z | Lib/unittest/mock.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | Lib/unittest/mock.py | sireliah/polish-python | 605df4944c2d3bc25f8bf6964b274c0a0d297cc3 | [
"PSF-2.0"
] | null | null | null | # mock.py
# Test tools dla mocking oraz patching.
# Maintained by Michael Foord
# Backport dla other versions of Python available from
# http://pypi.python.org/pypi/mock
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
... | 33.648125 | 89 | 0.619936 |
4a11a89d9f50a9315bde94221f25b7d20e2fd10d | 1,327 | py | Python | Classificação/Arvore_Decisão/arvore_decisão_census.py | BigWalvi/Machine-Learning-and-Data-Science | 709392d82178dfb29b00ad459bad906b75d2d706 | [
"MIT"
] | null | null | null | Classificação/Arvore_Decisão/arvore_decisão_census.py | BigWalvi/Machine-Learning-and-Data-Science | 709392d82178dfb29b00ad459bad906b75d2d706 | [
"MIT"
] | null | null | null | Classificação/Arvore_Decisão/arvore_decisão_census.py | BigWalvi/Machine-Learning-and-Data-Science | 709392d82178dfb29b00ad459bad906b75d2d706 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 5 15:53:08 2021
@author: Walvi
"""
import pandas as pd
base = pd.read_csv('census.csv')
previsores = base.iloc[:,0:14].values
classe = base.iloc[:,14].values
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.compose import ColumnTransformer
c... | 33.175 | 145 | 0.813866 |
4a11a8bf7cc84b5d709e7777f45e592b39ca13f1 | 1,471 | py | Python | src/db_handler.py | AccraZed/Klove | f49c219424473aad2ed8e4b9dc8dce18a3d7b860 | [
"MIT"
] | null | null | null | src/db_handler.py | AccraZed/Klove | f49c219424473aad2ed8e4b9dc8dce18a3d7b860 | [
"MIT"
] | null | null | null | src/db_handler.py | AccraZed/Klove | f49c219424473aad2ed8e4b9dc8dce18a3d7b860 | [
"MIT"
] | null | null | null | import sqlite3
from sqlite3 import Error
# Python doesn't support function overloading(later function takes precedence)
class DatabaseHandler:
def __init__(self, path_database):
try:
self.connection = sqlite3.connect(path_database)
print("Connection to SQLite DB successful")
... | 31.297872 | 88 | 0.582597 |
4a11aa150cb541a3c5ac09ad57260dadb6800409 | 315 | py | Python | python3/arrange_coins.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | 1 | 2020-10-08T09:17:40.000Z | 2020-10-08T09:17:40.000Z | python3/arrange_coins.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | python3/arrange_coins.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | """
Space : O(1)
Time : O(n)
"""
class Solution:
def arrangeCoins(self, n: int) -> int:
ans, count = 0, 0
add = 1
while count < n:
count += add
add += 1
ans += 1
if count > n:
ans -= 1
return ans | 17.5 | 42 | 0.361905 |
4a11aa19011efd9671ba0be1262d9daaba524f04 | 2,082 | py | Python | project2/src/tools.py | errikos/ml-makarona | 5e0c9efe3405245119bf5aa9bd81a4ca5159eab1 | [
"MIT"
] | null | null | null | project2/src/tools.py | errikos/ml-makarona | 5e0c9efe3405245119bf5aa9bd81a4ca5159eab1 | [
"MIT"
] | null | null | null | project2/src/tools.py | errikos/ml-makarona | 5e0c9efe3405245119bf5aa9bd81a4ca5159eab1 | [
"MIT"
] | 1 | 2019-10-24T22:47:38.000Z | 2019-10-24T22:47:38.000Z | #!/usr/bin/env python3
import click
import os
import helpers
def _write_normalized(data, base_path, fname):
with open(os.path.join(base_path, fname), 'w+') as f:
f.write('user,item,rating\n')
f.writelines('{u},{i},{r}\n'.format(u=u, i=i, r=r) for u, i, r in data)
@click.group(help='Various usef... | 41.64 | 112 | 0.695485 |
4a11ac4de6ce55910da1412be1db34c4a4695a36 | 385 | py | Python | plim/util.py | spollard/Plim | 7689de85364691063ed5c43a891c433f9ebef5b9 | [
"MIT"
] | 85 | 2015-01-08T20:15:54.000Z | 2022-03-12T21:51:27.000Z | plim/util.py | spollard/Plim | 7689de85364691063ed5c43a891c433f9ebef5b9 | [
"MIT"
] | 18 | 2015-02-27T14:59:08.000Z | 2021-09-24T10:27:19.000Z | plim/util.py | spollard/Plim | 7689de85364691063ed5c43a891c433f9ebef5b9 | [
"MIT"
] | 14 | 2015-02-26T07:20:42.000Z | 2022-02-01T17:52:16.000Z | import sys
PY3K = sys.version_info >= (3, 0)
if PY3K:
from io import StringIO
joined = lambda buf: ''.join(buf)
space_separated = lambda buf: ' '.join(buf)
u = str
MAXSIZE = sys.maxsize
else:
from StringIO import StringIO
joined = lambda buf: u('').join(buf)
space_separated = lambd... | 18.333333 | 50 | 0.620779 |
4a11aed49f41bd68d470286b595bf71b3638b130 | 6,750 | py | Python | web/src/stadistic/forms.py | frhumanes/consulting | 400df4fc59240d2cd1c5807feaabacd056fdce03 | [
"Apache-2.0"
] | null | null | null | web/src/stadistic/forms.py | frhumanes/consulting | 400df4fc59240d2cd1c5807feaabacd056fdce03 | [
"Apache-2.0"
] | null | null | null | web/src/stadistic/forms.py | frhumanes/consulting | 400df4fc59240d2cd1c5807feaabacd056fdce03 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
from django import forms
from django.conf import settings
from userprofile.models import Profile
from formula.models import Variable, Dimension
from survey.models import Option
from consulting.models import Medicine
from illness.models import Illness
from django.utils.translation import ugette... | 45.608108 | 192 | 0.580593 |
4a11b05d19f88282e59e641d44f49bdc7669176a | 5,624 | py | Python | quart_session/__init__.py | adrienyhuel/quart-session | 264a9ad3693477484a6000e5924116f68383fb42 | [
"BSD-3-Clause"
] | null | null | null | quart_session/__init__.py | adrienyhuel/quart-session | 264a9ad3693477484a6000e5924116f68383fb42 | [
"BSD-3-Clause"
] | null | null | null | quart_session/__init__.py | adrienyhuel/quart-session | 264a9ad3693477484a6000e5924116f68383fb42 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
quart_session
~~~~~~~~~~~~~
Adds server session support to your application.
:copyright: (c) 2014 by Shipeng Feng.
:copyright: (c) 2020 by Sander.
:license: BSD, see LICENSE for more details.
"""
__version__ = '1.0.2'
import os
from quart import Quart
from .sess... | 38 | 119 | 0.608286 |
4a11b0916e906c7095a2d703924db83060ba8dd1 | 6,639 | py | Python | reinforce/reinforce_pixels.py | uchendui/reinforcement-learning | 121e7f7c325dad2b3b2f0437b9ac78e23a841b45 | [
"MIT"
] | null | null | null | reinforce/reinforce_pixels.py | uchendui/reinforcement-learning | 121e7f7c325dad2b3b2f0437b9ac78e23a841b45 | [
"MIT"
] | null | null | null | reinforce/reinforce_pixels.py | uchendui/reinforcement-learning | 121e7f7c325dad2b3b2f0437b9ac78e23a841b45 | [
"MIT"
] | null | null | null | import gym
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from util.network import PolicyNetworkBuilder
from util.misc import to_one_hot
class Trajectory:
def __init__(self, states, actions, rewards, num_actions):
"""
Represents a single trajectory sampled from our poli... | 36.478022 | 106 | 0.539388 |
4a11b0aac9664f8374608eee731ad52204f7efd3 | 1,650 | py | Python | cms/management/commands/generate_dev_fixtures.py | digimatronics/py | 8ee737e5d2dbb226c18a7dd46912c7301b37cc0e | [
"Apache-2.0"
] | 1 | 2017-03-12T06:29:04.000Z | 2017-03-12T06:29:04.000Z | cms/management/commands/generate_dev_fixtures.py | digimatronics/py | 8ee737e5d2dbb226c18a7dd46912c7301b37cc0e | [
"Apache-2.0"
] | 4 | 2021-03-31T20:10:38.000Z | 2021-09-08T02:47:18.000Z | cms/management/commands/generate_dev_fixtures.py | digimatronics/py | 8ee737e5d2dbb226c18a7dd46912c7301b37cc0e | [
"Apache-2.0"
] | null | null | null | import gzip
import json
import io
from optparse import make_option
from django.core.management import BaseCommand, call_command
from django.contrib.auth.hashers import make_password
class Command(BaseCommand):
"""
Generate fixtures necessary for local development of production database.
NOTE: This sho... | 27.04918 | 78 | 0.594545 |
4a11b0cd1b4c33e61ed8b8fd7704d521317cb164 | 11,606 | py | Python | mayan/apps/documents/south_migrations/0010_auto__chg_field_document_date_added.py | camerondphillips/MAYAN | b8cd44af50f0b2f2b59286d9c88e2f7aa573a93f | [
"Apache-2.0"
] | null | null | null | mayan/apps/documents/south_migrations/0010_auto__chg_field_document_date_added.py | camerondphillips/MAYAN | b8cd44af50f0b2f2b59286d9c88e2f7aa573a93f | [
"Apache-2.0"
] | null | null | null | mayan/apps/documents/south_migrations/0010_auto__chg_field_document_date_added.py | camerondphillips/MAYAN | b8cd44af50f0b2f2b59286d9c88e2f7aa573a93f | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Document.date_added'
db.alter_column('documents_document', 'date_added', self.gf('django.db.models.fields.DateTimeField')())
def backwar... | 76.860927 | 182 | 0.564708 |
4a11b0d2d8667c62ac2b2a95786c30f5200aa245 | 5,115 | py | Python | setup.py | margudo/marvin | 6f5a11b5b7ef80dbdb43a4538e27ccda126bab6e | [
"BSD-3-Clause"
] | null | null | null | setup.py | margudo/marvin | 6f5a11b5b7ef80dbdb43a4538e27ccda126bab6e | [
"BSD-3-Clause"
] | null | null | null | setup.py | margudo/marvin | 6f5a11b5b7ef80dbdb43a4538e27ccda126bab6e | [
"BSD-3-Clause"
] | null | null | null | # !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Brian Cherinka
# @Date: 2016-10-19 17:36:00
# @Last modified by: Brian Cherinka
# @Last Modified time: 2018-12-03 10:56:33
#
# This is the Marvin setup
#
from setuptools import setup, find_packages
import os
fro... | 33.651316 | 93 | 0.618768 |
4a11b1cd1ff503c915dfb780a532c1659b1ba207 | 1,999 | py | Python | swig/python/samples/make_fuzzer_friendly_archive.py | gajgeospatial/gdal-3.2.2 | f03032b8b734f611d5b3039c0e5cdbf81adc306e | [
"Apache-2.0"
] | null | null | null | swig/python/samples/make_fuzzer_friendly_archive.py | gajgeospatial/gdal-3.2.2 | f03032b8b734f611d5b3039c0e5cdbf81adc306e | [
"Apache-2.0"
] | null | null | null | swig/python/samples/make_fuzzer_friendly_archive.py | gajgeospatial/gdal-3.2.2 | f03032b8b734f611d5b3039c0e5cdbf81adc306e | [
"Apache-2.0"
] | 1 | 2022-02-21T06:31:07.000Z | 2022-02-21T06:31:07.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ******************************************************************************
# $Id: make_fuzzer_friendly_archive.py 428d6fbc987332afb0ba6c7b6913390f7386e864 2020-01-17 22:19:28 +0100 Even Rouault $
#
# Project: GDAL
# Purpose: Make fuzzer friendly archive (only wo... | 48.756098 | 121 | 0.653827 |
4a11b2c672553de35fb777bcd84e78191a8595a1 | 1,308 | py | Python | [tampered]addBlock.py | isidharthrai/Blockchain-Simulation-using-Python | a822011d85ef50696d95f6e897daa7899ca977f5 | [
"MIT"
] | 1 | 2019-08-17T10:01:10.000Z | 2019-08-17T10:01:10.000Z | [tampered]addBlock.py | SidharthRai/Blockchain-Simulation-using-Python | a822011d85ef50696d95f6e897daa7899ca977f5 | [
"MIT"
] | null | null | null | [tampered]addBlock.py | SidharthRai/Blockchain-Simulation-using-Python | a822011d85ef50696d95f6e897daa7899ca977f5 | [
"MIT"
] | 5 | 2019-08-10T12:31:09.000Z | 2019-12-09T02:14:50.000Z | import hashlib as hasher
import datetime as date
#importing the block
from block import Block
#importing the chain
import jupiter_block as jb
import pluto_block as pb
import neptune_block as nb
# Generate all later blocks in the blockchain
def next_block(last_block):
this_index = last_block.index + ... | 30.418605 | 93 | 0.712538 |
4a11b2e555c9081f76856ea4ab6bdaa55e944d7a | 107 | py | Python | testzld/test1.py | zoulida/sdufeQuant | dc3715a62f620c0a437daacfe9a113d5a6ecb62d | [
"Apache-2.0"
] | null | null | null | testzld/test1.py | zoulida/sdufeQuant | dc3715a62f620c0a437daacfe9a113d5a6ecb62d | [
"Apache-2.0"
] | null | null | null | testzld/test1.py | zoulida/sdufeQuant | dc3715a62f620c0a437daacfe9a113d5a6ecb62d | [
"Apache-2.0"
] | 1 | 2019-09-19T07:37:36.000Z | 2019-09-19T07:37:36.000Z | __author__ = 'zoulida'
def func1():
print('func1')
def func2():
print('func2')
func1() | 9.727273 | 22 | 0.542056 |
4a11b34c2cd56882854189146c30bb9c7b7f7ac3 | 6,674 | py | Python | src/pyeff_system.py | pyflosic/pyeff | 4b76fcc4a0bfb25f9f4106567d01b5ea02db6737 | [
"Apache-2.0"
] | 3 | 2019-06-24T08:04:25.000Z | 2020-05-26T03:45:45.000Z | src/pyeff_system.py | pyflosic/pyeff | 4b76fcc4a0bfb25f9f4106567d01b5ea02db6737 | [
"Apache-2.0"
] | null | null | null | src/pyeff_system.py | pyflosic/pyeff | 4b76fcc4a0bfb25f9f4106567d01b5ea02db6737 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 PyEFF 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 31.630332 | 171 | 0.493257 |
4a11b350eb44f724f04610e4da0b36d388f02b41 | 519 | py | Python | strings/reverse_string.py | ProgrammerSnigdho/Python | 0b3cc70dae31b99580dc0fbba75dde563c026e51 | [
"MIT"
] | null | null | null | strings/reverse_string.py | ProgrammerSnigdho/Python | 0b3cc70dae31b99580dc0fbba75dde563c026e51 | [
"MIT"
] | null | null | null | strings/reverse_string.py | ProgrammerSnigdho/Python | 0b3cc70dae31b99580dc0fbba75dde563c026e51 | [
"MIT"
] | null | null | null | # We can reverse a string with indexing
txt = 'This is a sample text' # Making a text for reversing
reversed_text = txt[::-1] # This slicing is starting from the end and going backward
print(reversed_text)
# With a function
def text_reversing(text):
reversed_text = text[::-1] # Storing the reversed text in a varia... | 43.25 | 87 | 0.755299 |
4a11b360b47284848b3f36bb4e03ff8a8e919809 | 1,000 | py | Python | py/atanet/sentiment/datasets/english_twitter.py | deletescape/atanet | 0c88c769be22f6ee81ed833b7e82f7decb062a06 | [
"MIT"
] | null | null | null | py/atanet/sentiment/datasets/english_twitter.py | deletescape/atanet | 0c88c769be22f6ee81ed833b7e82f7decb062a06 | [
"MIT"
] | null | null | null | py/atanet/sentiment/datasets/english_twitter.py | deletescape/atanet | 0c88c769be22f6ee81ed833b7e82f7decb062a06 | [
"MIT"
] | null | null | null | from atanet.sentiment.datasets.set import SentimentDataset
from atanet.sentiment.language.language import Language
import pandas as pd
import zipfile
import os
TEST_TRAIN_SPLIT = 0.85
MAX_LENGTH = 100
class EnglishTwitterDataset(SentimentDataset):
def __init__(self):
columns = ['Sentiment', 'Id', 'Date... | 34.482759 | 100 | 0.692 |
4a11b5890e17cd60162c0a6c7d55ae396a89e881 | 1,254 | py | Python | src/papyrus_scripts/utils/UniprotMatch.py | OlivierBeq/Papyrus-scripts | 54fbe74116f36c810ba08b7ab9f7c4baec264506 | [
"MIT"
] | 7 | 2021-11-09T10:05:42.000Z | 2022-03-26T14:15:02.000Z | src/papyrus_scripts/utils/UniprotMatch.py | OlivierBeq/Papyrus-scripts | 54fbe74116f36c810ba08b7ab9f7c4baec264506 | [
"MIT"
] | null | null | null | src/papyrus_scripts/utils/UniprotMatch.py | OlivierBeq/Papyrus-scripts | 54fbe74116f36c810ba08b7ab9f7c4baec264506 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Functions to interact with UniProt."""
from io import StringIO
from typing import List, Union
import pandas as pd
import requests
def uniprot_mappings(query: Union[str, List[str]],
map_from: str = 'ID',
map_to: str = 'PDB_ID',
... | 29.857143 | 87 | 0.600478 |
4a11b61e64ecef75d994efe9b0b6c8049ce31a2d | 8,992 | py | Python | odin/annotator/annotator_classification.py | rnt-pmi/odin | 8cfddf04f964393ef30217aa5f4aa61229d7e811 | [
"Apache-2.0"
] | 4 | 2021-01-09T10:46:31.000Z | 2021-12-16T14:38:06.000Z | odin/annotator/annotator_classification.py | rnt-pmi/odin | 8cfddf04f964393ef30217aa5f4aa61229d7e811 | [
"Apache-2.0"
] | null | null | null | odin/annotator/annotator_classification.py | rnt-pmi/odin | 8cfddf04f964393ef30217aa5f4aa61229d7e811 | [
"Apache-2.0"
] | 3 | 2021-01-09T10:46:15.000Z | 2021-05-11T01:33:30.000Z | import os
import json
from PIL import Image
from matplotlib import pyplot as plt
from IPython.display import display
from tabulate import tabulate
from odin.classes.safe_writer import SafeWriter
from odin.classes import strings as labels_str
from odin.annotator import AnnotatorInterface
from odin.annotator import MetaP... | 43.230769 | 134 | 0.659364 |
4a11b652ac33c507f002904ea94b06a78730819d | 392 | py | Python | example/config.py | xremap/xremap-python | 0784c7fbd30b17362de110829e66a051dc52557c | [
"MIT"
] | 2 | 2021-12-22T13:34:43.000Z | 2022-03-30T14:25:37.000Z | example/config.py | xremap/xremap-python | 0784c7fbd30b17362de110829e66a051dc52557c | [
"MIT"
] | null | null | null | example/config.py | xremap/xremap-python | 0784c7fbd30b17362de110829e66a051dc52557c | [
"MIT"
] | null | null | null | from xremap.dsl import *
define_modmap({
'CapsLock': 'Control_L',
})
define_conditional_modmap({ 'only': ['Gnome-terminal'] }, {
'Control_R': 'Esc',
})
define_keymap({ 'only': ['Google-chrome'] }, {
'C-M-j': 'C-Tab',
'C-M-k': 'C-Shift-Tab',
}, 'Chrome')
define_keymap({}, {
'C-b': 'left',
'C... | 17.043478 | 59 | 0.52551 |
4a11b85b2fdb856cad4603c3cbde022c1c5b8c95 | 624 | py | Python | datasources/migrations/0017_count_external_requests.py | tiferrei/PEDASI | b819aee93de99c00a1aa3eb9d32102b89f72459e | [
"MIT"
] | null | null | null | datasources/migrations/0017_count_external_requests.py | tiferrei/PEDASI | b819aee93de99c00a1aa3eb9d32102b89f72459e | [
"MIT"
] | 18 | 2019-02-27T12:39:27.000Z | 2021-03-24T16:32:47.000Z | datasources/migrations/0017_count_external_requests.py | Southampton-RSG/PEDASI-IoT | 25a111ac7cf4b23fee50ad8eac6ea21564954859 | [
"MIT"
] | 1 | 2021-02-16T17:47:15.000Z | 2021-02-16T17:47:15.000Z | # Generated by Django 2.0.8 on 2018-12-13 09:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('datasources', '0016_prov_exempt_help_text'),
]
operations = [
migrations.AddField(
model_name='datasource',
name='ex... | 26 | 73 | 0.621795 |
4a11b890dc7c205164ea543831f552cad1c8cc1a | 4,330 | py | Python | third_party/ctc_decoders/setup.py | phecda-xu/PaddleSpeech | 6bf0d3bf57229091a74912633e837dabc6215c86 | [
"Apache-2.0"
] | 1 | 2022-02-26T01:48:00.000Z | 2022-02-26T01:48:00.000Z | third_party/ctc_decoders/setup.py | ziwenag/PaddleSpeech | 89e69ee10ee02b875af663146bc46fcf095e812a | [
"Apache-2.0"
] | null | null | null | third_party/ctc_decoders/setup.py | ziwenag/PaddleSpeech | 89e69ee10ee02b875af663146bc46fcf095e812a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.376812 | 81 | 0.646882 |
4a11b961e1009381a99796b7f29d314c70f29dc0 | 5,938 | py | Python | ElectroWeakAnalysis/Skimming/test/EWK_DiElectronSkim_Drop.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | ElectroWeakAnalysis/Skimming/test/EWK_DiElectronSkim_Drop.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | ElectroWeakAnalysis/Skimming/test/EWK_DiElectronSkim_Drop.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("EWKDiElectronSkim")
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.load("Configuration.StandardSequences.MagneticField_cff")
process.load("Configuration.StandardSequences.Geometry_cff")
process.load("Configuration.StandardSequences.Fronti... | 43.343066 | 162 | 0.60037 |
4a11b97c12636028c928e8d2db31b9b87eaa217b | 1,725 | py | Python | pay-api/src/pay_api/resources/code.py | thorwolpert/sbc-pay | ea355dfb13e783ed1e86ed92efaa45293463c348 | [
"Apache-2.0"
] | 4 | 2020-03-23T21:37:02.000Z | 2021-06-15T11:25:22.000Z | pay-api/src/pay_api/resources/code.py | thorwolpert/sbc-pay | ea355dfb13e783ed1e86ed92efaa45293463c348 | [
"Apache-2.0"
] | 757 | 2019-05-02T17:53:52.000Z | 2022-03-31T22:42:01.000Z | pay-api/src/pay_api/resources/code.py | thorwolpert/sbc-pay | ea355dfb13e783ed1e86ed92efaa45293463c348 | [
"Apache-2.0"
] | 39 | 2019-01-30T20:05:36.000Z | 2022-03-24T15:07:54.000Z | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 33.823529 | 91 | 0.729855 |
4a11ba0b889637770433cbf2513b112594b5a2d9 | 981 | py | Python | snacks/views.py | okayjones/django-x | 5e5e8056e9181fef5bca473e0351242a1b272aea | [
"MIT"
] | null | null | null | snacks/views.py | okayjones/django-x | 5e5e8056e9181fef5bca473e0351242a1b272aea | [
"MIT"
] | null | null | null | snacks/views.py | okayjones/django-x | 5e5e8056e9181fef5bca473e0351242a1b272aea | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
from .models import Snack
from django.urls import reverse_lazy
from django.contrib.auth.mixins import LoginRequiredMixin
class SnackListView(LoginRequiredMixin, ListView):
template_name = ... | 33.827586 | 89 | 0.762487 |
4a11ba1769a78e5721ce273064204891690e9902 | 390 | py | Python | architecture/main.py | elisesweetnam/ES595project | 7c76a0d325b9ca4f31ab0723a217e621902a8100 | [
"MIT"
] | null | null | null | architecture/main.py | elisesweetnam/ES595project | 7c76a0d325b9ca4f31ab0723a217e621902a8100 | [
"MIT"
] | null | null | null | architecture/main.py | elisesweetnam/ES595project | 7c76a0d325b9ca4f31ab0723a217e621902a8100 | [
"MIT"
] | null | null | null | # import our modules
# this modile handles other modules by importing
import data_util
import db_util
import server
def main():
# documentations doc string (more than just a comment)
# done at the top of a function
'''
This module handles all the other modules
'''
server.handleServer()... | 22.941176 | 55 | 0.674359 |
4a11bbf785be2df1dd3dd438ab1a9cddf4c9ba8a | 1,170 | py | Python | megengine_release/configs/freeanchor_res18_coco_3x_800size.py | megvii-research/ICD | a97e0ecd9b69dbc0e3c2b8168c1d72ea79c6641b | [
"Apache-2.0"
] | 32 | 2021-11-09T11:19:21.000Z | 2022-03-21T17:37:32.000Z | configs/freeanchor_res18_coco_3x_800size.py | Senwang98/ICD | fdda393088fa31ac6dc9ddbd7ec3e7008ea32ff4 | [
"Apache-2.0"
] | 3 | 2022-02-28T08:51:13.000Z | 2022-03-30T09:16:41.000Z | configs/freeanchor_res18_coco_3x_800size.py | Senwang98/ICD | fdda393088fa31ac6dc9ddbd7ec3e7008ea32ff4 | [
"Apache-2.0"
] | 4 | 2021-11-11T11:59:05.000Z | 2022-03-30T03:26:41.000Z | # -*- coding: utf-8 -*-
# This repo is licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | 29.25 | 88 | 0.711966 |
4a11bc084f0a427f8208c05df22afeb4c87d178a | 3,875 | py | Python | test/gen_events.py | wwt/csna | cfef9187ec18b9654fe7a3632afd38a3ecc1f2a2 | [
"Apache-2.0"
] | 1 | 2022-03-10T18:07:20.000Z | 2022-03-10T18:07:20.000Z | test/gen_events.py | wwt/csna | cfef9187ec18b9654fe7a3632afd38a3ecc1f2a2 | [
"Apache-2.0"
] | null | null | null | test/gen_events.py | wwt/csna | cfef9187ec18b9654fe7a3632afd38a3ecc1f2a2 | [
"Apache-2.0"
] | null | null | null | #!/opt/soar/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 - 2022 World Wide Technology
# All rights reserved.
#
# author: Joel W. King @joelwking - World Wide Technology
#
# references:
# https://kc.mcafee.com/resources/sites/MCAFEE/content/live/CORP_KNOWLEDGEBASE/78000/KB78712... | 31.762295 | 136 | 0.651613 |
4a11bc9f1aaf2a37f8952de30b87a292bf0b1b5c | 3,932 | py | Python | collagen/data/_dataprovider.py | MIPT-Oulu/Collagen | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | [
"MIT"
] | 4 | 2019-05-14T14:44:51.000Z | 2020-03-13T08:37:48.000Z | collagen/data/_dataprovider.py | MIPT-Oulu/Collagen | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | [
"MIT"
] | 26 | 2019-04-21T20:35:22.000Z | 2022-03-12T00:32:57.000Z | collagen/data/_dataprovider.py | MIPT-Oulu/Collagen | 0cbc4285d60e5c9fcc89f629fcf4321e80b7452c | [
"MIT"
] | 1 | 2019-05-14T14:53:28.000Z | 2019-05-14T14:53:28.000Z | import gc
class DataProvider(object):
""" Provides data from single or multiple ``ItemLoader``s
Parameters
----------
item_loaders : ``collagen.data.ItemLoader``
Dictionary that maps names to ``ItemLoader`` objects
"""
def __init__(self, item_loaders: dict):
self.__loaders = ... | 34.191304 | 124 | 0.579095 |
4a11bd475b8690f577757bfbd8e3031b8d990aca | 36,344 | py | Python | main/global_EoR_figures_producer.py | dannyjacobs/PRISim | 89e544d771cf5c4113a4d5787a57c9586fa98eac | [
"MIT"
] | null | null | null | main/global_EoR_figures_producer.py | dannyjacobs/PRISim | 89e544d771cf5c4113a4d5787a57c9586fa98eac | [
"MIT"
] | null | null | null | main/global_EoR_figures_producer.py | dannyjacobs/PRISim | 89e544d771cf5c4113a4d5787a57c9586fa98eac | [
"MIT"
] | null | null | null | import numpy as NP
import astropy.cosmology as CP
import scipy.constants as FCNST
import argparse
import yaml
import astropy
from astropy.io import fits, ascii
import progressbar as PGB
import matplotlib.pyplot as PLT
import matplotlib.colors as PLTC
import matplotlib.cm as CM
from matplotlib.ticker import FuncFormatte... | 47.884058 | 555 | 0.691641 |
4a11bd581432d5fa5ab64b205ced705eb086fc93 | 468 | py | Python | tests/conftest.py | Ivo-B/CC-DL-template | 9374c968a62a6604f8939b62e775af027c75a76b | [
"MIT"
] | 1 | 2022-01-11T09:55:23.000Z | 2022-01-11T09:55:23.000Z | tests/conftest.py | Ivo-B/CC-DL-template | 9374c968a62a6604f8939b62e775af027c75a76b | [
"MIT"
] | null | null | null | tests/conftest.py | Ivo-B/CC-DL-template | 9374c968a62a6604f8939b62e775af027c75a76b | [
"MIT"
] | null | null | null | import pytest
default_args: dict = {
"project_name": "My test project",
"repo_name": "my-test-repo",
"module_name": "mtr",
"author_name": "Ivo Baltruschat",
"author_mail": "im.baltruschat@icloud.com",
"description": "A nice test project.",
"dl_framework": "Tensorflow",
"add_example_code... | 23.4 | 47 | 0.638889 |
4a11be74add726183da27c78d4a565e93955e42d | 140 | py | Python | Learning/Test50_map.py | liang1024/Python | a80127500f7a171567e32699f42128f3ddc44b3f | [
"Apache-2.0"
] | 1 | 2017-03-07T13:49:27.000Z | 2017-03-07T13:49:27.000Z | Learning/Test50_map.py | liang1024/Python | a80127500f7a171567e32699f42128f3ddc44b3f | [
"Apache-2.0"
] | null | null | null | Learning/Test50_map.py | liang1024/Python | a80127500f7a171567e32699f42128f3ddc44b3f | [
"Apache-2.0"
] | null | null | null |
'''
Map:
'''
income=[10,30,75]
def double_money(dollars):
return dollars*2
new_income=list(map(double_money,income))
print(new_income) | 14 | 41 | 0.721429 |
4a11bf9093295cd7192778ef71496efbf6a87f83 | 1,252 | py | Python | okta/komand_okta/actions/assign_user_to_app_sso/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | okta/komand_okta/actions/assign_user_to_app_sso/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | okta/komand_okta/actions/assign_user_to_app_sso/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
APPLICATIONID = "applicationId"
APPUSER = "appuser"
class Output:
RESULT = "result"
class AssignUserToAppSsoInput(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"proper... | 19.261538 | 140 | 0.577476 |
4a11c167970b1074ae81df53df3f7ef204489a35 | 983 | py | Python | boots/envs/batched_env.py | roosephu/boots | 2f4f500f54feb95cf36abd863f3de4510d6f4950 | [
"MIT"
] | 13 | 2019-10-15T10:43:39.000Z | 2021-03-20T06:27:15.000Z | boots/envs/batched_env.py | roosephu/boots | 2f4f500f54feb95cf36abd863f3de4510d6f4950 | [
"MIT"
] | null | null | null | boots/envs/batched_env.py | roosephu/boots | 2f4f500f54feb95cf36abd863f3de4510d6f4950 | [
"MIT"
] | 6 | 2020-01-21T06:51:18.000Z | 2021-05-27T20:25:35.000Z | import numpy as np
from gym import Wrapper
from . import BaseBatchedEnv
class BatchedEnv(BaseBatchedEnv, Wrapper):
def __init__(self, make_envs):
envs = [make_env() for make_env in make_envs]
super().__init__(envs[0])
self.envs = envs
self.n_envs = len(envs)
def step(self, act... | 25.868421 | 61 | 0.599186 |
4a11c169e5267f7c09900d6652a1df96d5776f7b | 72,844 | py | Python | jax/lax/lax_control_flow.py | megioliver/jax | 620bf4300b74c298a5e0133e08f60f76700cf37f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-03-12T04:34:46.000Z | 2020-03-12T04:34:46.000Z | jax/lax/lax_control_flow.py | megioliver/jax | 620bf4300b74c298a5e0133e08f60f76700cf37f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/lax/lax_control_flow.py | megioliver/jax | 620bf4300b74c298a5e0133e08f60f76700cf37f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 43.593058 | 102 | 0.702474 |
4a11c1a96bd8d5adf526ac9f8f4aa9650070f07b | 47,851 | py | Python | tests/admin_filters/tests.py | beniwohli/django | 514b2c989a948e3c59bda0da0c9427acf643cf5b | [
"PSF-2.0",
"BSD-3-Clause"
] | 12 | 2018-06-30T15:20:10.000Z | 2020-10-20T02:15:00.000Z | tests/admin_filters/tests.py | beniwohli/django | 514b2c989a948e3c59bda0da0c9427acf643cf5b | [
"PSF-2.0",
"BSD-3-Clause"
] | 7 | 2018-06-18T17:56:50.000Z | 2020-06-24T16:51:04.000Z | tests/admin_filters/tests.py | beniwohli/django | 514b2c989a948e3c59bda0da0c9427acf643cf5b | [
"PSF-2.0",
"BSD-3-Clause"
] | 5 | 2018-07-17T05:41:04.000Z | 2020-07-31T12:30:46.000Z | import datetime
import sys
import unittest
from django.contrib.admin import (
AllValuesFieldListFilter, BooleanFieldListFilter, ModelAdmin,
RelatedOnlyFieldListFilter, SimpleListFilter, site,
)
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.auth.admin import UserAdmin
fr... | 43.42196 | 119 | 0.671731 |
4a11c1d6ea97e9b3875786c29f85e406fa447c49 | 1,532 | py | Python | edge_promoting.py | williamlus/pytorch-CartoonGAN | 0de1105386529ffa1cd8a0d8f6fdc9faee325785 | [
"MIT"
] | 356 | 2018-07-24T17:53:12.000Z | 2022-03-30T15:26:04.000Z | edge_promoting.py | williamlus/pytorch-CartoonGAN | 0de1105386529ffa1cd8a0d8f6fdc9faee325785 | [
"MIT"
] | 17 | 2018-09-24T16:51:28.000Z | 2021-01-23T03:00:20.000Z | edge_promoting.py | williamlus/pytorch-CartoonGAN | 0de1105386529ffa1cd8a0d8f6fdc9faee325785 | [
"MIT"
] | 84 | 2018-07-30T12:06:13.000Z | 2021-11-06T08:18:16.000Z | import cv2, os
import numpy as np
from tqdm import tqdm
def edge_promoting(root, save):
file_list = os.listdir(root)
if not os.path.isdir(save):
os.makedirs(save)
kernel_size = 5
kernel = np.ones((kernel_size, kernel_size), np.uint8)
gauss = cv2.getGaussianKernel(kernel_size, 0)
... | 46.424242 | 158 | 0.579634 |
4a11c2604077da636ea32864573cdf92120fbb73 | 1,294 | py | Python | rss.py | dnuka/banda | 26d9aa203794f2ea4d0d2327a0486e7b0b425fda | [
"MIT"
] | 8 | 2018-05-26T04:34:01.000Z | 2021-11-08T11:41:31.000Z | rss.py | dnuka/banda | 26d9aa203794f2ea4d0d2327a0486e7b0b425fda | [
"MIT"
] | 13 | 2018-10-11T04:50:25.000Z | 2021-10-12T15:32:18.000Z | rss.py | dnuka/banda | 26d9aa203794f2ea4d0d2327a0486e7b0b425fda | [
"MIT"
] | 11 | 2018-10-11T05:41:49.000Z | 2020-06-20T03:18:29.000Z | #! /usr/bin/env python3
from urllib import request
from urllib.parse import urlparse
from bs4 import BeautifulSoup
feeds = [
"https://news.ycombinator.com/rss",
"https://www.wired.com/feed/category/security/latest/rss",
"https://arstechnica.com/feed/",
]
def identify(url):
# identify rss source
... | 24.415094 | 73 | 0.603555 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.