hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2cf82cd0a659ee5f05ba5bb1d2a9465cbdc517 | 5,960 | py | Python | py3status/constants.py | obestwalter/py3status | a79d50ae252626bacb14bfcc8f369e59ae500fd1 | [
"BSD-3-Clause"
] | null | null | null | py3status/constants.py | obestwalter/py3status | a79d50ae252626bacb14bfcc8f369e59ae500fd1 | [
"BSD-3-Clause"
] | null | null | null | py3status/constants.py | obestwalter/py3status | a79d50ae252626bacb14bfcc8f369e59ae500fd1 | [
"BSD-3-Clause"
] | null | null | null | # This file contains various useful constants for py3status
GENERAL_DEFAULTS = {
"color_bad": "#FF0000",
"color_degraded": "#FFFF00",
"color_good": "#00FF00",
"color_separator": "#333333",
"colors": False,
"interval": 5,
"output_format": "i3bar",
}
MAX_NESTING_LEVELS = 4
TIME_FORMAT = "%Y... | 26.607143 | 84 | 0.568121 |
GENERAL_DEFAULTS = {
"color_bad": "#FF0000",
"color_degraded": "#FFFF00",
"color_good": "#00FF00",
"color_separator": "#333333",
"colors": False,
"interval": 5,
"output_format": "i3bar",
}
MAX_NESTING_LEVELS = 4
TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
TZTIME_FORMAT = "%Y-%m-%d %H:%M:%S %Z"
T... | true | true |
1c2cf8860a5d04aba92fd23ccf7aa4598225d065 | 6,749 | py | Python | SDE_CG_C/utils/evaluation.py | Zhanghaotian1/SDE_conf | 90773e807ab8ccdc1963e113a2c72df16b8899c1 | [
"MIT"
] | null | null | null | SDE_CG_C/utils/evaluation.py | Zhanghaotian1/SDE_conf | 90773e807ab8ccdc1963e113a2c72df16b8899c1 | [
"MIT"
] | null | null | null | SDE_CG_C/utils/evaluation.py | Zhanghaotian1/SDE_conf | 90773e807ab8ccdc1963e113a2c72df16b8899c1 | [
"MIT"
] | 1 | 2022-01-28T07:56:28.000Z | 2022-01-28T07:56:28.000Z | import numpy as np
from tqdm.auto import tqdm
import torch
from torch_geometric.data import Data
from rdkit import Chem
from rdkit.Chem.rdForceFieldHelpers import MMFFOptimizeMolecule
from SDE_CG import utils
def get_rmsd_confusion_matrix(data: Data, useFF=False):
data.pos_ref = data.pos_ref.view(-1, data.num_n... | 36.090909 | 154 | 0.59594 | import numpy as np
from tqdm.auto import tqdm
import torch
from torch_geometric.data import Data
from rdkit import Chem
from rdkit.Chem.rdForceFieldHelpers import MMFFOptimizeMolecule
from SDE_CG import utils
def get_rmsd_confusion_matrix(data: Data, useFF=False):
data.pos_ref = data.pos_ref.view(-1, data.num_n... | true | true |
1c2cfa067573151f4c0869d0c10acd318d538534 | 6,182 | py | Python | src/clustering.py | DianaLaboratory/DeepTSS | 9f6d7cb94268aedbd9d38944ee6707ef9d6df882 | [
"MIT"
] | null | null | null | src/clustering.py | DianaLaboratory/DeepTSS | 9f6d7cb94268aedbd9d38944ee6707ef9d6df882 | [
"MIT"
] | null | null | null | src/clustering.py | DianaLaboratory/DeepTSS | 9f6d7cb94268aedbd9d38944ee6707ef9d6df882 | [
"MIT"
] | null | null | null | import pandas as pd
import multiprocessing as mp
import time
import os
from src.FindClusters import *
from src.Func import *
def _args_(input_file):
filename = os.path.basename(input_file)
name = os.path.splitext(filename)[0]
return(filename, name)
def findAllRepresentatives(line):
line = line.split('... | 38.160494 | 165 | 0.620511 | import pandas as pd
import multiprocessing as mp
import time
import os
from src.FindClusters import *
from src.Func import *
def _args_(input_file):
filename = os.path.basename(input_file)
name = os.path.splitext(filename)[0]
return(filename, name)
def findAllRepresentatives(line):
line = line.split('... | true | true |
1c2cfa1530e0657a58165e5b7d251745010afaf6 | 113,256 | py | Python | pysnmp-with-texts/DATALINK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/DATALINK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/DATALINK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module DATALINK-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DATALINK-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:37:02 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019,... | 104.191352 | 8,402 | 0.772807 |
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint = mibBuild... | true | true |
1c2cfa80fe0b2e9e9f4ad971d95c5e54f8d46cb0 | 7,054 | py | Python | google/ads/google_ads/v1/proto/enums/local_placeholder_field_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/proto/enums/local_placeholder_field_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/proto/enums/local_placeholder_field_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v1/proto/enums/local_placeholder_field.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mess... | 41.251462 | 1,279 | 0.759002 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db =... | true | true |
1c2cfac891f520e4a1fb7ea15d7dcced206469ae | 3,044 | py | Python | tests/test_put_no_body.py | Aryabhata-Rootspring/fastapi | f6237ad05a8468ac19c591181adad38d75372c46 | [
"MIT"
] | 53,007 | 2018-12-08T10:05:29.000Z | 2022-03-31T23:30:02.000Z | tests/test_put_no_body.py | Aryabhata-Rootspring/fastapi | f6237ad05a8468ac19c591181adad38d75372c46 | [
"MIT"
] | 4,155 | 2019-01-05T05:07:49.000Z | 2022-03-31T21:25:38.000Z | tests/test_put_no_body.py | Aryabhata-Rootspring/fastapi | f6237ad05a8468ac19c591181adad38d75372c46 | [
"MIT"
] | 4,092 | 2018-12-09T16:21:00.000Z | 2022-03-31T07:59:45.000Z | from fastapi import FastAPI
from fastapi.testclient import TestClient
app = FastAPI()
@app.put("/items/{item_id}")
def save_item_no_body(item_id: str):
return {"item_id": item_id}
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"pa... | 31.061224 | 86 | 0.396518 | from fastapi import FastAPI
from fastapi.testclient import TestClient
app = FastAPI()
@app.put("/items/{item_id}")
def save_item_no_body(item_id: str):
return {"item_id": item_id}
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"pa... | true | true |
1c2cfb5cc57393f63b906668f0e0cb4b599d3a76 | 16,940 | py | Python | tasks/uk/cdrc.py | CartoDB/bigmetadata | a32325382500f23b8a607e4e02cc0ec111360869 | [
"BSD-3-Clause"
] | 45 | 2015-12-14T03:05:55.000Z | 2021-06-29T22:46:40.000Z | tasks/uk/cdrc.py | CartoDB/bigmetadata | a32325382500f23b8a607e4e02cc0ec111360869 | [
"BSD-3-Clause"
] | 480 | 2016-02-19T15:58:44.000Z | 2021-09-10T16:38:56.000Z | tasks/uk/cdrc.py | CartoDB/bigmetadata | a32325382500f23b8a607e4e02cc0ec111360869 | [
"BSD-3-Clause"
] | 13 | 2016-08-09T21:03:02.000Z | 2020-04-29T23:40:20.000Z | # https://data.cdrc.ac.uk/dataset/cdrc-2011-oac-geodata-pack-uk
from tasks.base_tasks import (ColumnsTask, TableTask, TagsTask, RepoFileUnzipTask, GeoFile2TempTableTask, MetaWrapper,
SimplifiedTempTableTask, RepoFile)
from tasks.util import shell, copyfile
from tasks.meta import GEOM_REF, ... | 40.23753 | 688 | 0.56588 |
from tasks.base_tasks import (ColumnsTask, TableTask, TagsTask, RepoFileUnzipTask, GeoFile2TempTableTask, MetaWrapper,
SimplifiedTempTableTask, RepoFile)
from tasks.util import shell, copyfile
from tasks.meta import GEOM_REF, OBSColumn, OBSTable, OBSTag, current_session
from tasks.tags im... | true | true |
1c2cfc9242442269152f6a43cae72f34671bae84 | 2,493 | pyw | Python | pyqt/chap04/connections.pyw | liuyangyang2015/PythonDemo | a72c009a31ff833dd12405bb97e688ae91ceda6c | [
"MIT"
] | null | null | null | pyqt/chap04/connections.pyw | liuyangyang2015/PythonDemo | a72c009a31ff833dd12405bb97e688ae91ceda6c | [
"MIT"
] | null | null | null | pyqt/chap04/connections.pyw | liuyangyang2015/PythonDemo | a72c009a31ff833dd12405bb97e688ae91ceda6c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2008-9 Qtrac Ltd. All rights reserved.
# This program or module 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 2 of the License, or
# version 3 of the Lic... | 33.24 | 74 | 0.657441 |
import functools
import sys
from PyQt4.QtCore import (Qt, SIGNAL)
from PyQt4.QtGui import (QApplication, QDialog, QHBoxLayout, QLabel,
QPushButton)
class Form(QDialog):
def __init__(self, parent=None):
super(Form, self).__init__(parent)
button1 = QPushButton("One")
but... | true | true |
1c2cfcf83bf68feb3e9f4c26b9bb7bfa82a0b0d2 | 6,849 | py | Python | tools/win32spawn.py | rockonedege/rt-thread | 4fe6c709d0bfe719bed6c927f0144ba373bbda5a | [
"Apache-2.0"
] | 7,482 | 2015-01-01T09:23:08.000Z | 2022-03-31T19:34:05.000Z | tools/win32spawn.py | rockonedege/rt-thread | 4fe6c709d0bfe719bed6c927f0144ba373bbda5a | [
"Apache-2.0"
] | 2,543 | 2015-01-09T02:01:34.000Z | 2022-03-31T23:10:14.000Z | tools/win32spawn.py | rockonedege/rt-thread | 4fe6c709d0bfe719bed6c927f0144ba373bbda5a | [
"Apache-2.0"
] | 4,645 | 2015-01-06T07:05:31.000Z | 2022-03-31T18:21:50.000Z | #
# File : win32spawn.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# 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 2 ... | 36.822581 | 129 | 0.644182 |
import os
import threading
import sys
_PY2 = sys.version_info[0] < 3
if _PY2:
import Queue
else:
import queue as Queue
import win32file
import win32pipe
import win32api
import win32con
import win32security
import win32process
import win32event
class Win32Spawn(object):
def __init... | true | true |
1c2cfd302a926b47ec24637ef7aa8c154993ec38 | 24,689 | py | Python | arim/plot.py | will-jj/arim | fc15efe171a41355090123fcea10406ee75efe31 | [
"MIT"
] | 14 | 2019-04-05T13:43:36.000Z | 2022-02-01T21:38:19.000Z | arim/plot.py | will-jj/arim | fc15efe171a41355090123fcea10406ee75efe31 | [
"MIT"
] | 2 | 2019-04-09T10:38:26.000Z | 2019-06-17T16:23:16.000Z | arim/plot.py | will-jj/arim | fc15efe171a41355090123fcea10406ee75efe31 | [
"MIT"
] | 5 | 2019-04-04T17:02:20.000Z | 2020-09-30T15:36:03.000Z | """
Plotting utilities based on `matplotib <http://matplotlib.org/>`_.
Some default values are configurable via the dictionary ``arim.plot.conf``.
.. py:data:: conf
Dictionary of default values. For some functions, if an argument is not populated,
its values will be populated from this dictionary. Example::
... | 26.292865 | 116 | 0.600348 |
from warnings import warn
import logging
from matplotlib import ticker
from mpl_toolkits import axes_grid1
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal
from . import ut
from .exceptions import ArimWarning
from . import geometry as g
from .config import Config
__all__ = [
"micro_formatt... | true | true |
1c2cfdef260371d2f04c95b5d6fd301a62493e68 | 1,149 | py | Python | commserver/setup.py | ErathosthemesAmmoro/track-communities | 7afd60aaa62ed0b81c7f785974ea0a8687ea136e | [
"Apache-2.0"
] | 12 | 2015-02-02T13:13:52.000Z | 2022-03-16T12:35:32.000Z | commserver/setup.py | ErathosthemesAmmoro/track-communities | 7afd60aaa62ed0b81c7f785974ea0a8687ea136e | [
"Apache-2.0"
] | null | null | null | commserver/setup.py | ErathosthemesAmmoro/track-communities | 7afd60aaa62ed0b81c7f785974ea0a8687ea136e | [
"Apache-2.0"
] | 3 | 2015-10-05T00:27:38.000Z | 2020-03-02T17:51:39.000Z | #
# Copyright 2016 Sotera Defense Solutions Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License”);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 32.828571 | 104 | 0.750218 |
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRAN... | true | true |
1c2cfe6635d76e5fb69b8e012ff32daa23046125 | 567 | py | Python | estoque/migrations/0003_auto_20190619_1852.py | Felipebros/mini_curso_django | 965dd5e8837db9dea4485e889c2b8703fb5e902d | [
"MIT"
] | 8 | 2019-06-18T20:20:39.000Z | 2019-11-09T20:21:06.000Z | estoque/migrations/0003_auto_20190619_1852.py | Felipebros/mini_curso_django | 965dd5e8837db9dea4485e889c2b8703fb5e902d | [
"MIT"
] | 8 | 2019-12-04T23:26:42.000Z | 2022-02-10T12:02:19.000Z | estoque/migrations/0003_auto_20190619_1852.py | Felipebros/mini_curso_django | 965dd5e8837db9dea4485e889c2b8703fb5e902d | [
"MIT"
] | 3 | 2019-06-21T22:37:32.000Z | 2019-10-31T00:38:45.000Z | # Generated by Django 2.2.2 on 2019-06-19 21:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('estoque', '0002_auto_20190619_1735'),
]
operations = [
migrations.AlterField(
model_name='estoque',
name='tipo_movim... | 29.842105 | 219 | 0.634921 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('estoque', '0002_auto_20190619_1735'),
]
operations = [
migrations.AlterField(
model_name='estoque',
name='tipo_movimentacao',
field=models.CharField(ch... | true | true |
1c2cfe6f65b98c8add69de13446ed21f91e4e0cb | 23,312 | py | Python | families/block_info/sawtooth_block_info/protobuf/state_context_pb2.py | shmup/sawtooth-core | 301655857205f677b0f9383812aaefecd27cc048 | [
"Apache-2.0"
] | 1 | 2021-06-09T19:25:41.000Z | 2021-06-09T19:25:41.000Z | families/block_info/sawtooth_block_info/protobuf/state_context_pb2.py | shmup/sawtooth-core | 301655857205f677b0f9383812aaefecd27cc048 | [
"Apache-2.0"
] | null | null | null | families/block_info/sawtooth_block_info/protobuf/state_context_pb2.py | shmup/sawtooth-core | 301655857205f677b0f9383812aaefecd27cc048 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sawtooth_block_info/protobuf/state_context.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.p... | 34.536296 | 2,065 | 0.754247 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
1c2cfea1595e21192e774b30ce71c1553103954c | 3,344 | py | Python | src/minecraft/monitor/simple_latency_strategy.py | Cameron-Alberts/MinecraftProcessManager | 6ea8b4035fee59ca11f1d8d69df2c6237239d898 | [
"MIT"
] | null | null | null | src/minecraft/monitor/simple_latency_strategy.py | Cameron-Alberts/MinecraftProcessManager | 6ea8b4035fee59ca11f1d8d69df2c6237239d898 | [
"MIT"
] | null | null | null | src/minecraft/monitor/simple_latency_strategy.py | Cameron-Alberts/MinecraftProcessManager | 6ea8b4035fee59ca11f1d8d69df2c6237239d898 | [
"MIT"
] | null | null | null | import logging as log
from .health_monitor_strategy import AbstractHealthMonitorStrategy
class SimpleLatencyHealthMonitorStrategy(AbstractHealthMonitorStrategy):
def __init__(self,
max_latency_in_seconds=1.0,
number_of_pings=5,
health_checks_queue_size=5,
... | 49.176471 | 111 | 0.659988 | import logging as log
from .health_monitor_strategy import AbstractHealthMonitorStrategy
class SimpleLatencyHealthMonitorStrategy(AbstractHealthMonitorStrategy):
def __init__(self,
max_latency_in_seconds=1.0,
number_of_pings=5,
health_checks_queue_size=5,
... | true | true |
1c2cfed1333a7025da594f0f50f1a8d2d2f9bc29 | 17,151 | py | Python | models/convert.py | zongdaoming/TinyTransformer | 8e64f8816117048c388b4b20e3a56760ce149fe3 | [
"Apache-2.0"
] | 2 | 2021-08-08T11:23:14.000Z | 2021-09-16T04:05:23.000Z | models/convert.py | zongdaoming/TinyTransformer | 8e64f8816117048c388b4b20e3a56760ce149fe3 | [
"Apache-2.0"
] | 1 | 2021-08-08T11:25:47.000Z | 2021-08-08T11:26:15.000Z | models/convert.py | zongdaoming/TinyTransformer | 8e64f8816117048c388b4b20e3a56760ce149fe3 | [
"Apache-2.0"
] | null | null | null | '''
Author: your name
Date: 2021-08-31 21:36:45
LastEditTime: 2021-08-31 22:09:43
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: /models/SmallT/convert.py
'''
import torch
import sys
from torch.autograd import Variable
from os.path import splitext, getsize
from spring.nart.tools.pytorc... | 42.140049 | 133 | 0.656055 | import torch
import sys
from torch.autograd import Variable
from os.path import splitext, getsize
from spring.nart.tools.pytorch.onnx_utils import load
from spring.nart.tools.pytorch.network_utils import make_network
from spring.nart.tools.pytorch.module_utils import convert_mode
import threading
from spring.nart.tools... | true | true |
1c2cff4cf4924b3b8ab3e9ab411e4d167ad36b35 | 4,470 | py | Python | scripts/bump-version.py | dsblank/jupyterlite | b51c265dd7450bd053a0ad2f8d5cd94a70cb0669 | [
"BSD-3-Clause"
] | 2 | 2021-09-18T03:05:02.000Z | 2021-11-15T11:55:30.000Z | scripts/bump-version.py | dsblank/jupyterlite | b51c265dd7450bd053a0ad2f8d5cd94a70cb0669 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T12:32:29.000Z | 2022-03-31T12:32:29.000Z | scripts/bump-version.py | dsblank/jupyterlite | b51c265dd7450bd053a0ad2f8d5cd94a70cb0669 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.import click
# Heavily inspired by:
# - https://github.com/jupyterlab/jupyterlab/blob/master/buildutils/src/bumpversion.ts
# - https://github.com/jupyterlab/retrolab/blob/main/buildutils/src/release-bump.ts
# - https://... | 30.616438 | 98 | 0.655705 |
import json
from pathlib import Path
import click
from jupyter_releaser.util import get_version, is_prerelease, run
OPTIONS = ["major", "minor", "release", "build"]
ENC = dict(encoding="utf-8")
ROOT = Path(__file__).parent.parent
ROOT_PACKAGE_JSON = ROOT / "package.json"
APP_PACKAGE_JSON = ROOT / "app" / "p... | true | true |
1c2cff78866cc8542cc4ff5da7ec91714d669ea9 | 8,198 | py | Python | websocketsip.py | thr0wforks/pjsip-through-websocket-demo | 3b141fde4d39b0b59c788733903963a85e7661f5 | [
"MIT"
] | null | null | null | websocketsip.py | thr0wforks/pjsip-through-websocket-demo | 3b141fde4d39b0b59c788733903963a85e7661f5 | [
"MIT"
] | null | null | null | websocketsip.py | thr0wforks/pjsip-through-websocket-demo | 3b141fde4d39b0b59c788733903963a85e7661f5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import signal
import pjsua as pj
import logging
import logging.config
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from jsonrpc import JSONRPCResponseManager, dispatcher
from jsonrpc.jsonrpc2 import JSONRPC20Request
import sys
if ... | 30.589552 | 80 | 0.58685 |
import os
import sys
import signal
import pjsua as pj
import logging
import logging.config
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from jsonrpc import JSONRPCResponseManager, dispatcher
from jsonrpc.jsonrpc2 import JSONRPC20Request
import sys
if sys.version_info.major == 3:
unicode = s... | true | true |
1c2d003aea679272b6063971b88bad61c6b7d23b | 77,924 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ip_rsvp_cfg.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ip_rsvp_cfg.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ip_rsvp_cfg.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-07-22T04:04:44.000Z | 2020-07-22T04:04:44.000Z | """ Cisco_IOS_XR_ip_rsvp_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR ip\-rsvp package configuration.
This module contains definitions
for the following management objects\:
rsvp\: Global RSVP configuration commands
This YANG module augments the
Cisco\-IOS\-XR\-snmp\-agent\-cfg
mo... | 39.615658 | 436 | 0.512576 | from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelError
from ydk.errors.error_handler import handle_type_error as _handle_type_error
cl... | true | true |
1c2d005be4a9936657d02d76301a9f51bdffde72 | 10,986 | py | Python | dwave/system/composites/virtual_graph.py | mdecandia/dwave-system | 263c3cf0f0053ade092c4b72c22d4201148f7ec6 | [
"Apache-2.0"
] | null | null | null | dwave/system/composites/virtual_graph.py | mdecandia/dwave-system | 263c3cf0f0053ade092c4b72c22d4201148f7ec6 | [
"Apache-2.0"
] | null | null | null | dwave/system/composites/virtual_graph.py | mdecandia/dwave-system | 263c3cf0f0053ade092c4b72c22d4201148f7ec6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.477733 | 108 | 0.633261 |
import dimod
from dwave.system.composites.embedding import FixedEmbeddingComposite
from dwave.system.flux_bias_offsets import get_flux_biases
FLUX_BIAS_KWARG = 'flux_biases'
__all__ = ['VirtualGraphComposite']
class VirtualGraphComposite(FixedEmbeddingComposite):
def __init__(self, sampler, em... | true | true |
1c2d00aed8665fd04416d0f7b83afbb2c85fa80a | 25,632 | py | Python | tests/python/contrib/test_onnx.py | wjj19950828/tvm | 9c63f4fc318652f6fff68342da2d11b26592a3e0 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 3 | 2021-05-08T17:04:39.000Z | 2021-07-11T17:40:54.000Z | tests/python/contrib/test_onnx.py | wjj19950828/tvm | 9c63f4fc318652f6fff68342da2d11b26592a3e0 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 1 | 2019-08-16T20:37:41.000Z | 2019-08-16T20:38:15.000Z | tests/python/contrib/test_onnx.py | wjj19950828/tvm | 9c63f4fc318652f6fff68342da2d11b26592a3e0 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 1 | 2019-05-31T20:10:11.000Z | 2019-05-31T20:10:11.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 u... | 35.016393 | 99 | 0.591097 |
import pytest
pytest.importorskip("onnx")
pytest.importorskip("onnxruntime")
import numpy as np
import onnxruntime as rt
import tvm
from tvm import relay
from tvm.contrib.target.onnx import to_onnx
from tvm.relay.testing import run_infer_type
def func_to_onnx(func, name):
mod = tvm.IRModule()
... | true | true |
1c2d0113353ee68262971a2f20cd036da0ee374d | 67 | py | Python | tests/test_main.py | grahamhome/pifx | 0f9aad667ff216aa00a883fc5efddbf147905d53 | [
"Apache-2.0"
] | 52 | 2015-12-16T22:59:36.000Z | 2021-04-13T07:10:24.000Z | tests/test_main.py | grahamhome/pifx | 0f9aad667ff216aa00a883fc5efddbf147905d53 | [
"Apache-2.0"
] | 13 | 2015-12-22T00:28:37.000Z | 2021-08-08T01:48:25.000Z | tests/test_main.py | grahamhome/pifx | 0f9aad667ff216aa00a883fc5efddbf147905d53 | [
"Apache-2.0"
] | 7 | 2016-10-11T20:41:51.000Z | 2021-08-08T01:39:42.000Z | import sys
sys.path.insert(1, '..')
from pifx import PIFX
# TODO
| 9.571429 | 24 | 0.671642 | import sys
sys.path.insert(1, '..')
from pifx import PIFX
| true | true |
1c2d03c1316c9260d3a78c67330574544c2622e0 | 13,476 | py | Python | src/tests/test_utils.py | juanalvarezg/script-server | bb0927ada44b6979240cea62a8103eb00abf5627 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/tests/test_utils.py | juanalvarezg/script-server | bb0927ada44b6979240cea62a8103eb00abf5627 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/tests/test_utils.py | juanalvarezg/script-server | bb0927ada44b6979240cea62a8103eb00abf5627 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | import json
import os
import shutil
import stat
import threading
import uuid
from copy import copy
from unittest.case import TestCase
from unittest.mock import MagicMock
import utils.file_utils as file_utils
import utils.os_utils as os_utils
from execution.process_base import ProcessWrapper
from model.script_config im... | 26.632411 | 96 | 0.608712 | import json
import os
import shutil
import stat
import threading
import uuid
from copy import copy
from unittest.case import TestCase
from unittest.mock import MagicMock
import utils.file_utils as file_utils
import utils.os_utils as os_utils
from execution.process_base import ProcessWrapper
from model.script_config im... | true | true |
1c2d045bc4ec3a10a114a1b4f089c05bb207e42c | 3,003 | py | Python | telemetry/telemetry/internal/platform/gpu_info_unittest.py | BearerPipelineTest/catapult | 3800a67cd916200046a50748893bbd0dcf3d7f4a | [
"BSD-3-Clause"
] | 1,894 | 2015-04-17T18:29:53.000Z | 2022-03-28T22:41:06.000Z | telemetry/telemetry/internal/platform/gpu_info_unittest.py | BearerPipelineTest/catapult | 3800a67cd916200046a50748893bbd0dcf3d7f4a | [
"BSD-3-Clause"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | telemetry/telemetry/internal/platform/gpu_info_unittest.py | atuchin-m/catapult | 108ea3e2ec108e68216b1250a3d79cc642600294 | [
"BSD-3-Clause"
] | 698 | 2015-06-02T19:18:35.000Z | 2022-03-29T16:57:15.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import unittest
from telemetry.internal.platform import gpu_device
from telemetry.internal.platform import gpu_info
... | 35.75 | 76 | 0.646021 |
from __future__ import absolute_import
import unittest
from telemetry.internal.platform import gpu_device
from telemetry.internal.platform import gpu_info
class TestGPUInfo(unittest.TestCase):
def testConstruction(self):
data = {
'devices': [
{'vendor_id': 1000, 'device_id': 2000,
... | true | true |
1c2d05f12b56ab3ee8ae1e1ddbc441a5723ef576 | 4,595 | py | Python | tests/unit/test_organization.py | joeseggie/resourceidea | aae6120e3ec84f3fc7e1ab1bc833ce37bd06685f | [
"MIT"
] | null | null | null | tests/unit/test_organization.py | joeseggie/resourceidea | aae6120e3ec84f3fc7e1ab1bc833ce37bd06685f | [
"MIT"
] | 21 | 2019-01-26T20:39:34.000Z | 2019-06-20T10:09:57.000Z | tests/unit/test_organization.py | joeseggie/resourceidea | aae6120e3ec84f3fc7e1ab1bc833ce37bd06685f | [
"MIT"
] | null | null | null | from faker import Faker
from faker.providers import address
from faker.providers import company
import pytest
from werkzeug.exceptions import NotFound
from app.organization.repositories import OrganizationRepository
from app.organization.models import Organization
from app.organization.utils import create_organizatio... | 29.837662 | 72 | 0.717519 | from faker import Faker
from faker.providers import address
from faker.providers import company
import pytest
from werkzeug.exceptions import NotFound
from app.organization.repositories import OrganizationRepository
from app.organization.models import Organization
from app.organization.utils import create_organizatio... | true | true |
1c2d0684c89b81f50f514cc0436a71df4e75e4cf | 5,057 | py | Python | mmdet/models/detectors/querytrack.py | Joanna0123/QueryInst | 6f75240610439e92bca5398054e3f7adc37bfd53 | [
"MIT"
] | null | null | null | mmdet/models/detectors/querytrack.py | Joanna0123/QueryInst | 6f75240610439e92bca5398054e3f7adc37bfd53 | [
"MIT"
] | null | null | null | mmdet/models/detectors/querytrack.py | Joanna0123/QueryInst | 6f75240610439e92bca5398054e3f7adc37bfd53 | [
"MIT"
] | null | null | null | from ..builder import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module()
class QueryTrack(TwoStageDetector):
r"""Implementation of `QueryTrack: Parallelly Supervised Mask Query for
Instance Segmentation <https://arxiv.org/abs/2105.01928>`, based on
SparseRCNN detector. """
... | 38.603053 | 86 | 0.57366 | from ..builder import DETECTORS
from .two_stage import TwoStageDetector
@DETECTORS.register_module()
class QueryTrack(TwoStageDetector):
def __init__(self, *args, **kwargs):
super(QueryTrack, self).__init__(*args, **kwargs)
assert self.with_rpn, 'QueryTrack do not support external proposals'
... | true | true |
1c2d06962ad333a36d67b09c592fec2e4a657d7e | 6,137 | py | Python | jina/drivers/helper.py | xubiuit/jina | 4ab91693c2d51a35eca3cf6c187034e0568b0ac9 | [
"Apache-2.0"
] | null | null | null | jina/drivers/helper.py | xubiuit/jina | 4ab91693c2d51a35eca3cf6c187034e0568b0ac9 | [
"Apache-2.0"
] | null | null | null | jina/drivers/helper.py | xubiuit/jina | 4ab91693c2d51a35eca3cf6c187034e0568b0ac9 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import mimetypes
import os
import urllib.parse
import urllib.request
from typing import Dict, Any, Iterable, Tuple, Union, List, Callable
import numpy as np
from ..proto import jina_pb2
def pb2array(blob: 'jina_pb... | 37.193939 | 125 | 0.648851 | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import mimetypes
import os
import urllib.parse
import urllib.request
from typing import Dict, Any, Iterable, Tuple, Union, List, Callable
import numpy as np
from ..proto import jina_pb2
def pb2array(blob: 'jina_pb... | true | true |
1c2d06c3fd512f60866a1355b452fca5d3c88d9a | 14,273 | py | Python | pymatgen/alchemy/materials.py | anjlip/pymatgen | 62ecae1c7382a41861e3a5d9b9c8dd1207472409 | [
"MIT"
] | 2 | 2017-10-02T03:11:47.000Z | 2018-12-02T12:56:12.000Z | pymatgen/alchemy/materials.py | darnoceloc/pymatgen | 5cc42912a12a265a603df7e34c856561f76edc1f | [
"MIT"
] | 3 | 2017-07-18T01:13:41.000Z | 2019-04-29T18:17:30.000Z | pymatgen/alchemy/materials.py | darnoceloc/pymatgen | 5cc42912a12a265a603df7e34c856561f76edc1f | [
"MIT"
] | 2 | 2016-06-15T00:12:59.000Z | 2018-12-02T12:56:47.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import re
import json
import datetime
from copy import deepcopy
from monty.json import MontyDecoder, jsanitize
from pymatgen.core.structure import Structure
from pymatgen.io.cif import CifParser
fr... | 38.061333 | 79 | 0.605899 |
import os
import re
import json
import datetime
from copy import deepcopy
from monty.json import MontyDecoder, jsanitize
from pymatgen.core.structure import Structure
from pymatgen.io.cif import CifParser
from pymatgen.io.vasp.inputs import Poscar
from monty.json import MSONable
from pymatgen.io.vasp.sets impor... | true | true |
1c2d06cb9879281b595716f3fff3696c7b8d7bce | 373 | py | Python | main.py | cr0mbly/TTGO-esp32-micropython-watch | 3378ea3b15e19f6bab405b6fc07759f17dd6213d | [
"MIT"
] | 6 | 2020-09-10T20:04:49.000Z | 2021-10-10T06:26:05.000Z | main.py | cr0mbly/TTGO-esp32-micropython-watch | 3378ea3b15e19f6bab405b6fc07759f17dd6213d | [
"MIT"
] | null | null | null | main.py | cr0mbly/TTGO-esp32-micropython-watch | 3378ea3b15e19f6bab405b6fc07759f17dd6213d | [
"MIT"
] | null | null | null | from apps.watch import WatchDisplay
from lcd_display import LcdDisplay
from system import SystemManager
# Setup internal system
system_manager = SystemManager()
system_manager.update_system()
# Setup LCD and eventsB
lcd_display = LcdDisplay(system_manager).setup()
lcd_display.register_touch_event()
# Display initial... | 24.866667 | 48 | 0.831099 | from apps.watch import WatchDisplay
from lcd_display import LcdDisplay
from system import SystemManager
system_manager = SystemManager()
system_manager.update_system()
lcd_display = LcdDisplay(system_manager).setup()
lcd_display.register_touch_event()
WatchDisplay(system_manager, lcd_display).run()
| true | true |
1c2d072085abfe36d7e843393f0e22f4fede76ae | 9,187 | py | Python | tests/hazmat/primitives/test_aes.py | spagh-eddie/cryptography | 8572a9d82e254d348aa674d37d1c19fee8831b19 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 4,492 | 2015-01-02T23:02:52.000Z | 2022-03-31T12:59:57.000Z | tests/hazmat/primitives/test_aes.py | spagh-eddie/cryptography | 8572a9d82e254d348aa674d37d1c19fee8831b19 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 3,692 | 2015-01-01T03:16:56.000Z | 2022-03-31T19:20:25.000Z | tests/hazmat/primitives/test_aes.py | sailfishos-mirror/cryptography | bab6faa2622e6ae33ceab40117dbd00f3b0cc9a1 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 1,155 | 2015-01-09T00:48:05.000Z | 2022-03-31T23:46:43.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.
import binascii
import os
import pytest
from cryptography.hazmat.primitives.ciphers import algorithms, base, modes
from .utils import _... | 33.166065 | 79 | 0.579188 |
import binascii
import os
import pytest
from cryptography.hazmat.primitives.ciphers import algorithms, base, modes
from .utils import _load_all_params, generate_encrypt_test
from ...doubles import DummyMode
from ...utils import load_nist_vectors
@pytest.mark.supported(
only_if=lambda backend: backend.ciph... | true | true |
1c2d073e9e36ccc9b40cc4d130871100baffaf06 | 750 | py | Python | src/explore/data_structure_tree/inorder_traversal.py | Jiezhi/myleetcode | b346e94c46da2a3033ebc8ff50e621aa179c4f62 | [
"MIT"
] | 1 | 2022-03-03T15:11:48.000Z | 2022-03-03T15:11:48.000Z | src/explore/data_structure_tree/inorder_traversal.py | Jiezhi/myleetcode | b346e94c46da2a3033ebc8ff50e621aa179c4f62 | [
"MIT"
] | null | null | null | src/explore/data_structure_tree/inorder_traversal.py | Jiezhi/myleetcode | b346e94c46da2a3033ebc8ff50e621aa179c4f62 | [
"MIT"
] | 2 | 2022-01-20T22:49:58.000Z | 2022-01-20T22:53:13.000Z | #!/usr/bin/env python
"""
Github: https://github.com/Jiezhi/myleetcode
Created on 2019-03-24
Leetcode: https://leetcode.com/explore/learn/card/data-structure-tree/134/traverse-a-tree/929/
Same as: 94 https://leetcode.com/problems/binary-tree-inorder-traversal/
"""
from tree_node import *
class Solution:
def in... | 25.862069 | 94 | 0.642667 |
from tree_node import *
class Solution:
def inorderTraversal(self, root: TreeNode) -> list:
ret = []
if not root:
return ret
if root.left:
ret = ret + self.inorderTraversal(root.left)
ret.append(root.val)
if root.right:
ret = ret + self.... | true | true |
1c2d08db4f64008bdec6d59094e5b421b130255a | 2,442 | py | Python | Motif_Analysis/Code/optimizer.py | tanfei2007/DeepM6A | ac8b5543db292516ce10cf42b7506004140d4d41 | [
"Apache-2.0"
] | 8 | 2020-08-09T02:21:24.000Z | 2022-03-17T03:01:08.000Z | Motif_Analysis/Code/optimizer.py | Cmanco/DeepM6A | ac8b5543db292516ce10cf42b7506004140d4d41 | [
"Apache-2.0"
] | null | null | null | Motif_Analysis/Code/optimizer.py | Cmanco/DeepM6A | ac8b5543db292516ce10cf42b7506004140d4d41 | [
"Apache-2.0"
] | 5 | 2020-11-30T01:53:38.000Z | 2021-07-21T04:08:47.000Z | #*********************
# Fei Tan
# ft54@njit.edu
# March 28, 2017
#********************
import numpy as np
import pprint
from keras import backend as K
from collections import OrderedDict
class Optimizer(object):
def __init__(self, seq_input, losses, wrt=None):
self.seq = seq_input
self.loss_functions... | 25.978723 | 109 | 0.673628 |
import numpy as np
import pprint
from keras import backend as K
from collections import OrderedDict
class Optimizer(object):
def __init__(self, seq_input, losses, wrt=None):
self.seq = seq_input
self.loss_functions = []
self.wrt = self.seq if wrt is None else wrt
overall_loss = K.variable(0.)
f... | true | true |
1c2d0986479155b099c8c5b721fa03b080e59510 | 248 | py | Python | hard-gists/69f4acd1fc094c66ba73/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/69f4acd1fc094c66ba73/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/69f4acd1fc094c66ba73/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | #!/usr/bin/env python3
import time
import cron
def do_stuff1():
print('stuff1!')
def do_stuff2():
#1 / 0
print('stuff2!')
cron.init()
cron.schedule(5, do_stuff1)
#time.sleep(1)
#cron.schedule(2, do_stuff2)
cron.wait()
print('done!') | 13.777778 | 28 | 0.657258 |
import time
import cron
def do_stuff1():
print('stuff1!')
def do_stuff2():
print('stuff2!')
cron.init()
cron.schedule(5, do_stuff1)
cron.wait()
print('done!') | true | true |
1c2d0adc348a4f74b5082e2c56fef04d70aaafb4 | 3,272 | py | Python | Libraries/Python/Turta_Digital.py | Turta-io/LoRaHAT | 4f2bc28c2bddde928bb2279a2c519ed163defff9 | [
"MIT"
] | 1 | 2021-03-22T22:45:29.000Z | 2021-03-22T22:45:29.000Z | Libraries/Python/Turta_Digital.py | Turta-io/LoRaHAT | 4f2bc28c2bddde928bb2279a2c519ed163defff9 | [
"MIT"
] | null | null | null | Libraries/Python/Turta_Digital.py | Turta-io/LoRaHAT | 4f2bc28c2bddde928bb2279a2c519ed163defff9 | [
"MIT"
] | 1 | 2020-03-28T21:32:35.000Z | 2020-03-28T21:32:35.000Z | # Turta LoRa HAT Helper for Raspbian.
# Distributed under the terms of the MIT license.
# Python Library for Digital IO Ports.
# Version 1.0.0
# Released: November 5th, 2019
# Visit https://docs.turta.io for documentation.
import RPi.GPIO as GPIO
class DigitalPort(object):
"""Digital IO Ports."""
#Variable... | 27.495798 | 91 | 0.552873 |
import RPi.GPIO as GPIO
class DigitalPort(object):
is_initialized = False
d1, d2, d3, d4 = 21, 22, 23, 24
def __init__(self, d1In = True, d2In = True, d3In = True, d4In = True):
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
if (d1In):
GPIO.setup(... | true | true |
1c2d0b25119761370d81f6070e27d83543d0b4a7 | 5,267 | py | Python | pysnmp-with-texts/DLINK-3100-SOCKET-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/DLINK-3100-SOCKET-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/DLINK-3100-SOCKET-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module DLINK-3100-SOCKET-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DLINK-3100-SOCKET-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:49:02 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | 107.489796 | 477 | 0.764382 |
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuild... | true | true |
1c2d0b4a226a5bf9b9851cd369c7c9a0c8439cf0 | 5,034 | py | Python | source/conf.py | stefbaldipr/iPressDocs | 3cc5aa6e579b4fa3c3e3e88245db52d02146881d | [
"MIT"
] | null | null | null | source/conf.py | stefbaldipr/iPressDocs | 3cc5aa6e579b4fa3c3e3e88245db52d02146881d | [
"MIT"
] | 1 | 2018-03-12T04:31:09.000Z | 2018-03-12T04:31:09.000Z | source/conf.py | stefbaldipr/iPressDocs | 3cc5aa6e579b4fa3c3e3e88245db52d02146881d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 30.325301 | 85 | 0.640644 |
project = u'iPress API'
copyright = u'2018, Stefano Ubaldi'
author = u'Stefano Ubaldi'
version = u'2.0'
release = u'2.0'
extensions = [
'sphinx.ext.imgmath',
'sphinxcontrib.httpdomain',
'sphinxcontrib.httpexample',
'sphinx-jsonschema'
]
templates_path = ['_templates... | true | true |
1c2d0ca7f4a4ea84b33b558ae0ff250d88a809be | 5,276 | py | Python | tests/adapters/test_postgres_adapter.py | pietervans/viewflow | 3123b1e36ca4b9464d4a8cdf13c520384b71c600 | [
"MIT"
] | 106 | 2021-03-25T12:38:54.000Z | 2022-03-10T02:56:37.000Z | tests/adapters/test_postgres_adapter.py | pietervans/viewflow | 3123b1e36ca4b9464d4a8cdf13c520384b71c600 | [
"MIT"
] | null | null | null | tests/adapters/test_postgres_adapter.py | pietervans/viewflow | 3123b1e36ca4b9464d4a8cdf13c520384b71c600 | [
"MIT"
] | 7 | 2021-04-03T13:30:36.000Z | 2021-08-28T03:11:21.000Z | from datetime import datetime
from unittest.mock import Mock
import jinja2
import viewflow
from airflow import DAG
from airflow.models import TaskInstance, Connection
from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow import settings
from airflow.utils import db
def _create_postgres_sess... | 41.543307 | 743 | 0.700531 | from datetime import datetime
from unittest.mock import Mock
import jinja2
import viewflow
from airflow import DAG
from airflow.models import TaskInstance, Connection
from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow import settings
from airflow.utils import db
def _create_postgres_sess... | true | true |
1c2d0e451151d8512422ba9f290e51f88c58564a | 4,078 | py | Python | src/test-apps/happy/tests/standalone/wdmNext/test_weave_wdm_next_mutual_subscribe_12.py | robszewczyk/openweave-core | f452cc55859daea83b3ce7af158c8e78b05cc3bc | [
"Apache-2.0"
] | 249 | 2017-09-18T17:48:34.000Z | 2022-02-02T06:46:21.000Z | src/test-apps/happy/tests/standalone/wdmNext/test_weave_wdm_next_mutual_subscribe_12.py | robszewczyk/openweave-core | f452cc55859daea83b3ce7af158c8e78b05cc3bc | [
"Apache-2.0"
] | 501 | 2017-11-10T11:25:32.000Z | 2022-02-01T10:43:13.000Z | src/test-apps/happy/tests/standalone/wdmNext/test_weave_wdm_next_mutual_subscribe_12.py | robszewczyk/openweave-core | f452cc55859daea83b3ce7af158c8e78b05cc3bc | [
"Apache-2.0"
] | 116 | 2017-09-20T07:06:55.000Z | 2022-01-08T13:41:15.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2016-2017 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | 50.975 | 173 | 0.655959 |
from __future__ import absolute_import
from __future__ import print_function
import unittest
import set_test_path
from weave_wdm_next_test_base import weave_wdm_next_test_base
import WeaveUtilities
class test_weave_wdm_next_mutual_subscribe_12(weave_wdm_next_test_base):
def test_weave_... | true | true |
1c2d0f4e0c15a4c07fa29575d460cd7acb1f0253 | 10,709 | py | Python | rllite/common/gym_utils.py | ZJU-RL/zjurl | 6aab83aaba7249bc43d112f21787c45b111d8aa4 | [
"MIT"
] | 3 | 2019-03-07T13:24:21.000Z | 2019-08-08T12:49:51.000Z | rllite/common/gym_utils.py | tyGavinZJU/rllite | 5c85eb11babb69a09604a04f0eb7bdc5a96f08f0 | [
"MIT"
] | null | null | null | rllite/common/gym_utils.py | tyGavinZJU/rllite | 5c85eb11babb69a09604a04f0eb7bdc5a96f08f0 | [
"MIT"
] | null | null | null | import gym
import numpy as np
import torch
from collections import deque
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class NormalizedActions(gym.ActionWrapper):
def action(self, action):
low = self.action_space.low
high = self.action_space.high
action... | 33.361371 | 117 | 0.609954 | import gym
import numpy as np
import torch
from collections import deque
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class NormalizedActions(gym.ActionWrapper):
def action(self, action):
low = self.action_space.low
high = self.action_space.high
action... | true | true |
1c2d0f849557aee866125c4da8f8a94fe9de46f2 | 7,081 | py | Python | src/configparserenhanced/TypedProperty.py | sandialabs/ConfigParserEnhanced | 93c2b32fa67c47bc2194a95a2464529c4adfaa01 | [
"BSD-3-Clause"
] | 2 | 2021-12-08T15:34:03.000Z | 2021-12-21T21:54:19.000Z | src/configparserenhanced/TypedProperty.py | sandialabs/ConfigParserEnhanced | 93c2b32fa67c47bc2194a95a2464529c4adfaa01 | [
"BSD-3-Clause"
] | null | null | null | src/configparserenhanced/TypedProperty.py | sandialabs/ConfigParserEnhanced | 93c2b32fa67c47bc2194a95a2464529c4adfaa01 | [
"BSD-3-Clause"
] | 4 | 2021-12-08T01:02:15.000Z | 2022-01-31T14:08:57.000Z | #!/usr/bin/env python3
# -*- mode: python; py-indent-offset: 4; py-continuation-offset: 4 -*-
#===============================================================================
# Copyright Notice
# ----------------
# Copyright 2021 National Technology & Engineering Solutions of Sandia,
# LLC (NTESS). Under the terms of C... | 42.915152 | 114 | 0.642847 |
import copy
import typing
class SENTINEL:
pass
def typed_property(
name: str,
expected_type=(int, str),
default=SENTINEL,
default_factory=lambda: None,
req_assign_before_use=False,
internal_type=None,
validator=None,
transform=None
):
... | true | true |
1c2d105e7db966f407ca10d5da75611063f8eb1a | 16,206 | py | Python | utils/stable_baselines_plotter.py | malikasng/Bbox_HGG_with_CTR_and_RRTstarFND | 2b1aae6c347f544fefface0c9f26dc4ecde51108 | [
"MIT"
] | 1 | 2020-09-16T06:15:17.000Z | 2020-09-16T06:15:17.000Z | utils/stable_baselines_plotter.py | malikasng/Bbox_HGG_with_CTR_and_RRTstarFND | 2b1aae6c347f544fefface0c9f26dc4ecde51108 | [
"MIT"
] | 5 | 2020-09-26T01:30:01.000Z | 2022-01-13T03:15:42.000Z | utils/stable_baselines_plotter.py | malikasng/Bbox_HGG_with_CTR_and_RRTstarFND | 2b1aae6c347f544fefface0c9f26dc4ecde51108 | [
"MIT"
] | null | null | null | # from https://github.com/hill-a/stable-baselines/blob/master/stable_baselines/results_plotter.py
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
# matplotlib.use('TkAgg') # Can change to 'Agg' for non-interactive mode
plt.rcParams['svg.fonttype'] = 'none'
X_TIMESTEPS = 'tim... | 48.960725 | 118 | 0.648895 |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
STEPS = 'timesteps'
X_EPISODES = 'episodes'
X_WALLTIME = 'walltime_hrs'
POSSIBLE_X_AXES = [X_TIMESTEPS, X_EPISODES, X_WALLTIME]
COLORS = ['blue', 'green', 'red', 'cyan', 'magenta', 'yellow', 'black', 'purple', 'pink',
'... | true | true |
1c2d11ff8e57664d9a10a9757b4355520a675e8a | 3,325 | py | Python | mlio/resources/manager.py | Workable/milo | 66c6425188cd20efaadfea7dfb31d730e68fe84b | [
"MIT"
] | 5 | 2018-07-17T07:09:08.000Z | 2020-03-14T21:06:37.000Z | mlio/resources/manager.py | Workable/mlio | 66c6425188cd20efaadfea7dfb31d730e68fe84b | [
"MIT"
] | null | null | null | mlio/resources/manager.py | Workable/mlio | 66c6425188cd20efaadfea7dfb31d730e68fe84b | [
"MIT"
] | null | null | null | import logging as _logging
from mlio.resources.exceptions import ResourceNotFoundError
from .repositories import RepositoriesContainer
logger = _logging.getLogger(__name__)
class ResourceManager:
"""
A registry of resource objects that are dynamically discovered and loaded from a prioritized list of
sou... | 37.359551 | 116 | 0.667669 | import logging as _logging
from mlio.resources.exceptions import ResourceNotFoundError
from .repositories import RepositoriesContainer
logger = _logging.getLogger(__name__)
class ResourceManager:
def __init__(self):
self._resources = {}
self._repositories = RepositoriesContainer()
@pro... | true | true |
1c2d120d9830a54c809476f7ceb13e76d62d5b68 | 1,510 | py | Python | server/benchmarkdataset/permissions.py | johnugeorge/medperf | 5bc3f643064df14e9476bd4d4c1a4c0cce5337d5 | [
"Apache-2.0"
] | 1 | 2021-09-24T18:09:53.000Z | 2021-09-24T18:09:53.000Z | server/benchmarkdataset/permissions.py | johnugeorge/medperf | 5bc3f643064df14e9476bd4d4c1a4c0cce5337d5 | [
"Apache-2.0"
] | 2 | 2021-09-27T16:14:04.000Z | 2021-11-03T14:24:54.000Z | server/benchmarkdataset/permissions.py | johnugeorge/medperf | 5bc3f643064df14e9476bd4d4c1a4c0cce5337d5 | [
"Apache-2.0"
] | null | null | null | from rest_framework.permissions import BasePermission
from benchmark.models import Benchmark
from dataset.models import Dataset
class IsAdmin(BasePermission):
def has_permission(self, request, view):
return request.user.is_superuser
class IsDatasetOwner(BasePermission):
def get_object(self, pk):
... | 27.454545 | 53 | 0.588742 | from rest_framework.permissions import BasePermission
from benchmark.models import Benchmark
from dataset.models import Dataset
class IsAdmin(BasePermission):
def has_permission(self, request, view):
return request.user.is_superuser
class IsDatasetOwner(BasePermission):
def get_object(self, pk):
... | true | true |
1c2d123bb9f3f859a243b8a2d858280e6889d55f | 169 | py | Python | Helloapp/venv/Scripts/django-admin.py | ramadevim/Hello-World | df85d1c8d9650c2f1fb04955ac293a47cdba05bd | [
"MIT"
] | null | null | null | Helloapp/venv/Scripts/django-admin.py | ramadevim/Hello-World | df85d1c8d9650c2f1fb04955ac293a47cdba05bd | [
"MIT"
] | null | null | null | Helloapp/venv/Scripts/django-admin.py | ramadevim/Hello-World | df85d1c8d9650c2f1fb04955ac293a47cdba05bd | [
"MIT"
] | 1 | 2019-10-02T11:56:36.000Z | 2019-10-02T11:56:36.000Z | #!C:\Users\maxgen\django proj\Helloapp\venv\Scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 28.166667 | 62 | 0.786982 |
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| true | true |
1c2d144146c5d13357b58eb927531a2dbd9a0908 | 1,322 | py | Python | main.py | zero-bugs/littlepytest | c3929dee3d5d40ba9c33200d9f441ae61ff36673 | [
"MIT"
] | null | null | null | main.py | zero-bugs/littlepytest | c3929dee3d5d40ba9c33200d9f441ae61ff36673 | [
"MIT"
] | null | null | null | main.py | zero-bugs/littlepytest | c3929dee3d5d40ba9c33200d9f441ae61ff36673 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import threading
from common.common_config import CommonConstant
from func.kc_scrawl import KcScrawlImpl, historyImgList
if __name__ == "__main__":
# 第一阶段api提取数据
kcScrawlImpl = KcScrawlImpl()
kcScrawlImpl.init()
# kcScrawlImpl.scrawPicUseApiAll()
print(l... | 25.921569 | 58 | 0.549924 |
import threading
from common.common_config import CommonConstant
from func.kc_scrawl import KcScrawlImpl, historyImgList
if __name__ == "__main__":
kcScrawlImpl = KcScrawlImpl()
kcScrawlImpl.init()
print(len(historyImgList))
try:
t1 = threading.Thread(
target... | true | true |
1c2d1454c5b45a992c0ec7434b5643be04552823 | 6,846 | py | Python | stock_plots.py | Preston5789/Stock_Regression_Algorithm | f65dd0c710be777628a0c03ce0fa851880cf0d81 | [
"MIT"
] | 1 | 2019-05-27T19:39:35.000Z | 2019-05-27T19:39:35.000Z | stock_plots.py | Preston5789/Stock_Regression_Algorithm | f65dd0c710be777628a0c03ce0fa851880cf0d81 | [
"MIT"
] | null | null | null | stock_plots.py | Preston5789/Stock_Regression_Algorithm | f65dd0c710be777628a0c03ce0fa851880cf0d81 | [
"MIT"
] | 2 | 2019-05-03T03:33:26.000Z | 2020-05-15T23:59:55.000Z |
import matplotlib.pyplot as plt
import numpy
import time
from matplotlib.widgets import Button
from stock_trade import Jesus
from stock_connect import Connection
from stock_reg import Errors
err = Errors()
graphswitcheroo = 0
con = Connection()
jes = Jesus()
con.socket()
plt.ion()
fig, axs = ... | 36.222222 | 193 | 0.647239 |
import matplotlib.pyplot as plt
import numpy
import time
from matplotlib.widgets import Button
from stock_trade import Jesus
from stock_connect import Connection
from stock_reg import Errors
err = Errors()
graphswitcheroo = 0
con = Connection()
jes = Jesus()
con.socket()
plt.ion()
fig, axs = ... | true | true |
1c2d157ae31bc30ab6e3cd6918790e543c9f2f6c | 1,196 | py | Python | setup.py | troywilson/so-lazy | bb5a884f2af2db975c065bb39874af9a47ff1f3b | [
"Apache-2.0"
] | null | null | null | setup.py | troywilson/so-lazy | bb5a884f2af2db975c065bb39874af9a47ff1f3b | [
"Apache-2.0"
] | null | null | null | setup.py | troywilson/so-lazy | bb5a884f2af2db975c065bb39874af9a47ff1f3b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''Setup configuration for so_lazy package'''
import json
import setuptools
PKG_NAME = 'so_lazy'
with open(PKG_NAME + '/pkg_info.json') as fh:
_pkg_info = json.load(fh)
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name=PKG_NAME,
version=_p... | 29.170732 | 70 | 0.655518 |
import json
import setuptools
PKG_NAME = 'so_lazy'
with open(PKG_NAME + '/pkg_info.json') as fh:
_pkg_info = json.load(fh)
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name=PKG_NAME,
version=_pkg_info['version'],
author=_pkg_info['author'],
description... | true | true |
1c2d15a29bbaf8b5ddc10f33905d8c185a433674 | 1,941 | py | Python | test/test_management_entity_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | test/test_management_entity_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | test/test_management_entity_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | 51.078947 | 1,052 | 0.783101 |
from __future__ import absolute_import
import unittest
import intersight
from intersight.models.management_entity_all_of import ManagementEntityAllOf
from intersight.rest import ApiException
class TestManagementEntityAllOf(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pa... | true | true |
1c2d15c565c541b8309285469165d695092f9e23 | 117,050 | py | Python | emsdk.py | Hillsie/emsdk | bb61bc17bd9183fbe691c2b3d945731f63525958 | [
"MIT"
] | null | null | null | emsdk.py | Hillsie/emsdk | bb61bc17bd9183fbe691c2b3d945731f63525958 | [
"MIT"
] | null | null | null | emsdk.py | Hillsie/emsdk | bb61bc17bd9183fbe691c2b3d945731f63525958 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright 2019 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import c... | 40.656478 | 323 | 0.6712 |
from __future__ import print_function
import copy
import errno
import json
import multiprocessing
import os
import os.path
import platform
import re
import shutil
import stat
import subprocess
import sys
import tempfile
import zipfile
if sys.version_info >= (3,):
from urllib.parse import urljoin
from urllib... | true | true |
1c2d1683276d18336a20cddf892fc118e276e093 | 15,191 | py | Python | tests/users/test_auth.py | itsmingjie/CTFd | 80df88f25d095ea7f7fc9cf8c8d0bf9cc7c2bf1f | [
"Apache-2.0"
] | 9 | 2020-05-07T01:39:06.000Z | 2022-01-21T09:32:03.000Z | tests/users/test_auth.py | itsmingjie/CTFd | 80df88f25d095ea7f7fc9cf8c8d0bf9cc7c2bf1f | [
"Apache-2.0"
] | 3 | 2021-03-11T00:50:06.000Z | 2022-02-10T23:13:17.000Z | tests/users/test_auth.py | erseco/CTFd | a6a4906ab058b79bca7af48038fa7badc1744340 | [
"Apache-2.0"
] | 7 | 2020-06-16T20:42:00.000Z | 2022-01-13T08:06:14.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import six
from freezegun import freeze_time
from mock import patch
from CTFd.models import Users, db
from CTFd.utils import get_config, set_config
from CTFd.utils.crypto import verify_password
from CTFd.utils.security.signing import serialize
from tests.helpers import cr... | 34.603645 | 116 | 0.612995 |
import six
from freezegun import freeze_time
from mock import patch
from CTFd.models import Users, db
from CTFd.utils import get_config, set_config
from CTFd.utils.crypto import verify_password
from CTFd.utils.security.signing import serialize
from tests.helpers import create_ctfd, destroy_ctfd, login_as_user, regi... | true | true |
1c2d18c57908c297096770b862aec97c9ff96d52 | 11,283 | py | Python | modify_weights.py | rayjyh/PyTorch_CIFAR10_rram_compenstion | 61a53c85a74abc965a5bea3e4b102e9a7ad8f03a | [
"MIT"
] | null | null | null | modify_weights.py | rayjyh/PyTorch_CIFAR10_rram_compenstion | 61a53c85a74abc965a5bea3e4b102e9a7ad8f03a | [
"MIT"
] | null | null | null | modify_weights.py | rayjyh/PyTorch_CIFAR10_rram_compenstion | 61a53c85a74abc965a5bea3e4b102e9a7ad8f03a | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import torch
'''
compensation = {
"no_comp":
"simple":
"dynamic":
"bias":
"double_sim":
}
'''
quantized = True
visualize = False
symmetric = True
def asym_quant_param(w, k):
num_intervals = 2 ** k - 1
scale = (torch.max(w) - torch.min(w)... | 39.041522 | 117 | 0.572011 | import numpy as np
import matplotlib.pyplot as plt
import torch
quantized = True
visualize = False
symmetric = True
def asym_quant_param(w, k):
num_intervals = 2 ** k - 1
scale = (torch.max(w) - torch.min(w)) / num_intervals
zero = int(-torch.min(w) / scale)
return num_intervals, scale, zero
def s... | true | true |
1c2d19186929b1032fb2c4eb224c5f81db2d2d09 | 312 | py | Python | src/vox/linters/python/clonedigger.py | Peilonrayz/vox | 026a82bb3c0d47988cd20d18639bcb0e249ee211 | [
"MIT"
] | null | null | null | src/vox/linters/python/clonedigger.py | Peilonrayz/vox | 026a82bb3c0d47988cd20d18639bcb0e249ee211 | [
"MIT"
] | null | null | null | src/vox/linters/python/clonedigger.py | Peilonrayz/vox | 026a82bb3c0d47988cd20d18639bcb0e249ee211 | [
"MIT"
] | null | null | null | import vox
from vox import flaggy, linty
from ..base_linter import BaseLinter
class Clonedigger(BaseLinter):
COMMAND = vox.FlagsBuilder().sugar(program="clonedigger")
DEPENDENCIES = ["clonedigger"]
FORMAT = None
NAME = "clonedigger"
PYTHON = "2.7"
extract_errors = linty.from_str.echo
| 22.285714 | 61 | 0.711538 | import vox
from vox import flaggy, linty
from ..base_linter import BaseLinter
class Clonedigger(BaseLinter):
COMMAND = vox.FlagsBuilder().sugar(program="clonedigger")
DEPENDENCIES = ["clonedigger"]
FORMAT = None
NAME = "clonedigger"
PYTHON = "2.7"
extract_errors = linty.from_str.echo
| true | true |
1c2d19569551341805cf3d50cc5ffb640693bf50 | 4,652 | py | Python | FemMed Microservice/ecommerce/settings.py | HimanshuBarak/FemPower | d3b7ed0d7f2f6eece9d9a1149fae083d88c1bb06 | [
"MIT"
] | null | null | null | FemMed Microservice/ecommerce/settings.py | HimanshuBarak/FemPower | d3b7ed0d7f2f6eece9d9a1149fae083d88c1bb06 | [
"MIT"
] | null | null | null | FemMed Microservice/ecommerce/settings.py | HimanshuBarak/FemPower | d3b7ed0d7f2f6eece9d9a1149fae083d88c1bb06 | [
"MIT"
] | null | null | null | """
Django settings for ecommerce project.
Generated by 'django-admin startproject' using Django 2.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
... | 25.844444 | 91 | 0.693465 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'lzj2axnee5!=1s5y17#ud4l^_n)krr*9wmn=^t6+o!^ry%&v_*'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'wishlists.apps.WishlistsConfig',
'orders.apps.OrdersConfig',
# 'users... | true | true |
1c2d19be1cf2c7370f09d63ee85ffc190a87325c | 13,747 | py | Python | src/sage/modular/modform_hecketriangle/element.py | defeo/sage | d8822036a9843bd4d75845024072515ede56bcb9 | [
"BSL-1.0"
] | 2 | 2018-06-30T01:37:35.000Z | 2018-06-30T01:37:39.000Z | src/sage/modular/modform_hecketriangle/element.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | src/sage/modular/modform_hecketriangle/element.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | r"""
Elements of Hecke modular forms spaces
AUTHORS:
- Jonas Jermann (2013): initial version
"""
from __future__ import absolute_import
#*****************************************************************************
# Copyright (C) 2013-2014 Jonas Jermann <jjermann2@gmail.com>
#
# Distributed under the terms ... | 39.277143 | 146 | 0.552339 | from __future__ import absolute_import
from .graded_ring_element import FormsRingElement
class FormsElement(FormsRingElement):
def __init__(self, parent, rat):
super(FormsElement, self).__init__(parent, rat)
if self.AT(["quasi"])>=self._analytic_type:
pass
elif not... | true | true |
1c2d1b0956967dc60e6e8d41c3f9a916abc2aa28 | 3,292 | py | Python | config/settings.py | laactech/mastering-django-orm | 2e6e2806311250147023133a0812c1b0e109db11 | [
"BSD-3-Clause"
] | null | null | null | config/settings.py | laactech/mastering-django-orm | 2e6e2806311250147023133a0812c1b0e109db11 | [
"BSD-3-Clause"
] | null | null | null | config/settings.py | laactech/mastering-django-orm | 2e6e2806311250147023133a0812c1b0e109db11 | [
"BSD-3-Clause"
] | null | null | null | """
Django settings for mastering_django_orm project.
Generated by 'django-admin startproject' using Django 3.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
... | 26.126984 | 91 | 0.703524 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "django-insecure-4h--2s#hczboh8*30j0@ui9r__-6&mtd=)$##u@y)fd(y-+q_c"
DEBUG = True
ALLOWED_HOSTS: list[str] = []
# Application definition
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"d... | true | true |
1c2d1b0d281c0e2d6a7fb417e8c2a8b60e46b793 | 12,148 | py | Python | Commands/Counter/counter_StreamlabsSystem.py | RzR32/_streamlabs-chatbot-scripts | 8bedc18f112bf50c6795fc34993ed5fd4bdf6f00 | [
"MIT"
] | 1 | 2020-07-27T20:04:42.000Z | 2020-07-27T20:04:42.000Z | Commands/Counter/counter_StreamlabsSystem.py | RzR32/_streamlabs-chatbot-scripts | 8bedc18f112bf50c6795fc34993ed5fd4bdf6f00 | [
"MIT"
] | null | null | null | Commands/Counter/counter_StreamlabsSystem.py | RzR32/_streamlabs-chatbot-scripts | 8bedc18f112bf50c6795fc34993ed5fd4bdf6f00 | [
"MIT"
] | null | null | null | # coding=utf-8
# ---------------------------
# Import Libraries
# ---------------------------
import codecs
import os
import json
import clr
clr.AddReference("IronPython.SQLite.dll")
clr.AddReference("IronPython.Modules.dll")
# ---------------------------
# [Required] Script Information
# -----------------------... | 41.745704 | 122 | 0.627428 |
import codecs
import os
import json
import clr
clr.AddReference("IronPython.SQLite.dll")
clr.AddReference("IronPython.Modules.dll")
ScriptName = "Twitch Commands - Counter"
Website = "https://twitch.tv/RzR32"
Description = "Commands - Counter for the Stream - RzR32"
Creator = "RzR32"
Version = "0.1"
sett... | true | true |
1c2d1b3c4b4a86f83826a190d19ee704cbcf08cd | 17,569 | py | Python | influxdb_client/__init__.py | tomklapka/influxdb-client-python | f8d1407a6190533faed4d645f6ba973b4d2bc8b2 | [
"MIT"
] | null | null | null | influxdb_client/__init__.py | tomklapka/influxdb-client-python | f8d1407a6190533faed4d645f6ba973b4d2bc8b2 | [
"MIT"
] | null | null | null | influxdb_client/__init__.py | tomklapka/influxdb-client-python | f8d1407a6190533faed4d645f6ba973b4d2bc8b2 | [
"MIT"
] | null | null | null | # coding: utf-8
# flake8: noqa
"""
Influx API Service.
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
# import apis into sd... | 62.523132 | 120 | 0.906369 |
from __future__ import absolute_import
from influxdb_client.service.authorizations_service import AuthorizationsService
from influxdb_client.service.buckets_service import BucketsService
from influxdb_client.service.cells_service import CellsService
from influxdb_client.service.checks_service import ChecksServi... | true | true |
1c2d1c95cee30dd87c9a443915be8fd3956f0364 | 3,695 | py | Python | critiquebrainz/frontend/external/mbspotify.py | code-master5/critiquebrainz | a231ef27923f54f8c3abb0c368e871215423546e | [
"Apache-2.0"
] | null | null | null | critiquebrainz/frontend/external/mbspotify.py | code-master5/critiquebrainz | a231ef27923f54f8c3abb0c368e871215423546e | [
"Apache-2.0"
] | null | null | null | critiquebrainz/frontend/external/mbspotify.py | code-master5/critiquebrainz | a231ef27923f54f8c3abb0c368e871215423546e | [
"Apache-2.0"
] | null | null | null | """
This module provides interface to Spotify ID mapper - mbspotify.
Source code of mbspotify is available at https://github.com/metabrainz/mbspotify.
"""
import json
import requests
from requests.exceptions import RequestException
from requests.adapters import HTTPAdapter
from flask_babel import lazy_gettext
from bra... | 37.704082 | 120 | 0.646279 | import json
import requests
from requests.exceptions import RequestException
from requests.adapters import HTTPAdapter
from flask_babel import lazy_gettext
from brainzutils import cache
from critiquebrainz.frontend import flash
_base_url = ""
_key = ""
_CACHE_NAMESPACE = "mbspotify_mappings"
_UNAVAILABLE_MSG = "Spoti... | true | true |
1c2d1dd07514cd2508c30d802fca461fd7afaa77 | 21,327 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/lsn/lsnappsprofile.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/lsn/lsnappsprofile.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/lsn/lsnappsprofile.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.06405 | 595 | 0.736625 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_excepti... | true | true |
1c2d1e8a28c3a8db04be902fe0080f620871c209 | 5,270 | py | Python | tests/abi_corpus/startup_regression_test.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | 1 | 2021-12-23T00:36:43.000Z | 2021-12-23T00:36:43.000Z | tests/abi_corpus/startup_regression_test.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | null | null | null | tests/abi_corpus/startup_regression_test.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python2
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import re
import sys
import tempfile
import corpus_errors
import corpus_utils
def TestAppStartup(opt... | 32.9375 | 80 | 0.688046 |
import optparse
import os
import re
import sys
import tempfile
import corpus_errors
import corpus_utils
def TestAppStartup(options, crx_path, app_path, profile_path):
"""Run the validator on a nexe, check if the result is expected.
Args:
options: bag of options.
crx_path: path to the crx.
app_p... | false | true |
1c2d1f49886d1c91a4c8d57b0a630de28838ef98 | 9,508 | py | Python | test/test_testcasecontainer.py | noralsydmp/icetea | b486cdc8e0d2211e118f1f8211aa4d284ca02422 | [
"Apache-2.0"
] | 6 | 2018-08-10T17:11:10.000Z | 2020-04-29T07:05:36.000Z | test/test_testcasecontainer.py | noralsydmp/icetea | b486cdc8e0d2211e118f1f8211aa4d284ca02422 | [
"Apache-2.0"
] | 58 | 2018-08-13T08:36:08.000Z | 2021-07-07T08:32:52.000Z | test/test_testcasecontainer.py | noralsydmp/icetea | b486cdc8e0d2211e118f1f8211aa4d284ca02422 | [
"Apache-2.0"
] | 7 | 2018-08-10T12:53:18.000Z | 2021-11-08T05:15:42.000Z | # pylint: disable=missing-docstring,no-self-use,redefined-builtin,too-many-arguments
# pylint: disable=protected-access,unused-variable
"""
Copyright 2017 ARM Limited
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 o... | 42.636771 | 100 | 0.640618 |
import json
import os
import unittest
import argparse
import mock
from icetea_lib.TestSuite.TestcaseContainer import TestcaseContainer, TestStatus
from icetea_lib.Result import Result
from icetea_lib.bench import Bench
def mock_load_tc(*args, **kwargs):
return None
def mock_raise_type(*args, **kwargs): ... | true | true |
1c2d1fc8a2b5942f018d1861c44ee51d2467d88e | 1,886 | py | Python | src/extended_webdrivers/frame.py | dillonm197/extended-webdrivers | 9cb4cdb75f37c66ee1ac7fa13b947ae3bcb17863 | [
"MIT"
] | null | null | null | src/extended_webdrivers/frame.py | dillonm197/extended-webdrivers | 9cb4cdb75f37c66ee1ac7fa13b947ae3bcb17863 | [
"MIT"
] | null | null | null | src/extended_webdrivers/frame.py | dillonm197/extended-webdrivers | 9cb4cdb75f37c66ee1ac7fa13b947ae3bcb17863 | [
"MIT"
] | 1 | 2019-08-07T01:48:36.000Z | 2019-08-07T01:48:36.000Z | class Frame:
""" Base class for handling switching to and from iframes using context managers. """
def __init__(self, child_frame):
self.driver = child_frame.parent
assert child_frame.tag_name.lower() == 'iframe'
self.child_frame = child_frame
def _switch_to(self):
""" Swit... | 35.584906 | 89 | 0.662248 | class Frame:
def __init__(self, child_frame):
self.driver = child_frame.parent
assert child_frame.tag_name.lower() == 'iframe'
self.child_frame = child_frame
def _switch_to(self):
self.parent_window = self.driver.current_window_handle
self.parent_frame = self.d... | true | true |
1c2d204ef61bc14c86ad018669c95549458a72ce | 16,764 | py | Python | cogs/queuecog.py | stealthlego/discord-queue-bot | 4f15a6e5aad4de333a685dfd32854c2898d4c6e6 | [
"MIT"
] | 3 | 2020-10-08T04:48:46.000Z | 2020-11-17T12:55:56.000Z | cogs/queuecog.py | stealthlego/discord-queue-bot | 4f15a6e5aad4de333a685dfd32854c2898d4c6e6 | [
"MIT"
] | 6 | 2020-10-07T19:05:53.000Z | 2021-05-09T12:55:33.000Z | cogs/queuecog.py | stealthlego/discord-queue-bot | 4f15a6e5aad4de333a685dfd32854c2898d4c6e6 | [
"MIT"
] | 1 | 2020-11-24T18:10:46.000Z | 2020-11-24T18:10:46.000Z | from asyncio.tasks import current_task
import os
import random
import time
import datetime
from attr import dataclass
import discord
from discord.ext import commands, tasks
import asyncio
server_handler = {}
reactions = ["\U000027A1", "\U00002705", "\U0000274C", "\U0001F504", "\U0001F500", "\U0001F6D1"]
instructions ... | 37.336303 | 149 | 0.596815 | from asyncio.tasks import current_task
import os
import random
import time
import datetime
from attr import dataclass
import discord
from discord.ext import commands, tasks
import asyncio
server_handler = {}
reactions = ["\U000027A1", "\U00002705", "\U0000274C", "\U0001F504", "\U0001F500", "\U0001F6D1"]
instructions ... | true | true |
1c2d2137de95de3a8e372e8383217ce2f7000d2c | 3,288 | py | Python | app/settings.py | khaledzaki2017/Recipe-app-api | c525b2764866fc3b8501baf9d8e9c7cc0374080b | [
"MIT"
] | null | null | null | app/settings.py | khaledzaki2017/Recipe-app-api | c525b2764866fc3b8501baf9d8e9c7cc0374080b | [
"MIT"
] | null | null | null | app/settings.py | khaledzaki2017/Recipe-app-api | c525b2764866fc3b8501baf9d8e9c7cc0374080b | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bui... | 24.721805 | 91 | 0.690389 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'z+-!#mb%g3ridp=b(nyb-2e3g5y-lf@2agwp9p6d#v^*a^uff9'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c2d2151cd5b2fc48c97bf31c39a0ca0e80eb1a1 | 18,214 | py | Python | rex_gym/envs/gym/walk_env.py | Dzhange/rex-gym | 3ffb674ade13ceac3352c3329f1804eb21a08403 | [
"Apache-2.0"
] | null | null | null | rex_gym/envs/gym/walk_env.py | Dzhange/rex-gym | 3ffb674ade13ceac3352c3329f1804eb21a08403 | [
"Apache-2.0"
] | null | null | null | rex_gym/envs/gym/walk_env.py | Dzhange/rex-gym | 3ffb674ade13ceac3352c3329f1804eb21a08403 | [
"Apache-2.0"
] | null | null | null | """This file implements the gym environment of rex alternating legs.
"""
import math
import random
from gym import spaces
import numpy as np
from .. import rex_gym_env
from ...model import rex_constants
from ...model.gait_planner import GaitPlanner
from ...model.kinematics import Kinematics
NUM_LEGS = 4
class RexW... | 46.464286 | 138 | 0.566981 | import math
import random
from gym import spaces
import numpy as np
from .. import rex_gym_env
from ...model import rex_constants
from ...model.gait_planner import GaitPlanner
from ...model.kinematics import Kinematics
NUM_LEGS = 4
class RexWalkEnv(rex_gym_env.RexGymEnv):
metadata = {"render.modes": ["human", "... | true | true |
1c2d23a538a46a1a35586ddeca8f545e09db4f19 | 1,587 | py | Python | lib/galaxy/tool_util/deps/mulled/mulled_build_tool.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tool_util/deps/mulled/mulled_build_tool.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | 6 | 2021-11-11T20:57:49.000Z | 2021-12-10T15:30:33.000Z | lib/galaxy/tool_util/deps/mulled/mulled_build_tool.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
"""Build a mulled images for a tool source (Galaxy or CWL tool).
Examples:
Build mulled images for requirements defined in a tool:
mulled-build-tool build path/to/tool_file.xml
"""
from galaxy.tool_util.parser import get_tool_source
from ._cli import arg_parser
from .mulled_build import (... | 29.943396 | 109 | 0.741021 |
from galaxy.tool_util.parser import get_tool_source
from ._cli import arg_parser
from .mulled_build import (
add_build_arguments,
add_single_image_arguments,
args_to_mull_targets_kwds,
mull_targets,
)
from .util import build_target
def main(argv=None):
parser = arg_parser(argv, globals())
ad... | true | true |
1c2d2413a1ef1a75bc362e732da7ec8c9048a08e | 3,848 | py | Python | everbean/tasks.py | messense/everbean | 2d93cff0f2f707aff25025b4e07ab1f6104b4854 | [
"MIT"
] | 2 | 2015-07-17T00:34:53.000Z | 2019-07-08T09:35:51.000Z | everbean/tasks.py | messense/everbean | 2d93cff0f2f707aff25025b4e07ab1f6104b4854 | [
"MIT"
] | 4 | 2015-05-21T13:36:39.000Z | 2017-08-21T12:40:35.000Z | everbean/tasks.py | messense/everbean | 2d93cff0f2f707aff25025b4e07ab1f6104b4854 | [
"MIT"
] | null | null | null | # coding=utf-8
from __future__ import (
with_statement,
absolute_import,
unicode_literals
)
from datetime import datetime
from flask import current_app as app
from flask.ext.mail import Message
from .core import mail, db, celery
from .account.models import User
from .note.models import Note
from .ext.doub... | 24.825806 | 77 | 0.650728 |
from __future__ import (
with_statement,
absolute_import,
unicode_literals
)
from datetime import datetime
from flask import current_app as app
from flask.ext.mail import Message
from .core import mail, db, celery
from .account.models import User
from .note.models import Note
from .ext.douban import (
... | true | true |
1c2d28a71efc509d66a44e44cc0bbc4d58484dd8 | 6,328 | py | Python | src/radixlib/parsers/no_parser.py | 0xOmarA/RadixLib | 85d75a47d4c4df4c1a319b74857ae2c513933623 | [
"MIT"
] | 32 | 2022-01-12T16:52:28.000Z | 2022-03-24T18:05:47.000Z | src/radixlib/parsers/no_parser.py | 0xOmarA/RadixLib | 85d75a47d4c4df4c1a319b74857ae2c513933623 | [
"MIT"
] | 3 | 2022-01-12T17:01:55.000Z | 2022-02-12T15:14:16.000Z | src/radixlib/parsers/no_parser.py | 0xOmarA/RadixLib | 85d75a47d4c4df4c1a319b74857ae2c513933623 | [
"MIT"
] | 1 | 2022-01-21T04:28:07.000Z | 2022-01-21T04:28:07.000Z | from typing import Callable, Optional, Any
from radixlib.parsers.base_parser import ParserBase
class NoParser(ParserBase):
""" Defines a parser which performs no parsing of the data whatsoever.
This class defines a parser which does not perform parsing over any of the data at all. While
this class might ... | 46.874074 | 101 | 0.70354 | from typing import Callable, Optional, Any
from radixlib.parsers.base_parser import ParserBase
class NoParser(ParserBase):
@classmethod
def parse(
cls,
data: Any,
data_type: str
) -> Any:
function_name: str = f'parse_{data_type}'
parsing_function: Optional... | true | true |
1c2d2a773462018896ad739e576823a0d2b1692c | 1,559 | py | Python | symphony/cli/gql/tests/test_transport.py | idoshveki/magma | 8022267bd8b8d94913fbb9a0836880361d785446 | [
"BSD-3-Clause"
] | 2 | 2020-11-05T18:58:26.000Z | 2021-02-09T06:42:49.000Z | symphony/cli/gql/tests/test_transport.py | idoshveki/magma | 8022267bd8b8d94913fbb9a0836880361d785446 | [
"BSD-3-Clause"
] | 10 | 2021-03-31T20:19:00.000Z | 2022-02-19T07:09:57.000Z | symphony/cli/gql/tests/test_transport.py | idoshveki/magma | 8022267bd8b8d94913fbb9a0836880361d785446 | [
"BSD-3-Clause"
] | 3 | 2020-08-20T18:45:34.000Z | 2020-08-20T20:18:42.000Z | #!/usr/bin/env python3
import pytest
import requests
from gql import Client, gql
from gql.transport.requests import RequestsHTTPTransport
@pytest.fixture
def client():
request = requests.get(
"http://swapi.graphene-python.org/graphql",
headers={"Host": "swapi.graphene-python.org", "Accept": "text... | 23.984615 | 77 | 0.479153 |
import pytest
import requests
from gql import Client, gql
from gql.transport.requests import RequestsHTTPTransport
@pytest.fixture
def client():
request = requests.get(
"http://swapi.graphene-python.org/graphql",
headers={"Host": "swapi.graphene-python.org", "Accept": "text/html"},
)
req... | true | true |
1c2d2aeb9f93a8945d0da4537d89d203cc18a3cb | 27,956 | py | Python | r6sapi/players.py | dasBunny/RainbowSixSiege-Python-API | dade9efd41b2a8855e65347ea1c70b85c3a36bbf | [
"MIT"
] | null | null | null | r6sapi/players.py | dasBunny/RainbowSixSiege-Python-API | dade9efd41b2a8855e65347ea1c70b85c3a36bbf | [
"MIT"
] | null | null | null | r6sapi/players.py | dasBunny/RainbowSixSiege-Python-API | dade9efd41b2a8855e65347ea1c70b85c3a36bbf | [
"MIT"
] | null | null | null | """
Copyright (c) 2016-2019 billyoyo
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, publish, distribute, ... | 43.477449 | 460 | 0.639648 |
import asyncio
import inspect
from .exceptions import InvalidRequest
from .platforms import PlatformURLNames
from .weapons import *
from .gamemodes import *
from .gamequeues import *
from .operators import *
from .ranks import *
class PlayerUrlTemplates:
FETCH_STATISTIC = "https://public-ubiservices.ubi.com/v1/... | true | true |
1c2d2c23a3bcd443b95c043f6fb27c7092470d17 | 142 | py | Python | zcrmsdk/src/com/zoho/crm/api/bulk_write/response_wrapper.py | zoho/zohocrm-python-sdk-2.0 | 3a93eb3b57fed4e08f26bd5b311e101cb2995411 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/bulk_write/response_wrapper.py | zoho/zohocrm-python-sdk-2.0 | 3a93eb3b57fed4e08f26bd5b311e101cb2995411 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/bulk_write/response_wrapper.py | zoho/zohocrm-python-sdk-2.0 | 3a93eb3b57fed4e08f26bd5b311e101cb2995411 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
class ResponseWrapper(ABC):
def __init__(self):
"""Creates an instance of ResponseWrapper"""
pass
| 15.777778 | 46 | 0.746479 | from abc import ABC, abstractmethod
class ResponseWrapper(ABC):
def __init__(self):
pass
| true | true |
1c2d2c2a9b337d93ae73da357bf12fb17a8477bd | 52,929 | py | Python | py_entitymatching/catalog/catalog_manager.py | kvpradap/py_entitymatching | 4ff803df1a03cf4d77ef935357355e6de5dd9438 | [
"BSD-3-Clause"
] | 165 | 2016-08-28T14:30:01.000Z | 2022-03-29T17:24:03.000Z | py_entitymatching/catalog/catalog_manager.py | mvahit/py_entitymatching | 6724081d7d95c547e5a51625b4a8207c6c1737f8 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 70 | 2016-11-22T00:35:22.000Z | 2022-03-11T22:26:26.000Z | py_entitymatching/catalog/catalog_manager.py | mvahit/py_entitymatching | 6724081d7d95c547e5a51625b4a8207c6c1737f8 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 53 | 2016-09-22T02:07:34.000Z | 2022-03-19T18:57:06.000Z | # coding=utf-8
"""
This module contains wrapper functions for the catalog.
"""
import logging
import pandas as pd
import six
import py_entitymatching.utils.catalog_helper as ch
from py_entitymatching.catalog.catalog import Catalog
from py_entitymatching.utils.validation_helper import validate_object_type
logger = lo... | 36.832985 | 106 | 0.652006 |
import logging
import pandas as pd
import six
import py_entitymatching.utils.catalog_helper as ch
from py_entitymatching.catalog.catalog import Catalog
from py_entitymatching.utils.validation_helper import validate_object_type
logger = logging.getLogger(__name__)
def get_property(data_frame, property_name):
... | true | true |
1c2d2c9056f3f7435f1e80d6ff4b5cde68b9076d | 10,970 | py | Python | cvxpy/reductions/solvers/conic_solvers/conic_solver.py | adshieh/cvxpy | 73b696b71dbb2ceb66a805798c922461e33afc6b | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-12-21T03:11:12.000Z | 2022-03-02T16:56:24.000Z | cvxpy/reductions/solvers/conic_solvers/conic_solver.py | adshieh/cvxpy | 73b696b71dbb2ceb66a805798c922461e33afc6b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/reductions/solvers/conic_solvers/conic_solver.py | adshieh/cvxpy | 73b696b71dbb2ceb66a805798c922461e33afc6b | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-11-17T15:45:54.000Z | 2020-11-17T15:45:54.000Z | """
Copyright 2017 Robin Verschueren, 2017 Akshay Agrawal
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... | 41.711027 | 86 | 0.583227 |
import cvxpy.settings as s
from cvxpy.constraints import SOC, ExpCone, PSD, Zero, NonNeg
from cvxpy.reductions.cvx_attr2constr import convex_attributes
from cvxpy.reductions.dcp2cone.cone_matrix_stuffing import ParamConeProg
from cvxpy.reductions.solution import Solution, failure_solution
from cvxpy.reductions.solvers... | true | true |
1c2d2cce86d70b42f0fd8a31f5f38480d589a8a6 | 2,914 | py | Python | f5_cccl/resource/ltm/test/test_irule.py | f5yacobucci/f5-cccl | 64e7fa0a6d4ead9b5209b5b46bf4ed1b6cef036a | [
"Apache-2.0"
] | null | null | null | f5_cccl/resource/ltm/test/test_irule.py | f5yacobucci/f5-cccl | 64e7fa0a6d4ead9b5209b5b46bf4ed1b6cef036a | [
"Apache-2.0"
] | null | null | null | f5_cccl/resource/ltm/test/test_irule.py | f5yacobucci/f5-cccl | 64e7fa0a6d4ead9b5209b5b46bf4ed1b6cef036a | [
"Apache-2.0"
] | 1 | 2019-11-02T05:22:48.000Z | 2019-11-02T05:22:48.000Z | #!/usr/bin/env python
# Copyright 2017 F5 Networks 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... | 21.746269 | 74 | 0.640014 |
from copy import copy
from f5_cccl.resource.ltm.irule import IRule
from mock import Mock
import pytest
ssl_redirect_irule_1 = """
when HTTP_REQUEST {
HTTP::redirect https://[getfield [HTTP::host] \":\" 1][HTTP::uri]
}
"""
cfg_test = {
'name': 'ssl_redirect',
'partition': '... | true | true |
1c2d2d3875cb0e774551d5ff9f6a71a5260ab0f5 | 109 | py | Python | notes/admin.py | mbassale/noteprg | 31042224c396441ba6954de4ed5d0b4f3e1efa71 | [
"MIT"
] | null | null | null | notes/admin.py | mbassale/noteprg | 31042224c396441ba6954de4ed5d0b4f3e1efa71 | [
"MIT"
] | 4 | 2021-03-30T12:57:11.000Z | 2021-06-10T18:45:28.000Z | notes/admin.py | mbassale/noteprg | 31042224c396441ba6954de4ed5d0b4f3e1efa71 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Note
# Register your models here.
admin.register(Note)
| 18.166667 | 32 | 0.798165 | from django.contrib import admin
from .models import Note
admin.register(Note)
| true | true |
1c2d2d3cf5b1d5868ecf0db1f97ce9e33cb66b8c | 2,844 | py | Python | tests/common/test_run/truncatemod_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | tests/common/test_run/truncatemod_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | tests/common/test_run/truncatemod_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.056338 | 119 | 0.662799 |
from akg.utils import kernel_exec as utils
from tensorio import compare_tensor
import numpy as np
from gen_random import random_gaussian
from test_op import truncatemod
from base import get_rtol_atol
def truncatemod_run(shape1, shape2, dtype, attrs):
if 'tuning' in attrs.keys():
t = attrs.g... | true | true |
1c2d2defd3c46424bb893cb4ea7bdee520efc1cb | 821 | py | Python | lab5.py | GregoryLazarev/SP_LAB5_6 | 39b1914e2782d2f20fc412da82b485b187de6dda | [
"MIT"
] | null | null | null | lab5.py | GregoryLazarev/SP_LAB5_6 | 39b1914e2782d2f20fc412da82b485b187de6dda | [
"MIT"
] | null | null | null | lab5.py | GregoryLazarev/SP_LAB5_6 | 39b1914e2782d2f20fc412da82b485b187de6dda | [
"MIT"
] | null | null | null | import threading
tr_dict = dict()
mutex = threading.Lock()
prohibited = (',','.','?','!','-','+','\'','@')
def Count_trigrams(in_str):
trgrms = dict()
trgrm = ""
for i in in_str:
if i not in prohibited:
trgrm += i
else:
trgrm = ""
if len(trgrm) == 3:
if trgrm in trgrms:
trgrms[... | 18.244444 | 56 | 0.580999 | import threading
tr_dict = dict()
mutex = threading.Lock()
prohibited = (',','.','?','!','-','+','\'','@')
def Count_trigrams(in_str):
trgrms = dict()
trgrm = ""
for i in in_str:
if i not in prohibited:
trgrm += i
else:
trgrm = ""
if len(trgrm) == 3:
if trgrm in trgrms:
trgrms[... | true | true |
1c2d2df0d25244136dde5a5320b73448f8857bc0 | 22,649 | py | Python | certbot/tests/compat/filesystem_test.py | venim/certbot | fe01390f925eb72d13709e4cd065e727c9eeaa75 | [
"Apache-2.0"
] | null | null | null | certbot/tests/compat/filesystem_test.py | venim/certbot | fe01390f925eb72d13709e4cd065e727c9eeaa75 | [
"Apache-2.0"
] | null | null | null | certbot/tests/compat/filesystem_test.py | venim/certbot | fe01390f925eb72d13709e4cd065e727c9eeaa75 | [
"Apache-2.0"
] | null | null | null | """Tests for certbot.compat.filesystem"""
import contextlib
import errno
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock
from certbot import util
from certbot._internal import lock
from certbot.compat import filesystem
from certbot.compat import os
import cert... | 41.255009 | 119 | 0.692525 | import contextlib
import errno
import unittest
try:
import mock
except ImportError:
from unittest import mock
from certbot import util
from certbot._internal import lock
from certbot.compat import filesystem
from certbot.compat import os
import certbot.tests.util as test_util
from certbot.tests.util import T... | true | true |
1c2d2eeb5796406a7964c144d0b8b98a0c2da39a | 138 | py | Python | tests/types/test_types_package.py | authlete/authlete-python | 751514c525cd04a930373de78463a1fe71b6da60 | [
"Apache-2.0"
] | 5 | 2019-07-30T01:37:04.000Z | 2021-02-15T05:55:55.000Z | tests/types/test_types_package.py | DestinyCall/authlete-python | 751514c525cd04a930373de78463a1fe71b6da60 | [
"Apache-2.0"
] | null | null | null | tests/types/test_types_package.py | DestinyCall/authlete-python | 751514c525cd04a930373de78463a1fe71b6da60 | [
"Apache-2.0"
] | 1 | 2021-02-15T05:55:56.000Z | 2021-02-15T05:55:56.000Z | import unittest
from authlete.types import *
class TestDtoPackage(unittest.TestCase):
def test_1(self):
ApplicationType.WEB
| 17.25 | 40 | 0.746377 | import unittest
from authlete.types import *
class TestDtoPackage(unittest.TestCase):
def test_1(self):
ApplicationType.WEB
| true | true |
1c2d2fe1bb015c0395aa7a11e44cbb7e502a54cc | 6,922 | py | Python | src/healthcareapis/azext_healthcareapis/custom.py | dijyotir/azure-cli-extensions | db626a9d53f7a3a683d9629cbd3d86fdcce98118 | [
"MIT"
] | 1 | 2021-09-16T09:13:38.000Z | 2021-09-16T09:13:38.000Z | src/healthcareapis/azext_healthcareapis/custom.py | dijyotir/azure-cli-extensions | db626a9d53f7a3a683d9629cbd3d86fdcce98118 | [
"MIT"
] | null | null | null | src/healthcareapis/azext_healthcareapis/custom.py | dijyotir/azure-cli-extensions | db626a9d53f7a3a683d9629cbd3d86fdcce98118 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 56.276423 | 134 | 0.651401 |
def create_healthcareapis(cmd, client,
resource_group,
name,
kind,
location,
access_policies_object_id,
tags=None,
etag=None,
... | true | true |
1c2d348864a628a2ff495a5fdc2d7ebec058f190 | 122 | py | Python | plenum/test/primary_selection/test_primary_selection_routes.py | steptan/indy-plenum | 488bf63c82753a74a92ac6952da784825ffd4a3d | [
"Apache-2.0"
] | null | null | null | plenum/test/primary_selection/test_primary_selection_routes.py | steptan/indy-plenum | 488bf63c82753a74a92ac6952da784825ffd4a3d | [
"Apache-2.0"
] | null | null | null | plenum/test/primary_selection/test_primary_selection_routes.py | steptan/indy-plenum | 488bf63c82753a74a92ac6952da784825ffd4a3d | [
"Apache-2.0"
] | null | null | null | from plenum.test.conftest import looper
nodeCount = 7
def test_routes(nodeSet, up):
# TODO: Low priority.
pass
| 13.555556 | 39 | 0.704918 | from plenum.test.conftest import looper
nodeCount = 7
def test_routes(nodeSet, up):
pass
| true | true |
1c2d34d62c53dc9486da792127a3f5778a42701f | 3,092 | py | Python | cwharaj/cwharaj/spiders/_mstaml_debug_spider.py | trujunzhang/djzhang-targets | c2e327acde9d51f0455e7243f17d93d74b579501 | [
"MIT"
] | 2 | 2018-12-03T16:30:55.000Z | 2019-04-03T13:29:20.000Z | cwharaj/cwharaj/spiders/_mstaml_debug_spider.py | trujunzhang/djzhang-targets | c2e327acde9d51f0455e7243f17d93d74b579501 | [
"MIT"
] | null | null | null | cwharaj/cwharaj/spiders/_mstaml_debug_spider.py | trujunzhang/djzhang-targets | c2e327acde9d51f0455e7243f17d93d74b579501 | [
"MIT"
] | 1 | 2019-04-03T13:29:25.000Z | 2019-04-03T13:29:25.000Z | # -*- coding: utf-8 -*-
import scrapy
from cwharaj.scraped_websites import WebsiteTypes, websites_allowed_domains, is_pagination
class MstamlDebugWatchSpider(scrapy.Spider):
url_from = WebsiteTypes.mstaml
name = "{}_debug".format(url_from.value)
details_urls = [
# Details
# 'http://www.m... | 48.3125 | 105 | 0.559832 |
import scrapy
from cwharaj.scraped_websites import WebsiteTypes, websites_allowed_domains, is_pagination
class MstamlDebugWatchSpider(scrapy.Spider):
url_from = WebsiteTypes.mstaml
name = "{}_debug".format(url_from.value)
details_urls = [
... | true | true |
1c2d353839d357fc3f304e21e3a23bc1936234b5 | 30,587 | py | Python | bg/graphviz.py | sergey-aganezov-jr/bg | 1ec758193441e49e7b34e0da09571480f4c24455 | [
"MIT"
] | 2 | 2020-01-29T14:26:18.000Z | 2020-09-08T05:37:15.000Z | bg/graphviz.py | sergey-aganezov-jr/bg | 1ec758193441e49e7b34e0da09571480f4c24455 | [
"MIT"
] | 3 | 2015-12-25T17:36:50.000Z | 2017-11-23T17:06:09.000Z | bg/graphviz.py | sergey-aganezov-jr/bg | 1ec758193441e49e7b34e0da09571480f4c24455 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import defaultdict
from collections import deque
from enum import Enum
from ete3 import TreeNode
from bg.edge import BGEdge
from bg.genome import BGGenome
from bg.multicolor import Multicolor
from bg.utils import get_from_dict_with_path
from bg.vertices import BGVertex, Infini... | 46.984639 | 157 | 0.679635 |
from collections import defaultdict
from collections import deque
from enum import Enum
from ete3 import TreeNode
from bg.edge import BGEdge
from bg.genome import BGGenome
from bg.multicolor import Multicolor
from bg.utils import get_from_dict_with_path
from bg.vertices import BGVertex, InfinityVertex, TaggedInfinit... | true | true |
1c2d353a656cee00eaf8f5db2afb2488b261dd8c | 685 | py | Python | app/middlewares.py | wasp/waspy-example | 98f25b68808925ef5ae14b68670650eeb61f47eb | [
"Apache-2.0"
] | null | null | null | app/middlewares.py | wasp/waspy-example | 98f25b68808925ef5ae14b68670650eeb61f47eb | [
"Apache-2.0"
] | null | null | null | app/middlewares.py | wasp/waspy-example | 98f25b68808925ef5ae14b68670650eeb61f47eb | [
"Apache-2.0"
] | 1 | 2018-03-19T22:00:12.000Z | 2018-03-19T22:00:12.000Z |
async def attach_object(app, handler):
""" This middleware shows an example of adding something
to the request object """
async def middleware(request):
request.some_object = object()
return await handler(request)
return middleware
async def add_header(app, handler):
""" This mid... | 32.619048 | 70 | 0.683212 |
async def attach_object(app, handler):
async def middleware(request):
request.some_object = object()
return await handler(request)
return middleware
async def add_header(app, handler):
async def middleware(request):
response = await handler(request)
if response.headers.ge... | true | true |
1c2d3572b7617a11b0cd4abb4a1e94698e519aaa | 375 | py | Python | configs/_base_/schedules/schedule_1k.py | AnonSubmission6150/submission6150 | 571633d9a12b4fd7a9546947787fc068966dab04 | [
"Apache-2.0"
] | null | null | null | configs/_base_/schedules/schedule_1k.py | AnonSubmission6150/submission6150 | 571633d9a12b4fd7a9546947787fc068966dab04 | [
"Apache-2.0"
] | null | null | null | configs/_base_/schedules/schedule_1k.py | AnonSubmission6150/submission6150 | 571633d9a12b4fd7a9546947787fc068966dab04 | [
"Apache-2.0"
] | null | null | null | # optimizer
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
optimizer_config = dict()
# learning policy
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=2000)
checkpoint_config = dict(by_epoch=False, inter... | 41.666667 | 72 | 0.757333 |
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
optimizer_config = dict()
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
runner = dict(type='IterBasedRunner', max_iters=2000)
checkpoint_config = dict(by_epoch=False, interval=200)
evaluation = dict(interval=200, metri... | true | true |
1c2d35ec21d0c5f7564e7e31974aa32de2b16ac0 | 362 | py | Python | review/urls.py | jamilnoyda/login-sign-in-logout-changepassword-in-django | d8cbbe1d7cbab0607e5ca737728a5f4627c49c07 | [
"MIT"
] | null | null | null | review/urls.py | jamilnoyda/login-sign-in-logout-changepassword-in-django | d8cbbe1d7cbab0607e5ca737728a5f4627c49c07 | [
"MIT"
] | null | null | null | review/urls.py | jamilnoyda/login-sign-in-logout-changepassword-in-django | d8cbbe1d7cbab0607e5ca737728a5f4627c49c07 | [
"MIT"
] | null | null | null | from django.conf.urls import url,include
from . import *
from . import views
from django.views.generic.base import TemplateView
app_name='review'
urlpatterns = [
url(r'^signup/', views.SignUp.as_view(), name='signup'),
url(r'^customerlist/', views.CustomerListView.as_view(), name='list'),
#url(r'^hom... | 18.1 | 74 | 0.668508 | from django.conf.urls import url,include
from . import *
from . import views
from django.views.generic.base import TemplateView
app_name='review'
urlpatterns = [
url(r'^signup/', views.SignUp.as_view(), name='signup'),
url(r'^customerlist/', views.CustomerListView.as_view(), name='list'),
... | true | true |
1c2d360757f9b6fad75aee38c6ffc1f0a4c4c337 | 399 | py | Python | Assignment-3/gcdLcm.py | HembramBeta777/Python-Programming | 827611b0613d9d953d13fb04ea9b5c5ac3c510f2 | [
"BSD-3-Clause"
] | 2 | 2020-09-01T04:58:16.000Z | 2021-01-30T03:45:52.000Z | Assignment-3/gcdLcm.py | HembramBeta777/Python-Programming | 827611b0613d9d953d13fb04ea9b5c5ac3c510f2 | [
"BSD-3-Clause"
] | null | null | null | Assignment-3/gcdLcm.py | HembramBeta777/Python-Programming | 827611b0613d9d953d13fb04ea9b5c5ac3c510f2 | [
"BSD-3-Clause"
] | null | null | null | # To find GCD and LCM of two numbers.
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
i=1
while( (i<=num1) and (i<=num2) ):
if( (num1%i==0) and (num2%i==0) ):
GCD = i;
i = i+1
print("The GCD of",num1,"and",num2,"is:",GCD)
lc... | 19.95 | 47 | 0.516291 |
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
i=1
while( (i<=num1) and (i<=num2) ):
if( (num1%i==0) and (num2%i==0) ):
GCD = i;
i = i+1
print("The GCD of",num1,"and",num2,"is:",GCD)
lcm = (num1 * num2) // GCD
print("The L... | true | true |
1c2d3746dc514c02495497b0e298410fc17f7ff9 | 1,349 | py | Python | pymager/resources/_path.py | samidalouche/pymager | 86a5f02163def40b7bbf81fd17e4c3e84bc5059c | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2015-01-20T03:24:13.000Z | 2015-01-20T03:24:13.000Z | pymager/resources/_path.py | samidalouche/pymager | 86a5f02163def40b7bbf81fd17e4c3e84bc5059c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | pymager/resources/_path.py | samidalouche/pymager | 86a5f02163def40b7bbf81fd17e4c3e84bc5059c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
Copyright 2010 Sami Dalouche
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 ... | 34.589744 | 86 | 0.72424 |
import os
class Path(object):
def __init__(self, reference_directory, path_elements=[]):
self.__reference_directory = reference_directory
self.__path_elements = path_elements
def parent_directory(self):
return Path(self.__reference_directory, self.__path_elements[:-1])
de... | true | true |
1c2d38ce51164a71d268b0df377e00336ed974d3 | 983 | py | Python | lib/spack/spack/analyzers/install_files.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | lib/spack/spack/analyzers/install_files.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | lib/spack/spack/analyzers/install_files.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""The install files json file (install_manifest.json) already exists in
the package install folder, so this analyzer simp... | 30.71875 | 79 | 0.733469 |
import os
import spack.monitor
from .analyzer_base import AnalyzerBase
class InstallFiles(AnalyzerBase):
name = "install_files"
outfile = "spack-analyzer-install-files.json"
description = "install file listing read from install_manifest.json"
def run(self):
manifest_file = os.path.j... | true | true |
1c2d3978d6b4d992081478a6033e9332b9d07db0 | 1,073 | py | Python | Luggage-Management-QR-System-master/Website/mongo_api.py | Shaunak04/S.C.A.M.S | 7f10f1c679a0b76269d0dcf05aa17cc26a268e1c | [
"Apache-2.0"
] | null | null | null | Luggage-Management-QR-System-master/Website/mongo_api.py | Shaunak04/S.C.A.M.S | 7f10f1c679a0b76269d0dcf05aa17cc26a268e1c | [
"Apache-2.0"
] | null | null | null | Luggage-Management-QR-System-master/Website/mongo_api.py | Shaunak04/S.C.A.M.S | 7f10f1c679a0b76269d0dcf05aa17cc26a268e1c | [
"Apache-2.0"
] | null | null | null | import pymongo
from bson import ObjectId
import dns
import gridfs
connection = None
database = None
QR_Gen_Accounts = None
QR_Read_Accounts = None
Flights = None
Luggage = None
Complaint = None
user_db = None
def get_obj_id(id):
return ObjectId(id)
def main():
global connection
global database
globa... | 22.829787 | 118 | 0.724138 | import pymongo
from bson import ObjectId
import dns
import gridfs
connection = None
database = None
QR_Gen_Accounts = None
QR_Read_Accounts = None
Flights = None
Luggage = None
Complaint = None
user_db = None
def get_obj_id(id):
return ObjectId(id)
def main():
global connection
global database
globa... | true | true |
1c2d3a2ae09f20773917cb473932130238c7a165 | 649 | py | Python | pil_resize_aspect_ratio/enums/fill_type.py | kkristof200/py_resize_image | 33824c691481b2166ade18e7fa6b5583ceeaa4f6 | [
"MIT"
] | null | null | null | pil_resize_aspect_ratio/enums/fill_type.py | kkristof200/py_resize_image | 33824c691481b2166ade18e7fa6b5583ceeaa4f6 | [
"MIT"
] | null | null | null | pil_resize_aspect_ratio/enums/fill_type.py | kkristof200/py_resize_image | 33824c691481b2166ade18e7fa6b5583ceeaa4f6 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------- Imports ---------------------------------------------------------------- #
# System
from enum import Enum
# ---------------------------------------------------------------------------------------------------------------------------------------- #
# ... | 40.5625 | 140 | 0.107858 |
from enum import Enum
class FillType(Enum):
Fill = 0
Fit = 1
| true | true |
1c2d3a915d317a05969c55ff714a638a4a1dca31 | 7,338 | py | Python | Modules/Gekokujo_vanilla_enhanced/Code/Module_system/ID_parties.py | roalyr/gekokujo_vanilla_enhanced | 84d8cc1033be98357ac139fafbc1c10851274019 | [
"MIT"
] | null | null | null | Modules/Gekokujo_vanilla_enhanced/Code/Module_system/ID_parties.py | roalyr/gekokujo_vanilla_enhanced | 84d8cc1033be98357ac139fafbc1c10851274019 | [
"MIT"
] | null | null | null | Modules/Gekokujo_vanilla_enhanced/Code/Module_system/ID_parties.py | roalyr/gekokujo_vanilla_enhanced | 84d8cc1033be98357ac139fafbc1c10851274019 | [
"MIT"
] | null | null | null | p_main_party = 0
p_temp_party = 1
p_camp_bandits = 2
p_temp_party_2 = 3
p_temp_casualties = 4
p_temp_casualties_2 = 5
p_temp_casualties_3 = 6
p_temp_wounded = 7
p_temp_killed = 8
p_main_party_backup = 9
p_encountered_party_backup = 10
p_collective_friends_backup = 11
p_player_casualties = 12
p_enemy_casual... | 19.832432 | 36 | 0.748569 | p_main_party = 0
p_temp_party = 1
p_camp_bandits = 2
p_temp_party_2 = 3
p_temp_casualties = 4
p_temp_casualties_2 = 5
p_temp_casualties_3 = 6
p_temp_wounded = 7
p_temp_killed = 8
p_main_party_backup = 9
p_encountered_party_backup = 10
p_collective_friends_backup = 11
p_player_casualties = 12
p_enemy_casual... | true | true |
1c2d3aced5ecffbaf0cfc56972803dc0a6b35f06 | 2,585 | py | Python | check_nifi_java_gc.py | adolci/nagios-plugins | 0d8cee0376467922b3315e9b0e08b98454eb9853 | [
"IBM-pibs",
"Apache-1.1"
] | null | null | null | check_nifi_java_gc.py | adolci/nagios-plugins | 0d8cee0376467922b3315e9b0e08b98454eb9853 | [
"IBM-pibs",
"Apache-1.1"
] | null | null | null | check_nifi_java_gc.py | adolci/nagios-plugins | 0d8cee0376467922b3315e9b0e08b98454eb9853 | [
"IBM-pibs",
"Apache-1.1"
] | 3 | 2019-07-25T11:46:32.000Z | 2019-12-17T05:01:03.000Z | #!/usr/bin/env python
# coding=utf-8
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2018-08-15 23:18:55 +0100 (Wed, 15 Aug 2018)
#
# https://github.com/harisekhon/nagios-plugins
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on Linke... | 29.375 | 96 | 0.688975 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import traceback
srcdir = os.path.abspath(os.path.dirname(__file__))
libdir = os.path.join(srcdir, 'pylib')
sys.path.append(libdir)... | true | true |
1c2d3c06541d8d9d49bb74af0946d1aa1c05a633 | 118 | py | Python | jr_tools/exceptions.py | erickgnavar/jr_tools | 46719b5708446ab19139fd5ac29d5bf51cf896b8 | [
"MIT"
] | 1 | 2017-11-02T01:39:11.000Z | 2017-11-02T01:39:11.000Z | jr_tools/exceptions.py | erickgnavar/jasper-reports-tools | 46719b5708446ab19139fd5ac29d5bf51cf896b8 | [
"MIT"
] | 1 | 2021-11-15T17:46:27.000Z | 2021-11-15T17:46:27.000Z | jr_tools/exceptions.py | erickgnavar/jr_tools | 46719b5708446ab19139fd5ac29d5bf51cf896b8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class ConnectionError(Exception):
pass
class InvalidOutputFormat(Exception):
pass
| 11.8 | 37 | 0.677966 |
class ConnectionError(Exception):
pass
class InvalidOutputFormat(Exception):
pass
| true | true |
1c2d3fd9537edf88a43260b481f18923fcf5e997 | 13,165 | py | Python | nipyapi/nifi/models/variable_registry_update_request_dto.py | esecules/nipyapi | e8a53b79a5e1a6b29446f43d2b23b6a3e60873f1 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/variable_registry_update_request_dto.py | esecules/nipyapi | e8a53b79a5e1a6b29446f43d2b23b6a3e60873f1 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/variable_registry_update_request_dto.py | esecules/nipyapi | e8a53b79a5e1a6b29446f43d2b23b6a3e60873f1 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 32.426108 | 479 | 0.638055 |
from pprint import pformat
from six import iteritems
import re
class VariableRegistryUpdateRequestDTO(object):
swagger_types = {
'request_id': 'str',
'uri': 'str',
'submission_time': 'datetime',
'last_updated': 'datetime',
'complete': 'bool',
'failure_reason':... | true | true |
1c2d409204403961a0d30302df49fce90c8889f3 | 5,683 | py | Python | EquationModels/BurgerEquationRar.py | mroberto166/PinnsSub | 338c5400080ba570fd8f53d7481539225fcf4d17 | [
"MIT"
] | 12 | 2020-12-02T13:04:55.000Z | 2022-01-07T21:48:30.000Z | EquationModels/BurgerEquationRar.py | mroberto166/PinnsSub | 338c5400080ba570fd8f53d7481539225fcf4d17 | [
"MIT"
] | null | null | null | EquationModels/BurgerEquationRar.py | mroberto166/PinnsSub | 338c5400080ba570fd8f53d7481539225fcf4d17 | [
"MIT"
] | 7 | 2020-12-02T13:04:57.000Z | 2021-12-28T14:28:19.000Z | from ImportFile import *
# n_coll = 8192
# n_u = 1024
# n_int = 0
pi = math.pi
v = 0.0 / pi
extrema_values = torch.tensor([[0, 0.5],
[-1, 1]])
def compute_res(network, x_f_train, space_dimensions, solid_object, computing_error):
x_f_train.requires_grad = True
u = network(x_f_t... | 35.968354 | 180 | 0.609537 | from ImportFile import *
pi = math.pi
v = 0.0 / pi
extrema_values = torch.tensor([[0, 0.5],
[-1, 1]])
def compute_res(network, x_f_train, space_dimensions, solid_object, computing_error):
x_f_train.requires_grad = True
u = network(x_f_train).reshape(-1, )
inputs = torch... | true | true |
1c2d40deae9c4867f2393d509669e5420a25eca0 | 410 | py | Python | pip-script.py | prudhvipaluvayi/user-register | 2460096043723d3c7a009319ecc6c756794cc8a4 | [
"BSD-3-Clause"
] | null | null | null | pip-script.py | prudhvipaluvayi/user-register | 2460096043723d3c7a009319ecc6c756794cc8a4 | [
"BSD-3-Clause"
] | null | null | null | pip-script.py | prudhvipaluvayi/user-register | 2460096043723d3c7a009319ecc6c756794cc8a4 | [
"BSD-3-Clause"
] | null | null | null | #!C:\Users\sys\registration\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
... | 31.538462 | 70 | 0.641463 |
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==10.0.1', 'console_scripts', 'pip')()
)
| true | true |
1c2d41716344b0434003b76094b8ad45ad1d49fb | 3,406 | py | Python | besspin/cwesEvaluation/resourceManagement/customCweScores/helpers.py | CTSRD-CHERI/BESSPIN-Tool-Suite | 26c0e7ce8cf6ffa6e33ea4ff9aa6194892ef6474 | [
"Apache-2.0"
] | null | null | null | besspin/cwesEvaluation/resourceManagement/customCweScores/helpers.py | CTSRD-CHERI/BESSPIN-Tool-Suite | 26c0e7ce8cf6ffa6e33ea4ff9aa6194892ef6474 | [
"Apache-2.0"
] | null | null | null | besspin/cwesEvaluation/resourceManagement/customCweScores/helpers.py | CTSRD-CHERI/BESSPIN-Tool-Suite | 26c0e7ce8cf6ffa6e33ea4ff9aa6194892ef6474 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
""" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
helpers functions for scoring the CWE tests
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # """
import re
from besspin.base.utils.misc import *
from besspin.cwesEvaluation.scoreTests import SCORE... | 38.704545 | 112 | 0.586025 |
import re
from besspin.base.utils.misc import *
from besspin.cwesEvaluation.scoreTests import SCORES, adjustToCustomScore
def getOsImage (lines,testNum=None):
warnText = "" if (testNum is None) else " in test_{0}.log".format(testNum)
for line in lines:
lineMatch = re.match(r'^<OSIMAGE=(?P<osImage>\w... | true | true |
1c2d41c1ae9ef43b0330b91a6179f977d991f8fd | 181 | py | Python | blender_f3b/Logger.py | riccardobl/f3b | 87a79e047e3754b81c3290a5b4849ec21bbfa363 | [
"BSD-3-Clause"
] | 3 | 2020-10-12T03:15:06.000Z | 2020-11-27T16:01:23.000Z | blender_f3b/Logger.py | riccardobl/f3b | 87a79e047e3754b81c3290a5b4849ec21bbfa363 | [
"BSD-3-Clause"
] | null | null | null | blender_f3b/Logger.py | riccardobl/f3b | 87a79e047e3754b81c3290a5b4849ec21bbfa363 | [
"BSD-3-Clause"
] | null | null | null | def info( txt):
print("INFO: " + txt)
def warning( txt):
print("WARNING: " + txt)
def error( txt):
print("ERROR: " + txt)
def debug( txt):
print("DEBUG: " + txt) | 15.083333 | 28 | 0.541436 | def info( txt):
print("INFO: " + txt)
def warning( txt):
print("WARNING: " + txt)
def error( txt):
print("ERROR: " + txt)
def debug( txt):
print("DEBUG: " + txt) | true | true |
1c2d423828e8ffc7f33b8112b54d90c1438bfbec | 1,680 | py | Python | tkinter/__canvas__/canvas-bubbles/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | tkinter/__canvas__/canvas-bubbles/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | tkinter/__canvas__/canvas-bubbles/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z | import tkinter as tk
import random
class Bubble():
def __init__(self, canvas, x, y, size, color='red', start_offset_y=0):
self.canvas = canvas
self.x = x
self.y = y + start_offset_y
self.start_x = x
self.start_y = y
self.size = size
... | 23.661972 | 99 | 0.564881 | import tkinter as tk
import random
class Bubble():
def __init__(self, canvas, x, y, size, color='red', start_offset_y=0):
self.canvas = canvas
self.x = x
self.y = y + start_offset_y
self.start_x = x
self.start_y = y
self.size = size
... | true | true |
1c2d43cd92bb7e556034be28f68e1600460f258f | 441 | py | Python | data/scripts/templates/object/mobile/skeleton/shared_astromech.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/skeleton/shared_astromech.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/skeleton/shared_astromech.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/skeleton/shared_astromech.iff"
result.attribute_template_id = 9
resu... | 25.941176 | 64 | 0.725624 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.