hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ff66e466fa3d6ad772cb0df3d3aba02a4674034d | 3,670 | py | Python | specutils/io/asdf/tags/spectra.py | keflavich/specutils | ec4fe50c6c032fc421c2cd0ee0dda11fd0f856cb | [
"BSD-3-Clause"
] | null | null | null | specutils/io/asdf/tags/spectra.py | keflavich/specutils | ec4fe50c6c032fc421c2cd0ee0dda11fd0f856cb | [
"BSD-3-Clause"
] | null | null | null | specutils/io/asdf/tags/spectra.py | keflavich/specutils | ec4fe50c6c032fc421c2cd0ee0dda11fd0f856cb | [
"BSD-3-Clause"
] | null | null | null | """
Contains classes that serialize spectral data types into ASDF representations.
"""
from numpy.testing import assert_allclose
from astropy.units import allclose
import astropy.nddata
from asdf.yamlutil import (custom_tree_to_tagged_tree,
tagged_tree_to_custom_tree)
from ....spectra impor... | 33.063063 | 87 | 0.642507 |
ff6708c288a1e5a3b9d4f99a534bc7bdc7a04a9b | 1,575 | py | Python | pcgrl/game/core/tile.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | null | null | null | pcgrl/game/core/tile.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | 1 | 2021-09-30T07:57:46.000Z | 2021-10-02T00:39:11.000Z | pcgrl/game/core/tile.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | 2 | 2021-09-16T16:43:03.000Z | 2021-09-28T18:12:41.000Z | from pdb import set_trace as T
import numpy as np
from forge.blade.io.stimulus.hook import StimHook
from forge.blade.io.stimulus.static import Stimulus
def camel(string):
return string[0].lower() + string[1:]
class Tile(StimHook):
SERIAL = 1
def __init__(self, config, mat, r, c, nCounts, tex):
super()... | 24.230769 | 55 | 0.612698 |
ff672fecace37d17cee8bc86555683b7926aa2ab | 775 | py | Python | configs/selfsup/_test_/models/resnet18_simsiam_kd_minepoch.py | dungdinhanh/mmselfsup | 67fc764f4f5512701f93e8e1fa39e09ee008a54a | [
"Apache-2.0"
] | null | null | null | configs/selfsup/_test_/models/resnet18_simsiam_kd_minepoch.py | dungdinhanh/mmselfsup | 67fc764f4f5512701f93e8e1fa39e09ee008a54a | [
"Apache-2.0"
] | null | null | null | configs/selfsup/_test_/models/resnet18_simsiam_kd_minepoch.py | dungdinhanh/mmselfsup | 67fc764f4f5512701f93e8e1fa39e09ee008a54a | [
"Apache-2.0"
] | 1 | 2022-03-15T11:31:48.000Z | 2022-03-15T11:31:48.000Z | # model settings
model = dict(
type='SimSiamKDMinEpoch',
backbone=dict(
type='ResNet',
depth=18,
in_channels=3,
out_indices=[4], # 0: conv-1, x: stage-x
norm_cfg=dict(type='SyncBN'),
zero_init_residual=True),
neck=dict(
type='NonLinearNeck',
i... | 25.833333 | 49 | 0.56 |
ff67a973aa1eddff93905c655a8166a05b6d34a8 | 21,204 | py | Python | projector_installer/dialogs.py | em3ndez/projector-installer | 842c82b127df0087e3d7e85ab1561fbb36c13f1a | [
"Apache-2.0"
] | null | null | null | projector_installer/dialogs.py | em3ndez/projector-installer | 842c82b127df0087e3d7e85ab1561fbb36c13f1a | [
"Apache-2.0"
] | null | null | null | projector_installer/dialogs.py | em3ndez/projector-installer | 842c82b127df0087e3d7e85ab1561fbb36c13f1a | [
"Apache-2.0"
] | null | null | null | # Copyright 2000-2022 JetBrains s.r.o.
# Use of this source code is governed by the Apache 2.0 license that can be found
# in the LICENSE file.
"""User dialog related procedures."""
import platform
import sys
import readline
from enum import Enum, auto
from getpass import getpass
from os.path import expanduser
from ... | 32.571429 | 99 | 0.649123 |
ff67baf0dc1e6bd3469151fbd2936c9c0ea282e7 | 2,181 | py | Python | src/rival_regions_wrapper/wrapper/perks.py | joostsijm/rival_regions_wrapper | f518ad4075b165078aee3c6dd93a0b4e8c3ba6d4 | [
"MIT"
] | 2 | 2021-04-06T15:39:52.000Z | 2021-04-09T11:37:21.000Z | src/rival_regions_wrapper/wrapper/perks.py | joostsijm/rival_regions_wrapper | f518ad4075b165078aee3c6dd93a0b4e8c3ba6d4 | [
"MIT"
] | 3 | 2021-03-28T10:59:49.000Z | 2021-04-02T09:43:16.000Z | src/rival_regions_wrapper/wrapper/perks.py | joostsijm/rival_regions_wrapper | f518ad4075b165078aee3c6dd93a0b4e8c3ba6d4 | [
"MIT"
] | 3 | 2021-03-19T13:11:47.000Z | 2021-08-28T14:16:54.000Z | """Perks class"""
import re
from bs4 import BeautifulSoup
from rival_regions_wrapper import util
from rival_regions_wrapper.wrapper.abstract_wrapper import AbstractWrapper
class Perks(AbstractWrapper):
"""Wrapper class for perks"""
def info(self):
"""Get perks"""
path = "main/content"
... | 29.08 | 76 | 0.517652 |
ff67e5d1190120595a04c9bf53977f4386b4fda4 | 12,056 | py | Python | app/util/http_run.py | wuqundong520/ApiTestManage | ad6afcbb4876e4f9183ec9027009a8f027b41783 | [
"Apache-2.0"
] | 318 | 2018-07-06T08:47:52.000Z | 2022-03-29T08:50:29.000Z | app/util/http_run.py | wuqundong520/ApiTestManage | ad6afcbb4876e4f9183ec9027009a8f027b41783 | [
"Apache-2.0"
] | 6 | 2019-07-25T02:56:57.000Z | 2021-01-25T08:31:30.000Z | app/util/http_run.py | wuqundong520/ApiTestManage | ad6afcbb4876e4f9183ec9027009a8f027b41783 | [
"Apache-2.0"
] | 145 | 2018-07-06T14:00:15.000Z | 2022-02-23T07:20:18.000Z | import ast
import json
import types
from app.models import *
from .httprunner.api import HttpRunner
from ..util.global_variable import *
from ..util.utils import encode_object
import importlib
from app import scheduler
from flask.json import JSONEncoder
class RunCase(object):
def __init__(self, project_ids=None):... | 46.015267 | 120 | 0.564035 |
ff67e7505cf8a8e4e05a3d74d119237f77bfda1f | 2,199 | py | Python | venv/Lib/site-packages/pyrogram/types/bots_and_keyboards/game_high_score.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/types/bots_and_keyboards/game_high_score.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/types/bots_and_keyboards/game_high_score.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 30.971831 | 93 | 0.649841 |
ff67f8012df1272ce150f739277269190d013ed6 | 19,628 | py | Python | cogbot/extensions/helpchat/help_chat.py | Arcensoth/cogbot | ef9d935ae8c8fbe00fb9370c75e0e6d9189141d0 | [
"MIT"
] | 8 | 2016-12-26T14:10:38.000Z | 2021-01-02T03:50:05.000Z | cogbot/extensions/helpchat/help_chat.py | Arcensoth/cogbot | ef9d935ae8c8fbe00fb9370c75e0e6d9189141d0 | [
"MIT"
] | 28 | 2016-12-12T04:06:53.000Z | 2020-04-23T06:18:55.000Z | cogbot/extensions/helpchat/help_chat.py | Arcensoth/cogbot | ef9d935ae8c8fbe00fb9370c75e0e6d9189141d0 | [
"MIT"
] | 9 | 2017-06-03T00:33:57.000Z | 2020-10-29T18:16:02.000Z | import asyncio
import logging
import re
import typing
import discord
from discord.ext import commands
from discord.ext.commands import Context
from cogbot import checks
from cogbot.cog_bot import CogBot, ServerId
from cogbot.extensions.helpchat.channel_state import ChannelState
from cogbot.extensions.helpchat.help_ch... | 40.977035 | 95 | 0.628745 |
ff6811633c4d3b5c0ee309e280b71a2c5bfdad5c | 4,458 | py | Python | deid/logger/progress.py | glebsts/deid | a0c630ee613d358b3c8e936dd539d51dee94a5a7 | [
"MIT"
] | 88 | 2017-10-16T12:47:09.000Z | 2022-03-10T23:08:04.000Z | deid/logger/progress.py | glebsts/deid | a0c630ee613d358b3c8e936dd539d51dee94a5a7 | [
"MIT"
] | 180 | 2017-06-15T01:37:00.000Z | 2022-03-23T23:05:57.000Z | deid/logger/progress.py | glebsts/deid | a0c630ee613d358b3c8e936dd539d51dee94a5a7 | [
"MIT"
] | 41 | 2017-09-29T00:29:50.000Z | 2022-03-16T02:26:54.000Z | # -*- coding: utf-8 -*-
"""
clint.textui.progress
~~~~~~~~~~~~~~~~~
A derivation of clint version, to not introduce a dependency and add custom functionality.
Credit to base code goes to https://github.com/kennethreitz/clint/blob/master/clint/textui/progress.py
"""
from __future__ import absolute_import
import sys... | 28.948052 | 102 | 0.540153 |
ff6812664885832b5ac42e7c88d8edacdf157203 | 3,394 | py | Python | evaluate.py | sb-b/BOUN-PARSE | 2b529924897d8e2613c4d2193a67796a895da40b | [
"Apache-2.0"
] | 12 | 2020-03-04T17:36:12.000Z | 2021-09-26T14:02:49.000Z | evaluate.py | sb-b/BOUN-PARSE | 2b529924897d8e2613c4d2193a67796a895da40b | [
"Apache-2.0"
] | 1 | 2020-12-09T08:21:11.000Z | 2020-12-09T08:21:11.000Z | evaluate.py | sb-b/BOUN-PARSE | 2b529924897d8e2613c4d2193a67796a895da40b | [
"Apache-2.0"
] | 3 | 2020-11-18T09:53:42.000Z | 2020-12-17T23:04:59.000Z | # coding=utf-8
import sys
from pipeline import Pipeline
import argparse
import os
import importlib
import morphological_parser.mp as mp
from full_pipeline_stream import read_pipelines
a2conl = importlib.import_module("morp-based-model.add_morp_analysis_to_conllu")
m2conl = importlib.import_module("morp-based-model.add_... | 44.657895 | 293 | 0.765174 |
ff68200b33d32f5e5984dae364fba8a9fba48069 | 1,497 | py | Python | contracts/ontology/LibUtils/SafeMath.py | markvelous/asdex | 09122ee74761a00a08c86f675d755e3b27b02e9f | [
"MIT"
] | null | null | null | contracts/ontology/LibUtils/SafeMath.py | markvelous/asdex | 09122ee74761a00a08c86f675d755e3b27b02e9f | [
"MIT"
] | 6 | 2021-03-25T23:51:13.000Z | 2022-03-12T00:34:39.000Z | contracts/ontology/LibUtils/SafeMath.py | markvelous/asdex | 09122ee74761a00a08c86f675d755e3b27b02e9f | [
"MIT"
] | 1 | 2021-06-06T05:08:13.000Z | 2021-06-06T05:08:13.000Z | # -*- coding: utf-8 -*-"""
"""
You can import this file and methods in your smart contract,
you can also add safe math methods within this function based on your needs.
"""
from LibUtils.ContractUtils import Require
from boa.interop.System.Runtime import Notify
def Add(a, b):
"""
Adds two numbers, throws on overflow... | 18.949367 | 89 | 0.544422 |
ff68367c4f104fc04ed1814fdf13502738807b22 | 12,501 | py | Python | py/desimeter/match_positioners.py | julienguy/desimeter | 9dd40251b0c483b525a952051a73587ac9180e8a | [
"BSD-3-Clause"
] | 1 | 2022-01-25T00:18:55.000Z | 2022-01-25T00:18:55.000Z | py/desimeter/match_positioners.py | desihub/desimeter | e575f22c8820d4f98a6715ad7574130a6d11b09b | [
"BSD-3-Clause"
] | 124 | 2019-12-30T20:46:43.000Z | 2021-12-09T21:33:57.000Z | py/desimeter/match_positioners.py | julienguy/desimeter | 9dd40251b0c483b525a952051a73587ac9180e8a | [
"BSD-3-Clause"
] | 5 | 2020-01-17T16:51:11.000Z | 2020-07-27T09:34:46.000Z | import numpy as np
import desimeter.log
log = desimeter.log.get_logger()
def match2d(x1, y1, x2, y2, rad):
"""Find all matches between x1, y1 and x2, y2 within radius rad."""
from scipy.spatial import cKDTree
xx1 = np.stack([x1, y1], axis=1)
xx2 = np.stack([x2, y2], axis=1)
tree1 = cKDTree(xx1)
... | 44.017606 | 81 | 0.62715 |
ff6856002cbdbba88426876420bf66c85def85f4 | 1,588 | py | Python | src/morphforgecontrib/simulation/synapse_templates/exponential_form/__init__.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | 1 | 2021-01-21T11:31:59.000Z | 2021-01-21T11:31:59.000Z | src/morphforgecontrib/simulation/synapse_templates/exponential_form/__init__.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | src/morphforgecontrib/simulation/synapse_templates/exponential_form/__init__.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | 44.111111 | 72 | 0.702771 |
ff6870dc28508f5533c0cd5356d87ceaa0f58c93 | 56,491 | py | Python | venv/Lib/site-packages/tensorflow/python/ops/gen_list_ops.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/python/ops/gen_list_ops.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/python/ops/gen_list_ops.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | 1 | 2020-06-28T11:47:47.000Z | 2020-06-28T11:47:47.000Z | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: list_ops.cc
"""
import collections
from tensorflow.python import pywrap_tfe as pywrap_tfe
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as _core
from ten... | 40.264433 | 146 | 0.720363 |
ff6883b722899c645d1ac1117a92c61ced0573a9 | 6,493 | py | Python | regolith/helpers/l_membershelper.py | MichaelTrumbull/regolith | 881f543cfa7bbf80b38ed2b357209c5bc009a6af | [
"CC0-1.0"
] | null | null | null | regolith/helpers/l_membershelper.py | MichaelTrumbull/regolith | 881f543cfa7bbf80b38ed2b357209c5bc009a6af | [
"CC0-1.0"
] | null | null | null | regolith/helpers/l_membershelper.py | MichaelTrumbull/regolith | 881f543cfa7bbf80b38ed2b357209c5bc009a6af | [
"CC0-1.0"
] | null | null | null | """Helper for listing group members.
"""
from regolith.dates import is_current
from regolith.helpers.basehelper import SoutHelperBase
from regolith.fsclient import _id_key
from regolith.sorters import position_key
from regolith.tools import (
all_docs_from_collection,
key_value_pair_filter, collection_str,
... | 43.871622 | 129 | 0.545049 |
ff68ed18b85bdf5a7574377930de4b85a8ec2094 | 757 | py | Python | web_app/__init__.py | xander-bennett/TwitOff | 230942382f4a0edd3276cbe4de57eb80ed982555 | [
"MIT"
] | null | null | null | web_app/__init__.py | xander-bennett/TwitOff | 230942382f4a0edd3276cbe4de57eb80ed982555 | [
"MIT"
] | 4 | 2019-11-13T21:31:57.000Z | 2021-06-08T21:27:05.000Z | web_app/__init__.py | xander-bennett/TwitOff | 230942382f4a0edd3276cbe4de57eb80ed982555 | [
"MIT"
] | null | null | null | from flask import Flask
from web_app.models import db, migrate
from web_app.routes.home_routes import home_routes
from web_app.routes.book_routes import book_routes
DATABASE_URI = "/Users/alexanderbennett/Desktop/repos/TwitOff/web_app/twitoff_development.db"
SECRET_KEY = "super secret"
def create_app():
app = Fl... | 29.115385 | 93 | 0.76354 |
ff68f32ec35c759d265bb0eea328f543be29af56 | 188,508 | py | Python | src/sentry/migrations/0001_initial.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/migrations/0001_initial.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/migrations/0001_initial.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import bitfield.models
import sentry.models.scheduledeletion
import sentry.models.groupshare
import sentry.db.models.fields.uuid
import django.utils.timezone
import sentry.db.models.fields.citext
from django.conf i... | 53.056009 | 184 | 0.484086 |
ff691473a2e4f93f8a614d2210d40f164cb92311 | 6,392 | py | Python | tensorboard_plugin/tensorboard_plugin_fairness_indicators/plugin_test.py | ZachT1711/fairness-indicators | b943dc2d6505cc4cc6da193b68275150c4c17d8f | [
"Apache-2.0"
] | 1 | 2020-08-26T06:57:42.000Z | 2020-08-26T06:57:42.000Z | tensorboard_plugin/tensorboard_plugin_fairness_indicators/plugin_test.py | ZachT1711/fairness-indicators | b943dc2d6505cc4cc6da193b68275150c4c17d8f | [
"Apache-2.0"
] | null | null | null | tensorboard_plugin/tensorboard_plugin_fairness_indicators/plugin_test.py | ZachT1711/fairness-indicators | b943dc2d6505cc4cc6da193b68275150c4c17d8f | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.739394 | 94 | 0.722309 |
ff694292408787086aee557e384fc00be3030c7a | 4,773 | py | Python | boudams/utils.py | matgille/boudams | d253ff2ee124e13186b5782ebb3c2d9b4bedd942 | [
"MIT"
] | 5 | 2019-10-12T22:12:42.000Z | 2022-02-17T14:59:02.000Z | boudams/utils.py | matgille/boudams | d253ff2ee124e13186b5782ebb3c2d9b4bedd942 | [
"MIT"
] | 10 | 2019-06-08T09:31:19.000Z | 2021-05-16T09:27:14.000Z | boudams/utils.py | matgille/boudams | d253ff2ee124e13186b5782ebb3c2d9b4bedd942 | [
"MIT"
] | 2 | 2020-01-10T09:46:09.000Z | 2021-02-26T17:04:36.000Z | import math
import gzip
import time
import uuid
from contextlib import contextmanager
import os
import shutil
import unidecode
import warnings
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
Cache = {}
def mufidecode... | 28.580838 | 94 | 0.589566 |
ff69456d5f60ac8ab793433a96d01e0ea5385e88 | 1,171 | py | Python | apps/ingest/migrations/0028_ingesttaskwatcher.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 18 | 2017-06-12T09:58:02.000Z | 2021-10-01T11:14:34.000Z | apps/ingest/migrations/0028_ingesttaskwatcher.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 276 | 2019-04-26T20:13:01.000Z | 2022-03-31T10:26:28.000Z | apps/ingest/migrations/0028_ingesttaskwatcher.py | ecds/readux | 4eac8b48efef8126f4f2be28b5eb943c85a89c2e | [
"Apache-2.0"
] | 7 | 2018-03-13T23:44:26.000Z | 2021-09-15T17:54:55.000Z | # Generated by Django 2.2.23 on 2021-09-28 18:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('ingest', '0027_remove_l... | 39.033333 | 167 | 0.64731 |
ff694d6c4224a590769a729a71481a1b8c9f0c00 | 3,125 | py | Python | flexget/tests/test_exec.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | 1 | 2018-05-02T21:14:50.000Z | 2018-05-02T21:14:50.000Z | flexget/tests/test_exec.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | flexget/tests/test_exec.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import sys
import pytest
class TestExec(object):
__tmp__ = True
config = """
templates:
global:
set:
temp_dir: '__tmp__'
... | 45.289855 | 173 | 0.53632 |
ff6961e2fb6482394252dd0638366224dad5f6f5 | 40,445 | py | Python | support/User Packages/build_install_entries.py | renaudguerin/hstwb-installer | 01ba6050af4fefb3af56c889fde906cf75cd187e | [
"MIT"
] | 1 | 2020-11-07T11:56:37.000Z | 2020-11-07T11:56:37.000Z | support/User Packages/build_install_entries.py | renaudguerin/hstwb-installer | 01ba6050af4fefb3af56c889fde906cf75cd187e | [
"MIT"
] | null | null | null | support/User Packages/build_install_entries.py | renaudguerin/hstwb-installer | 01ba6050af4fefb3af56c889fde906cf75cd187e | [
"MIT"
] | null | null | null | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
# Build Install Entries
# ---------------------
#
# Author: Henrik Noerfjand Stengaard
# Date: 2019-10-30
#
# A powershell script to build install entries script for HstWB Installer user packages.
"""Build Install Entries"""
from __future__ import prin... | 46.811343 | 498 | 0.660329 |
ff696779c9d6588253b6f6e84c83c952b59cda24 | 3,354 | py | Python | lottery/branch/change_depth_random_mask.py | xhchrn/open_lth | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | [
"MIT"
] | 9 | 2021-03-30T20:43:26.000Z | 2021-12-28T06:25:17.000Z | lottery/branch/change_depth_random_mask.py | xhchrn/open_lth | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | [
"MIT"
] | null | null | null | lottery/branch/change_depth_random_mask.py | xhchrn/open_lth | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | [
"MIT"
] | 2 | 2021-03-31T01:19:48.000Z | 2021-08-02T13:41:32.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
from lottery.branch import base
import models.registry
from pruning.mask import Mask
from pruning.pruned_model import PrunedModel
f... | 42.455696 | 119 | 0.691115 |
ff69a6b47007bec1498e9eefed4ea448bafb590e | 290 | py | Python | nixui/tests/test_api.py | yater/nix-gui | e7d1137ff85ef6bfe33ccc7cd8eee944475d4217 | [
"MIT"
] | 254 | 2021-07-08T19:40:12.000Z | 2022-03-30T23:21:19.000Z | nixui/tests/test_api.py | yater/nix-gui | e7d1137ff85ef6bfe33ccc7cd8eee944475d4217 | [
"MIT"
] | 166 | 2021-07-07T19:39:08.000Z | 2022-03-16T19:24:08.000Z | nixui/tests/test_api.py | yater/nix-gui | e7d1137ff85ef6bfe33ccc7cd8eee944475d4217 | [
"MIT"
] | 10 | 2021-07-09T11:20:31.000Z | 2022-01-04T20:46:39.000Z | import os
import pytest
from nixui.options import api
SAMPLES_PATH = 'tests/sample'
@pytest.mark.datafiles(SAMPLES_PATH)
def test_get_option_tree():
os.environ['CONFIGURATION_PATH'] = os.path.abspath(os.path.join(SAMPLES_PATH, 'configuration.nix'))
assert api.get_option_tree()
| 22.307692 | 103 | 0.772414 |
ff69ac8dbaf94f8d80c1f6ae174ee245c4f8b27f | 634 | py | Python | nst.py | tripleee/halflife | ab0fa5fc2a048b9e17762ceb6e3472e4d9c65317 | [
"Apache-2.0",
"MIT"
] | 5 | 2017-08-31T08:48:46.000Z | 2017-10-27T12:20:54.000Z | nst.py | tripleee/halflife | ab0fa5fc2a048b9e17762ceb6e3472e4d9c65317 | [
"Apache-2.0",
"MIT"
] | 12 | 2018-05-10T08:29:40.000Z | 2021-12-09T07:44:19.000Z | nst.py | Charcoal-SE/halflife | fd95c3f4373e589cb69547f7e90f01589dc0858e | [
"Apache-2.0",
"MIT"
] | 2 | 2018-03-19T17:08:25.000Z | 2021-11-11T04:20:26.000Z | #!/usr/bin/env python
import json
import logging
import sys
import halflife
loglevel = logging.WARNING
if '--verbose' in sys.argv[1:]:
loglevel = logging.INFO
sys.argv.remove('--verbose')
logging.basicConfig(level=loglevel, format='%(module)s:%(message)s')
with open('halflife.conf') as conffile:
conf = j... | 23.481481 | 68 | 0.670347 |
ff69b97edc72cc8509e68a9c2b42d22910f80d16 | 3,156 | py | Python | tests/gui/test_state.py | preeti98/sleap | 203c3a03c0c54f8dab242611d9a8d24595e98081 | [
"BSD-3-Clause-Clear"
] | 156 | 2020-05-01T18:43:43.000Z | 2022-03-25T10:31:18.000Z | tests/gui/test_state.py | preeti98/sleap | 203c3a03c0c54f8dab242611d9a8d24595e98081 | [
"BSD-3-Clause-Clear"
] | 299 | 2020-04-20T16:37:52.000Z | 2022-03-31T23:54:48.000Z | tests/gui/test_state.py | preeti98/sleap | 203c3a03c0c54f8dab242611d9a8d24595e98081 | [
"BSD-3-Clause-Clear"
] | 41 | 2020-05-14T15:25:21.000Z | 2022-03-25T12:44:54.000Z | import pytest
from sleap.gui.state import GuiState
def test_gui_state():
state = GuiState()
# use a global var to count how many times callback is called
times_x_changed = 0
def count_change_callback():
nonlocal times_x_changed
times_x_changed += 1
# make sure that value can be... | 22.225352 | 79 | 0.63403 |
ff69d57361c6f684189c4397ca515db07f39cd30 | 130 | py | Python | crowdsorter/api/__init__.py | jacebrowning/crowdsorter | 1c847f1f0284fc810ec1f2dd501acb4dbfa16bbb | [
"MIT"
] | 2 | 2020-05-09T23:46:23.000Z | 2021-03-23T18:40:26.000Z | crowdsorter/api/__init__.py | jacebrowning/crowdsorter | 1c847f1f0284fc810ec1f2dd501acb4dbfa16bbb | [
"MIT"
] | 1 | 2020-10-18T17:15:49.000Z | 2020-11-11T18:25:05.000Z | crowdsorter/api/__init__.py | jacebrowning/crowdsorter | 1c847f1f0284fc810ec1f2dd501acb4dbfa16bbb | [
"MIT"
] | 1 | 2021-03-23T18:41:16.000Z | 2021-03-23T18:41:16.000Z | from . import root
from . import collections
from . import items
from . import votes
from . import scores
from . import redirects
| 18.571429 | 25 | 0.769231 |
ff69dd7145e7cc2f989660190362683abbacb3b1 | 1,297 | py | Python | money/templatetags/url.py | taqueci/nomoney | 940879ffff0d17724709e642d9c1911ac4e996ce | [
"MIT"
] | null | null | null | money/templatetags/url.py | taqueci/nomoney | 940879ffff0d17724709e642d9c1911ac4e996ce | [
"MIT"
] | 2 | 2020-06-06T13:08:38.000Z | 2022-02-10T14:51:16.000Z | money/templatetags/url.py | taqueci/nomoney | 940879ffff0d17724709e642d9c1911ac4e996ce | [
"MIT"
] | null | null | null | # Copyright (C) Takeshi Nakamura. All rights reserved.
import re
from django import template
from money.views.shared import date
register = template.Library()
@register.simple_tag(takes_context=True)
def url_param_value(context, key):
return context['request'].GET.get(key, '')
@register.simple_tag(takes_con... | 21.616667 | 71 | 0.619892 |
ff6a2f42330779fc7311f2e0cb3435a9e937a480 | 1,419 | py | Python | nlisim/modules/csv_writer.py | jbeezley/simulation-hello-world | b4e1258de9c7601af1701041fa39f8f6c5e5a61e | [
"Apache-2.0"
] | 4 | 2021-05-21T15:46:15.000Z | 2022-03-01T02:58:32.000Z | nlisim/modules/csv_writer.py | jbeezley/simulation-hello-world | b4e1258de9c7601af1701041fa39f8f6c5e5a61e | [
"Apache-2.0"
] | 10 | 2020-11-10T23:20:37.000Z | 2022-03-12T01:34:47.000Z | nlisim/modules/csv_writer.py | jbeezley/simulation-hello-world | b4e1258de9c7601af1701041fa39f8f6c5e5a61e | [
"Apache-2.0"
] | 2 | 2020-12-16T14:24:26.000Z | 2021-01-08T15:56:20.000Z | import csv
import itertools
import attr
from nlisim.module import ModuleModel, ModuleState
from nlisim.postprocess import generate_summary_stats
from nlisim.state import State
@attr.s(kw_only=True, repr=False)
class CSVWriterState(ModuleState):
def __repr__(self):
return 'CSVWriterState()'
class CSVWr... | 28.38 | 93 | 0.634954 |
ff6a929bbe1f87bc87fb9c2360e2f4e0416ca731 | 4,823 | py | Python | neatsociety/genes.py | machinebrains/neat-society | 395c092083aa62ac8ad2a93a9afde659ecbd85fd | [
"BSD-3-Clause"
] | 2 | 2018-03-03T16:30:09.000Z | 2022-01-02T17:02:22.000Z | neatsociety/genes.py | machinebrains/neat-society | 395c092083aa62ac8ad2a93a9afde659ecbd85fd | [
"BSD-3-Clause"
] | null | null | null | neatsociety/genes.py | machinebrains/neat-society | 395c092083aa62ac8ad2a93a9afde659ecbd85fd | [
"BSD-3-Clause"
] | 1 | 2021-09-21T21:53:17.000Z | 2021-09-21T21:53:17.000Z | import random
class NodeGene(object):
def __init__(self, ID, node_type, bias=0.0, response=4.924273, activation_type='sigmoid'):
""" A node gene encodes the basic artificial neuron model.
node_type must be 'INPUT', 'HIDDEN', or 'OUTPUT'
"""
assert activation_type is not None
... | 39.859504 | 111 | 0.647522 |
ff6ab1e56aa9a6af768d65e883494244fb55129e | 5,129 | py | Python | empower/apps/managers/flowmanager/scripts/experiments/delay_aware/experiment_delay_aware.py | imec-idlab/empower-runtime | eda52649f855722fdec1d02e25a28c61a8fbda06 | [
"Apache-2.0"
] | 2 | 2020-02-28T15:54:01.000Z | 2020-11-24T08:45:11.000Z | empower/apps/managers/flowmanager/scripts/experiments/delay_aware/experiment_delay_aware.py | imec-idlab/empower-runtime | eda52649f855722fdec1d02e25a28c61a8fbda06 | [
"Apache-2.0"
] | null | null | null | empower/apps/managers/flowmanager/scripts/experiments/delay_aware/experiment_delay_aware.py | imec-idlab/empower-runtime | eda52649f855722fdec1d02e25a28c61a8fbda06 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
__author__ = "Pedro Heleno Isolani"
__copyright__ = "Copyright 2020, The SDN WiFi MAC Manager"
__license__ = "GPL"
__version__ = "1.0"
__maintainer__ = "Pedro Heleno Isolani"
__email__ = "pedro.isolani@uantwerpen.be"
__status__ = "Prototype"
from subprocess import call
from optparse import Option... | 53.427083 | 112 | 0.608891 |
ff6ad471864bb1bec44b4dce09577a47e3db79bf | 7,555 | py | Python | salt/modules/smartos_nictagadm.py | silviud/salt | 9d35ea66428a030d00ef1a2f3b93ecfe90be023c | [
"Apache-2.0"
] | 1 | 2020-02-22T07:11:24.000Z | 2020-02-22T07:11:24.000Z | salt/modules/smartos_nictagadm.py | silviud/salt | 9d35ea66428a030d00ef1a2f3b93ecfe90be023c | [
"Apache-2.0"
] | null | null | null | salt/modules/smartos_nictagadm.py | silviud/salt | 9d35ea66428a030d00ef1a2f3b93ecfe90be023c | [
"Apache-2.0"
] | 1 | 2019-08-01T15:14:19.000Z | 2019-08-01T15:14:19.000Z | # -*- coding: utf-8 -*-
'''
Module for running nictagadm command on SmartOS
:maintainer: Jorge Schrauwen <sjorge@blackdot.be>
:maturity: new
:depends: nictagadm binary, dladm binary
:platform: smartos
..versionadded: Carbon
'''
from __future__ import absolute_import
# Import Python libs
import log... | 24.609121 | 118 | 0.572204 |
ff6b064ea50ae8ebafdf85a9ec0cdc4337176308 | 20,137 | py | Python | run_pretraining_local.py | chenyu-jiang/bert | 099cb1421dbf23f30f61a59b2770c4f06465c7bf | [
"Apache-2.0"
] | null | null | null | run_pretraining_local.py | chenyu-jiang/bert | 099cb1421dbf23f30f61a59b2770c4f06465c7bf | [
"Apache-2.0"
] | null | null | null | run_pretraining_local.py | chenyu-jiang/bert | 099cb1421dbf23f30f61a59b2770c4f06465c7bf | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 40.435743 | 152 | 0.661916 |
ff6b192b8d870c548011bcacc64b7fea05893c5d | 9,208 | py | Python | giantstar/utils/dataParser.py | DaoSen-v/gaintstar | 5ecae8652c9f71aaa78cc0fd181d431cb130cab1 | [
"MIT"
] | 1 | 2021-08-06T08:32:15.000Z | 2021-08-06T08:32:15.000Z | giantstar/utils/dataParser.py | DaoSen-v/gaintstar | 5ecae8652c9f71aaa78cc0fd181d431cb130cab1 | [
"MIT"
] | null | null | null | giantstar/utils/dataParser.py | DaoSen-v/gaintstar | 5ecae8652c9f71aaa78cc0fd181d431cb130cab1 | [
"MIT"
] | null | null | null | import importlib
import re
from faker import Faker
from requests import Session
from selenium.webdriver.remote.webdriver import WebDriver
from giantstar.utils.error import NoSuchVariableError
from giantstar.utils.extractor import patch_expr
from giantstar.utils.logger import logger
from giantstar.globalSetting import... | 37.583673 | 143 | 0.590465 |
ff6b26131e6622d96a6dfd95aa52a8afedfa0800 | 13,322 | py | Python | tests/test_combustion.py | volpatto/chemicals | 721904ee17604f5e8685b0e5fff12e0bac567f73 | [
"MIT"
] | null | null | null | tests/test_combustion.py | volpatto/chemicals | 721904ee17604f5e8685b0e5fff12e0bac567f73 | [
"MIT"
] | null | null | null | tests/test_combustion.py | volpatto/chemicals | 721904ee17604f5e8685b0e5fff12e0bac567f73 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Chemical Engineering Design Library (ChEDL).
Utilities for process modeling. Copyright (C) 2016, Caleb Bell
<Caleb.Andrew.Bell@gmail.com> Permission is hereby granted, free of charge, to
any person obtaining a copy of this software and associated documentation files
(the "Software"), to deal... | 42.974194 | 149 | 0.630311 |
ff6b2e27f4f3d6f57383aa0f8069d86cc534bc8d | 8,212 | py | Python | custom_components/ble_monitor/ble_parser/ruuvitag.py | avidit/home-assistant-config | c4ea82e7ea75f93ebfb1700b39df5ff9787843b7 | [
"MIT"
] | 383 | 2019-11-25T17:13:04.000Z | 2020-11-12T08:47:35.000Z | custom_components/ble_monitor/ble_parser/ruuvitag.py | scrambledleek/ha_hacs_ble_monitor | abafc7a34312e695667325dbe97c309f20dd1527 | [
"MIT"
] | 142 | 2019-11-25T21:29:27.000Z | 2020-11-12T16:58:01.000Z | custom_components/ble_monitor/ble_parser/ruuvitag.py | scrambledleek/ha_hacs_ble_monitor | abafc7a34312e695667325dbe97c309f20dd1527 | [
"MIT"
] | 65 | 2019-11-26T11:53:44.000Z | 2020-11-11T16:37:52.000Z | # Parser for Ruuvi Tag BLE advertisements
import base64
import logging
import math
from struct import unpack
from .helpers import (
to_mac,
to_unformatted_mac,
)
_LOGGER = logging.getLogger(__name__)
def parse_ruuvitag(self, data, source_mac, rssi):
"""Ruuvitag parser"""
ruuvitag_mac = source_mac
... | 39.104762 | 112 | 0.445933 |
ff6b368cd5d41f6824080fe084193d59e33e673f | 75 | py | Python | go/src/infra/tools/vpython/vpythonsmoketest/testdata/child2/child.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | go/src/infra/tools/vpython/vpythonsmoketest/testdata/child2/child.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | go/src/infra/tools/vpython/vpythonsmoketest/testdata/child2/child.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env vpython
import sys
import six
print "Child2", sys.argv[1]
| 10.714286 | 27 | 0.706667 |
ff6b3e68b6cdbee9783d780635e2b7d016f69e94 | 666 | py | Python | migrations/versions/4ed3e7f53099_new_column.py | Ras-Kwesi/pitch | 296033267cefcbe6cb607e8d61b111088a2f0298 | [
"MIT"
] | null | null | null | migrations/versions/4ed3e7f53099_new_column.py | Ras-Kwesi/pitch | 296033267cefcbe6cb607e8d61b111088a2f0298 | [
"MIT"
] | null | null | null | migrations/versions/4ed3e7f53099_new_column.py | Ras-Kwesi/pitch | 296033267cefcbe6cb607e8d61b111088a2f0298 | [
"MIT"
] | null | null | null | """new column
Revision ID: 4ed3e7f53099
Revises: 63977d6c32c6
Create Date: 2018-09-08 14:42:02.720534
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4ed3e7f53099'
down_revision = '63977d6c32c6'
branch_labels = None
depends_on = None
def upgrade():
# ###... | 22.965517 | 85 | 0.696697 |
ff6b412d48134b965890381176593316374d0873 | 45,540 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 42.049861 | 190 | 0.660277 |
ff6b56c95d9ac7cac8a81ab1ea2522e9442f63fb | 12,189 | py | Python | hummingbot/strategy/uniswap_v3_lp/uniswap_v3_lp.py | subchap/hummingbot | de1ed87977c45a72425bb9708e707230fe117b99 | [
"Apache-2.0"
] | 2 | 2021-06-17T13:09:25.000Z | 2021-06-17T13:09:29.000Z | hummingbot/strategy/uniswap_v3_lp/uniswap_v3_lp.py | petioptrv/hummingbot | 09ed7628acdb358c0bb281d7e5e8a98f7e6d0026 | [
"Apache-2.0"
] | null | null | null | hummingbot/strategy/uniswap_v3_lp/uniswap_v3_lp.py | petioptrv/hummingbot | 09ed7628acdb358c0bb281d7e5e8a98f7e6d0026 | [
"Apache-2.0"
] | null | null | null | from decimal import Decimal
import logging
import asyncio
import pandas as pd
from hummingbot.core.clock import Clock
from hummingbot.logger import HummingbotLogger
from hummingbot.client.performance import PerformanceMetrics
from hummingbot.strategy.market_trading_pair_tuple import MarketTradingPairTuple
from hummingb... | 48.951807 | 143 | 0.592173 |
ff6b59502afbaf2db62f4df2a0ce311500253c34 | 21 | py | Python | O5/_26_kernel_principal_component_analysis/doc.py | ShAlireza/ML-Tries | 4516be7a3275c9bdedd7bd258800be384b6b34f0 | [
"MIT"
] | null | null | null | O5/_26_kernel_principal_component_analysis/doc.py | ShAlireza/ML-Tries | 4516be7a3275c9bdedd7bd258800be384b6b34f0 | [
"MIT"
] | null | null | null | O5/_26_kernel_principal_component_analysis/doc.py | ShAlireza/ML-Tries | 4516be7a3275c9bdedd7bd258800be384b6b34f0 | [
"MIT"
] | null | null | null | """
Page 170
"""
| 5.25 | 12 | 0.333333 |
ff6b6bc76e53b7df592bfb02b8064a669918e149 | 1,157 | py | Python | test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/operations/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/operations/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/azure/version-tolerant/Expected/AcceptanceTests/AzureSpecialsVersionTolerant/azurespecialpropertiesversiontolerant/operations/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 41.321429 | 94 | 0.711322 |
ff6b70e8483cfc57c2da27036906bd26865777de | 2,493 | py | Python | recipes/create_a_basic_drawing.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 18 | 2018-04-19T08:30:48.000Z | 2022-02-14T11:00:27.000Z | recipes/create_a_basic_drawing.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 15 | 2018-04-22T00:52:41.000Z | 2021-07-05T10:16:38.000Z | recipes/create_a_basic_drawing.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 6 | 2018-04-22T00:14:12.000Z | 2021-12-06T01:42:07.000Z | #!/usr/bin/env python
"""
Insert a circle and a lot of lines (a fractal) in a text document.
"""
import os
import sys
import cmath
from math import sqrt
from odfdo import Document, Header, LineShape, EllipseShape, Paragraph
CYCLES = 4 # beware, 5 is big, 6 too big to display...
# some graphic computations
class Ve... | 25.701031 | 81 | 0.57842 |
ff6b89c034b0e50ec948c4f0fbbd54e947d5aa81 | 4,326 | py | Python | oscar/lib/python2.7/site-packages/faker/providers/person/en_TH/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/person/en_TH/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/person/en_TH/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats = (
'{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_name}} {{l... | 52.120482 | 90 | 0.530744 |
ff6b93c12a2ee49d8004cd03b7d46e4793ea6f9f | 7,355 | py | Python | mmseg/models/losses/cross_entropy_loss.py | YvanYin/SegFormer | bb0bbb171195ffcd516243cf2e1f1f4a3a6bef67 | [
"DOC"
] | null | null | null | mmseg/models/losses/cross_entropy_loss.py | YvanYin/SegFormer | bb0bbb171195ffcd516243cf2e1f1f4a3a6bef67 | [
"DOC"
] | null | null | null | mmseg/models/losses/cross_entropy_loss.py | YvanYin/SegFormer | bb0bbb171195ffcd516243cf2e1f1f4a3a6bef67 | [
"DOC"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..builder import LOSSES
from .utils import weight_reduce_loss
def cross_entropy(pred,
label,
weight=None,
class_weight=None,
reduction='mean',
avg_factor=No... | 36.775 | 78 | 0.598368 |
ff6bcbf581e79d0d51c08ada6a4bc848988a1247 | 2,165 | py | Python | tests/tls12/test_tls12_Heartbeat.py | timb-machine-mirrors/tlsmate | 1313161b9170311f466a3a43b3d84797cecc0291 | [
"MIT"
] | null | null | null | tests/tls12/test_tls12_Heartbeat.py | timb-machine-mirrors/tlsmate | 1313161b9170311f466a3a43b3d84797cecc0291 | [
"MIT"
] | null | null | null | tests/tls12/test_tls12_Heartbeat.py | timb-machine-mirrors/tlsmate | 1313161b9170311f466a3a43b3d84797cecc0291 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Implements a class to be used for unit testing.
"""
import pathlib
from tests.cipher_suite_tester import CipherSuiteTester
from tlsmate import tls
from tlsmate import msg
from tlsmate.tlssuite import TlsLibrary
class TestCase(CipherSuiteTester):
"""Class used for tests with pytest.
... | 34.365079 | 83 | 0.670208 |
ff6bd74bb6bca9440a44e194c36bbdea682ef638 | 464 | py | Python | unik/__init__.py | balbasty/unik | 7b8b2a0989495eec7bc0db6c672ce904cbcb1063 | [
"MIT"
] | null | null | null | unik/__init__.py | balbasty/unik | 7b8b2a0989495eec7bc0db6c672ce904cbcb1063 | [
"MIT"
] | null | null | null | unik/__init__.py | balbasty/unik | 7b8b2a0989495eec7bc0db6c672ce904cbcb1063 | [
"MIT"
] | null | null | null | from .alloc import *
from .constants import *
from .controlflow import *
from .debug import *
from .indexing import *
from .magik import *
from .math import *
from .shapes import *
from .types import *
from .various import *
from . import alloc
from . import constants
from . import controlflow
from . import debug
from... | 20.173913 | 26 | 0.75 |
ff6c0f8a58f67be5c730d49abd215af0a7eb2e80 | 356 | py | Python | algorithms/400-499/448. Find All Numbers Disappeared in an Array.py | USTCLink/LeetcodeSolutions | ec64fea0d6cb3c56ad3d7268982be8701786700b | [
"MIT"
] | 3 | 2020-10-28T20:14:30.000Z | 2020-11-03T01:27:04.000Z | algorithms/400-499/448. Find All Numbers Disappeared in an Array.py | USTCLink/LeetcodeSolutions | ec64fea0d6cb3c56ad3d7268982be8701786700b | [
"MIT"
] | null | null | null | algorithms/400-499/448. Find All Numbers Disappeared in an Array.py | USTCLink/LeetcodeSolutions | ec64fea0d6cb3c56ad3d7268982be8701786700b | [
"MIT"
] | null | null | null | class Solution:
def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
res = []
for num in nums:
idx = abs(num) - 1
if nums[idx] > 0:
nums[idx] = -nums[idx]
for i, num in enumerate(nums):
if num > 0:
res.append(i+1)... | 29.666667 | 67 | 0.441011 |
ff6c1156b23a9e67831d1c54b151727e5c5a782f | 616 | py | Python | applications/messenger/fields.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | applications/messenger/fields.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | applications/messenger/fields.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | missive = (
"content_type",
"object_id",
"mode",
"status",
"target",
"last_name",
"first_name",
"denomination",
"backend",
"response",
"subject",
"header_html",
"footer_html",
"html",
"txt",
"msg_id",
"partner_id",
"trace",
"code_error"
)
noti... | 14.666667 | 19 | 0.498377 |
ff6c276332bf91d8f25bc8ddc290f43526e4ba20 | 528 | py | Python | python/insertion-sort/tests/test_insertion_sort.py | RoaaMustafa/data-structures-and-algorithms | 3a756dd5b3feae338eaac28e9229bc37ad6013e2 | [
"MIT"
] | null | null | null | python/insertion-sort/tests/test_insertion_sort.py | RoaaMustafa/data-structures-and-algorithms | 3a756dd5b3feae338eaac28e9229bc37ad6013e2 | [
"MIT"
] | 2 | 2021-08-06T13:44:01.000Z | 2021-08-07T10:18:07.000Z | python/insertion-sort/tests/test_insertion_sort.py | RoaaMustafa/data-structures-and-algorithms | 3a756dd5b3feae338eaac28e9229bc37ad6013e2 | [
"MIT"
] | 1 | 2021-12-06T22:12:31.000Z | 2021-12-06T22:12:31.000Z | from insertion_sort import __version__
from insertion_sort.insertion_sort import *
def test_version():
assert __version__ == '0.1.0'
def test_insertionsort():
arr=[7,8,9,0,4,2]
actual=insertionSort(arr)
expected=[0, 2, 4, 7, 8, 9]
assert expected==actual
def test_edge_insertionsort():
ar... | 16 | 43 | 0.681818 |
ff6c2f47606a62d362eb4b6db2af6341a38ffc95 | 6,156 | py | Python | microbenthos/model/saver.py | achennu/microbenthos | c83fb60d05b5614546466601e973721640e685d4 | [
"MIT"
] | 3 | 2018-04-23T13:51:36.000Z | 2021-08-05T01:53:51.000Z | microbenthos/model/saver.py | achennu/microbenthos | c83fb60d05b5614546466601e973721640e685d4 | [
"MIT"
] | 5 | 2018-04-09T20:08:40.000Z | 2018-05-04T23:08:50.000Z | microbenthos/model/saver.py | achennu/microbenthos | c83fb60d05b5614546466601e973721640e685d4 | [
"MIT"
] | 2 | 2018-04-09T20:11:50.000Z | 2021-08-06T03:34:06.000Z | """
Implements a data saver for model snapshots
"""
import logging
from collections.abc import Mapping
import h5py as hdf
from fipy.tools import numerix as np
def save_snapshot(fpath, snapshot, compression = 6, shuffle = True):
"""
Save a snapshot dictionary of the model to a HDF file
This method prese... | 35.583815 | 100 | 0.595192 |
ff6c3af9170df1260b46183ebcc7ac89a9fabcb1 | 5,103 | py | Python | ray/adaptdl_ray/aws/test_controller_mocked_ray.py | odp/adaptdl | 8a0ad47da91ab4b8f5e13c819cb4701a2ebe8ca8 | [
"Apache-2.0"
] | null | null | null | ray/adaptdl_ray/aws/test_controller_mocked_ray.py | odp/adaptdl | 8a0ad47da91ab4b8f5e13c819cb4701a2ebe8ca8 | [
"Apache-2.0"
] | null | null | null | ray/adaptdl_ray/aws/test_controller_mocked_ray.py | odp/adaptdl | 8a0ad47da91ab4b8f5e13c819cb4701a2ebe8ca8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Petuum, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 29.842105 | 74 | 0.670978 |
ff6c47247c968323f2ecbe8280de880ac1dc365c | 10,796 | py | Python | tensorflow/python/ops/state_ops.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | 1 | 2020-08-27T08:17:15.000Z | 2020-08-27T08:17:15.000Z | tensorflow/python/ops/state_ops.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/state_ops.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | 1 | 2018-06-05T05:02:16.000Z | 2018-06-05T05:02:16.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.52795 | 80 | 0.711004 |
ff6c54f04be94bd154e44f607e53291899007012 | 1,253 | py | Python | rsl_comm_py/examples/example_shearwater_cregs_as_json.py | RedshiftLabsPtyLtd/rsl_comm_py | e53b4e85079898c894dac25842a08bcc303edfbb | [
"MIT"
] | null | null | null | rsl_comm_py/examples/example_shearwater_cregs_as_json.py | RedshiftLabsPtyLtd/rsl_comm_py | e53b4e85079898c894dac25842a08bcc303edfbb | [
"MIT"
] | null | null | null | rsl_comm_py/examples/example_shearwater_cregs_as_json.py | RedshiftLabsPtyLtd/rsl_comm_py | e53b4e85079898c894dac25842a08bcc303edfbb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Author: Dr. Konstantin Selyunin
# License: MIT
# Date: 17 August 2020
import logging
import sys
import json
from pathlib import Path
from rsl_comm_py.shearwater_serial import ShearWaterSerial
if __name__ == '__main__':
logging.basicConfig(
level=logging.WARNING,
format=... | 32.128205 | 86 | 0.679968 |
ff6c5ab859ee4dc7b301b6106c8d751e2d3c1171 | 845 | py | Python | blueprints/apis/topic_ns.py | VMAJSTER/openstreamingplatform | f002246db922dab9a3f019f46001f3901326feaf | [
"MIT"
] | null | null | null | blueprints/apis/topic_ns.py | VMAJSTER/openstreamingplatform | f002246db922dab9a3f019f46001f3901326feaf | [
"MIT"
] | null | null | null | blueprints/apis/topic_ns.py | VMAJSTER/openstreamingplatform | f002246db922dab9a3f019f46001f3901326feaf | [
"MIT"
] | null | null | null | from flask_restplus import Api, Resource, reqparse, Namespace
from classes import topics
from classes.shared import db
api = Namespace('topic', description='Topic Related Queries and Functions')
@api.route('/')
class api_1_ListTopics(Resource):
def get(self):
"""
Returns a List of All Topics... | 29.137931 | 75 | 0.636686 |
ff6c6ee42e41deb0de260c2c9fa099fab81ca76e | 554 | py | Python | tests/components/test_remarks.py | StephenOrJames/aviation-weather | 35594cc1ba448acdea9123380cc47ac96d2107c8 | [
"MIT"
] | 2 | 2017-03-14T23:28:28.000Z | 2020-01-10T23:04:30.000Z | tests/components/test_remarks.py | aviationweather/aviation_weather | 35594cc1ba448acdea9123380cc47ac96d2107c8 | [
"MIT"
] | null | null | null | tests/components/test_remarks.py | aviationweather/aviation_weather | 35594cc1ba448acdea9123380cc47ac96d2107c8 | [
"MIT"
] | null | null | null | import unittest
from aviation_weather import Remarks
from aviation_weather.exceptions import RemarksDecodeError
class TestRemarks(unittest.TestCase):
"""Unit tests for aviation_weather.components.remarks.Remarks"""
def test_valid(self):
s = "RMK AO2 PK WND 14027/1802 SLP183 P0018 T01170106"
r... | 30.777778 | 68 | 0.711191 |
ff6c9a28f53d166bab9795a708c730698766088a | 1,004 | py | Python | tests/test_misc.py | fcortes/django-ninja | c29a5ae298ec22e25f8ee49c7787bd8a311bac78 | [
"MIT"
] | null | null | null | tests/test_misc.py | fcortes/django-ninja | c29a5ae298ec22e25f8ee49c7787bd8a311bac78 | [
"MIT"
] | null | null | null | tests/test_misc.py | fcortes/django-ninja | c29a5ae298ec22e25f8ee49c7787bd8a311bac78 | [
"MIT"
] | null | null | null | import pytest
from pydantic import BaseModel
from ninja import NinjaAPI
from ninja.testing import TestClient
from ninja.signature.details import is_pydantic_model
def test_is_pydantic_model():
class Model(BaseModel):
x: int
assert is_pydantic_model(Model)
assert is_pydantic_model("instance") is F... | 23.904762 | 65 | 0.616534 |
ff6cda07dd390161f27c570a3f62cb052d16948b | 5,153 | py | Python | maths/test_maths.py | murilocamargos/algorithms | 8a51db21efec6c67cabe0666cb36cc8317012aea | [
"MIT"
] | null | null | null | maths/test_maths.py | murilocamargos/algorithms | 8a51db21efec6c67cabe0666cb36cc8317012aea | [
"MIT"
] | null | null | null | maths/test_maths.py | murilocamargos/algorithms | 8a51db21efec6c67cabe0666cb36cc8317012aea | [
"MIT"
] | null | null | null | from base_conversion import int2base,base2int
from extended_gcd import extended_gcd
from gcd import gcd,lcm
from generate_strobogrammtic import gen_strobogrammatic,strobogrammaticInRange
from is_strobogrammatic import is_strobogrammatic,is_strobogrammatic2
from next_perfect_square import find_next_square,find_next_squa... | 26.699482 | 80 | 0.647196 |
ff6ce365d7421b6b0a55317846c1d6d7acb6debe | 8,260 | py | Python | src/nr/powerline/__init__.py | NiklasRosenstein/powerline | c00d94f47df03b5ca6ab7eead1ba47dec2b811f8 | [
"MIT"
] | null | null | null | src/nr/powerline/__init__.py | NiklasRosenstein/powerline | c00d94f47df03b5ca6ab7eead1ba47dec2b811f8 | [
"MIT"
] | 3 | 2021-08-09T01:14:47.000Z | 2021-08-09T01:15:34.000Z | src/nr/powerline/__init__.py | NiklasRosenstein/powerline | c00d94f47df03b5ca6ab7eead1ba47dec2b811f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2020, Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# this software and associated documentation files (the "Software"), to deal in
# Software without restriction, including without limitation the rights to use,... | 32.015504 | 99 | 0.695036 |
ff6d32d14669b33f95a30706b95414d5e354004d | 1,818 | py | Python | sfs/time/soundfield.py | vishwesh-vishwesh/HiWi-job | 8953eb744f6e03191b94869e833b44efe74f7bd8 | [
"MIT"
] | null | null | null | sfs/time/soundfield.py | vishwesh-vishwesh/HiWi-job | 8953eb744f6e03191b94869e833b44efe74f7bd8 | [
"MIT"
] | null | null | null | sfs/time/soundfield.py | vishwesh-vishwesh/HiWi-job | 8953eb744f6e03191b94869e833b44efe74f7bd8 | [
"MIT"
] | null | null | null | """Compute sound field."""
from __future__ import division
from .. import util
from .. import defs
from .source import point
def p_array(x0, signals, weights, observation_time, grid, source=point,
c=None):
"""Compute sound field for an array of secondary sources.
Parameters
----------
x0... | 31.894737 | 71 | 0.635864 |
ff6d58e3a98cdf87fa8354053be991f280a241be | 44,948 | py | Python | contrib/tools/cython/Cython/Debugger/libcython.py | r1nadeg/04_catboost | 6755bbbd1496540b92ded57eea1974f64bef87c5 | [
"Apache-2.0"
] | 8 | 2017-12-29T19:17:16.000Z | 2021-02-09T20:39:06.000Z | Cython/Debugger/libcython.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 2 | 2019-08-14T06:21:15.000Z | 2020-10-29T19:54:56.000Z | Cython/Debugger/libcython.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 4 | 2018-03-02T10:54:29.000Z | 2020-06-24T04:50:43.000Z | """
GDB extension that adds Cython support.
"""
from __future__ import print_function
try:
input = raw_input
except NameError:
pass
import sys
import textwrap
import traceback
import functools
import itertools
import collections
import gdb
try: # python 2
UNICODE = unicode
BYTES = str
except NameE... | 31.322648 | 89 | 0.590482 |
ff6d679b6888b7abb87512c881ae7ed55b8f4d23 | 447 | py | Python | tests/urls.py | d1g1tinc/drf-haystack | 7bf138948562ebcf3470954a4627dc12f6b09b96 | [
"MIT"
] | null | null | null | tests/urls.py | d1g1tinc/drf-haystack | 7bf138948562ebcf3470954a4627dc12f6b09b96 | [
"MIT"
] | null | null | null | tests/urls.py | d1g1tinc/drf-haystack | 7bf138948562ebcf3470954a4627dc12f6b09b96 | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from rest_framework import routers
from tests.mockapp.views import SearchPersonFacetViewSet, SearchPersonMLTViewSet
router = routers.DefaultRouter()
router.register("search-person-facet", viewset=SearchPersonFacetViewSet, basename="search-person-facet")
router.register("sear... | 37.25 | 104 | 0.814318 |
ff6d86c34ef0aa96ba7f3ba44ed4df411f28b000 | 3,262 | py | Python | tastypie_api/paginator.py | padeny/tastypie_api | 696a17535d921fabe35d693565684803d39c451a | [
"MIT"
] | 2 | 2019-07-10T12:09:25.000Z | 2019-07-10T12:09:26.000Z | tastypie_api/paginator.py | padeny/tastypie_api | 696a17535d921fabe35d693565684803d39c451a | [
"MIT"
] | 4 | 2020-06-05T21:24:48.000Z | 2021-11-08T00:57:37.000Z | tastypie_api/paginator.py | padeny/tastypie_api | 696a17535d921fabe35d693565684803d39c451a | [
"MIT"
] | null | null | null | from django.utils import six
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from tastypie.paginator import Paginator as t_Paginator
from tastypie_api.exceptions import DataFormatError
class Paginator(t_Paginator):
def get_page_num(self):
"""
It ... | 33.979167 | 119 | 0.601471 |
ff6dc621c81bf0f4b002546cfac6d8979cdfbd0a | 28,770 | py | Python | pywick/models/classification/resnext_features/resnext101_64x4d_features.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | 2 | 2020-11-28T07:56:09.000Z | 2021-11-08T09:30:39.000Z | pywick/models/classification/resnext_features/resnext101_64x4d_features.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | null | null | null | pywick/models/classification/resnext_features/resnext101_64x4d_features.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | null | null | null | # Source: https://github.com/Cadene/pretrained-models.pytorch/blob/master/pretrainedmodels/models/resnext_features/resnext101_64x4d_features.py
from __future__ import print_function, division, absolute_import
import torch.nn as nn
from functools import reduce
class LambdaBase(nn.Sequential):
def __init__(self, *a... | 41.217765 | 143 | 0.37772 |
ff6dcb8c73459b16167e8ca55eee4d3af6a0fb68 | 2,332 | py | Python | data/imagenet_data.py | bobenxia/Centripetal-SGD | e33350464504085a641a2a969d3c06e3d5cc4765 | [
"Apache-2.0"
] | 35 | 2019-10-08T15:14:33.000Z | 2021-12-15T08:28:39.000Z | data/imagenet_data.py | bobenxia/Centripetal-SGD | e33350464504085a641a2a969d3c06e3d5cc4765 | [
"Apache-2.0"
] | 7 | 2019-10-16T12:44:21.000Z | 2021-08-17T09:09:06.000Z | data/imagenet_data.py | bobenxia/Centripetal-SGD | e33350464504085a641a2a969d3c06e3d5cc4765 | [
"Apache-2.0"
] | 11 | 2019-09-29T01:14:29.000Z | 2022-02-14T09:46:19.000Z | import torch
import torchvision.transforms as transforms
from data.dataset_util import DataIterator
import os
import torchvision.datasets as datasets
IMGNET_TRAIN_DIR = 'imagenet_data'
class ImgnetStdTrainData(object):
def __init__(self, distributed, batch_size_per_gpu, img_size=224):
normalize = transfo... | 36.4375 | 123 | 0.584906 |
ff6df639529e9606eb8e67feb550a665e98791f7 | 2,299 | py | Python | world_export/blender_file.py | drewp/megasecond | 13cd93e356b426e093135bf8402efec513e2fa46 | [
"CC-BY-4.0"
] | 2 | 2021-01-02T19:38:05.000Z | 2021-04-06T07:51:27.000Z | world_export/blender_file.py | jeremy-coleman/megasecond | 0ba6b453c1b35fcd7b33256ccd07ca7d0615dc39 | [
"CC-BY-4.0"
] | null | null | null | world_export/blender_file.py | jeremy-coleman/megasecond | 0ba6b453c1b35fcd7b33256ccd07ca7d0615dc39 | [
"CC-BY-4.0"
] | 1 | 2021-04-06T07:51:35.000Z | 2021-04-06T07:51:35.000Z | import logging
import os
from pathlib import Path
import bpy
from selection import select_object
log = logging.getLogger()
def saveScene(out: Path):
out.parent.mkdir(parents=True, exist_ok=True)
bpy.context.preferences.filepaths.save_version = 0
bpy.ops.wm.save_as_mainfile(filepath=str(out))
def writ... | 32.842857 | 171 | 0.69552 |
ff6e13bcb0d4655cf348e52f5c4bec554777688e | 1,759 | py | Python | Weeder_Reader.py | lilymaryam/UC_Davis_iGEM | a3f8e6803cdd1e2424b3fe01364a93f08d41803d | [
"MIT"
] | null | null | null | Weeder_Reader.py | lilymaryam/UC_Davis_iGEM | a3f8e6803cdd1e2424b3fe01364a93f08d41803d | [
"MIT"
] | null | null | null | Weeder_Reader.py | lilymaryam/UC_Davis_iGEM | a3f8e6803cdd1e2424b3fe01364a93f08d41803d | [
"MIT"
] | null | null | null |
import os
import argparse
## Makes arguments to input into speed_weeder
parser = argparse.ArgumentParser(
description='Runs weeder on fasta file and reports results.')
parser.add_argument('--fasta', required=True, type=str,
metavar='<str>', help='fasta file of promoters')
parser.add_argument('--freq', required=Tru... | 25.128571 | 101 | 0.553724 |
ff6e145912ec313cd5e73d156897fdb351805ec7 | 11,570 | py | Python | tracker/view/edit.py | remyoudompheng/arch-security-tracker | 8451b618d74c9b322e163da5444452f25f0585cc | [
"MIT"
] | null | null | null | tracker/view/edit.py | remyoudompheng/arch-security-tracker | 8451b618d74c9b322e163da5444452f25f0585cc | [
"MIT"
] | null | null | null | tracker/view/edit.py | remyoudompheng/arch-security-tracker | 8451b618d74c9b322e163da5444452f25f0585cc | [
"MIT"
] | null | null | null | from collections import defaultdict
from itertools import chain
from flask import flash
from flask import redirect
from flask import render_template
from sqlalchemy import func
from tracker import db
from tracker import tracker
from tracker.advisory import advisory_extend_model_from_advisory_text
from tracker.advisor... | 44.5 | 141 | 0.686344 |
ff6e217285bb1f7a2e32ec350afb7fdad962a63d | 9,753 | py | Python | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_trigger_runs_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_trigger_runs_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_trigger_runs_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 41.679487 | 221 | 0.670665 |
ff6e83cea67d57f8ac4ca57cc7e60615630fd0c0 | 16,601 | py | Python | common/plots.py | kbardool/CarND-Advanced-Lane-Lines | 2c3a0b4c1623c4e303b3833c166627a56c260d71 | [
"MIT"
] | null | null | null | common/plots.py | kbardool/CarND-Advanced-Lane-Lines | 2c3a0b4c1623c4e303b3833c166627a56c260d71 | [
"MIT"
] | null | null | null | common/plots.py | kbardool/CarND-Advanced-Lane-Lines | 2c3a0b4c1623c4e303b3833c166627a56c260d71 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
def plot_1(pl, legend = 'best', size=(15,7)):
plt.figure(figsize=size)
ax = plt.gca()
min_x = min(pl.imgUndistStats['RGB'])
max_x = max(pl.imgUndistStats['RGB'])
len_x = len(pl.imgUndistStats['RGB'])
# ax.plot(... | 60.148551 | 141 | 0.633094 |
ff6e998e59366bfa759865a72688c75bfbdde249 | 39 | py | Python | pelican/plugins/nginx_alias_map/__init__.py | gaige/nginx_alias_map | 403ec282d98811e085c9769a6973999d8239d817 | [
"MIT"
] | null | null | null | pelican/plugins/nginx_alias_map/__init__.py | gaige/nginx_alias_map | 403ec282d98811e085c9769a6973999d8239d817 | [
"MIT"
] | 1 | 2022-03-29T13:22:58.000Z | 2022-03-29T13:22:58.000Z | pelican/plugins/nginx_alias_map/__init__.py | gaige/nginx_alias_map | 403ec282d98811e085c9769a6973999d8239d817 | [
"MIT"
] | null | null | null | from .nginx_alias_map import * # NOQA
| 19.5 | 38 | 0.74359 |
ff6ea11141e54b7fffd4fb965806bbc8df3f9c4c | 16,615 | py | Python | src/gp_build.py | QianWanghhu/predict_uq | 9d2e9c0a9cddef901ef89985497fa94eb36c4c03 | [
"MIT"
] | null | null | null | src/gp_build.py | QianWanghhu/predict_uq | 9d2e9c0a9cddef901ef89985497fa94eb36c4c03 | [
"MIT"
] | null | null | null | src/gp_build.py | QianWanghhu/predict_uq | 9d2e9c0a9cddef901ef89985497fa94eb36c4c03 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from multiprocessing import Pool
import numpy as np
import os
import matplotlib.pyplot as plt
from functools import partial
import copy
import pandas as pd
import pickle
from scipy import stats
# from scipy.optimize import root
from scipy.optimize import bisect
from sklearn.gaussian_process.kern... | 38.820093 | 129 | 0.64845 |
ff6ef718ae2263cad16db57f89924a8b2c14d444 | 635 | py | Python | utils/rearrange.py | TimS70/WebET_Analysis | 32fc2e1b70c2dad5637ee1614a6a651bc8d458b4 | [
"MIT"
] | null | null | null | utils/rearrange.py | TimS70/WebET_Analysis | 32fc2e1b70c2dad5637ee1614a6a651bc8d458b4 | [
"MIT"
] | null | null | null | utils/rearrange.py | TimS70/WebET_Analysis | 32fc2e1b70c2dad5637ee1614a6a651bc8d458b4 | [
"MIT"
] | null | null | null | import numpy as np
def pivot_outcome_by_factor(data, factor, outcome):
if len(data) > len(data['run_id'].unique()):
outcomes_by_factor = data.groupby(
['run_id', factor],
as_index=False)[outcome].mean()
else:
outcomes_by_factor = data[
np.append(['run_id', f... | 31.75 | 67 | 0.535433 |
ff6f1eb77e7f5c8c4a69240177abb32af0f34355 | 2,061 | py | Python | pre_commit/staged_files_only.py | bukzor/pre-commit | 7d546c1f815a41f17af276e2f8d0636efdd87a6d | [
"MIT"
] | null | null | null | pre_commit/staged_files_only.py | bukzor/pre-commit | 7d546c1f815a41f17af276e2f8d0636efdd87a6d | [
"MIT"
] | null | null | null | pre_commit/staged_files_only.py | bukzor/pre-commit | 7d546c1f815a41f17af276e2f8d0636efdd87a6d | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import contextlib
import io
import logging
import time
from pre_commit.prefixed_command_runner import CalledProcessError
logger = logging.getLogger('pre_commit')
@contextlib.contextmanager
def staged_files_only(cmd_runner):
"""Clear any unstaged changes from the git wor... | 33.786885 | 77 | 0.600679 |
ff6f2eaa5556597d8504634356eb2c1177b37e2b | 27,563 | py | Python | vision_transform_codes/utils/image_processing.py | spencerkent/vision-transform-codes | 63258ce698e436ee3ce29def75c89337759fb98b | [
"BSD-3-Clause"
] | null | null | null | vision_transform_codes/utils/image_processing.py | spencerkent/vision-transform-codes | 63258ce698e436ee3ce29def75c89337759fb98b | [
"BSD-3-Clause"
] | null | null | null | vision_transform_codes/utils/image_processing.py | spencerkent/vision-transform-codes | 63258ce698e436ee3ce29def75c89337759fb98b | [
"BSD-3-Clause"
] | null | null | null | """
Some utilities for wrangling image data.
These may be relevant for implementing sparse coding or other transform coding
strategies on images. Just leaving a few relevant references:
.. [1] Olshausen, B. A., & Field, D. J. (1997). Sparse coding with an
overcomplete basis set: A strategy employed by V1?. Vis... | 39.375714 | 82 | 0.696151 |
ff6f2fc327d2cf0828f691370d03c604babeda26 | 1,306 | py | Python | tests/integration/states/rabbitmq_vhost.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | tests/integration/states/rabbitmq_vhost.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | tests/integration/states/rabbitmq_vhost.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | 3 | 2020-05-10T02:08:44.000Z | 2020-11-06T11:01:57.000Z | '''
Tests for the rabbitmq state
'''
# Import python libs
import os
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import bonneville libs
import integration
class RabbitVHostTestCase(integration.ModuleCase,
integration.SaltReturn... | 25.115385 | 77 | 0.633997 |
ff6f422915f1712840e4115783c5f0e0bf54f717 | 1,303 | py | Python | igibson/test/test_render_tensor.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 360 | 2020-04-02T11:12:09.000Z | 2022-03-24T21:46:58.000Z | igibson/test/test_render_tensor.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 169 | 2020-04-07T21:01:05.000Z | 2022-03-31T10:07:39.000Z | igibson/test/test_render_tensor.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 94 | 2020-04-09T23:22:17.000Z | 2022-03-17T21:49:03.000Z | import os
import numpy as np
import igibson
from igibson.render.mesh_renderer.mesh_renderer_settings import MeshRendererSettings
from igibson.render.mesh_renderer.mesh_renderer_tensor import MeshRendererG2G
def test_tensor_render_rendering():
w = 800
h = 600
setting = MeshRendererSettings(enable_pbr=Fal... | 32.575 | 97 | 0.677667 |
ff6f48c5911b1b89384b16c9f20fd36421d20321 | 1,074 | py | Python | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 35.8 | 94 | 0.690875 |
ff6f58f26b18d1504500747ee470f544425ecf53 | 15,715 | py | Python | main.py | RunpeiDong/DGMS | 1f6a7ca9f39a2bc31cfade1e45967b006ea6532d | [
"Apache-2.0"
] | 2 | 2022-01-03T05:25:01.000Z | 2022-01-06T23:08:50.000Z | main.py | RunpeiDong/DGMS | 1f6a7ca9f39a2bc31cfade1e45967b006ea6532d | [
"Apache-2.0"
] | null | null | null | main.py | RunpeiDong/DGMS | 1f6a7ca9f39a2bc31cfade1e45967b006ea6532d | [
"Apache-2.0"
] | 1 | 2022-02-28T01:13:30.000Z | 2022-02-28T01:13:30.000Z | # Copyright (c) Runpei Dong, ArChip Lab.
# This source code is licensed under the Apache 2.0 license found in the
# LICENSE file in the root directory of this source tree.
import torch
import argparse
import time
import os
import sys
import math
import torch.nn as nn
import config as cfg
from tqdm import tqdm
from ... | 45.950292 | 195 | 0.595418 |
ff6f648a76751cf46bbb4ade78eed4edc6ae76d7 | 278 | py | Python | json2ber2json/__init__.py | uptane/asn1 | dd6996217a952ec4172398065f5ab085c63981df | [
"MIT"
] | 2 | 2016-09-22T23:27:56.000Z | 2018-12-21T12:08:06.000Z | json2ber2json/__init__.py | uptane/asn1 | dd6996217a952ec4172398065f5ab085c63981df | [
"MIT"
] | 8 | 2016-09-22T22:01:43.000Z | 2016-12-26T21:43:49.000Z | json2ber2json/__init__.py | uptane/asn1 | dd6996217a952ec4172398065f5ab085c63981df | [
"MIT"
] | 1 | 2018-04-16T21:58:37.000Z | 2018-04-16T21:58:37.000Z | __all__ = ['applicationmetadata', 'applicationmodule', 'bootloadermetadata',
'bootloadermodule', 'metadataverificationmodule', 'rootmetadata',
'snapshotmetadata', 'targetsmetadata', 'timeservermetadata',
'timeservermodule', 'timestampmetadata']
| 55.6 | 76 | 0.708633 |
ff6f6d6a8261d6b74ef8c80efceda0dcbc386bd0 | 5,283 | py | Python | tests/conftest.py | admdev8/broccolini | ed66e923235f1083bd57ecd7d5e4807c1fc16ed6 | [
"MIT"
] | 1 | 2020-11-20T15:31:44.000Z | 2020-11-20T15:31:44.000Z | tests/conftest.py | admdev8/broccolini | ed66e923235f1083bd57ecd7d5e4807c1fc16ed6 | [
"MIT"
] | 93 | 2021-01-01T03:08:41.000Z | 2022-03-01T03:06:56.000Z | tests/conftest.py | m4ta1l/broccolini | ed66e923235f1083bd57ecd7d5e4807c1fc16ed6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Provide non secret data here for all tests.
Give data in various forms to the test functions.
"""
import random
import shortuuid
import pytest
from faker import Faker
@pytest.fixture(scope="session")
def return_random_uuid():
"""Provide random values."""
retu... | 38.282609 | 120 | 0.699981 |
ff6f72664978287cba2ca21b5b18c9f3f501dadc | 8,256 | py | Python | testing/old_tests/full_idid.py | kuanhanl/cappresse | 31cd7d03414a930f7e2c21e1a3eb5e7dd25cc500 | [
"MIT"
] | 2 | 2019-09-26T20:56:06.000Z | 2019-11-18T21:03:27.000Z | testing/old_tests/full_idid.py | kuanhanl/cappresse | 31cd7d03414a930f7e2c21e1a3eb5e7dd25cc500 | [
"MIT"
] | 6 | 2018-03-19T20:36:49.000Z | 2018-04-13T15:27:29.000Z | testing/old_tests/full_idid.py | kuanhanl/cappresse | 31cd7d03414a930f7e2c21e1a3eb5e7dd25cc500 | [
"MIT"
] | 5 | 2018-10-04T18:51:02.000Z | 2020-07-02T15:31:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
from nmpc_mhe.dync.MHEGenv2 import MheGen
from sample_mods.bfb.nob5_hi_t import bfb_dae
import itertools, sys
"""Testing the new preparation phases with ideal strategies"""
def main():
u_weight = 1E... | 38.4 | 118 | 0.561289 |
ff6f769047b650946afa7e28c87234c318a025a9 | 1,141 | py | Python | src/journalabbrev_cli/common.py | alexreg/journal-abbrev | e980b4c96668f610d1a35e816474c094eb563034 | [
"BSD-3-Clause"
] | null | null | null | src/journalabbrev_cli/common.py | alexreg/journal-abbrev | e980b4c96668f610d1a35e816474c094eb563034 | [
"BSD-3-Clause"
] | null | null | null | src/journalabbrev_cli/common.py | alexreg/journal-abbrev | e980b4c96668f610d1a35e816474c094eb563034 | [
"BSD-3-Clause"
] | null | null | null | import sys
from typing import *
from progressbar.bar import ProgressBar
from progressbar.widgets import WidgetBase
class FatalError(Exception):
def __init__(self, exit_status: int = 1) -> None:
super().__init__()
self.exit_status = exit_status
def error(message: str) -> None:
print("ERROR: " + message, file ... | 26.534884 | 112 | 0.697634 |
ff6fb5690ca3f0be3b7b475479136c5f47e16909 | 173 | py | Python | mkconfig/core/error.py | mcfongtw/MkConfig | 2015ad46352a1c7b42b510369f410e98c52df53b | [
"MIT"
] | 1 | 2016-11-29T13:41:21.000Z | 2016-11-29T13:41:21.000Z | mkconfig/core/error.py | mcfongtw/MkConfig | 2015ad46352a1c7b42b510369f410e98c52df53b | [
"MIT"
] | null | null | null | mkconfig/core/error.py | mcfongtw/MkConfig | 2015ad46352a1c7b42b510369f410e98c52df53b | [
"MIT"
] | null | null | null |
class IllegalStateException(Exception):
"""
An error when program enter an unexpected state
"""
def __init__(self, message):
self.message = message | 21.625 | 51 | 0.66474 |
ff6fb8019d1a6669ddbd32d4b68308cba7894b20 | 228 | py | Python | runserver.py | dedupeio/dedupe-geocoder | ed1506a36e1a153737adab51144911cbd3ab3112 | [
"MIT"
] | 9 | 2017-06-20T15:05:23.000Z | 2021-09-26T02:45:24.000Z | runserver.py | dedupeio/dedupe-geocoder | ed1506a36e1a153737adab51144911cbd3ab3112 | [
"MIT"
] | 1 | 2018-06-21T21:45:46.000Z | 2018-06-21T22:06:03.000Z | runserver.py | dedupeio/dedupe-geocoder | ed1506a36e1a153737adab51144911cbd3ab3112 | [
"MIT"
] | 4 | 2017-09-26T14:57:45.000Z | 2021-09-26T01:45:32.000Z | from geocoder import create_app
app = create_app()
if __name__ == "__main__":
import sys
try:
port = int(sys.argv[1])
except (IndexError, ValueError):
port = 5000
app.run(debug=True, port=port)
| 19 | 36 | 0.627193 |
ff6fcc0a58ed321ca99604158b2cf643d6bc1d63 | 1,462 | py | Python | do_aramco_sz.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | do_aramco_sz.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | do_aramco_sz.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | 1 | 2022-02-11T23:22:41.000Z | 2022-02-11T23:22:41.000Z | import os
import numpy as np
datafolder="/home/jliu447/lossycompression/aramco"
ebs=[i*1e-4 for i in range(1,10)]+[i*1e-3 for i in range(1,10)]+[i*1e-2 for i in range(1,11)]
cr=np.zeros((29,51),dtype=np.float32)
psnr=np.zeros((29,51),dtype=np.float32)
filelist=os.listdir(datafolder)
filelist=[x for x in filelist if... | 31.782609 | 93 | 0.55472 |
ff6fd25f2206beecbe7053f50c6fb4bf0bd3c699 | 20,475 | py | Python | lib/rucio/core/lock.py | elichad/rucio | 0705e4124e18c853c4661f85e00238cb0c6bd750 | [
"Apache-2.0"
] | null | null | null | lib/rucio/core/lock.py | elichad/rucio | 0705e4124e18c853c4661f85e00238cb0c6bd750 | [
"Apache-2.0"
] | null | null | null | lib/rucio/core/lock.py | elichad/rucio | 0705e4124e18c853c4661f85e00238cb0c6bd750 | [
"Apache-2.0"
] | 1 | 2020-01-30T11:03:53.000Z | 2020-01-30T11:03:53.000Z | # Copyright European Organization for Nuclear Research (CERN)
#
# 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
#
# Authors:
# - Martin Barisits, <m... | 46.961009 | 170 | 0.616654 |
ff702a0fade3e4f893b64b961fc2d8af3bec52a8 | 8,757 | py | Python | cogs/faq.py | SuperYellowSystem/FactorioQuizzBot | 55dfea657c64dd9d92bfa9657de66159cc7e79e9 | [
"MIT"
] | 1 | 2018-04-08T16:47:02.000Z | 2018-04-08T16:47:02.000Z | cogs/faq.py | SuperYellowSystem/FactorioQuizBot | 55dfea657c64dd9d92bfa9657de66159cc7e79e9 | [
"MIT"
] | null | null | null | cogs/faq.py | SuperYellowSystem/FactorioQuizBot | 55dfea657c64dd9d92bfa9657de66159cc7e79e9 | [
"MIT"
] | null | null | null | import datetime
import discord
from discord.ext import commands as cmds
from fuzzywuzzy import fuzz
from cogs.utils import checks
import logging
logger = logging.getLogger(__name__)
class FAQCog:
def __init__(self, bot):
self.bot = bot
type(self).__name__ = "Frequently Asked Questions"
def ... | 42.509709 | 119 | 0.500285 |
ff70328a08a7321c3af072064ff702fe12ae96a9 | 5,895 | py | Python | src/test/tinc/tincrepo/mpp/gpdb/tests/package/contrib/pgcrypto/functional/test_functional_pgcrypto.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | src/test/tinc/tincrepo/mpp/gpdb/tests/package/contrib/pgcrypto/functional/test_functional_pgcrypto.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 6 | 2018-08-04T07:51:37.000Z | 2018-11-26T07:09:44.000Z | src/test/tinc/tincrepo/mpp/gpdb/tests/package/contrib/pgcrypto/functional/test_functional_pgcrypto.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | 66.235955 | 172 | 0.754538 |
ff703b4d48474500da7475f168aed80f4b2d6610 | 682 | py | Python | main.py | tippesi/Python-Audio | 2311723e544a9e34dc33b888b07778efe849e46e | [
"BSD-3-Clause"
] | 1 | 2019-04-01T13:26:50.000Z | 2019-04-01T13:26:50.000Z | main.py | tippesi/Python-Audio | 2311723e544a9e34dc33b888b07778efe849e46e | [
"BSD-3-Clause"
] | null | null | null | main.py | tippesi/Python-Audio | 2311723e544a9e34dc33b888b07778efe849e46e | [
"BSD-3-Clause"
] | null | null | null | from audio import Audio
from postprocessing.volume_postprocessing import VolumePostprocessing
from postprocessing.channel_sine_postprocessing import ChannelSinePostprocessing
import pyaudio
paudio = pyaudio.PyAudio()
audio = Audio("MenuTheme2_final.wav", 2048, paudio)
# Append postprocessing effects
# audio.postproc... | 31 | 80 | 0.818182 |
ff705433dd4c02d2cac5704d54e07b75158573e6 | 1,783 | py | Python | 2021_python/01/tsp.py | pantadeusz/meh | 16d2826330c9bfdb4c7a315f2f69ec33b464541d | [
"MIT"
] | null | null | null | 2021_python/01/tsp.py | pantadeusz/meh | 16d2826330c9bfdb4c7a315f2f69ec33b464541d | [
"MIT"
] | 1 | 2019-10-18T07:14:26.000Z | 2019-10-18T18:54:26.000Z | 2021_python/01/tsp.py | pantadeusz/meh | 16d2826330c9bfdb4c7a315f2f69ec33b464541d | [
"MIT"
] | 2 | 2019-10-24T08:50:00.000Z | 2020-03-29T06:10:20.000Z | import math
import itertools
import random
# def. problemu
# def. rozwiazania - dziedzina funkcji
# f. celu
def goalFunction (solution, problem):
'''naturalna reprezentacja rozwiazania - lista kolejnych miast do odwiedzenia'''
sum = 0
for i in range(0,len(solution)):
p0 = problem[solution[i]]
... | 27.015152 | 106 | 0.625911 |
ff705fc54bf5ddb61b4a20c07c6b361bb45512db | 1,792 | py | Python | main.py | tylwright/PySystemsManager | 0f424b857fdbff381fb0463b6ee00570f336b380 | [
"MIT"
] | 1 | 2016-01-14T02:58:20.000Z | 2016-01-14T02:58:20.000Z | main.py | tylwright/PySystemsManager | 0f424b857fdbff381fb0463b6ee00570f336b380 | [
"MIT"
] | null | null | null | main.py | tylwright/PySystemsManager | 0f424b857fdbff381fb0463b6ee00570f336b380 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Tyler Wright
from PySystemsManager_functions import *
def mainMenu():
"""
;Description - Prints the main menu and awaits users choice.
"""
# Setting initial choice value
choice = "1111"
while choice != "q":
clearScreen()
print "\n=============================="
print "=======PySyst... | 24.888889 | 71 | 0.59096 |
ff70648a38033a2637cde44a620bea93e9b6285c | 1,524 | py | Python | src/transformers/source_selector.py | niall-twomey/har_datasets | 68f142ba613ce26f67cdd6b871117f4c24ea603f | [
"MIT"
] | 24 | 2018-12-12T08:54:52.000Z | 2021-12-07T08:45:13.000Z | src/transformers/source_selector.py | niall-twomey/har_datasets | 68f142ba613ce26f67cdd6b871117f4c24ea603f | [
"MIT"
] | 3 | 2019-07-18T20:14:41.000Z | 2022-03-12T01:03:28.000Z | src/transformers/source_selector.py | niall-twomey/har_datasets | 68f142ba613ce26f67cdd6b871117f4c24ea603f | [
"MIT"
] | 9 | 2018-12-12T16:18:39.000Z | 2022-03-30T16:25:47.000Z | from loguru import logger
from numpy import concatenate
from src.base import get_ancestral_metadata
from src.keys import Key
__all__ = [
"source_selector",
]
def do_select_feats(**nodes):
keys = sorted(nodes.keys())
return concatenate([nodes[key] for key in keys], axis=1)
def source_selector(parent, m... | 31.75 | 104 | 0.664698 |
ff70737b4804a9870d60be7c6cfdebc6b092d25d | 3,639 | py | Python | animator/base.py | shashi278/AndroidView | d2e930552a822d79fbf3796e79bd9957fd03a27c | [
"MIT"
] | 5 | 2020-01-22T13:08:37.000Z | 2021-07-20T06:07:45.000Z | animator/base.py | shashi278/AndroidView | d2e930552a822d79fbf3796e79bd9957fd03a27c | [
"MIT"
] | null | null | null | animator/base.py | shashi278/AndroidView | d2e930552a822d79fbf3796e79bd9957fd03a27c | [
"MIT"
] | 1 | 2019-09-05T02:51:23.000Z | 2019-09-05T02:51:23.000Z | """
MIT License
Copyright (c) 2019 Shashi Ranjan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... | 33.694444 | 78 | 0.670789 |
ff70751f4e22f1ac1d3cfd771886b30b5692a7c4 | 16,134 | py | Python | dpkt/pcap.py | vinjn/net-doctor | 02c6271c13593a21becba760db23b1c0ca34158c | [
"MIT"
] | 1 | 2017-08-13T13:20:11.000Z | 2017-08-13T13:20:11.000Z | dpkt/pcap.py | vinjn/net-doctor | 02c6271c13593a21becba760db23b1c0ca34158c | [
"MIT"
] | null | null | null | dpkt/pcap.py | vinjn/net-doctor | 02c6271c13593a21becba760db23b1c0ca34158c | [
"MIT"
] | null | null | null | # $Id: pcap.py 77 2011-01-06 15:59:38Z dugsong $
# -*- coding: utf-8 -*-
"""Libpcap file format."""
from __future__ import print_function
from __future__ import absolute_import
import sys
import time
from decimal import Decimal
from . import dpkt
from .compat import intround
TCPDUMP_MAGIC = 0xa1b2c3d4
TCPDUMP_MAGIC_... | 26.44918 | 108 | 0.612371 |
ff70af6975dc099ffc02446bc3e7c3370d89ff5f | 2,833 | py | Python | atlas/gspread/urls.py | PanDAWMS/panda-bigmon-atlas | a3688b9ed722a15c0469c8bee84cc9a417670608 | [
"Apache-2.0"
] | null | null | null | atlas/gspread/urls.py | PanDAWMS/panda-bigmon-atlas | a3688b9ed722a15c0469c8bee84cc9a417670608 | [
"Apache-2.0"
] | 15 | 2015-01-06T13:41:52.000Z | 2022-03-30T10:37:25.000Z | atlas/gspread/urls.py | PanDAWMS/panda-bigmon-atlas | a3688b9ed722a15c0469c8bee84cc9a417670608 | [
"Apache-2.0"
] | 1 | 2017-07-20T08:01:24.000Z | 2017-07-20T08:01:24.000Z | # -*- coding: utf-8 -*-
"""
gspread.urls
~~~~~~~~~~~~
This module is Google API url patterns storage.
"""
import re
from atlas.gspread.exceptions import UnsupportedFeedTypeError, UrlParameterMissing
SPREADSHEETS_SERVER = 'spreadsheets.google.com'
SPREADSHEETS_FEED_URL = 'https://%s/%s/' % (SPREADSHEETS_SERVER, '... | 31.831461 | 109 | 0.635369 |
ff70be233717bff702c61969ee77f1700de40898 | 3,972 | py | Python | thirdparty/nsiqcppstyle/rules/RULE_3_3_A_start_function_name_with_upperrcase_windows.py | cfsengineering/tigl | abfbb57b82dc6beac7cde212a4cd5e0aed866db8 | [
"Apache-2.0"
] | 171 | 2015-04-13T11:24:34.000Z | 2022-03-26T00:56:38.000Z | thirdparty/nsiqcppstyle/rules/RULE_3_3_A_start_function_name_with_upperrcase_windows.py | cfsengineering/tigl | abfbb57b82dc6beac7cde212a4cd5e0aed866db8 | [
"Apache-2.0"
] | 620 | 2015-01-20T08:34:36.000Z | 2022-03-30T11:05:33.000Z | thirdparty/nsiqcppstyle/rules/RULE_3_3_A_start_function_name_with_upperrcase_windows.py | cfsengineering/tigl | abfbb57b82dc6beac7cde212a4cd5e0aed866db8 | [
"Apache-2.0"
] | 56 | 2015-02-09T13:33:56.000Z | 2022-03-19T04:52:51.000Z | """
Start the function name with a upper case letter.
It's rule for only Window C/C++ code.
== Violation ==
bool checkSth() <== Violation. The function name starts with a lowercase 'c'.
{
return false;
}
bool _checkSth() <== Violation. The function name starts with a lowercase 'c'.
... | 21.586957 | 121 | 0.554884 |
ff70bf8f305a77f2696f127c8231259580f14e4b | 76,127 | py | Python | sdk/storage/azure-storage-blob/tests/test_block_blob_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/storage/azure-storage-blob/tests/test_block_blob_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-blob/tests/test_block_blob_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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.
# --------------------------------------------------------------------... | 45.639688 | 154 | 0.691529 |
ff70c948778bfb1cff91ac086d1958c968be1c44 | 50,329 | py | Python | selim_sef/data_tools/osmnx_funcs.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 27 | 2020-03-04T05:54:48.000Z | 2022-01-05T07:07:44.000Z | selim_sef/data_tools/osmnx_funcs.py | CosmiQ/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 1 | 2020-07-14T10:35:50.000Z | 2020-07-14T10:35:50.000Z | selim_sef/data_tools/osmnx_funcs.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 7 | 2020-03-07T21:42:57.000Z | 2022-01-07T10:49:50.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Code from the osmnx v0.9 package.
"""
import time
import math
import numpy as np
import pandas as pd
import geopandas as gpd
import networkx as nx
from shapely.geometry import Point
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
from... | 38.62548 | 123 | 0.61855 |
ff70dd8aa10330204a06d4e9db3fdaf4204b5945 | 2,899 | py | Python | duhportinf/test/make_testcase_mapping.py | sifive/duhportinf | f7c02b62b594a69a324f44000801754cb50abb42 | [
"Apache-2.0"
] | 3 | 2019-12-06T04:22:19.000Z | 2020-12-03T21:44:53.000Z | duhportinf/test/make_testcase_mapping.py | sifive/duhportinf | f7c02b62b594a69a324f44000801754cb50abb42 | [
"Apache-2.0"
] | 14 | 2019-05-07T16:16:21.000Z | 2020-11-24T19:26:04.000Z | duhportinf/test/make_testcase_mapping.py | sifive/duhportinf | f7c02b62b594a69a324f44000801754cb50abb42 | [
"Apache-2.0"
] | 4 | 2019-06-13T19:57:55.000Z | 2021-05-19T05:20:28.000Z | import os
from ..busdef import BusDef
bsdir = os.path.join(
os.path.dirname(__file__),
'test-bus-specs',
)
spec_path = os.path.join(bsdir, 'AXI4_rtl.json5')
bus_defs.extend(BusDef.bus_defs_from_spec(spec_path))
all_bd_portnames = set([p[0] for bd in bus_defs for p in bd.all_ports])
input_mappi... | 49.982759 | 71 | 0.607106 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.