hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c40e8a942494ad1bfdb9f0df2e12a301ede13b52 | 2,251 | py | Python | gazeclassify/tutorials/get_mask_and_dilate.py | Flow000/gazeclassify | dda4c8cd62ad84615f4272171f1635ab683f9bed | [
"MIT"
] | 6 | 2021-02-25T01:17:09.000Z | 2022-03-19T07:13:52.000Z | gazeclassify/tutorials/get_mask_and_dilate.py | Flow000/gazeclassify | dda4c8cd62ad84615f4272171f1635ab683f9bed | [
"MIT"
] | 3 | 2021-05-10T07:38:24.000Z | 2021-06-07T12:59:29.000Z | gazeclassify/tutorials/get_mask_and_dilate.py | Flow000/gazeclassify | dda4c8cd62ad84615f4272171f1635ab683f9bed | [
"MIT"
] | 1 | 2021-06-24T12:58:01.000Z | 2021-06-24T12:58:01.000Z | from __future__ import annotations
from pathlib import Path
from typing import Dict, Tuple
import cv2 # type: ignore
import numpy as np # type: ignore
from pixellib.instance import instance_segmentation # type: ignore
from gazeclassify.thirdparty.pixellib_api import InferSpeed
from gazeclassify.tutorials.model_do... | 36.306452 | 113 | 0.750777 |
f43ef6f792e532f6ee92ca50d478d08d9352edcd | 2,389 | py | Python | xonsh/completers/pip.py | meramsey/xonsh | 5685ffc8b8aa921012b31dc8af02e14388b730e9 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xonsh/completers/pip.py | meramsey/xonsh | 5685ffc8b8aa921012b31dc8af02e14388b730e9 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xonsh/completers/pip.py | meramsey/xonsh | 5685ffc8b8aa921012b31dc8af02e14388b730e9 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """Completers for pip."""
# pylint: disable=invalid-name, missing-docstring, unsupported-membership-test
# pylint: disable=unused-argument, not-an-iterable
import re
import subprocess
import xonsh.lazyasd as xl
from xonsh.completers.tools import (
contextual_command_completer,
get_filter_function,
RichComp... | 28.783133 | 88 | 0.629971 |
cf6e53cbc7d1759938af89a5a67d2c58e10c15b1 | 18,586 | py | Python | zutils/tf_math_funcs.py | d1ngn1gefe1/lmdis-rep | b334d7e5eb281948107ac6781807945ff7a4dfc2 | [
"Apache-2.0"
] | 133 | 2018-06-19T22:17:59.000Z | 2022-03-03T06:49:45.000Z | zutils/tf_math_funcs.py | d1ngn1gefe1/lmdis-rep | b334d7e5eb281948107ac6781807945ff7a4dfc2 | [
"Apache-2.0"
] | 5 | 2018-06-26T23:38:50.000Z | 2019-12-30T02:43:43.000Z | zutils/tf_math_funcs.py | d1ngn1gefe1/lmdis-rep | b334d7e5eb281948107ac6781807945ff7a4dfc2 | [
"Apache-2.0"
] | 21 | 2018-08-24T09:58:17.000Z | 2022-01-11T02:15:40.000Z | import tensorflow as tf
import numpy as np
import math
from copy import copy
from collections import Iterable
from functools import reduce
epsilon = 1e-6
epsilon2 = 1e-160
def is_tf_data(a):
return isinstance(a, (tf.Tensor, tf.Variable))
def get_shape(a):
def int_r(v):
if v is None:
re... | 28.950156 | 112 | 0.601797 |
e04e06e5d49e3282675579ec3f0505c7497505d1 | 3,294 | py | Python | transit-time/web/route.py | achien/transit-time | 527271a31e80e6a598a83716bd1a231f6b6cd47b | [
"MIT"
] | 11 | 2020-02-08T00:06:17.000Z | 2021-01-20T00:02:28.000Z | transit-time/web/route.py | achien/transit-time | 527271a31e80e6a598a83716bd1a231f6b6cd47b | [
"MIT"
] | 2 | 2021-04-10T19:08:04.000Z | 2021-05-11T18:50:41.000Z | transit-time/web/route.py | achien/transit-time | 527271a31e80e6a598a83716bd1a231f6b6cd47b | [
"MIT"
] | null | null | null | import asyncio
import sqlalchemy as sa
from async_lru import alru_cache
from starlette.endpoints import HTTPEndpoint
import c
import db
from scraper.gtfs import gtfs
from web import templates
class Route(HTTPEndpoint):
async def get(self, request):
system = gtfs.TransitSystem(request.path_params["system... | 34.3125 | 85 | 0.567092 |
9b7233313cd6c49fa6764c4195115dee052b7a77 | 2,307 | py | Python | py/app/api_pandas.py | mattorama/tufterati | fa2f8b8f89ad673bc10342fdc9f0f0acac40cdc7 | [
"MIT"
] | null | null | null | py/app/api_pandas.py | mattorama/tufterati | fa2f8b8f89ad673bc10342fdc9f0f0acac40cdc7 | [
"MIT"
] | null | null | null | py/app/api_pandas.py | mattorama/tufterati | fa2f8b8f89ad673bc10342fdc9f0f0acac40cdc7 | [
"MIT"
] | null | null | null | #%%
import numpy as np
import pandas as pd
#%%
s = pd.Series([1, 3, 5, np.nan, 6, 8])
#%%
dates = pd.date_range('20130101', periods=6)
#%%
df = pd.DataFrame(np.random.randn(6, 4), index=dates, columns=list('ABCD'))
#%%
df.index
#%%
df.sort_index(axis=1, ascending=False)
#%%
df.sort_values(by='B')
#%%
df.loc[dates... | 17.216418 | 96 | 0.569571 |
d7cb5c5e900ce34a32cd97fc51ed07f667e5e923 | 3,826 | py | Python | src/gradient_ascent_adv.py | Pandinosaurus/pytorch-cnn-adversarial-attacks | 8af67f124c904401947c90078481f93f3456e107 | [
"MIT"
] | 349 | 2017-12-16T10:39:03.000Z | 2022-03-23T07:00:34.000Z | src/gradient_ascent_adv.py | Pandinosaurus/pytorch-cnn-adversarial-attacks | 8af67f124c904401947c90078481f93f3456e107 | [
"MIT"
] | 1 | 2018-11-09T05:13:37.000Z | 2018-11-18T01:18:17.000Z | src/gradient_ascent_adv.py | Pandinosaurus/pytorch-cnn-adversarial-attacks | 8af67f124c904401947c90078481f93f3456e107 | [
"MIT"
] | 69 | 2017-12-28T01:28:41.000Z | 2021-12-22T05:17:15.000Z | """
Created on Thu Oct 29 14:09:01 2017
@author: Utku Ozbulak - github.com/utkuozbulak
"""
import os
import cv2
from torch.optim import SGD
from torchvision import models
from torch.nn import functional
from misc_functions import preprocess_image, recreate_image, get_params
class DisguisedFoolingSampleGeneration()... | 42.988764 | 107 | 0.604025 |
ad3e2de3344144a5229ca86b394d6804b6287970 | 28,519 | py | Python | tests/tests_compliant_logging/test_logging.py | Azure/shrike | 4c38d507187636a454b45f2022a90a2178339579 | [
"MIT"
] | 27 | 2021-05-27T00:01:24.000Z | 2022-01-30T19:55:24.000Z | tests/tests_compliant_logging/test_logging.py | Azure/shrike | 4c38d507187636a454b45f2022a90a2178339579 | [
"MIT"
] | 284 | 2021-05-12T22:26:41.000Z | 2022-02-23T21:18:34.000Z | tests/tests_compliant_logging/test_logging.py | Azure/shrike | 4c38d507187636a454b45f2022a90a2178339579 | [
"MIT"
] | 5 | 2021-06-02T04:51:47.000Z | 2021-12-20T17:07:41.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from shrike import compliant_logging
from shrike.compliant_logging.constants import DataCategory
from shrike.compliant_logging.logging import (
CompliantLogger,
get_aml_context,
)
from shrike.compliant_logging.exceptions import PublicRunt... | 32.481777 | 88 | 0.588836 |
d729546eb7981b0891b1903e3ca1af1452361a40 | 12,203 | py | Python | src/alsc/ar-bert-s/data_helpers.py | mainuliitkgp/AR-BERT | d6d5e8542a3a1c76edac49cec9e99ebda6395725 | [
"MIT"
] | 4 | 2022-03-06T17:41:57.000Z | 2022-03-22T08:42:58.000Z | src/alsc/ar-bert-s/data_helpers.py | mainuliitkgp/AR-BERT | d6d5e8542a3a1c76edac49cec9e99ebda6395725 | [
"MIT"
] | null | null | null | src/alsc/ar-bert-s/data_helpers.py | mainuliitkgp/AR-BERT | d6d5e8542a3a1c76edac49cec9e99ebda6395725 | [
"MIT"
] | 1 | 2022-03-19T14:04:42.000Z | 2022-03-19T14:04:42.000Z | # -*- coding: utf-8 -*-
import numpy as np
import re
import itertools
from collections import Counter
def load_data_and_labels(positive_data_file):
"""
Loads MR polarity data from files, splits the data into words and generates labels.
Returns split sentences and labels.
"""
# Load data from fi... | 36.426866 | 104 | 0.590674 |
c88ee603bee61f58b97954d5690d1b0ee47ca530 | 2,497 | py | Python | pulsar/apps/greenio/lock.py | PyCN/pulsar | fee44e871954aa6ca36d00bb5a3739abfdb89b26 | [
"BSD-3-Clause"
] | 1,410 | 2015-01-02T14:55:07.000Z | 2022-03-28T17:22:06.000Z | pulsar/apps/greenio/lock.py | PyCN/pulsar | fee44e871954aa6ca36d00bb5a3739abfdb89b26 | [
"BSD-3-Clause"
] | 194 | 2015-01-22T06:18:24.000Z | 2020-10-20T21:21:58.000Z | pulsar/apps/greenio/lock.py | PyCN/pulsar | fee44e871954aa6ca36d00bb5a3739abfdb89b26 | [
"BSD-3-Clause"
] | 168 | 2015-01-31T10:29:55.000Z | 2022-03-14T10:22:24.000Z | import threading
from collections import deque
from asyncio import get_event_loop
from greenlet import getcurrent
from pulsar.api import create_future
from .utils import MustBeInChildGreenlet
class GreenLock:
"""A Locking primitive that is owned by a particular greenlet
when locked.The main greenlet cannot... | 32.012821 | 79 | 0.643973 |
30f45d4f4949dbdefbe8162ce2f5eaee64b17f33 | 10,565 | py | Python | biosteam/process_tools/reactor_specification.py | EVBiotechBV/biosteam | c31c5998c6f6a52f9e06daba0ddc73bdee78a07a | [
"MIT"
] | 73 | 2020-03-04T20:14:07.000Z | 2022-03-14T00:35:18.000Z | biosteam/process_tools/reactor_specification.py | EVBiotechBV/biosteam | c31c5998c6f6a52f9e06daba0ddc73bdee78a07a | [
"MIT"
] | 74 | 2020-03-06T11:47:32.000Z | 2022-03-31T17:55:24.000Z | biosteam/process_tools/reactor_specification.py | EVBiotechBV/biosteam | c31c5998c6f6a52f9e06daba0ddc73bdee78a07a | [
"MIT"
] | 19 | 2020-03-06T13:59:27.000Z | 2022-02-22T15:24:21.000Z | # -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020-2021, Yoel Cortes-Pena <yoelcortes@gmail.com>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details... | 32.912773 | 87 | 0.589683 |
5e74a85ec47078f9cf2d1d78b7a9ab87d0784d91 | 3,174 | py | Python | koans/about_strings.py | Dimetry537/python_koans | 0db5e24fb207bf4d8eab19b891aeffda84b1d074 | [
"MIT"
] | null | null | null | koans/about_strings.py | Dimetry537/python_koans | 0db5e24fb207bf4d8eab19b891aeffda84b1d074 | [
"MIT"
] | null | null | null | koans/about_strings.py | Dimetry537/python_koans | 0db5e24fb207bf4d8eab19b891aeffda84b1d074 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(True, isinstance(string, str))
def test_single_quoted_strings_are_also_strings(self):
string =... | 33.410526 | 85 | 0.642722 |
101f2091f6e1772495278b7eb3272af454c137c5 | 10,343 | py | Python | nodegraph/widgets/tab_search.py | fivedbrothers/nodegraph | 1080176035be1d81f1c43f4701aa0ad5d95e323f | [
"MIT"
] | null | null | null | nodegraph/widgets/tab_search.py | fivedbrothers/nodegraph | 1080176035be1d81f1c43f4701aa0ad5d95e323f | [
"MIT"
] | null | null | null | nodegraph/widgets/tab_search.py | fivedbrothers/nodegraph | 1080176035be1d81f1c43f4701aa0ad5d95e323f | [
"MIT"
] | null | null | null |
import re
from collections import OrderedDict
from PySide6 import QtCore, QtWidgets, QtGui
from nodegraph.constants import (
VIEWER_BG_COLOR,
VIEWER_NAV_BG_COLOR,
NODE_SEL_BORDER_COLOR
)
class TabSearchCompleter(QtWidgets.QCompleter):
"""
QCompleter adapted from:
https://stackoverflow.com/q... | 35.300341 | 82 | 0.557285 |
4605fbc170c458911f7c6fb5554e3890f0e5647d | 3,283 | py | Python | code/python/Formula/v1/fds/sdk/Formula/__init__.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/Formula/v1/fds/sdk/Formula/__init__.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/Formula/v1/fds/sdk/Formula/__init__.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
"""
FactSet Formula API
**FactSet Formula API** FactSet’s Formula API is a modern, flexible, formula-based API that enables users to access FactSet’s wide range of financial data and content. The API offers two endpoints, one optimized for time-series analysis and one designed for cross-secti... | 117.25 | 2,620 | 0.797137 |
a28d3b5117de0d30b93489fcf7f0c896a64c078c | 2,414 | py | Python | misty2py/utils/utils.py | ChrisScarred/misty-programming | 851376514c833214c55c93011458bd7603448e8b | [
"MIT"
] | 1 | 2021-04-14T17:24:37.000Z | 2021-04-14T17:24:37.000Z | misty2py/utils/utils.py | ChrisScarred/misty2py | 851376514c833214c55c93011458bd7603448e8b | [
"MIT"
] | null | null | null | misty2py/utils/utils.py | ChrisScarred/misty2py | 851376514c833214c55c93011458bd7603448e8b | [
"MIT"
] | null | null | null | """This module contains miscellaneous utility functions."""
import os
from typing import Any, Callable, Dict, List, Type
from dotenv import dotenv_values
def get_project_folder(env_path: str = ".env") -> str:
"""Obtains the project directory using the `PROJECT_DIR` value from the supplied .env file."""
value... | 34.485714 | 136 | 0.693869 |
eb0d7d77435f678bb81d4b4fb9b46cb3dc980060 | 18,579 | py | Python | tests/rule_based_profiler/test_rule_output.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | tests/rule_based_profiler/test_rule_output.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | tests/rule_based_profiler/test_rule_output.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List
from great_expectations.core import ExpectationConfiguration
from great_expectations.rule_based_profiler.rule import RuleOutput
from great_expectations.rule_based_profiler.types import Domain, ParameterNode
def test_rule_output_get_get_expectation_configurations(
rule_output_for_rul... | 36.287109 | 92 | 0.378384 |
c5f56a5d626631a5dd0bd341f01c53cfaa000305 | 9,143 | py | Python | tests/m2m_through_regress/tests.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | 2 | 2016-07-23T18:08:37.000Z | 2016-07-24T09:54:34.000Z | tests/m2m_through_regress/tests.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | null | null | null | tests/m2m_through_regress/tests.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | 1 | 2020-05-25T08:55:19.000Z | 2020-05-25T08:55:19.000Z | from __future__ import unicode_literals
from django.core import management
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils.six import StringIO
from .models import (Person, Group, Membership, UserMembership, Car, Driver,
CarDriver)
class M2MThroughTestCase(TestCase)... | 38.578059 | 360 | 0.619053 |
b9f9830b8beb0322dce68419fe8a3af6d48f3dc3 | 3,239 | py | Python | tensorflow_datasets/testing/mocking_test.py | shikhar2707/datasets | c034a193967d6d72152196708a5638e546e320f4 | [
"Apache-2.0"
] | 7 | 2020-04-21T01:28:30.000Z | 2021-06-13T07:23:33.000Z | tensorflow_datasets/testing/mocking_test.py | shikhar2707/datasets | c034a193967d6d72152196708a5638e546e320f4 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/testing/mocking_test.py | shikhar2707/datasets | c034a193967d6d72152196708a5638e546e320f4 | [
"Apache-2.0"
] | 4 | 2020-04-25T15:48:46.000Z | 2020-11-22T20:35:01.000Z | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 35.988889 | 78 | 0.704847 |
de81c9962290bce5109c3313b5ff1147ef09e3af | 13,806 | py | Python | my_player.py | rsyamil/minimax-seven-go | d4562ded18f493c53661a3ec9611a4f51a0cbf9e | [
"Apache-2.0"
] | null | null | null | my_player.py | rsyamil/minimax-seven-go | d4562ded18f493c53661a3ec9611a4f51a0cbf9e | [
"Apache-2.0"
] | null | null | null | my_player.py | rsyamil/minimax-seven-go | d4562ded18f493c53661a3ec9611a4f51a0cbf9e | [
"Apache-2.0"
] | 1 | 2022-03-15T17:09:01.000Z | 2022-03-15T17:09:01.000Z | from go import *
from util import *
from os import path
import random
from math import inf
class MyPlayer:
def __init__(self, name=[], go=None, piece_type=None, expansion_limit=None,
verbose=None, b_tune=None, w_tune=None):
self.name = name
self.verbose = verbose
... | 45.86711 | 147 | 0.572505 |
2c504ffb6ba5d0883a79efc5b241f82865b8dc6d | 998 | py | Python | labs/lab13/tests/compose-all.py | abalone88/cs61a_2018sp | 59d408d0961cf71faf10b77779bfc71c0c508f0c | [
"MIT"
] | 2 | 2021-06-05T20:36:20.000Z | 2021-06-05T20:44:26.000Z | labs/lab13/tests/compose-all.py | abalone88/cs61a_2018sp | 59d408d0961cf71faf10b77779bfc71c0c508f0c | [
"MIT"
] | null | null | null | labs/lab13/tests/compose-all.py | abalone88/cs61a_2018sp | 59d408d0961cf71faf10b77779bfc71c0c508f0c | [
"MIT"
] | null | null | null | test = {
'name': 'compose-all',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> (define identity (compose-all (list)))
identity
scm> (identity 42)
42
""",
'hidden': False,
'locked': False
},
... | 22.177778 | 75 | 0.410822 |
fecb343c41b72a142d7f58b740eb405eda1a6cc6 | 267 | py | Python | backend/app.py | Nikhileshsandela/Window_Counter | 6f13b73c7317a7b272c820f0d168bcb0400c1c83 | [
"MIT"
] | null | null | null | backend/app.py | Nikhileshsandela/Window_Counter | 6f13b73c7317a7b272c820f0d168bcb0400c1c83 | [
"MIT"
] | 13 | 2020-02-24T10:38:29.000Z | 2022-02-27T00:07:04.000Z | backend/app.py | Nikhileshsandela/Window_Counter | 6f13b73c7317a7b272c820f0d168bcb0400c1c83 | [
"MIT"
] | 3 | 2020-02-20T15:48:03.000Z | 2020-02-29T21:16:45.000Z | from flask import Flask # importing flask class
from flask_cors import CORS # importing cross originating resource
# flask initialization
app = Flask(__name__)
CORS(app)
cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
app.secret_key = "secret key" | 33.375 | 68 | 0.715356 |
0ac3ad6e51b8e7c8d1d3d797e40d0e8583c62a9f | 9,078 | py | Python | svdb/merge_vcf_module.py | jemten/SVDB | e36181e45b0dd3329aef778ad1e62a1181b8d00f | [
"MIT"
] | null | null | null | svdb/merge_vcf_module.py | jemten/SVDB | e36181e45b0dd3329aef778ad1e62a1181b8d00f | [
"MIT"
] | null | null | null | svdb/merge_vcf_module.py | jemten/SVDB | e36181e45b0dd3329aef778ad1e62a1181b8d00f | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import gzip
import sys
from . import merge_vcf_module_cython, readVCF
def print_header(vcf_list, vcf_dictionary, args, command_line):
header = {"ALT": {},
"INFO": {},
"FILTER": {},
"FORMAT": {},
"CONTIGS": []}
con... | 44.719212 | 191 | 0.549901 |
c989f226cf2d8884ad6687db7f581558879df984 | 52,582 | py | Python | tests/unit/test_checkpointing.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | 1 | 2022-03-15T07:00:38.000Z | 2022-03-15T07:00:38.000Z | tests/unit/test_checkpointing.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | null | null | null | tests/unit/test_checkpointing.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | null | null | null | import torch
import torch.distributed as dist
import deepspeed
from deepspeed.runtime.zero.stage_1_and_2 import DeepSpeedZeroOptimizer
from deepspeed.utils import groups
from deepspeed.runtime.fp16.fused_optimizer import FP16_Optimizer
from deepspeed.runtime.fp16.unfused_optimizer import FP16_UnfusedOptimizer
from de... | 37.451567 | 137 | 0.497357 |
afbb299b3f0acc323cdd969e55777143b6f4db8c | 591 | py | Python | tests/test_rollout.py | Caffa/sequential_social_dilemma_games | de9af51f6cad2fbbd1fb28707364f997e7fc14f6 | [
"MIT"
] | 284 | 2019-01-17T00:56:27.000Z | 2022-03-28T19:23:04.000Z | tests/test_rollout.py | Caffa/sequential_social_dilemma_games | de9af51f6cad2fbbd1fb28707364f997e7fc14f6 | [
"MIT"
] | 134 | 2018-12-20T18:53:29.000Z | 2022-01-18T20:13:04.000Z | tests/test_rollout.py | Caffa/sequential_social_dilemma_games | de9af51f6cad2fbbd1fb28707364f997e7fc14f6 | [
"MIT"
] | 111 | 2019-01-28T22:32:23.000Z | 2022-03-24T07:11:02.000Z | import os
import unittest
from visualization.rollout import Controller
class TestRollout(unittest.TestCase):
def setUp(self):
class Args(object):
pass
args = Args()
args.env = "cleanup"
self.controller = Controller(args)
def test_rollouts(self):
path = o... | 21.888889 | 60 | 0.639594 |
cb54bb1bc6c2ba4a065faa632c0f4a76c35a6c63 | 3,407 | py | Python | doc/source/conf.py | Dantali0n/RadLoggerPy | c630ce730519001ee39fb3a02dd3652943a23067 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | Dantali0n/RadLoggerPy | c630ce730519001ee39fb3a02dd3652943a23067 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | Dantali0n/RadLoggerPy | c630ce730519001ee39fb3a02dd3652943a23067 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 29.885965 | 79 | 0.710889 |
e02c9e776299eef2b8e01c159220b4809c37fff4 | 416 | py | Python | code_week24_105_1011/qing_wa_tiao_tai_jie_lcof.py | dylanlee101/leetcode | b059afdadb83d504e62afd1227107de0b59557af | [
"Apache-2.0"
] | null | null | null | code_week24_105_1011/qing_wa_tiao_tai_jie_lcof.py | dylanlee101/leetcode | b059afdadb83d504e62afd1227107de0b59557af | [
"Apache-2.0"
] | null | null | null | code_week24_105_1011/qing_wa_tiao_tai_jie_lcof.py | dylanlee101/leetcode | b059afdadb83d504e62afd1227107de0b59557af | [
"Apache-2.0"
] | null | null | null | '''
一只青蛙一次可以跳上1级台阶,也可以跳上2级台阶。求该青蛙跳上一个 n 级的台阶总共有多少种跳法。
答案需要取模 1e9+7(1000000007),如计算初始结果为:1000000008,请返回 1。
示例 1:
输入:n = 2
输出:2
示例 2:
输入:n = 7
输出:21
示例 3:
输入:n = 0
输出:1
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/qing-wa-tiao-tai-jie-wen-ti-lcof
'''
class Solution:
def numWays(self, n: int) -> int:
... | 15.407407 | 68 | 0.610577 |
3fae21345f74cd00724372502138840ecf5d154c | 4,455 | py | Python | watchgod/watcher.py | Kludex/watchgod | 1f738352da0a38eed25f4730fde097f06eaaacd6 | [
"MIT"
] | 688 | 2017-10-17T12:18:22.000Z | 2022-03-23T06:31:49.000Z | watchgod/watcher.py | Kludex/watchgod | 1f738352da0a38eed25f4730fde097f06eaaacd6 | [
"MIT"
] | 100 | 2017-10-17T12:17:16.000Z | 2022-03-23T10:42:10.000Z | watchgod/watcher.py | Kludex/watchgod | 1f738352da0a38eed25f4730fde097f06eaaacd6 | [
"MIT"
] | 79 | 2018-01-05T10:08:37.000Z | 2022-03-10T06:36:12.000Z | import logging
import os
import re
from enum import IntEnum
from pathlib import Path
from typing import TYPE_CHECKING, Dict, Optional, Pattern, Set, Tuple, Union
__all__ = 'Change', 'AllWatcher', 'DefaultDirWatcher', 'DefaultWatcher', 'PythonWatcher', 'RegExpWatcher'
logger = logging.getLogger('watchgod.watcher')
cl... | 36.219512 | 106 | 0.641077 |
85833a96582e68625a2e769af33a87fdb3ef3655 | 5,169 | py | Python | test/integration/ggrc_workflows/generator.py | sbilly/ggrc-core | 59a6825c6a8e15e42ebdb9e08d079cefd1800120 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2016-11-06T05:21:24.000Z | 2016-11-06T05:21:24.000Z | test/integration/ggrc_workflows/generator.py | sbilly/ggrc-core | 59a6825c6a8e15e42ebdb9e08d079cefd1800120 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-02-02T23:09:40.000Z | 2021-02-08T21:00:48.000Z | test/integration/ggrc_workflows/generator.py | sbilly/ggrc-core | 59a6825c6a8e15e42ebdb9e08d079cefd1800120 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from datetime import date
from ggrc import db
from ggrc import builder
from ggrc_workflows.models import (Workflow, TaskGroup, TaskGroupTask,
TaskGroupObject, Cycle)
from i... | 28.245902 | 78 | 0.676533 |
f008409f1eef82be72c53fe0a4b11ed697a4814f | 587 | py | Python | boxuegu/apps/courses/migrations/0009_auto_20190613_2010.py | boxuegushixun/boxuegu | d7d6d014bc85673d7db30936a3b1e07ba8b58d5d | [
"MIT"
] | null | null | null | boxuegu/apps/courses/migrations/0009_auto_20190613_2010.py | boxuegushixun/boxuegu | d7d6d014bc85673d7db30936a3b1e07ba8b58d5d | [
"MIT"
] | null | null | null | boxuegu/apps/courses/migrations/0009_auto_20190613_2010.py | boxuegushixun/boxuegu | d7d6d014bc85673d7db30936a3b1e07ba8b58d5d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2019-06-13 20:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('courses', '0008_bannercourse'),
]
operations = [
... | 26.681818 | 154 | 0.660988 |
893f74226b14f9845c31a0b06353413c99450cc6 | 3,910 | py | Python | third_party/webrtc/src/chromium/src/tools/perf/measurements/timeline_controller.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 8 | 2016-02-08T11:59:31.000Z | 2020-05-31T15:19:54.000Z | third_party/webrtc/src/chromium/src/tools/perf/measurements/timeline_controller.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 1 | 2021-05-05T11:11:31.000Z | 2021-05-05T11:11:31.000Z | third_party/webrtc/src/chromium/src/tools/perf/measurements/timeline_controller.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 7 | 2016-02-09T09:28:14.000Z | 2020-07-25T19:03:36.000Z | # Copyright 2014 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.
from telemetry.page import action_runner
from telemetry.page import page_test
from telemetry.timeline.model import TimelineModel
from telemetry.timeline impo... | 36.542056 | 78 | 0.752941 |
a3c46cd8f7f7dc7cdb119ecd03613afcc462d207 | 6,649 | py | Python | PJ-X-ACT/build_val_model.py | Seth-Park/MultimodalExplanations | b58c09ac38a5e5d08541a94599410e59ec5cdec6 | [
"BSD-2-Clause"
] | 39 | 2018-07-18T16:31:46.000Z | 2022-01-25T16:38:51.000Z | PJ-X-ACT/build_val_model.py | Seth-Park/MultimodalExplanations | b58c09ac38a5e5d08541a94599410e59ec5cdec6 | [
"BSD-2-Clause"
] | 13 | 2018-10-15T19:10:34.000Z | 2021-11-03T02:21:53.000Z | PJ-X-ACT/build_val_model.py | Seth-Park/MultimodalExplanations | b58c09ac38a5e5d08541a94599410e59ec5cdec6 | [
"BSD-2-Clause"
] | 6 | 2018-11-09T15:41:31.000Z | 2021-05-26T11:42:30.000Z | import matplotlib
matplotlib.use('Agg')
import os
import sys
import numpy as np
import json
import matplotlib.pyplot as plt
import caffe
from caffe import layers as L
from caffe import params as P
import config
def learning_params(param_list):
param_dicts = []
for pl in param_list:
param_dict = {}
... | 49.992481 | 145 | 0.698902 |
e5392121c83357ee5c4a9c1239d9f090abfd14c5 | 16,037 | py | Python | jaxopt/_src/levenberg_marquardt.py | amir-saadat/jaxopt | d0e3949b04c06960dfbb631386eee20ebffa50a6 | [
"Apache-2.0"
] | null | null | null | jaxopt/_src/levenberg_marquardt.py | amir-saadat/jaxopt | d0e3949b04c06960dfbb631386eee20ebffa50a6 | [
"Apache-2.0"
] | null | null | null | jaxopt/_src/levenberg_marquardt.py | amir-saadat/jaxopt | d0e3949b04c06960dfbb631386eee20ebffa50a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 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 to in writing, ... | 40.806616 | 91 | 0.668329 |
d37710407eb062c842a05aae53b81cc794951351 | 1,599 | py | Python | 07_neuroevolution/helpers/pendulum_jax.py | RobertTLange/code-and-blog | a727390b8668dbf7352759220666548e2d1a0e2d | [
"Apache-2.0"
] | 63 | 2020-01-08T16:09:43.000Z | 2022-01-17T11:20:06.000Z | 07_neuroevolution/helpers/pendulum_jax.py | RobertTLange/code-and-blog | a727390b8668dbf7352759220666548e2d1a0e2d | [
"Apache-2.0"
] | 4 | 2021-03-10T20:40:53.000Z | 2022-02-07T12:49:27.000Z | 07_neuroevolution/helpers/pendulum_jax.py | RobertTLange/code-and-blog | a727390b8668dbf7352759220666548e2d1a0e2d | [
"Apache-2.0"
] | 9 | 2020-04-24T09:34:49.000Z | 2021-06-29T03:06:43.000Z | import jax
import jax.numpy as jnp
from jax import jit
# Default environment parameters for Pendulum-v0
env_params = {"max_speed": 8,
"max_torque": 2.,
"dt": 0.05,
"g": 10.0,
"m": 1.,
"l": 1.}
def step_pendulum(params, state, u):
""" Integrat... | 30.75 | 76 | 0.565979 |
42bf8c25fa2d29c0d685f02628d4959370710680 | 6,924 | py | Python | sentinelhub/time_utils.py | adamchainz/sentinelhub-py | d7ad283cf9d4bd4c8c1a8b169cdbe37c5bc8208a | [
"MIT"
] | 573 | 2018-01-15T21:44:59.000Z | 2022-03-27T22:03:37.000Z | sentinelhub/time_utils.py | adamchainz/sentinelhub-py | d7ad283cf9d4bd4c8c1a8b169cdbe37c5bc8208a | [
"MIT"
] | 189 | 2018-01-23T14:35:34.000Z | 2022-03-24T15:44:04.000Z | sentinelhub/time_utils.py | adamchainz/sentinelhub-py | d7ad283cf9d4bd4c8c1a8b169cdbe37c5bc8208a | [
"MIT"
] | 193 | 2018-01-16T09:31:47.000Z | 2022-03-29T07:11:42.000Z | """
Module with useful time/date functions
"""
import datetime as dt
import dateutil.parser
import dateutil.tz
def is_valid_time(time):
""" Check if input string represents a valid time/date stamp
:param time: a string containing a time/date stamp
:type time: str
:return: `True` is string is a valid... | 41.461078 | 119 | 0.706817 |
6cf5bb546f7984c8846e65630ad17772625516bc | 8,038 | py | Python | PokerRL/game/_/rl_env/poker_types/DiscretizedPokerEnv.py | hellovertex/PokerRL | 061ca745ec43ca6509111dafa4bb4b25796c8096 | [
"MIT"
] | null | null | null | PokerRL/game/_/rl_env/poker_types/DiscretizedPokerEnv.py | hellovertex/PokerRL | 061ca745ec43ca6509111dafa4bb4b25796c8096 | [
"MIT"
] | null | null | null | PokerRL/game/_/rl_env/poker_types/DiscretizedPokerEnv.py | hellovertex/PokerRL | 061ca745ec43ca6509111dafa4bb4b25796c8096 | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Eric Steinberger
import time
import numpy as np
from prl.environment.steinberger.PokerRL.game.Poker import Poker
from prl.environment.steinberger.PokerRL.game._.rl_env.base.PokerEnv import PokerEnv as _PokerEnv
from prl.environment.steinberger.PokerRL.game.poker_env_args import DiscretizedPoker... | 45.412429 | 120 | 0.628141 |
cba18f094af951464b0a1eb6f28f7bcb5478ff88 | 319 | py | Python | sagas/tests/services/simple.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 3 | 2020-01-11T13:55:38.000Z | 2020-08-25T22:34:15.000Z | sagas/tests/services/simple.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | null | null | null | sagas/tests/services/simple.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 1 | 2021-01-01T05:21:44.000Z | 2021-01-01T05:21:44.000Z | from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class HelloWorld(Resource):
"""
curl http://127.0.0.1:5000/
"""
def get(self):
return {'hello': 'world'}
api.add_resource(HelloWorld, '/')
if __name__ == '__main__':
app.run(debug=True)
| 17.722222 | 39 | 0.639498 |
c85296f8f807fe0b3d305495f3d3277706a4b652 | 67,114 | py | Python | torch/utils/data/dataloader.py | edward-io/pytorch | 04caef8e1d4f951cc380d6cebb9967b71695de13 | [
"Intel"
] | 5 | 2021-08-17T17:44:20.000Z | 2021-08-21T05:03:42.000Z | torch/utils/data/dataloader.py | edward-io/pytorch | 04caef8e1d4f951cc380d6cebb9967b71695de13 | [
"Intel"
] | 1 | 2021-09-03T09:35:27.000Z | 2021-09-03T09:35:27.000Z | torch/utils/data/dataloader.py | edward-io/pytorch | 04caef8e1d4f951cc380d6cebb9967b71695de13 | [
"Intel"
] | null | null | null | r"""Definition of the DataLoader and associated iterators that subclass _BaseDataLoaderIter
To support these two classes, in `./_utils` we define many utility methods and
functions to be run in multiprocessing. E.g., the data loading worker loop is
in `./_utils/worker.py`.
"""
import os
import threading
import iterto... | 50.499624 | 131 | 0.615013 |
5cdc17a23964fa0ab02811d3b4344c21ba30d7d9 | 1,754 | py | Python | sources/en/f/freelightnovel.py | Nyadist/lightnovel-crawler | 8a19b5bdddde2ace1a919abcc51143c450cf32d0 | [
"Apache-2.0"
] | 20 | 2018-02-09T07:13:49.000Z | 2018-10-31T00:15:53.000Z | sources/en/f/freelightnovel.py | Nyadist/lightnovel-crawler | 8a19b5bdddde2ace1a919abcc51143c450cf32d0 | [
"Apache-2.0"
] | 21 | 2018-03-22T10:40:45.000Z | 2018-11-10T13:44:00.000Z | sources/en/f/freelightnovel.py | Nyadist/lightnovel-crawler | 8a19b5bdddde2ace1a919abcc51143c450cf32d0 | [
"Apache-2.0"
] | 7 | 2018-03-22T10:40:08.000Z | 2018-10-28T12:18:06.000Z | # -*- coding: utf-8 -*-
import logging
import re
from lncrawl.core.crawler import Crawler
logger = logging.getLogger(__name__)
class FreeLightNovel(Crawler):
base_url = 'https://www.freelightnovel.com/'
def read_novel_info(self):
logger.debug('Visiting %s', self.novel_url)
soup = self.get_s... | 30.241379 | 73 | 0.569555 |
0a615fa1c605ce08504b5365b4120ff001d6e70c | 1,843 | py | Python | pywingui/shell.py | Answeror/lit | dbc01ee8e4e600a0a43e49ffd18873653cc3f7cc | [
"MIT"
] | null | null | null | pywingui/shell.py | Answeror/lit | dbc01ee8e4e600a0a43e49ffd18873653cc3f7cc | [
"MIT"
] | null | null | null | pywingui/shell.py | Answeror/lit | dbc01ee8e4e600a0a43e49ffd18873653cc3f7cc | [
"MIT"
] | 2 | 2016-10-13T01:10:41.000Z | 2019-01-28T17:11:39.000Z | from .windows import *
from .wtl import *
NIN_SELECT = (WM_USER + 0)
NINF_KEY = 0x1
NIN_KEYSELECT = (NIN_SELECT | NINF_KEY)
NIN_BALLOONSHOW = (WM_USER + 2)
NIN_BALLOONHIDE = (WM_USER + 3)
NIN_BALLOONTIMEOUT = (WM_USER + 4)
NIN_BALLOONUSERCLICK = (WM_USER + 5)
NIM_ADD = 0x00... | 26.328571 | 56 | 0.584916 |
3c8e79305922ba4d99984f2180b5542a4d8596d4 | 7,049 | py | Python | xos/services/helloworldservice_complete/admin.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null | xos/services/helloworldservice_complete/admin.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null | xos/services/helloworldservice_complete/admin.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null |
from core.admin import ReadOnlyAwareAdmin, SliceInline
from core.middleware import get_request
from core.models import User
from django import forms
from django.contrib import admin
from services.helloworldservice_complete.models import HelloWorldServiceComplete, HelloWorldTenantComplete, HELLO_WORLD_KIND
# The class... | 49.640845 | 124 | 0.696553 |
9705dadaa9cc24af5adaed7c4d0f5ed92b946cab | 871 | py | Python | testpy3/testdeque.py | quchunguang/test | dd1dde14a69d9e8b2c9ed3efbf536df7840f0487 | [
"MIT"
] | 1 | 2021-05-06T02:02:59.000Z | 2021-05-06T02:02:59.000Z | testpy3/testdeque.py | SrikanthParsha14/test | 8cee69e09c8557d53d8d30382cec8ea5c1f82f6e | [
"MIT"
] | null | null | null | testpy3/testdeque.py | SrikanthParsha14/test | 8cee69e09c8557d53d8d30382cec8ea5c1f82f6e | [
"MIT"
] | 1 | 2019-06-17T13:20:39.000Z | 2019-06-17T13:20:39.000Z | # https://pymotw.com/3/collections/deque.html
# A double-ended queue, or deque, supports adding and removing elements from
# either end. The more commonly used stacks and queues are degenerate forms of
# deques, where the inputs and outputs are restricted to a single end.?
import collections
# Add to the right
d1 = co... | 22.921053 | 78 | 0.677382 |
0be61bab7df41372cb074c224262049b6d63a5e4 | 14,514 | py | Python | python/ccxt/async_support/base/exchange.py | mariuszskon/ccxt | 13253de7346e33cd384f79abf7dfb64dcbfdc35f | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | mariuszskon/ccxt | 13253de7346e33cd384f79abf7dfb64dcbfdc35f | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | mariuszskon/ccxt | 13253de7346e33cd384f79abf7dfb64dcbfdc35f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.49.40'
# -----------------------------------------------------------------------------
import asyncio
import concurrent.futures
import socket
import certifi
import aiohttp
import ssl
import sys
i... | 43.196429 | 355 | 0.617266 |
c40c946686372f0d20413f40f3f51cf51ac47f68 | 9,082 | py | Python | venv/lib/python3.8/site-packages/patsy/user_util.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 710 | 2015-01-07T20:08:59.000Z | 2022-03-08T14:30:13.000Z | venv/lib/python3.8/site-packages/patsy/user_util.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 142 | 2015-01-07T02:20:27.000Z | 2021-11-15T04:23:02.000Z | venv/lib/python3.8/site-packages/patsy/user_util.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 101 | 2015-01-15T16:35:12.000Z | 2022-02-19T06:50:02.000Z | # This file is part of Patsy
# Copyright (C) 2012 Nathaniel Smith <njs@pobox.com>
# See file LICENSE.txt for license information.
# Miscellaneous utilities that are useful to users (as compared to
# patsy.util, which is misc. utilities useful for implementing patsy).
# These are made available in the patsy.* namespac... | 36.918699 | 80 | 0.603612 |
c512deac10bfc295c1de162c17f9af52b4c4a35c | 1,097 | py | Python | thinglang/utils/collection_utils.py | ofples/thinglang | b1391e8fb42d518fc0018400eecb608d18da915a | [
"MIT"
] | 5 | 2017-11-07T21:32:22.000Z | 2019-06-30T18:35:17.000Z | thinglang/utils/collection_utils.py | ofples/thinglang | b1391e8fb42d518fc0018400eecb608d18da915a | [
"MIT"
] | null | null | null | thinglang/utils/collection_utils.py | ofples/thinglang | b1391e8fb42d518fc0018400eecb608d18da915a | [
"MIT"
] | 1 | 2020-03-25T18:14:08.000Z | 2020-03-25T18:14:08.000Z | import functools
from typing import Iterable, Type, Sequence
def drain(predicate=lambda x: True):
"""
Drains a generator function into a list, optionally filtering using predicate
"""
def wrapper(func):
@functools.wraps(func)
def inner(*args, **kwargs) -> list:
return [x f... | 23.340426 | 81 | 0.619872 |
9fa50c4dcb6672e9ab44da539a6c7c417299322e | 3,241 | py | Python | rasa/shared/constants.py | theanht1/rasa | eb408bb2d216de3a1cd1f72799d7b80eceeb1fd2 | [
"Apache-2.0"
] | 1 | 2021-06-07T07:06:34.000Z | 2021-06-07T07:06:34.000Z | rasa/shared/constants.py | theanht1/rasa | eb408bb2d216de3a1cd1f72799d7b80eceeb1fd2 | [
"Apache-2.0"
] | 50 | 2021-03-05T04:13:48.000Z | 2022-03-01T13:36:06.000Z | rasa/shared/constants.py | theanht1/rasa | eb408bb2d216de3a1cd1f72799d7b80eceeb1fd2 | [
"Apache-2.0"
] | null | null | null | DOCS_BASE_URL = "https://rasa.com/docs/rasa"
LEGACY_DOCS_BASE_URL = "https://legacy-docs-v1.rasa.com"
DOCS_URL_TRAINING_DATA = DOCS_BASE_URL + "/training-data-format"
DOCS_URL_TRAINING_DATA_NLU = DOCS_URL_TRAINING_DATA + "#nlu-training-data"
DOCS_URL_DOMAINS = DOCS_BASE_URL + "/domain"
DOCS_URL_SLOTS = DOCS_URL_DOMAINS... | 39.048193 | 78 | 0.816106 |
074888d4775cf14cfef2164a77221d375a1724d9 | 1,429 | py | Python | setup.py | idobatter/WebSocket-for-Python | f7bd95b07f5df185c32d1eb6a2d10e1e78d43637 | [
"BSD-3-Clause"
] | 1 | 2015-11-06T02:38:45.000Z | 2015-11-06T02:38:45.000Z | setup.py | idobatter/WebSocket-for-Python | f7bd95b07f5df185c32d1eb6a2d10e1e78d43637 | [
"BSD-3-Clause"
] | null | null | null | setup.py | idobatter/WebSocket-for-Python | f7bd95b07f5df185c32d1eb6a2d10e1e78d43637 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name = "ws4py",
version = '0.3.3',
description = "WebSocket library for Python",
maintainer = "Sylvain Hellegouarch",
maintainer_email = "sh@defuze.org",
... | 38.621622 | 72 | 0.585024 |
37fcc10ac594d1ad594042714424c00b8c76312e | 1,715 | py | Python | lib/adafruit_imageload/pnm/ppm_binary.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | lib/adafruit_imageload/pnm/ppm_binary.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 7 | 2021-02-19T20:00:08.000Z | 2022-01-14T10:51:12.000Z | lib/adafruit_imageload/pnm/ppm_binary.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: 2018 Scott Shawcroft for Adafruit Industries
# SPDX-FileCopyrightText: Matt Land
# SPDX-FileCopyrightText: Brooke Storm
# SPDX-FileCopyrightText: Sam McGahan
#
# SPDX-License-Identifier: MIT
"""
`adafruit_imageload.pnm.ppm_binary`
====================================================
Load pix... | 30.625 | 77 | 0.616327 |
60ee1b475e2807be0cff6d09a05dbd5f318bd0ac | 123 | py | Python | src/worker_settings.py | raphtheb/Friendly-hello-world | 172587f5d102cfdc7dd0a5317ee261a97cd6fe11 | [
"Apache-2.0"
] | null | null | null | src/worker_settings.py | raphtheb/Friendly-hello-world | 172587f5d102cfdc7dd0a5317ee261a97cd6fe11 | [
"Apache-2.0"
] | null | null | null | src/worker_settings.py | raphtheb/Friendly-hello-world | 172587f5d102cfdc7dd0a5317ee261a97cd6fe11 | [
"Apache-2.0"
] | null | null | null | # Taken from http://python-rq.org/docs/workers/
import os
REDIS_URL = os.getenv('REDIS_URL', 'redis://localhost:6379/1')
| 20.5 | 62 | 0.715447 |
4d951c551a1b7ca8a916a0e1648308af12542e18 | 4,816 | py | Python | coche.py | Seralpa/Unblock-Me-Praise-the-Helix-edition | 889c2d39b5f0d83683a9aa58af4ca135b2a69d67 | [
"MIT"
] | null | null | null | coche.py | Seralpa/Unblock-Me-Praise-the-Helix-edition | 889c2d39b5f0d83683a9aa58af4ca135b2a69d67 | [
"MIT"
] | null | null | null | coche.py | Seralpa/Unblock-Me-Praise-the-Helix-edition | 889c2d39b5f0d83683a9aa58af4ca135b2a69d67 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#Sergio Alonso
#Helio Fernandez Abad
from __future__ import print_function
import random
def iniciarPuntuaciones(puntuaciones): #Este metodo se encarga de leer, si existe, el fichero de puntuaciones y pone dichas puntuaciones en la lista.
'''PRE:si hay un fichero de puntuaciones est... | 40.813559 | 255 | 0.60652 |
00e53883111964ce63a9af22e6003f30ab91d258 | 1,699 | py | Python | kitsune/announcements/views.py | navgurukul-shivani18/kitsune | a7cf49ab1bfcf4e770938116968824b2b0fa5bb1 | [
"BSD-3-Clause"
] | 4 | 2021-05-17T11:38:08.000Z | 2021-08-19T06:42:39.000Z | kitsune/announcements/views.py | navgurukul-shivani18/kitsune | a7cf49ab1bfcf4e770938116968824b2b0fa5bb1 | [
"BSD-3-Clause"
] | 32 | 2021-04-15T22:35:58.000Z | 2022-01-04T21:30:05.000Z | kitsune/announcements/views.py | navgurukul-shivani18/kitsune | a7cf49ab1bfcf4e770938116968824b2b0fa5bb1 | [
"BSD-3-Clause"
] | 3 | 2020-06-14T06:59:46.000Z | 2020-06-15T14:45:56.000Z | import json
from django.http import HttpResponse, HttpResponseForbidden
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_POST
from kitsune.access.decorators import login_required
from kitsune.announcements.forms import AnnouncementForm
from kitsune.announcements.models i... | 30.339286 | 75 | 0.717481 |
09e9a4a5a7ff62425d4434beb8cf33ff4e5d55bb | 143 | py | Python | run_curator.py | wjimenez5271/curator | 68c2311327dc276394aa8cc4be30296da13fe23f | [
"Apache-2.0"
] | null | null | null | run_curator.py | wjimenez5271/curator | 68c2311327dc276394aa8cc4be30296da13fe23f | [
"Apache-2.0"
] | null | null | null | run_curator.py | wjimenez5271/curator | 68c2311327dc276394aa8cc4be30296da13fe23f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Wrapper for running curator from source."""
from curator.curator import main
if __name__ == '__main__':
main()
| 15.888889 | 46 | 0.692308 |
64b52632085d16466d3aac9ecfb4a00e8c7589ce | 543 | py | Python | Nimbus/apps/accounts/urls.py | cgreencode/Nimbus | edaf1fdd307551706edcbcf950769aee161641cf | [
"MIT"
] | 213 | 2015-02-19T15:07:52.000Z | 2021-01-19T21:15:26.000Z | Nimbus/apps/accounts/urls.py | cgreencode/Nimbus | edaf1fdd307551706edcbcf950769aee161641cf | [
"MIT"
] | 10 | 2015-02-27T00:07:56.000Z | 2016-07-03T01:01:43.000Z | Nimbus/apps/accounts/urls.py | cgreencode/Nimbus | edaf1fdd307551706edcbcf950769aee161641cf | [
"MIT"
] | 36 | 2015-11-04T07:08:32.000Z | 2020-08-10T07:24:42.000Z | from django.conf.urls import include, url
from django.contrib import admin
from . import views
from nimbus.apps import debug_urls
urlpatterns = debug_urls()
admin.autodiscover()
urlpatterns += [
url(r'^admin/', include(admin.site.urls)),
url(r"^$", views.index, name="index"),
url(r"^login$", views.login... | 30.166667 | 132 | 0.685083 |
123a7dcf8dc25d7fdb97a3eb50e37118dba6a2d7 | 4,875 | py | Python | Lib/site-packages/win32comext/shell/demos/explorer_browser.py | egorcompany/telegram-chat-members | 19a7c2bffe2fb832b79a4475ca324c438d5f548d | [
"MIT"
] | 3 | 2016-11-24T03:57:22.000Z | 2019-02-27T15:19:50.000Z | Lib/site-packages/win32comext/shell/demos/explorer_browser.py | egorcompany/telegram-chat-members | 19a7c2bffe2fb832b79a4475ca324c438d5f548d | [
"MIT"
] | 67 | 2016-10-19T01:23:47.000Z | 2016-12-14T04:30:38.000Z | Lib/site-packages/win32comext/shell/demos/explorer_browser.py | egorcompany/telegram-chat-members | 19a7c2bffe2fb832b79a4475ca324c438d5f548d | [
"MIT"
] | 1 | 2019-04-07T08:33:09.000Z | 2019-04-07T08:33:09.000Z | # A sample of using Vista's IExplorerBrowser interfaces...
# Currently doesn't quite work:
# * CPU sits at 100% while running.
import sys
import pythoncom
from win32com.shell import shell, shellcon
import win32gui, win32con, win32api
from win32com.server.util import wrap, unwrap
# event handler for the brow... | 41.313559 | 128 | 0.623385 |
da03a86b414b5ccc3508354a86806eb487cbfe5b | 916 | py | Python | MIDI Remote Scripts/_Generic/SpecialMixerComponent.py | aarkwright/ableton_devices | fe5df3bbd64ccbc136bba722ba1e131a02969798 | [
"MIT"
] | null | null | null | MIDI Remote Scripts/_Generic/SpecialMixerComponent.py | aarkwright/ableton_devices | fe5df3bbd64ccbc136bba722ba1e131a02969798 | [
"MIT"
] | null | null | null | MIDI Remote Scripts/_Generic/SpecialMixerComponent.py | aarkwright/ableton_devices | fe5df3bbd64ccbc136bba722ba1e131a02969798 | [
"MIT"
] | null | null | null | # uncompyle6 version 3.3.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
# Embedded file name: c:\Jenkins\live\output\win_64_static\Release\python-bundle\MIDI Remote Scripts\_Generic\SpecialMixerComponent.py
# Compiled at: 2018-11-30 15:48:11
... | 45.8 | 134 | 0.782751 |
5a485420f0e2e85000977b8f57492b7d6a239613 | 24,396 | py | Python | PhaseTwo/process_video.py | VolpeUSDOT/fra-gctd | 5452bd954d1a4e9c839b39dd6bcda1f59f320906 | [
"MIT"
] | null | null | null | PhaseTwo/process_video.py | VolpeUSDOT/fra-gctd | 5452bd954d1a4e9c839b39dd6bcda1f59f320906 | [
"MIT"
] | null | null | null | PhaseTwo/process_video.py | VolpeUSDOT/fra-gctd | 5452bd954d1a4e9c839b39dd6bcda1f59f320906 | [
"MIT"
] | null | null | null | from ctypes import resize
import warnings
import datetime
import timeit
import json
import csv
import os
import sys
## 'Unused' imports, required to make pyinstaller include them during compilation
import scipy
import av
from scipy.stats import statlib
from scipy.integrate import _odepack
from scipy.interpolate import... | 43.642218 | 346 | 0.613707 |
ba90d078866c26cf410e87e55fb549b64373e672 | 3,850 | py | Python | yt/visualization/volume_rendering/tests/test_varia.py | cevans216/yt | c19c3c615b996c8a6e418362ffea9041a616d673 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/visualization/volume_rendering/tests/test_varia.py | cevans216/yt | c19c3c615b996c8a6e418362ffea9041a616d673 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/visualization/volume_rendering/tests/test_varia.py | cevans216/yt | c19c3c615b996c8a6e418362ffea9041a616d673 | [
"BSD-3-Clause-Clear"
] | null | null | null | import os
import shutil
import tempfile
from unittest import TestCase
import numpy as np
import yt
from yt.testing import fake_random_ds
from yt.visualization.volume_rendering.render_source import VolumeSource
from yt.visualization.volume_rendering.scene import Scene
def setup():
"""Test specific setup."""
... | 26.923077 | 75 | 0.63039 |
4e92b64c34774ec9d947dd71b3996da08ff01aa1 | 54,094 | py | Python | TrainingExtensions/torch/src/python/aimet_torch/meta/connectedgraph.py | quic-akhobare/aimet | 1811a0ef58a75d103e173731b436876ee5dc4c49 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/torch/src/python/aimet_torch/meta/connectedgraph.py | quic-akhobare/aimet | 1811a0ef58a75d103e173731b436876ee5dc4c49 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/torch/src/python/aimet_torch/meta/connectedgraph.py | quic-akhobare/aimet | 1811a0ef58a75d103e173731b436876ee5dc4c49 | [
"BSD-3-Clause"
] | 1 | 2021-03-06T18:40:33.000Z | 2021-03-06T18:40:33.000Z | #!/usr/bin/env python3.5
# =============================================================================
#
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2019-2020, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted... | 51.176916 | 126 | 0.641273 |
ab9e799744b37fc1083fbd6f7312e6328a11acc1 | 5,213 | py | Python | tests/test_compaction.py | hgulino/pdf417-py | 3df2376a2bc2ee1497a0bb401b5eb735789eee85 | [
"MIT"
] | null | null | null | tests/test_compaction.py | hgulino/pdf417-py | 3df2376a2bc2ee1497a0bb401b5eb735789eee85 | [
"MIT"
] | null | null | null | tests/test_compaction.py | hgulino/pdf417-py | 3df2376a2bc2ee1497a0bb401b5eb735789eee85 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from pdf417gen.compaction import compact, compact_bytes, compact_numbers, compact_text
from pdf417gen.compaction import optimizations, _split_to_chunks, Chunk
from pdf417gen.compaction.text import compact_text_interim
from pdf417gen.encodin... | 30.30814 | 86 | 0.627278 |
d8fa2a3deaea74de61194447d16faea516e577f7 | 20,734 | py | Python | vae_gan_pure_16_20211202.py | tf2gan/vae-gan-code-for-reinforced-panel | b4d407b999551ad5fd965cd2bb18c1e5bbba3449 | [
"MIT"
] | 3 | 2022-02-27T10:49:14.000Z | 2022-02-27T10:49:33.000Z | vae_gan_pure_16_20211202.py | tf2gan/vae-gan-code-for-reinforced-panel | b4d407b999551ad5fd965cd2bb18c1e5bbba3449 | [
"MIT"
] | null | null | null | vae_gan_pure_16_20211202.py | tf2gan/vae-gan-code-for-reinforced-panel | b4d407b999551ad5fd965cd2bb18c1e5bbba3449 | [
"MIT"
] | 1 | 2022-02-27T10:49:05.000Z | 2022-02-27T10:49:05.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed May 30
@author: xtf
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from json import encoder
from tokenize import generate_tokens
from tensorflow import keras
from tensorflow.keras.layers import Dense, Input
... | 37.629764 | 175 | 0.706521 |
f33d0c2b6d85c841556779c71170f34542c7063a | 1,016 | py | Python | tests/test_gtp_wrapper.py | vftens/RocAlphaGo-aug25-keras2-py35 | 67ad5242ea7a8cdda60b9e10590f7bc9e91447c6 | [
"MIT"
] | null | null | null | tests/test_gtp_wrapper.py | vftens/RocAlphaGo-aug25-keras2-py35 | 67ad5242ea7a8cdda60b9e10590f7bc9e91447c6 | [
"MIT"
] | null | null | null | tests/test_gtp_wrapper.py | vftens/RocAlphaGo-aug25-keras2-py35 | 67ad5242ea7a8cdda60b9e10590f7bc9e91447c6 | [
"MIT"
] | null | null | null | import unittest
from AlphaGo import go
from multiprocessing import Process
from interface.gtp_wrapper import run_gtp
class PassPlayer(object):
def get_move(self, state):
return go.PASS
class mystd_simulator():
def mystdin_simulator():
return "\n".join([
"1 name",
... | 25.4 | 98 | 0.544291 |
f7c71126c899c68f438fa00e37d9acc172ca2d13 | 3,181 | py | Python | antiddosclient/osc/v1/parser_builder.py | huaweicloudsdk/osc_antiddos | f23324528ea8a2c6122340d4b4f68ea5b86977b4 | [
"Apache-2.0"
] | 3 | 2017-10-18T06:58:45.000Z | 2021-01-30T14:05:29.000Z | antiddosclient/osc/v1/parser_builder.py | huaweicloudsdk/osc_antiddos | f23324528ea8a2c6122340d4b4f68ea5b86977b4 | [
"Apache-2.0"
] | 13 | 2017-03-06T08:02:22.000Z | 2017-04-20T07:09:40.000Z | antiddosclient/osc/v1/parser_builder.py | huaweicloudsdk/osc_antiddos | f23324528ea8a2c6122340d4b4f68ea5b86977b4 | [
"Apache-2.0"
] | 2 | 2017-09-18T22:01:18.000Z | 2020-04-26T10:17:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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... | 30.295238 | 78 | 0.588494 |
32344fd1f1653646f32356cdb57c59ca9742d45f | 4,220 | py | Python | gcloud/core/views.py | SHUN-YI/bk-sops | a4a841bdc44a18518c6c53c04a02996ddc7da2be | [
"Apache-2.0"
] | 2 | 2019-08-15T10:06:26.000Z | 2019-09-17T11:49:20.000Z | gcloud/core/views.py | SHUN-YI/bk-sops | a4a841bdc44a18518c6c53c04a02996ddc7da2be | [
"Apache-2.0"
] | null | null | null | gcloud/core/views.py | SHUN-YI/bk-sops | a4a841bdc44a18518c6c53c04a02996ddc7da2be | [
"Apache-2.0"
] | 1 | 2020-07-03T06:45:07.000Z | 2020-07-03T06:45:07.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 36.695652 | 305 | 0.677962 |
75a99dda8acdd8be0d023ba9a19d59b51dbd3dbd | 7,036 | py | Python | configman/dotdict.py | peterbe/configman | 724d80b25a0ebbb2e75ad69e92a6611494cd68b4 | [
"BSD-3-Clause"
] | null | null | null | configman/dotdict.py | peterbe/configman | 724d80b25a0ebbb2e75ad69e92a6611494cd68b4 | [
"BSD-3-Clause"
] | null | null | null | configman/dotdict.py | peterbe/configman | 724d80b25a0ebbb2e75ad69e92a6611494cd68b4 | [
"BSD-3-Clause"
] | null | null | null | # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | 39.751412 | 79 | 0.656481 |
fbc65bf397464cf0034c064dc264dfc1dd6b5b6e | 2,393 | py | Python | qarpo/control_widgets.py | jdomer/qarpo | 305a0ae845cb36d609176de2e1ccedf0997a030b | [
"MIT"
] | null | null | null | qarpo/control_widgets.py | jdomer/qarpo | 305a0ae845cb36d609176de2e1ccedf0997a030b | [
"MIT"
] | null | null | null | qarpo/control_widgets.py | jdomer/qarpo | 305a0ae845cb36d609176de2e1ccedf0997a030b | [
"MIT"
] | null | null | null | from IPython.core.display import HTML
import threading
from IPython.display import display, Image
import ipywidgets as widgets
from ipywidgets import Layout
import time
import queue
import subprocess
import datetime
import matplotlib
import matplotlib.pyplot as plt
import os, pwd
import warnings
import json
import ran... | 35.191176 | 106 | 0.653991 |
595ae3e4e3b8e37a770ab1bab8486910fd5f8480 | 23,786 | py | Python | dicom2nifti/convert_philips.py | isi-research/dicom2nif | 1cc6a5b54855ba55d9dbe8d42e39c40eb5813bed | [
"MIT"
] | 1 | 2019-10-31T00:07:55.000Z | 2019-10-31T00:07:55.000Z | dicom2nifti/convert_philips.py | isi-research/dicom2nifti | 1cc6a5b54855ba55d9dbe8d42e39c40eb5813bed | [
"MIT"
] | null | null | null | dicom2nifti/convert_philips.py | isi-research/dicom2nifti | 1cc6a5b54855ba55d9dbe8d42e39c40eb5813bed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
dicom2nifti
@author: abrys
"""
from __future__ import print_function
import dicom2nifti.patch_pydicom_encodings
dicom2nifti.patch_pydicom_encodings.apply()
import os
import traceback
import logging
import nibabel
import numpy
import pydicom.config as pydicom_config
from pydicom.tag imp... | 38.551053 | 116 | 0.679391 |
cd0e85191061c2a058f97029e3153cab2bc1b771 | 22,165 | py | Python | sopel/config/types.py | r4f4/sopel | 338985667606ae7b189ab3becd05a5db39d89e87 | [
"EFL-2.0"
] | null | null | null | sopel/config/types.py | r4f4/sopel | 338985667606ae7b189ab3becd05a5db39d89e87 | [
"EFL-2.0"
] | null | null | null | sopel/config/types.py | r4f4/sopel | 338985667606ae7b189ab3becd05a5db39d89e87 | [
"EFL-2.0"
] | 1 | 2020-01-21T20:54:24.000Z | 2020-01-21T20:54:24.000Z | # coding=utf-8
"""Types for creating section definitions.
A section definition consists of a subclass of :class:`StaticSection`, on which
any number of subclasses of :class:`BaseValidated` (a few common ones of which
are available in this module) are assigned as attributes. These descriptors
define how to read values ... | 38.215517 | 95 | 0.608346 |
e2ceacc1c483dd1fcf2b74dfd1f877349c2fa11c | 3,997 | py | Python | jamf/models/country.py | jensenbox/python-jamf | 85213085b1064a00375a7aa7df5e33c19f5178eb | [
"RSA-MD"
] | 1 | 2021-04-20T15:28:57.000Z | 2021-04-20T15:28:57.000Z | jamf/models/country.py | jensenbox/python-jamf | 85213085b1064a00375a7aa7df5e33c19f5178eb | [
"RSA-MD"
] | null | null | null | jamf/models/country.py | jensenbox/python-jamf | 85213085b1064a00375a7aa7df5e33c19f5178eb | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
Jamf Pro API
## Overview This is a sample Jamf Pro server which allows for usage without any authentication. The Jamf Pro environment which supports the Try it Out functionality does not run the current beta version of Jamf Pro, thus any newly added endpoints will result in an error and sh... | 27.190476 | 342 | 0.565174 |
02cbb006f88aa8c969340b865df50b7ffd924105 | 6,784 | py | Python | resources/osm_importer/parser_objects.py | victorhu3/webots | 60d173850f0b4714c500db004e69f2df8cfb9e8a | [
"Apache-2.0"
] | 1 | 2020-11-11T09:31:28.000Z | 2020-11-11T09:31:28.000Z | resources/osm_importer/parser_objects.py | victorhu3/webots | 60d173850f0b4714c500db004e69f2df8cfb9e8a | [
"Apache-2.0"
] | 2 | 2020-05-18T12:49:14.000Z | 2020-12-01T15:13:43.000Z | resources/osm_importer/parser_objects.py | victorhu3/webots | 60d173850f0b4714c500db004e69f2df8cfb9e8a | [
"Apache-2.0"
] | 1 | 2022-02-25T12:34:18.000Z | 2022-02-25T12:34:18.000Z | #!/usr/bin/env python3
# Copyright 1996-2020 Cyberbotics Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.666667 | 123 | 0.630601 |
e724d2425d3979dfd5d8266ddd9ae71528aa003e | 17,558 | py | Python | cvat/apps/engine/task.py | elixir14/cvat | 5e2a9e35e3f94f7c542367c9337903b2cd172fbd | [
"MIT"
] | 3 | 2020-03-10T12:29:49.000Z | 2022-01-27T03:25:25.000Z | cvat/apps/engine/task.py | elixir14/cvat | 5e2a9e35e3f94f7c542367c9337903b2cd172fbd | [
"MIT"
] | 9 | 2020-04-21T06:12:32.000Z | 2020-09-18T06:48:03.000Z | cvat/apps/engine/task.py | elixir14/cvat | 5e2a9e35e3f94f7c542367c9337903b2cd172fbd | [
"MIT"
] | 1 | 2020-11-29T18:28:38.000Z | 2020-11-29T18:28:38.000Z |
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
import itertools
import os
import sys
from re import findall
import rq
import shutil
from traceback import print_exception
from urllib import error as urlerror
from urllib import parse as urlparse
from urllib import request as urlrequest
fr... | 42.513317 | 171 | 0.612769 |
3d8fab16e54a3792c25e71f484266b9536c1d968 | 17,007 | py | Python | examples/asyncio_consumer_example.py | DavidWittman/pika | 6d9896c89ee187ce1a1a5c6e55a1ee0adcc5b538 | [
"BSD-3-Clause"
] | 2,479 | 2015-01-01T20:06:23.000Z | 2022-03-31T13:29:19.000Z | examples/asyncio_consumer_example.py | DavidWittman/pika | 6d9896c89ee187ce1a1a5c6e55a1ee0adcc5b538 | [
"BSD-3-Clause"
] | 813 | 2015-01-07T07:13:49.000Z | 2022-03-28T05:05:06.000Z | examples/asyncio_consumer_example.py | DavidWittman/pika | 6d9896c89ee187ce1a1a5c6e55a1ee0adcc5b538 | [
"BSD-3-Clause"
] | 763 | 2015-01-10T04:38:33.000Z | 2022-03-31T07:24:57.000Z | # -*- coding: utf-8 -*-
# pylint: disable=C0111,C0103,R0205
import functools
import logging
import time
import pika
from pika.adapters.asyncio_connection import AsyncioConnection
from pika.exchange_type import ExchangeType
LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) '
'-35s %(... | 38.217978 | 85 | 0.668489 |
7114cb1c8e9b03a373da04da078f7df8dac1d71f | 18,207 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_policy_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_policy_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_policy_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"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 ... | 61.30303 | 162 | 0.716812 |
127913a0b4c30d5da031bb75888f9563bcb693cb | 2,868 | py | Python | src/process.py | uvipen/SSD-pytorch | a9bc7b881adbeb2302e259c61ae7f5e6fc3a699a | [
"MIT"
] | 139 | 2021-02-10T02:16:28.000Z | 2022-03-08T16:03:42.000Z | src/process.py | uvipen/SSD-pytorch | a9bc7b881adbeb2302e259c61ae7f5e6fc3a699a | [
"MIT"
] | 7 | 2021-02-12T14:47:38.000Z | 2022-01-06T06:02:21.000Z | src/process.py | uvipen/SSD-pytorch | a9bc7b881adbeb2302e259c61ae7f5e6fc3a699a | [
"MIT"
] | 42 | 2021-02-10T01:59:40.000Z | 2022-03-08T13:10:42.000Z | """
@author: Viet Nguyen <nhviet1009@gmail.com>
"""
import numpy as np
from tqdm.autonotebook import tqdm
import torch
from pycocotools.cocoeval import COCOeval
from apex import amp
def train(model, train_loader, epoch, writer, criterion, optimizer, scheduler, is_amp):
model.train()
num_iter_per_epoch = len(t... | 37.246753 | 115 | 0.581241 |
ee678451a5b9dd2c065a3870c60a715901ae0c6c | 817 | py | Python | elasticsearch/_version.py | jkbak/elasticsearch-py | 6d62ce4f1b17cc41990a4d5cb3bd76e48c36a76b | [
"Apache-2.0"
] | 1 | 2022-01-05T03:43:43.000Z | 2022-01-05T03:43:43.000Z | elasticsearch/_version.py | jkbak/elasticsearch-py | 6d62ce4f1b17cc41990a4d5cb3bd76e48c36a76b | [
"Apache-2.0"
] | null | null | null | elasticsearch/_version.py | jkbak/elasticsearch-py | 6d62ce4f1b17cc41990a4d5cb3bd76e48c36a76b | [
"Apache-2.0"
] | null | null | null | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | 43 | 64 | 0.760098 |
8d27c6cd84d7487571f1340c4859ab2b5f1f98db | 671 | py | Python | examples/run_saba.py | eltociear/NiaPy | 7884aefec8f013d9f8db5c1af7080a61dd19a31d | [
"MIT"
] | null | null | null | examples/run_saba.py | eltociear/NiaPy | 7884aefec8f013d9f8db5c1af7080a61dd19a31d | [
"MIT"
] | null | null | null | examples/run_saba.py | eltociear/NiaPy | 7884aefec8f013d9f8db5c1af7080a61dd19a31d | [
"MIT"
] | null | null | null | # encoding=utf8
# This is temporary fix to import module from parent folder
# It will be removed when package is published on PyPI
import sys
sys.path.append('../')
# End of fix
from niapy.algorithms.modified import SelfAdaptiveBatAlgorithm
from niapy.task import StoppingTask
from niapy.problems import Griewank
# we... | 30.5 | 95 | 0.751118 |
a52e38c5a21367dac212e347db5ce090751e740b | 8,818 | py | Python | devolpmentscratch/missingdata_balldrop.py | catatonicpig/ModCal | bd792e16cbb343ce330905feeb00e2e2b045653d | [
"BSD-3-Clause"
] | 2 | 2020-11-16T17:34:48.000Z | 2021-01-15T19:17:33.000Z | devolpmentscratch/missingdata_balldrop.py | catatonicpig/ModCal | bd792e16cbb343ce330905feeb00e2e2b045653d | [
"BSD-3-Clause"
] | null | null | null | devolpmentscratch/missingdata_balldrop.py | catatonicpig/ModCal | bd792e16cbb343ce330905feeb00e2e2b045653d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Header here."""
import numpy as np
import scipy.stats as sps
import sys
import os
import copy
#the following imports are sloppy until a module is actually built...
from balldroptestfuncs import balldropmodel_linear,\
balldropmodel_grav, balldroptrue
SCRIPT_DIR = os.path.dirname(os.path.r... | 40.081818 | 106 | 0.619415 |
1a15dda6b171d1268b68eead31cdd355725575ce | 435 | py | Python | links/migrations/0005_auto_20200419_1612.py | darth-dodo/hackernews-backend | 402497a47271a90402624ed2c34b46ac08638440 | [
"MIT"
] | 3 | 2020-04-20T09:15:39.000Z | 2020-05-25T18:27:44.000Z | links/migrations/0005_auto_20200419_1612.py | darth-dodo/hackernews-backend | 402497a47271a90402624ed2c34b46ac08638440 | [
"MIT"
] | null | null | null | links/migrations/0005_auto_20200419_1612.py | darth-dodo/hackernews-backend | 402497a47271a90402624ed2c34b46ac08638440 | [
"MIT"
] | 1 | 2022-01-29T06:05:15.000Z | 2022-01-29T06:05:15.000Z | # Generated by Django 2.2 on 2020-04-19 16:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("hn_users", "0001_initial"),
("links", "0004_auto_20200419_1607"),
]
operations = [
migrations.AlterModelOptions(name="vote", options={},),
... | 22.894737 | 63 | 0.611494 |
557afd9382ee83ac44af1fbcf6e592f82d3414f4 | 3,149 | py | Python | setup.py | darden-data-science/UserDataHub | e6b10a1cacc8f761fbb222596cfc957acafbb1d7 | [
"BSD-3-Clause"
] | null | null | null | setup.py | darden-data-science/UserDataHub | e6b10a1cacc8f761fbb222596cfc957acafbb1d7 | [
"BSD-3-Clause"
] | null | null | null | setup.py | darden-data-science/UserDataHub | e6b10a1cacc8f761fbb222596cfc957acafbb1d7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# ----------------------------------------------------------------------------
# This setup.py file was adapted from the setup.py file of the repository
# jupyterhub/oathenticator on 06/10/2020.
# ----------------------------------------------------------------------------
# Copy... | 33.5 | 95 | 0.563036 |
46d7ab4f4b8888b07a92e5db21339f41be716135 | 247 | py | Python | tests/test_parse.py | Faxn/rgr | 656f4795bfbb5ca6bf7f9dd6c8e043a3242cd331 | [
"BSD-2-Clause"
] | null | null | null | tests/test_parse.py | Faxn/rgr | 656f4795bfbb5ca6bf7f9dd6c8e043a3242cd331 | [
"BSD-2-Clause"
] | null | null | null | tests/test_parse.py | Faxn/rgr | 656f4795bfbb5ca6bf7f9dd6c8e043a3242cd331 | [
"BSD-2-Clause"
] | null | null | null | import unittest
import ply.lex as lex
from rgr import lexer
lex.lex(module=lexer)
from rgr.parseRoll import parser
class ParseUnit(unittest.TestCase):
pass
if __name__ == "__main__":
unittest.main() # run all tests
| 13.722222 | 35 | 0.684211 |
db4de24f3f24ccb51d46b7fccdab1c423abccfa7 | 2,282 | py | Python | mariadb_kernel/maria_magics/load.py | an3l/mariadb_kernel | ba3986e38b5cbbfc28fad9534b91d5e1132a90ac | [
"BSD-3-Clause"
] | 18 | 2020-09-17T16:41:46.000Z | 2022-02-04T14:30:15.000Z | mariadb_kernel/maria_magics/load.py | an3l/mariadb_kernel | ba3986e38b5cbbfc28fad9534b91d5e1132a90ac | [
"BSD-3-Clause"
] | 36 | 2020-10-15T11:49:29.000Z | 2022-02-27T16:44:04.000Z | mariadb_kernel/maria_magics/load.py | an3l/mariadb_kernel | ba3986e38b5cbbfc28fad9534b91d5e1132a90ac | [
"BSD-3-Clause"
] | 14 | 2020-09-08T16:26:38.000Z | 2022-03-27T20:49:03.000Z | """This class implements the %load magic command"""
help_text = """
The %load magic command has the following syntax:
> %load csv_file_path table_name [skip_row_num]
The %load magic command can load CSV file for updating specific table data.
This command does not create a table if the one specified as argument do... | 35.65625 | 104 | 0.613935 |
f32765773a2c249a4b17fa2650687afe5542473a | 338 | py | Python | medium/longest-increasing-subsequence.py | trilliwon/LeetCode | d137df53fa2489821b3c17ac22f24d9a1ae86304 | [
"MIT"
] | null | null | null | medium/longest-increasing-subsequence.py | trilliwon/LeetCode | d137df53fa2489821b3c17ac22f24d9a1ae86304 | [
"MIT"
] | null | null | null | medium/longest-increasing-subsequence.py | trilliwon/LeetCode | d137df53fa2489821b3c17ac22f24d9a1ae86304 | [
"MIT"
] | null | null | null | import bisect
class Solution:
def lengthOfLIS(self, nums: List[int]) -> int:
if len(nums) == 0:
return 0
comp = [nums[0]]
for x in nums:
if comp[-1] < x:
comp.append(x)
else:
comp[bisect.bisect_left(comp, x)] = x
... | 19.882353 | 53 | 0.461538 |
2b3917a1faefc226607b21b25bb64265e9f7ce3a | 5,377 | py | Python | fs_helpers.py | Crain-32/wwrando | 1832963c7a9339f4f004e7f4b8bee227bfd86f23 | [
"MIT"
] | 284 | 2018-07-05T15:18:18.000Z | 2022-03-28T19:59:03.000Z | fs_helpers.py | Crain-32/wwrando | 1832963c7a9339f4f004e7f4b8bee227bfd86f23 | [
"MIT"
] | 235 | 2018-07-06T18:39:36.000Z | 2022-03-29T21:09:46.000Z | fs_helpers.py | Crain-32/wwrando | 1832963c7a9339f4f004e7f4b8bee227bfd86f23 | [
"MIT"
] | 96 | 2018-07-12T02:33:40.000Z | 2022-03-22T05:08:02.000Z |
import struct
from io import BytesIO
PADDING_BYTES = b"This is padding data to alignme"
class InvalidOffsetError(Exception):
pass
def data_len(data):
data_length = data.seek(0, 2)
return data_length
def make_copy_data(data):
copy_data = read_all_bytes(data)
return BytesIO(copy_data)
def read_all_bytes(... | 27.294416 | 156 | 0.72215 |
fec8663f46e514b452b32c53098fe0b7c91d8c38 | 69,578 | py | Python | eval/eval-EV-ID11.py | dnanhkhoa/brat-standoff-preprocessing | 68c96687574316f848e8ec4a6961899a9c3f1061 | [
"MIT"
] | null | null | null | eval/eval-EV-ID11.py | dnanhkhoa/brat-standoff-preprocessing | 68c96687574316f848e8ec4a6961899a9c3f1061 | [
"MIT"
] | null | null | null | eval/eval-EV-ID11.py | dnanhkhoa/brat-standoff-preprocessing | 68c96687574316f848e8ec4a6961899a9c3f1061 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Implementation of BioNLP Shared Task evaluation.
# Copyright (c) 2010-2013 BioNLP Shared Task organizers
# This script is distributed under the open source MIT license:
# http://www.opensource.org/licenses/mit-license
import sys
import re
import os
import optparse
# allowed types for entitie... | 41.738452 | 308 | 0.62044 |
3ffb54c95a9c9f58128795cd5db6d47bd1218452 | 6,354 | py | Python | Incident-Response/Tools/cyphon/cyphon/tests/pages/element.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 1 | 2021-07-24T17:22:50.000Z | 2021-07-24T17:22:50.000Z | Incident-Response/Tools/cyphon/cyphon/tests/pages/element.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-28T03:40:31.000Z | 2022-02-28T03:40:52.000Z | Incident-Response/Tools/cyphon/cyphon/tests/pages/element.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-25T08:34:51.000Z | 2022-03-16T17:29:44.000Z | # -*- coding: utf-8 -*-
# Copyright 2017-2019 ControlScan, Inc.
#
# This file is part of Cyphon Engine.
#
# Cyphon Engine is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# Cyphon En... | 27.746725 | 80 | 0.612528 |
dfd84f8f8441bf3b86f23cfbf52ba9e9d2e48d77 | 999 | py | Python | src/genie/libs/parser/nxos/tests/ShowCdpNeighborsDetail/cli/equal/golden_output_6_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/nxos/tests/ShowCdpNeighborsDetail/cli/equal/golden_output_6_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/nxos/tests/ShowCdpNeighborsDetail/cli/equal/golden_output_6_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
"index": {
1: {
"advertisement_ver": 2,
"capabilities": "Router Switch IGMP Filtering",
"device_id": "PYATS-4451-CUBE01.yourdomain.com",
"duplex_mode": "full",
"hold_time": 129,
"interface_addresses": {"172.16.3.2": ... | 43.434783 | 291 | 0.562563 |
1e35a5ccae8771490bd034414f45deb1b8e68d3f | 581 | py | Python | LectureCode/lecture_13/test_routes.py | Waynel65/CS-501-malware-course-public | 223e38a361fb92af7dc9489f85debde34618664f | [
"MIT"
] | 2 | 2022-01-27T20:52:34.000Z | 2022-02-03T23:53:23.000Z | LectureCode/lecture_13/test_routes.py | Waynel65/CS-501-malware-course-public | 223e38a361fb92af7dc9489f85debde34618664f | [
"MIT"
] | null | null | null | LectureCode/lecture_13/test_routes.py | Waynel65/CS-501-malware-course-public | 223e38a361fb92af7dc9489f85debde34618664f | [
"MIT"
] | 8 | 2022-01-26T00:32:48.000Z | 2022-03-15T18:32:17.000Z | import requests
password = "Claws"
#config:
c2_url = "http://localhost:5000"
register_uri = "/register"
task_create = "/tasks/create"
def create_task(task_type, cmd, agent_id):
r = requests.post(c2_url + task_create, json = {
"type": task_type,
"cmd": cmd,
"agent_id": agent_id
})
... | 23.24 | 52 | 0.628227 |
72734cacae4e8afcfac91de23c381743a2ddf4d3 | 3,744 | py | Python | archive/old game engine/render/render_engine.py | Tubular-Terriers/code-jam | be706c485110ee49727ec33d07b5d8fef7cf49e1 | [
"MIT"
] | 1 | 2021-07-20T17:01:43.000Z | 2021-07-20T17:01:43.000Z | archive/old game engine/render/render_engine.py | Tubular-Terriers/code-jam | be706c485110ee49727ec33d07b5d8fef7cf49e1 | [
"MIT"
] | null | null | null | archive/old game engine/render/render_engine.py | Tubular-Terriers/code-jam | be706c485110ee49727ec33d07b5d8fef7cf49e1 | [
"MIT"
] | null | null | null | import asyncio
import curses
import sys
import pygame
import pymunk
from pymunk.vec2d import Vec2d
# FIXME: remove this import
sys.path.append("..")
# from entity_manager import EntityManager
# from engine import Game
# from map.map_manager import MapManager
# flake8: noqa
class RenderEngine:
"""
Creates i... | 26.742857 | 86 | 0.504274 |
0e3bd3dc94623e9442dcbef70fc1fef93f20ae7b | 1,149 | py | Python | apis/nb/clients/network_plug_and_play_client/models/ZtdSmartAccount.py | CiscoDevNet/APIC-EM-Generic-Scripts- | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 45 | 2016-06-09T15:41:25.000Z | 2019-08-06T17:13:11.000Z | apis/nb/clients/network_plug_and_play_client/models/ZtdSmartAccount.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 36 | 2016-06-12T03:03:56.000Z | 2017-03-13T18:20:11.000Z | apis/nb/clients/network_plug_and_play_client/models/ZtdSmartAccount.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2016-06-22T03:51:37.000Z | 2019-07-10T10:06:02.000Z | #!/usr/bin/env python
#pylint: skip-file
# This source code is licensed under the Apache license found in the
# LICENSE file in the root directory of this project.
class ZtdSmartAccount(object):
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the ... | 23.9375 | 97 | 0.507398 |
f1b11c17454a950b199afc729699ccfae2e43806 | 8,311 | py | Python | David and Pooja/++Validating Linked Mods/Python-3.0/Lib/distutils/tests/test_dist.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2015-05-21T23:47:54.000Z | 2015-05-21T23:47:54.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/distutils/tests/test_dist.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2015-10-29T20:51:31.000Z | 2015-10-29T20:51:31.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/distutils/tests/test_dist.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | """Tests for distutils.dist."""
import distutils.cmd
import distutils.dist
import os
import io
import sys
import unittest
from test.support import TESTFN
class test_dist(distutils.cmd.Command):
"""Sample distutils extension command."""
user_options = [
("sample-option=", "S", "help text"),
... | 35.365957 | 77 | 0.552521 |
ac692483bf8ae855109ef807ee4d180cd2fbf6a9 | 18,258 | py | Python | Recommender/Union/run2_p.py | RUCAIBox/TG_CRS_Code | 0428a3a069c4d0d4888f2d476dba2cafd7918524 | [
"Apache-2.0"
] | 27 | 2020-11-21T11:22:34.000Z | 2022-03-07T13:13:22.000Z | Recommender/Union/run2_p.py | RUCAIBox/TG_CRS_Code | 0428a3a069c4d0d4888f2d476dba2cafd7918524 | [
"Apache-2.0"
] | 3 | 2020-11-25T11:53:36.000Z | 2021-01-18T06:15:46.000Z | Recommender/Union/run2_p.py | RUCAIBox/TG_CRS_Code | 0428a3a069c4d0d4888f2d476dba2cafd7918524 | [
"Apache-2.0"
] | 3 | 2020-12-09T08:42:14.000Z | 2021-05-03T08:07:30.000Z | import numpy as np
from tqdm import tqdm
from math import exp
import os
import signal
import json
import argparse
from dataset_p import CRSdataset
from model import BERTModel, SASRecModel, SASBERT
import torch.nn as nn
from torch import optim
import torch
from nltk.translate.bleu_score import sentence_bleu
import nltk
... | 36.083004 | 124 | 0.57049 |
40231f44200727b0a8a773bf13d5efadf227f330 | 8,735 | py | Python | Dataset_Generator.py | evanxia1018/CSE539_Project_LLE | 881ea2278c39c16716e5de83dd8abbd267806a35 | [
"MIT"
] | 2 | 2019-11-10T02:04:52.000Z | 2020-04-19T03:51:51.000Z | Dataset_Generator.py | SarahLynnePu/CSE539_Project_LLE | 881ea2278c39c16716e5de83dd8abbd267806a35 | [
"MIT"
] | null | null | null | Dataset_Generator.py | SarahLynnePu/CSE539_Project_LLE | 881ea2278c39c16716e5de83dd8abbd267806a35 | [
"MIT"
] | 3 | 2017-12-28T14:09:24.000Z | 2020-04-19T04:25:03.000Z | #!/usr/bin/python3
import random
import math
import numpy as np
"""
Constants
"""
variance = 0.01
CHECKERBOARD_SIZE = 0.2
"""
Functions
"""
# def get_swiss_roll_dataset(numOfSamples):
# sample_list = []
# label_list = []
# for x in range(0, numOfSamples):
# # noise_test = random.random()
# ... | 39.170404 | 201 | 0.549399 |
562d02eccd932fa7fc0a4ee87e8e95bb2beffef4 | 1,839 | py | Python | python/scripts/weight_query.py | DavidNemeskey/cc_emergency_corpus | 6a6707ea6e939047014db7de8a4031ae7901351a | [
"MIT"
] | null | null | null | python/scripts/weight_query.py | DavidNemeskey/cc_emergency_corpus | 6a6707ea6e939047014db7de8a4031ae7901351a | [
"MIT"
] | null | null | null | python/scripts/weight_query.py | DavidNemeskey/cc_emergency_corpus | 6a6707ea6e939047014db7de8a4031ae7901351a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# vim: set fileencoding=utf-8 :
"""
Weights queries, based on the word weights file (created by weight_words.py).
This is the input to the search pipeline.
"""
from __future__ import absolute_import, division, print_function
from argparse import ArgumentParser
from operator import itemgetter
f... | 36.78 | 79 | 0.60087 |
20a0f383ea38e39acedee343dd6c371cbff94d04 | 746 | py | Python | app/user/views.py | steklyanov/Recipe-book | e53a7edf1c7ba3d45dda7f8f4d73e921bc654043 | [
"MIT"
] | null | null | null | app/user/views.py | steklyanov/Recipe-book | e53a7edf1c7ba3d45dda7f8f4d73e921bc654043 | [
"MIT"
] | 1 | 2019-02-13T13:28:55.000Z | 2019-02-13T13:29:27.000Z | app/user/views.py | steklyanov/Recipe-book | e53a7edf1c7ba3d45dda7f8f4d73e921bc654043 | [
"MIT"
] | null | null | null | from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from .serializers import UserSerializer, AuthTokenSerializer
class CreateUserView(generics.CreateAPIView):
serializer_class = UserSerializer... | 31.083333 | 67 | 0.824397 |
a71b94e8e1b4f84db25e417d12def03529d32bee | 28,205 | py | Python | sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/models/_models.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/models/_models.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/models/_models.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 34.735222 | 165 | 0.62691 |
1fe6482d7239f528abc493411038718b5ccdccc6 | 5,399 | py | Python | pysparkrpc/api_client.py | abronte/PysparkAPI | 894f9a550109b7d3fc10573fb1f080972ed13d8d | [
"MIT"
] | 1 | 2020-07-31T17:50:50.000Z | 2020-07-31T17:50:50.000Z | pysparkrpc/api_client.py | abronte/PysparkAPI | 894f9a550109b7d3fc10573fb1f080972ed13d8d | [
"MIT"
] | 3 | 2021-06-06T18:25:43.000Z | 2021-06-07T00:26:44.000Z | pysparkrpc/api_client.py | abronte/PysparkAPI | 894f9a550109b7d3fc10573fb1f080972ed13d8d | [
"MIT"
] | null | null | null | import types
import functools
import base64
import pickle
import time
import hashlib
import json
import httpx
import cloudpickle
import pysparkrpc
PROXY_URL = 'http://localhost:8765'
CACHING = True
def _copy_func(f):
g = types.FunctionType(f.__code__, f.__globals__, name=f.__name__,
a... | 32.721212 | 152 | 0.54047 |
43531b120f8b9adc0f2334770eacdc52dd72e2a5 | 493 | py | Python | plotly/validators/barpolar/marker/line/_colorsrc.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/barpolar/marker/line/_colorsrc.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/barpolar/marker/line/_colorsrc.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name='colorsrc',
parent_name='barpolar.marker.line',
**kwargs
):
super(ColorsrcValidator, self).__init__(
plotly_name=plotly_n... | 25.947368 | 67 | 0.606491 |
27eb52760e9d20d96737cfb1a88061545a480f46 | 2,817 | py | Python | dynadb/sequence_tools.py | GPCRmd/GPCRmd | 7dc75359ace4a00c1597bdb7a86ebee17d51f09c | [
"Apache-2.0"
] | 3 | 2019-03-06T13:35:38.000Z | 2020-08-05T15:31:29.000Z | dynadb/sequence_tools.py | GPCRmd/GPCRmd | 7dc75359ace4a00c1597bdb7a86ebee17d51f09c | [
"Apache-2.0"
] | null | null | null | dynadb/sequence_tools.py | GPCRmd/GPCRmd | 7dc75359ace4a00c1597bdb7a86ebee17d51f09c | [
"Apache-2.0"
] | null | null | null | from .customized_errors import ParsingError
import re
def check_sequence(seqstr,allow_gaps=True,allow_stop=False):
w = re.compile(r'^\s+$')
rec = re.compile(r'^[A-Z\s]+$')
seqstr2 = seqstr
if seqstr2 == "":
return False
if allow_gaps:
seqstr2 = seqstr2.replace('-','')
if allow_stop:
seqs... | 33.939759 | 99 | 0.534966 |
ddddaa2dbfb2979dce37540c3cb3760f30699f9e | 191 | py | Python | Tsnewp/Tsnewp/_pca.py | majingliang/machine_learning | cd70e3a07bd1f0803ebcffebca565e70aff96de8 | [
"MIT"
] | 1 | 2019-09-29T13:36:29.000Z | 2019-09-29T13:36:29.000Z | Tsnewp/Tsnewp/_pca.py | yummydeli/machine_learning | 54471182ac21ef0eee26557a7bd6f3a3dc3a09bd | [
"MIT"
] | null | null | null | Tsnewp/Tsnewp/_pca.py | yummydeli/machine_learning | 54471182ac21ef0eee26557a7bd6f3a3dc3a09bd | [
"MIT"
] | null | null | null | import numpy as np
def _pca(data, no_dim=50):
data = data - data.mean(axis=0)
_, m = np.linalg.eig(np.dot(data.T, data))
data = np.dot(data, m[:, :no_dim])
return data.real
| 21.222222 | 46 | 0.60733 |
50f32f24e917c92ec092635cf4b5d81ca267711e | 3,409 | py | Python | dijkstras.py | shulinye/yoga | cde4a9a12ea444f760b938e6ed1e6380e9d62c16 | [
"MIT"
] | 2 | 2015-07-02T08:50:33.000Z | 2019-11-13T20:55:40.000Z | dijkstras.py | shulinye/yoga | cde4a9a12ea444f760b938e6ed1e6380e9d62c16 | [
"MIT"
] | 19 | 2015-06-24T22:58:40.000Z | 2015-07-25T04:50:43.000Z | dijkstras.py | shulinye/yoga | cde4a9a12ea444f760b938e6ed1e6380e9d62c16 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import heapq
import time
LATEPENALTY = 40
IMBALANCE_BOUNTY = 3
LAST_MOVE_PENALTY = 10
__all_ = ['dijkstra']
def bounty(node : "Move", imbalance : list , cost : int ) -> int:
"""Awards a bounty to a node that's currently in the imbalanced list"""
if node is None: return 1000 #Not a move, j... | 39.183908 | 98 | 0.578469 |
36e8d5ffd2cd510d25977fc65f09de9b1e375169 | 1,208 | py | Python | pysimpleframe/interface/input/linux/KeyCodes.py | OriDevTeam/PySimpleFrame | 105654736a0ecc2ddb00921f1bc139faeaba2c84 | [
"BSD-3-Clause"
] | null | null | null | pysimpleframe/interface/input/linux/KeyCodes.py | OriDevTeam/PySimpleFrame | 105654736a0ecc2ddb00921f1bc139faeaba2c84 | [
"BSD-3-Clause"
] | null | null | null | pysimpleframe/interface/input/linux/KeyCodes.py | OriDevTeam/PySimpleFrame | 105654736a0ecc2ddb00921f1bc139faeaba2c84 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Name: TOFILL\n
Description: TOFILL
"""
"""PySimpleFrame
Author: Miguel Silva
License: Check LICENSE file
"""
## System imports ##
from enum import Enum, IntEnum, unique
## Library imports ##
## Application imports ##
@unique
class KeyCodes(Enum):
NON... | 18.30303 | 47 | 0.554636 |
c4bfcafbe1935fac111f0c9a05300ded2101080b | 1,418 | py | Python | Pasture_Growth_Modelling/initialisation_support/dryland_ibasal.py | Komanawa-Solutions-Ltd/SLMACC-2020-CSRA | 914b6912c5f5b522107aa9406fb3d823e61c2ebe | [
"Apache-2.0"
] | null | null | null | Pasture_Growth_Modelling/initialisation_support/dryland_ibasal.py | Komanawa-Solutions-Ltd/SLMACC-2020-CSRA | 914b6912c5f5b522107aa9406fb3d823e61c2ebe | [
"Apache-2.0"
] | null | null | null | Pasture_Growth_Modelling/initialisation_support/dryland_ibasal.py | Komanawa-Solutions-Ltd/SLMACC-2020-CSRA | 914b6912c5f5b522107aa9406fb3d823e61c2ebe | [
"Apache-2.0"
] | null | null | null | """
Author: Matt Hanson
Created: 23/11/2020 11:06 AM
"""
import ksl_env
# add basgra nz functions
ksl_env.add_basgra_nz_path()
from supporting_functions.plotting import plot_multiple_results
from check_basgra_python.support_for_tests import establish_org_input, get_lincoln_broadfield, get_woodward_weather, _clean_h... | 33.761905 | 131 | 0.722849 |
b8718a145baecb6414c121b742c47761519d15c6 | 242 | py | Python | AlphaGo/go_engine/gtp/gnugo_gnugo.py | PatWie/tensorpack-recipes | 33962bb45e81f3619bfa6a8aeae5556cc7534caf | [
"Apache-2.0"
] | 48 | 2018-06-14T18:09:22.000Z | 2022-02-08T18:29:03.000Z | AlphaGo/go_engine/gtp/gnugo_gnugo.py | AmeerAnsari/tensorflow-recipes | 33962bb45e81f3619bfa6a8aeae5556cc7534caf | [
"Apache-2.0"
] | 1 | 2018-01-23T15:10:32.000Z | 2018-01-24T16:14:26.000Z | AlphaGo/go_engine/gtp/gnugo_gnugo.py | AmeerAnsari/tensorflow-recipes | 33962bb45e81f3619bfa6a8aeae5556cc7534caf | [
"Apache-2.0"
] | 10 | 2018-06-21T10:18:56.000Z | 2020-05-07T04:03:47.000Z | from gtp_engine_gnugo import GnuGoEngine
from gtp_match import Match
a = GnuGoEngine('gnugoA')
b = GnuGoEngine('gnugoB')
p = Match(a, b)
while p.finished is not True:
p.ply('W')
p.ply('B')
a.show_board()
a.score()
b.score()
| 13.444444 | 40 | 0.665289 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.