hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71fd916fcc0b6fd5407ff0c3b8ac492320273d7 | 26,028 | py | Python | tf_rl_tutorial/models.py | 4k4xs4pH1r3/tf_rl_tutorial | c58d10c60cfd79b2e0661b4a49cccae8d4584c57 | [
"Apache-2.0"
] | 40 | 2016-03-09T03:03:08.000Z | 2021-09-11T21:44:12.000Z | tf_rl_tutorial/models.py | 4k4xs4pH1r3/tf_rl_tutorial | c58d10c60cfd79b2e0661b4a49cccae8d4584c57 | [
"Apache-2.0"
] | 1 | 2018-05-08T13:45:43.000Z | 2018-05-08T13:45:43.000Z | tf_rl_tutorial/models.py | 4k4xs4pH1r3/tf_rl_tutorial | c58d10c60cfd79b2e0661b4a49cccae8d4584c57 | [
"Apache-2.0"
] | 17 | 2016-03-17T14:57:11.000Z | 2021-06-04T16:24:48.000Z | # Copyright 2016 Mandiant, A FireEye Company
# Authors: Brian Jones
# License: Apache 2.0
''' Model classes for "Relational Learning with TensorFlow" tutorial '''
import numpy as np
import tensorflow as tf
from .util import ContrastiveTrainingProvider
def least_squares_objective(output, target, add_bias=True):
... | 47.67033 | 96 | 0.643807 |
import numpy as np
import tensorflow as tf
from .util import ContrastiveTrainingProvider
def least_squares_objective(output, target, add_bias=True):
y = output
if add_bias:
bias = tf.Variable([0.0])
y = output + bias
loss = tf.reduce_sum(tf.square(y - target))
return y, loss
de... | true | true |
f71fd969d3ac6dc91ff8442595549e245b3a9430 | 1,059 | py | Python | salvia/wallet/payment.py | Salvia-Network/salvia-blockchain | b0ce4b9f75c2fc354941b45eb468ffcf917ead30 | [
"Apache-2.0"
] | 6 | 2021-09-13T17:20:49.000Z | 2022-02-09T04:31:47.000Z | salvia/wallet/payment.py | Salvia-Network/salvia-blockchain | b0ce4b9f75c2fc354941b45eb468ffcf917ead30 | [
"Apache-2.0"
] | 21 | 2021-09-20T00:56:54.000Z | 2022-03-22T01:12:12.000Z | salvia/wallet/payment.py | Salvia-Network/salvia-blockchain | b0ce4b9f75c2fc354941b45eb468ffcf917ead30 | [
"Apache-2.0"
] | 9 | 2021-09-13T17:54:04.000Z | 2022-03-15T08:38:35.000Z | from dataclasses import dataclass
from typing import List
from salvia.types.blockchain_format.sized_bytes import bytes32
from salvia.types.blockchain_format.program import Program
from salvia.util.ints import uint64
# This class is supposed to correspond to a CREATE_COIN condition
@dataclass(frozen=True)
class Paym... | 31.147059 | 86 | 0.705382 | from dataclasses import dataclass
from typing import List
from salvia.types.blockchain_format.sized_bytes import bytes32
from salvia.types.blockchain_format.program import Program
from salvia.util.ints import uint64
@dataclass(frozen=True)
class Payment:
puzzle_hash: bytes32
amount: uint64
memos: List[... | true | true |
f71fd999a54a3748a94533f9d632879d0495dbcd | 1,271 | py | Python | checklink/parse/__init__.py | zombie110year/find_dead_link | 565ec99c0fcbecaa4f7d82006bc9d58d0c05fa06 | [
"MIT"
] | null | null | null | checklink/parse/__init__.py | zombie110year/find_dead_link | 565ec99c0fcbecaa4f7d82006bc9d58d0c05fa06 | [
"MIT"
] | null | null | null | checklink/parse/__init__.py | zombie110year/find_dead_link | 565ec99c0fcbecaa4f7d82006bc9d58d0c05fa06 | [
"MIT"
] | null | null | null | """
Text Parsers to find url from content.
Every url item should contain:
- url
- location(`filepath:row:column`)
"""
from abc import abstractmethod
from typing import List
class Link:
def __init__(self, url: str, path: str, row: int, column: int):
"""init link object
:param str url: link's hre... | 21.183333 | 76 | 0.601888 | from abc import abstractmethod
from typing import List
class Link:
def __init__(self, url: str, path: str, row: int, column: int):
self.__url = url
self.__path = path
self.__row = row
self.__column = column
@property
def url(self) -> str:
return self.__url
@pr... | true | true |
f71fd9b490090c7c03e0f828032d2a989edaca88 | 3,415 | py | Python | components/studio/projects/models.py | MuhammadNaumanAbid/stackn | 484501efda19f8f9c9c088bcf6095060c925d3b1 | [
"Apache-2.0"
] | null | null | null | components/studio/projects/models.py | MuhammadNaumanAbid/stackn | 484501efda19f8f9c9c088bcf6095060c925d3b1 | [
"Apache-2.0"
] | null | null | null | components/studio/projects/models.py | MuhammadNaumanAbid/stackn | 484501efda19f8f9c9c088bcf6095060c925d3b1 | [
"Apache-2.0"
] | null | null | null | import base64
from django.db import models
from django.contrib.auth.models import User
from django.utils.text import slugify
import string
import random
DEFAULT_ENVIRONMENT_ID = 1
class Flavor(models.Model):
name = models.CharField(max_length=512)
slug = models.CharField(max_length=512)
cpu = models.Te... | 34.846939 | 120 | 0.703075 | import base64
from django.db import models
from django.contrib.auth.models import User
from django.utils.text import slugify
import string
import random
DEFAULT_ENVIRONMENT_ID = 1
class Flavor(models.Model):
name = models.CharField(max_length=512)
slug = models.CharField(max_length=512)
cpu = models.Te... | true | true |
f71fdbd179d815f56f9c409701685cd66a7005c3 | 23,154 | py | Python | yuu/ext/abematv.py | soltia48/yuu | 30d2fcf9427cbbea930d01baef337b64ad7fb05b | [
"BSD-3-Clause"
] | null | null | null | yuu/ext/abematv.py | soltia48/yuu | 30d2fcf9427cbbea930d01baef337b64ad7fb05b | [
"BSD-3-Clause"
] | null | null | null | yuu/ext/abematv.py | soltia48/yuu | 30d2fcf9427cbbea930d01baef337b64ad7fb05b | [
"BSD-3-Clause"
] | null | null | null | import hashlib
import hmac
import json
import logging
import os
import re
import struct
import tempfile
import time
import uuid
from base64 import urlsafe_b64encode
from binascii import unhexlify
import m3u8
from Crypto.Cipher import AES
from tqdm import tqdm
def is_channel(url):
url = re.findall('(slot)', url)
... | 38.914286 | 170 | 0.556319 | import hashlib
import hmac
import json
import logging
import os
import re
import struct
import tempfile
import time
import uuid
from base64 import urlsafe_b64encode
from binascii import unhexlify
import m3u8
from Crypto.Cipher import AES
from tqdm import tqdm
def is_channel(url):
url = re.findall('(slot)', url)
... | true | true |
f71fde1bd02fcc1f714d372b9d638e5ed8bbe7be | 4,468 | py | Python | data_steward/cdr_cleaner/cleaning_rules/deid/dateshift.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 16 | 2017-06-30T20:05:05.000Z | 2022-03-08T21:03:19.000Z | data_steward/cdr_cleaner/cleaning_rules/deid/dateshift.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 342 | 2017-06-23T21:37:40.000Z | 2022-03-30T16:44:16.000Z | data_steward/cdr_cleaner/cleaning_rules/deid/dateshift.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 33 | 2017-07-01T00:12:20.000Z | 2022-01-26T18:06:53.000Z | """
The basic date shifting rule..
Original Issue: DC-1005
This is an abstract class and cannot be directly instantiated. It must be
extended to be used.
"""
# Python Imports
import logging
from abc import abstractmethod
# Project imports
from cdr_cleaner.cleaning_rules.base_cleaning_rule import BaseCleaningRule
fr... | 34.90625 | 78 | 0.576321 |
import logging
from abc import abstractmethod
from cdr_cleaner.cleaning_rules.base_cleaning_rule import BaseCleaningRule
from common import JINJA_ENV
LOGGER = logging.getLogger(__name__)
SHIFT_EXP = JINJA_ENV.from_string("""
{{field_type}}_SUB( CAST({{field}} AS {{field_type}}), INTERVAL (
SELECT
shift... | true | true |
f71fde73faca108579365cdbb13033f096a89b4b | 37,146 | py | Python | conf_selection_and_DFT/PL_dft_library_201027.py | aspuru-guzik-group/kraken | 4eaad505c1343e6083032b4a3fda47e004e19734 | [
"MIT"
] | 3 | 2022-01-13T12:39:54.000Z | 2022-03-30T00:10:52.000Z | conf_selection_and_DFT/PL_dft_library_201027.py | aspuru-guzik-group/kraken | 4eaad505c1343e6083032b4a3fda47e004e19734 | [
"MIT"
] | null | null | null | conf_selection_and_DFT/PL_dft_library_201027.py | aspuru-guzik-group/kraken | 4eaad505c1343e6083032b4a3fda47e004e19734 | [
"MIT"
] | null | null | null | # 201005: rename/restructure .yml files for consistency with xtb-level data
# 201006: in read_conformer() fix error message when log files are missing
import os,re,itertools,time
#import pybel
#from openbabel import pybel
import numpy as np
import pandas as pd
import pathlib as pl
cwd = pl.Path.cwd()
import... | 57.324074 | 1,343 | 0.619959 |
import os,re,itertools,time
import numpy as np
import pandas as pd
import pathlib as pl
cwd = pl.Path.cwd()
import yaml
from yaml import CLoader as Loader
from yaml import CDumper as Dumper
from rdkit import Chem,Geometry
from rdkit.Chem import rdmolfiles, AllChem, rdMolAlign,rdmolops
from multiprocessi... | true | true |
f71fdf25a6bbbf3c2ecdf90eda58463aa369ca88 | 52,543 | py | Python | t5/seqio/dataset_providers.py | dptam/text-to-text-transfer-transformer | 3662823b126ebf39d9d8ed147a8af0c6973f0ba9 | [
"Apache-2.0"
] | null | null | null | t5/seqio/dataset_providers.py | dptam/text-to-text-transfer-transformer | 3662823b126ebf39d9d8ed147a8af0c6973f0ba9 | [
"Apache-2.0"
] | null | null | null | t5/seqio/dataset_providers.py | dptam/text-to-text-transfer-transformer | 3662823b126ebf39d9d8ed147a8af0c6973f0ba9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The T5 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 36.161734 | 107 | 0.671888 |
import abc
import collections
import inspect
import json
import os
import re
from typing import Any, Callable, Iterable, Mapping, MutableMapping, Optional, Sequence, Tuple, Type, Union
from absl import logging
import dataclasses
import numpy as np
from packaging import version
from t5.seqio import util... | true | true |
f71fdf38821c8803ae681fd71c4c71d7da8b1c90 | 2,037 | py | Python | airflow/migrations/versions/0090_30867afad44a_rename_concurrency_column_in_dag_table_.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 8,092 | 2016-04-27T20:32:29.000Z | 2019-01-05T07:39:33.000Z | airflow/migrations/versions/0090_30867afad44a_rename_concurrency_column_in_dag_table_.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 2,961 | 2016-05-05T07:16:16.000Z | 2019-01-05T08:47:59.000Z | airflow/migrations/versions/0090_30867afad44a_rename_concurrency_column_in_dag_table_.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 3,546 | 2016-05-04T20:33:16.000Z | 2019-01-05T05:14:26.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 31.338462 | 88 | 0.691703 |
import sqlalchemy as sa
from alembic import op
revision = '30867afad44a'
down_revision = 'e9304a3141f0'
branch_labels = None
depends_on = None
airflow_version = '2.2.0'
def upgrade():
conn = op.get_bind()
is_sqlite = bool(conn.dialect.name == "sqlite")
if is_sqlite:
op.execut... | true | true |
f71fdf687002e4d434788ab435b395447a70728b | 228 | py | Python | dstlib/node.py | Algebra7/dstlib | 3f891fb48c8c00caf89255c45a1b41f76331d252 | [
"MIT"
] | 1 | 2021-07-27T08:22:29.000Z | 2021-07-27T08:22:29.000Z | dstlib/node.py | Algebra7/dstlib | 3f891fb48c8c00caf89255c45a1b41f76331d252 | [
"MIT"
] | null | null | null | dstlib/node.py | Algebra7/dstlib | 3f891fb48c8c00caf89255c45a1b41f76331d252 | [
"MIT"
] | null | null | null | class Node:
"""Class for storing linked list node."""
def __init__(self, element, next_pointer, prev_pointer=None):
self._element = element
self._next = next_pointer
self._prev = prev_pointer | 32.571429 | 65 | 0.653509 | class Node:
def __init__(self, element, next_pointer, prev_pointer=None):
self._element = element
self._next = next_pointer
self._prev = prev_pointer | true | true |
f71fdf8b98012c19be34962342155bc04ff638eb | 25,034 | py | Python | garnets.py | seanth/garnets | 3ff37bcbf095df14586cccb39a52bcf7b221c8ee | [
"MIT"
] | 1 | 2022-02-25T14:32:34.000Z | 2022-02-25T14:32:34.000Z | garnets.py | seanth/garnets | 3ff37bcbf095df14586cccb39a52bcf7b221c8ee | [
"MIT"
] | null | null | null | garnets.py | seanth/garnets | 3ff37bcbf095df14586cccb39a52bcf7b221c8ee | [
"MIT"
] | 2 | 2020-09-02T17:18:33.000Z | 2022-02-25T14:32:48.000Z | import logging
import random
from math import sqrt, log
from stellar_system import Star
from stellar_system import Planetesimal
from stellar_system import Protoplanet
from stellar_system import Protomoon
from stellar_system import Planet
from stellar_system import Orbit
from accrete import CircumstellarDisk
from consta... | 40.247588 | 284 | 0.533874 | import logging
import random
from math import sqrt, log
from stellar_system import Star
from stellar_system import Planetesimal
from stellar_system import Protoplanet
from stellar_system import Protomoon
from stellar_system import Planet
from stellar_system import Orbit
from accrete import CircumstellarDisk
from consta... | true | true |
f71fe0dc7aac7d9afad4c1f08c6e9b94fde74e57 | 4,160 | py | Python | vivisect/extensions/example_gui_extension.py | bat-serjo/vivisect | f60934a2c8c51c7acdba52a65756e717a108a440 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vivisect/extensions/example_gui_extension.py | bat-serjo/vivisect | f60934a2c8c51c7acdba52a65756e717a108a440 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vivisect/extensions/example_gui_extension.py | bat-serjo/vivisect | f60934a2c8c51c7acdba52a65756e717a108a440 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | try:
from PyQt5.QtWidgets import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog
from PyQt5 import QtCore
except:
from PyQt4.QtGui import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog
from PyQt4 import QtCore
from vqt.main import idlethread
from vqt.basics import VBox
... | 31.755725 | 111 | 0.665625 | try:
from PyQt5.QtWidgets import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog
from PyQt5 import QtCore
except:
from PyQt4.QtGui import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog
from PyQt4 import QtCore
from vqt.main import idlethread
from vqt.basics import VBox
... | true | true |
f71fe1a680e38a876089f6c92424e564085015cd | 728 | py | Python | tests/test_bit.py | robertchase/aiomysql | 80236fca02c70cd693cb02112646ca14f2c7e2be | [
"MIT"
] | null | null | null | tests/test_bit.py | robertchase/aiomysql | 80236fca02c70cd693cb02112646ca14f2c7e2be | [
"MIT"
] | null | null | null | tests/test_bit.py | robertchase/aiomysql | 80236fca02c70cd693cb02112646ca14f2c7e2be | [
"MIT"
] | 1 | 2021-04-30T14:11:42.000Z | 2021-04-30T14:11:42.000Z | """test Bit operations"""
import pytest
from aiomysql.bit import Bit
@pytest.mark.parametrize(
'length, value, expected', (
(10, None, ValueError),
(10, 1, 1),
(10, '123', TypeError),
(10, '0', 0),
(10, '1', 1),
(10, '010', 2),
(10, '1010', 10),
(10... | 22.060606 | 43 | 0.54533 | import pytest
from aiomysql.bit import Bit
@pytest.mark.parametrize(
'length, value, expected', (
(10, None, ValueError),
(10, 1, 1),
(10, '123', TypeError),
(10, '0', 0),
(10, '1', 1),
(10, '010', 2),
(10, '1010', 10),
(10, '01000000000', ValueErro... | true | true |
f71fe27393e1a3a75142186240ffddd9c0d963a4 | 15,812 | py | Python | contrib/experimental/input/osx.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 15 | 2015-01-21T12:29:01.000Z | 2018-12-09T09:17:33.000Z | contrib/experimental/input/osx.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | null | null | null | contrib/experimental/input/osx.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 9 | 2015-12-12T09:12:46.000Z | 2021-12-26T13:29:14.000Z | #!/usr/bin/env python
"""
"""
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import ctypes
import pyglet
from pyglet.libs.darwin import carbon, _oscheck, create_cfstring
from pyglet.libs.darwin.constants import *
import input
import usage
# non-broken c_void_p
void_p = ctypes.POINTER(ctypes.c_int)
cl... | 34.982301 | 84 | 0.544397 |
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import ctypes
import pyglet
from pyglet.libs.darwin import carbon, _oscheck, create_cfstring
from pyglet.libs.darwin.constants import *
import input
import usage
void_p = ctypes.POINTER(ctypes.c_int)
class CFUUIDBytes(ctypes.Structure):
_fields_ = ... | true | true |
f71fe39b002b6987bd56fdc8f822aa4a1ab3f554 | 548 | py | Python | config_parser.py | benkelaci/qrcode_medicinedispenser | 41cee011dc0e9ab5d1ef0738efd5e1ea11c13d0a | [
"MIT"
] | null | null | null | config_parser.py | benkelaci/qrcode_medicinedispenser | 41cee011dc0e9ab5d1ef0738efd5e1ea11c13d0a | [
"MIT"
] | null | null | null | config_parser.py | benkelaci/qrcode_medicinedispenser | 41cee011dc0e9ab5d1ef0738efd5e1ea11c13d0a | [
"MIT"
] | null | null | null | import json
class Struct(object):
def __init__(self, data):
for name, value in data.items():
setattr(self, name, self._wrap(value))
def _wrap(self, value):
if isinstance(value, (tuple, list, set, frozenset)):
return type(value)([self._wrap(v) for v in value... | 27.4 | 71 | 0.616788 | import json
class Struct(object):
def __init__(self, data):
for name, value in data.items():
setattr(self, name, self._wrap(value))
def _wrap(self, value):
if isinstance(value, (tuple, list, set, frozenset)):
return type(value)([self._wrap(v) for v in value... | true | true |
f71fe39bd8323e42c4bdd0221f1966de94ab7729 | 904 | py | Python | examples/sawyer/moveit_planning.py | gujralsanyam22/pyrobot | a0448714857b684d8b280f710e9304988524d2e0 | [
"MIT"
] | 2,150 | 2019-06-12T20:55:41.000Z | 2022-03-21T07:14:51.000Z | examples/sawyer/moveit_planning.py | gujralsanyam22/pyrobot | a0448714857b684d8b280f710e9304988524d2e0 | [
"MIT"
] | 124 | 2019-06-22T17:12:27.000Z | 2022-02-26T11:43:13.000Z | examples/sawyer/moveit_planning.py | gujralsanyam22/pyrobot | a0448714857b684d8b280f710e9304988524d2e0 | [
"MIT"
] | 329 | 2019-06-13T03:03:54.000Z | 2022-03-30T07:04:55.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Example for commanding robot with position control using moveit planner
"""
import time
from pyrobot import Robot
def main():
targe... | 21.52381 | 71 | 0.622788 |
import time
from pyrobot import Robot
def main():
target_joints = [
[0.704, -0.455, -0.159, 1.395, -1.240, 1.069, 2.477],
[-0.341, -0.384, -0.018, 1.533, -0.977, -1.492, -1.084],
]
config = dict(moveit_planner_type="ESTkConfigDefault")
bot = Robot(
"sawyer",
use... | true | true |
f71fe3a7ec4b148032db722f5c53b2c067b9a249 | 1,863 | py | Python | random_colors.py | electric-blue-green/trinket | 82e1e265934252c0cf3b2fa72f9bc1d60a35ac93 | [
"Unlicense"
] | 1 | 2021-06-05T03:12:36.000Z | 2021-06-05T03:12:36.000Z | random_colors.py | aejb/trinket | 82e1e265934252c0cf3b2fa72f9bc1d60a35ac93 | [
"Unlicense"
] | 1 | 2018-02-26T11:22:50.000Z | 2018-02-26T11:22:50.000Z | random_colors.py | electric-blue-green/trinket | 82e1e265934252c0cf3b2fa72f9bc1d60a35ac93 | [
"Unlicense"
] | null | null | null | import board
import busio
import time
import random
dotstar = busio.SPI(board.APA102_SCK, board.APA102_MOSI)
#colors = [1, 128, 244] # set colors all to 1
colors = [random.randint(3, 240), random.randint(3, 240), random.randint(3, 240), ] # selects random start color in "safe zone"
steps = [1, 3, 4] # se... | 56.454545 | 131 | 0.574342 | import board
import busio
import time
import random
dotstar = busio.SPI(board.APA102_SCK, board.APA102_MOSI)
dint(3, 240), random.randint(3, 240), random.randint(3, 240), ]
steps = [1, 3, 4]
steps = [random.randint(1, 5), random.randint(1, 5), random.randint(1, 5)]
print("INIT") etColor(index,... | true | true |
f71fe485cdc1d845da328b9bf8355e5b4665fa3d | 393 | py | Python | project-euler/py/e6.py | aaycee/aaycee.github.io | b609a869c5c9d02f7cbc1798b643ec083475f741 | [
"MIT"
] | null | null | null | project-euler/py/e6.py | aaycee/aaycee.github.io | b609a869c5c9d02f7cbc1798b643ec083475f741 | [
"MIT"
] | null | null | null | project-euler/py/e6.py | aaycee/aaycee.github.io | b609a869c5c9d02f7cbc1798b643ec083475f741 | [
"MIT"
] | null | null | null | # Akachukwu Obi, 2018
# Project Euler #6
# see .js file for build up
def diffOfSumOfSquares(max):
sumOfNumbers = max * (max + 1) / 2 # sum of n natural numbers is n(n + 1)/2
sumOfSquares = (max / 6.0) * (2 * max + 1) * (max + 1) # I used 6.0 to avoid getting a math.floor situation in puthon2.7
return sumOfNumbers ... | 35.727273 | 121 | 0.689567 |
def diffOfSumOfSquares(max):
sumOfNumbers = max * (max + 1) / 2
sumOfSquares = (max / 6.0) * (2 * max + 1) * (max + 1)
return sumOfNumbers * sumOfNumbers - sumOfSquares
print(diffOfSumOfSquares(100)) | true | true |
f71fe4adf7dd0cb5bea1c0b3a038207a017240b9 | 250 | py | Python | experiments_approximate/experiments/create_dico_alphacsc.py | bmalezieux/unrolled_dl | 5854a6991e44db025a99a9f0d38be6b1e669aa83 | [
"MIT"
] | null | null | null | experiments_approximate/experiments/create_dico_alphacsc.py | bmalezieux/unrolled_dl | 5854a6991e44db025a99a9f0d38be6b1e669aa83 | [
"MIT"
] | null | null | null | experiments_approximate/experiments/create_dico_alphacsc.py | bmalezieux/unrolled_dl | 5854a6991e44db025a99a9f0d38be6b1e669aa83 | [
"MIT"
] | null | null | null | import numpy as np
atoms_to_save = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 15, 18])
u_cdl = np.load("u_cdl.npy")
v_cdl = np.load("v_cdl.npy")
np.save("u_cdl_modified.npy", u_cdl[atoms_to_save])
np.save("v_cdl_modified.npy", v_cdl[atoms_to_save])
| 25 | 65 | 0.68 | import numpy as np
atoms_to_save = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 15, 18])
u_cdl = np.load("u_cdl.npy")
v_cdl = np.load("v_cdl.npy")
np.save("u_cdl_modified.npy", u_cdl[atoms_to_save])
np.save("v_cdl_modified.npy", v_cdl[atoms_to_save])
| true | true |
f71fe97a19d5758ce4f745c12696da1bb54d0fba | 15,439 | py | Python | src/catsys/exe/_res.py | AtomCrafty/catsystem-py | 11bd96708e3959be84e41e30397820ebaa54974d | [
"MIT"
] | 6 | 2020-10-20T13:26:56.000Z | 2022-02-15T05:26:38.000Z | src/catsys/exe/_res.py | AtomCrafty/catsystem-py | 11bd96708e3959be84e41e30397820ebaa54974d | [
"MIT"
] | 2 | 2020-10-20T16:15:35.000Z | 2021-07-08T18:15:23.000Z | src/catsys/exe/_res.py | AtomCrafty/catsystem-py | 11bd96708e3959be84e41e30397820ebaa54974d | [
"MIT"
] | 1 | 2020-10-19T15:20:50.000Z | 2020-10-19T15:20:50.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Windows resource types
Requires packages: pefile
WARNING: This module is deprecated, broken, and will be removed eventually.
"""
__version__ = '0.0.1'
__date__ = '2020-01-01'
__author__ = 'Robert Jordan'
__all__ = ['ResourceName', 'ResourceId']
#####################... | 43.985755 | 175 | 0.711704 |
"""Windows resource types
Requires packages: pefile
WARNING: This module is deprecated, broken, and will be removed eventually.
"""
__version__ = '0.0.1'
__date__ = '2020-01-01'
__author__ = 'Robert Jordan'
__all__ = ['ResourceName', 'ResourceId']
ol:
return self.value < ResourceName._cast(other)
def _... | false | true |
f71fead294ee942753789629c9a72d7384c394a0 | 2,087 | py | Python | main.py | KevHg/reddit-sentiment | 383407105957b8a582a524fa29b9f21d7b2cbd23 | [
"MIT"
] | 3 | 2020-12-22T09:03:15.000Z | 2021-05-13T18:17:44.000Z | main.py | KevHg/reddit-sentiment | 383407105957b8a582a524fa29b9f21d7b2cbd23 | [
"MIT"
] | 3 | 2020-11-11T15:33:13.000Z | 2021-12-13T20:18:41.000Z | main.py | KevHg/reddit-sentiment | 383407105957b8a582a524fa29b9f21d7b2cbd23 | [
"MIT"
] | 1 | 2021-02-18T19:56:09.000Z | 2021-02-18T19:56:09.000Z | import os
from scrapy.crawler import CrawlerProcess
import pandas as pd
import logging
import nltk
import json_reader
from sentiment_score import clean_text, calculate_sentiment_score
from reddit_scraper.reddit_scraper.spiders.reddit_post_scraper import RedditPostCrawler
if __name__ == '__main__':
# Initial setup... | 33.66129 | 117 | 0.661236 | import os
from scrapy.crawler import CrawlerProcess
import pandas as pd
import logging
import nltk
import json_reader
from sentiment_score import clean_text, calculate_sentiment_score
from reddit_scraper.reddit_scraper.spiders.reddit_post_scraper import RedditPostCrawler
if __name__ == '__main__':
logging.ge... | true | true |
f71feb945e7c962481692be8e2384e367a3c4bbd | 3,443 | py | Python | pollbot/models/reference.py | shubham-king/poll | 677e870bea36dffbf27f24e4cdeec892b40f7128 | [
"MIT"
] | 112 | 2019-06-11T17:52:57.000Z | 2022-03-18T00:05:21.000Z | pollbot/models/reference.py | shubham-king/poll | 677e870bea36dffbf27f24e4cdeec892b40f7128 | [
"MIT"
] | 91 | 2019-05-28T11:33:40.000Z | 2022-02-27T12:12:07.000Z | pollbot/models/reference.py | shubham-king/poll | 677e870bea36dffbf27f24e4cdeec892b40f7128 | [
"MIT"
] | 69 | 2019-07-10T16:58:06.000Z | 2022-03-30T22:09:44.000Z | """The sqlalchemy model for a polloption."""
from __future__ import annotations
from sqlalchemy import Column, ForeignKey, Index, func
from sqlalchemy.orm import relationship
from sqlalchemy.types import BigInteger, DateTime, Integer, String
from pollbot.db import base
from pollbot.enums import ReferenceType
class ... | 27.99187 | 97 | 0.637816 | from __future__ import annotations
from sqlalchemy import Column, ForeignKey, Index, func
from sqlalchemy.orm import relationship
from sqlalchemy.types import BigInteger, DateTime, Integer, String
from pollbot.db import base
from pollbot.enums import ReferenceType
class Reference(base):
__tablename__ = "refere... | true | true |
f71fec1a43d05877719e3969203eaab05fae4883 | 10,145 | py | Python | metadl/core/scoring/scoring.py | mikehuisman/metadl | 61ece0364b08e67412ab87da4a41425b2e88a562 | [
"Apache-2.0"
] | 26 | 2020-09-23T13:04:52.000Z | 2022-03-03T03:07:49.000Z | metadl/core/scoring/scoring.py | mikehuisman/metadl | 61ece0364b08e67412ab87da4a41425b2e88a562 | [
"Apache-2.0"
] | 5 | 2020-11-04T13:26:09.000Z | 2021-09-17T07:42:01.000Z | metadl/core/scoring/scoring.py | mikehuisman/metadl | 61ece0364b08e67412ab87da4a41425b2e88a562 | [
"Apache-2.0"
] | 12 | 2020-11-03T12:01:35.000Z | 2021-12-19T03:58:50.000Z | """ Runs the scoring procedure for the challenge.
It assumes that there exists a ./model_dir folder containing both the
submission code and the saved learner.
It will create a folder named ./scoring_output (default) in which a txt file
will contain the average score over 600 episodes. You can change the folder
name... | 38.869732 | 99 | 0.648398 | import os
from sys import path
import scipy.stats
import gin
import numpy as np
from absl import app
from absl import flags
from absl import logging
import tensorflow as tf
from metadl.data.dataset import DataGenerator
from metadl.core.ingestion.ingestion import get_gin_path, show_dir
FLAGS = flags.FLAGS
flags.D... | true | true |
f71fed6c463f4fb9305f4215a3d3f237674e9c98 | 6,399 | py | Python | Graph-based/processor/recognition.py | EnTimeMent/Group-Behavior-Recognition | d6606e9e7bef836a9ccc5b4ada66933a4770171c | [
"MIT"
] | 3 | 2020-12-29T04:07:58.000Z | 2022-01-11T14:47:16.000Z | Graph-based/processor/recognition.py | EnTimeMent/Group-Behavior-Recognition | d6606e9e7bef836a9ccc5b4ada66933a4770171c | [
"MIT"
] | 1 | 2021-01-02T10:28:07.000Z | 2021-01-04T18:01:42.000Z | Graph-based/processor/recognition.py | EnTimeMent/Group-Behavior-Recognition | d6606e9e7bef836a9ccc5b4ada66933a4770171c | [
"MIT"
] | 1 | 2022-01-09T12:55:41.000Z | 2022-01-09T12:55:41.000Z | #!/usr/bin/env python
# pylint: disable=W0201
import sys
import argparse
import yaml
import numpy as np
# torch
import torch
import torch.nn as nn
import torch.optim as optim
# torchlight
import torchlight
from torchlight import str2bool
from torchlight import DictAction
from torchlight import import_class
from .pro... | 32.482234 | 94 | 0.556493 |
import sys
import argparse
import yaml
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torchlight
from torchlight import str2bool
from torchlight import DictAction
from torchlight import import_class
from .processor import Processor
from sklearn.metrics import confusion_m... | true | true |
f71fedf23526603a8b5b482439d51773bdec5bd3 | 3,347 | py | Python | medseer/migrations/0001_initial.py | noureldin-eg/medseer | 8a68cd92a757ab3141081547d322c0c6b2056d66 | [
"Apache-2.0"
] | null | null | null | medseer/migrations/0001_initial.py | noureldin-eg/medseer | 8a68cd92a757ab3141081547d322c0c6b2056d66 | [
"Apache-2.0"
] | null | null | null | medseer/migrations/0001_initial.py | noureldin-eg/medseer | 8a68cd92a757ab3141081547d322c0c6b2056d66 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.10 on 2022-01-25 22:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
... | 46.486111 | 125 | 0.582611 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
('id', models.BigAutoField(auto_created... | true | true |
f71fee147634858badedf4ea69e3f4bc26bb7e78 | 2,052 | py | Python | tests/parsers/plist_plugins/ipod.py | jeppetrost/plaso | b48008c6ea79950eeeef3a05b3a859086c8704b6 | [
"Apache-2.0"
] | null | null | null | tests/parsers/plist_plugins/ipod.py | jeppetrost/plaso | b48008c6ea79950eeeef3a05b3a859086c8704b6 | [
"Apache-2.0"
] | null | null | null | tests/parsers/plist_plugins/ipod.py | jeppetrost/plaso | b48008c6ea79950eeeef3a05b3a859086c8704b6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the iPod plist plugin."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import ipod as _ # pylint: disable=unused-import
from plaso.lib import definitions
from plaso.parsers.plist_plugins import ipod
from tests import test_l... | 30.176471 | 80 | 0.729532 |
from __future__ import unicode_literals
import unittest
from plaso.formatters import ipod as _
from plaso.lib import definitions
from plaso.parsers.plist_plugins import ipod
from tests import test_lib as shared_test_lib
from tests.parsers.plist_plugins import test_lib
class TestIPodPlugin(test_lib.PlistPlugin... | true | true |
f71fee22e27eb7d42dc3efe0a61407b797d283a4 | 63,809 | py | Python | pandas/core/groupby/groupby.py | paritoshmittal09/pandas | 862d2d89b8fe0a93ec8e714315175e2eba1fa6e5 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/groupby/groupby.py | paritoshmittal09/pandas | 862d2d89b8fe0a93ec8e714315175e2eba1fa6e5 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/groupby/groupby.py | paritoshmittal09/pandas | 862d2d89b8fe0a93ec8e714315175e2eba1fa6e5 | [
"BSD-3-Clause"
] | null | null | null | """
Provide the groupby split-apply-combine paradigm. Define the GroupBy
class providing the base-class of operations.
The SeriesGroupBy and DataFrameGroupBy sub-class
(defined in pandas.core.groupby.generic)
expose these user-facing objects to provide specific functionailty.
"""
import types
from functools import wr... | 32.439756 | 82 | 0.555862 |
import types
from functools import wraps, partial
import datetime
import collections
import warnings
from contextlib import contextmanager
import numpy as np
from pandas._libs import groupby as libgroupby, Timestamp
from pandas.util._validators import validate_kwargs
from pandas.util._decorators import (
cache_r... | true | true |
f71fef0c42afe5737fff68a898b0a1503169b16b | 303 | py | Python | mundo 3/des085.py | Pedroluis1/python | d949fa2646c049aa51a41a32dc62de7b14eae90f | [
"MIT"
] | null | null | null | mundo 3/des085.py | Pedroluis1/python | d949fa2646c049aa51a41a32dc62de7b14eae90f | [
"MIT"
] | null | null | null | mundo 3/des085.py | Pedroluis1/python | d949fa2646c049aa51a41a32dc62de7b14eae90f | [
"MIT"
] | null | null | null | valores = [[], []]
val = 0
for c in range(1, 8):
val = int(input(f'Digite o {c}° valor: '))
if val % 2 == 0:
valores[0].append(val)
else:
valores[1].append(val)
valores[0].sort()
valores[1].sort()
print(f'valores impares: {valores[1]}')
print(f'valores pares: {valores[0]}')
| 23.307692 | 46 | 0.567657 | valores = [[], []]
val = 0
for c in range(1, 8):
val = int(input(f'Digite o {c}° valor: '))
if val % 2 == 0:
valores[0].append(val)
else:
valores[1].append(val)
valores[0].sort()
valores[1].sort()
print(f'valores impares: {valores[1]}')
print(f'valores pares: {valores[0]}')
| true | true |
f71fefeee470de4abd81815f4b20fd0e5aa1ae84 | 6,228 | py | Python | pypy/translator/platform/posix.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | pypy/translator/platform/posix.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/translator/platform/posix.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null |
""" Base class for all posixish platforms
"""
from pypy.translator.platform import Platform, log, _run_subprocess
from pypy.tool import autopath
import py, os
class BasePosix(Platform):
exe_ext = ''
def __init__(self, cc=None):
if cc is None:
cc = 'gcc'
self.cc = cc
def _lib... | 30.985075 | 96 | 0.538536 |
from pypy.translator.platform import Platform, log, _run_subprocess
from pypy.tool import autopath
import py, os
class BasePosix(Platform):
exe_ext = ''
def __init__(self, cc=None):
if cc is None:
cc = 'gcc'
self.cc = cc
def _libs(self, libraries):
return ['-l%s' % (... | true | true |
f71ff11e0a47dc49e9286ac8954a588df8c45b2e | 64 | py | Python | test/core/metaflow_custom/toplevel/__init__.py | saikonen/metaflow | 48e37bea3ea4e83ddab8227869bbe56b52d9957d | [
"Apache-2.0"
] | 7 | 2020-07-24T17:07:58.000Z | 2021-05-19T21:47:12.000Z | test/core/metaflow_custom/toplevel/__init__.py | saikonen/metaflow | 48e37bea3ea4e83ddab8227869bbe56b52d9957d | [
"Apache-2.0"
] | 55 | 2020-07-20T16:56:27.000Z | 2022-03-28T12:51:15.000Z | test/core/metaflow_custom/toplevel/__init__.py | saikonen/metaflow | 48e37bea3ea4e83ddab8227869bbe56b52d9957d | [
"Apache-2.0"
] | 6 | 2020-10-15T18:38:35.000Z | 2021-06-20T03:05:43.000Z | __mf_customization__ = 'test'
tl_value = 42
__version__ = None | 12.8 | 29 | 0.765625 | __mf_customization__ = 'test'
tl_value = 42
__version__ = None | true | true |
f71ff1359f7c6ddeef12a05d12e6963d96fa007e | 2,569 | py | Python | jspp_imageutils/annotations/convert.py | jspaezp/jspp_imageutils | 6376e274a1b0675622a7979c181b9effc125aa09 | [
"Apache-2.0"
] | null | null | null | jspp_imageutils/annotations/convert.py | jspaezp/jspp_imageutils | 6376e274a1b0675622a7979c181b9effc125aa09 | [
"Apache-2.0"
] | null | null | null | jspp_imageutils/annotations/convert.py | jspaezp/jspp_imageutils | 6376e274a1b0675622a7979c181b9effc125aa09 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# modified from:
# https://gist.github.com/rotemtam/88d9a4efae243fc77ed4a0f9917c8f6c
import os
import glob
import click
import pandas as pd
import xml.etree.ElementTree as ET
def xml_to_csv(path: str) -> pd.DataFrame:
xml_list = []
for xml_file in glob.glob(pat... | 29.528736 | 79 | 0.570261 |
import os
import glob
import click
import pandas as pd
import xml.etree.ElementTree as ET
def xml_to_csv(path: str) -> pd.DataFrame:
xml_list = []
for xml_file in glob.glob(path):
tree = ET.parse(xml_file)
root = tree.getroot()
for member in root.findall('object'):
b... | true | true |
f71ff15ecd2f2844f2c2b918043ff8217bac2c9b | 3,796 | py | Python | Week6/AdvML_Week6_ex2.py | mikkokotola/AdvancedMachineLearning | 574e82d4104ac04f1cb9889beb5be7d122bd0d01 | [
"MIT"
] | 1 | 2020-03-18T08:51:44.000Z | 2020-03-18T08:51:44.000Z | Week6/AdvML_Week6_ex2.py | mikkokotola/AdvancedMachineLearning | 574e82d4104ac04f1cb9889beb5be7d122bd0d01 | [
"MIT"
] | null | null | null | Week6/AdvML_Week6_ex2.py | mikkokotola/AdvancedMachineLearning | 574e82d4104ac04f1cb9889beb5be7d122bd0d01 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[8]:
## Advanced Course in Machine Learning
## Week 6
## Exercise 2 / Random forest
import numpy as np
import scipy
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from numpy import linalg as LA
from sklearn... | 19.171717 | 84 | 0.663593 |
sns
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from numpy import linalg as LA
from sklearn import decomposition
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import pairwise_distances
from sklearn.manifold import TSNE
import math
import sys
import mnist
from... | true | true |
f71ff26a2521e900d339ce88a0f2dc11b89982ac | 8,979 | py | Python | models/layers/mesh_pool.py | yamaguchi1024/MeshCNN | 197530eab2aa4c2419511c1854dcbc662377f340 | [
"MIT"
] | null | null | null | models/layers/mesh_pool.py | yamaguchi1024/MeshCNN | 197530eab2aa4c2419511c1854dcbc662377f340 | [
"MIT"
] | null | null | null | models/layers/mesh_pool.py | yamaguchi1024/MeshCNN | 197530eab2aa4c2419511c1854dcbc662377f340 | [
"MIT"
] | 1 | 2020-10-10T23:31:50.000Z | 2020-10-10T23:31:50.000Z | import torch
import torch.nn as nn
from threading import Thread
from models.layers.mesh_union import MeshUnion
import numpy as np
from heapq import heappop, heapify
class MeshPool(nn.Module):
def __init__(self, target, multi_thread=False):
super(MeshPool, self).__init__()
self.__out_target = ... | 44.014706 | 155 | 0.646397 | import torch
import torch.nn as nn
from threading import Thread
from models.layers.mesh_union import MeshUnion
import numpy as np
from heapq import heappop, heapify
class MeshPool(nn.Module):
def __init__(self, target, multi_thread=False):
super(MeshPool, self).__init__()
self.__out_target = ... | true | true |
f71ff2713f88d105f4975f0cee61ae6ef8e14fed | 896 | py | Python | nn_dataflow/nns/mlp_s.py | joeshow79/nn_dataflow | 279440452148ebf327992bd178a37cd5fd5330c5 | [
"BSD-3-Clause"
] | null | null | null | nn_dataflow/nns/mlp_s.py | joeshow79/nn_dataflow | 279440452148ebf327992bd178a37cd5fd5330c5 | [
"BSD-3-Clause"
] | null | null | null | nn_dataflow/nns/mlp_s.py | joeshow79/nn_dataflow | 279440452148ebf327992bd178a37cd5fd5330c5 | [
"BSD-3-Clause"
] | null | null | null | """ $lic$
Copyright (C) 2016-2019 by The Board of Trustees of Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
This program is distributed in the hope that it will be useful, but WITHOU... | 27.151515 | 79 | 0.756696 |
from nn_dataflow.core import Network
from nn_dataflow.core import InputLayer, FCLayer
NN = Network('MLP-S')
NN.set_input_layer(InputLayer(784, 1))
NN.add('fc1', FCLayer(784, 500))
NN.add('fc2', FCLayer(500, 250))
NN.add('fc3', FCLayer(250, 10))
| true | true |
f71ff2d8ade82949986924ccc275d50947e1700f | 3,753 | py | Python | nexuscasc/config/k8s_config_handler.py | vjda/nexus3-casc-cli | 6d33503c19f75b73b656293141911e083331faf0 | [
"MIT"
] | 7 | 2020-06-30T08:15:53.000Z | 2022-03-22T10:28:09.000Z | nexuscasc/config/k8s_config_handler.py | vjda/nexus3-casc-cli | 6d33503c19f75b73b656293141911e083331faf0 | [
"MIT"
] | 1 | 2021-09-27T03:24:46.000Z | 2021-09-27T03:24:46.000Z | nexuscasc/config/k8s_config_handler.py | vjda/nexus3-casc-cli | 6d33503c19f75b73b656293141911e083331faf0 | [
"MIT"
] | 1 | 2020-12-07T14:55:30.000Z | 2020-12-07T14:55:30.000Z | import base64
import re
from dataclasses import dataclass
from enum import Enum
from typing import Union, List
from kubernetes import client, config
from kubernetes.client import V1ConfigMapList, V1SecretList, CoreV1Api, V1Secret, V1ConfigMap
from nexuscasc.logger import Logger
class ResourceType(Enum):
SECRET,... | 38.295918 | 119 | 0.625633 | import base64
import re
from dataclasses import dataclass
from enum import Enum
from typing import Union, List
from kubernetes import client, config
from kubernetes.client import V1ConfigMapList, V1SecretList, CoreV1Api, V1Secret, V1ConfigMap
from nexuscasc.logger import Logger
class ResourceType(Enum):
SECRET,... | true | true |
f71ff2dfd267b7ca272fcc6a2a50017e19cd8ff1 | 3,423 | py | Python | tests/commands/spot/test_limit_order_cmd.py | mpetrinidev/bnb-cli | d10fc36b6a1e2dd34597d9f31ea143019ba6f4b9 | [
"MIT"
] | 5 | 2021-04-02T20:49:19.000Z | 2021-06-11T06:22:24.000Z | tests/commands/spot/test_limit_order_cmd.py | mpetrinidev/bnb-cli | d10fc36b6a1e2dd34597d9f31ea143019ba6f4b9 | [
"MIT"
] | 2 | 2021-06-13T20:22:09.000Z | 2021-06-14T23:09:14.000Z | tests/commands/spot/test_limit_order_cmd.py | mpetrinidev/bnc-cli | d10fc36b6a1e2dd34597d9f31ea143019ba6f4b9 | [
"MIT"
] | null | null | null | import datetime
import os
from unittest.mock import Mock
from bnc.cli import cli
from bnc.utils.utils import json_to_str
from tests.commands.common import read_json_test_file, get_headers
from tests.commands.common_fixtures import *
def get_json_filename():
return os.path.join(os.path.dirname(os.path.abspath(__f... | 48.211268 | 138 | 0.650891 | import datetime
import os
from unittest.mock import Mock
from bnc.cli import cli
from bnc.utils.utils import json_to_str
from tests.commands.common import read_json_test_file, get_headers
from tests.commands.common_fixtures import *
def get_json_filename():
return os.path.join(os.path.dirname(os.path.abspath(__f... | true | true |
f71ff3f9334377468b2b24b73aa343bc3c717efb | 2,218 | py | Python | src/odontology/core/migrations/0009_chapter_tariff.py | nanomolina/JP | 248a47bced4dac850f85d28968ddf279cd123400 | [
"Apache-2.0"
] | 2 | 2016-06-23T15:35:29.000Z | 2022-01-11T00:55:21.000Z | src/odontology/core/migrations/0009_chapter_tariff.py | nanomolina/JP | 248a47bced4dac850f85d28968ddf279cd123400 | [
"Apache-2.0"
] | 27 | 2016-06-24T12:28:01.000Z | 2022-01-13T00:37:25.000Z | src/odontology/core/migrations/0009_chapter_tariff.py | nanomolina/JP | 248a47bced4dac850f85d28968ddf279cd123400 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-09-02 20:22
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20160801_1937'),
]
operations = [... | 50.409091 | 131 | 0.625338 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20160801_1937'),
]
operations = [
migrations.CreateModel(
name='Chapter',
... | true | true |
f71ff457dfbaab5f3f5847da75668942d7052f7a | 3,330 | py | Python | dockerdjango/dockerdjango/settings.py | ducanhvna/DockerDjango | ab5dcb801691fa1ef15a38f05e75fe58066c61ae | [
"MIT"
] | null | null | null | dockerdjango/dockerdjango/settings.py | ducanhvna/DockerDjango | ab5dcb801691fa1ef15a38f05e75fe58066c61ae | [
"MIT"
] | 9 | 2019-12-04T23:29:22.000Z | 2022-02-10T12:19:23.000Z | dockerdjango/dockerdjango/settings.py | ducanhvna/DockerDjango | ab5dcb801691fa1ef15a38f05e75fe58066c61ae | [
"MIT"
] | null | null | null | """
Django settings for dockerdjango project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import ... | 25.419847 | 91 | 0.678378 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'gc(_1u30_&as3g*xqy8k@u$aj22*@_#d$ylw@s8cjfjmz%ukq('
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f71ff4f192b3057091ebc889bf78714a2e21a9d6 | 2,455 | py | Python | examples/pybullet/examples/quadruped_setup_playback.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 9,136 | 2015-01-02T00:41:45.000Z | 2022-03-31T15:30:02.000Z | examples/pybullet/examples/quadruped_setup_playback.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,424 | 2015-01-05T08:55:58.000Z | 2022-03-30T19:34:55.000Z | examples/pybullet/examples/quadruped_setup_playback.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,921 | 2015-01-02T10:19:30.000Z | 2022-03-31T02:48:42.000Z | import pybullet as p
import pybullet_data
p.connect(p.SHARED_MEMORY)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
objects = [
p.loadURDF("plane.urdf", 0.000000, 0.000000, -.300000, 0.000000, 0.000000, 0.000000, 1.000000)
]
objects = [
p.loadURDF("quadruped/minitaur.urdf", [-0.000046, -0.000068, 0.20... | 51.145833 | 98 | 0.608147 | import pybullet as p
import pybullet_data
p.connect(p.SHARED_MEMORY)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
objects = [
p.loadURDF("plane.urdf", 0.000000, 0.000000, -.300000, 0.000000, 0.000000, 0.000000, 1.000000)
]
objects = [
p.loadURDF("quadruped/minitaur.urdf", [-0.000046, -0.000068, 0.20... | true | true |
f71ff582921b55fc70764b796e2441625d14a39b | 3,212 | py | Python | quati/dataset/corpora/imdb.py | onenoc/quati | ba372b2ad14076294af62cbcbc27e1b3ca8421c1 | [
"MIT"
] | 2 | 2021-01-30T21:20:36.000Z | 2021-01-30T22:15:07.000Z | quati/dataset/corpora/imdb.py | onenoc/quati | ba372b2ad14076294af62cbcbc27e1b3ca8421c1 | [
"MIT"
] | null | null | null | quati/dataset/corpora/imdb.py | onenoc/quati | ba372b2ad14076294af62cbcbc27e1b3ca8421c1 | [
"MIT"
] | 1 | 2021-01-18T23:12:18.000Z | 2021-01-18T23:12:18.000Z | from itertools import chain
from pathlib import Path
import nltk
import torchtext
from quati.dataset.fields.words import WordsField
from quati.dataset.fields.tags import TagsField
from quati.dataset.corpora.corpus import Corpus
def create_single_file_for_pos_and_neg(corpus_path):
new_file_path = Path(corpus_pat... | 33.113402 | 76 | 0.59589 | from itertools import chain
from pathlib import Path
import nltk
import torchtext
from quati.dataset.fields.words import WordsField
from quati.dataset.fields.tags import TagsField
from quati.dataset.corpora.corpus import Corpus
def create_single_file_for_pos_and_neg(corpus_path):
new_file_path = Path(corpus_pat... | true | true |
f71ff58b38aa884ffd4cc5997958ad2274a7a77b | 491 | py | Python | tests/system/test_base.py | aalmazanarbs/memstatsbeat | 554be8f67c385f4e9aeccfdc09b838075c8e1714 | [
"Apache-2.0"
] | null | null | null | tests/system/test_base.py | aalmazanarbs/memstatsbeat | 554be8f67c385f4e9aeccfdc09b838075c8e1714 | [
"Apache-2.0"
] | null | null | null | tests/system/test_base.py | aalmazanarbs/memstatsbeat | 554be8f67c385f4e9aeccfdc09b838075c8e1714 | [
"Apache-2.0"
] | null | null | null | from memstatsbeat import BaseTest
import os
class Test(BaseTest):
def test_base(self):
"""
Basic test with exiting Memstatsbeat normally
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
memstatsbeat_proc = self.star... | 24.55 | 77 | 0.641548 | from memstatsbeat import BaseTest
import os
class Test(BaseTest):
def test_base(self):
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
memstatsbeat_proc = self.start_beat()
self.wait_until(lambda: self.log_contains("memstatsbeat is ru... | true | true |
f71ff5e2374591301bbf01a9ea272bd250502167 | 7,448 | py | Python | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/instruction.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/instruction.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/instruction.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null |
# Copyright 1997 - 2018 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, p... | 33.102222 | 156 | 0.733217 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Instruction(Base):
_SDM_NAME = 'instruction'
def __init__(self, parent):
super(Instruction, self).__init__(parent)
@property
def Actions(self):
from ixnetwork_restpy.testplatform.se... | true | true |
f71ff7f5175b2552338f6b41f9f1520efde5ebe9 | 1,203 | py | Python | pytorch_basic_template/model/model_entry.py | ldylab/deep_learning_with_pytorch | c86a2e24ee94ade1a78b66f10eb69b6e1fdd4463 | [
"MIT"
] | null | null | null | pytorch_basic_template/model/model_entry.py | ldylab/deep_learning_with_pytorch | c86a2e24ee94ade1a78b66f10eb69b6e1fdd4463 | [
"MIT"
] | null | null | null | pytorch_basic_template/model/model_entry.py | ldylab/deep_learning_with_pytorch | c86a2e24ee94ade1a78b66f10eb69b6e1fdd4463 | [
"MIT"
] | null | null | null | # from model.base.fcn import CustomFcn
# from model.best.fcn import DeepLabv3Fcn
# from model.better.fcn import Resnet101Fcn
# from model.sota.fcn import LightFcn
from model.alexnet.alexnet_model import AlexNet
from model.lenet5.lenet_5_model import LeNet5
from model.vggnet.vggnet16 import VGG16
from model.densenet.den... | 36.454545 | 86 | 0.758936 |
from model.alexnet.alexnet_model import AlexNet
from model.lenet5.lenet_5_model import LeNet5
from model.vggnet.vggnet16 import VGG16
from model.densenet.densenet_model import DenseNet121
from model.resnet.resnet34_model import resnet34
from model.resnet.resnet101_model import resnet101, resnet50
from model.cotnet.... | true | true |
f71ff8d04b827e68cb215f95a82095cadf50e4ca | 1,094 | py | Python | data/p4VQE/R4/benchmark/startPyquil330.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil330.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil330.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=10
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(1) # number=2
pr... | 22.326531 | 64 | 0.608775 |
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program()
prog += H(1)
prog += H(2)
prog += H(3)
prog += Y(3)
prog... | true | true |
f71ff98e011cc1d66aab1506e6db05f161b7b1cb | 150 | py | Python | src/blog/views.py | master-stm/blog-dhango-ar | dd904e2af9bc6b7f85da6063f2abcaf12d572b47 | [
"bzip2-1.0.6"
] | null | null | null | src/blog/views.py | master-stm/blog-dhango-ar | dd904e2af9bc6b7f85da6063f2abcaf12d572b47 | [
"bzip2-1.0.6"
] | null | null | null | src/blog/views.py | master-stm/blog-dhango-ar | dd904e2af9bc6b7f85da6063f2abcaf12d572b47 | [
"bzip2-1.0.6"
] | null | null | null | from django.shortcuts import render
# Create your views here.
def home(request):
return render(request, 'blog/index.html', {'title': 'Home'})
| 16.666667 | 64 | 0.7 | from django.shortcuts import render
def home(request):
return render(request, 'blog/index.html', {'title': 'Home'})
| true | true |
f71ffa32ecb22bbfb515cf38fa8b15f86b7fb720 | 5,517 | py | Python | atron_cli/atron.py | atron-cc/atron | 49244fbd5ca3d372f6e3e74cda388ddea3acf00e | [
"MIT"
] | 4 | 2019-05-11T01:21:15.000Z | 2020-02-08T18:00:39.000Z | atron_cli/atron.py | atron-cc/atron | 49244fbd5ca3d372f6e3e74cda388ddea3acf00e | [
"MIT"
] | null | null | null | atron_cli/atron.py | atron-cc/atron | 49244fbd5ca3d372f6e3e74cda388ddea3acf00e | [
"MIT"
] | null | null | null | import click
import time
import platform
import os
from minifier import minify
from .board import Board, BoardException, DirectoryExistsError
from .board import PyboardError
_board = None
@click.group()
@click.option(
"--port",
"-p",
envvar="ATRON_PORT",
default="",
type=click.STRING,
help="N... | 25.780374 | 138 | 0.589813 | import click
import time
import platform
import os
from minifier import minify
from .board import Board, BoardException, DirectoryExistsError
from .board import PyboardError
_board = None
@click.group()
@click.option(
"--port",
"-p",
envvar="ATRON_PORT",
default="",
type=click.STRING,
help="N... | true | true |
f71ffa36ec9cfc1d58a5f56d219d392194ca7a79 | 331 | py | Python | Projetos/surf05.py | anderson-br-ti/python | d65d851f0934267dff9256dfdac09b100efb3b45 | [
"MIT"
] | null | null | null | Projetos/surf05.py | anderson-br-ti/python | d65d851f0934267dff9256dfdac09b100efb3b45 | [
"MIT"
] | null | null | null | Projetos/surf05.py | anderson-br-ti/python | d65d851f0934267dff9256dfdac09b100efb3b45 | [
"MIT"
] | null | null | null | f = open('surf.txt')
notas = []
nomes = []
for linha in f:
nome, pontos = linha.split()
notas.append(float(pontos))
nomes.append(nome)
f.close()
notas.sort(reverse=True)
nomes.sort(reverse=True)
print ('%s %4.2f' %(nomes[0], notas[0]))
print ('%s %4.2f' %(nomes[1], notas[1]))
print ('%s %4.2f' %(nomes[2], n... | 22.066667 | 40 | 0.601208 | f = open('surf.txt')
notas = []
nomes = []
for linha in f:
nome, pontos = linha.split()
notas.append(float(pontos))
nomes.append(nome)
f.close()
notas.sort(reverse=True)
nomes.sort(reverse=True)
print ('%s %4.2f' %(nomes[0], notas[0]))
print ('%s %4.2f' %(nomes[1], notas[1]))
print ('%s %4.2f' %(nomes[2], n... | true | true |
f71ffa96a121e4b599332fda00ecec1c3e395215 | 381 | py | Python | sayhello/__init__.py | IshunChin/cfn-tutorial | 0a282fe3a2affa60c5c46702206128bb19e60869 | [
"MIT"
] | null | null | null | sayhello/__init__.py | IshunChin/cfn-tutorial | 0a282fe3a2affa60c5c46702206128bb19e60869 | [
"MIT"
] | null | null | null | sayhello/__init__.py | IshunChin/cfn-tutorial | 0a282fe3a2affa60c5c46702206128bb19e60869 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
app = Flask('sayhello')
app.config.from_pyfile('settings.py')
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
db = SQLAlchemy(app)
bootstrap = Bootstrap(app)
moment... | 23.8125 | 44 | 0.808399 | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_sqlalchemy import SQLAlchemy
app = Flask('sayhello')
app.config.from_pyfile('settings.py')
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
db = SQLAlchemy(app)
bootstrap = Bootstrap(app)
moment... | true | true |
f71ffb327a8627122eb965383d8d9493e4611a68 | 23,768 | py | Python | examples/sentence_similarity/gensen_train.py | gohanlon/nlp | 7b07109a2066eb2152c370ef38600230668a9c8d | [
"MIT"
] | 4,407 | 2019-10-29T21:35:19.000Z | 2022-03-31T13:56:37.000Z | examples/sentence_similarity/gensen_train.py | shubham9g17/nlp-recipes | a5cd2303187239799ae0b1597a7c16eb99a97108 | [
"MIT"
] | 134 | 2019-10-30T23:38:59.000Z | 2022-03-01T11:42:53.000Z | examples/sentence_similarity/gensen_train.py | shubham9g17/nlp-recipes | a5cd2303187239799ae0b1597a7c16eb99a97108 | [
"MIT"
] | 726 | 2019-10-31T15:21:52.000Z | 2022-03-31T10:18:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""
The GenSen training process follows the steps:
1. Create or load the dataset vocabulary
2. Train on the training dataset for each batch epoch (batch size = 48 updates)
3. Eval... | 36.849612 | 96 | 0.51847 |
import argparse
import json
import logging
import os
import time
import horovod.torch as hvd
import mlflow
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as f
import torch.optim as optim
from utils_nlp.models.gensen.multi_task_model import Mu... | true | true |
f71ffb8011fd1e0f44abc963af4799e254cbef2d | 6,006 | py | Python | rb_missions/scripts/acoustic_docking.py | vanttec/vanttec_usv | 5c7b45a61728404b4c957028eac7bc361f1b2077 | [
"MIT"
] | 13 | 2020-08-18T18:47:11.000Z | 2022-03-30T08:07:25.000Z | rb_missions/scripts/acoustic_docking.py | vanttec/vanttec_usv | 5c7b45a61728404b4c957028eac7bc361f1b2077 | [
"MIT"
] | 2 | 2021-05-07T03:56:11.000Z | 2021-08-10T04:18:21.000Z | rb_missions/scripts/acoustic_docking.py | vanttec/vanttec_usv | 5c7b45a61728404b4c957028eac7bc361f1b2077 | [
"MIT"
] | 5 | 2020-12-21T17:29:29.000Z | 2022-02-15T07:51:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
----------------------------------------------------------
@file: acoustic_docking.py
@date: Wed Jun 3, 2020
@author: Alejandro Gonzalez Garcia
@e-mail: alexglzg97@gmail.com
@brief: Motion planning. ROS node to follow an acoustic
signal for ... | 33.741573 | 145 | 0.604729 |
import math
import time
import os
import numpy as np
import rospy
from geometry_msgs.msg import Pose, Pose2D, PoseArray
from std_msgs.msg import Int32, Float32MultiArray, Float64, String
from visualization_msgs.msg import Marker, MarkerArray
class AcousticDocking:
def __init__(self):
self.ned_x = 0
... | true | true |
f71ffbe737f15846e14c72d6820690ac7cf93d67 | 4,873 | py | Python | lula/util.py | wiseodd/lula | a52b27c118ed136a62d8d7d1a898067d5ac685fb | [
"MIT"
] | 15 | 2021-06-07T14:25:35.000Z | 2021-12-26T16:41:01.000Z | lula/util.py | wiseodd/lula | a52b27c118ed136a62d8d7d1a898067d5ac685fb | [
"MIT"
] | 1 | 2022-03-11T01:03:12.000Z | 2022-03-11T01:03:12.000Z | lula/util.py | wiseodd/lula | a52b27c118ed136a62d8d7d1a898067d5ac685fb | [
"MIT"
] | 2 | 2021-06-19T05:41:05.000Z | 2022-03-23T11:51:06.000Z | import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
class MaskedLinear(nn.Module):
def __init__(self, base_layer, m_in, m_out):
"""
The standard nn.Linear layer, but with gradient masking to enforce the LULA construction.
"""
super(MaskedLinea... | 32.059211 | 141 | 0.60353 | import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
class MaskedLinear(nn.Module):
def __init__(self, base_layer, m_in, m_out):
super(MaskedLinear, self).__init__()
W_base = base_layer.weight.data.clone()
n_out, n_in = W_base.shape
... | true | true |
f71ffe7210fe58d0bbb802af2106a7f260b2e296 | 5,184 | py | Python | line6.py | ChrBarth/pypod | 4dccf6e5f5f3584672e2bab5281220a15ee51de5 | [
"MIT"
] | 4 | 2021-04-26T07:24:27.000Z | 2022-01-17T23:10:47.000Z | line6.py | ChrBarth/pypod | 4dccf6e5f5f3584672e2bab5281220a15ee51de5 | [
"MIT"
] | null | null | null | line6.py | ChrBarth/pypod | 4dccf6e5f5f3584672e2bab5281220a15ee51de5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Some useful POD-Variables
# The Program names:
PROGRAMS = [ "1A", "1B", "1C", "1D",
"2A", "2B", "2C", "2D",
"3A", "3B", "3C", "3D",
"4A", "4B", "4C", "4D",
"5A", "5B", "5C", "5D",
"6A", "6B", "6C", "6D",
"7A", "7B",... | 33.882353 | 103 | 0.470486 |
PROGRAMS = [ "1A", "1B", "1C", "1D",
"2A", "2B", "2C", "2D",
"3A", "3B", "3C", "3D",
"4A", "4B", "4C", "4D",
"5A", "5B", "5C", "5D",
"6A", "6B", "6C", "6D",
"7A", "7B", "7C", "7D",
"8A", "8B", "8C", "8D",
"9A", ... | true | true |
f71fff32cfd2c5d668696fc8401b13ffda826fad | 118 | py | Python | commands/enlist.py | SirChopwood/Arma-3-Bot | 5aa751beb6a362af1fcefe3c8b1d2572b3ffc76f | [
"MIT"
] | 1 | 2020-10-30T18:37:39.000Z | 2020-10-30T18:37:39.000Z | commands/enlist.py | SirChopwood/Requisitions-Officer-Bot | 5aa751beb6a362af1fcefe3c8b1d2572b3ffc76f | [
"MIT"
] | null | null | null | commands/enlist.py | SirChopwood/Requisitions-Officer-Bot | 5aa751beb6a362af1fcefe3c8b1d2572b3ffc76f | [
"MIT"
] | null | null | null | async def Main(self, message, command, arguments):
await self.run_file("section_slot_assign", message, arguments)
| 39.333333 | 66 | 0.771186 | async def Main(self, message, command, arguments):
await self.run_file("section_slot_assign", message, arguments)
| true | true |
f71fffe42a961cd5e75a8c0d5975af883c4d0f2f | 2,763 | py | Python | _preflight_hook_experiment.py | BapeHiks/pythonista_startup | 060c355e9ecefa069227ae80c061cf532f9148e1 | [
"MIT"
] | 22 | 2016-04-05T14:56:11.000Z | 2022-02-03T02:52:23.000Z | _preflight_hook_experiment.py | BapeHiks/pythonista_startup | 060c355e9ecefa069227ae80c061cf532f9148e1 | [
"MIT"
] | 2 | 2016-04-28T08:45:16.000Z | 2017-04-24T21:55:37.000Z | _preflight_hook_experiment.py | BapeHiks/pythonista_startup | 060c355e9ecefa069227ae80c061cf532f9148e1 | [
"MIT"
] | 3 | 2017-04-23T16:47:33.000Z | 2020-08-05T16:14:49.000Z | """Highly unreliable way to register "preflight hooks", which are run every time you run a script (but not an editor action)."""
from __future__ import absolute_import, division, print_function
def run():
print(u"Installing preflight hooks...")
# There's no official way to add hooks that run before every... | 49.339286 | 587 | 0.631198 |
from __future__ import absolute_import, division, print_function
def run():
print(u"Installing preflight hooks...")
# However Pythonista's preflight code imports pythonista_startup once to check what names it contains.
try:
import builtins
except ImportError:
import... | true | true |
f7200016b3e4bb76f1473df3974edfb197cc475a | 2,321 | py | Python | tests/hazmat/backends/test_commoncrypto.py | balabit-deps/balabit-os-6-python-cryptography | c31d184a56a18bad89a6444313367be71b5b0877 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2015-09-25T16:03:32.000Z | 2015-09-25T16:03:32.000Z | tests/hazmat/backends/test_commoncrypto.py | balabit-deps/balabit-os-6-python-cryptography | c31d184a56a18bad89a6444313367be71b5b0877 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/hazmat/backends/test_commoncrypto.py | balabit-deps/balabit-os-6-python-cryptography | c31d184a56a18bad89a6444313367be71b5b0877 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-07-17T12:26:45.000Z | 2020-07-17T12:26:45.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import pytest
from cryptography import utils
from cryptography.exception... | 37.435484 | 79 | 0.734166 |
from __future__ import absolute_import, division, print_function
import pytest
from cryptography import utils
from cryptography.exceptions import InternalError, _Reasons
from cryptography.hazmat.backends import _available_backends
from cryptography.hazmat.primitives.ciphers import Cipher, CipherAlgorithm
from cry... | true | true |
f720016578b11272f4a943f87114d1bf4673f739 | 15,319 | py | Python | sdk/python/pulumi_azure_nextgen/storagesync/latest/get_registered_server.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/storagesync/latest/get_registered_server.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/storagesync/latest/get_registered_server.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 42.671309 | 546 | 0.687447 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'GetRegisteredServerResult',
'AwaitableGetRegisteredServerResult',
'get_registered_server',
]
warnings.warn("""The 'latest' version is deprecat... | true | true |
f72001cd4e99d72b538406d817ae842ce6ada978 | 37,141 | py | Python | test/functional/rpc_psbt.py | GumFruit/cpuchain | c2fb213eb1e376a7457a8eecf907eca719eb4c99 | [
"MIT"
] | null | null | null | test/functional/rpc_psbt.py | GumFruit/cpuchain | c2fb213eb1e376a7457a8eecf907eca719eb4c99 | [
"MIT"
] | null | null | null | test/functional/rpc_psbt.py | GumFruit/cpuchain | c2fb213eb1e376a7457a8eecf907eca719eb4c99 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from itertools import prod... | 61.593698 | 584 | 0.675991 |
from decimal import Decimal
from itertools import product
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_approx,
assert_equal,
assert_greater_than,
assert_raises_rpc_error,
find_output,
)
import json
import os
MAX_BIP125_RBF_SEQUENCE =... | true | true |
f72001fbbd35b8a678f898e1db551767c3665048 | 30,425 | py | Python | src/waldur_azure/migrations/0003_redesign.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | 2 | 2017-01-20T15:26:25.000Z | 2017-08-03T04:38:08.000Z | src/waldur_azure/migrations/0003_redesign.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | null | null | null | src/waldur_azure/migrations/0003_redesign.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | null | null | null | # Generated by Django 1.11.18 on 2019-01-28 14:05
import re
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
import django_fsm
import model_utils.fields
from django.db import migrations, models
import waldur_azure.validators
import waldur_core.core.fields
import waldur_core.... | 36.745169 | 199 | 0.396647 |
import re
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
import django_fsm
import model_utils.fields
from django.db import migrations, models
import waldur_azure.validators
import waldur_core.core.fields
import waldur_core.core.models
import waldur_core.core.shims
import ... | true | true |
f7200243f3b4d289ac50951e7f5c03cf8e464b4c | 7,970 | py | Python | src/pyrad_proc/pyrad/EGG-INFO/scripts/rewrite_monitoring.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 41 | 2016-12-01T08:46:06.000Z | 2021-06-24T21:14:33.000Z | src/pyrad_proc/pyrad/EGG-INFO/scripts/rewrite_monitoring.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 42 | 2017-02-23T14:52:49.000Z | 2021-02-01T10:43:52.000Z | src/pyrad_proc/pyrad/EGG-INFO/scripts/rewrite_monitoring.py | jfigui/pyrad | 7811d593bb09a7f8a621c0e8ae3f32c2b85a0254 | [
"BSD-3-Clause"
] | 21 | 2016-08-25T15:02:12.000Z | 2021-05-27T04:09:40.000Z | #!/home/daniel/anaconda3/bin/python
# -*- coding: utf-8 -*-
"""
================================================
rewrite_monitoring
================================================
This program rewrites a monitoring time series files into the correct
time order
"""
# Author: fvj
# License: BSD 3 clause
import date... | 33.628692 | 77 | 0.408281 |
import datetime
import atexit
import numpy as np
import os
from pyrad.io import read_monitoring_ts, write_monitoring_ts
from pyrad.graph import plot_monitoring_ts
from pyrad.io import generate_field_name_str, get_fieldname_pyart
print(__doc__)
def main():
input_base = (
'/store/msrad/radar/pyra... | true | true |
f72002f8e1ad1752270b6c4051b237ce04dec27e | 13,299 | py | Python | Scripts/simulation/interactions/jog_interaction.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/interactions/jog_interaction.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/interactions/jog_interaction.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\interactions\jog_interaction.py
# Compiled at: 2020-07-22 05:56:20
# Size of source mod 2**32: 16676... | 50.759542 | 471 | 0.666892 |
from _math import Vector3
import itertools, random
from balloon.tunable_balloon import TunableBalloon
from element_utils import do_all
from event_testing.results import TestResult
from interactions import TargetType
from interactions.base.super_interaction import SuperInteraction
from interactions.constraints imp... | true | true |
f72003c0391c7dabf487c7375b1a310ce99ae57b | 2,718 | py | Python | test/test_mct.py | pistoia/qiskit-aqua | c7900ffdabc1499145739bfab29a392709bee1a0 | [
"Apache-2.0"
] | null | null | null | test/test_mct.py | pistoia/qiskit-aqua | c7900ffdabc1499145739bfab29a392709bee1a0 | [
"Apache-2.0"
] | null | null | null | test/test_mct.py | pistoia/qiskit-aqua | c7900ffdabc1499145739bfab29a392709bee1a0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# 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 agre... | 34.405063 | 105 | 0.577999 |
import unittest
import itertools
import numpy as np
from parameterized import parameterized
from qiskit import QuantumCircuit, QuantumRegister
from qiskit import execute as q_execute
from qiskit.quantum_info import state_fidelity
from qiskit.aqua import get_aer_backend
from test.common import QiskitA... | true | true |
f72005233f11455f1e95662ff8e8514dc68a23af | 3,738 | py | Python | letsencrypt/configuration.py | meehow/letsencrypt | 64073b234a6b87a574d873599a8d4dbf11729d5c | [
"Apache-2.0"
] | 1 | 2021-09-05T14:18:00.000Z | 2021-09-05T14:18:00.000Z | letsencrypt/configuration.py | meehow/letsencrypt | 64073b234a6b87a574d873599a8d4dbf11729d5c | [
"Apache-2.0"
] | null | null | null | letsencrypt/configuration.py | meehow/letsencrypt | 64073b234a6b87a574d873599a8d4dbf11729d5c | [
"Apache-2.0"
] | null | null | null | """Let's Encrypt user-supplied configuration."""
import os
import urlparse
import zope.interface
from acme import challenges
from letsencrypt import constants
from letsencrypt import errors
from letsencrypt import interfaces
class NamespaceConfig(object):
"""Configuration wrapper around :class:`argparse.Namesp... | 32.789474 | 80 | 0.697164 | import os
import urlparse
import zope.interface
from acme import challenges
from letsencrypt import constants
from letsencrypt import errors
from letsencrypt import interfaces
class NamespaceConfig(object):
zope.interface.implements(interfaces.IConfig)
def __init__(self, namespace):
self.namespace... | true | true |
f72005518b34101337fb593f9f38ae1ba0642602 | 8,708 | py | Python | src/modules/display_tickets.py | dat-adi/eisen-tickets | bedd6786da5c49d0021ca97e6e4f33b7a07f5be4 | [
"MIT"
] | null | null | null | src/modules/display_tickets.py | dat-adi/eisen-tickets | bedd6786da5c49d0021ca97e6e4f33b7a07f5be4 | [
"MIT"
] | 11 | 2020-07-31T05:48:51.000Z | 2022-01-16T08:03:28.000Z | src/modules/display_tickets.py | dat-adi/eisen-tickets | bedd6786da5c49d0021ca97e6e4f33b7a07f5be4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GUI import
import tkinter as tk
# Styling the GUI
from tkinter import ttk
# Database connection
from modules.create_db_components import create_connection
# Deletes the ticket from the database
from modules.removing_tickets import delete_ticket
"""This module is used to ... | 30.989324 | 87 | 0.598071 |
import tkinter as tk
from tkinter import ttk
from modules.create_db_components import create_connection
from modules.removing_tickets import delete_ticket
__author__ = "Datta Adithya"
__credits__ = ["Datta Adithya"]
__license__ = "MIT"
__maintainer__ = "Datta Adithya"
__email__ = "dat.adithya@gmail.com"
... | true | true |
f720055934c6413aad908cb155527edb52b40062 | 1,116 | py | Python | root/scripts/includes/python_logger.py | DragonCrafted87/docker-alpine-base | 033199c1d7d6d57271f16841b132469c78658dcf | [
"MIT"
] | null | null | null | root/scripts/includes/python_logger.py | DragonCrafted87/docker-alpine-base | 033199c1d7d6d57271f16841b132469c78658dcf | [
"MIT"
] | null | null | null | root/scripts/includes/python_logger.py | DragonCrafted87/docker-alpine-base | 033199c1d7d6d57271f16841b132469c78658dcf | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from logging import DEBUG
from logging import INFO
from logging import Formatter
from logging import StreamHandler
from logging import getLogger
from sys import stderr
from sys import stdout
class LogLevelFilter:
def __init__(self, level):
self.__level = level
... | 25.953488 | 82 | 0.728495 |
from logging import DEBUG
from logging import INFO
from logging import Formatter
from logging import StreamHandler
from logging import getLogger
from sys import stderr
from sys import stdout
class LogLevelFilter:
def __init__(self, level):
self.__level = level
def filter(self, log_record):
... | true | true |
f720066904260a4d87d72e6f5790ddf77d44d217 | 101 | py | Python | codes_auto/1603.running-sum-of-1d-array.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/1603.running-sum-of-1d-array.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/1603.running-sum-of-1d-array.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=1603 lang=python3
#
# [1603] running-sum-of-1d-array
#
None
# @lc code=end | 14.428571 | 42 | 0.673267 |
None
| true | true |
f72006ab8586955d57cb0232db8f0b952693aca0 | 1,522 | py | Python | setup.py | Rishk/alpha_vantage | 1cb28a98cb0c8526b85d163be96a37fd2d16ff95 | [
"MIT"
] | 1 | 2019-12-27T17:50:59.000Z | 2019-12-27T17:50:59.000Z | setup.py | Rishk/alpha_vantage | 1cb28a98cb0c8526b85d163be96a37fd2d16ff95 | [
"MIT"
] | null | null | null | setup.py | Rishk/alpha_vantage | 1cb28a98cb0c8526b85d163be96a37fd2d16ff95 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
try:
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except IOError:
long_description = 'Python module to get stock data from ... | 30.44 | 83 | 0.61498 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
try:
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except IOError:
long_description = 'Python module to get stock data from ... | true | true |
f720075710121fe0930a9588a836db8847406e4b | 18,959 | py | Python | tools/rnahmm/algbioi/core/analysis16s.py | fplaza/CAMISIM | 4f2ab5e94773a355210568be946e732df7437cb6 | [
"Apache-2.0"
] | 88 | 2017-11-20T01:30:40.000Z | 2022-03-31T07:29:25.000Z | tools/rnahmm/algbioi/core/analysis16s.py | fplaza/CAMISIM | 4f2ab5e94773a355210568be946e732df7437cb6 | [
"Apache-2.0"
] | 121 | 2017-11-15T09:03:38.000Z | 2022-03-24T09:50:59.000Z | tools/rnahmm/algbioi/core/analysis16s.py | fplaza/CAMISIM | 4f2ab5e94773a355210568be946e732df7437cb6 | [
"Apache-2.0"
] | 35 | 2017-12-14T08:19:40.000Z | 2022-03-03T11:26:46.000Z | #!/usr/bin/env python
"""
Copyright (C) 2014 Ivan Gregor
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | 50.156085 | 152 | 0.588586 |
"""
Copyright (C) 2014 Ivan Gregor
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is ... | false | true |
f72007805c2d3ca886d768516835db709c0dc08b | 1,117 | py | Python | python files/area_calcs.py | dhbesson/abc_visualization | b024bf551e0e331e3f7bd9d63dbe1437a3c25aa7 | [
"MIT"
] | null | null | null | python files/area_calcs.py | dhbesson/abc_visualization | b024bf551e0e331e3f7bd9d63dbe1437a3c25aa7 | [
"MIT"
] | null | null | null | python files/area_calcs.py | dhbesson/abc_visualization | b024bf551e0e331e3f7bd9d63dbe1437a3c25aa7 | [
"MIT"
] | null | null | null | import requests, csv, sys, os, time, json, codecs
server = "https://cloudrf.com"
# dir = "calculations/antennas_1W_2m"
# Open CSV file
import codecs
# csvfile = csv.reader(codecs.open('antennas.csv', 'rU', 'utf-16'))
uid = 'YOUR CLOUDRF UID HERE'
key = 'YOUR CLOUDRF KEY HERE'
def calc_area(dir,csv... | 27.243902 | 68 | 0.554163 | import requests, csv, sys, os, time, json, codecs
server = "https://cloudrf.com"
import codecs
uid = 'YOUR CLOUDRF UID HERE'
key = 'YOUR CLOUDRF KEY HERE'
def calc_area(dir,csvfile_loc):
n = 0
csvfile = csv.DictReader(open(csvfile_loc))
if not os.path.exists(dir):
os.makedi... | true | true |
f72008a164fc940a1cd12de39700a25410e41ad5 | 3,485 | py | Python | src/the_tale/the_tale/game/bills/models.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | null | null | null | src/the_tale/the_tale/game/bills/models.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | null | null | null | src/the_tale/the_tale/game/bills/models.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | null | null | null |
import smart_imports
smart_imports.all()
class Bill(django_models.Model):
CAPTION_MIN_LENGTH = 6
CAPTION_MAX_LENGTH = 256
created_at = django_models.DateTimeField(auto_now_add=True, null=False)
updated_at = django_models.DateTimeField(auto_now_add=True, null=False) # MUST setupped by hand
vot... | 42.5 | 145 | 0.766428 |
import smart_imports
smart_imports.all()
class Bill(django_models.Model):
CAPTION_MIN_LENGTH = 6
CAPTION_MAX_LENGTH = 256
created_at = django_models.DateTimeField(auto_now_add=True, null=False)
updated_at = django_models.DateTimeField(auto_now_add=True, null=False)
voting_end_at = django_mod... | true | true |
f72008f42f54ea078b631fc42689eec8279d667b | 486 | py | Python | April 2021/Furthest Building You Can Reach.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | April 2021/Furthest Building You Can Reach.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | April 2021/Furthest Building You Can Reach.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | class Solution:
def furthestBuilding(self, H, bricks, ladders):
jumps_pq = []
for i in range(len(H) - 1):
jump_height = H[i + 1] - H[i]
if jump_height <= 0: continue
heappush(jumps_pq, jump_height)
if len(jumps_pq) > ladders:
bricks -=... | 28.588235 | 57 | 0.522634 | class Solution:
def furthestBuilding(self, H, bricks, ladders):
jumps_pq = []
for i in range(len(H) - 1):
jump_height = H[i + 1] - H[i]
if jump_height <= 0: continue
heappush(jumps_pq, jump_height)
if len(jumps_pq) > ladders:
bricks -=... | true | true |
f72008f569b6e13c90d5063ad392e029122f1919 | 228 | py | Python | Itertools/itertools.product.py | AndreasGeiger/hackerrank-python | a436c207e62b32f70a6b4279bb641a3c4d90e112 | [
"MIT"
] | null | null | null | Itertools/itertools.product.py | AndreasGeiger/hackerrank-python | a436c207e62b32f70a6b4279bb641a3c4d90e112 | [
"MIT"
] | null | null | null | Itertools/itertools.product.py | AndreasGeiger/hackerrank-python | a436c207e62b32f70a6b4279bb641a3c4d90e112 | [
"MIT"
] | null | null | null | from itertools import product
listA = list(map(int, input().split()))
listB = list(map(int, input().split()))
productLists = list(product(listA, listB))
for i in range(len(productLists)):
print(productLists[i], end=" ")
| 20.727273 | 42 | 0.684211 | from itertools import product
listA = list(map(int, input().split()))
listB = list(map(int, input().split()))
productLists = list(product(listA, listB))
for i in range(len(productLists)):
print(productLists[i], end=" ")
| true | true |
f7200945eace3e7c67af32832e8436d62e73a7ee | 3,102 | py | Python | nativepython/type_wrappers/range_wrapper.py | szymonlipinski/nativepython | 5f0bcc709b99a43681488f2753eccc2ac37a0334 | [
"Apache-2.0"
] | null | null | null | nativepython/type_wrappers/range_wrapper.py | szymonlipinski/nativepython | 5f0bcc709b99a43681488f2753eccc2ac37a0334 | [
"Apache-2.0"
] | null | null | null | nativepython/type_wrappers/range_wrapper.py | szymonlipinski/nativepython | 5f0bcc709b99a43681488f2753eccc2ac37a0334 | [
"Apache-2.0"
] | null | null | null | # Coyright 2017-2019 Nativepython Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 31.333333 | 83 | 0.640554 |
from nativepython.type_wrappers.wrapper import Wrapper
import nativepython.native_ast as native_ast
class RangeWrapper(Wrapper):
is_pod = True
is_empty = False
is_pass_by_ref = False
def __init__(self):
super().__init__((range, "type"))
def getNativeLayoutType(self):
... | true | true |
f72009f2a950749e199cacf800fa7cbce9a95e33 | 1,856 | py | Python | ml-agents-envs/mlagents_envs/registry/base_registry_entry.py | bobcy2015/ml-agents | 5d02292ad889f1884fa98bd92f127f17cbfe0112 | [
"Apache-2.0"
] | 13,653 | 2017-09-19T15:56:02.000Z | 2022-03-31T18:55:07.000Z | ml-agents-envs/mlagents_envs/registry/base_registry_entry.py | bobcy2015/ml-agents | 5d02292ad889f1884fa98bd92f127f17cbfe0112 | [
"Apache-2.0"
] | 3,623 | 2017-09-20T02:50:20.000Z | 2022-03-31T06:37:25.000Z | ml-agents-envs/mlagents_envs/registry/base_registry_entry.py | bobcy2015/ml-agents | 5d02292ad889f1884fa98bd92f127f17cbfe0112 | [
"Apache-2.0"
] | 4,130 | 2017-09-19T17:36:34.000Z | 2022-03-31T12:54:55.000Z | from abc import abstractmethod
from typing import Any, Optional
from mlagents_envs.base_env import BaseEnv
class BaseRegistryEntry:
def __init__(
self,
identifier: str,
expected_reward: Optional[float],
description: Optional[str],
):
"""
BaseRegistryEntry allows... | 32.561404 | 87 | 0.649246 | from abc import abstractmethod
from typing import Any, Optional
from mlagents_envs.base_env import BaseEnv
class BaseRegistryEntry:
def __init__(
self,
identifier: str,
expected_reward: Optional[float],
description: Optional[str],
):
self._identifier = identifier
... | true | true |
f7200a2703afba3d344293f747d73f0e8c66c472 | 14,266 | py | Python | sdk/python/pulumi_azure_native/storagesync/v20180701/get_registered_server.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20180701/get_registered_server.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20180701/get_registered_server.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 41.71345 | 517 | 0.683233 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'GetRegisteredServerResult',
'AwaitableGetRegisteredServerResult',
'get_registered_server',
]
@pulumi.output_type
class GetRegisteredServerResu... | true | true |
f7200af076a3e5be760cbc8be2e5197296b523de | 428 | py | Python | exams/forms.py | WillOnGit/exam-timetable | fec170025c39144299d61ea323eed3a000b61cf9 | [
"MIT"
] | null | null | null | exams/forms.py | WillOnGit/exam-timetable | fec170025c39144299d61ea323eed3a000b61cf9 | [
"MIT"
] | null | null | null | exams/forms.py | WillOnGit/exam-timetable | fec170025c39144299d61ea323eed3a000b61cf9 | [
"MIT"
] | null | null | null | from .models import ExamVenue
from django.forms import ModelForm
class RestrictedResponseForm(ModelForm):
def __init__(self, *args, **kwargs):
super(RestrictedResponseForm, self).__init__(*args,**kwargs)
try:
self.fields['assigned_venue'].queryset = ExamVenue.objects.filter(exam=self.i... | 35.666667 | 102 | 0.700935 | from .models import ExamVenue
from django.forms import ModelForm
class RestrictedResponseForm(ModelForm):
def __init__(self, *args, **kwargs):
super(RestrictedResponseForm, self).__init__(*args,**kwargs)
try:
self.fields['assigned_venue'].queryset = ExamVenue.objects.filter(exam=self.i... | true | true |
f7200b2aa450884bed39014c6f0f6fc44dd2a5aa | 4,253 | py | Python | src/Infraestructura/ccutils/databases/configuration.py | lbarriosh/cygnus-cloud | 1a17fbb55de69adba2ec42db4c9a063865af4fbd | [
"Apache-2.0"
] | 3 | 2017-09-03T22:01:35.000Z | 2019-01-10T05:40:44.000Z | src/web/CygnusCloud/modules/ccutils/databases/configuration.py | lbarriosh/cygnus-cloud | 1a17fbb55de69adba2ec42db4c9a063865af4fbd | [
"Apache-2.0"
] | null | null | null | src/web/CygnusCloud/modules/ccutils/databases/configuration.py | lbarriosh/cygnus-cloud | 1a17fbb55de69adba2ec42db4c9a063865af4fbd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
'''
========================================================================
CygnusCloud
========================================================================
File: configuration.py
Version: 3.0
Description: Database configurator... | 36.350427 | 151 | 0.556078 |
import MySQLdb
import os.path
from ccutils.processes.childProcessManager import ChildProcessManager
class DBConfigurator(object):
def __init__(self, rootPassword):
self.__rootPassword = rootPassword
def addUser(self, user, password, databaseName, allPrivileges=True):
conn = MySQLdb.C... | true | true |
f7200b3bdc7b35e8600608ed9b126abac2ec17a1 | 557 | py | Python | shop/migrations/0024_auto_20200311_0154.py | manson800819/test | 6df7d92eababe76a54585cb8102a00a6d79ca467 | [
"MIT"
] | null | null | null | shop/migrations/0024_auto_20200311_0154.py | manson800819/test | 6df7d92eababe76a54585cb8102a00a6d79ca467 | [
"MIT"
] | null | null | null | shop/migrations/0024_auto_20200311_0154.py | manson800819/test | 6df7d92eababe76a54585cb8102a00a6d79ca467 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-03-11 01:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('shop', '0023_auto_20200311_0137'),
]
operations =... | 25.318182 | 125 | 0.653501 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('shop', '0023_auto_20200311_0137'),
]
operations = [
migrations.AlterField(
model_name='product',
... | true | true |
f7200b4756a033cb419019d6f292992490dafe65 | 28,992 | py | Python | geoopt/manifolds/base.py | grapefroot/geoopt | 8f219a820e24b87ac68136ff66af11b25d5c04c5 | [
"Apache-2.0"
] | 4 | 2020-01-27T15:37:19.000Z | 2020-12-06T02:51:03.000Z | geoopt/manifolds/base.py | grapefroot/geoopt | 8f219a820e24b87ac68136ff66af11b25d5c04c5 | [
"Apache-2.0"
] | null | null | null | geoopt/manifolds/base.py | grapefroot/geoopt | 8f219a820e24b87ac68136ff66af11b25d5c04c5 | [
"Apache-2.0"
] | 1 | 2021-05-07T22:01:41.000Z | 2021-05-07T22:01:41.000Z | import abc
import torch.nn
import itertools
from typing import Optional, Tuple, Union
__all__ = ["Manifold", "ScalingInfo"]
class ScalingInfo(object):
"""
Scaling info for each argument that requires rescaling.
.. code:: python
scaled_value = value * scaling ** power if power != 0 else value
... | 30.485804 | 117 | 0.559051 | import abc
import torch.nn
import itertools
from typing import Optional, Tuple, Union
__all__ = ["Manifold", "ScalingInfo"]
class ScalingInfo(object):
NotCompatible = object()
__slots__ = ["kwargs", "results"]
def __init__(self, *results: float, **kwargs: float):
self.results = results
... | true | true |
f7200b476d9f3051e09445e9614d3e89cf93fb90 | 256 | py | Python | app/recipe/urls.py | rahulsudhakar10/receipe-api-project | 29f205607905bbee347ea9ca505751f4d4cd508a | [
"MIT"
] | null | null | null | app/recipe/urls.py | rahulsudhakar10/receipe-api-project | 29f205607905bbee347ea9ca505751f4d4cd508a | [
"MIT"
] | null | null | null | app/recipe/urls.py | rahulsudhakar10/receipe-api-project | 29f205607905bbee347ea9ca505751f4d4cd508a | [
"MIT"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
app_name = 'recipe'
urlpatterns = [
path('', include(router.urls))
]
| 17.066667 | 48 | 0.734375 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
app_name = 'recipe'
urlpatterns = [
path('', include(router.urls))
]
| true | true |
f7200bcd5453259f229956e2f1faa902e06be465 | 6,058 | py | Python | selfdrive/controls/lib/longitudinal_planner.py | mogorman/openpilot-1 | 1d19166992149a7dea3536644d67e9e0e2e385fd | [
"MIT"
] | 1 | 2021-06-10T18:00:03.000Z | 2021-06-10T18:00:03.000Z | selfdrive/controls/lib/longitudinal_planner.py | mogorman/openpilot-1 | 1d19166992149a7dea3536644d67e9e0e2e385fd | [
"MIT"
] | 1 | 2021-05-29T00:57:16.000Z | 2021-05-29T00:57:16.000Z | selfdrive/controls/lib/longitudinal_planner.py | mogorman/openpilot-1 | 1d19166992149a7dea3536644d67e9e0e2e385fd | [
"MIT"
] | 2 | 2021-11-16T01:49:54.000Z | 2022-01-14T04:03:23.000Z | #!/usr/bin/env python3
import math
import numpy as np
from common.numpy_fast import interp
from common.cached_params import CachedParams
import cereal.messaging as messaging
from common.realtime import DT_MDL
from selfdrive.modeld.constants import T_IDXS
from selfdrive.config import Conversions as CV
from selfdrive.co... | 40.657718 | 108 | 0.73176 |
import math
import numpy as np
from common.numpy_fast import interp
from common.cached_params import CachedParams
import cereal.messaging as messaging
from common.realtime import DT_MDL
from selfdrive.modeld.constants import T_IDXS
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.longcontrol... | true | true |
f7200bced83e516dd159f591c79e95855c52a38f | 23,009 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_application_gateway_private_endpoint_connections_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 53.509302 | 241 | 0.690556 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f7200c78df71a4b408145caba6e03ce542b4d9df | 3,753 | py | Python | tests/system/action/motion_comment_section/test_sort.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | tests/system/action/motion_comment_section/test_sort.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | 19 | 2021-11-22T16:25:54.000Z | 2021-11-25T13:38:13.000Z | tests/system/action/motion_comment_section/test_sort.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | from openslides_backend.permissions.permissions import Permissions
from tests.system.action.base import BaseActionTestCase
class MotionCommentSectionSortActionTest(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
self.permission_test_model = {
"motion_comment_section/31": ... | 34.75 | 75 | 0.501998 | from openslides_backend.permissions.permissions import Permissions
from tests.system.action.base import BaseActionTestCase
class MotionCommentSectionSortActionTest(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
self.permission_test_model = {
"motion_comment_section/31": ... | true | true |
f7200c97efca195813bca2dc2b1dffe77ce84bea | 4,104 | py | Python | test/functional/feature_includeconf.py | kaboela/litecoinz | b793b04a717416726a7b1013b21b07fb35dbc4a2 | [
"MIT"
] | 8 | 2020-06-05T16:30:36.000Z | 2021-09-28T08:39:52.000Z | test/functional/feature_includeconf.py | kaboela/litecoinz | b793b04a717416726a7b1013b21b07fb35dbc4a2 | [
"MIT"
] | 8 | 2020-04-04T11:24:26.000Z | 2021-05-09T18:53:53.000Z | test/functional/feature_includeconf.py | kaboela/litecoinz | b793b04a717416726a7b1013b21b07fb35dbc4a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests the includeconf argument
Verify that:
1. adding includeconf to the configuration file causes the inc... | 49.445783 | 231 | 0.694932 |
import os
from test_framework.test_framework import BitcoinTestFramework
class IncludeConfTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 1
def setup_chain(self):
super().setup_chain()
with open(os.pa... | true | true |
f72010304316b8649123167ea9d4b94f50b6f1f1 | 25,588 | py | Python | plaidcloud/utilities/tests/test_remote_dimension.py | PlaidCloud/public-utilities | 663e94f2657a02a4249177945e0880bb968c3439 | [
"Apache-2.0"
] | null | null | null | plaidcloud/utilities/tests/test_remote_dimension.py | PlaidCloud/public-utilities | 663e94f2657a02a4249177945e0880bb968c3439 | [
"Apache-2.0"
] | 48 | 2020-10-30T10:15:39.000Z | 2022-03-25T17:23:57.000Z | plaidcloud/utilities/tests/test_remote_dimension.py | PlaidCloud/plaid-utilities | 1031cb87580bbe110f56455925e483a0ae177fe1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import filecmp
import os
import unittest
from unittest import TestCase
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal
from p... | 40.745223 | 126 | 0.523409 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import filecmp
import os
import unittest
from unittest import TestCase
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal
from plaidcloud.utilities.connect import ... | true | true |
f7201125ce532819474be57b6c62cb7fcba4cd59 | 33,749 | py | Python | sdks/python/apache_beam/dataframe/pandas_doctests_test.py | psobot/beam | d9da8a4dc818b01a86d2dce2e78c0d78b47038bb | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2019-07-27T11:54:33.000Z | 2021-06-06T11:53:36.000Z | sdks/python/apache_beam/dataframe/pandas_doctests_test.py | psobot/beam | d9da8a4dc818b01a86d2dce2e78c0d78b47038bb | [
"Apache-2.0",
"BSD-3-Clause"
] | 12 | 2019-04-15T15:27:23.000Z | 2019-07-01T18:13:10.000Z | sdks/python/apache_beam/dataframe/pandas_doctests_test.py | psobot/beam | d9da8a4dc818b01a86d2dce2e78c0d78b47038bb | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-06-03T19:54:48.000Z | 2021-06-03T19:54:48.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 44.406579 | 83 | 0.518919 |
import sys
import unittest
import pandas as pd
from apache_beam.dataframe import doctests
from apache_beam.dataframe.pandas_top_level_functions import _is_top_level_function
@unittest.skipIf(sys.platform == 'win32', '[BEAM-10626]')
class DoctestTest(unittest.TestCase):
def test_ndframe_tests(self)... | true | true |
f720120c884a1396999a7662659cbb6bb8cb01bb | 811 | py | Python | manage.py | oguzhanunlu/validate_json | 79cda734934195bd59055d7f04288a7b538f9542 | [
"Apache-2.0"
] | null | null | null | manage.py | oguzhanunlu/validate_json | 79cda734934195bd59055d7f04288a7b538f9542 | [
"Apache-2.0"
] | null | null | null | manage.py | oguzhanunlu/validate_json | 79cda734934195bd59055d7f04288a7b538f9542 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "validate_json.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure tha... | 35.26087 | 77 | 0.644883 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "validate_json.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportErr... | true | true |
f72012960cef127dbd4634d4f311534488584e40 | 27,649 | py | Python | salt/modules/snapper.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 12 | 2015-01-21T00:18:25.000Z | 2021-07-11T07:35:26.000Z | salt/modules/snapper.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 1 | 2015-10-05T22:03:10.000Z | 2015-10-05T22:03:10.000Z | salt/modules/snapper.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 12 | 2015-01-05T09:50:42.000Z | 2019-08-19T01:43:40.000Z | # -*- coding: utf-8 -*-
'''
Module to manage filesystem snapshots with snapper
.. versionadded:: 2016.11.0
:codeauthor: Duncan Mac-Vicar P. <dmacvicar@suse.de>
:codeauthor: Pablo Suárez Hernández <psuarezhernandez@suse.de>
:depends: ``dbus`` Python module.
:depends: ``snapper`` http://snapper.io, a... | 30.823857 | 126 | 0.619733 |
from __future__ import absolute_import, unicode_literals, print_function
import logging
import os
import time
import difflib
try:
from pwd import getpwuid
HAS_PWD = True
except ImportError:
HAS_PWD = False
from salt.exceptions import CommandExecutionError
import salt.utils.files
from salt.ext import s... | true | true |
f72013a2dc273fdddd592328a01ea75807d6c262 | 1,098 | py | Python | cli/tests/test_managers/test_run.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | cli/tests/test_managers/test_run.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | cli/tests/test_managers/test_run.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2019 Polyaxon, 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 o... | 30.5 | 74 | 0.762295 |
from __future__ import absolute_import, division, print_function
from unittest import TestCase
import pytest
from polyaxon_sdk import V1Run
from polyaxon.managers.run import RunManager
@pytest.mark.managers_mark
class TestRunManager(TestCase):
def test_default_props(self):
assert RunM... | true | true |
f720140e054f1279701550bef9197a63ff8e51bf | 88,490 | py | Python | src/neo4j_loader/load_csv_data.py | cebriggs7135/ontology-api | 4d2512dcec532cfdfdcd5ff88216e402afbbe2af | [
"MIT"
] | null | null | null | src/neo4j_loader/load_csv_data.py | cebriggs7135/ontology-api | 4d2512dcec532cfdfdcd5ff88216e402afbbe2af | [
"MIT"
] | null | null | null | src/neo4j_loader/load_csv_data.py | cebriggs7135/ontology-api | 4d2512dcec532cfdfdcd5ff88216e402afbbe2af | [
"MIT"
] | null | null | null | '''
Created on Oct 20, 2020
@author: chb69
'''
import sys
import os
import types
import mysql.connector
from mysql.connector import errorcode
import csv
import argparse
"""
this list includes the prefixes for several informatics resources found in the PheKnowLator mapping data.
This might be useful ... | 44.691919 | 234 | 0.609108 |
import sys
import os
import types
import mysql.connector
from mysql.connector import errorcode
import csv
import argparse
config = {}
def load_config(root_path, filename):
filename = os.path.join(root_path, filename)
d = types.ModuleType("config")
d.__file__ = filename
return_dict = {}
try:
... | true | true |
f7201460d7fc455a3f1d476f67b45706ae5482ed | 4,736 | py | Python | baselines/Termination_DEOC/run_atari_miniworld.py | anandkamat05/TDEOC | 11749457c3a7550e11ba1acc4784e8545f8087aa | [
"MIT"
] | 5 | 2020-11-10T21:38:04.000Z | 2021-08-11T01:34:50.000Z | baselines/Termination_DEOC/run_atari_miniworld.py | LARS12llt/TDEOC | 11749457c3a7550e11ba1acc4784e8545f8087aa | [
"MIT"
] | 8 | 2020-09-26T01:31:02.000Z | 2022-02-10T02:19:53.000Z | baselines/Termination_DEOC/run_atari_miniworld.py | LARS12llt/TDEOC | 11749457c3a7550e11ba1acc4784e8545f8087aa | [
"MIT"
] | 1 | 2020-11-18T03:20:26.000Z | 2020-11-18T03:20:26.000Z | # !/usr/bin/env python
from baselines.common import set_global_seeds, tf_util as U
from baselines import bench
import os.path as osp
import gym, logging
from mpi4py import MPI
import pdb
from gym_extensions.continuous import mujoco
import gym_miniworld
from baselines import logger
import sys
def train(env_id, num_tim... | 47.36 | 174 | 0.655617 |
from baselines.common import set_global_seeds, tf_util as U
from baselines import bench
import os.path as osp
import gym, logging
from mpi4py import MPI
import pdb
from gym_extensions.continuous import mujoco
import gym_miniworld
from baselines import logger
import sys
def train(env_id, num_timesteps, seed, num_opti... | true | true |
f72014b925bc545ca989597e22d048c3a184e38f | 1,430 | py | Python | Transposition/transpositionFileCipher.py | a1exlism/HackingSecretCiphersWithPy | d7ec59d9eb5c5ae55c68ce911a3973ae0c526698 | [
"MIT"
] | null | null | null | Transposition/transpositionFileCipher.py | a1exlism/HackingSecretCiphersWithPy | d7ec59d9eb5c5ae55c68ce911a3973ae0c526698 | [
"MIT"
] | null | null | null | Transposition/transpositionFileCipher.py | a1exlism/HackingSecretCiphersWithPy | d7ec59d9eb5c5ae55c68ce911a3973ae0c526698 | [
"MIT"
] | null | null | null | import os, sys, time, Transposition.transpositionEncrypt as ENC, \
Transposition.transpositionDecrypt as DEC
def main():
f_key = 10
# f_mode = 'encrypt'
f_mode = 'decrypt'
if f_mode == 'decrypt':
input_filename = 'frankenstein.encrypt.txt'
else:
input_filename = 'frankenstein.t... | 28.039216 | 88 | 0.636364 | import os, sys, time, Transposition.transpositionEncrypt as ENC, \
Transposition.transpositionDecrypt as DEC
def main():
f_key = 10
f_mode = 'decrypt'
if f_mode == 'decrypt':
input_filename = 'frankenstein.encrypt.txt'
else:
input_filename = 'frankenstein.txt'
output_file... | true | true |
f720154bd7ce3ed32ed597d87d874fe71e148ab1 | 7,664 | py | Python | test/jit/test_misc.py | metacpp/pytorch | 1e7a4d6bbe1fac4fb94f6b62f24c6e242db1e952 | [
"Intel"
] | 1 | 2022-03-02T00:28:04.000Z | 2022-03-02T00:28:04.000Z | test/jit/test_misc.py | metacpp/pytorch | 1e7a4d6bbe1fac4fb94f6b62f24c6e242db1e952 | [
"Intel"
] | 1 | 2022-03-01T06:10:50.000Z | 2022-03-01T06:10:50.000Z | test/jit/test_misc.py | metacpp/pytorch | 1e7a4d6bbe1fac4fb94f6b62f24c6e242db1e952 | [
"Intel"
] | null | null | null | # Owner(s): ["oncall: jit"]
from typing import Any, Dict, List, Optional, Tuple
from torch.testing._internal.jit_utils import JitTestCase, make_global
from torch.testing import FileCheck
from torch import jit
from jit.test_module_interface import TestModuleInterface # noqa: F401
import os
import sys
import torch
imp... | 33.762115 | 106 | 0.584551 |
from typing import Any, Dict, List, Optional, Tuple
from torch.testing._internal.jit_utils import JitTestCase, make_global
from torch.testing import FileCheck
from torch import jit
from jit.test_module_interface import TestModuleInterface
import os
import sys
import torch
import torch.testing._internal.jit_utils
i... | true | true |
f72015bb9160c0942bb83fe1f3d4aa6377a9797d | 5,563 | py | Python | natlas-server/app/elastic/client.py | m4rcu5/natlas | d1057c5349a5443cecffb3db9a6428f7271b07ad | [
"Apache-2.0"
] | null | null | null | natlas-server/app/elastic/client.py | m4rcu5/natlas | d1057c5349a5443cecffb3db9a6428f7271b07ad | [
"Apache-2.0"
] | null | null | null | natlas-server/app/elastic/client.py | m4rcu5/natlas | d1057c5349a5443cecffb3db9a6428f7271b07ad | [
"Apache-2.0"
] | null | null | null | import json
from config import Config
import elasticsearch
import time
from datetime import datetime
import logging
from opencensus.trace import execution_context
from opencensus.trace import span as span_module
import semver
class ElasticClient:
es = None
lastReconnectAttempt = None
mapping = {}
natlasIndices = ... | 35.660256 | 145 | 0.732339 | import json
from config import Config
import elasticsearch
import time
from datetime import datetime
import logging
from opencensus.trace import execution_context
from opencensus.trace import span as span_module
import semver
class ElasticClient:
es = None
lastReconnectAttempt = None
mapping = {}
natlasIndices = ... | true | true |
f7201983075ff6e117cd811c5af6d092bb3c77bd | 79,711 | py | Python | src/pretix/control/views/orders.py | joelbcastillo/pretix | 1005437c69d5fed2a0ea2525b41481b0952fe6f1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/control/views/orders.py | joelbcastillo/pretix | 1005437c69d5fed2a0ea2525b41481b0952fe6f1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-06-12T00:09:40.000Z | 2020-06-12T00:09:40.000Z | src/pretix/control/views/orders.py | joelbcastillo/pretix | 1005437c69d5fed2a0ea2525b41481b0952fe6f1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import json
import logging
import mimetypes
import os
import re
from datetime import datetime, time, timedelta
from decimal import Decimal, DecimalException
from urllib.parse import urlencode
import vat_moss.id
from django.conf import settings
from django.contrib import messages
from django.core.files import File
from... | 42.264581 | 154 | 0.575303 | import json
import logging
import mimetypes
import os
import re
from datetime import datetime, time, timedelta
from decimal import Decimal, DecimalException
from urllib.parse import urlencode
import vat_moss.id
from django.conf import settings
from django.contrib import messages
from django.core.files import File
from... | true | true |
f7201a7642abbd76d0bee748789b15d308c71b10 | 9,682 | py | Python | vspk/cli/cli.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | 19 | 2016-03-07T12:34:22.000Z | 2020-06-11T11:09:02.000Z | vspk/cli/cli.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | 40 | 2016-06-13T15:36:54.000Z | 2020-11-10T18:14:43.000Z | vspk/cli/cli.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | 15 | 2016-06-10T22:06:01.000Z | 2020-12-15T18:37:42.000Z | #!/usr/bin/env python
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
... | 68.666667 | 232 | 0.727639 |
import argparse
import sys
sys.path.append("../")
class _HelpAction(argparse._HelpAction):
def __call__(self, parser, namespace, values, option_string=None):
parser.print_help()
subparsers_actions = [
action for action in parser._actions
if isi... | true | true |
f7201ae4d61deb09277603a9c4d12dfb5b5dd40b | 1,565 | py | Python | deepmath/deephol/public/proof_assistant.py | LaudateCorpus1/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | [
"Apache-2.0"
] | 830 | 2016-11-07T21:46:27.000Z | 2022-03-23T08:01:03.000Z | deepmath/deephol/public/proof_assistant.py | LaudateCorpus1/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | [
"Apache-2.0"
] | 26 | 2016-11-07T22:06:31.000Z | 2022-02-16T00:18:29.000Z | deepmath/deephol/public/proof_assistant.py | LaudateCorpus1/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | [
"Apache-2.0"
] | 168 | 2016-11-07T21:48:55.000Z | 2022-03-19T02:47:14.000Z | """A python client interface for ProofAssistantService."""
from __future__ import absolute_import
from __future__ import division
# Import Type Annotations
from __future__ import print_function
import grpc
import tensorflow as tf
from deepmath.proof_assistant import proof_assistant_pb2
from deepmath.proof_assistant im... | 36.395349 | 80 | 0.771885 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import grpc
import tensorflow as tf
from deepmath.proof_assistant import proof_assistant_pb2
from deepmath.proof_assistant import proof_assistant_pb2_grpc
tf.flags.DEFINE_string(
'proof_assistant_server_a... | true | true |
f7201bd62f21c953c3e3878bc9213acf8336f68d | 1,120 | py | Python | src/data_utils/image_dataset.py | lindsey98/dml_cross_entropy | 4312cb295e972abda7b0e2bdadecf1965c5d7ed5 | [
"BSD-3-Clause"
] | null | null | null | src/data_utils/image_dataset.py | lindsey98/dml_cross_entropy | 4312cb295e972abda7b0e2bdadecf1965c5d7ed5 | [
"BSD-3-Clause"
] | null | null | null | src/data_utils/image_dataset.py | lindsey98/dml_cross_entropy | 4312cb295e972abda7b0e2bdadecf1965c5d7ed5 | [
"BSD-3-Clause"
] | null | null | null | from PIL import Image
from torch.utils.data import Dataset
from src.data_utils.utils import load_data
class ImageDataset(Dataset):
def __init__(self, samples: list, transform, preload: bool = False, num_workers=None):
self.transform = transform
self.samples = samples
self.targets = [label... | 31.111111 | 101 | 0.63125 | from PIL import Image
from torch.utils.data import Dataset
from src.data_utils.utils import load_data
class ImageDataset(Dataset):
def __init__(self, samples: list, transform, preload: bool = False, num_workers=None):
self.transform = transform
self.samples = samples
self.targets = [label... | true | true |
f7201d90ee64fded6d4df4a84c0dcb782c4684f0 | 20,761 | py | Python | Lib/site-packages/git/objects/commit.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/git/objects/commit.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 7 | 2020-02-12T03:06:52.000Z | 2021-06-10T19:33:14.000Z | Lib/site-packages/git/objects/commit.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | null | null | null | # commit.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from gitdb import IStream
from git.util import (
hex_to_bin,
Actor,
Iterable,
Stats,
... | 38.878277 | 119 | 0.607822 |
from gitdb import IStream
from git.util import (
hex_to_bin,
Actor,
Iterable,
Stats,
finalize_process
)
from git.diff import Diffable
from .tree import Tree
from . import base
from .util import (
Traversable,
Serializable,
parse_date,
altz_to_utctz_str,
parse_actor_and_dat... | true | true |
f7201e595590259f3f2e768dbecb2c84ac98021f | 14,932 | py | Python | run_validation.py | ASinanSaglam/atomizer_analysis | 8dfc1230b2ad0c691885f8fd7119d6169cd7d1ed | [
"MIT"
] | null | null | null | run_validation.py | ASinanSaglam/atomizer_analysis | 8dfc1230b2ad0c691885f8fd7119d6169cd7d1ed | [
"MIT"
] | null | null | null | run_validation.py | ASinanSaglam/atomizer_analysis | 8dfc1230b2ad0c691885f8fd7119d6169cd7d1ed | [
"MIT"
] | null | null | null | # %matplotlib notebook
import os, re, sys, urllib, requests, base64, IPython, io, pickle, glob
sys.path.append("/home/monoid/Development/fresh_atomizer_checks/atomizer/SBMLparser/test/manual")
import itertools as itt
import numpy as np
import subprocess as sb
import pandas as pd
import matplotlib.pyplot as plt
import m... | 47.858974 | 141 | 0.575676 |
import os, re, sys, urllib, requests, base64, IPython, io, pickle, glob
sys.path.append("/home/monoid/Development/fresh_atomizer_checks/atomizer/SBMLparser/test/manual")
import itertools as itt
import numpy as np
import subprocess as sb
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpi... | true | true |
f7201f03fb11fc26e5295dea810629ac3fa330da | 5,030 | py | Python | cedar/forms.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | cedar/forms.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | 11 | 2020-03-24T15:29:46.000Z | 2022-03-11T23:14:48.000Z | cedar/forms.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | from os.path import join
from email.mime.image import MIMEImage
from django.conf import settings
from django.forms import ModelForm, ValidationError, ChoiceField
from django.forms.models import BaseInlineFormSet
from django.forms.models import inlineformset_factory
from django.contrib.auth.forms import ReadOnlyPasswor... | 43.362069 | 110 | 0.663022 | from os.path import join
from email.mime.image import MIMEImage
from django.conf import settings
from django.forms import ModelForm, ValidationError, ChoiceField
from django.forms.models import BaseInlineFormSet
from django.forms.models import inlineformset_factory
from django.contrib.auth.forms import ReadOnlyPasswor... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.