hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c436b649a82cf4960e00d0baa54f3341444e559 | 2,087 | py | Python | malib/trainers/utils.py | wwxFromTju/malib | 7cd2a4af55cf1f56da8854e26ea7a4f3782ceea2 | [
"MIT"
] | 6 | 2021-05-19T10:25:36.000Z | 2021-12-27T03:30:33.000Z | malib/trainers/utils.py | wwxFromTju/malib | 7cd2a4af55cf1f56da8854e26ea7a4f3782ceea2 | [
"MIT"
] | 1 | 2021-05-29T04:51:37.000Z | 2021-05-30T06:18:10.000Z | malib/trainers/utils.py | ying-wen/malib_deprecated | 875338b81c4d87064ad31201f461ef742db05f25 | [
"MIT"
] | 1 | 2021-05-31T16:16:12.000Z | 2021-05-31T16:16:12.000Z | # Created by yingwen at 2019-06-30
from copy import deepcopy
import numpy as np
import tensorflow as tf
def add_target_actions(batch_n, agents, batch_size, multiagent=True):
target_actions_n = []
for i, agent in enumerate(agents):
target_actions_n.append(
agent.act(batch_n[i]["next_observa... | 33.66129 | 79 | 0.668903 |
from copy import deepcopy
import numpy as np
import tensorflow as tf
def add_target_actions(batch_n, agents, batch_size, multiagent=True):
target_actions_n = []
for i, agent in enumerate(agents):
target_actions_n.append(
agent.act(batch_n[i]["next_observations"], use_target=True)
... | true | true |
1c436c37a9e54c42d49e6960d46a6ddee487ea78 | 414 | py | Python | day2/test_program_alarm.py | marinmuso/adventofcode | 41320aef44b4ade2f36392e5ed77363dbd5c6e79 | [
"Apache-2.0"
] | null | null | null | day2/test_program_alarm.py | marinmuso/adventofcode | 41320aef44b4ade2f36392e5ed77363dbd5c6e79 | [
"Apache-2.0"
] | null | null | null | day2/test_program_alarm.py | marinmuso/adventofcode | 41320aef44b4ade2f36392e5ed77363dbd5c6e79 | [
"Apache-2.0"
] | null | null | null | import pytest
from program_alarm import process_opcodes
@pytest.mark.parametrize("test_input, expected", [
([1, 0, 0, 0, 99], [2, 0, 0, 0, 99]),
([2, 3, 0, 3, 99], [2, 3, 0, 6, 99]),
([2, 4, 4, 5, 99, 0], [2, 4, 4, 5, 99, 9801]),
([1, 1, 1, 4, 99, 5, 6, 0, 99], [30, 1, 1, 4, 2, 5, 6, 0, 99])
])
def t... | 29.571429 | 66 | 0.560386 | import pytest
from program_alarm import process_opcodes
@pytest.mark.parametrize("test_input, expected", [
([1, 0, 0, 0, 99], [2, 0, 0, 0, 99]),
([2, 3, 0, 3, 99], [2, 3, 0, 6, 99]),
([2, 4, 4, 5, 99, 0], [2, 4, 4, 5, 99, 9801]),
([1, 1, 1, 4, 99, 5, 6, 0, 99], [30, 1, 1, 4, 2, 5, 6, 0, 99])
])
def t... | true | true |
1c436cbbda96f2d2fcc0119360c4a52d77484b57 | 1,436 | py | Python | models/fix_sclstm16.py | latte488/smth-smth-v2 | 8504d10a994458769707108cbbe62adde81ca5aa | [
"Apache-2.0",
"MIT"
] | 2 | 2021-08-17T14:16:54.000Z | 2021-11-06T06:06:28.000Z | models/fix_sclstm16.py | latte488/smth-smth-v2 | 8504d10a994458769707108cbbe62adde81ca5aa | [
"Apache-2.0",
"MIT"
] | null | null | null | models/fix_sclstm16.py | latte488/smth-smth-v2 | 8504d10a994458769707108cbbe62adde81ca5aa | [
"Apache-2.0",
"MIT"
] | 1 | 2021-11-07T12:27:24.000Z | 2021-11-07T12:27:24.000Z | import torch
from torch import nn
import selected_dropout
rnn_units = 16
class Model(nn.Module):
def __init__(self, column_units):
super(Model, self).__init__()
self.cnn = nn.Sequential(
nn.Conv2d(3, 16, kernel_size=3, stride=1, padding=1),
nn.BatchNorm2d(16),
n... | 29.306122 | 74 | 0.510446 | import torch
from torch import nn
import selected_dropout
rnn_units = 16
class Model(nn.Module):
def __init__(self, column_units):
super(Model, self).__init__()
self.cnn = nn.Sequential(
nn.Conv2d(3, 16, kernel_size=3, stride=1, padding=1),
nn.BatchNorm2d(16),
n... | true | true |
1c436cfd7b87bf108a646221ae9e344c7add96a8 | 80 | py | Python | tiletanic/__init__.py | umeier/tiletanic | 461958452a793e781607deddf9828f8e2f55d248 | [
"MIT"
] | 19 | 2015-11-09T16:10:20.000Z | 2020-11-27T21:28:35.000Z | tiletanic/__init__.py | umeier/tiletanic | 461958452a793e781607deddf9828f8e2f55d248 | [
"MIT"
] | 4 | 2015-11-06T19:30:08.000Z | 2020-03-28T19:10:25.000Z | tiletanic/__init__.py | umeier/tiletanic | 461958452a793e781607deddf9828f8e2f55d248 | [
"MIT"
] | 9 | 2015-12-22T19:51:28.000Z | 2021-01-27T22:52:32.000Z | from .base import Tile, Coords, CoordsBbox
from . import tileschemes, tilecover
| 26.666667 | 42 | 0.8 | from .base import Tile, Coords, CoordsBbox
from . import tileschemes, tilecover
| true | true |
1c436dd9bb8061c46ffe29a26b483f322f9063aa | 98 | py | Python | chat/apps.py | Kevin1289/Clique.io_site | 01e1d5505b293419da75aedb40bdefb9086696a6 | [
"MIT"
] | 1 | 2020-09-01T05:15:33.000Z | 2020-09-01T05:15:33.000Z | chat/apps.py | Kevin1289/Clique.io_site | 01e1d5505b293419da75aedb40bdefb9086696a6 | [
"MIT"
] | null | null | null | chat/apps.py | Kevin1289/Clique.io_site | 01e1d5505b293419da75aedb40bdefb9086696a6 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ChatConfig(AppConfig):
name = 'django_private_chat'
| 16.333333 | 33 | 0.77551 | from django.apps import AppConfig
class ChatConfig(AppConfig):
name = 'django_private_chat'
| true | true |
1c436e9788ed48c1ecb285aa39a09207734ffac6 | 1,068 | py | Python | 992. Subarrays with K Different Integers/solution4.py | sunshot/LeetCode | 8f6503201831055f1d49ed3abb25be44a13ec317 | [
"MIT"
] | null | null | null | 992. Subarrays with K Different Integers/solution4.py | sunshot/LeetCode | 8f6503201831055f1d49ed3abb25be44a13ec317 | [
"MIT"
] | null | null | null | 992. Subarrays with K Different Integers/solution4.py | sunshot/LeetCode | 8f6503201831055f1d49ed3abb25be44a13ec317 | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def subarraysWithKDistinct(self, A: List[int], K: int) -> int:
ans = 0
d_cnt = {}
start = 0
start_k = 0
# start is the starting of the window
# start_k is the starting point of k distinct integers
# in the windo... | 29.666667 | 66 | 0.48221 | from typing import List
class Solution:
def subarraysWithKDistinct(self, A: List[int], K: int) -> int:
ans = 0
d_cnt = {}
start = 0
start_k = 0
for x in A:
d_cnt[x] = d_cnt.get(x, 0) + 1
... | true | true |
1c436ef56a0d3571f86e1fca49e76adc1d362e2d | 4,610 | py | Python | benchmark/startQiskit_QC3054.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC3054.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC3054.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=46
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... | 36.015625 | 165 | 0.657918 |
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np... | true | true |
1c436f5695176a99b1087e41e25bf532fa3c7feb | 18,608 | py | Python | tensornets/contrib_layers/optimizers.py | mehrdad-shokri/tensornets | e36eff73e5fc984977c5ceadefc1adb089e7bab5 | [
"MIT"
] | 1,057 | 2017-10-13T08:30:16.000Z | 2022-03-13T19:20:22.000Z | tensornets/contrib_layers/optimizers.py | mehrdad-shokri/tensornets | e36eff73e5fc984977c5ceadefc1adb089e7bab5 | [
"MIT"
] | 62 | 2017-11-13T00:10:56.000Z | 2021-11-04T09:22:43.000Z | tensornets/contrib_layers/optimizers.py | mehrdad-shokri/tensornets | e36eff73e5fc984977c5ceadefc1adb089e7bab5 | [
"MIT"
] | 210 | 2017-11-02T08:41:49.000Z | 2022-03-13T19:20:25.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.195011 | 124 | 0.680729 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from .. import contrib_framework
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow... | true | true |
1c436f90b8d2bf1ddeb5aaa0ae0d9ea423af407f | 2,692 | py | Python | sarpy/io/product/converter.py | jordan-heemskerk/sarpy | 9684c3e58a8e0d0db0cb9b16a5adb79fe9852a0a | [
"MIT"
] | null | null | null | sarpy/io/product/converter.py | jordan-heemskerk/sarpy | 9684c3e58a8e0d0db0cb9b16a5adb79fe9852a0a | [
"MIT"
] | null | null | null | sarpy/io/product/converter.py | jordan-heemskerk/sarpy | 9684c3e58a8e0d0db0cb9b16a5adb79fe9852a0a | [
"MIT"
] | null | null | null | """
This module provide utilities for opening any files analogous to Sensor
Independent Derived Data, namely detected images in the ground plane.
"""
import os
import sys
import pkgutil
from importlib import import_module
from sarpy.io.general.base import BaseReader
__classification__ = "UNCLASSIFIED"
__author__ = ... | 24.252252 | 85 | 0.641902 |
import os
import sys
import pkgutil
from importlib import import_module
from sarpy.io.general.base import BaseReader
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
opener(open_func):
if not callable(open_func):
raise TypeError('open_func must be a callable')
if open_func not... | true | true |
1c436faf2475e151b87920566c243934785ebf80 | 1,664 | py | Python | buff/trinket/spider.py | dannl/hunter-sim-classic | e32cccc8431cc3e78b08067dd58e10fec52aac6a | [
"MIT"
] | null | null | null | buff/trinket/spider.py | dannl/hunter-sim-classic | e32cccc8431cc3e78b08067dd58e10fec52aac6a | [
"MIT"
] | null | null | null | buff/trinket/spider.py | dannl/hunter-sim-classic | e32cccc8431cc3e78b08067dd58e10fec52aac6a | [
"MIT"
] | null | null | null | from buff import LastingBuff
class Spider(LastingBuff):
def __init__(self):
super().__init__('spider', 2 * 60, 15)
def equip(self, engine, char_state):
char_state.crit += 0.01
def dequip(self, engine, char_state):
char_state.crit -= 0.01
def timeout(self, rotation, engine, ... | 37.818182 | 108 | 0.616587 | from buff import LastingBuff
class Spider(LastingBuff):
def __init__(self):
super().__init__('spider', 2 * 60, 15)
def equip(self, engine, char_state):
char_state.crit += 0.01
def dequip(self, engine, char_state):
char_state.crit -= 0.01
def timeout(self, rotation, engine, ... | true | true |
1c437097aa7324512cba0b35f6327c391f210265 | 9,375 | py | Python | src/plotmanx/reporting.py | tokenchain/plotman | 666e4e34eecda90aa94004ff042fefebfbf3fead | [
"Apache-2.0"
] | null | null | null | src/plotmanx/reporting.py | tokenchain/plotman | 666e4e34eecda90aa94004ff042fefebfbf3fead | [
"Apache-2.0"
] | null | null | null | src/plotmanx/reporting.py | tokenchain/plotman | 666e4e34eecda90aa94004ff042fefebfbf3fead | [
"Apache-2.0"
] | null | null | null | import math
import os
import psutil
import texttable as tt # from somewhere?
from . import archive, job, manager, plot_util, configuration
def abbr_path(path, putative_prefix):
if putative_prefix and path.startswith(putative_prefix):
return os.path.relpath(path, putative_prefix)
else:
retur... | 35.11236 | 134 | 0.58464 | import math
import os
import psutil
import texttable as tt
from . import archive, job, manager, plot_util, configuration
def abbr_path(path, putative_prefix):
if putative_prefix and path.startswith(putative_prefix):
return os.path.relpath(path, putative_prefix)
else:
return path
def phas... | true | true |
1c4371ed067b7cc5d0e0120d86bfb0013fc0a9a5 | 2,906 | py | Python | netbox/virtualization/api/views.py | mrevilme/netbox | 51f6d2f45e1bb9d53da6a7f7733673a458c50060 | [
"Apache-2.0"
] | 1 | 2021-05-04T12:53:09.000Z | 2021-05-04T12:53:09.000Z | netbox/virtualization/api/views.py | emersonfelipesp/netbox | fecca5ad83fb6b48a2f15982dfd3242653f105f9 | [
"Apache-2.0"
] | null | null | null | netbox/virtualization/api/views.py | emersonfelipesp/netbox | fecca5ad83fb6b48a2f15982dfd3242653f105f9 | [
"Apache-2.0"
] | null | null | null | from rest_framework.routers import APIRootView
from dcim.models import Device
from extras.api.views import ConfigContextQuerySetMixin, CustomFieldModelViewSet, ModelViewSet
from utilities.utils import count_related
from virtualization import filters
from virtualization.models import Cluster, ClusterGroup, ClusterType,... | 33.022727 | 110 | 0.753269 | from rest_framework.routers import APIRootView
from dcim.models import Device
from extras.api.views import ConfigContextQuerySetMixin, CustomFieldModelViewSet, ModelViewSet
from utilities.utils import count_related
from virtualization import filters
from virtualization.models import Cluster, ClusterGroup, ClusterType,... | true | true |
1c43729c8f65039b3f467f122673f02a5cc4cbc1 | 11,256 | py | Python | saleor/payment/gateways/np_atobarai/tests/test_api_helpers.py | victor-abz/saleor | f8e2b49703d995d4304d5a690dbe9c83631419d0 | [
"CC-BY-4.0"
] | 1,392 | 2021-10-06T15:54:28.000Z | 2022-03-31T20:50:55.000Z | saleor/payment/gateways/np_atobarai/tests/test_api_helpers.py | victor-abz/saleor | f8e2b49703d995d4304d5a690dbe9c83631419d0 | [
"CC-BY-4.0"
] | 888 | 2021-10-06T10:48:54.000Z | 2022-03-31T11:00:30.000Z | saleor/payment/gateways/np_atobarai/tests/test_api_helpers.py | victor-abz/saleor | f8e2b49703d995d4304d5a690dbe9c83631419d0 | [
"CC-BY-4.0"
] | 538 | 2021-10-07T16:21:27.000Z | 2022-03-31T22:58:57.000Z | from dataclasses import fields
from decimal import Decimal
from unittest.mock import DEFAULT, Mock, patch, sentinel
import pytest
from posuto import Posuto
from .....order.fetch import OrderLineInfo
from ....interface import AddressData, RefundData
from ....utils import price_to_minor_unit
from .. import api_helpers,... | 28.714286 | 88 | 0.676173 | from dataclasses import fields
from decimal import Decimal
from unittest.mock import DEFAULT, Mock, patch, sentinel
import pytest
from posuto import Posuto
from .....order.fetch import OrderLineInfo
from ....interface import AddressData, RefundData
from ....utils import price_to_minor_unit
from .. import api_helpers,... | true | true |
1c43741fca9fb5451f7dc34b89f19edff48f1a2f | 3,072 | py | Python | kfold.py | bhadreshpsavani/TAPER-EHR | ab938749756fcaaef52a7002a074421f483e3562 | [
"MIT"
] | 12 | 2020-04-10T02:24:20.000Z | 2021-11-09T22:52:24.000Z | kfold.py | bhadreshpsavani/TAPER-EHR | ab938749756fcaaef52a7002a074421f483e3562 | [
"MIT"
] | 7 | 2020-05-03T10:03:29.000Z | 2022-02-09T23:38:21.000Z | kfold.py | bhadreshpsavani/TAPER-EHR | ab938749756fcaaef52a7002a074421f483e3562 | [
"MIT"
] | 10 | 2020-06-14T09:37:35.000Z | 2022-02-04T22:21:16.000Z |
import numpy as np
import pandas as pd
import os
import pickle
import argparse
from sklearn.model_selection import KFold
from utils.data_utils import *
from collections import defaultdict
def filt_code(data, code_type, min_=5):
""" Filter code sets based on frequency count
Args:
min_: (int) minimum nu... | 36.571429 | 108 | 0.62207 |
import numpy as np
import pandas as pd
import os
import pickle
import argparse
from sklearn.model_selection import KFold
from utils.data_utils import *
from collections import defaultdict
def filt_code(data, code_type, min_=5):
codes = defaultdict(lambda : 0)
for k, v in data.items():
for vv in v:
... | true | true |
1c437445200f13523ac4b91a040d4bb026052069 | 134,889 | py | Python | h2o-py/h2o/frame.py | DEVESHTARASIA/h2o-3 | 9bd73fcedb4236b7ea8f214b36ca95f3e00d4548 | [
"Apache-2.0"
] | null | null | null | h2o-py/h2o/frame.py | DEVESHTARASIA/h2o-3 | 9bd73fcedb4236b7ea8f214b36ca95f3e00d4548 | [
"Apache-2.0"
] | null | null | null | h2o-py/h2o/frame.py | DEVESHTARASIA/h2o-3 | 9bd73fcedb4236b7ea8f214b36ca95f3e00d4548 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
H2O data frame.
:copyright: (c) 2016 H2O.ai
:license: Apache License Version 2.0 (see LICENSE for details)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import csv
import datetime
import functools
import os
import sys
import tempfile
import trac... | 43.095527 | 135 | 0.609086 |
from __future__ import absolute_import, division, print_function, unicode_literals
import csv
import datetime
import functools
import os
import sys
import tempfile
import traceback
import warnings
from io import StringIO
from types import FunctionType
import requests
import h2o
from h2o.display import H2ODisplay
fr... | true | true |
1c4375d0124e02a4e91d5f16efeedc52c37bb057 | 17,765 | py | Python | sdk/python/pulumi_azure_native/sql/v20190601preview/workload_group.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/sql/v20190601preview/workload_group.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/sql/v20190601preview/workload_group.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 47.373333 | 663 | 0.677174 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = ['WorkloadGroupArgs', 'WorkloadGroup']
@pulumi.input_type
class WorkloadGroupArgs:
def __init__(__self__, *,
database_name: pulumi.Inpu... | true | true |
1c4376331213d71be83752613cbfb6ce878134b3 | 143 | py | Python | problems/0025/compute.py | Dynortice/Project-Euler | 99a0201b5d5f147eab77fc52d9db8995045cded0 | [
"MIT"
] | null | null | null | problems/0025/compute.py | Dynortice/Project-Euler | 99a0201b5d5f147eab77fc52d9db8995045cded0 | [
"MIT"
] | null | null | null | problems/0025/compute.py | Dynortice/Project-Euler | 99a0201b5d5f147eab77fc52d9db8995045cded0 | [
"MIT"
] | null | null | null | from math import ceil, log, sqrt
def compute(n: int) -> int:
return int(ceil((log(10) * (n - 1) + log(5) / 2) / log((1 + sqrt(5)) / 2)))
| 23.833333 | 79 | 0.538462 | from math import ceil, log, sqrt
def compute(n: int) -> int:
return int(ceil((log(10) * (n - 1) + log(5) / 2) / log((1 + sqrt(5)) / 2)))
| true | true |
1c43775eddde1322d48ee5b6171359f9460a3375 | 325 | py | Python | dagology/tests/test_metrics.py | JamesClough/dagology | 5421fd0ad439e70a61d0408eb1cacebaa403f671 | [
"MIT"
] | 5 | 2017-02-16T21:35:28.000Z | 2020-08-09T07:33:30.000Z | dagology/tests/test_metrics.py | JamesClough/dagology | 5421fd0ad439e70a61d0408eb1cacebaa403f671 | [
"MIT"
] | null | null | null | dagology/tests/test_metrics.py | JamesClough/dagology | 5421fd0ad439e70a61d0408eb1cacebaa403f671 | [
"MIT"
] | 3 | 2018-04-20T08:58:24.000Z | 2020-04-11T02:25:56.000Z | from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_in
from nose.tools import assert_raises
from nose.tools import assert_true
import networkx as nx
import numpy as np
import dagology as dag
class TestEucludea(object):
""" Unit tests for interval function"""
... | 21.666667 | 43 | 0.796923 | from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_in
from nose.tools import assert_raises
from nose.tools import assert_true
import networkx as nx
import numpy as np
import dagology as dag
class TestEucludea(object):
pass
| true | true |
1c4377c3dc57f9c21495e90e367e31c935a9a01f | 1,824 | py | Python | code/hd_Preprocessing.py | snehil1703/Home-Depot-Search-Relevance-Data-Analysis | d036734f48ac35e608b792a3c68b97c97d51357f | [
"Apache-2.0"
] | null | null | null | code/hd_Preprocessing.py | snehil1703/Home-Depot-Search-Relevance-Data-Analysis | d036734f48ac35e608b792a3c68b97c97d51357f | [
"Apache-2.0"
] | null | null | null | code/hd_Preprocessing.py | snehil1703/Home-Depot-Search-Relevance-Data-Analysis | d036734f48ac35e608b792a3c68b97c97d51357f | [
"Apache-2.0"
] | null | null | null | # Importing required packages
import pandas
import numpy
#Importing required files
import hd_DataAnalysis as sd
import hd_Preprocessing as prep
# Extracting the features of the three main attributes
def feature_extraction(main_data):
main_data['search_term'] = main_data['search_term'].map(lambda x: sd.preprocess_w... | 46.769231 | 142 | 0.750548 |
import pandas
import numpy
import hd_DataAnalysis as sd
import hd_Preprocessing as prep
def feature_extraction(main_data):
main_data['search_term'] = main_data['search_term'].map(lambda x: sd.preprocess_word(x))
main_data['product_title'] = main_data['product_title'].map(lambda x: sd.preprocess_word(x))
main_d... | true | true |
1c437841a3b01daa9a2600a43c0462b0bfe4c09c | 10,803 | py | Python | qiskit/extensions/standard/equivalence_library.py | diego-plan9/qiskit-terra | a4120d70bd631ad2add228fdb1f86706bc5f2339 | [
"Apache-2.0"
] | 1 | 2018-05-29T03:58:03.000Z | 2018-05-29T03:58:03.000Z | qiskit/extensions/standard/equivalence_library.py | diego-plan9/qiskit-terra | a4120d70bd631ad2add228fdb1f86706bc5f2339 | [
"Apache-2.0"
] | 3 | 2018-11-13T17:33:37.000Z | 2018-12-03T09:35:00.000Z | qiskit/extensions/standard/equivalence_library.py | diego-plan9/qiskit-terra | a4120d70bd631ad2add228fdb1f86706bc5f2339 | [
"Apache-2.0"
] | 2 | 2017-12-03T15:48:14.000Z | 2018-03-11T13:08:03.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 24.496599 | 89 | 0.544386 |
from qiskit.qasm import pi
from qiskit.circuit import EquivalenceLibrary, Parameter, QuantumCircuit, QuantumRegister
from . import (
HGate,
CHGate,
MSGate,
RGate,
RCCXGate,
RCCCXGate,
RXGate,
CRXGate,
RXXGate,
RYGate,
CRYGate,
RZGate,
CRZGate,
R... | true | true |
1c43796bccaf30510d15fc9c0745a62bf63bf637 | 248 | py | Python | src/tfi/doc/example_code.py | ajbouh/tfi | 6e89e8c8f1ca3b285c788cc6b802fc44f9001290 | [
"MIT"
] | 160 | 2017-09-13T00:32:05.000Z | 2018-05-21T18:17:32.000Z | src/tfi/doc/example_code.py | tesserai/tfi | 6e89e8c8f1ca3b285c788cc6b802fc44f9001290 | [
"MIT"
] | 6 | 2017-09-14T17:54:21.000Z | 2018-01-27T19:31:18.000Z | src/tfi/doc/example_code.py | ajbouh/tfi | 6e89e8c8f1ca3b285c788cc6b802fc44f9001290 | [
"MIT"
] | 11 | 2017-09-13T00:37:08.000Z | 2018-03-05T08:03:34.000Z | class ExampleCode(object):
def __init__(self, name, label, lines):
self.name = name
self.label = label
self.lines = lines
class ExampleCodeSet(object):
def __init__(self, examples):
self.examples = examples
| 24.8 | 43 | 0.641129 | class ExampleCode(object):
def __init__(self, name, label, lines):
self.name = name
self.label = label
self.lines = lines
class ExampleCodeSet(object):
def __init__(self, examples):
self.examples = examples
| true | true |
1c43798e4f90c184b28ff96bd2cdb011086d62f3 | 8,511 | py | Python | packages/python/plotly/plotly/graph_objs/scattergeo/marker/colorbar/_tickfont.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/scattergeo/marker/colorbar/_tickfont.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/scattergeo/marker/colorbar/_tickfont.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattergeo.marker.colorbar"
_path_str = "scattergeo.marker.colorbar.tickfont"
_valid_props... | 37.328947 | 82 | 0.568793 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickfont(_BaseTraceHierarchyType):
_parent_path_str = "scattergeo.marker.colorbar"
_path_str = "scattergeo.marker.colorbar.tickfont"
_valid_props = {"color", "family", "size"}
... | true | true |
1c4379b36a66a2a9b70d4fc271af6a45e07df62d | 519 | py | Python | verification/config.py | vinthedark/snet-marketplace-service | 66ed9d093b00f09d3e28ef4d86c4e4c125037d06 | [
"MIT"
] | null | null | null | verification/config.py | vinthedark/snet-marketplace-service | 66ed9d093b00f09d3e28ef4d86c4e4c125037d06 | [
"MIT"
] | null | null | null | verification/config.py | vinthedark/snet-marketplace-service | 66ed9d093b00f09d3e28ef4d86c4e4c125037d06 | [
"MIT"
] | null | null | null | NETWORK_ID = 0
NETWORKS = {
0: {
"name": "test",
"http_provider": "https://ropsten.infura.io",
"ws_provider": "wss://ropsten.infura.io/ws",
"db": {
"DB_HOST": "localhost",
"DB_USER": "unittest_root",
"DB_PASSWORD": "unittest_pwd",
"DB_N... | 20.76 | 53 | 0.527938 | NETWORK_ID = 0
NETWORKS = {
0: {
"name": "test",
"http_provider": "https://ropsten.infura.io",
"ws_provider": "wss://ropsten.infura.io/ws",
"db": {
"DB_HOST": "localhost",
"DB_USER": "unittest_root",
"DB_PASSWORD": "unittest_pwd",
"DB_N... | true | true |
1c437a608b0328b405a63a31a1f68dc38ea065f4 | 1,462 | py | Python | HW5/181041025/code/Question1.py | perihanmirkelam/CSE505_Algorithms | 07f58c27e7869697c5fdadc6fa2fffbdd8f18c69 | [
"Apache-2.0"
] | null | null | null | HW5/181041025/code/Question1.py | perihanmirkelam/CSE505_Algorithms | 07f58c27e7869697c5fdadc6fa2fffbdd8f18c69 | [
"Apache-2.0"
] | null | null | null | HW5/181041025/code/Question1.py | perihanmirkelam/CSE505_Algorithms | 07f58c27e7869697c5fdadc6fa2fffbdd8f18c69 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[29]:
def mergeSort(jobs):
if len(jobs)>1:
mid = len(jobs)//2
lefthalf = jobs[:mid]
righthalf = jobs[mid:]
mergeSort(lefthalf)
mergeSort(righthalf)
i=0
j=0
k=0
while i < len(lefthalf) and j < len(r... | 20.885714 | 116 | 0.509576 |
def mergeSort(jobs):
if len(jobs)>1:
mid = len(jobs)//2
lefthalf = jobs[:mid]
righthalf = jobs[mid:]
mergeSort(lefthalf)
mergeSort(righthalf)
i=0
j=0
k=0
while i < len(lefthalf) and j < len(righthalf):
if lefthalf[i][weight]... | true | true |
1c437ba6984eef38fe6b7adf59af9db10fb5a08d | 1,643 | py | Python | testprograms/MainLarge.py | jchmrt/ev3dev2simulator | 3a8968162d1658a82860a613caf9986c5428b124 | [
"MIT"
] | 2 | 2020-07-14T01:31:14.000Z | 2021-02-22T19:14:12.000Z | testprograms/MainLarge.py | jchmrt/ev3dev2simulator | 3a8968162d1658a82860a613caf9986c5428b124 | [
"MIT"
] | 19 | 2020-02-16T08:11:23.000Z | 2020-12-10T10:06:36.000Z | testprograms/MainLarge.py | jchmrt/ev3dev2simulator | 3a8968162d1658a82860a613caf9986c5428b124 | [
"MIT"
] | 10 | 2020-03-02T08:37:29.000Z | 2022-03-06T03:49:07.000Z | #!/usr/bin/env python3
from time import sleep
from ev3dev2._platform.ev3 import INPUT_1, INPUT_4, INPUT_2, OUTPUT_B
from ev3dev2.led import Leds
from ev3dev2.motor import MoveTank, OUTPUT_A, OUTPUT_D, SpeedPercent, MoveDifferential, MediumMotor
from ev3dev2.sensor.lego import ColorSensor
from ev3dev2.sensor.lego impor... | 23.140845 | 99 | 0.734632 |
from time import sleep
from ev3dev2._platform.ev3 import INPUT_1, INPUT_4, INPUT_2, OUTPUT_B
from ev3dev2.led import Leds
from ev3dev2.motor import MoveTank, OUTPUT_A, OUTPUT_D, SpeedPercent, MoveDifferential, MediumMotor
from ev3dev2.sensor.lego import ColorSensor
from ev3dev2.sensor.lego import TouchSensor
from ev3... | true | true |
1c437be4b3a4e05e897a8c92ea9e144eef263140 | 3,122 | py | Python | NiaPy/benchmarks/happyCat.py | lucijabrezocnik/NiaPy | 1582d1af835c022c77224ea0234178a399efc106 | [
"MIT"
] | null | null | null | NiaPy/benchmarks/happyCat.py | lucijabrezocnik/NiaPy | 1582d1af835c022c77224ea0234178a399efc106 | [
"MIT"
] | null | null | null | NiaPy/benchmarks/happyCat.py | lucijabrezocnik/NiaPy | 1582d1af835c022c77224ea0234178a399efc106 | [
"MIT"
] | 1 | 2018-06-13T08:10:23.000Z | 2018-06-13T08:10:23.000Z | # encoding=utf8
"""Impementation of Happy Cat funtion."""
import math
from NiaPy.benchmarks.benchmark import Benchmark
__all__ = ['HappyCat']
class HappyCat(Benchmark):
r"""Implementation of Happy cat function.
Date: 2018
Author: Lucija Brezočnik
License: MIT
Function: **Happy cat function*... | 31.22 | 143 | 0.516976 |
import math
from NiaPy.benchmarks.benchmark import Benchmark
__all__ = ['HappyCat']
class HappyCat(Benchmark):
Name = ['HappyCat']
def __init__(self, Lower=-100.0, Upper=100.0):
Benchmark.__init__(self, Lower, Upper)
@staticmethod
def latex_code():
return r'''$f(\mathbf{x}) = {\l... | true | true |
1c437de91b99c2c41a0ee03cc7cec5424707557b | 2,308 | py | Python | skiptracer.py | EdwardDantes/skiptracer | 7ed09b5a72e4a325d8d9fb76dd487ba4cbec00fb | [
"Apache-2.0"
] | 912 | 2018-06-01T16:11:49.000Z | 2022-03-31T11:16:07.000Z | skiptracer.py | EdwardDantes/skiptracer | 7ed09b5a72e4a325d8d9fb76dd487ba4cbec00fb | [
"Apache-2.0"
] | 56 | 2018-06-02T22:35:14.000Z | 2021-12-13T19:48:17.000Z | skiptracer.py | EdwardDantes/skiptracer | 7ed09b5a72e4a325d8d9fb76dd487ba4cbec00fb | [
"Apache-2.0"
] | 210 | 2018-05-31T01:59:48.000Z | 2022-03-12T04:54:46.000Z | # -*- coding: utf-8 -*-
#!/usr/bin/env python
from __future__ import print_function
from plugins.menus import menus
from plugins.banner import Logo
import sys
import signal
try:
import __builtin__ as bi
except BaseException:
import builtins as bi
import ast
from plugins.colors import BodyColors as bc
def sig... | 29.21519 | 91 | 0.403813 |
from __future__ import print_function
from plugins.menus import menus
from plugins.banner import Logo
import sys
import signal
try:
import __builtin__ as bi
except BaseException:
import builtins as bi
import ast
from plugins.colors import BodyColors as bc
def signal_handler(signal, frame):
print("")
... | true | true |
1c437eb70c6b093c670682aeef35f268915bba86 | 1,093 | py | Python | python/cuml/common/timing_utils.py | garanews/cuml | 318f521a1d2681f4622a44921d27b5f592fe4407 | [
"Apache-2.0"
] | 2,743 | 2018-10-11T17:28:58.000Z | 2022-03-31T19:20:50.000Z | python/cuml/common/timing_utils.py | garanews/cuml | 318f521a1d2681f4622a44921d27b5f592fe4407 | [
"Apache-2.0"
] | 4,280 | 2018-10-11T22:29:57.000Z | 2022-03-31T22:02:44.000Z | python/cuml/common/timing_utils.py | garanews/cuml | 318f521a1d2681f4622a44921d27b5f592fe4407 | [
"Apache-2.0"
] | 454 | 2018-10-11T17:40:56.000Z | 2022-03-25T17:07:09.000Z | #
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 24.288889 | 74 | 0.656908 |
import time
from contextlib import contextmanager
@contextmanager
def timed(name):
t0 = time.time()
yield
t1 = time.time()
print("..%-24s: %8.4f" % (name, t1 - t0))
| true | true |
1c437ee24f843523d90bf668b10ab64b5712089c | 6,624 | py | Python | tools/third_party/h2/h2/config.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | tools/third_party/h2/h2/config.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 7,642 | 2018-05-28T09:38:03.000Z | 2022-03-31T20:55:48.000Z | tools/third_party/h2/h2/config.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | # -*- coding: utf-8 -*-
"""
h2/config
~~~~~~~~~
Objects for controlling the configuration of the HTTP/2 stack.
"""
class _BooleanConfigOption(object):
"""
Descriptor for handling a boolean config option. This will block
attempts to set boolean config options to non-bools.
"""
def __init__(self, ... | 38.736842 | 79 | 0.677083 |
class _BooleanConfigOption(object):
def __init__(self, name):
self.name = name
self.attr_name = '_%s' % self.name
def __get__(self, instance, owner):
return getattr(instance, self.attr_name)
def __set__(self, instance, value):
if not isinstance(value, bool):
... | true | true |
1c437fe59fd92943c7f968764ae61bfd0c5db224 | 119 | py | Python | mybrowser/session/__init__.py | joeledwardson/betfair-browser | b641f134e60307250a0e51bafa849422ecf5264b | [
"MIT"
] | 3 | 2021-11-23T19:03:02.000Z | 2021-11-24T08:44:23.000Z | mybrowser/session/__init__.py | joeledwardson/betfair-browser | b641f134e60307250a0e51bafa849422ecf5264b | [
"MIT"
] | 2 | 2021-11-23T18:47:31.000Z | 2021-12-08T15:36:11.000Z | mybrowser/session/__init__.py | joeledwardson/betfair-browser | b641f134e60307250a0e51bafa849422ecf5264b | [
"MIT"
] | null | null | null | from .session import Session, LoadedMarket
from .notifications import NotificationType, Notification, post_notification | 59.5 | 76 | 0.87395 | from .session import Session, LoadedMarket
from .notifications import NotificationType, Notification, post_notification | true | true |
1c4380ab2ee431b04f09eea7954a8d0ac2abc23c | 4,264 | py | Python | tests/h/nipsa/worker_test.py | project-star/h | fd1decafdce981b681ef3bd59e001b1284498dae | [
"MIT"
] | 1 | 2017-06-16T14:01:28.000Z | 2017-06-16T14:01:28.000Z | tests/h/nipsa/worker_test.py | project-star/h | fd1decafdce981b681ef3bd59e001b1284498dae | [
"MIT"
] | null | null | null | tests/h/nipsa/worker_test.py | project-star/h | fd1decafdce981b681ef3bd59e001b1284498dae | [
"MIT"
] | 1 | 2020-02-16T08:04:56.000Z | 2020-02-16T08:04:56.000Z | # -*- coding: utf-8 -*-
import mock
from h.nipsa import worker
def test_add_nipsa_action():
action = worker.add_nipsa_action("foo", {"_id": "test_id"})
assert action == {
"_op_type": "update",
"_index": "foo",
"_type": "annotation",
"_id": "test_id",
"doc": {"nipsa": ... | 36.758621 | 84 | 0.594512 |
import mock
from h.nipsa import worker
def test_add_nipsa_action():
action = worker.add_nipsa_action("foo", {"_id": "test_id"})
assert action == {
"_op_type": "update",
"_index": "foo",
"_type": "annotation",
"_id": "test_id",
"doc": {"nipsa": True}
}
def test_... | true | true |
1c4380b7b5eed26f0ed5dae4702e6fb59ca6da6e | 27,145 | py | Python | general_util/utils.py | alibaba/Retrieval-based-Pre-training-for-Machine-Reading-Comprehension | b27dc55446a29a53af7fffdad8628ccb545420da | [
"Apache-2.0"
] | 7 | 2021-06-16T01:40:23.000Z | 2021-12-04T02:40:35.000Z | general_util/utils.py | SparkJiao/Retrieval-based-Pre-training-for-Machine-Reading-Comprehension | 9ccad31bd0bf2216004cf729d1d511fc3e0b77c9 | [
"Apache-2.0"
] | 1 | 2021-08-16T09:10:05.000Z | 2021-08-25T08:44:44.000Z | general_util/utils.py | SparkJiao/Retrieval-based-Pre-training-for-Machine-Reading-Comprehension | 9ccad31bd0bf2216004cf729d1d511fc3e0b77c9 | [
"Apache-2.0"
] | 3 | 2021-09-13T02:03:37.000Z | 2021-10-11T18:48:21.000Z | import collections
import json
import math
import random
import re
import string
import torch
from collections import Counter
from torch.nn.functional import softmax
from typing import List, Callable, Tuple, Any, Optional
try:
from pytorch_pretrained_bert.tokenization import BasicTokenizer
except Impo... | 38.178622 | 121 | 0.605121 | import collections
import json
import math
import random
import re
import string
import torch
from collections import Counter
from torch.nn.functional import softmax
from typing import List, Callable, Tuple, Any, Optional
try:
from pytorch_pretrained_bert.tokenization import BasicTokenizer
except Impo... | true | true |
1c4382d435c7991b40ab8ee733f83b4502d0fea7 | 826 | py | Python | src/pyams_zmi/zmi/breadcrumb.py | Py-AMS/pyams-zmi | 0073d12062728efad3dc2b5cb40b0f75eacaaa1d | [
"ZPL-2.1"
] | null | null | null | src/pyams_zmi/zmi/breadcrumb.py | Py-AMS/pyams-zmi | 0073d12062728efad3dc2b5cb40b0f75eacaaa1d | [
"ZPL-2.1"
] | null | null | null | src/pyams_zmi/zmi/breadcrumb.py | Py-AMS/pyams-zmi | 0073d12062728efad3dc2b5cb40b0f75eacaaa1d | [
"ZPL-2.1"
] | null | null | null | #
# Copyright (c) 2015-2021 Thierry Florac <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRAN... | 30.592593 | 75 | 0.773608 |
from pyams_skin.viewlet.breadcrumb import BreadcrumbsAdapter
from pyams_template.template import override_template
from pyams_zmi.interfaces import IAdminLayer
__docformat__ = 'restructuredtext'
override_template(BreadcrumbsAdapter,
template='templates/breadcrumbs.pt', layer=IAdminLay... | true | true |
1c4382e3404c092cad820cea3891d6a1328a1167 | 7,167 | py | Python | py/test/pytests/retrieve_config.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | py/test/pytests/retrieve_config.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | py/test/pytests/retrieve_config.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | # Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Retrieve JSON config file from either an USB stick or a factory server.
Description
-----------
This pytest retrieves the config file from a specified... | 32.876147 | 80 | 0.686759 |
import logging
import os
import threading
import time
import unittest
from cros.factory.test import session
from cros.factory.test import server_proxy
from cros.factory.test.utils import media_utils
from cros.factory.utils.arg_utils import Arg
from cros.factory.utils import config_utils
from cros.factory.utils i... | true | true |
1c4382f85f3e76b494e4c372dd40b1ac3840e519 | 6,850 | py | Python | runner_predict_proba.py | dmitryrubtsov/Predictions-of-calls-in-Moscow-Megafon | 260bb49e859694d6a7c0dfb8cb13cd39d05ed597 | [
"MIT"
] | null | null | null | runner_predict_proba.py | dmitryrubtsov/Predictions-of-calls-in-Moscow-Megafon | 260bb49e859694d6a7c0dfb8cb13cd39d05ed597 | [
"MIT"
] | null | null | null | runner_predict_proba.py | dmitryrubtsov/Predictions-of-calls-in-Moscow-Megafon | 260bb49e859694d6a7c0dfb8cb13cd39d05ed597 | [
"MIT"
] | null | null | null | import os
import pickle
import time
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
class ColumnSelector(BaseEstimator, TransformerMixin):
def __init__(self, columns):
self.columns = columns
def fit(self, X, y=None):
return self
def transform(self, X):
... | 37.845304 | 120 | 0.554745 | import os
import pickle
import time
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
class ColumnSelector(BaseEstimator, TransformerMixin):
def __init__(self, columns):
self.columns = columns
def fit(self, X, y=None):
return self
def transform(self, X):
... | true | true |
1c438431f1b367fc3e91a7be45c76305d48a8771 | 12,873 | py | Python | userbot/modules/pmpermit.py | matesa/userbot | a071f58245ebdfbeec3ce93c53e75ca4d1f64b53 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2020-01-18T18:55:28.000Z | 2021-05-08T19:15:32.000Z | userbot/modules/pmpermit.py | matesa/userbot | a071f58245ebdfbeec3ce93c53e75ca4d1f64b53 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/pmpermit.py | matesa/userbot | a071f58245ebdfbeec3ce93c53e75ca4d1f64b53 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 19 | 2019-06-07T07:13:41.000Z | 2021-07-09T17:34:57.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.b (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for keeping control who PM you. """
from telethon.tl.functions.contacts import BlockRequest, Unblo... | 41.392283 | 129 | 0.550843 |
from telethon.tl.functions.contacts import BlockRequest, UnblockRequest
from telethon.tl.functions.messages import ReportSpamRequest
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import User
from sqlalchemy.exc import IntegrityError
from userbot import (COUNT_PM, CMD_HELP, BO... | true | true |
1c4384413ad1249c86287e57bc04b52f1efeeba4 | 716 | py | Python | apps/healthcare/covid/onprem/pipelines/covid-visualization/visualization.py | Karthik-Git-Sudo786/cisco-kubeflow-starter-pack | 49013953c0cf0de508bb05f1837809d84e6ea2d2 | [
"Apache-2.0"
] | 60 | 2020-03-20T08:05:32.000Z | 2021-12-17T14:07:53.000Z | apps/healthcare/covid/onprem/pipelines/covid-visualization/visualization.py | Karthik-Git-Sudo786/cisco-kubeflow-starter-pack | 49013953c0cf0de508bb05f1837809d84e6ea2d2 | [
"Apache-2.0"
] | 84 | 2020-03-18T07:06:20.000Z | 2021-03-02T13:29:20.000Z | apps/healthcare/covid/onprem/pipelines/covid-visualization/visualization.py | Karthik-Git-Sudo786/cisco-kubeflow-starter-pack | 49013953c0cf0de508bb05f1837809d84e6ea2d2 | [
"Apache-2.0"
] | 90 | 2020-03-17T11:54:05.000Z | 2021-06-03T09:18:58.000Z | # Python script to visualise the predicted number of cases in India
import matplotlib.pyplot as plt
from pandas import read_csv
train_df = read_csv(source + '/train_df.csv')
predict_df = read_csv(source + '/predict_df.csv')
country = "India"
target = "ConfirmedCases"
region_train_df = train_df[(train_df["Country_Re... | 25.571429 | 71 | 0.698324 |
import matplotlib.pyplot as plt
from pandas import read_csv
train_df = read_csv(source + '/train_df.csv')
predict_df = read_csv(source + '/predict_df.csv')
country = "India"
target = "ConfirmedCases"
region_train_df = train_df[(train_df["Country_Region"]==country)]
region_predict_df = predict_df[(predict_df["Count... | true | true |
1c4385826a2413c60ee4f12a8e6fc18bc2a4bfb0 | 5,308 | py | Python | scripts/MakeSingleHeader.py | carand/CLI11 | 438eabe5f8d91a3f12ce6c53afd1236b990798ae | [
"BSD-3-Clause"
] | 1 | 2020-09-18T21:24:26.000Z | 2020-09-18T21:24:26.000Z | scripts/MakeSingleHeader.py | carand/CLI11 | 438eabe5f8d91a3f12ce6c53afd1236b990798ae | [
"BSD-3-Clause"
] | 2 | 2020-10-31T02:25:09.000Z | 2021-03-07T01:48:46.000Z | scripts/MakeSingleHeader.py | carand/CLI11 | 438eabe5f8d91a3f12ce6c53afd1236b990798ae | [
"BSD-3-Clause"
] | 1 | 2021-10-21T16:58:01.000Z | 2021-10-21T16:58:01.000Z | #!/usr/bin/env python
from __future__ import print_function, unicode_literals
import os
import re
from argparse import ArgumentParser
from operator import add
from copy import copy
from functools import reduce
from subprocess import Popen, PIPE
includes_local = re.compile(r"""^#include "(.*)"$""", re.MULTILINE)
incl... | 30.159091 | 131 | 0.620196 |
from __future__ import print_function, unicode_literals
import os
import re
from argparse import ArgumentParser
from operator import add
from copy import copy
from functools import reduce
from subprocess import Popen, PIPE
includes_local = re.compile(r"""^#include "(.*)"$""", re.MULTILINE)
includes_system = re.comp... | true | true |
1c4385b696021fae2a33d7691ec3ff865c96ff2a | 3,156 | py | Python | apps/habitss/tests.py | KolevDarko/lifehq | 88d92f5fe76f2fb6511f2a892e096d95a69985d8 | [
"MIT"
] | null | null | null | apps/habitss/tests.py | KolevDarko/lifehq | 88d92f5fe76f2fb6511f2a892e096d95a69985d8 | [
"MIT"
] | null | null | null | apps/habitss/tests.py | KolevDarko/lifehq | 88d92f5fe76f2fb6511f2a892e096d95a69985d8 | [
"MIT"
] | null | null | null | from datetime import datetime
from account.models import Account
from dateutil.parser import parser, parse
from django.test import TestCase
from django_common.auth_backends import User
from apps.base.models import Profile
from apps.habitss.models import HabitAction, Habit
from apps.habitss.views import HabitStruct
... | 36.275862 | 85 | 0.679658 | from datetime import datetime
from account.models import Account
from dateutil.parser import parser, parse
from django.test import TestCase
from django_common.auth_backends import User
from apps.base.models import Profile
from apps.habitss.models import HabitAction, Habit
from apps.habitss.views import HabitStruct
... | true | true |
1c43867a03288dc0c1f3a51949b75193edc66308 | 3,558 | py | Python | thorpy/elements/pressable.py | YannThorimbert/ThorPy-1.0 | 2855491e7d5016e9cbefb71784d169bb57cf8c73 | [
"MIT"
] | null | null | null | thorpy/elements/pressable.py | YannThorimbert/ThorPy-1.0 | 2855491e7d5016e9cbefb71784d169bb57cf8c73 | [
"MIT"
] | null | null | null | thorpy/elements/pressable.py | YannThorimbert/ThorPy-1.0 | 2855491e7d5016e9cbefb71784d169bb57cf8c73 | [
"MIT"
] | null | null | null | from copy import copy
from pygame.event import Event, post
from thorpy.elements.element import Element
from thorpy.miscgui.state import State
from thorpy.miscgui.reaction import Reaction
from thorpy.miscgui.initializer import init_params
from thorpy.miscgui import constants, parameters, style, painterstyle
class Pre... | 37.851064 | 82 | 0.642496 | from copy import copy
from pygame.event import Event, post
from thorpy.elements.element import Element
from thorpy.miscgui.state import State
from thorpy.miscgui.reaction import Reaction
from thorpy.miscgui.initializer import init_params
from thorpy.miscgui import constants, parameters, style, painterstyle
class Pre... | true | true |
1c43882de9d66e798e357004b8fcaf92f64aca83 | 1,357 | py | Python | psych_metric/datasets/crowd_layer/convert_txt_to_csv_ner.py | prijatelj/bayesian_eval_ground_truth-free | c0e569c78d63beb79f5e1e727c322293c3584323 | [
"MIT"
] | 1 | 2021-12-26T05:55:46.000Z | 2021-12-26T05:55:46.000Z | psych_metric/datasets/crowd_layer/convert_txt_to_csv_ner.py | prijatelj/bayesian_eval_ground_truth-free | c0e569c78d63beb79f5e1e727c322293c3584323 | [
"MIT"
] | null | null | null | psych_metric/datasets/crowd_layer/convert_txt_to_csv_ner.py | prijatelj/bayesian_eval_ground_truth-free | c0e569c78d63beb79f5e1e727c322293c3584323 | [
"MIT"
] | null | null | null | """Converts given data txt file into a more parsable formatted csv.
"""
import argparse
import numpy as np
import pandas as pd
def parse_args():
parser = argparse.ArgumentParser(description='Convert the given ner-mturk txt file into an easier to parse csv file.')
parser.add_argument('input_file', help='Enter... | 29.5 | 122 | 0.642594 | import argparse
import numpy as np
import pandas as pd
def parse_args():
parser = argparse.ArgumentParser(description='Convert the given ner-mturk txt file into an easier to parse csv file.')
parser.add_argument('input_file', help='Enter the file path to the csv of author names')
parser.add_argument('ou... | true | true |
1c438865c8ad14c6278e6e11a08d3a7128f77ab8 | 3,441 | py | Python | sample.py | tsudalab/rxngenerator | 6f459828c03485926adb390e5bfbd4a6d91de30b | [
"MIT"
] | 8 | 2022-01-04T09:36:32.000Z | 2022-03-03T22:35:53.000Z | sample.py | tsudalab/rxngenerator | 6f459828c03485926adb390e5bfbd4a6d91de30b | [
"MIT"
] | null | null | null | sample.py | tsudalab/rxngenerator | 6f459828c03485926adb390e5bfbd4a6d91de30b | [
"MIT"
] | 1 | 2021-12-17T19:17:44.000Z | 2021-12-17T19:17:44.000Z | import sys
sys.path.append('./rxnft_vae')
import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
from torch.utils.data import DataLoader
from torch.autograd import Variable
import math, random, sys
from optparse import OptionParser
from collections import deque
... | 33.086538 | 163 | 0.779134 | import sys
sys.path.append('./rxnft_vae')
import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
from torch.utils.data import DataLoader
from torch.autograd import Variable
import math, random, sys
from optparse import OptionParser
from collections import deque
... | true | true |
1c43887a8bfb3ccc2eae3cbec1b04d408745a2bf | 4,850 | py | Python | cloudmersive_validate_api_client/models/validate_identifier_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | 3 | 2018-06-23T21:37:21.000Z | 2020-04-20T23:07:36.000Z | cloudmersive_validate_api_client/models/validate_identifier_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | 1 | 2019-02-04T17:03:35.000Z | 2019-03-02T20:16:52.000Z | cloudmersive_validate_api_client/models/validate_identifier_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | 2 | 2019-03-21T15:54:15.000Z | 2020-05-27T17:30:43.000Z | # coding: utf-8
"""
validateapi
The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API. # noqa: E501
OpenAPI spec version: v1
Ge... | 33.219178 | 274 | 0.610722 |
import pprint
import re
import six
class ValidateIdentifierResponse(object):
swagger_types = {
'valid_identifier': 'bool',
'error': 'str'
}
attribute_map = {
'valid_identifier': 'ValidIdentifier',
'error': 'Error'
}
def __init__(self, valid_identifier=None... | true | true |
1c4388d2d89af63f50ad952bd629f48f9511c161 | 8,306 | py | Python | beacon_controller/controllers/concepts_controller.py | NCATS-Tangerine/rhea-beacon | ccf6e790dc4c26eb4853b1bcb78382b84fbfe238 | [
"MIT"
] | null | null | null | beacon_controller/controllers/concepts_controller.py | NCATS-Tangerine/rhea-beacon | ccf6e790dc4c26eb4853b1bcb78382b84fbfe238 | [
"MIT"
] | 10 | 2018-08-18T03:13:08.000Z | 2019-02-05T20:04:15.000Z | beacon_controller/controllers/concepts_controller.py | NCATS-Tangerine/rhea-beacon | ccf6e790dc4c26eb4853b1bcb78382b84fbfe238 | [
"MIT"
] | null | null | null | from swagger_server.models.beacon_concept import BeaconConcept # noqa: E501
from swagger_server.models.beacon_concept_with_details import BeaconConceptWithDetails # noqa: E501
from swagger_server.models.beacon_concept_detail import BeaconConceptDetail
from swagger_server.models.exact_match_response import ExactMatchR... | 43.260417 | 871 | 0.639658 | from swagger_server.models.beacon_concept import BeaconConcept
from swagger_server.models.beacon_concept_with_details import BeaconConceptWithDetails
from swagger_server.models.beacon_concept_detail import BeaconConceptDetail
from swagger_server.models.exact_match_response import ExactMatchResponse
from beacon_c... | true | true |
1c4389982394e055dc2613ebfce4ec4faef09405 | 121,801 | py | Python | models/courses.py | danieldanciu/schoggi | 0e18f0cca58cf2318525d57691c2e674b131206d | [
"Apache-2.0"
] | null | null | null | models/courses.py | danieldanciu/schoggi | 0e18f0cca58cf2318525d57691c2e674b131206d | [
"Apache-2.0"
] | null | null | null | models/courses.py | danieldanciu/schoggi | 0e18f0cca58cf2318525d57691c2e674b131206d | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 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 ... | 39.013773 | 138 | 0.62612 |
"""Common classes and methods for managing Courses."""
__author__ = 'Pavel Simakov (psimakov@google.com)'
import collections
import copy
from datetime import datetime
import logging
import os
import pickle
import re
import sys
import threading
import config
import messages
import progress
import random... | false | true |
1c4389e92f7dcdefa6efc1d49c0fa7f9f02146b9 | 1,542 | py | Python | team_9/cocos/test/test_shattered_tiles_3d.py | Donnyvdm/dojo19 | 3cf043a84e3ad6d3c4d59cd9c50b160e1ff03400 | [
"BSD-3-Clause"
] | 1 | 2019-09-15T18:59:49.000Z | 2019-09-15T18:59:49.000Z | team_9/cocos/test/test_shattered_tiles_3d.py | Donnyvdm/dojo19 | 3cf043a84e3ad6d3c4d59cd9c50b160e1ff03400 | [
"BSD-3-Clause"
] | null | null | null | team_9/cocos/test/test_shattered_tiles_3d.py | Donnyvdm/dojo19 | 3cf043a84e3ad6d3c4d59cd9c50b160e1ff03400 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "t 0.1, s, t 2, s, t 5.1, s, q"
tags = "ShatteredTiles3D"
import pyglet
import... | 28.036364 | 74 | 0.702983 | from __future__ import division, print_function, unicode_literals
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
testinfo = "t 0.1, s, t 2, s, t 5.1, s, q"
tags = "ShatteredTiles3D"
import pyglet
import cocos
from cocos.director import director
from cocos.actions import *
fr... | true | true |
1c438aa0f087f05df0285155d7d372207cc59f58 | 913 | py | Python | src/python/miplearn/__init__.py | bknueven/MIPLearn | 43225681cb87ba5bcd699f409aa9b10225f9da2d | [
"BSD-3-Clause"
] | 1 | 2020-06-16T15:38:48.000Z | 2020-06-16T15:38:48.000Z | src/python/miplearn/__init__.py | bknueven/MIPLearn | 43225681cb87ba5bcd699f409aa9b10225f9da2d | [
"BSD-3-Clause"
] | null | null | null | src/python/miplearn/__init__.py | bknueven/MIPLearn | 43225681cb87ba5bcd699f409aa9b10225f9da2d | [
"BSD-3-Clause"
] | null | null | null | # MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details.
from .extractors import (SolutionExtractor,
InstanceFeaturesExtract... | 45.65 | 82 | 0.696605 |
from .extractors import (SolutionExtractor,
InstanceFeaturesExtractor,
ObjectiveValueExtractor,
VariableFeaturesExtractor,
)
from .components.component import Component
from .components.objective import ObjectiveValue... | true | true |
1c438ab0698c65a5de0b059062da1bf1ff546e58 | 7,391 | py | Python | lib/ls_dataset/d3m_dataset.py | stevencdang/AutoML-DS-Components | b0490262d3db5307c37f82c92e25cd938dd3a242 | [
"Apache-2.0"
] | null | null | null | lib/ls_dataset/d3m_dataset.py | stevencdang/AutoML-DS-Components | b0490262d3db5307c37f82c92e25cd938dd3a242 | [
"Apache-2.0"
] | 8 | 2020-09-04T17:39:26.000Z | 2022-03-02T03:28:38.000Z | lib/ls_dataset/d3m_dataset.py | stevencdang/AutoML-DS-Components | b0490262d3db5307c37f82c92e25cd938dd3a242 | [
"Apache-2.0"
] | null | null | null |
# Author: Steven C. Dang
# Class encapsulating operations on a remote d3m dataset
import logging
import os.path as path
import os
from io import IOBase
import json
import csv
import pandas as pd
from ls_dataset.ls_dataset import LSDataset
from ls_dataset.dsr_table import DSRTable
from ls_dataset.dsr_factory import ... | 34.699531 | 109 | 0.56677 |
import logging
import os.path as path
import os
from io import IOBase
import json
import csv
import pandas as pd
from ls_dataset.ls_dataset import LSDataset
from ls_dataset.dsr_table import DSRTable
from ls_dataset.dsr_factory import DatasetResourceFactory
logger = logging.getLogger(__name__)
class D3MDataset(L... | true | true |
1c438abc7906ec59abae2c735dd5b01a8b172294 | 2,358 | py | Python | effects/game-of-life/rle2png.py | Kristopher38/demoscene | a9909597ed142ad92e0fd2968f8976c8f5db1657 | [
"Artistic-2.0"
] | null | null | null | effects/game-of-life/rle2png.py | Kristopher38/demoscene | a9909597ed142ad92e0fd2968f8976c8f5db1657 | [
"Artistic-2.0"
] | null | null | null | effects/game-of-life/rle2png.py | Kristopher38/demoscene | a9909597ed142ad92e0fd2968f8976c8f5db1657 | [
"Artistic-2.0"
] | null | null | null | #!/usr/bin/env python3
from sys import argv
from PIL import Image
import re
import argparse
header_pattern = re.compile(
r'x\s*=\s*(\d+)\s*,\s*y\s*=\s*(\d+)(?:\s*,\s*rule\s*=\s*(\w+\/\w+)\s*)*'
)
rle_pattern = re.compile(r'(\d*)(o|b|\$)')
rotate_transforms = {
90: Image.ROTATE_90,
180: Image.ROTATE_180,
... | 29.848101 | 76 | 0.502969 |
from sys import argv
from PIL import Image
import re
import argparse
header_pattern = re.compile(
r'x\s*=\s*(\d+)\s*,\s*y\s*=\s*(\d+)(?:\s*,\s*rule\s*=\s*(\w+\/\w+)\s*)*'
)
rle_pattern = re.compile(r'(\d*)(o|b|\$)')
rotate_transforms = {
90: Image.ROTATE_90,
180: Image.ROTATE_180,
270: Image.ROTATE_... | true | true |
1c438ba5c7df53e8035695eedf765a3fdd0e338e | 2,243 | py | Python | rapm_prior/download_stats_nba_data.py | airalcorn2/NBA_Tutorials | 85179300864d2c97a727a7b2a5ee46d250bdac20 | [
"MIT"
] | 123 | 2019-01-02T20:51:19.000Z | 2022-03-16T23:37:17.000Z | rapm_prior/download_stats_nba_data.py | nicholasrios/NBA_Tutorials | 85179300864d2c97a727a7b2a5ee46d250bdac20 | [
"MIT"
] | 8 | 2019-07-31T14:32:46.000Z | 2022-02-14T00:16:15.000Z | rapm_prior/download_stats_nba_data.py | nicholasrios/NBA_Tutorials | 85179300864d2c97a727a7b2a5ee46d250bdac20 | [
"MIT"
] | 38 | 2019-05-15T23:26:16.000Z | 2022-01-03T05:35:13.000Z | import json
import pandas as pd
import urllib3
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
header_data = {
'Host': 'stats.nba.com',
'Connection': 'keep-alive',
'Cache-Control': 'max-age=0',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Macintosh;... | 48.76087 | 502 | 0.664735 | import json
import pandas as pd
import urllib3
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
header_data = {
'Host': 'stats.nba.com',
'Connection': 'keep-alive',
'Cache-Control': 'max-age=0',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Macintosh;... | true | true |
1c438c1bf0fc289020d2aef076f6dd54765a738f | 1,016 | py | Python | apprest/management/commands/insert_user.py | dsanchez-cells/calipsoplus-backend | 7eaa6904ec59d88052644b31041b92ee20e54354 | [
"MIT"
] | 4 | 2018-12-04T15:08:27.000Z | 2019-04-11T09:49:41.000Z | apprest/management/commands/insert_user.py | dsanchez-cells/calipsoplus-backend | 7eaa6904ec59d88052644b31041b92ee20e54354 | [
"MIT"
] | 63 | 2018-11-22T13:07:56.000Z | 2021-06-10T20:55:58.000Z | apprest/management/commands/insert_user.py | dsanchez-cells/calipsoplus-backend | 7eaa6904ec59d88052644b31041b92ee20e54354 | [
"MIT"
] | 10 | 2018-11-23T08:17:28.000Z | 2022-01-15T23:41:59.000Z | from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from apprest.services.experiment import CalipsoExperimentsServices
class Command(BaseCommand):
help = 'Insert new user'
experiments_services = CalipsoExperimentsServices()
def add_arguments(self,... | 36.285714 | 103 | 0.675197 | from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from apprest.services.experiment import CalipsoExperimentsServices
class Command(BaseCommand):
help = 'Insert new user'
experiments_services = CalipsoExperimentsServices()
def add_arguments(self,... | true | true |
1c438c84d51ba5ee38e7953290216d463f2c40f8 | 744 | py | Python | ginpar/utils/strings.py | davidomarf/ginpar | cee1676ba2280d09f43a52f5145b28388b8e1152 | [
"MIT"
] | 12 | 2019-10-19T15:35:54.000Z | 2021-01-18T00:15:10.000Z | ginpar/utils/strings.py | davidomarf/ginpar | cee1676ba2280d09f43a52f5145b28388b8e1152 | [
"MIT"
] | 19 | 2019-10-06T22:10:23.000Z | 2019-11-08T17:53:16.000Z | ginpar/utils/strings.py | davidomarf/ginpar | cee1676ba2280d09f43a52f5145b28388b8e1152 | [
"MIT"
] | null | null | null | """String filters to convert between cases.
The list of filters in here are added to the Jinja2 environment, so they may
come handy when designing a custom theme.
"""
def unkebab(s):
"""Replace dashes with spaces.
Parameters
----------
s : str
String that may contain "-" characters.
"""
... | 19.076923 | 76 | 0.577957 |
def unkebab(s):
return " ".join(s.split("-"))
def space_to_kebab(s):
return "-".join(s.split(" "))
def camel_to_space(s):
return " ".join(s.split("_"))
| true | true |
1c438e8445a5ef1fa4671cd7454ca72b222337f0 | 7,551 | bzl | Python | haskell/private/actions/package.bzl | ghuntley/rules_haskell | adc3503387fbb54173dc4b4f21ae0aefe33759a4 | [
"Apache-2.0"
] | null | null | null | haskell/private/actions/package.bzl | ghuntley/rules_haskell | adc3503387fbb54173dc4b4f21ae0aefe33759a4 | [
"Apache-2.0"
] | null | null | null | haskell/private/actions/package.bzl | ghuntley/rules_haskell | adc3503387fbb54173dc4b4f21ae0aefe33759a4 | [
"Apache-2.0"
] | null | null | null | """Action for creating packages and registering them with ghc-pkg"""
load("@bazel_skylib//lib:paths.bzl", "paths")
load(":private/path_utils.bzl", "target_unique_name")
load(":private/pkg_id.bzl", "pkg_id")
load(":private/set.bzl", "set")
load(":private/path_utils.bzl", "get_lib_name")
def _get_extra_libraries(dep_in... | 35.78673 | 95 | 0.610118 |
load("@bazel_skylib//lib:paths.bzl", "paths")
load(":private/path_utils.bzl", "target_unique_name")
load(":private/pkg_id.bzl", "pkg_id")
load(":private/set.bzl", "set")
load(":private/path_utils.bzl", "get_lib_name")
def _get_extra_libraries(dep_info):
cc_libs = dep_info.cc_dependencies.dynamic_linking.libraries... | true | true |
1c438f9a008ee3db85c82e845472932de6e679c6 | 2,660 | py | Python | bin/distribution_test.py | astrolabsoftware/fink-source | 9003e933e1d8c3f03b70c2b277638de97be102ec | [
"Apache-2.0"
] | 17 | 2019-03-08T12:37:06.000Z | 2022-02-01T18:02:07.000Z | bin/distribution_test.py | astrolabsoftware/fink-source | 9003e933e1d8c3f03b70c2b277638de97be102ec | [
"Apache-2.0"
] | 559 | 2019-03-07T14:55:27.000Z | 2022-03-11T20:13:12.000Z | bin/distribution_test.py | tallamjr/fink-broker | 97753ff695b78ea52d084cac787dec6c52c4e4cc | [
"Apache-2.0"
] | 12 | 2019-03-08T13:04:38.000Z | 2022-01-23T22:22:50.000Z | #!/usr/bin/env python
# Copyright 2019-2021 AstroLab Software
# Author: Abhishek Chauhan
#
# 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
#
#... | 31.666667 | 77 | 0.721805 |
import argparse
import time
from fink_broker.parser import getargs
from fink_broker.sparkUtils import init_sparksession
from fink_broker.distributionUtils import decode_kafka_df
from fink_broker.loggingUtils import get_fink_logger, inspect_application
def main():
parser = argparse.ArgumentParser... | true | true |
1c4391152fe7b0959e118d2e075b3b8ec564cb67 | 808 | py | Python | examples/tellurium-files/phrasedml/case_06.py | kirichoi/tellurium | 77cf6e794600587741ebe209644a78051e0db1d5 | [
"Apache-2.0"
] | 73 | 2016-06-13T12:44:28.000Z | 2021-12-31T14:44:39.000Z | examples/tellurium-files/phrasedml/case_06.py | kirichoi/tellurium | 77cf6e794600587741ebe209644a78051e0db1d5 | [
"Apache-2.0"
] | 461 | 2015-03-26T00:05:16.000Z | 2022-03-16T17:24:35.000Z | examples/tellurium-files/phrasedml/case_06.py | kirichoi/tellurium | 77cf6e794600587741ebe209644a78051e0db1d5 | [
"Apache-2.0"
] | 30 | 2016-01-18T16:50:54.000Z | 2021-07-06T09:29:53.000Z | """
Coupled ranges.
Two ranges with one of the ranges being master range, the other following in lock.
"""
import os
from tellurium.sedml.utils import run_case
a_str = '''
model case_06()
J0: S1 -> S2; k1*S1-k2*S2
S1 = 10.0; S2 = 0.0;
k1 = 0.5; k2=0.4
end
'''
p_str = '''
mod1 = model "case_06"
sim1 = simulat... | 28.857143 | 82 | 0.680693 | import os
from tellurium.sedml.utils import run_case
a_str = '''
model case_06()
J0: S1 -> S2; k1*S1-k2*S2
S1 = 10.0; S2 = 0.0;
k1 = 0.5; k2=0.4
end
'''
p_str = '''
mod1 = model "case_06"
sim1 = simulate uniform(0, 10, 100)
task1 = run sim1 on mod1
repeat1 = repeat task1 for S1 in [1, 3, 5], S2 in unifor... | true | true |
1c43915857abc3fd17112f0c842caca40adcc78b | 4,345 | py | Python | truvo/test/test_nuvo.py | mjr9804/truvo | e3f52833e534e8ace7eb82f2091045df269eeb72 | [
"MIT"
] | null | null | null | truvo/test/test_nuvo.py | mjr9804/truvo | e3f52833e534e8ace7eb82f2091045df269eeb72 | [
"MIT"
] | null | null | null | truvo/test/test_nuvo.py | mjr9804/truvo | e3f52833e534e8ace7eb82f2091045df269eeb72 | [
"MIT"
] | null | null | null | """
Tests for nuvo.py
"""
#pylint: disable=arguments-differ,missing-class-docstring,missing-function-docstring
#pylint: disable=protected-access
import json
from unittest import TestCase
from unittest.mock import patch
from truvo import nuvo
class TestNuvo(TestCase):
@patch('socket.create_connection')
@patch... | 43.019802 | 99 | 0.636364 |
import json
from unittest import TestCase
from unittest.mock import patch
from truvo import nuvo
class TestNuvo(TestCase):
@patch('socket.create_connection')
@patch('socket.gethostbyname')
def setUp(self, mock_gethost, mock_create):
self.mock_gethost = mock_gethost
self.mock_gethost.ret... | true | true |
1c4392f528ec2231722f92fe93550d8115cbc3e8 | 9,158 | py | Python | test/data_processing/test_nodes.py | coruscating/qiskit-experiments | dac1febf13be870d3bac16af22aa341a088e0766 | [
"Apache-2.0"
] | null | null | null | test/data_processing/test_nodes.py | coruscating/qiskit-experiments | dac1febf13be870d3bac16af22aa341a088e0766 | [
"Apache-2.0"
] | 1 | 2021-06-01T01:43:52.000Z | 2021-06-01T01:43:52.000Z | test/data_processing/test_nodes.py | coruscating/qiskit-experiments | dac1febf13be870d3bac16af22aa341a088e0766 | [
"Apache-2.0"
] | 2 | 2021-05-17T10:13:20.000Z | 2021-06-01T01:34:34.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 38.64135 | 100 | 0.604826 |
import numpy as np
from qiskit.test import QiskitTestCase
from qiskit_experiments.data_processing.nodes import (
SVD,
AverageData,
MinMaxNormalize,
Probability,
)
from qiskit_experiments.data_processing.data_processor import DataProcessor
from . import BaseDataProcessorTest
class Test... | true | true |
1c43934f21526c9f0103a9f4b781ad01d3e6c720 | 5,364 | py | Python | AVL_tree_PROG.py | arafayr/AVL_tree_PROG | 9528aa61fab3e10d6b12579cf438811c93e99ace | [
"MIT"
] | null | null | null | AVL_tree_PROG.py | arafayr/AVL_tree_PROG | 9528aa61fab3e10d6b12579cf438811c93e99ace | [
"MIT"
] | null | null | null | AVL_tree_PROG.py | arafayr/AVL_tree_PROG | 9528aa61fab3e10d6b12579cf438811c93e99ace | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
class Node:
def __init__(self,data,parent):
self.data = data
self.rightchild = None
self.leftchild = None
self.parent = parent
self.height = 0
class AVLTree:
def __init__(self):
self.root = None
... | 29.635359 | 99 | 0.496644 |
class Node:
def __init__(self,data,parent):
self.data = data
self.rightchild = None
self.leftchild = None
self.parent = parent
self.height = 0
class AVLTree:
def __init__(self):
self.root = None
def insert(self,data):
if self.ro... | true | true |
1c4394dcae4611c54410c55300ddc06a3894fabe | 16,003 | py | Python | tests/scanner/test_win32_scanner.py | zea2/DeviceManager | 5f224c7680692cd9329b5b1421b00a814e3c2bfe | [
"MIT"
] | null | null | null | tests/scanner/test_win32_scanner.py | zea2/DeviceManager | 5f224c7680692cd9329b5b1421b00a814e3c2bfe | [
"MIT"
] | 15 | 2020-03-06T13:53:56.000Z | 2020-04-01T09:14:34.000Z | tests/scanner/test_win32_scanner.py | zea2/DeviceManager | 5f224c7680692cd9329b5b1421b00a814e3c2bfe | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script for testing the module device_manager.scanner._win32.
This script tests the following entities:
- class Win32USBDeviceScanner
- class Win32LANDeviceScanner
Authors:
Lukas Lankes, Forschungszentrum Jülich GmbH - ZEA-2, l.lankes@fz-juelich.de
"""
import os
im... | 49.544892 | 100 | 0.620509 |
import os
import subprocess
import sys
import unittest
import unittest.mock
from device_manager.device import USBDevice, LANDevice
from device_manager.scanner import USBDeviceScanner, LANDeviceScanner
@unittest.skipUnless(sys.platform == "win32", "Requires Windows")
class TestWin32ScannerImport(unittest.TestCase)... | true | true |
1c4394fff12d771e0ea171ef042d49040a6866df | 2,724 | py | Python | setup.py | fangd123/TextBrewer | 866f4363d9bd964f00aa60b0db5e9252a7905448 | [
"Apache-2.0"
] | null | null | null | setup.py | fangd123/TextBrewer | 866f4363d9bd964f00aa60b0db5e9252a7905448 | [
"Apache-2.0"
] | null | null | null | setup.py | fangd123/TextBrewer | 866f4363d9bd964f00aa60b0db5e9252a7905448 | [
"Apache-2.0"
] | null | null | null | """
Simple check list from AllenNLP repo: https://github.com/allenai/allennlp/blob/master/setup.py
To create the package for pypi.
1. Change the version in __init__.py, setup.py as well as docs/source/conf.py.
2. Commit these changes with the message: "Release: VERSION"
3. Add a tag in git to mark the release: "git tag... | 41.907692 | 101 | 0.698972 |
import shutil
from pathlib import Path
from setuptools import find_packages, setup
setup(
name="textbrewer",
version="0.2.1",
author="ziqingyang",
author_email="zqyang5@iflytek.com",
description="PyTorch-based knowledge distillation toolkit for natural language processing",
long_description=... | true | true |
1c43953717c27a54f36e47fe96bee4424e86d55d | 7,825 | py | Python | django/core/handlers/wsgi.py | raydeal/django | e96320c91724830034033a9cb8afd9cf8c11e2fd | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | django/core/handlers/wsgi.py | raydeal/django | e96320c91724830034033a9cb8afd9cf8c11e2fd | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | django/core/handlers/wsgi.py | raydeal/django | e96320c91724830034033a9cb8afd9cf8c11e2fd | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | from io import BytesIO
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.http import HttpRequest, QueryDict, parse_cookie
from django.urls import set_script_prefix
from django.utils.encoding import repercent_broken_unicode
from django.utils.functional im... | 35.894495 | 87 | 0.648051 | from io import BytesIO
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.http import HttpRequest, QueryDict, parse_cookie
from django.urls import set_script_prefix
from django.utils.encoding import repercent_broken_unicode
from django.utils.functional im... | true | true |
1c4395fdce03fca9baeba81e5f548c41f4601762 | 446 | py | Python | lib/download.py | colajam93/aurpackager | 624b9be3dcb0d1ef388a0bd2c3019390881d51cd | [
"MIT"
] | null | null | null | lib/download.py | colajam93/aurpackager | 624b9be3dcb0d1ef388a0bd2c3019390881d51cd | [
"MIT"
] | null | null | null | lib/download.py | colajam93/aurpackager | 624b9be3dcb0d1ef388a0bd2c3019390881d51cd | [
"MIT"
] | null | null | null | from contextlib import closing
from urllib.request import urlopen, OpenerDirector
def save_to_file(url: str, file_path: str, opener: OpenerDirector = None):
def process(request_):
with open(file_path, 'wb') as f:
f.write(request_.read())
if opener:
with closing(opener.open(url)) a... | 27.875 | 74 | 0.647982 | from contextlib import closing
from urllib.request import urlopen, OpenerDirector
def save_to_file(url: str, file_path: str, opener: OpenerDirector = None):
def process(request_):
with open(file_path, 'wb') as f:
f.write(request_.read())
if opener:
with closing(opener.open(url)) a... | true | true |
1c4396f29e3704807e1fce11fdaed48c810a35a5 | 7,393 | py | Python | okta/resource_clients/domain_client.py | ander501/okta-sdk-python | 0927dc6a2f6d5ebf7cd1ea806d81065094c92471 | [
"Apache-2.0"
] | null | null | null | okta/resource_clients/domain_client.py | ander501/okta-sdk-python | 0927dc6a2f6d5ebf7cd1ea806d81065094c92471 | [
"Apache-2.0"
] | null | null | null | okta/resource_clients/domain_client.py | ander501/okta-sdk-python | 0927dc6a2f6d5ebf7cd1ea806d81065094c92471 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 - Present Okta, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... | 26.123675 | 90 | 0.548357 |
from okta.models.domain_list_response\
import DomainListResponse
from okta.models.domain\
import Domain
from okta.utils import format_url
from okta.api_client import APIClient
class DomainClient(APIClient):
def __init__(self):
self._base_url = ""
async def list_domains(
self,... | true | true |
1c43975c6be9b0a91b85f63283c7f97b975a1cb8 | 10,146 | py | Python | threedi_api_client/openapi/models/potential_breach.py | nens/threedi-api-client | 43b0eb1bd47310b1783f87f6ad8bfbfe0fb4d90a | [
"BSD-3-Clause"
] | null | null | null | threedi_api_client/openapi/models/potential_breach.py | nens/threedi-api-client | 43b0eb1bd47310b1783f87f6ad8bfbfe0fb4d90a | [
"BSD-3-Clause"
] | 16 | 2021-05-31T09:52:04.000Z | 2022-03-14T16:07:19.000Z | threedi_api_client/openapi/models/potential_breach.py | nens/threedi-api-client | 43b0eb1bd47310b1783f87f6ad8bfbfe0fb4d90a | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
3Di API
3Di simulation API (latest stable version: v3) Framework release: 2.9.0 3Di core release: 2.2.2 deployed on: 11:01AM (UTC) on January 11, 2022 # noqa: E501
The version of the OpenAPI document: v3
Contact: info@nelen-schuurmans.nl
Generated by: https://openapi-ge... | 33.596026 | 191 | 0.623398 |
import logging
import pprint
import re
import six
from threedi_api_client.openapi.configuration import Configuration
logger = logging.getLogger(__name__)
class PotentialBreach(object):
openapi_types = {
'url': 'str',
'connected_pnt_id': 'int',
'levee_material': 'str',
'lin... | true | true |
1c439907cfb244998cd93f3c730564f431b4e5ee | 600 | py | Python | coffeenijuan/management/migrations/0003_supply_addeded_by.py | Cyvid7-Darus10/CMSC-128-Group-Repo | cdbbe84f4af398a6c1d5c2749173d4cf585487a9 | [
"MIT"
] | null | null | null | coffeenijuan/management/migrations/0003_supply_addeded_by.py | Cyvid7-Darus10/CMSC-128-Group-Repo | cdbbe84f4af398a6c1d5c2749173d4cf585487a9 | [
"MIT"
] | null | null | null | coffeenijuan/management/migrations/0003_supply_addeded_by.py | Cyvid7-Darus10/CMSC-128-Group-Repo | cdbbe84f4af398a6c1d5c2749173d4cf585487a9 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-06-07 15:04
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('management', '0002_trans... | 27.272727 | 133 | 0.678333 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('management', '0002_transaction'),
]
operations = [
mig... | true | true |
1c439b1e301860046f645abdbc1f4668b65d7558 | 1,419 | py | Python | dataproc/google/cloud/dataproc_v1beta2/proto/shared_pb2.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2019-01-23T21:54:51.000Z | 2019-01-23T21:54:51.000Z | dataproc/google/cloud/dataproc_v1beta2/proto/shared_pb2.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2018-04-06T19:51:23.000Z | 2018-04-06T19:51:23.000Z | dataproc/google/cloud/dataproc_v1beta2/proto/shared_pb2.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2020-11-15T11:44:36.000Z | 2020-11-15T11:44:36.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/dataproc_v1beta2/proto/shared.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 message as _message
from g... | 36.384615 | 275 | 0.799859 |
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 message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_... | true | true |
1c439bd57caf9056e4da24f63fd5fa1fd020399d | 258 | py | Python | core/urls.py | kamyabdesign/DRF_Django | 7930ef9ad259c092e16e7ae1885054cef1608415 | [
"Apache-2.0"
] | null | null | null | core/urls.py | kamyabdesign/DRF_Django | 7930ef9ad259c092e16e7ae1885054cef1608415 | [
"Apache-2.0"
] | null | null | null | core/urls.py | kamyabdesign/DRF_Django | 7930ef9ad259c092e16e7ae1885054cef1608415 | [
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api-auth/', include('rest_framework.urls')),
path('', include('blog.urls')),
path('api/', include('api.urls')),
]
| 23.454545 | 54 | 0.651163 |
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api-auth/', include('rest_framework.urls')),
path('', include('blog.urls')),
path('api/', include('api.urls')),
]
| true | true |
1c439c449f1626aa0ccf923efed17e25fa0b2efb | 2,913 | py | Python | partner/partner.py | aparkerlue/ledger-partner | b7d59f23ed5853312cdf9aa97f8941f00478d41b | [
"Apache-2.0"
] | null | null | null | partner/partner.py | aparkerlue/ledger-partner | b7d59f23ed5853312cdf9aa97f8941f00478d41b | [
"Apache-2.0"
] | null | null | null | partner/partner.py | aparkerlue/ledger-partner | b7d59f23ed5853312cdf9aa97f8941f00478d41b | [
"Apache-2.0"
] | null | null | null | # -*- mode: python; coding: utf-8; -*-
"""Functions for partnership accounting with Ledger."""
from math import floor
from ledger import Amount
def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
"""Return True if the values a and b are close to each other."""
return abs(a - b) <= max(rel_tol * max(abs(a), abs(b)... | 33.872093 | 86 | 0.650532 |
from math import floor
from ledger import Amount
def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
return abs(a - b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
def parse_partner_string(s):
L = [x.strip().split(" ") for x in s.split(",")]
if all(len(x) <= 1 for x in L):
return {t[0]: 100... | true | true |
1c439c92d19627a8c9292e2c3337445b1ea5786f | 91 | py | Python | enthought/traits/traits_listener.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/traits/traits_listener.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/traits/traits_listener.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
from traits.traits_listener import *
| 22.75 | 38 | 0.846154 |
from __future__ import absolute_import
from traits.traits_listener import *
| true | true |
1c439cda4f6402826d3d0ec46d23201b633cd875 | 649 | py | Python | setup.py | caracalai/caracal | c93373fb88091175c32dc0e4a91eb7a78b693367 | [
"MIT"
] | 25 | 2021-12-10T14:07:04.000Z | 2022-02-21T14:45:31.000Z | setup.py | caracalai/caracal | c93373fb88091175c32dc0e4a91eb7a78b693367 | [
"MIT"
] | null | null | null | setup.py | caracalai/caracal | c93373fb88091175c32dc0e4a91eb7a78b693367 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as f:
long_description = f.read()
setuptools.setup(
name="caracal",
version="0.0.1",
long_description=long_description,
author="BroutonLab team",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT L... | 24.037037 | 51 | 0.597843 | import setuptools
with open("README.md", "r") as f:
long_description = f.read()
setuptools.setup(
name="caracal",
version="0.0.1",
long_description=long_description,
author="BroutonLab team",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT L... | true | true |
1c439db077a19cdd96ad6a2a146970e85ccbd10b | 1,189 | py | Python | custom_components/tesla_custom/binary_sensor.py | carleeno/tesla | 81c342d5c2564eed3659cc5a0711b4c209dd6773 | [
"Apache-2.0"
] | 108 | 2021-04-29T11:38:05.000Z | 2022-03-25T10:35:28.000Z | custom_components/tesla_custom/binary_sensor.py | carleeno/tesla | 81c342d5c2564eed3659cc5a0711b4c209dd6773 | [
"Apache-2.0"
] | 120 | 2021-04-29T07:49:59.000Z | 2022-03-31T04:45:15.000Z | custom_components/tesla_custom/binary_sensor.py | custom-components/tesla | 004f265ec0c6e25ce2d04cdeea9964cf1d1cac4e | [
"Apache-2.0"
] | 33 | 2021-05-01T16:03:07.000Z | 2022-03-12T21:54:40.000Z | """Support for Tesla binary sensor."""
from homeassistant.components.binary_sensor import DEVICE_CLASSES, BinarySensorEntity
from . import DOMAIN as TESLA_DOMAIN
from .tesla_device import TeslaDevice
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Tesla binary_sensors by confi... | 29 | 85 | 0.640034 |
from homeassistant.components.binary_sensor import DEVICE_CLASSES, BinarySensorEntity
from . import DOMAIN as TESLA_DOMAIN
from .tesla_device import TeslaDevice
async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(
[
TeslaBinarySensor(
devic... | true | true |
1c439e6349e5d084a088b8833c4b88c1aeebd6da | 189 | py | Python | scanpy/tests/test_sim.py | mkmkryu/scanpy2 | f3db32a142dc31c1b628380db1c969a6d0b9dc3a | [
"BSD-3-Clause"
] | 1,171 | 2017-01-17T14:01:02.000Z | 2022-03-31T23:02:57.000Z | scanpy/tests/test_sim.py | mkmkryu/scanpy2 | f3db32a142dc31c1b628380db1c969a6d0b9dc3a | [
"BSD-3-Clause"
] | 1,946 | 2017-01-22T10:19:04.000Z | 2022-03-31T17:13:03.000Z | scanpy/tests/test_sim.py | mkmkryu/scanpy2 | f3db32a142dc31c1b628380db1c969a6d0b9dc3a | [
"BSD-3-Clause"
] | 499 | 2017-01-21T11:39:29.000Z | 2022-03-23T13:57:35.000Z | import scanpy as sc
import numpy as np
def test_sim_toggleswitch():
adata = sc.tl.sim('toggleswitch')
np.allclose(adata.X, sc.datasets.toggleswitch().X, np.finfo(np.float32).eps)
| 23.625 | 80 | 0.724868 | import scanpy as sc
import numpy as np
def test_sim_toggleswitch():
adata = sc.tl.sim('toggleswitch')
np.allclose(adata.X, sc.datasets.toggleswitch().X, np.finfo(np.float32).eps)
| true | true |
1c439ef1c9899ada0ed1adae7eefbd496b13ddb8 | 334 | py | Python | cart/urls.py | Code-Institute-Submissions/kordianbird-GamerGarageMS4 | 5c771674e76c6b81c761a2282df62bff61667def | [
"OML"
] | null | null | null | cart/urls.py | Code-Institute-Submissions/kordianbird-GamerGarageMS4 | 5c771674e76c6b81c761a2282df62bff61667def | [
"OML"
] | null | null | null | cart/urls.py | Code-Institute-Submissions/kordianbird-GamerGarageMS4 | 5c771674e76c6b81c761a2282df62bff61667def | [
"OML"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.view_cart, name='view_cart'),
path('add/<item_id>/', views.add_to_cart, name='add_to_cart'),
path('remove/<item_id>/', views.remove_from_cart, name='remove_from_cart'),
path('adjust/<item_id>/', views.adjust_cart, name='adj... | 33.4 | 79 | 0.694611 | from django.urls import path
from . import views
urlpatterns = [
path('', views.view_cart, name='view_cart'),
path('add/<item_id>/', views.add_to_cart, name='add_to_cart'),
path('remove/<item_id>/', views.remove_from_cart, name='remove_from_cart'),
path('adjust/<item_id>/', views.adjust_cart, name='adj... | true | true |
1c439f902b5bfa9b26789f055d14dbf4620b3063 | 3,962 | py | Python | 5_longestPalindrome.py | luoshao23/LeetCode | fb7a4adf9e0324764158a40e76a491e737b96f4d | [
"Apache-2.0"
] | null | null | null | 5_longestPalindrome.py | luoshao23/LeetCode | fb7a4adf9e0324764158a40e76a491e737b96f4d | [
"Apache-2.0"
] | null | null | null | 5_longestPalindrome.py | luoshao23/LeetCode | fb7a4adf9e0324764158a40e76a491e737b96f4d | [
"Apache-2.0"
] | null | null | null | def isPal(s):
l = len(s)
if l <= 1:
return True
half = l // 2 - 1
for i in range(half, -1, -1):
if s[i] != s[l - 1 - i]:
return False
else:
return True
class Solution(object):
def longestPalindrome_1(self, s):
"""
:type s: str
:rtype... | 23.86747 | 76 | 0.392226 | def isPal(s):
l = len(s)
if l <= 1:
return True
half = l // 2 - 1
for i in range(half, -1, -1):
if s[i] != s[l - 1 - i]:
return False
else:
return True
class Solution(object):
def longestPalindrome_1(self, s):
"""
:type s: str
:rtype... | false | true |
1c43a009e316cddd46cc3993314f9f414db25862 | 2,094 | py | Python | modules/settingsConf.py | mattiasoldani/anaKrys | 9f6e4bcb72463c68fdccd6b65ec6bcf539346774 | [
"MIT"
] | null | null | null | modules/settingsConf.py | mattiasoldani/anaKrys | 9f6e4bcb72463c68fdccd6b65ec6bcf539346774 | [
"MIT"
] | 7 | 2021-01-12T15:19:36.000Z | 2022-03-26T10:44:25.000Z | modules/settingsConf.py | mattiasoldani/anaKrys | 9f6e4bcb72463c68fdccd6b65ec6bcf539346774 | [
"MIT"
] | null | null | null | from settings import *
###############################################################################
###############################################################################
def settingsSelect(boolTest, whichInput):
if not boolTest: # physics files -- either ROOT or ASCII or NPZ
print("look... | 42.734694 | 100 | 0.475645 | from settings import *
| true | true |
1c43a0552c4e97cf972971d47db51a0b2becb608 | 439 | py | Python | env/Lib/site-packages/plotly/validators/streamtube/hoverlabel/_namelengthsrc.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/streamtube/hoverlabel/_namelengthsrc.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/streamtube/hoverlabel/_namelengthsrc.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="streamtube.hoverlabel", **kwargs
):
super(NamelengthsrcValidator, self).__init__(
plotly_name=plotly_name,
... | 31.357143 | 88 | 0.671982 | import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="streamtube.hoverlabel", **kwargs
):
super(NamelengthsrcValidator, self).__init__(
plotly_name=plotly_name,
... | true | true |
1c43a0a7b2ff45d86431f6a45ca3ab07b55cbfdb | 310 | py | Python | src/image_downloader.py | aditipolkam/spotify-downloader | 2b6f8027170771dda7713bf034f5c099187a9bed | [
"MIT"
] | null | null | null | src/image_downloader.py | aditipolkam/spotify-downloader | 2b6f8027170771dda7713bf034f5c099187a9bed | [
"MIT"
] | null | null | null | src/image_downloader.py | aditipolkam/spotify-downloader | 2b6f8027170771dda7713bf034f5c099187a9bed | [
"MIT"
] | 1 | 2022-01-23T10:40:17.000Z | 2022-01-23T10:40:17.000Z | import urllib.request
import os
import pathlib
from pathlib import Path
def download_image(url, filepath, name):
filename = str(name + ".jpg")
img_path = Path(pathlib.Path(filepath, filename))
urllib.request.urlretrieve(url,img_path)
#print("cover download successful")
return img_path
| 20.666667 | 53 | 0.732258 | import urllib.request
import os
import pathlib
from pathlib import Path
def download_image(url, filepath, name):
filename = str(name + ".jpg")
img_path = Path(pathlib.Path(filepath, filename))
urllib.request.urlretrieve(url,img_path)
return img_path
| true | true |
1c43a2957e0ba3c3212221040eb1df78fccdd245 | 32,336 | py | Python | tests/test_client/tests.py | victorliun/django | 7def55c3f6716fcfa40a3bd5d0fbb2090588d81e | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/test_client/tests.py | victorliun/django | 7def55c3f6716fcfa40a3bd5d0fbb2090588d81e | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/test_client/tests.py | victorliun/django | 7def55c3f6716fcfa40a3bd5d0fbb2090588d81e | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Testing using the Test Client
The test client is a class that can act like a simple
browser for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
... | 41.139949 | 111 | 0.670708 |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core import mail
from django.http import HttpResponse
from django.test import (
Client, RequestFactory, SimpleTestCase, TestCase, override_settings,
)
from django.urls import reverse_lazy
from .views import get_view, ... | true | true |
1c43a3e89071329a74cdf1180bec926813985501 | 14,688 | py | Python | Scripts/rum.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | Scripts/rum.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | Scripts/rum.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null |
# coding: utf-8
# In[14]:
import numpy as np
import matplotlib.pyplot as plt
# get_ipython().run_line_magic('matplotlib', 'inline')
import psyneulink as pnl
# In[15]:
import psyneulink.core.components.functions.transferfunctions
nouns=['oak','pine','rose','daisy','canary','robin','salmon','sunfish']
relations=['... | 33.688073 | 470 | 0.540782 |
import numpy as np
import matplotlib.pyplot as plt
import psyneulink as pnl
import psyneulink.core.components.functions.transferfunctions
nouns=['oak','pine','rose','daisy','canary','robin','salmon','sunfish']
relations=['is','has','can']
is_list=['living','living thing','plant','animal','tree','flower','bir... | true | true |
1c43a4beccd3e3b8b93f9f00909ebd701fcc7ae1 | 1,898 | py | Python | PiBlynk-py/14-terminals.py | BLavery/PyBlynk | 96e0d5c42fa1f5eed91d41890856f065ed8b607a | [
"MIT"
] | 12 | 2017-09-08T12:26:48.000Z | 2020-09-18T03:30:36.000Z | PiBlynk-py/14-terminals.py | BLavery/PyBlynk | 96e0d5c42fa1f5eed91d41890856f065ed8b607a | [
"MIT"
] | 1 | 2018-01-21T19:07:49.000Z | 2021-03-04T17:28:57.000Z | PiBlynk-py/14-terminals.py | BLavery/PyBlynk | 96e0d5c42fa1f5eed91d41890856f065ed8b607a | [
"MIT"
] | 7 | 2018-02-13T21:54:46.000Z | 2020-09-18T03:30:39.000Z |
import os
from PiBlynk import Blynk
from mytoken import *
blynk = Blynk(token)
#------------------------------------------
import time
def timeNow():
return time.asctime()[11:19]
#------------------------------------
# terminal from APP into python interpreter
_last_cmd = ""
def pyterminal_h(value, pin, st):
... | 25.648649 | 82 | 0.557956 |
import os
from PiBlynk import Blynk
from mytoken import *
blynk = Blynk(token)
import time
def timeNow():
return time.asctime()[11:19]
_last_cmd = ""
def pyterminal_h(value, pin, st):
global _last_cmd
cmd = value[0]
if cmd == ".":
cmd = _last_cmd
blynk.virtua... | true | true |
1c43a4ff50f9df182226287026667f6a1751ef12 | 6,391 | py | Python | codes/data/__init__.py | DamianoGiani/EGVSRprova | 2cae74436f2bf864f061d63eadae079a328ed9ed | [
"MIT"
] | null | null | null | codes/data/__init__.py | DamianoGiani/EGVSRprova | 2cae74436f2bf864f061d63eadae079a328ed9ed | [
"MIT"
] | null | null | null | codes/data/__init__.py | DamianoGiani/EGVSRprova | 2cae74436f2bf864f061d63eadae079a328ed9ed | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from .paired_lmdb_dataset import PairedLMDBDataset
from .unpaired_lmdb_dataset import UnpairedLMDBDataset
from .paired_folder_dataset import PairedFolderDataset
from .mypaired_folder_dataset import MyPairedFolderDataset
def create_da... | 35.904494 | 81 | 0.581756 | import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from .paired_lmdb_dataset import PairedLMDBDataset
from .unpaired_lmdb_dataset import UnpairedLMDBDataset
from .paired_folder_dataset import PairedFolderDataset
from .mypaired_folder_dataset import MyPairedFolderDataset
def create_da... | true | true |
1c43a5d43acef9b7daa27745b07cce0f336cf9ba | 200 | py | Python | src/server/app/endpoints/thankyou/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/thankyou/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/thankyou/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, Blueprint
thankyou = Blueprint("thankyou", __name__)
@thankyou.route('/', methods=["GET"])
def index():
return render_template('/thankyou/index.html')
| 22.222222 | 51 | 0.73 | from flask import Flask, render_template, Blueprint
thankyou = Blueprint("thankyou", __name__)
@thankyou.route('/', methods=["GET"])
def index():
return render_template('/thankyou/index.html')
| true | true |
1c43a6a7f69248cf21e59f6dbe57ecc16dc04e09 | 1,335 | py | Python | WebBrickLibs/MiscLib/tests/TestCombinators.py | AndyThirtover/wb_gateway | 69f9c870369085f4440033201e2fb263a463a523 | [
"BSD-3-Clause"
] | null | null | null | WebBrickLibs/MiscLib/tests/TestCombinators.py | AndyThirtover/wb_gateway | 69f9c870369085f4440033201e2fb263a463a523 | [
"BSD-3-Clause"
] | null | null | null | WebBrickLibs/MiscLib/tests/TestCombinators.py | AndyThirtover/wb_gateway | 69f9c870369085f4440033201e2fb263a463a523 | [
"BSD-3-Clause"
] | null | null | null | # Copyright L.P.Klyne 2013
# Licenced under 3 clause BSD licence
# $Id: TestCombinators.py 2612 2008-08-11 20:08:49Z graham.klyne $
#
# Unit testing for WebBrick library combinators
# See http://pyunit.sourceforge.net/pyunit.html
#
import sys
import unittest
sys.path.append("../..")
from MiscLib.Combinators import... | 24.272727 | 68 | 0.632959 |
import sys
import unittest
sys.path.append("../..")
from MiscLib.Combinators import *
class TestCombinators(unittest.TestCase):
def setUp(self):
return
def tearDown(self):
return
def testApply(self):
def ap(f,v): return f(v)
def inc(n): return n+1... | true | true |
1c43a6c922911852492067e97959f186a004ec8b | 641 | py | Python | setup.py | Deekshith1994/Recipes | 5dfc98b249f6caf90571c037eb35560417b6818e | [
"Apache-2.0"
] | 591 | 2016-04-27T15:34:28.000Z | 2019-02-28T21:28:15.000Z | setup.py | Deekshith1994/Recipes | 5dfc98b249f6caf90571c037eb35560417b6818e | [
"Apache-2.0"
] | 11 | 2016-05-24T17:09:16.000Z | 2018-10-17T10:02:10.000Z | setup.py | Deekshith1994/Recipes | 5dfc98b249f6caf90571c037eb35560417b6818e | [
"Apache-2.0"
] | 120 | 2016-04-27T20:50:42.000Z | 2019-02-25T03:48:31.000Z | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
import ingredient_phrase_tagger
requires, extra = ['Unidecode==0.04.14', 'pandas==0.17.1'], {}
if sys.version_info >= (3,):
extra['use_2to3'] = True
setup(
name='ingredient_phrase_tagger',
version='0.0.0.dev0',
description... | 25.64 | 98 | 0.711388 |
import sys
from setuptools import setup, find_packages
import ingredient_phrase_tagger
requires, extra = ['Unidecode==0.04.14', 'pandas==0.17.1'], {}
if sys.version_info >= (3,):
extra['use_2to3'] = True
setup(
name='ingredient_phrase_tagger',
version='0.0.0.dev0',
description='Extract structured ... | true | true |
1c43a9a5a12f07ef89a7cb5e84279cee5f3d98be | 8,831 | py | Python | pyscf/grad/casscf.py | highlight0112/pyscf | 4afbd42bad3e72db5bb94d8cacf1d5de76537bdd | [
"Apache-2.0"
] | null | null | null | pyscf/grad/casscf.py | highlight0112/pyscf | 4afbd42bad3e72db5bb94d8cacf1d5de76537bdd | [
"Apache-2.0"
] | null | null | null | pyscf/grad/casscf.py | highlight0112/pyscf | 4afbd42bad3e72db5bb94d8cacf1d5de76537bdd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 34.767717 | 89 | 0.611143 |
import time
from functools import reduce
import numpy
from pyscf import lib
from pyscf import ao2mo
from pyscf.lib import logger
from pyscf.grad import rhf as rhf_grad
from pyscf.grad.mp2 import _shell_prange
def kernel(mc, mo_coeff=None, ci=None, atmlst=None, mf_grad=None,
verbose=None)... | true | true |
1c43a9d34a103b5ab69d0cfba4759484f8792ead | 3,080 | py | Python | deprecated/Friedman.py | Klettgau/CSC-332 | cf0563d1230cac124ed2146ab2e211a15f216c23 | [
"MIT"
] | null | null | null | deprecated/Friedman.py | Klettgau/CSC-332 | cf0563d1230cac124ed2146ab2e211a15f216c23 | [
"MIT"
] | null | null | null | deprecated/Friedman.py | Klettgau/CSC-332 | cf0563d1230cac124ed2146ab2e211a15f216c23 | [
"MIT"
] | null | null | null | import argparse
import ciphers.Affine as aff
import deprecated.CustomParser as CustomParser
import ciphers.Engima as Engima
import ciphers.Jefferson as jeff
import ciphers.Julius as jul
import ciphers.Vigenere as vig
# this is was the original cli for the project.
#Deprecated
def main():
grandfather = CustomPa... | 44 | 102 | 0.647727 | import argparse
import ciphers.Affine as aff
import deprecated.CustomParser as CustomParser
import ciphers.Engima as Engima
import ciphers.Jefferson as jeff
import ciphers.Julius as jul
import ciphers.Vigenere as vig
def main():
grandfather = CustomParser.Parsely()
parser = argparse.ArgumentParser(descrip... | true | true |
1c43a9e8e3e044bdac8baa2d76c080754533826a | 575 | py | Python | month1/day12/demo08.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | 1 | 2021-02-02T02:17:37.000Z | 2021-02-02T02:17:37.000Z | month1/day12/demo08.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | month1/day12/demo08.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | """
需求:老张开车去东北
变化:飞机/轮船/骑车....
思想:
封装:将需求分解为多个类
人类 汽车 飞机 轮船 自行车 ...
继承:
多态:
"""
class Person:
def __init__(self, name=""):
self.name = name
def drive(self, pos, vehicle):
print("去", pos)
vehicle.transport()
class Vehicle:
def t... | 16.428571 | 38 | 0.514783 | class Person:
def __init__(self, name=""):
self.name = name
def drive(self, pos, vehicle):
print("去", pos)
vehicle.transport()
class Vehicle:
def transport(self):
pass
class Car(Vehicle):
def transport(self):
print("行驶")
class Airplane(Vehicle):
def t... | true | true |
1c43a9f90f338a12da6807ed168ec5a7c59bd252 | 12,522 | py | Python | dev_tool/__main__.py | ShenTengTu/mpy-dev-tool | b70c789ed743eb5089ec5b2b6f90e107bced152d | [
"MIT"
] | null | null | null | dev_tool/__main__.py | ShenTengTu/mpy-dev-tool | b70c789ed743eb5089ec5b2b6f90e107bced152d | [
"MIT"
] | null | null | null | dev_tool/__main__.py | ShenTengTu/mpy-dev-tool | b70c789ed743eb5089ec5b2b6f90e107bced152d | [
"MIT"
] | null | null | null | from argparse import _SubParsersAction, Namespace
import shutil
from os import linesep
from . import (
realpath_join,
os_cwd,
os_walk_hash,
path_exists,
path_basename,
HERE,
DIST_DIR,
SUBMODULES_DIR,
EXT_LIB_DIR,
PYPROJECT_TOML,
)
from .toml_op import write_toml, read_toml
from .... | 32.866142 | 93 | 0.639435 | from argparse import _SubParsersAction, Namespace
import shutil
from os import linesep
from . import (
realpath_join,
os_cwd,
os_walk_hash,
path_exists,
path_basename,
HERE,
DIST_DIR,
SUBMODULES_DIR,
EXT_LIB_DIR,
PYPROJECT_TOML,
)
from .toml_op import write_toml, read_toml
from .... | true | true |
1c43aa654c855e80acf368da55cae7fcc0829d48 | 4,181 | py | Python | Tests/compat/sbs_newtype.py | dsonbill/IronPython3-NETCore | 8c76bdbec1754233f04b41ecd28e9bae2c862fd0 | [
"Apache-2.0"
] | 2 | 2019-09-21T22:22:30.000Z | 2020-05-09T12:45:51.000Z | Tests/compat/sbs_newtype.py | dsonbill/IronPython3-NETCore | 8c76bdbec1754233f04b41ecd28e9bae2c862fd0 | [
"Apache-2.0"
] | null | null | null | Tests/compat/sbs_newtype.py | dsonbill/IronPython3-NETCore | 8c76bdbec1754233f04b41ecd28e9bae2c862fd0 | [
"Apache-2.0"
] | null | null | null | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | 31.916031 | 97 | 0.526429 | true | true | |
1c43ab87ff3684e20b68bd114c2a295f62a3a3f9 | 17,256 | py | Python | scripts/run_e2e_tests.py | tjinjoy/oppia | ed5ccbd95e42078457d40dde1dda02f1ae6a4354 | [
"Apache-2.0"
] | null | null | null | scripts/run_e2e_tests.py | tjinjoy/oppia | ed5ccbd95e42078457d40dde1dda02f1ae6a4354 | [
"Apache-2.0"
] | null | null | null | scripts/run_e2e_tests.py | tjinjoy/oppia | ed5ccbd95e42078457d40dde1dda02f1ae6a4354 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Oppia 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 applicable ... | 36.252101 | 128 | 0.708391 |
from __future__ import absolute_import
from __future__ import unicode_literals
import argparse
import atexit
import contextlib
import os
import re
import subprocess
import sys
import time
import python_utils
from scripts import build
from scripts import common
from scripts import install_chrome_on_... | true | true |
1c43ac745ef32675e0e5e8a38ff7ea9b049dc90b | 1,380 | py | Python | Leetcode/133.clone-graph.py | EdwaRen/Competitve-Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | 1 | 2021-05-03T21:48:25.000Z | 2021-05-03T21:48:25.000Z | Leetcode/133.clone-graph.py | EdwaRen/Competitve_Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | null | null | null | Leetcode/133.clone-graph.py | EdwaRen/Competitve_Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | null | null | null | """
# Definition for a Node.
"""
class Node(object):
def __init__(self, val, neighbors):
self.val = val
self.neighbors = neighbors
class Solution(object):
def cloneGraph(self, node):
"""
:type node: Node
:rtype: Node
"""
# Dict mapping new -> old
... | 19.714286 | 61 | 0.51087 | class Node(object):
def __init__(self, val, neighbors):
self.val = val
self.neighbors = neighbors
class Solution(object):
def cloneGraph(self, node):
self.dp = {}
stack = [node]
def recurse(orig_node):
if orig_node in self.dp:
retu... | true | true |
1c43aca44aa17aca4a5165de11dd1d2b40cbee2e | 199 | py | Python | concorde/shaman/__main__.py | frutiger/concorde | 9f5a763bdaf2b8e48636193db39b7fde8209156c | [
"Unlicense"
] | 2 | 2016-03-09T03:54:19.000Z | 2016-04-14T09:37:01.000Z | concorde/shaman/__main__.py | frutiger/concorde | 9f5a763bdaf2b8e48636193db39b7fde8209156c | [
"Unlicense"
] | 1 | 2016-02-28T23:43:14.000Z | 2016-02-28T23:43:14.000Z | concorde/shaman/__main__.py | frutiger/concorde | 9f5a763bdaf2b8e48636193db39b7fde8209156c | [
"Unlicense"
] | 1 | 2016-02-28T23:25:19.000Z | 2016-02-28T23:25:19.000Z | # shaman.__main__
import os
import sys
from .profile import Profile
def main():
if len(sys.argv) > 1:
os.chdir(sys.argv[1])
Profile().run()
if __name__ == '__main__':
main()
| 12.4375 | 29 | 0.613065 |
import os
import sys
from .profile import Profile
def main():
if len(sys.argv) > 1:
os.chdir(sys.argv[1])
Profile().run()
if __name__ == '__main__':
main()
| true | true |
1c43ad00ec84d35d26a4cd91af1b711ebf5f6585 | 379 | py | Python | graphene_django_cud/tests/migrations/0006_dog_bark_count.py | rymanso/graphene-django-cud | 43bdc972700012304ddc0c3fb022a1ec7fbb7c31 | [
"MIT"
] | 66 | 2019-09-10T09:35:15.000Z | 2022-03-09T15:29:49.000Z | graphene_django_cud/tests/migrations/0006_dog_bark_count.py | rymanso/graphene-django-cud | 43bdc972700012304ddc0c3fb022a1ec7fbb7c31 | [
"MIT"
] | 61 | 2019-09-24T08:43:18.000Z | 2022-03-31T05:51:41.000Z | graphene_django_cud/tests/migrations/0006_dog_bark_count.py | rymanso/graphene-django-cud | 43bdc972700012304ddc0c3fb022a1ec7fbb7c31 | [
"MIT"
] | 27 | 2019-11-13T12:18:56.000Z | 2022-02-16T20:49:12.000Z | # Generated by Django 2.2.6 on 2021-01-02 02:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tests', '0005_dogregistration'),
]
operations = [
migrations.AddField(
model_name='dog',
name='bark_count',
... | 19.947368 | 49 | 0.591029 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tests', '0005_dogregistration'),
]
operations = [
migrations.AddField(
model_name='dog',
name='bark_count',
field=models.IntegerField(default=0),
... | true | true |
1c43adc8107f6755957a1f0868d44f529924a4cc | 1,202 | py | Python | recurring_content_detector/video_functions.py | lcd1232/recurring-content-detector | 31e502e16b0d9870a6e3e4eb3bfe93d058cd01b0 | [
"MIT"
] | 46 | 2019-06-12T10:43:47.000Z | 2022-03-15T12:17:13.000Z | recurring_content_detector/video_functions.py | lcd1232/recurring-content-detector | 31e502e16b0d9870a6e3e4eb3bfe93d058cd01b0 | [
"MIT"
] | 19 | 2020-01-20T09:26:39.000Z | 2021-12-10T13:16:08.000Z | recurring_content_detector/video_functions.py | lcd1232/recurring-content-detector | 31e502e16b0d9870a6e3e4eb3bfe93d058cd01b0 | [
"MIT"
] | 14 | 2020-01-05T21:04:28.000Z | 2022-02-21T08:51:04.000Z | import cv2
import ffmpeg
import mimetypes
def file_is_video(video_fn):
"""
Checks if the given file path actually is a video file
"""
file_type = mimetypes.guess_type(video_fn)[0]
return file_type is not None and file_type.startswith("video")
def get_framerate(video_fn):
"""
Return the vi... | 30.820513 | 92 | 0.642263 | import cv2
import ffmpeg
import mimetypes
def file_is_video(video_fn):
file_type = mimetypes.guess_type(video_fn)[0]
return file_type is not None and file_type.startswith("video")
def get_framerate(video_fn):
video = cv2.VideoCapture(video_fn)
return video.get(cv2.CAP_PROP_FPS)
def resize(input, out... | true | true |
1c43adc9316e975e0e744796c75493658c598e86 | 2,021 | py | Python | tests/example_data/data_loading/pandas/pands_data_loading_conf.py | delorenzosoftware/superset | 5403f1ec163a52623f34f459d89f20e4e190371d | [
"Apache-2.0"
] | 2 | 2021-12-21T15:57:16.000Z | 2022-01-31T02:22:02.000Z | tests/example_data/data_loading/pandas/pands_data_loading_conf.py | changeiot/superset | 299b5dc64448d04abe6b35ee85fbd2b938c781bc | [
"Apache-2.0"
] | 19 | 2022-01-29T03:16:22.000Z | 2022-03-25T23:50:16.000Z | tests/example_data/data_loading/pandas/pands_data_loading_conf.py | changeiot/superset | 299b5dc64448d04abe6b35ee85fbd2b938c781bc | [
"Apache-2.0"
] | 2 | 2021-12-21T13:41:18.000Z | 2021-12-26T22:16:43.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 31.092308 | 81 | 0.688768 |
from __future__ import annotations
from typing import Any, Dict
default_pandas_data_loader_config = {
"if_exists": "replace",
"chunksize": 500,
"index": False,
"method": "multi",
"strftime": "%Y-%m-%d %H:%M:%S",
"support_datetime_type": False,
}
class PandasLoaderConfiguratio... | true | true |
1c43aee86a6f74f2a929505d9eafea8c529c9914 | 14,477 | py | Python | monty/functools.py | JosephMontoya-TRI/monty | facef1776c7d05c941191a32a0b93f986a9761dd | [
"MIT"
] | null | null | null | monty/functools.py | JosephMontoya-TRI/monty | facef1776c7d05c941191a32a0b93f986a9761dd | [
"MIT"
] | null | null | null | monty/functools.py | JosephMontoya-TRI/monty | facef1776c7d05c941191a32a0b93f986a9761dd | [
"MIT"
] | null | null | null | """
functools, especially backported from Python 3.
"""
from __future__ import absolute_import
__author__ = 'Shyue Ping Ong'
__copyright__ = 'Copyright 2013, The Materials Virtual Lab'
__version__ = '0.1'
__maintainer__ = 'Shyue Ping Ong'
__email__ = 'ongsp@ucsd.edu'
__date__ = '8/29/14'
from collections import nam... | 33.745921 | 80 | 0.570629 |
from __future__ import absolute_import
__author__ = 'Shyue Ping Ong'
__copyright__ = 'Copyright 2013, The Materials Virtual Lab'
__version__ = '0.1'
__maintainer__ = 'Shyue Ping Ong'
__email__ = 'ongsp@ucsd.edu'
__date__ = '8/29/14'
from collections import namedtuple
from functools import update_wrapper, wraps, par... | true | true |
1c43aefb40b6a4733937ffe25a9ac6453faae8b7 | 20,502 | py | Python | vnpy/database/mongodb/mongodb_database.py | NovelResearchInvestment/vnpy | 27e1b053a478e26416d7ce2867fa99e8cb7ee659 | [
"MIT"
] | null | null | null | vnpy/database/mongodb/mongodb_database.py | NovelResearchInvestment/vnpy | 27e1b053a478e26416d7ce2867fa99e8cb7ee659 | [
"MIT"
] | null | null | null | vnpy/database/mongodb/mongodb_database.py | NovelResearchInvestment/vnpy | 27e1b053a478e26416d7ce2867fa99e8cb7ee659 | [
"MIT"
] | null | null | null | """"""
from datetime import datetime
from typing import List
from mongoengine import (
Document,
DateTimeField,
FloatField,
StringField,
IntField,
connect,
QuerySet
)
from mongoengine.errors import DoesNotExist
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object imp... | 28.835443 | 97 | 0.544776 | from datetime import datetime
from typing import List
from mongoengine import (
Document,
DateTimeField,
FloatField,
StringField,
IntField,
connect,
QuerySet
)
from mongoengine.errors import DoesNotExist
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object import Bar... | true | true |
1c43af03e0a527463944610ebbf54b54b44af576 | 1,101 | py | Python | setup.py | lrgr/explosig-data | 9fd11e5252e3fb112dc7a3e55cb7b40d8b8d5efb | [
"MIT"
] | 1 | 2020-01-30T17:55:03.000Z | 2020-01-30T17:55:03.000Z | setup.py | keller-mark/explosig-data | 9fd11e5252e3fb112dc7a3e55cb7b40d8b8d5efb | [
"MIT"
] | 1 | 2020-02-20T15:03:54.000Z | 2020-02-20T23:44:14.000Z | setup.py | keller-mark/explosig-data | 9fd11e5252e3fb112dc7a3e55cb7b40d8b8d5efb | [
"MIT"
] | 1 | 2020-01-12T14:17:20.000Z | 2020-01-12T14:17:20.000Z | import os
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="explosig-data",
version="0.0.5",
author="Leiserson Research Group",
description="Process mutation data into standard formats originally developed for the ExploSig family of tools",
... | 28.973684 | 116 | 0.60218 | import os
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="explosig-data",
version="0.0.5",
author="Leiserson Research Group",
description="Process mutation data into standard formats originally developed for the ExploSig family of tools",
... | true | true |
1c43af043c358960ef291435ccf748377f5039a2 | 914 | py | Python | tf_autoaugment/transforms/color.py | sebastian-sz/tf-autoaugment | 6807f5095df1b842a8a17265dc2361165f5d1658 | [
"MIT"
] | null | null | null | tf_autoaugment/transforms/color.py | sebastian-sz/tf-autoaugment | 6807f5095df1b842a8a17265dc2361165f5d1658 | [
"MIT"
] | null | null | null | tf_autoaugment/transforms/color.py | sebastian-sz/tf-autoaugment | 6807f5095df1b842a8a17265dc2361165f5d1658 | [
"MIT"
] | null | null | null | """Code for Color transform."""
import tensorflow as tf
from tf_autoaugment.image_utils import blend_batch
from tf_autoaugment.transforms.base_transform import BaseTransform
class Color(BaseTransform):
"""Implements Color Transform."""
def __call__(self, images: tf.Tensor, level: tf.Tensor) -> tf.Tensor:
... | 36.56 | 81 | 0.695842 | import tensorflow as tf
from tf_autoaugment.image_utils import blend_batch
from tf_autoaugment.transforms.base_transform import BaseTransform
class Color(BaseTransform):
def __call__(self, images: tf.Tensor, level: tf.Tensor) -> tf.Tensor:
factor = self._parse_level(level)
return self.color(imag... | true | true |
1c43af4eb0282ba7f121ee3ea1d70ccdbd2d1c04 | 346 | py | Python | Exercise_10_4.py | kushrami/Python-Crash-Course-book-Excersice | 7093181940a90d9f4bab5775ef56f57963450393 | [
"Apache-2.0"
] | null | null | null | Exercise_10_4.py | kushrami/Python-Crash-Course-book-Excersice | 7093181940a90d9f4bab5775ef56f57963450393 | [
"Apache-2.0"
] | null | null | null | Exercise_10_4.py | kushrami/Python-Crash-Course-book-Excersice | 7093181940a90d9f4bab5775ef56f57963450393 | [
"Apache-2.0"
] | null | null | null | #Guest Book:
while True:
User_name = input("Please enter your name or enter 'q' to exit:")
if User_name == 'q':
break
else:
with open('guest_book.txt','a') as file_object:
file_object.write(User_name)
file_object.write('\n')
print("You can check your name in ... | 28.833333 | 69 | 0.595376 |
while True:
User_name = input("Please enter your name or enter 'q' to exit:")
if User_name == 'q':
break
else:
with open('guest_book.txt','a') as file_object:
file_object.write(User_name)
file_object.write('\n')
print("You can check your name in file guest_b... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.