hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f0ce7aaaf1a3b11fc9d159b0720225ac7679497c | 11,667 | py | Python | convert-2d.py | dcm684/lasercut | f459a9b9d73987e1a581728a51b031fb7aaea653 | [
"BSD-2-Clause"
] | null | null | null | convert-2d.py | dcm684/lasercut | f459a9b9d73987e1a581728a51b031fb7aaea653 | [
"BSD-2-Clause"
] | null | null | null | convert-2d.py | dcm684/lasercut | f459a9b9d73987e1a581728a51b031fb7aaea653 | [
"BSD-2-Clause"
] | null | null | null | """
Process a lasercut box to enable its production on a laser cutter, 3D printer, or other comparable device
Processes a given 3D OpenSCAD scad file using the lasercut library to create a file with the sides that can be used
by a laser cutter. Or if ff a value for extrusion thickness is given, the exported file would... | 40.651568 | 116 | 0.676609 |
65796cc6b298ba51086fbbf338e8c60d7dfda17a | 1,399 | py | Python | awards/models.py | hugglesfox/bsc-awards | 79ed77f9d97e5daccf31d83d850d6791ce3b86ed | [
"MIT"
] | null | null | null | awards/models.py | hugglesfox/bsc-awards | 79ed77f9d97e5daccf31d83d850d6791ce3b86ed | [
"MIT"
] | 44 | 2019-12-18T20:04:47.000Z | 2020-11-13T01:15:45.000Z | awards/models.py | hugglesfox/bsc-awards | 79ed77f9d97e5daccf31d83d850d6791ce3b86ed | [
"MIT"
] | null | null | null | from awards import db
class AwardRecipients(db.Model):
id = db.Column(db.Integer, primary_key=True)
student_id = db.Column(db.String(7), nullable=False)
award_id = db.Column(db.Integer, nullable=False)
class Student(db.Model):
student_id = db.Column(db.String(7), primary_key=True)
first_name = d... | 36.815789 | 59 | 0.706934 |
b257084c63b859febe789175f9c7609cf1f01ae4 | 8,010 | py | Python | openpharmacophore/algorithms/dbscan.py | uibcdf/openpharmacophore | 4f563fa206f6e7c081502acab97bb795d27bdeb9 | [
"MIT"
] | 14 | 2021-11-12T10:09:25.000Z | 2022-03-18T08:24:16.000Z | openpharmacophore/algorithms/dbscan.py | uibcdf/openpharmacophore | 4f563fa206f6e7c081502acab97bb795d27bdeb9 | [
"MIT"
] | 7 | 2021-11-05T01:37:57.000Z | 2022-01-18T06:03:39.000Z | openpharmacophore/algorithms/dbscan.py | uibcdf/openpharmacophore | 4f563fa206f6e7c081502acab97bb795d27bdeb9 | [
"MIT"
] | 3 | 2021-11-05T01:22:47.000Z | 2021-12-12T03:57:09.000Z | from openpharmacophore import PharmacophoricPoint
from openpharmacophore.utils.align_ligands import align_set_of_ligands
from openpharmacophore.pharmacophore.chemical_features import PharmacophoricPointExtractor
import numpy as np
from sklearn.cluster import DBSCAN
from rdkit import Chem, RDConfig
from rdkit.Chem impor... | 38.695652 | 135 | 0.626966 |
a2738315e8ec1fcb3ac5c01332236e67b6fb20d5 | 1,398 | py | Python | CreatAllFile.py | FAWC-bupt/Text-Classification | a68b639917d65778ec05ac41f0e8d2b3ac49c9fc | [
"MIT"
] | 4 | 2021-01-09T01:33:45.000Z | 2021-11-11T14:03:52.000Z | CreatAllFile.py | FAWC-bupt/Text-Classification | a68b639917d65778ec05ac41f0e8d2b3ac49c9fc | [
"MIT"
] | null | null | null | CreatAllFile.py | FAWC-bupt/Text-Classification | a68b639917d65778ec05ac41f0e8d2b3ac49c9fc | [
"MIT"
] | 1 | 2021-07-06T06:26:12.000Z | 2021-07-06T06:26:12.000Z | """
预处理部分3:
整合数据至一个文件all.txt,避免重复IO
"""
class_list = {'财经': 'Economics', '房产': 'House', '社会': 'Society', '时尚': 'Fashion', '教育': 'Education',
'科技': 'Technology', '时政': 'Politics', '体育': 'PE', '游戏': 'Game', '娱乐': 'Entertainment'}
if __name__ == '__main__':
all_data_test = ''
all_data_train = ''
... | 46.6 | 105 | 0.570815 |
665f487866570e0755261286e3f1a5e8c8c9dd74 | 2,145 | py | Python | src/oci/database_migration/models/job_collection.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/database_migration/models/job_collection.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/database_migration/models/job_collection.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 29.791667 | 245 | 0.652214 |
61ebbf8ddcb935be275478fa30e98fcc965eccce | 1,393 | py | Python | Fw/Python/src/fprime/common/models/serialize/i32_type.py | hunterpaulson/fprime | 70560897b56dc3037dc966c99751b708b1cc8a05 | [
"Apache-2.0"
] | null | null | null | Fw/Python/src/fprime/common/models/serialize/i32_type.py | hunterpaulson/fprime | 70560897b56dc3037dc966c99751b708b1cc8a05 | [
"Apache-2.0"
] | 5 | 2020-07-13T16:56:33.000Z | 2020-07-23T20:38:13.000Z | Fw/Python/src/fprime/common/models/serialize/i32_type.py | hunterpaulson/lgtm-fprime | 9eeda383c263ecba8da8188a45e1d020107ff323 | [
"Apache-2.0"
] | null | null | null | """
Created on Dec 18, 2014
@author: tcanham, reder
"""
from __future__ import print_function
from __future__ import absolute_import
import struct
from .type_exceptions import TypeMismatchException
from .type_exceptions import TypeRangeException
from . import type_base
@type_base.serialize
@type_base.deserialize
cl... | 21.106061 | 63 | 0.595118 |
88bff4ab4116f7f16f58ca5b7a1a0b65afbf3f16 | 787 | py | Python | stack.py | FAWC-bupt/Virtual-Machine-of-Instruction-Set-Architecture | 478d3a95150c358b41012948577db6fe3ac8483b | [
"MIT"
] | 3 | 2020-05-11T12:20:18.000Z | 2020-11-14T12:31:42.000Z | stack.py | FAWC-bupt/Virtual-Machine-of-Instruction-Set-Architecture | 478d3a95150c358b41012948577db6fe3ac8483b | [
"MIT"
] | null | null | null | stack.py | FAWC-bupt/Virtual-Machine-of-Instruction-Set-Architecture | 478d3a95150c358b41012948577db6fe3ac8483b | [
"MIT"
] | 1 | 2020-08-10T23:09:59.000Z | 2020-08-10T23:09:59.000Z | from register import Register, ARegister, DRegister
from memory import Memory
def push(regA: Register, RSP: Register, AR: ARegister, DR: DRegister, memory: Memory):
"""
将指定寄存器的值压入栈中
:param regA:
:param RSP:
:param AR:
:param DR:
:param memory:
:return:
"""
RSP.data = RSP.data - ... | 17.886364 | 86 | 0.597205 |
d2f0874a452bb381303c5f55aaf2e223d2044a0b | 266 | py | Python | algorithms/sem_prop/inputoutput/utils.py | Soton-Song/valentine | 9a47859f912540cdbe961ed3585201d3accd07be | [
"Apache-2.0"
] | null | null | null | algorithms/sem_prop/inputoutput/utils.py | Soton-Song/valentine | 9a47859f912540cdbe961ed3585201d3accd07be | [
"Apache-2.0"
] | null | null | null | algorithms/sem_prop/inputoutput/utils.py | Soton-Song/valentine | 9a47859f912540cdbe961ed3585201d3accd07be | [
"Apache-2.0"
] | null | null | null | from pickle import load, dump
def serialize_object(obj, path):
f = open(path, 'wb')
dump(obj, f)
f.close()
def deserialize_object(path):
f = open(path, 'rb')
obj = load(f)
return obj
if __name__ == "__main__":
print("Input output")
| 14.777778 | 32 | 0.609023 |
fc075483ab298eff09e12415d810be7d89e4ed28 | 991 | py | Python | main.py | Adeon18/Solver_Algorithms | 54acc53d92e1234fd14dd303f5c59f818ab91f95 | [
"MIT"
] | 4 | 2021-05-27T10:42:12.000Z | 2022-03-23T12:51:43.000Z | main.py | Adeon18/Solver_Algorithms | 54acc53d92e1234fd14dd303f5c59f818ab91f95 | [
"MIT"
] | null | null | null | main.py | Adeon18/Solver_Algorithms | 54acc53d92e1234fd14dd303f5c59f818ab91f95 | [
"MIT"
] | null | null | null | import os
from sys import platform
# Check for user system
linux = False
bad_os = False
if platform == "linux" or platform == "linux2":
linux = True
elif platform == "win32":
bad_os = True
scripts = {
1: "maze/main.py",
2: "sudoku/main.py",
3: "crossword/main.py",
4: "graph_colorizer/main.py"... | 22.022222 | 132 | 0.638749 |
b42a0bdc611a714864e8f985dd4878727a423a0e | 1,884 | py | Python | homeassistant/components/remote/reproduce_state.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | 1 | 2021-03-23T07:20:03.000Z | 2021-03-23T07:20:03.000Z | homeassistant/components/remote/reproduce_state.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | 60 | 2020-07-06T15:10:30.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/remote/reproduce_state.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | 4 | 2017-01-10T04:17:33.000Z | 2021-09-02T16:37:24.000Z | """Reproduce an Remote state."""
from __future__ import annotations
import asyncio
import logging
from typing import Any, Iterable
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_OFF,
STATE_ON,
)
from homeassistant.core import Context, State
from homeassi... | 24.467532 | 81 | 0.663482 |
5e33cd996cf412f56f927a2b5fd7e324adff3a74 | 714 | py | Python | src/python/rule.py | karmaresearch/glog-python | fdeb7f2941686ffe0692b365175452c861bfce1f | [
"Apache-2.0"
] | 1 | 2021-09-09T05:43:35.000Z | 2021-09-09T05:43:35.000Z | src/python/rule.py | karmaresearch/glog-python | fdeb7f2941686ffe0692b365175452c861bfce1f | [
"Apache-2.0"
] | null | null | null | src/python/rule.py | karmaresearch/glog-python | fdeb7f2941686ffe0692b365175452c861bfce1f | [
"Apache-2.0"
] | null | null | null | import copy
class Rule:
def __init__(self, head_atoms, body_atoms):
self.head_atoms = head_atoms
self.body_atoms = body_atoms
def str(self):
out = ''
for head_atom in self.head_atoms:
out += head_atom.str() + ','
out = out[:-1] + ' :- '
for body_atom... | 24.62069 | 47 | 0.582633 |
3f1ed78b2cb6d12f6331b7b95b62fe942cfbef92 | 315 | py | Python | packages/merlin/protocols/AssetCategory.py | pyre/pyre | 0f903836f52450bf81216c5dfdfdfebb16090177 | [
"BSD-3-Clause"
] | 25 | 2018-04-23T01:45:39.000Z | 2021-12-10T06:01:23.000Z | packages/merlin/protocols/AssetCategory.py | pyre/pyre | 0f903836f52450bf81216c5dfdfdfebb16090177 | [
"BSD-3-Clause"
] | 53 | 2018-05-31T04:55:00.000Z | 2021-10-07T21:41:32.000Z | packages/merlin/protocols/AssetCategory.py | pyre/pyre | 0f903836f52450bf81216c5dfdfdfebb16090177 | [
"BSD-3-Clause"
] | 12 | 2018-04-23T22:50:40.000Z | 2022-02-20T17:27:23.000Z | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2021 all rights reserved
# support
import merlin
# class declaration
class AssetCategory(merlin.protocol, family="merlin.assets.categories"):
"""
Protocol for all project asset categories
"""
# end of file
| 16.578947 | 72 | 0.685714 |
4c014910822c141a255df77316b0bda4178ba58b | 34,780 | py | Python | ztfquery/query.py | MichaelMedford/ztfquery | 9e3634d93338e4c753effa278d57de9142e3b791 | [
"Apache-2.0"
] | null | null | null | ztfquery/query.py | MichaelMedford/ztfquery | 9e3634d93338e4c753effa278d57de9142e3b791 | [
"Apache-2.0"
] | null | null | null | ztfquery/query.py | MichaelMedford/ztfquery | 9e3634d93338e4c753effa278d57de9142e3b791 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
#
""" Combine MetaSearch and MetaURL to get data from IRSA """
import os
import numpy as np
from .metasearch import download_metadata, _test_kind_
from . import buildurl
import warnings
# This enables multiprocess downloading
from . import io
# Combining metadata with buildurl
def metatab... | 43.529412 | 150 | 0.551294 |
7a6dcdce1f7488f07a954b1ee715a793d8d97935 | 87 | py | Python | Renter/apps.py | Hyped-247/rp | 9e3c6287ec2a183998f6ddadc20153736bbefaf3 | [
"MIT"
] | null | null | null | Renter/apps.py | Hyped-247/rp | 9e3c6287ec2a183998f6ddadc20153736bbefaf3 | [
"MIT"
] | null | null | null | Renter/apps.py | Hyped-247/rp | 9e3c6287ec2a183998f6ddadc20153736bbefaf3 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class RenterConfig(AppConfig):
name = 'Renter'
| 14.5 | 33 | 0.747126 |
ab14b5ab963b249674cefb4bb706c5511c93b30f | 8,406 | py | Python | TTS/vocoder/utils/generic_utils.py | mightmay/Mien-TTS | 8a22ff0a79558b3cf4981ce1b63f4d1485ea6338 | [
"MIT"
] | null | null | null | TTS/vocoder/utils/generic_utils.py | mightmay/Mien-TTS | 8a22ff0a79558b3cf4981ce1b63f4d1485ea6338 | [
"MIT"
] | null | null | null | TTS/vocoder/utils/generic_utils.py | mightmay/Mien-TTS | 8a22ff0a79558b3cf4981ce1b63f4d1485ea6338 | [
"MIT"
] | 1 | 2021-04-28T17:30:03.000Z | 2021-04-28T17:30:03.000Z | import re
import torch
import importlib
import numpy as np
#from matplotlib import pyplot as plt
#from TTS.tts.utils.visual import plot_spectrogram
def interpolate_vocoder_input(scale_factor, spec):
"""Interpolate spectrogram by the scale factor.
It is mainly used to match the sampling rates of
the tts a... | 38.737327 | 87 | 0.629669 |
74124ba4f7c25ec6be3d92cf6d4af888810f3930 | 742 | py | Python | setup.py | kaapstorm/openhim-mediator-utils-py | 7ad8dd44e9e97b5d3f44ce742241e72f748f2527 | [
"MIT"
] | null | null | null | setup.py | kaapstorm/openhim-mediator-utils-py | 7ad8dd44e9e97b5d3f44ce742241e72f748f2527 | [
"MIT"
] | null | null | null | setup.py | kaapstorm/openhim-mediator-utils-py | 7ad8dd44e9e97b5d3f44ce742241e72f748f2527 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="openhim_mediator_utils",
version="0.0.2",
author="Lazola Sifuba",
author_email="sifubalazola@gmail.com",
description="A utility library for build openHIM mediators",
long_description=l... | 30.916667 | 64 | 0.672507 |
1531bcc2d525378cece1b2f5f36171125215ff19 | 40 | py | Python | label_studio/__init__.py | zoumt1633/label-studio | 324d542b49b42cac5c9a3e23373b9febaf9a426e | [
"Apache-2.0"
] | null | null | null | label_studio/__init__.py | zoumt1633/label-studio | 324d542b49b42cac5c9a3e23373b9febaf9a426e | [
"Apache-2.0"
] | 7 | 2021-06-02T02:57:44.000Z | 2022-03-12T00:48:20.000Z | __init__.py | JamesXChang/label_tool | f62470a2bf677a2dd1d18054baf2d651d69c83a9 | [
"Apache-2.0"
] | null | null | null | # Package version
__version__ = '0.7.2'
| 13.333333 | 21 | 0.7 |
0329ef5ebc67212c458f768eb1b608364a2ee9d0 | 11,543 | py | Python | test/test_configuration.py | dakshinai/unit | fa4d4b61200b6f465edbe24ebcdce1a7a8675d39 | [
"Apache-2.0"
] | null | null | null | test/test_configuration.py | dakshinai/unit | fa4d4b61200b6f465edbe24ebcdce1a7a8675d39 | [
"Apache-2.0"
] | null | null | null | test/test_configuration.py | dakshinai/unit | fa4d4b61200b6f465edbe24ebcdce1a7a8675d39 | [
"Apache-2.0"
] | null | null | null | import unittest
from unit.control import TestControl
class TestConfiguration(TestControl):
prerequisites = {'modules': {'python': 'any'}}
def test_json_empty(self):
self.assertIn('error', self.conf(''), 'empty')
def test_json_leading_zero(self):
self.assertIn('error', self.conf('00'), '... | 27.949153 | 82 | 0.337434 |
9ddc1e4c427fc896f59147e82a57abf479bb7b6a | 3,024 | py | Python | utils/check_ptc.py | bl0x/symbiflow-arch-defs | 5fa5e71526e443d589971f2649d8b189df982d72 | [
"ISC"
] | 183 | 2017-12-29T12:08:32.000Z | 2022-02-15T03:29:07.000Z | utils/check_ptc.py | bl0x/symbiflow-arch-defs | 5fa5e71526e443d589971f2649d8b189df982d72 | [
"ISC"
] | 1,832 | 2017-12-29T14:47:27.000Z | 2022-02-18T06:30:43.000Z | utils/check_ptc.py | bl0x/symbiflow-arch-defs | 5fa5e71526e443d589971f2649d8b189df982d72 | [
"ISC"
] | 96 | 2017-12-30T12:00:45.000Z | 2022-02-17T09:03:46.000Z | #!/usr/bin/env python3
""" Tool for sanity checking rrgraph CHAN PTC's.
"""
import lxml.etree as ET
import argparse
def check_ptc(xml):
""" Checks ptc values used on CHANX and CHANY rr graph nodes are valid.
CHAN ptc numbers are an index per x/y coordinate and channel type (CHANX or
CHANY). ptc's at a p... | 32.170213 | 81 | 0.473214 |
5ece83c146b267015534c04adf7a992e3a427ab4 | 18,334 | py | Python | src/python/pants/backend/project_info/tasks/export.py | sammy-1234/pants | 889016952a248cf229c78c014d9f6c95422d98b8 | [
"Apache-2.0"
] | 1 | 2020-08-26T03:30:31.000Z | 2020-08-26T03:30:31.000Z | src/python/pants/backend/project_info/tasks/export.py | sammy-1234/pants | 889016952a248cf229c78c014d9f6c95422d98b8 | [
"Apache-2.0"
] | 1 | 2021-09-02T14:16:37.000Z | 2021-09-02T14:16:37.000Z | src/python/pants/backend/project_info/tasks/export.py | sammy-1234/pants | 889016952a248cf229c78c014d9f6c95422d98b8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import json
import os
from collections import defaultdict
from twitter.common.collections import OrderedSet
from pants.backend.jvm.subsystems.jvm_platform import JvmPlatform
from pants.b... | 44.285024 | 100 | 0.709392 |
4830965a20d0892745d93688393110ab2193b038 | 18,094 | py | Python | weewx/bin/weewx/drivers/ws1.py | tony-rasskazov/meteo | 1cb41cb4f219ff4e13a3ffb377f9ebf228711b96 | [
"MIT"
] | null | null | null | weewx/bin/weewx/drivers/ws1.py | tony-rasskazov/meteo | 1cb41cb4f219ff4e13a3ffb377f9ebf228711b96 | [
"MIT"
] | null | null | null | weewx/bin/weewx/drivers/ws1.py | tony-rasskazov/meteo | 1cb41cb4f219ff4e13a3ffb377f9ebf228711b96 | [
"MIT"
] | 1 | 2020-07-15T16:38:03.000Z | 2020-07-15T16:38:03.000Z | #!/usr/bin/env python
#
# Copyright 2014 Matthew Wall
# See the file LICENSE.txt for your rights.
"""Driver for ADS WS1 weather stations.
Thanks to Kevin and Paul Caccamo for adding the serial-to-tcp capability.
Thanks to Steve (sesykes71) for the testing that made this driver possible.
Thanks to Jay Nugent (WB8TKL... | 36.406439 | 88 | 0.549851 |
c709d8826838878bf90f056bbf3aeebfa3310839 | 2,094 | py | Python | apps/04_journal/you_try/program.py | robbyrenz/python-jumpstart-course-demos | d14f30e23cbb0349ef1f22559475e4a8157613f0 | [
"MIT"
] | null | null | null | apps/04_journal/you_try/program.py | robbyrenz/python-jumpstart-course-demos | d14f30e23cbb0349ef1f22559475e4a8157613f0 | [
"MIT"
] | null | null | null | apps/04_journal/you_try/program.py | robbyrenz/python-jumpstart-course-demos | d14f30e23cbb0349ef1f22559475e4a8157613f0 | [
"MIT"
] | null | null | null | def main(): # defining a main method; high level code up here
print_header()
run_event_loop()
# main() can't be defined here as Python would not know the definition of the functions in the main method
def print_header():
print('-------------------------------')
print(' JOURNAL APP')
prin... | 32.215385 | 111 | 0.575454 |
3bbf109435c6dc48312104c0a78ab9500a46a4ce | 19,405 | py | Python | course/views.py | ArnedyNavi/studymate | 55e6a2c6717dd478a311ea8bf839a26ca3ef2b40 | [
"MIT"
] | 4 | 2021-12-31T17:25:00.000Z | 2022-02-08T17:05:46.000Z | course/views.py | ArnedyNavi/studymate | 55e6a2c6717dd478a311ea8bf839a26ca3ef2b40 | [
"MIT"
] | null | null | null | course/views.py | ArnedyNavi/studymate | 55e6a2c6717dd478a311ea8bf839a26ca3ef2b40 | [
"MIT"
] | null | null | null | from django.http.response import JsonResponse
from django.http import Http404
from django.core.exceptions import PermissionDenied, BadRequest
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.decorators import login_required
from django.http import HttpRes... | 39.441057 | 172 | 0.59629 |
26f6aeab90dfd6245953ae471f11d7e36452dc3c | 562 | py | Python | trade_remedies_api/organisations/migrations/0002_organisation_duplicate_of.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 1 | 2020-08-13T10:37:15.000Z | 2020-08-13T10:37:15.000Z | trade_remedies_api/organisations/migrations/0002_organisation_duplicate_of.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 4 | 2020-09-10T13:41:52.000Z | 2020-12-16T09:00:21.000Z | trade_remedies_api/organisations/migrations/0002_organisation_duplicate_of.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-10-24 13:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("organisations", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="organisation... | 23.416667 | 60 | 0.580071 |
2ed403e95cb9222d6a37a2fbc8647e211c774a4b | 33,020 | py | Python | torchvision/transforms/functional_tensor.py | mhhabdelwahab/vision | 21790df9a4f77bd9ec4db44de04594cb539457a7 | [
"BSD-3-Clause"
] | null | null | null | torchvision/transforms/functional_tensor.py | mhhabdelwahab/vision | 21790df9a4f77bd9ec4db44de04594cb539457a7 | [
"BSD-3-Clause"
] | null | null | null | torchvision/transforms/functional_tensor.py | mhhabdelwahab/vision | 21790df9a4f77bd9ec4db44de04594cb539457a7 | [
"BSD-3-Clause"
] | null | null | null | import warnings
from typing import Optional, Tuple, List
import torch
from torch import Tensor
from torch.nn.functional import grid_sample, conv2d, interpolate, pad as torch_pad
def _is_tensor_a_torch_image(x: Tensor) -> bool:
return x.ndim >= 2
def _assert_image_tensor(img: Tensor) -> None:
if not _is_ten... | 35.62028 | 119 | 0.638855 |
252803be66423b10eade3cf5f707abf8f55821b1 | 5,732 | py | Python | test/functional/prioritise_transaction.py | gradinkov/pigeoncoin | 1a4f420f344d229d37514b570e92cae358ea06d7 | [
"MIT"
] | 49 | 2018-03-24T13:56:00.000Z | 2021-04-15T04:29:17.000Z | test/functional/prioritise_transaction.py | gradinkov/pigeoncoin | 1a4f420f344d229d37514b570e92cae358ea06d7 | [
"MIT"
] | 18 | 2018-03-22T20:12:34.000Z | 2020-05-14T03:09:37.000Z | test/functional/prioritise_transaction.py | gradinkov/pigeoncoin | 1a4f420f344d229d37514b570e92cae358ea06d7 | [
"MIT"
] | 64 | 2018-03-27T00:17:34.000Z | 2021-12-02T21:41:27.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Pigeon Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the prioritisetransaction mining RPC."""
from tes... | 44.092308 | 153 | 0.658234 |
d0e9f83088d8cc6c4eab82839dc1baa9255e5461 | 4,858 | py | Python | alerta/models/heartbeat.py | iDemonix/alerta | c35c56ca246d968c0f7419af0b485e999530f792 | [
"Apache-2.0"
] | null | null | null | alerta/models/heartbeat.py | iDemonix/alerta | c35c56ca246d968c0f7419af0b485e999530f792 | [
"Apache-2.0"
] | null | null | null | alerta/models/heartbeat.py | iDemonix/alerta | c35c56ca246d968c0f7419af0b485e999530f792 | [
"Apache-2.0"
] | null | null | null |
import os
import platform
import sys
from datetime import datetime, timedelta
from typing import Any, Dict, List, Optional, Tuple, Union
from uuid import uuid4
from flask import current_app
from alerta.app import db
from alerta.database.base import Query
from alerta.utils.format import DateTime
from alerta.utils.res... | 34.94964 | 148 | 0.605393 |
261cd1ed2d49f86c1d6d35e0a9170c1e0a414f71 | 13,397 | py | Python | libraries/classification/inception/inception_distributed_train.py | jayant766/MIDAS-IIITD | 9a6085bff579a5846c58bac70264a736ed9da750 | [
"Apache-2.0"
] | 2 | 2021-05-04T11:43:20.000Z | 2021-05-21T18:10:39.000Z | libraries/classification/inception/inception_distributed_train.py | jayant766/MIDAS-IIITD | 9a6085bff579a5846c58bac70264a736ed9da750 | [
"Apache-2.0"
] | null | null | null | libraries/classification/inception/inception_distributed_train.py | jayant766/MIDAS-IIITD | 9a6085bff579a5846c58bac70264a736ed9da750 | [
"Apache-2.0"
] | null | null | null | """A library to train Inception using multiple replicas with synchronous update.
Please see accompanying README.md for details and instructions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os.path
import time
im... | 44.508306 | 80 | 0.646787 |
fbb94e2221ca749fa555274a352cd37691ad49a0 | 1,056 | py | Python | pymatflow/cp2k/post/scripts/post-geo-opt-cp2k.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 6 | 2020-03-06T16:13:08.000Z | 2022-03-09T07:53:34.000Z | pymatflow/cp2k/post/scripts/post-geo-opt-cp2k.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 1 | 2021-10-02T02:23:08.000Z | 2021-11-08T13:29:37.000Z | pymatflow/cp2k/post/scripts/post-geo-opt-cp2k.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 1 | 2021-07-10T16:28:14.000Z | 2021-07-10T16:28:14.000Z | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
import os
import sys
import matplotlib.pyplot as plt
"""
usage:
post-geo-opt-cp2k.py xxx
xxx is the output file of the GEO_OPT run
"""
os.system("cat %s | grep 'ENERGY| Total FORCE_EVAL' > energy-per-geo-step.data" % (sys.argv[1]))
os.system("... | 28.540541 | 119 | 0.618371 |
4166d787a8cae126853bb3d514ec578ee8f9a3a9 | 2,157 | py | Python | sitetree/management/commands/sitetreedump.py | mrog70/django-sitetree2 | 5dd56c9a7823f67a2988be1238b3d46860a6a426 | [
"BSD-3-Clause"
] | null | null | null | sitetree/management/commands/sitetreedump.py | mrog70/django-sitetree2 | 5dd56c9a7823f67a2988be1238b3d46860a6a426 | [
"BSD-3-Clause"
] | null | null | null | sitetree/management/commands/sitetreedump.py | mrog70/django-sitetree2 | 5dd56c9a7823f67a2988be1238b3d46860a6a426 | [
"BSD-3-Clause"
] | null | null | null | from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
from sitetree.utils import get_tree_model, get_tree_item_model
from sitetree.compat import CommandOption, options_getter, VERSION
MODEL_TREE_CLASS = get_tree_model()
MODEL_TREE... | 33.703125 | 116 | 0.679184 |
86f5387e001bf28a4c073b4e75316b8ac138845d | 1,289 | py | Python | Lib/tkinter/commondialog.py | dignissimus/cpython | 17357108732c731d6ed4f2bd123ee6ba1ff6891b | [
"0BSD"
] | null | null | null | Lib/tkinter/commondialog.py | dignissimus/cpython | 17357108732c731d6ed4f2bd123ee6ba1ff6891b | [
"0BSD"
] | 2 | 2022-01-01T11:08:44.000Z | 2022-03-01T19:01:02.000Z | Lib/tkinter/commondialog.py | dignissimus/cpython | 17357108732c731d6ed4f2bd123ee6ba1ff6891b | [
"0BSD"
] | null | null | null | # base class for tk common dialogues
#
# this module provides a base class for accessing the common
# dialogues available in Tk 4.2 and newer. use filedialog,
# colorchooser, and messagebox to access the individual
# dialogs.
#
# written by Fredrik Lundh, May 1997
#
__all__ = ["Dialog"]
from tkinter import _get_temp... | 23.87037 | 89 | 0.622188 |
0f6c04bcf5f85d41f194d32b94a8592447c298d4 | 26,649 | py | Python | image_generation/render_images.py | BScarleth/clevr-dataset-generation-mask | efa11d69b2fc21a2007205cac6a4b0122149af7d | [
"BSD-3-Clause"
] | null | null | null | image_generation/render_images.py | BScarleth/clevr-dataset-generation-mask | efa11d69b2fc21a2007205cac6a4b0122149af7d | [
"BSD-3-Clause"
] | null | null | null | image_generation/render_images.py | BScarleth/clevr-dataset-generation-mask | efa11d69b2fc21a2007205cac6a4b0122149af7d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import print... | 40.377273 | 113 | 0.693647 |
deb449183523148b00bdabf18e21714bbe3551c8 | 467 | py | Python | src/courses/migrations/0006_auto_20200521_2038.py | GiomarOsorio/another-e-learning-platform | 5cfc76420eb3466691f5187c915c179afb13199a | [
"MIT"
] | null | null | null | src/courses/migrations/0006_auto_20200521_2038.py | GiomarOsorio/another-e-learning-platform | 5cfc76420eb3466691f5187c915c179afb13199a | [
"MIT"
] | 8 | 2020-06-25T22:16:20.000Z | 2022-03-12T00:39:27.000Z | src/courses/migrations/0006_auto_20200521_2038.py | GiomarOsorio/another-e-learning-platform | 5cfc76420eb3466691f5187c915c179afb13199a | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-21 20:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0005_auto_20200521_2038'),
]
operations = [
migrations.AlterField(
model_name='module',
name='segments',
... | 24.578947 | 129 | 0.631692 |
53f8d8f0a03c0ae367fc673431366935c0bf9f32 | 5,360 | py | Python | AIFP/mae_toPdbqt.py | jeah-z/IFP-RNN | 83cb3f0f75907227d682e8980b335b17db2c2ab1 | [
"MIT"
] | null | null | null | AIFP/mae_toPdbqt.py | jeah-z/IFP-RNN | 83cb3f0f75907227d682e8980b335b17db2c2ab1 | [
"MIT"
] | null | null | null | AIFP/mae_toPdbqt.py | jeah-z/IFP-RNN | 83cb3f0f75907227d682e8980b335b17db2c2ab1 | [
"MIT"
] | null | null | null | try:
from openbabel import pybel
except:
import pybel
import pandas as pd
import argparse
from functools import partial
from multiprocessing import Pool
from tqdm.auto import tqdm
import os
from pathlib import Path
import rdkit
from rdkit import Chem
from pebble import concurrent, ProcessPool
from concurrent.fu... | 37.746479 | 127 | 0.604291 |
65ef20c3cd8fa5aeb228287be92b16208bfaf4c2 | 8,462 | py | Python | tests/brownfield/separate_file_example/test_brownfield_app.py | nutanixdev/calm-dsl | 90e1c583d7b9ac905cdfb3e2ad27f9f930e69831 | [
"Apache-2.0"
] | null | null | null | tests/brownfield/separate_file_example/test_brownfield_app.py | nutanixdev/calm-dsl | 90e1c583d7b9ac905cdfb3e2ad27f9f930e69831 | [
"Apache-2.0"
] | null | null | null | tests/brownfield/separate_file_example/test_brownfield_app.py | nutanixdev/calm-dsl | 90e1c583d7b9ac905cdfb3e2ad27f9f930e69831 | [
"Apache-2.0"
] | null | null | null | import uuid
import time
import json
import traceback
import pytest
import sys
from click.testing import CliRunner
from calm.dsl.cli import main as cli
from calm.dsl.cli.constants import APPLICATION
from calm.dsl.tools import make_file_dir
from calm.dsl.log import get_logging_handle
LOG = get_logging_handle(__name__)
... | 34.966942 | 138 | 0.578468 |
128656cc124500c88ac1af8a83d29668f6abc791 | 275 | py | Python | lib/plugins/create/templates/kubeless-python/handler.py | ajesse11x/serverless | 15333c223563e36d66469950c57c4f9ae68866a4 | [
"MIT"
] | 39,871 | 2015-12-08T08:23:40.000Z | 2022-03-31T23:42:35.000Z | lib/plugins/create/templates/kubeless-python/handler.py | ajesse11x/serverless | 15333c223563e36d66469950c57c4f9ae68866a4 | [
"MIT"
] | 8,862 | 2015-12-08T07:59:58.000Z | 2022-03-31T23:22:49.000Z | lib/plugins/create/templates/kubeless-python/handler.py | ajesse11x/serverless | 15333c223563e36d66469950c57c4f9ae68866a4 | [
"MIT"
] | 6,151 | 2015-12-08T09:17:10.000Z | 2022-03-31T06:58:23.000Z | import json
def hello(event, context):
body = {
"message": "Go Serverless v1.0! Your function executed successfully!",
"input": event['data']
}
response = {
"statusCode": 200,
"body": json.dumps(body)
}
return response
| 17.1875 | 78 | 0.56 |
7c3c045fdd4cc364310ac9cf38876c99f3c85b4c | 909 | py | Python | traffic/map_test.py | markraemer/mH-PriSe | 1555c4c7e6457c3bb5bce3b6dae9c514ed7fc3d3 | [
"MIT"
] | 1 | 2016-12-02T06:50:44.000Z | 2016-12-02T06:50:44.000Z | traffic/map_test.py | markraemer/mH-PriSe | 1555c4c7e6457c3bb5bce3b6dae9c514ed7fc3d3 | [
"MIT"
] | null | null | null | traffic/map_test.py | markraemer/mH-PriSe | 1555c4c7e6457c3bb5bce3b6dae9c514ed7fc3d3 | [
"MIT"
] | null | null | null | from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
# create new figure, axes instances.
fig=plt.figure()
ax=fig.add_axes([0.1,0.1,0.8,0.8])
# setup mercator map projection.
m = Basemap(llcrnrlon=-100.,llcrnrlat=20.,urcrnrlon=20.,urcrnrlat=60.,\
rsphere=(6378137.00,63... | 36.36 | 71 | 0.715072 |
d0c5f685dcaac9b50ce4b0e4e26f497bbfd8a66f | 4,756 | py | Python | tests/python/gaia-ui-tests/gaiatest/apps/fmradio/app.py | NickProgramm/gaia | 975a35c0f5010df341e96d6c5ec60217f5347412 | [
"Apache-2.0"
] | 3 | 2016-08-17T08:52:51.000Z | 2020-03-29T04:56:45.000Z | tests/python/gaia-ui-tests/gaiatest/apps/fmradio/app.py | NickProgramm/gaia | 975a35c0f5010df341e96d6c5ec60217f5347412 | [
"Apache-2.0"
] | 1 | 2017-02-21T21:36:12.000Z | 2017-02-21T21:36:30.000Z | tests/python/gaia-ui-tests/gaiatest/apps/fmradio/app.py | NickProgramm/gaia | 975a35c0f5010df341e96d6c5ec60217f5347412 | [
"Apache-2.0"
] | 1 | 2019-03-03T01:31:58.000Z | 2019-03-03T01:31:58.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import re
from marionette_driver import expected, By, Wait
from marionette_driver.marionette import Actions
from gaiat... | 42.464286 | 138 | 0.712994 |
c49109e855bff388a92b443d8e55515a32857be0 | 13,160 | py | Python | app/config.py | THIS-IS-NOT-A-BACKUP/app | 0f5e722a3510b9163bc50d1b457ac2580ffedd1a | [
"MIT"
] | null | null | null | app/config.py | THIS-IS-NOT-A-BACKUP/app | 0f5e722a3510b9163bc50d1b457ac2580ffedd1a | [
"MIT"
] | null | null | null | app/config.py | THIS-IS-NOT-A-BACKUP/app | 0f5e722a3510b9163bc50d1b457ac2580ffedd1a | [
"MIT"
] | null | null | null | import os
import random
import socket
import string
import subprocess
from ast import literal_eval
from typing import Callable
from urllib.parse import urlparse
from dotenv import load_dotenv
SHA1 = subprocess.getoutput("git rev-parse HEAD")
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def... | 33.232323 | 93 | 0.771657 |
7e8b568001a30c3f17599b6738d0bbd60c7cb807 | 8,068 | py | Python | mayan/apps/quotas/quota_backends.py | PatrickMugayaJoel/Mayan-EDMS | 1a2b4d4fa784a68498f82e0735958dc116b60d46 | [
"Apache-2.0"
] | null | null | null | mayan/apps/quotas/quota_backends.py | PatrickMugayaJoel/Mayan-EDMS | 1a2b4d4fa784a68498f82e0735958dc116b60d46 | [
"Apache-2.0"
] | null | null | null | mayan/apps/quotas/quota_backends.py | PatrickMugayaJoel/Mayan-EDMS | 1a2b4d4fa784a68498f82e0735958dc116b60d46 | [
"Apache-2.0"
] | 1 | 2021-09-01T14:07:47.000Z | 2021-09-01T14:07:47.000Z | import types
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.db.models import IntegerField
from django.db.models.functions import Cast
from django.template.defaultfilters import filesizeformat
from django.utils.translation import ugettext_lazy as _
... | 34.775862 | 137 | 0.606718 |
59dae854bdabb689b85af13f3c0de6705ef8786a | 22,836 | py | Python | src/external/simplexml.py | ojimary/titus | ac53bcde5e0f32ab1f8b982b5c2bb7d89c9917a4 | [
"Condor-1.1"
] | 108 | 2015-05-29T07:50:26.000Z | 2022-03-04T06:10:55.000Z | src/external/simplexml.py | ROBERT-MCDOWELL/p2p-sip | 3ba6d39327694f662c3e4c9c943f9bfb4abb9a29 | [
"Condor-1.1"
] | 5 | 2015-07-16T16:33:21.000Z | 2020-05-30T23:13:20.000Z | src/external/simplexml.py | ROBERT-MCDOWELL/p2p-sip | 3ba6d39327694f662c3e4c9c943f9bfb4abb9a29 | [
"Condor-1.1"
] | 69 | 2015-07-20T16:05:04.000Z | 2022-03-31T15:41:03.000Z | # Copyright (c) 2008, Kundan Singh. All rights reserved. See LICENSING for details.
'''
Simple XML handling. The existing xml.dom.minidom is too Java'ish, so simplexml is used to allow easier syntax
when processing XML. The basic API ideas are inspired from ActionScript's XML and XMLList data types.
XML is the main cl... | 53.230769 | 223 | 0.652566 |
bcd67e851a8bd49122613e6df435a6c9dcb87bb9 | 34,990 | py | Python | .history/neuroformer/model_perceiver_20220121144355.py | woanderer/neuroformer | df3462d55977b6c9adcb6753e7c474b8b76e8021 | [
"MIT"
] | null | null | null | .history/neuroformer/model_perceiver_20220121144355.py | woanderer/neuroformer | df3462d55977b6c9adcb6753e7c474b8b76e8021 | [
"MIT"
] | null | null | null | .history/neuroformer/model_perceiver_20220121144355.py | woanderer/neuroformer | df3462d55977b6c9adcb6753e7c474b8b76e8021 | [
"MIT"
] | null | null | null | # from code.transformer_vid.utils import convert_weights
# import rotary_embedding_torch
from torch.nn.modules.activation import GELU, ReLU
# from data.OneCombo3.trainer import TrainerConfig
import math
import numpy as np
import itertools
import logging
import torch
import torch.nn as nn
from torch.nn import functiona... | 39.270483 | 139 | 0.582223 |
1584291f3a7e50975c197a8ee5207917531ee96e | 5,030 | py | Python | groups/models.py | qsic/qsic3 | b45dfcc76c80001b0c35c6a887a0cfcdf8d1c1e2 | [
"BSD-3-Clause"
] | null | null | null | groups/models.py | qsic/qsic3 | b45dfcc76c80001b0c35c6a887a0cfcdf8d1c1e2 | [
"BSD-3-Clause"
] | 1 | 2015-01-12T05:54:20.000Z | 2015-01-12T05:55:23.000Z | groups/models.py | qsic/qsic3 | b45dfcc76c80001b0c35c6a887a0cfcdf8d1c1e2 | [
"BSD-3-Clause"
] | null | null | null | import os
import string
import urllib.parse
import urllib.request
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.template.defaultfilters import slugify
from django.utils import timezone
from image_cropping.fields import ImageRatioField
from py3s3.... | 33.986486 | 95 | 0.631014 |
b8443b6b72fabe5c427c905e0851cc7ded70722e | 912 | py | Python | hw2/support.py | ixlan/Deep-learning | 246e5285b6fb6508814762fddfd00d54515ccf79 | [
"MIT"
] | null | null | null | hw2/support.py | ixlan/Deep-learning | 246e5285b6fb6508814762fddfd00d54515ccf79 | [
"MIT"
] | null | null | null | hw2/support.py | ixlan/Deep-learning | 246e5285b6fb6508814762fddfd00d54515ccf79 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from glob import glob
import os
def accuracy_loss_curve(train_acc, test_acc, train_loss, test_loss, iter_steps):
plt.subplot(2, 1, 1)
plt.plot(iter_steps, train_loss, '-o', label ='train')
plt.plot(iter_steps, test_loss, '-o', label = 'test')
plt.xlabel('Iteration')
... | 27.636364 | 80 | 0.680921 |
4bfdddd569923d16c7edbded917eaf53d848ffe3 | 656 | py | Python | src/genie/libs/parser/bigip/get_wom_profile.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/bigip/get_wom_profile.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/bigip/get_wom_profile.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | # Global Imports
import json
from collections import defaultdict
# Metaparser
from genie.metaparser import MetaParser
# =============================================
# Collection for '/mgmt/tm/wom/profile' resources
# =============================================
class WomProfileSchema(MetaParser):
schema = {}... | 19.294118 | 52 | 0.577744 |
1b9ef6398acadcef2e849943f43501841e125121 | 7,524 | py | Python | scripts/elia_daily_graph.py | sophiano/cusvm | 7bba8a216b02a7c5607b4b5127c245c74d8f8514 | [
"MIT"
] | null | null | null | scripts/elia_daily_graph.py | sophiano/cusvm | 7bba8a216b02a7c5607b4b5127c245c74d8f8514 | [
"MIT"
] | null | null | null | scripts/elia_daily_graph.py | sophiano/cusvm | 7bba8a216b02a7c5607b4b5127c245c74d8f8514 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 2 08:44:14 2021
@author: sopmathieu
"""
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams['font.size'] = 14
import pkg_resources as pkg
from cusvm import preprocessing as pre
from cusvm import autocorrelations as acf
##... | 30.33871 | 103 | 0.630649 |
6b96f562dd2288fbae2fcae077aa7114c47aeed7 | 2,161 | py | Python | src/azure-cli/azure/cli/command_modules/interactive/__init__.py | WCollins3/azure-cli | 1639f71f25e926376e3af7014325329702e028ec | [
"MIT"
] | 1 | 2020-03-20T06:01:04.000Z | 2020-03-20T06:01:04.000Z | src/azure-cli/azure/cli/command_modules/interactive/__init__.py | WCollins3/azure-cli | 1639f71f25e926376e3af7014325329702e028ec | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/interactive/__init__.py | WCollins3/azure-cli | 1639f71f25e926376e3af7014325329702e028ec | [
"MIT"
] | 1 | 2019-09-30T22:27:10.000Z | 2019-09-30T22:27:10.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 44.102041 | 129 | 0.589542 |
8448d5c2d7af31e5441265104aedcae98887bb22 | 1,721 | py | Python | PythonExercicios/ex073 - Tuplas com Times de Futebol.py | caique-santana/CursoEmVideo-Curso_Python3 | 86bb67bbbf348544e1135d8657672d4e33fa70e2 | [
"MIT"
] | 1 | 2020-04-15T00:49:02.000Z | 2020-04-15T00:49:02.000Z | PythonExercicios/ex073 - Tuplas com Times de Futebol.py | caique-santana/CursoEmVideo-Curso_Python3 | 86bb67bbbf348544e1135d8657672d4e33fa70e2 | [
"MIT"
] | null | null | null | PythonExercicios/ex073 - Tuplas com Times de Futebol.py | caique-santana/CursoEmVideo-Curso_Python3 | 86bb67bbbf348544e1135d8657672d4e33fa70e2 | [
"MIT"
] | null | null | null | """ Crie uma tupla preenchida com os 20 primeiros colocados da Tableda do Campeonato Brasileiro de Futebol,
a ordem de colocação. Depois mostre:
A) Apenas os 5 primeiros colocados.
B) Os últimos 4 colocados da tabela.
C) Uma lista com os times em ordem alfabética.
D) Em que posição na tabela está o time da Chapeco... | 43.025 | 108 | 0.65369 |
77db8f745d7ea33a4a7409fba8a48c636a2351ea | 12,150 | py | Python | lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 34 | 2020-01-31T17:50:00.000Z | 2022-02-16T20:19:29.000Z | lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 14 | 2020-02-03T23:39:51.000Z | 2021-07-20T16:24:25.000Z | lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 7 | 2020-04-14T09:12:18.000Z | 2021-09-20T10:31:12.000Z | """
Test lldb breakpoint command add/list/delete.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import side_effect
class BreakpointCommandTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
mydir = TestBase.compute_mydir(__f... | 42.1875 | 147 | 0.615802 |
ead8a3cca4941f438d5af80676d62dfe8d8ddea1 | 3,280 | py | Python | antlr4_vba_parser/vba_listener.py | Liam-Deacon/antlr4-vba-parser | af273e6d7c4efd7660d647ad5b6e338a4ff46bd3 | [
"BSD-3-Clause"
] | 1 | 2021-07-23T19:28:59.000Z | 2021-07-23T19:28:59.000Z | antlr4_vba_parser/vba_listener.py | Liam-Deacon/antlr4-vba-parser | af273e6d7c4efd7660d647ad5b6e338a4ff46bd3 | [
"BSD-3-Clause"
] | null | null | null | antlr4_vba_parser/vba_listener.py | Liam-Deacon/antlr4-vba-parser | af273e6d7c4efd7660d647ad5b6e338a4ff46bd3 | [
"BSD-3-Clause"
] | null | null | null | """Implements the ANTLR listener pattern for the VBA parser"""
from .vbaListener import vbaListener
from .vbaParser import vbaParser
class VBADictListener(vbaListener):
"""Custom VBA listener which produces a dictionary of VBA output"""
def __init__(self) -> None:
super().__init__()
self.data... | 34.526316 | 81 | 0.694817 |
bcaa83106caec5ce19f7b056605ed98b280304bc | 11,116 | py | Python | MAIN/Basics.py | xtuyaowu/Pair-Trading-Reinforcement-Learning | 24b744224457efa2dfee23ed0c44ec393b37449a | [
"MIT"
] | 4 | 2021-01-17T17:18:07.000Z | 2022-01-05T10:52:01.000Z | MAIN/Basics.py | xtuyaowu/Pair-Trading-Reinforcement-Learning | 24b744224457efa2dfee23ed0c44ec393b37449a | [
"MIT"
] | null | null | null | MAIN/Basics.py | xtuyaowu/Pair-Trading-Reinforcement-Learning | 24b744224457efa2dfee23ed0c44ec393b37449a | [
"MIT"
] | null | null | null | import tensorflow as tf
import itertools
import random
random.seed(0)
import numpy as np
import abc
from os import path
class Agent(metaclass=abc.ABCMeta):
def __init__(self, network, config):
self.session = None
self.network = network
self.config = config
self.data = ... | 31.851003 | 117 | 0.61407 |
7ebe71b8d3e931455b2a39b8c047cb3db9d642e4 | 21,693 | py | Python | webinterface/src/plugin.py | FoxyRabbit67/enigma2-plugins | f6b94012726931fdf28e80a26226aec612b350de | [
"Linux-OpenIB"
] | 41 | 2016-01-21T17:54:44.000Z | 2021-06-26T05:54:41.000Z | webinterface/src/plugin.py | FoxyRabbit67/enigma2-plugins | f6b94012726931fdf28e80a26226aec612b350de | [
"Linux-OpenIB"
] | 22 | 2016-11-16T11:25:26.000Z | 2021-12-13T09:13:06.000Z | webinterface/src/plugin.py | FoxyRabbit67/enigma2-plugins | f6b94012726931fdf28e80a26226aec612b350de | [
"Linux-OpenIB"
] | 62 | 2016-02-05T22:55:48.000Z | 2022-03-12T21:48:22.000Z | Version = '$Header$';
from enigma import eConsoleAppContainer
from Plugins.Plugin import PluginDescriptor
from Components.config import config, ConfigBoolean, ConfigSubsection, ConfigInteger, ConfigYesNo, ConfigText, ConfigOnOff
from Components.Network import iNetworkInfo
from Screens.MessageBox import MessageBox
fro... | 35.856198 | 145 | 0.685797 |
b7c34ea86c77de4a0625f6b121568d1e673c902e | 364 | py | Python | src/content_style_layers.py | d4rk6h05t/neural-style-art | f2fb3586e8a039e04238e0eb2dc4c8af96cd85d6 | [
"Apache-2.0"
] | 6 | 2020-07-20T01:21:17.000Z | 2022-01-13T02:27:40.000Z | src/content_style_layers.py | d4rk6h05t/neural-style-art | f2fb3586e8a039e04238e0eb2dc4c8af96cd85d6 | [
"Apache-2.0"
] | null | null | null | src/content_style_layers.py | d4rk6h05t/neural-style-art | f2fb3586e8a039e04238e0eb2dc4c8af96cd85d6 | [
"Apache-2.0"
] | null | null | null |
# Content layer where will pull our feature maps
content_layers = ['block5_conv2']
# Style layer we are interested in
style_layers = ['block1_conv1',
'block2_conv1',
'block3_conv1',
'block4_conv1',
'block5_conv1'
]
num_content_layers = len(content_... | 26 | 48 | 0.631868 |
5d43c06e5d540a18d7e890c0eb0122234361e906 | 340 | py | Python | am/__main__.py | ove/ove-asset-manager | 34b20ba8b436a5fe5c1561e0c5d98f171a37193f | [
"MIT"
] | null | null | null | am/__main__.py | ove/ove-asset-manager | 34b20ba8b436a5fe5c1561e0c5d98f171a37193f | [
"MIT"
] | 191 | 2019-03-01T14:00:57.000Z | 2021-06-06T23:01:57.000Z | am/__main__.py | ove/ove-asset-manager | 34b20ba8b436a5fe5c1561e0c5d98f171a37193f | [
"MIT"
] | 1 | 2020-01-13T13:07:49.000Z | 2020-01-13T13:07:49.000Z | from wsgiref import simple_server
from am import setup_app
# do not use this in production
# this is a dev only method provided for convenience
def main():
simple_server.make_server('0.0.0.0', 6080, setup_app()).serve_forever() # nosec
if __name__ == "__main__":
try:
main()
except KeyboardInte... | 20 | 84 | 0.691176 |
9cf45c76d24b239727c43b60b69bbdd534ad05c8 | 1,483 | py | Python | src/sqlfluff/rules/L021.py | tdstark/sqlfluff | 873263465c879a4061d7613078da9e6050fb66ff | [
"MIT"
] | null | null | null | src/sqlfluff/rules/L021.py | tdstark/sqlfluff | 873263465c879a4061d7613078da9e6050fb66ff | [
"MIT"
] | 8 | 2022-01-26T21:43:03.000Z | 2022-01-31T10:22:02.000Z | src/sqlfluff/rules/L021.py | tdstark/sqlfluff | 873263465c879a4061d7613078da9e6050fb66ff | [
"MIT"
] | 1 | 2022-01-24T10:10:43.000Z | 2022-01-24T10:10:43.000Z | """Implementation of Rule L021."""
from typing import Optional
from sqlfluff.core.rules.base import BaseRule, LintResult, RuleContext
import sqlfluff.core.rules.functional.segment_predicates as sp
class Rule_L021(BaseRule):
"""Ambiguous use of ``DISTINCT`` in select statement with ``GROUP BY``.
| **Anti-pat... | 30.265306 | 84 | 0.59002 |
71ac6798465f3c6a9c48f99cfd9cf63511ab9a9b | 2,382 | py | Python | common/src/stack/command/stack/commands/load/json/plugin_api.py | shivanshs9/stacki | 258740748281dfe89b0f566261eaf23102f91aa4 | [
"BSD-3-Clause"
] | null | null | null | common/src/stack/command/stack/commands/load/json/plugin_api.py | shivanshs9/stacki | 258740748281dfe89b0f566261eaf23102f91aa4 | [
"BSD-3-Clause"
] | null | null | null | common/src/stack/command/stack/commands/load/json/plugin_api.py | shivanshs9/stacki | 258740748281dfe89b0f566261eaf23102f91aa4 | [
"BSD-3-Clause"
] | null | null | null | # @copyright@
# Copyright (c) 2006 - 2018 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
import stack.commands
import json
from stack.exception import CommandError
class Plugin(stack.commands.Plugin, stack.commands.Command):
notifi... | 34.521739 | 150 | 0.688077 |
97ac16530430a7e2b118e76c6a8b82d5c18a290f | 356 | py | Python | Aula 08/Ex3.py | diegorafaelvieira/Programacao-1 | 657a974f1215cec4aed68603e738d9a135131545 | [
"MIT"
] | null | null | null | Aula 08/Ex3.py | diegorafaelvieira/Programacao-1 | 657a974f1215cec4aed68603e738d9a135131545 | [
"MIT"
] | null | null | null | Aula 08/Ex3.py | diegorafaelvieira/Programacao-1 | 657a974f1215cec4aed68603e738d9a135131545 | [
"MIT"
] | null | null | null | qtd10_100=0
soma=0
qtdPares_100=0
for x in range(0,1000):
valor = int(input("Informe o valor:"))
if valor>10 and valor<100:
qtd10_100+=1
soma+=valor
if valor>100 and valor%2==0:
qtdPares_100+=1
print("Números pares e maiores do que 100:",qtdPares_100)
print("Números maiores que 10 e ... | 27.384615 | 67 | 0.668539 |
1503620cf769424b5e5d422a1d22901bbaaa1f50 | 2,237 | py | Python | HLTrigger/Configuration/python/HLT_75e33/sequences/HLTDiphoton3023IsoCaloIdUnseededSequence_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTrigger/Configuration/python/HLT_75e33/sequences/HLTDiphoton3023IsoCaloIdUnseededSequence_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTrigger/Configuration/python/HLT_75e33/sequences/HLTDiphoton3023IsoCaloIdUnseededSequence_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
from ..modules.hltDiEG23EtUnseededFilter_cfi import *
from ..modules.hltDiEG3023IsoCaloIdClusterShapeSigmavvUnseededFilter_cfi import *
from ..modules.hltDiEG3023IsoCaloIdClusterShapeSigmawwUnseededFilter_cfi import *
from ..modules.hltDiEG3023IsoCaloIdClusterShapeUnseededFilte... | 48.630435 | 81 | 0.86008 |
86f026e35fcc3d887549d6b70c4fce7518acccfc | 503 | py | Python | local_groups/migrations/0057_auto_20170829_2137.py | JoshZero87/site | c8024b805ff5ff0e16f54dce7bf05097fd2f08e0 | [
"MIT"
] | 4 | 2017-01-29T00:38:41.000Z | 2019-09-04T14:30:24.000Z | local_groups/migrations/0057_auto_20170829_2137.py | JoshZero87/site | c8024b805ff5ff0e16f54dce7bf05097fd2f08e0 | [
"MIT"
] | 74 | 2017-10-02T04:42:54.000Z | 2022-01-13T00:44:16.000Z | local_groups/migrations/0057_auto_20170829_2137.py | JoshZero87/site | c8024b805ff5ff0e16f54dce7bf05097fd2f08e0 | [
"MIT"
] | 3 | 2017-03-24T23:26:46.000Z | 2019-10-21T01:16:03.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-08-29 21:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('local_groups', '0056_auto_20170829_1818'),
]
operations = [
migrations.Alte... | 23.952381 | 97 | 0.632207 |
ff9f07d9604147f7e4977699d5f95acc43408809 | 2,995 | py | Python | experiments/exp_adult_10_OLHPGRR.py | Leaflowave/PrivCQ | 8acc6ad0888793fb7fa190a1bd5b4f9eb1140514 | [
"MIT"
] | null | null | null | experiments/exp_adult_10_OLHPGRR.py | Leaflowave/PrivCQ | 8acc6ad0888793fb7fa190a1bd5b4f9eb1140514 | [
"MIT"
] | null | null | null | experiments/exp_adult_10_OLHPGRR.py | Leaflowave/PrivCQ | 8acc6ad0888793fb7fa190a1bd5b4f9eb1140514 | [
"MIT"
] | null | null | null | import frequency_oracle_3dim as freq
import linecache
import random
def query_on_adult_dim3(oraclePath,oracleInterval,queryPath,trueOraclePath,aggregation="count"):
# adult_3 range 10
queriesStr = linecache.getline(queryPath, 1)
queries = eval(queriesStr)
answer = [0]*500
trueOracleStr =... | 45.378788 | 106 | 0.55793 |
399f7a275c2d21e47c659bdc1b39ef535eeeb5bb | 917 | py | Python | filelist_excel.py | exomachine/filelist_excel | 73347a49b990ed6e8e609c9cc53bbd68fcdce2ad | [
"MIT"
] | null | null | null | filelist_excel.py | exomachine/filelist_excel | 73347a49b990ed6e8e609c9cc53bbd68fcdce2ad | [
"MIT"
] | null | null | null | filelist_excel.py | exomachine/filelist_excel | 73347a49b990ed6e8e609c9cc53bbd68fcdce2ad | [
"MIT"
] | null | null | null | # Export a list of all files from a target path to an Excel Spreadsheet
# @exomachine 2019
import glob
import xlwt
import ntpath
from tempfile import TemporaryFile
path = 'U:\\' #Input path
savePath = "Q:\\Folder Content.xls" #Output path
rawData = []
book1 = xlwt.Workbook()
sheet1 = book1.... | 23.512821 | 72 | 0.665213 |
25e4e66486e71405c13378b7ff5abefc75bf9075 | 6,985 | py | Python | app/dataprocessing.py | sean-ashley/Stroke-Prediction-App | 8abb6f7c1217291f5f5a52e9f422314d85dd0fae | [
"Apache-2.0"
] | 7 | 2021-03-21T23:19:28.000Z | 2021-12-27T18:51:45.000Z | app/dataprocessing.py | sean-ashley/Stroke-Prediction-App | 8abb6f7c1217291f5f5a52e9f422314d85dd0fae | [
"Apache-2.0"
] | null | null | null | app/dataprocessing.py | sean-ashley/Stroke-Prediction-App | 8abb6f7c1217291f5f5a52e9f422314d85dd0fae | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import MultiLabelBinarizer
def is_user_diabetic(avg_glucose_level):
"""
desc: converts avg_glucose_level to category based on ADA Guidelines https://w... | 29.723404 | 140 | 0.661704 |
26d9d0b467b0d72d0888084969c5d2aee9ad8c6c | 4,378 | py | Python | umetnine/account/views.py | jaanos/OPB-umetnine | f1fedd62e750317548510c412793d80c60b9e392 | [
"MIT"
] | null | null | null | umetnine/account/views.py | jaanos/OPB-umetnine | f1fedd62e750317548510c412793d80c60b9e392 | [
"MIT"
] | null | null | null | umetnine/account/views.py | jaanos/OPB-umetnine | f1fedd62e750317548510c412793d80c60b9e392 | [
"MIT"
] | null | null | null | from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
# from django.views.generic import CreateView, TemplateView
from datetime import datetime
from artists.forms import NewAr... | 37.741379 | 102 | 0.640247 |
b1eec386b7239e221374f6f2dc5021d6c2d0cc67 | 837 | py | Python | sana/api/middleware/echo/urls.py | satvikdhandhania/vit-11 | e599f2b82a9194658c67bbd5c7e45f3b50d016da | [
"BSD-3-Clause"
] | 1 | 2016-09-20T20:36:53.000Z | 2016-09-20T20:36:53.000Z | sana/api/middleware/echo/urls.py | satvikdhandhania/vit-11 | e599f2b82a9194658c67bbd5c7e45f3b50d016da | [
"BSD-3-Clause"
] | null | null | null | sana/api/middleware/echo/urls.py | satvikdhandhania/vit-11 | e599f2b82a9194658c67bbd5c7e45f3b50d016da | [
"BSD-3-Clause"
] | null | null | null | '''
@author: Sana Dev Team
Created on May 18, 2011
'''
from django.conf.urls.defaults import patterns
import handlers
urlpatterns = patterns(
'',
(r'^binary/$',
handlers.binary_resource,
{},
'binary'),
(r'^client/',
handlers.client_resource,
{},
... | 18.195652 | 46 | 0.476703 |
c3674877e97a6605e7d7eef510113b30704b7799 | 14,714 | py | Python | Practise_1_Olympic Hero/Python_Olympic Hero.py | csk1908/ga-learner-dsmp-repo | ea841db0d534e6b45176b6b316fa7f2a3ca87a4a | [
"MIT"
] | null | null | null | Practise_1_Olympic Hero/Python_Olympic Hero.py | csk1908/ga-learner-dsmp-repo | ea841db0d534e6b45176b6b316fa7f2a3ca87a4a | [
"MIT"
] | null | null | null | Practise_1_Olympic Hero/Python_Olympic Hero.py | csk1908/ga-learner-dsmp-repo | ea841db0d534e6b45176b6b316fa7f2a3ca87a4a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Problem Statement
# The Olympic Games, considered to be the world's foremost sports competition has more than 200 nations participating across the Summer and Winter Games alternating by occurring every four years but two years apart.
#
# Throughout this project, we will explore... | 32.84375 | 321 | 0.722441 |
9fa768b4e784735bb1f6b6d19c1458f5e29d73b9 | 11,809 | py | Python | bin/Python27/Lib/site-packages/sympy/combinatorics/prufer.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/sympy/combinatorics/prufer.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/sympy/combinatorics/prufer.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | from sympy.core import Basic
from sympy.core.compatibility import iterable, as_int
from sympy.utilities.iterables import flatten
from collections import defaultdict
class Prufer(Basic):
"""
The Prufer correspondence is an algorithm that describes the
bijection between labeled trees and the Prufer code. A ... | 27.399072 | 81 | 0.473791 |
2fcd2959ad9fc1c976eba5a80209d279b3d87709 | 3,068 | py | Python | braille_experience/braille_translators/mapAlphaToBraille.py | firekim2/testserver | 0ebd7be0e254fa825dad8be314fbfcb7b03f7a30 | [
"MIT"
] | null | null | null | braille_experience/braille_translators/mapAlphaToBraille.py | firekim2/testserver | 0ebd7be0e254fa825dad8be314fbfcb7b03f7a30 | [
"MIT"
] | null | null | null | braille_experience/braille_translators/mapAlphaToBraille.py | firekim2/testserver | 0ebd7be0e254fa825dad8be314fbfcb7b03f7a30 | [
"MIT"
] | null | null | null | # Contains dictionaries that map English letters to braille.
letters = {'a': chr(10241),
'b': chr(10243),
'c': chr(10249),
'd': chr(10265),
'e': chr(10257),
'f': chr(10251),
'g': chr(10267),
'h': chr(10259),
'i': chr(1025... | 31.628866 | 61 | 0.3191 |
0bf92279ccb15fcd06d5b4abcacf6f23dc7bb1aa | 16,309 | py | Python | sfs/mono/source.py | vishwesh-vishwesh/HiWi-job | 8953eb744f6e03191b94869e833b44efe74f7bd8 | [
"MIT"
] | null | null | null | sfs/mono/source.py | vishwesh-vishwesh/HiWi-job | 8953eb744f6e03191b94869e833b44efe74f7bd8 | [
"MIT"
] | null | null | null | sfs/mono/source.py | vishwesh-vishwesh/HiWi-job | 8953eb744f6e03191b94869e833b44efe74f7bd8 | [
"MIT"
] | null | null | null | """Compute the sound field generated by a sound source.
.. plot::
:context: reset
import sfs
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = 8, 4.5 # inch
x0 = 1.5, 1, 0
f = 500 # Hz
omega = 2 * np.pi * f
normalization_point = 4 * np.pi
n... | 27.974271 | 79 | 0.559384 |
adff23053e45aaca10579c0b0de3a70d1d48c88d | 1,646 | py | Python | src/models/fft.py | charlesxjyang/DeepGeyser | 59f54c67667800f091d7af1805c04bbc36c7624b | [
"Apache-2.0"
] | null | null | null | src/models/fft.py | charlesxjyang/DeepGeyser | 59f54c67667800f091d7af1805c04bbc36c7624b | [
"Apache-2.0"
] | null | null | null | src/models/fft.py | charlesxjyang/DeepGeyser | 59f54c67667800f091d7af1805c04bbc36c7624b | [
"Apache-2.0"
] | null | null | null | #misc
import sys
#data processing
import numpy as np
import pandas as pd
from scipy.fftpack import rfft
from scipy import optimize
#plotting
import matplotlib.pyplot as plt
#home-made
sys.path.append('../../utils')
from preprocessing import temp_forecasting_shape_processing,test_train_split
from error_reporting import ... | 32.27451 | 141 | 0.693196 |
67e538e42011db37d2919725f0d26babbf747145 | 205 | py | Python | test123.py | andreroche/Test-Scripts | 3d2b93900b8cd4e234fe909fc41ae0e4e2a43263 | [
"Apache-2.0"
] | null | null | null | test123.py | andreroche/Test-Scripts | 3d2b93900b8cd4e234fe909fc41ae0e4e2a43263 | [
"Apache-2.0"
] | null | null | null | test123.py | andreroche/Test-Scripts | 3d2b93900b8cd4e234fe909fc41ae0e4e2a43263 | [
"Apache-2.0"
] | null | null | null | result = False
x = 2520
while not True:
x+=2520
for y in range(2,21):
if x%y != 0:
break
print (result)
else:
print (result)
| 14.642857 | 27 | 0.404878 |
98cc60de4bad6988d47425e36293a46f0df95984 | 2,912 | py | Python | infoblox_netmri/api/remote/models/scan_interface_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/remote/models/scan_interface_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/remote/models/scan_interface_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class ScanInterfaceRemote(RemoteModel):
"""
A NetMRI interface that can do discovery and other interaction with licensed devices
| ``unit_id:`` The internal identifier for the collector on which the scan... | 30.978723 | 128 | 0.580701 |
2f5caa259e269f889ae53cf284cd9d0abcd33507 | 19,572 | py | Python | cobra/utils.py | sherppard/cobra | 5e2b9bf7418490a901d5d7cdc48f622717655f39 | [
"MIT"
] | 1 | 2018-06-12T11:20:55.000Z | 2018-06-12T11:20:55.000Z | cobra/utils.py | PCanyi/cobra | 0a80aa81a340c9d0f6ca68ef36980c5348cb5396 | [
"MIT"
] | null | null | null | cobra/utils.py | PCanyi/cobra | 0a80aa81a340c9d0f6ca68ef36980c5348cb5396 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
utils
~~~~~
Implements utils
:author: Feei <feei@feei.cn>
:homepage: https://github.com/WhaleShark-Team/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2018 Feei. All rights reserved
"""
import shutil
import hashlib
import jso... | 32.137931 | 159 | 0.566166 |
9d703529daec585e5994a10a2f7270992957741f | 1,027 | py | Python | config/cifar100_200.py | XuZhengzhuo/Prior-LT | 60720b519f4f4b56316e589702b58fa1374059d7 | [
"MIT"
] | 9 | 2021-11-17T09:21:20.000Z | 2022-02-23T03:40:31.000Z | config/cifar100_200.py | XuZhengzhuo/Prior-LT | 60720b519f4f4b56316e589702b58fa1374059d7 | [
"MIT"
] | 1 | 2021-12-21T07:58:23.000Z | 2021-12-21T08:06:55.000Z | config/cifar100_200.py | XuZhengzhuo/Prior-LT | 60720b519f4f4b56316e589702b58fa1374059d7 | [
"MIT"
] | 1 | 2022-01-04T07:58:42.000Z | 2022-01-04T07:58:42.000Z | # model
arch = 'resnet32'
# dataset
dataset = 'cifar100' # or 'cifar10'
imb_type = 'exp' # or 'step'
num_classes = int(dataset[5:])
imb_factor = 0.005
train_cls_num_list = None
inf_label_distribution = None
if dataset == 'cifar10':
h_class_idx = [0, 3]
m_class_idx = [3, 7]
t_class_idx = [7, 10]
else:
... | 18.672727 | 59 | 0.673807 |
84d5c977ff393ab701f9a0125335606377675532 | 531,138 | py | Python | template_container_macaque/labels/slice_53.py | lkondratova/Brainplot | 3c8a88c1995dedeaa5cbd88ee71499c7cf9c571d | [
"MIT"
] | null | null | null | template_container_macaque/labels/slice_53.py | lkondratova/Brainplot | 3c8a88c1995dedeaa5cbd88ee71499c7cf9c571d | [
"MIT"
] | null | null | null | template_container_macaque/labels/slice_53.py | lkondratova/Brainplot | 3c8a88c1995dedeaa5cbd88ee71499c7cf9c571d | [
"MIT"
] | null | null | null | coordinates_00EBFF = ((46, 187),
(46, 189), (47, 186), (47, 191), (48, 184), (48, 187), (48, 188), (48, 189), (48, 192), (49, 183), (49, 186), (49, 187), (49, 188), (49, 189), (49, 190), (49, 191), (49, 193), (50, 181), (50, 184), (50, 185), (50, 186), (50, 187), (50, 188), (50, 189), (50, 190), (50, 191), (50, 192),... | 782.235641 | 865 | 0.485855 |
9fee91fe2e8d112a7a12578571967ac17dd261c6 | 1,417 | py | Python | src/pyrfc/__init__.py | coledong/PyRFC | 073bfbd330a6f5581d507c7936974b19147355ea | [
"Apache-2.0"
] | 1 | 2020-06-03T17:56:51.000Z | 2020-06-03T17:56:51.000Z | src/pyrfc/__init__.py | coledong/PyRFC | 073bfbd330a6f5581d507c7936974b19147355ea | [
"Apache-2.0"
] | null | null | null | src/pyrfc/__init__.py | coledong/PyRFC | 073bfbd330a6f5581d507c7936974b19147355ea | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 SAP AG.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: //www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 28.34 | 88 | 0.703599 |
082d881741a10b0ce11d96970cda7042f4cec15e | 6,808 | py | Python | rich/_palettes.py | BIGBALLON/rich | 4e24f2ef1a978ce5f1b01b2b26b36f87b87566f2 | [
"MIT"
] | 16 | 2020-09-20T22:32:54.000Z | 2021-04-02T17:14:25.000Z | rich/_palettes.py | BIGBALLON/rich | 4e24f2ef1a978ce5f1b01b2b26b36f87b87566f2 | [
"MIT"
] | 42 | 2020-12-16T07:03:59.000Z | 2022-03-28T20:11:50.000Z | rich/_palettes.py | BIGBALLON/rich | 4e24f2ef1a978ce5f1b01b2b26b36f87b87566f2 | [
"MIT"
] | 3 | 2021-05-21T21:26:34.000Z | 2021-10-05T16:57:57.000Z | from .palette import Palette
# The standard ansi colors
WINDOWS_PALETTE = Palette(
[
(0, 0, 0),
(128, 0, 0),
(0, 128, 0),
(128, 128, 0),
(0, 0, 128),
(128, 0, 128),
(0, 128, 128),
(192, 192, 192),
]
)
# # The standard ansi colors (including brig... | 22.543046 | 56 | 0.328437 |
9c9b53c4944db740fb42850c8b5af13165bfe2fb | 7,962 | py | Python | TimeWrapper_JE/venv/Lib/site-packages/pip/_internal/cli/base_command.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | TimeWrapper_JE/venv/Lib/site-packages/pip/_internal/cli/base_command.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | TimeWrapper_JE/venv/Lib/site-packages/pip/_internal/cli/base_command.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | 1 | 2021-06-20T19:28:37.000Z | 2021-06-20T19:28:37.000Z | """Base Command class, and related routines"""
import logging
import logging.config
import optparse
import os
import sys
import traceback
from optparse import Values
from typing import Any, List, Optional, Tuple
from pip._internal.cli import cmdoptions
from pip._internal.cli.command_context import Command... | 35.864865 | 87 | 0.601105 |
f58c115847f3d0e2109da87a3245c07b6f82922b | 26 | py | Python | terrascript/kubernetes/__init__.py | GarnerCorp/python-terrascript | ec6c2d9114dcd3cb955dd46069f8ba487e320a8c | [
"BSD-2-Clause"
] | null | null | null | terrascript/kubernetes/__init__.py | GarnerCorp/python-terrascript | ec6c2d9114dcd3cb955dd46069f8ba487e320a8c | [
"BSD-2-Clause"
] | null | null | null | terrascript/kubernetes/__init__.py | GarnerCorp/python-terrascript | ec6c2d9114dcd3cb955dd46069f8ba487e320a8c | [
"BSD-2-Clause"
] | 1 | 2018-11-15T16:23:05.000Z | 2018-11-15T16:23:05.000Z | """2019-05-28 10:49:51"""
| 13 | 25 | 0.538462 |
6ef8dc1caadc6a1ad2e7410242b2e7f50a4d6285 | 2,801 | py | Python | src/ralph_assets/models_util.py | vi4m/ralph_assets | d174e8f769da2d5a335d24bbef5d0ca2e205383c | [
"Apache-2.0"
] | null | null | null | src/ralph_assets/models_util.py | vi4m/ralph_assets | d174e8f769da2d5a335d24bbef5d0ca2e205383c | [
"Apache-2.0"
] | null | null | null | src/ralph_assets/models_util.py | vi4m/ralph_assets | d174e8f769da2d5a335d24bbef5d0ca2e205383c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Model utilities and mixins."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.contrib.contentty... | 28.01 | 78 | 0.706176 |
b96bbe4c152fd198cecca087eeee0a2cb6bc663b | 5,757 | py | Python | tools/generate-tempest-plugins-list.py | cityofships/tempest | 59aa6811a3664d88b8939603b8e974644fbe21fa | [
"Apache-2.0"
] | 254 | 2015-01-05T19:22:52.000Z | 2022-03-29T08:14:54.000Z | tools/generate-tempest-plugins-list.py | cityofships/tempest | 59aa6811a3664d88b8939603b8e974644fbe21fa | [
"Apache-2.0"
] | 13 | 2015-03-02T15:53:04.000Z | 2022-02-16T02:28:14.000Z | tools/generate-tempest-plugins-list.py | cityofships/tempest | 59aa6811a3664d88b8939603b8e974644fbe21fa | [
"Apache-2.0"
] | 367 | 2015-01-07T15:05:39.000Z | 2022-03-04T09:50:35.000Z | #! /usr/bin/env python
# Copyright 2016 Hewlett Packard Enterprise Development Company, L.P.
#
# 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... | 37.383117 | 78 | 0.70106 |
2e6084ccc55954e25925ca6df8701f9d4b67bd15 | 185 | py | Python | x_rebirth_station_calculator/station_data/wares/surface_miner_urv_mk2.py | Phipsz/XRebirthStationCalculator | ac31c2f5816be34a7df2d7c4eb4bd5e01f7ff835 | [
"MIT"
] | 1 | 2016-04-17T11:00:22.000Z | 2016-04-17T11:00:22.000Z | x_rebirth_station_calculator/station_data/wares/surface_miner_urv_mk2.py | Phipsz/XRebirthStationCalculator | ac31c2f5816be34a7df2d7c4eb4bd5e01f7ff835 | [
"MIT"
] | null | null | null | x_rebirth_station_calculator/station_data/wares/surface_miner_urv_mk2.py | Phipsz/XRebirthStationCalculator | ac31c2f5816be34a7df2d7c4eb4bd5e01f7ff835 | [
"MIT"
] | null | null | null | from x_rebirth_station_calculator.station_data.station_base import Ware
names = {'L044': 'Surface Miner URV Mk2',
'L049': 'Tagebau-URV Mk2'}
SurfaceMinerURVMk2 = Ware(names)
| 26.428571 | 71 | 0.740541 |
d9f2ff0aeca975dd1e71c83436607932dcf8a1a6 | 2,346 | py | Python | iriusrisk-python-client-lib/test/test_threats_api.py | iriusrisk/iriusrisk-python-client-lib | 4912706cd1e5c0bc555dbc7da02fb64cbeab3b18 | [
"Apache-2.0"
] | null | null | null | iriusrisk-python-client-lib/test/test_threats_api.py | iriusrisk/iriusrisk-python-client-lib | 4912706cd1e5c0bc555dbc7da02fb64cbeab3b18 | [
"Apache-2.0"
] | null | null | null | iriusrisk-python-client-lib/test/test_threats_api.py | iriusrisk/iriusrisk-python-client-lib | 4912706cd1e5c0bc555dbc7da02fb64cbeab3b18 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
IriusRisk API
Products API # noqa: E501
OpenAPI spec version: 1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import iriusrisk_python_client_lib
from iriusrisk_python_client_lib.api.threats_api... | 33.514286 | 161 | 0.768542 |
65f7bba3b5c556a183226c492f4fde582343e814 | 874 | py | Python | gaphor/UML/usecases/extend.py | bertob/gaphor | a1d6f8dd8c878f299980bba6c055436148573274 | [
"Apache-2.0"
] | null | null | null | gaphor/UML/usecases/extend.py | bertob/gaphor | a1d6f8dd8c878f299980bba6c055436148573274 | [
"Apache-2.0"
] | null | null | null | gaphor/UML/usecases/extend.py | bertob/gaphor | a1d6f8dd8c878f299980bba6c055436148573274 | [
"Apache-2.0"
] | null | null | null | """Use case extension relationship."""
from gaphor import UML
from gaphor.diagram.presentation import LinePresentation, Named
from gaphor.diagram.shapes import Box, EditableText, Text, draw_arrow_head
from gaphor.diagram.support import represents
from gaphor.UML.modelfactory import stereotypes_str
@represents(UML.Ex... | 34.96 | 74 | 0.697941 |
9c265d7af0dc76b2721d6537a935c688e8cd0ab1 | 835 | py | Python | app/core/tests/test_commands.py | Mimicx/recipe-app-api | 4aa0ad098d414861b628e50948b741dc56a5847a | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | Mimicx/recipe-app-api | 4aa0ad098d414861b628e50948b741dc56a5847a | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | Mimicx/recipe-app-api | 4aa0ad098d414861b628e50948b741dc56a5847a | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandTests(TestCase):
def test_wait_for_db_ready(self):
"""Test Waiting for db when db is available"""
with patch('django.db.utils... | 33.4 | 74 | 0.665868 |
be9a755e995d43297395442ccbd32758e60581f6 | 1,597 | py | Python | jenkjobs/__init__.py | UCL/jenkjobs | 63945399310111f35f39b6ae74cfca4d9eb1d75b | [
"Apache-2.0"
] | null | null | null | jenkjobs/__init__.py | UCL/jenkjobs | 63945399310111f35f39b6ae74cfca4d9eb1d75b | [
"Apache-2.0"
] | null | null | null | jenkjobs/__init__.py | UCL/jenkjobs | 63945399310111f35f39b6ae74cfca4d9eb1d75b | [
"Apache-2.0"
] | null | null | null | def rsdt_doxygen(parser, xml_parent, data):
"""yaml: junit
Publish Doxygen documentation
Sameas as jenkins
Example::
publishers:
- rsdt_doxygen:
doxyfile: path to doxyfile relative to workspace. Required.
folder: path to working directory relative to workspace.
... | 33.978723 | 79 | 0.66124 |
9d8b32e80f2eb829d0b4b554273e23770f8111b4 | 1,794 | py | Python | pymatgen/tests/test_init.py | JiQi535/pymatgen | 9dc1a8e3658da846e79c25d55c399c13ec25646b | [
"MIT"
] | null | null | null | pymatgen/tests/test_init.py | JiQi535/pymatgen | 9dc1a8e3658da846e79c25d55c399c13ec25646b | [
"MIT"
] | null | null | null | pymatgen/tests/test_init.py | JiQi535/pymatgen | 9dc1a8e3658da846e79c25d55c399c13ec25646b | [
"MIT"
] | 1 | 2020-10-20T02:09:02.000Z | 2020-10-20T02:09:02.000Z | import os
import unittest
import warnings
import ruamel.yaml as yaml
from pymatgen import (
SETTINGS,
SETTINGS_FILE,
Structure,
_load_pmg_settings,
get_structure_from_mp,
loadfn,
)
from pymatgen.io.vasp import Vasprun
test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "test_files"... | 31.473684 | 86 | 0.618729 |
b49319025df18d07f9b6b31ca9b68fefc2004be3 | 1,921 | py | Python | CloudBackup/utils.py | 520github/CloudBackup | ec4a48f1ba438dbaf45d518c5ae0f192b6e7aa96 | [
"Apache-2.0"
] | 9 | 2015-08-23T09:08:14.000Z | 2019-04-29T02:08:11.000Z | CloudBackup/utils.py | chineking/CloudBackup | ec4a48f1ba438dbaf45d518c5ae0f192b6e7aa96 | [
"Apache-2.0"
] | null | null | null | CloudBackup/utils.py | chineking/CloudBackup | ec4a48f1ba438dbaf45d518c5ae0f192b6e7aa96 | [
"Apache-2.0"
] | 5 | 2016-07-19T03:38:10.000Z | 2017-12-06T21:13:42.000Z | #!/usr/bin/env python
#coding=utf-8
'''
Copyright (c) 2012 chine <qin@qinxuye.me>
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 ... | 29.106061 | 82 | 0.704321 |
c8ea3272ace7d8f099460af09d5a19a8dbd84349 | 10,548 | py | Python | softgym/envs/flex_env.py | ipab-rad/softgym | eeee770d8720c2cebaa9c5f72408b3340b07d367 | [
"BSD-3-Clause"
] | 147 | 2020-11-12T16:48:55.000Z | 2022-03-29T02:21:13.000Z | softgym/envs/flex_env.py | ipab-rad/softgym | eeee770d8720c2cebaa9c5f72408b3340b07d367 | [
"BSD-3-Clause"
] | 28 | 2020-11-20T23:09:58.000Z | 2022-03-31T14:51:16.000Z | softgym/envs/flex_env.py | ipab-rad/softgym | eeee770d8720c2cebaa9c5f72408b3340b07d367 | [
"BSD-3-Clause"
] | 29 | 2020-11-12T06:25:19.000Z | 2022-03-28T14:10:55.000Z | import os
import copy
from gym import error
import numpy as np
import gym
from softgym.utils.visualization import save_numpy_as_gif
import cv2
import os.path as osp
import pickle
try:
import pyflex
except ImportError as e:
raise error.DependencyNotInstalled("{}. (You need to first compile the python binding)".... | 39.505618 | 134 | 0.639173 |
fd690743d6cf0b6844287fe92101ded8d030480a | 2,486 | py | Python | Accuracy.py | ChrisZeThird/Image-Recognition-without-using-Neural-Network | 305b78b23cd1af2f60384180b1a0d9323e40c427 | [
"Apache-2.0"
] | 1 | 2021-09-14T17:19:38.000Z | 2021-09-14T17:19:38.000Z | Accuracy.py | ChrisZeThird/Image-Recognition-without-using-Neural-Network | 305b78b23cd1af2f60384180b1a0d9323e40c427 | [
"Apache-2.0"
] | null | null | null | Accuracy.py | ChrisZeThird/Image-Recognition-without-using-Neural-Network | 305b78b23cd1af2f60384180b1a0d9323e40c427 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 14 15:25:24 2021
@author: ChrisZeThird
"""
"""Separated file, meant to calculate the accuracy of the PictureRecognition programm, for different values of:
- K : the size of the batch
- delta : the precision
The goal is to plot thanks to matplo... | 25.628866 | 129 | 0.628721 |
90889b450d7bf8d6c7ebe763ef2667c8c26640b0 | 8,821 | py | Python | intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_replacemsggroup_nntp.py | Stienvdh/statrick | 7b092fc42171e226718a70a285a4b323f2f395ad | [
"MIT"
] | null | null | null | intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_replacemsggroup_nntp.py | Stienvdh/statrick | 7b092fc42171e226718a70a285a4b323f2f395ad | [
"MIT"
] | null | null | null | intro-ansible/venv3/lib/python3.8/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_replacemsggroup_nntp.py | Stienvdh/statrick | 7b092fc42171e226718a70a285a4b323f2f395ad | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | 32.430147 | 153 | 0.578052 |
de7d5f726ff7202c0a52af62d0fa46f24ed034ca | 4,644 | py | Python | src/faro/proto/proto_types.py | amanvell/faro | 2c4e5b86406937e1dd3fa9f339cfbca2325d98d6 | [
"MIT"
] | null | null | null | src/faro/proto/proto_types.py | amanvell/faro | 2c4e5b86406937e1dd3fa9f339cfbca2325d98d6 | [
"MIT"
] | null | null | null | src/faro/proto/proto_types.py | amanvell/faro | 2c4e5b86406937e1dd3fa9f339cfbca2325d98d6 | [
"MIT"
] | null | null | null | '''
MIT License
Copyright 2019 Oak Ridge National Laboratory
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, mer... | 30.96 | 88 | 0.687123 |
1050627f9c9c549b5d570ecb31c9941c2a9a19f1 | 4,062 | py | Python | tests/test_UniformMultiLayerLeverDrive2d_historic.py | tdegeus/FrictionQPotGooseFEM | 094d3dbe3a458b56203e5151157b26ca5bb6b497 | [
"MIT"
] | null | null | null | tests/test_UniformMultiLayerLeverDrive2d_historic.py | tdegeus/FrictionQPotGooseFEM | 094d3dbe3a458b56203e5151157b26ca5bb6b497 | [
"MIT"
] | null | null | null | tests/test_UniformMultiLayerLeverDrive2d_historic.py | tdegeus/FrictionQPotGooseFEM | 094d3dbe3a458b56203e5151157b26ca5bb6b497 | [
"MIT"
] | null | null | null | import os
import unittest
import FrictionQPotFEM
import GMatElastoPlasticQPot.Cartesian2d as GMat
import GooseFEM
import h5py
import numpy as np
import prrng
class test_UniformMultiLayerIndividualDrive2d(unittest.TestCase):
"""
Tests
"""
def test_historic(self):
"""
A simple historic... | 31.007634 | 100 | 0.552437 |
f816dbcf18adf40376ffcce2541c413d6d5d3ddc | 1,717 | py | Python | clipl/scripts/csv2root.py | thomas-mueller/clipl | 4c8c61dd4a09fee6ad2ec65f3baa6854cf9cce69 | [
"MIT"
] | null | null | null | clipl/scripts/csv2root.py | thomas-mueller/clipl | 4c8c61dd4a09fee6ad2ec65f3baa6854cf9cce69 | [
"MIT"
] | null | null | null | clipl/scripts/csv2root.py | thomas-mueller/clipl | 4c8c61dd4a09fee6ad2ec65f3baa6854cf9cce69 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import clipl.utility.logger as logger
log = logging.getLogger(__name__)
import argparse
import numpy
import os
import ROOT
ROOT.gROOT.SetBatch(True)
ROOT.PyConfig.IgnoreCommandLineOptions = True
ROOT.gErrorIgnoreLevel = ROOT.kError
import clipl.utility.tf... | 31.218182 | 122 | 0.704718 |
97fd67068c265539675a46166cee4a9aff92d7c7 | 7,117 | py | Python | modules/tools/open_space_visualization/auto_param_tuning.py | seeclong/apollo | 99c8afb5ebcae2a3c9359a156a957ff03944b27b | [
"Apache-2.0"
] | 27 | 2019-04-06T02:27:14.000Z | 2021-11-27T13:47:06.000Z | modules/tools/open_space_visualization/auto_param_tuning.py | seeclong/apollo | 99c8afb5ebcae2a3c9359a156a957ff03944b27b | [
"Apache-2.0"
] | 7 | 2021-03-10T18:14:25.000Z | 2022-02-27T04:46:46.000Z | modules/tools/open_space_visualization/auto_param_tuning.py | seeclong/apollo | 99c8afb5ebcae2a3c9359a156a957ff03944b27b | [
"Apache-2.0"
] | 38 | 2019-04-15T10:58:37.000Z | 2022-01-27T08:52:39.000Z | #!/usr/bin/env python
###############################################################################
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | 42.616766 | 165 | 0.701138 |
22e994ea03651bba511bb46735cb31fe285bb524 | 7,207 | py | Python | judger.py | SkyErnest/legal_basis | 7fc2aaffa54c6bc6fc8713e5755edff9b3d296e4 | [
"BSD-3-Clause"
] | null | null | null | judger.py | SkyErnest/legal_basis | 7fc2aaffa54c6bc6fc8713e5755edff9b3d296e4 | [
"BSD-3-Clause"
] | null | null | null | judger.py | SkyErnest/legal_basis | 7fc2aaffa54c6bc6fc8713e5755edff9b3d296e4 | [
"BSD-3-Clause"
] | null | null | null | from math import log
import os
import json
import numpy as np
class Judger:
# Initialize Judger, with the path of accusation list and law articles list
def __init__(self, accusation_path, law_path):
self.accu_dic = {}
f = open(accusation_path, "r",encoding='utf-8')
self.task1_cnt = 0
... | 33.995283 | 147 | 0.475371 |
9e95c5c83911e24fca27e522db17f04abe6efa75 | 981 | py | Python | tests/validation/test_square_client_id_validation.py | babenek/CredSweeper | 4d69ec934b45fd2f68e00b636077e5edfd1ff6ca | [
"MIT"
] | 17 | 2021-10-22T00:29:46.000Z | 2022-03-21T03:05:56.000Z | tests/validation/test_square_client_id_validation.py | babenek/CredSweeper | 4d69ec934b45fd2f68e00b636077e5edfd1ff6ca | [
"MIT"
] | 29 | 2021-11-05T21:10:51.000Z | 2022-03-30T10:41:08.000Z | tests/validation/test_square_client_id_validation.py | babenek/CredSweeper | 4d69ec934b45fd2f68e00b636077e5edfd1ff6ca | [
"MIT"
] | 16 | 2021-11-05T20:39:54.000Z | 2022-03-11T00:57:32.000Z | from os import environ
from typing import List
import pytest
from credsweeper.common.constants import KeyValidationOption
from credsweeper.credentials import LineData
from credsweeper.validations import SquareClientIdValidation
from tests.test_utils.dummy_line_data import get_line_data
@pytest.mark.api_validation
c... | 35.035714 | 75 | 0.763507 |
d76dd38661bf94014edf6b1833bc964eafb0b52b | 10,970 | py | Python | lexilla/scripts/LexillaData.py | xelliott/Notepad3 | 984e637ceae20b085d84e6294b6c63ca9ec78839 | [
"BSD-3-Clause"
] | null | null | null | lexilla/scripts/LexillaData.py | xelliott/Notepad3 | 984e637ceae20b085d84e6294b6c63ca9ec78839 | [
"BSD-3-Clause"
] | null | null | null | lexilla/scripts/LexillaData.py | xelliott/Notepad3 | 984e637ceae20b085d84e6294b6c63ca9ec78839 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# ScintillaData.py - implemented 2013 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Common code used by Scintilla and SciTE for source file regeneration.
# The ScintillaData object exposes information about Scintilla as properties:
# Version properties
# version
# ... | 39.602888 | 116 | 0.555971 |
31296104b82e438ac3520f0576d7c7cf6af130f8 | 5,017 | py | Python | src/fileutil.py | militiaonly/spark1707 | 3d4a3945ca2190628ea6a8593d3adadfd1a71dfb | [
"MIT"
] | null | null | null | src/fileutil.py | militiaonly/spark1707 | 3d4a3945ca2190628ea6a8593d3adadfd1a71dfb | [
"MIT"
] | null | null | null | src/fileutil.py | militiaonly/spark1707 | 3d4a3945ca2190628ea6a8593d3adadfd1a71dfb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding=utf-8 -*-
########################################
# Copyright (c) 2017 Shanghai Kimstars #
########################################
import os
import json
import logging
import random
import datetime
# wrtnode.__name__
logger = logging.getLogger('wrtnode.' + __name__)
def dt_to... | 25.467005 | 71 | 0.527407 |
209fd46c9c5a3475246dfa73ee923f0b8e428619 | 2,115 | py | Python | AutoPoly/extern/moltemplate/common/amber/amberparm_pair_to_lt.py | Chenghao-Wu/AutoPoly | e7b5d098c1fa33a11189e831ce6e5f121fc7615c | [
"MIT"
] | 1 | 2021-09-09T21:53:41.000Z | 2021-09-09T21:53:41.000Z | AutoPoly/extern/moltemplate/common/amber/amberparm_pair_to_lt.py | Chenghao-Wu/AutoPoly | e7b5d098c1fa33a11189e831ce6e5f121fc7615c | [
"MIT"
] | null | null | null | AutoPoly/extern/moltemplate/common/amber/amberparm_pair_to_lt.py | Chenghao-Wu/AutoPoly | e7b5d098c1fa33a11189e831ce6e5f121fc7615c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
lines_gaff = sys.stdin.readlines()
#pair_style = 'lj/charmm/coul/long'
# NOTE: Long-range coulombic forces were disabled intentionally. (See below)
# If you want to use long-range electrostatics, uncomment these lines:
# Instead I use hybrid lj/charmm/coul/charmm b... | 36.465517 | 120 | 0.655792 |
4d50934172f1c53deda5ac95ad59d75afb849e5d | 451 | py | Python | test_minHeap.py | codeocelot/datastructures | cec1253a287b00b72fbbc82660cd464a376c967d | [
"Apache-2.0"
] | null | null | null | test_minHeap.py | codeocelot/datastructures | cec1253a287b00b72fbbc82660cd464a376c967d | [
"Apache-2.0"
] | null | null | null | test_minHeap.py | codeocelot/datastructures | cec1253a287b00b72fbbc82660cd464a376c967d | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from min_heap import MinHeap
class TestMinHeap(TestCase):
def test_pop(self):
init = [1, 2, 3, 4, 5, 6, 7]
heap = MinHeap(init)
r = heap.pop()
self.assertEqual(r, 1)
self.assertEqual(heap.values, [2, 4, 3, 7, 5, 6])
def test_push(self):
... | 25.055556 | 57 | 0.554324 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.