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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
33ce5e87981259004d73f531ac6ce01cf21657db | 10,431 | py | Python | extrap/extrap/extrapgui.py | extra-p/extrap | 34f9d8b078aa240defd6ac50203efd44d6f60f79 | [
"BSD-3-Clause"
] | 13 | 2020-11-12T21:50:09.000Z | 2022-03-03T11:01:27.000Z | extrap/extrap/extrapgui.py | extra-p/extrap | 34f9d8b078aa240defd6ac50203efd44d6f60f79 | [
"BSD-3-Clause"
] | 3 | 2020-12-04T12:49:37.000Z | 2021-05-06T11:41:31.000Z | extrap/extrap/extrapgui.py | extra-p/extrap | 34f9d8b078aa240defd6ac50203efd44d6f60f79 | [
"BSD-3-Clause"
] | 6 | 2021-01-14T16:06:47.000Z | 2021-09-01T09:54:37.000Z | # This file is part of the Extra-P software (http://www.scalasca.org/software/extra-p)
#
# Copyright (c) 2020-2021, Technical University of Darmstadt, Germany
#
# This software may be modified and distributed under the terms of a BSD-style license.
# See the LICENSE file in the base directory for details.
import argpa... | 40.119231 | 119 | 0.683923 |
33ce7d33b08883f62883f9b2f60169058feade3d | 18,323 | py | Python | cifar100/train.py | EricArazo/PseudoLabeling | 1cca107efb2e818ae6d825c4588f6cf522fc6a34 | [
"MIT"
] | 135 | 2019-08-09T12:36:11.000Z | 2022-03-21T08:17:18.000Z | cifar100/train.py | EricArazo/PseudoLabeling | 1cca107efb2e818ae6d825c4588f6cf522fc6a34 | [
"MIT"
] | 4 | 2019-08-13T13:42:22.000Z | 2021-01-13T05:38:10.000Z | cifar100/train.py | EricArazo/PseudoLabeling | 1cca107efb2e818ae6d825c4588f6cf522fc6a34 | [
"MIT"
] | 27 | 2019-10-01T11:54:20.000Z | 2022-03-22T14:05:09.000Z | import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.utils.data as data
from torch import optim
from torchvision import datasets, transforms
import numpy as np
import random
import sys
import argparse
import os
import time
from dataset.cifar100 import get_dataset
sys.path.append('../u... | 47.965969 | 202 | 0.588222 |
33ce8b3658dbf2334d175f61cf9ecb76542310b4 | 1,836 | py | Python | practice/weekly-contest-174/solutions.py | yangtau/algorithms-practice | 58974b6e661101686eeab357dcf6821cf7b51064 | [
"MIT"
] | 1 | 2019-03-24T17:57:34.000Z | 2019-03-24T17:57:34.000Z | practice/weekly-contest-174/solutions.py | yangtau/algorithms-practice | 58974b6e661101686eeab357dcf6821cf7b51064 | [
"MIT"
] | null | null | null | practice/weekly-contest-174/solutions.py | yangtau/algorithms-practice | 58974b6e661101686eeab357dcf6821cf7b51064 | [
"MIT"
] | null | null | null | from collections import defaultdict
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def kWeakestRows(self, mat: [[int]], k: int) -> [int]:
res = []
for i, row in enumerate(mat):
res.append((sum(1 for j... | 28.246154 | 69 | 0.4439 |
33ceb1e66820cf3eea97bd3c1c6d078020b87143 | 3,867 | py | Python | omeganlp/data/__init__.py | yuiant/omeganlp | 4258958b6d84a664d6fca0ca32a927a725b392c4 | [
"MIT"
] | 9 | 2022-02-12T07:17:52.000Z | 2022-02-14T04:46:21.000Z | omeganlp/data/__init__.py | yuiant/omeganlp | 4258958b6d84a664d6fca0ca32a927a725b392c4 | [
"MIT"
] | null | null | null | omeganlp/data/__init__.py | yuiant/omeganlp | 4258958b6d84a664d6fca0ca32a927a725b392c4 | [
"MIT"
] | 2 | 2022-02-13T16:14:49.000Z | 2022-02-14T04:46:30.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from typing import Optional
import numpy as np
from pytorch_lightning import LightningDataModule
from omeganlp.core.io import check_path
from omeganlp.data.processor import BaseDataProcessor
class DataType:
TRAIN = "train"
DEV = "dev"
TEST = "tes... | 31.185484 | 88 | 0.646755 |
33cee27951b9acf94ef82b10b557be92dac636a6 | 37,238 | py | Python | src/sage/games/sudoku.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | 1 | 2016-11-04T16:31:48.000Z | 2016-11-04T16:31:48.000Z | src/sage/games/sudoku.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | null | null | null | src/sage/games/sudoku.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | null | null | null | r"""
Sudoku Puzzles
This module provides algorithms to solve Sudoku puzzles, plus tools
for inputting, converting and displaying various ways of writing a
puzzle or its solution(s). Primarily this is accomplished with the
:class:`sage.games.sudoku.Sudoku` class, though the legacy top-level
:func:`sage.games.sudoku.su... | 41.560268 | 892 | 0.477711 |
33ceeec1eda622d012d7d0e1ce0f891287f88ad3 | 840 | py | Python | tests/test2018.py | newtonwolfe/frc-livescore | 2ecd94f515ec2c4922a593e411f75a8a07469d23 | [
"MIT"
] | 29 | 2017-07-07T05:57:03.000Z | 2022-02-06T13:01:08.000Z | tests/test2018.py | newtonwolfe/frc-livescore | 2ecd94f515ec2c4922a593e411f75a8a07469d23 | [
"MIT"
] | 21 | 2017-07-06T20:24:27.000Z | 2021-11-10T22:41:17.000Z | tests/test2018.py | newtonwolfe/frc-livescore | 2ecd94f515ec2c4922a593e411f75a8a07469d23 | [
"MIT"
] | 7 | 2017-07-09T02:14:04.000Z | 2021-11-09T22:36:02.000Z | import difflib
import os
import sys
import yaml
import cv2
from livescore import Livescore2018
# Initialize new Livescore instance
frc = Livescore2018()
error = False
with open('data/2018.yml') as data:
values = yaml.load(data)
# Read all images from the ./images/2018 directory
for f in os.listdir('./images/20... | 22.105263 | 88 | 0.652381 |
33cf1f0749f74086cdca614ce15515b6cb957519 | 6,941 | py | Python | Core/Model/EdgeModel/SQLite/history.py | UpBeatMan/Abschlussarbeit | e842df691bbfdf77cd1c41d9de00718166bb4e19 | [
"MIT"
] | null | null | null | Core/Model/EdgeModel/SQLite/history.py | UpBeatMan/Abschlussarbeit | e842df691bbfdf77cd1c41d9de00718166bb4e19 | [
"MIT"
] | 28 | 2021-06-20T17:39:00.000Z | 2021-09-04T15:03:41.000Z | Core/Model/EdgeModel/SQLite/history.py | UpBeatMan/Abschlussarbeit | e842df691bbfdf77cd1c41d9de00718166bb4e19 | [
"MIT"
] | null | null | null | from sqlalchemy import Column, Integer, String, orm, ForeignKey
from sqlalchemy.orm import relationship
from Model.util import log_message, change_file_time
from Model.EdgeModel.SQLite.base import (
BaseSession,
BaseSQLiteClass,
BaseSQliteHandler,
BaseAttribute,
OTHER,
DT_MICRO,
DT_MILLI_ZE... | 34.532338 | 87 | 0.579599 |
33cf383cc2803574069c63a11cb6f6e59e4a5ad5 | 2,254 | py | Python | calling_plan/military/models.py | hadtrindade/calling-plan | b9790bd2738c81e6d2c2835bb4de96d6abb09404 | [
"MIT"
] | null | null | null | calling_plan/military/models.py | hadtrindade/calling-plan | b9790bd2738c81e6d2c2835bb4de96d6abb09404 | [
"MIT"
] | 12 | 2021-03-10T12:46:02.000Z | 2021-06-10T20:54:49.000Z | calling_plan/military/models.py | hadtrindade/calling-plan | b9790bd2738c81e6d2c2835bb4de96d6abb09404 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils.translation import gettext_lazy as _
class Area(models.Model):
administrative_zones = (
("S", "Sul"),
("N", "Norte"),
("L", "Leste"),
("O", "Oeste"),
("G", "Guarnição"),
("F", "Fora da Guarnição"),
)
area = mode... | 31.305556 | 74 | 0.675688 |
33cfa33d266d2bb62bd023608829ef9bb82f6ef9 | 520 | py | Python | sqlite_db/sqlite.py | godwinaden/movie_api_server | 1b467bd91d0a5a9a2f0a2a9fc921b3a4f5c04217 | [
"MIT"
] | null | null | null | sqlite_db/sqlite.py | godwinaden/movie_api_server | 1b467bd91d0a5a9a2f0a2a9fc921b3a4f5c04217 | [
"MIT"
] | null | null | null | sqlite_db/sqlite.py | godwinaden/movie_api_server | 1b467bd91d0a5a9a2f0a2a9fc921b3a4f5c04217 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
SQLALCHEMY_DATABASE_URL = "sqlite:///./sqlite.db"
engine = create_engine(SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}, echo=True)
SessionLocal = sessionmaker(autoco... | 28.888889 | 101 | 0.769231 |
33cfd001ad12fb8562c6ff7c85e6cc57964eede6 | 1,099 | py | Python | tests/utils.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 108 | 2018-01-22T11:09:59.000Z | 2021-01-15T10:53:04.000Z | tests/utils.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 112 | 2018-01-25T22:57:21.000Z | 2019-08-22T20:08:48.000Z | tests/utils.py | zhwXF/Superset | 14c3488c79f8f3cdbd1123e8f7a92f8746c2db09 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 24 | 2018-01-19T22:54:39.000Z | 2020-11-12T13:04:25.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.633333 | 80 | 0.77252 |
33d029e85673496b8971a2e8ed68d5de842c46b1 | 716,399 | py | Python | vmflib2/games/mapbase_base.py | Trainzack/vmflib2 | 9bc9803b3c8c644346b5a5eb864c0deaf544d8a6 | [
"BSD-2-Clause"
] | 1 | 2021-02-11T17:52:48.000Z | 2021-02-11T17:52:48.000Z | vmflib2/games/mapbase_base.py | Trainzack/vmflib2 | 9bc9803b3c8c644346b5a5eb864c0deaf544d8a6 | [
"BSD-2-Clause"
] | null | null | null | vmflib2/games/mapbase_base.py | Trainzack/vmflib2 | 9bc9803b3c8c644346b5a5eb864c0deaf544d8a6 | [
"BSD-2-Clause"
] | 1 | 2021-02-12T18:56:51.000Z | 2021-02-12T18:56:51.000Z | """
Helper classes for creating maps in any Source Engine game that uses mapbase_base.fgd.
This file was auto-generated by import_fgd.py on 2020-01-19 09:11:15.535462.
"""
from vmflib2.vmf import *
class AiMonitor(Entity):
"""
Auto-generated from mapbase_base.fgd, line 6033.
Monitors NPCs for conditions ... | 61.6894 | 1,478 | 0.687507 |
33d02a5de7feaa29bb142b1b9ca524cb0fa2718a | 3,924 | py | Python | combine_tubs.py | ricoai/ricar_ryc | 811aefaf9893f3fe9c61d2070d8dc3a949f36697 | [
"MIT"
] | 1 | 2018-12-03T21:55:19.000Z | 2018-12-03T21:55:19.000Z | combine_tubs.py | ricoai/ricar_ryc | 811aefaf9893f3fe9c61d2070d8dc3a949f36697 | [
"MIT"
] | null | null | null | combine_tubs.py | ricoai/ricar_ryc | 811aefaf9893f3fe9c61d2070d8dc3a949f36697 | [
"MIT"
] | null | null | null | """"
Combine all the tubs i want to use into 1 folder.
I have found that when i run multiple folders, my loss
plot spikes randomly. I have been told this happens
when i jump between folders. So this will make all the tubs
1 large tub.
It will rename the json and image files so that everything
is in order.
--force w... | 27.829787 | 105 | 0.647044 |
33d05d95690b514d7dbd5f672771a7f5b88ae2f2 | 881 | py | Python | src/encoded/tests/test_upgrade_chip_replication_quality_metric.py | aperritano/encoded | c03f6799a2155377321877bf12c079c50b0e08ce | [
"MIT"
] | null | null | null | src/encoded/tests/test_upgrade_chip_replication_quality_metric.py | aperritano/encoded | c03f6799a2155377321877bf12c079c50b0e08ce | [
"MIT"
] | 1 | 2018-12-14T18:00:30.000Z | 2018-12-14T18:00:30.000Z | src/encoded/tests/test_upgrade_chip_replication_quality_metric.py | aperritano/encoded | c03f6799a2155377321877bf12c079c50b0e08ce | [
"MIT"
] | null | null | null | import pytest
@pytest.fixture
def chip_replication_quality_metric_1(award, lab):
return{
"step_run": "63b1b347-f008-4103-8d20-0e12f54d1882",
"award": award["uuid"],
"lab": lab["uuid"],
"quality_metric_of": ["ENCFF003COS"],
"IDR_dispersion_plot": "ENCFF002DSJ.raw.srt.filt.no... | 40.045455 | 131 | 0.704881 |
33d06981a096574c11b3938e9a64576548f4bdae | 10,187 | py | Python | river/datasets/base.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 1,105 | 2019-01-24T15:15:30.000Z | 2020-11-10T18:27:00.000Z | river/datasets/base.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 328 | 2019-01-25T13:48:43.000Z | 2020-11-11T11:41:44.000Z | river/datasets/base.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 150 | 2019-01-29T19:05:21.000Z | 2020-11-11T11:50:14.000Z | import abc
import inspect
import itertools
import os
import pathlib
import re
import shutil
import tarfile
import typing
import zipfile
from urllib import request
from river import utils
__all__ = ["Dataset", "SyntheticDataset", "FileDataset", "RemoteDataset"]
REG = "Regression"
BINARY_CLF = "Binary classification"
... | 29.8739 | 98 | 0.599293 |
33d08933eb635671b2ef8e34327b338e085236e6 | 3,788 | py | Python | hail-elasticsearch-pipelines/luigi_pipeline/tests/test_seqr_loading_tasks.py | leklab/pkd_browser | 47ca228ee1424db399405f3825b463583e4a404f | [
"MIT"
] | null | null | null | hail-elasticsearch-pipelines/luigi_pipeline/tests/test_seqr_loading_tasks.py | leklab/pkd_browser | 47ca228ee1424db399405f3825b463583e4a404f | [
"MIT"
] | null | null | null | hail-elasticsearch-pipelines/luigi_pipeline/tests/test_seqr_loading_tasks.py | leklab/pkd_browser | 47ca228ee1424db399405f3825b463583e4a404f | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import patch
import hail as hl
from seqr_loading import SeqrVCFToMTTask, SeqrValidationError
from tests.data.sample_vep import VEP_DATA, DERIVED_DATA
TEST_DATA_MT_1KG = 'tests/data/1kg_30variants.vcf.bgz'
class TestSeqrLoadingTasks(unittest.TestCase):
def _sample_type_stats_r... | 52.611111 | 127 | 0.728353 |
33d0943ad57244a04aebf8cb70b5c00462a3c099 | 1,121 | py | Python | controller.py | igoumiri/pyMST | 79825c6fbf521b3ec8931114d0d3d36b548cf75b | [
"MIT"
] | null | null | null | controller.py | igoumiri/pyMST | 79825c6fbf521b3ec8931114d0d3d36b548cf75b | [
"MIT"
] | null | null | null | controller.py | igoumiri/pyMST | 79825c6fbf521b3ec8931114d0d3d36b548cf75b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# MST Controller
# Imène Goumiri
# January 4, 2017
# MIT License
import numpy.matlib as np
import scipy.integrate as si
class LQG:
def __init__(self, config):
self.A = np.mat(config["A"])
self.B = np.mat(config["B"])
self.C = np.mat(config["C"])
self.D = np.mat(config["D"])
self.F ... | 23.354167 | 68 | 0.570919 |
33d0c52f3b7d3c0c485487d2af789eb41580c379 | 5,558 | py | Python | rsvp.py | kokeshii/RSVPBot | bb7f02c62cee6155f46829d834330a767ec9b945 | [
"MIT"
] | 32 | 2015-04-21T21:19:55.000Z | 2021-01-12T23:35:56.000Z | rsvp.py | kokeshii/RSVPBot | bb7f02c62cee6155f46829d834330a767ec9b945 | [
"MIT"
] | 60 | 2015-04-23T00:17:10.000Z | 2017-05-22T20:26:04.000Z | rsvp.py | kokeshii/RSVPBot | bb7f02c62cee6155f46829d834330a767ec9b945 | [
"MIT"
] | 23 | 2015-04-23T00:19:48.000Z | 2017-05-23T18:42:19.000Z | from __future__ import with_statement
import re
import json
import rsvp_commands
from strings import ERROR_INVALID_COMMAND
class RSVP(object):
def __init__(self, key_word, backend):
"""
keep a copy in memory of the whole events dictionary and commit it when necessary
to the supplied backend.
"""
... | 33.684848 | 111 | 0.679921 |
33d0c9d55d37e2c1f898ec060d73f2f80fce9321 | 2,254 | py | Python | isRectangleOverlap.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | 1 | 2019-08-29T01:12:47.000Z | 2019-08-29T01:12:47.000Z | isRectangleOverlap.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | null | null | null | isRectangleOverlap.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
'''
@project : LeetCode
@File : isRectangleOverlap.py
@Contact : 9824373@qq.com
@Desc :
矩形以列表 [x1, y1, x2, y2] 的形式表示,其中 (x1, y1) 为左下角的坐标,(x2, y2) 是右上角的坐标。
如果相交的面积为正,则称两矩形重叠。需要明确的是,只在角或边接触的两个矩形不构成重叠。
给出两个矩形,判断它们是否重叠并返回结果。
示例 1:
... | 29.272727 | 132 | 0.444987 |
33d0da87b5717d0954c730600460c3dcc559b1bd | 2,671 | py | Python | smart_instant_pot/tests/test_image_utils.py | tdicola/Smart_Instant_Pot | b2e4b9deec3f1813f737c94041f315eccce9978d | [
"MIT"
] | 3 | 2018-12-16T21:01:47.000Z | 2021-03-17T19:10:27.000Z | smart_instant_pot/tests/test_image_utils.py | tdicola/Smart_Instant_Pot | b2e4b9deec3f1813f737c94041f315eccce9978d | [
"MIT"
] | null | null | null | smart_instant_pot/tests/test_image_utils.py | tdicola/Smart_Instant_Pot | b2e4b9deec3f1813f737c94041f315eccce9978d | [
"MIT"
] | null | null | null | # Smart Instant Pot Image Utilities Tests
# Author: Tony DiCola
import unittest
import numpy as np
import smart_instant_pot.image_utils as image_utils
class TestConstrainSize(unittest.TestCase):
def test_shrink_square(self):
# Create a 200x200 square test image and verify it will shrink to the
... | 40.469697 | 81 | 0.674279 |
33d10a999f4c075bc1220bc367c88ea36dd0c1b8 | 1,762 | py | Python | panoptes_aggregation/tests/utility_tests/test_text_utils.py | amyrebecca/aggregation-for-caesar | 5f0d884932312010f9caeb8ebfcfe358f490e41f | [
"Apache-2.0"
] | null | null | null | panoptes_aggregation/tests/utility_tests/test_text_utils.py | amyrebecca/aggregation-for-caesar | 5f0d884932312010f9caeb8ebfcfe358f490e41f | [
"Apache-2.0"
] | null | null | null | panoptes_aggregation/tests/utility_tests/test_text_utils.py | amyrebecca/aggregation-for-caesar | 5f0d884932312010f9caeb8ebfcfe358f490e41f | [
"Apache-2.0"
] | null | null | null | import unittest
import numpy as np
from panoptes_aggregation.reducers import text_utils
theta_1 = [
180,
179,
45,
-90,
135
]
theta_2 = [
-180,
-179,
135,
135,
-135
]
delta_theta = [
0,
2,
90,
135,
90
]
theta_lists = [
np.array([179, -179]),
np.arr... | 20.729412 | 72 | 0.540295 |
33d111d1c8f2f2c08794f6fa832debeb251fe6e8 | 2,504 | py | Python | executor/integration_tests/executor/conftest.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 6 | 2020-09-29T09:03:04.000Z | 2022-03-14T06:52:25.000Z | executor/integration_tests/executor/conftest.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | null | null | null | executor/integration_tests/executor/conftest.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 4 | 2020-10-01T07:49:22.000Z | 2021-06-16T19:44:12.000Z | import kubernetes
import toml
from typing import Dict, Any
from bai_k8s_utils.kubernetes_tests_client import KubernetesTestUtilsClient
from bai_kafka_utils.events import (
BenchmarkEvent,
FetcherBenchmarkEvent,
BenchmarkDoc,
FetcherPayload,
create_from_object,
)
from pytest import fixture
from bai_... | 33.837838 | 110 | 0.771965 |
33d137370bfcf3f2cbf9b8d7db724d9da2505a44 | 182 | py | Python | curvtest.py | kaustavg/curv | 591143f827da7e0d341d7c716a12e086e3bbb22b | [
"MIT"
] | 1 | 2018-11-15T20:36:38.000Z | 2018-11-15T20:36:38.000Z | curvtest.py | kaustavg/curv | 591143f827da7e0d341d7c716a12e086e3bbb22b | [
"MIT"
] | null | null | null | curvtest.py | kaustavg/curv | 591143f827da7e0d341d7c716a12e086e3bbb22b | [
"MIT"
] | null | null | null | import curv as cv
A = cv.normal(1,2)
B = cv.uniform(-5,4)
C = 4 + A - 2*B
cv.plotNet()
print(cv.E(C))
print(cv.V(C))
# D = C * A**2
# cv.plotCHF(C,(-10,10))
cv.plotPDF(C,(-10,10))
| 14 | 24 | 0.554945 |
33d146f184ffae685068a1b36c8a3882a5f7a25b | 8,766 | py | Python | tests/api/db/test_projects.py | EdmondIguazio/mlrun | e63b34a610788ebe522ce7a46642e26927e39882 | [
"Apache-2.0"
] | null | null | null | tests/api/db/test_projects.py | EdmondIguazio/mlrun | e63b34a610788ebe522ce7a46642e26927e39882 | [
"Apache-2.0"
] | null | null | null | tests/api/db/test_projects.py | EdmondIguazio/mlrun | e63b34a610788ebe522ce7a46642e26927e39882 | [
"Apache-2.0"
] | 1 | 2021-05-05T14:19:46.000Z | 2021-05-05T14:19:46.000Z | import pytest
import deepdiff
import typing
from sqlalchemy.orm import Session
from mlrun.api import schemas
from mlrun.api.db.base import DBInterface
from mlrun.api.db.sqldb.models import (
_classes,
Function,
Project,
Run,
Artifact,
FeatureSet,
Feature,
Entity,
Schedule,
)
from te... | 36.373444 | 112 | 0.543235 |
33d14846e45883732917a43ee6f9b56090f1a23d | 31,642 | py | Python | pysindy/pysindy.py | JasonChunZheng/pysindy | a9467c012faef0a7a072cfc2408b37978beb12c4 | [
"MIT"
] | 1 | 2020-10-28T13:12:53.000Z | 2020-10-28T13:12:53.000Z | pysindy/pysindy.py | JasonChunZheng/pysindy | a9467c012faef0a7a072cfc2408b37978beb12c4 | [
"MIT"
] | null | null | null | pysindy/pysindy.py | JasonChunZheng/pysindy | a9467c012faef0a7a072cfc2408b37978beb12c4 | [
"MIT"
] | null | null | null | import warnings
from typing import Sequence
from numpy import concatenate
from numpy import isscalar
from numpy import ndim
from numpy import newaxis
from numpy import vstack
from numpy import zeros
from scipy.integrate import odeint
from scipy.interpolate import interp1d
from scipy.linalg import LinAlgWarning
from sk... | 39.112485 | 88 | 0.558435 |
33d153529150effc6cf748051205a07b5f43592e | 2,605 | py | Python | c2cwsgiutils/models_graph.py | jhutchings1/c2cwsgiutils | 733f3eace5393539a170455038a27d42682bf4f5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cwsgiutils/models_graph.py | jhutchings1/c2cwsgiutils | 733f3eace5393539a170455038a27d42682bf4f5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cwsgiutils/models_graph.py | jhutchings1/c2cwsgiutils | 733f3eace5393539a170455038a27d42682bf4f5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import inspect
import sys
from typing import Any, Set, List
import sqlalchemy as sa
def generate_model_graph(module: Any) -> None:
if len(sys.argv) == 1:
base_name = "Base"
elif len(sys.argv) == 2:
base_name = sys.argv[1]
else:
print("Invalid parameters\nUsage: %s [base_class]" % ... | 28.944444 | 96 | 0.614587 |
33d1b45a2d1309a033acb46d683fb0834d0bd088 | 2,583 | py | Python | icedata/datasets/pennfudan/parser.py | FraPochetti/icedata | fdd094dfbf80e2668ef942ea26fe6b4d31052eb7 | [
"Apache-2.0"
] | null | null | null | icedata/datasets/pennfudan/parser.py | FraPochetti/icedata | fdd094dfbf80e2668ef942ea26fe6b4d31052eb7 | [
"Apache-2.0"
] | null | null | null | icedata/datasets/pennfudan/parser.py | FraPochetti/icedata | fdd094dfbf80e2668ef942ea26fe6b4d31052eb7 | [
"Apache-2.0"
] | null | null | null | __all__ = ["parser", "PennFundanParser"]
from icevision.imports import *
from icevision import *
def parser(data_dir) -> parsers.ParserInterface:
return PennFundanParser(data_dir=data_dir)
class PennFundanParser(parsers.MaskRCNN, parsers.FilepathMixin, parsers.SizeMixin):
def __init__(self, data_dir):
... | 33.115385 | 83 | 0.576461 |
33d1bdb44694073e004d83925b21b221eb816c16 | 920 | py | Python | ml-agents/tests/yamato/standalone_build_tests.py | mattinjersey/ml-agents | 7dcf947f541d661cc4a94b0e7758e1b12c6be078 | [
"Apache-2.0"
] | 2 | 2021-01-09T13:13:13.000Z | 2021-01-18T19:54:00.000Z | ml-agents/tests/yamato/standalone_build_tests.py | Rushoo26/ml-agents | c73616c176f383bebefc3a1895ed1265661a1236 | [
"Apache-2.0"
] | null | null | null | ml-agents/tests/yamato/standalone_build_tests.py | Rushoo26/ml-agents | c73616c176f383bebefc3a1895ed1265661a1236 | [
"Apache-2.0"
] | 1 | 2021-12-03T16:51:05.000Z | 2021-12-03T16:51:05.000Z | import os
import sys
import argparse
from .yamato_utils import get_base_path, run_standalone_build
def main(scene_path):
base_path = get_base_path()
print(f"Running in base path {base_path}")
executable_name = None
if scene_path is not None:
executable_name = os.path.splitext(scene_path)[0] ... | 25.555556 | 77 | 0.68913 |
33d1ec1702dc920293a11113f0c519b68216cb50 | 5,472 | py | Python | tests/bot/cogs/test_token_remover.py | Savant-Dev/bot | cfc5720925b6bbc40c45507f8579145a0014a6eb | [
"MIT"
] | 1 | 2020-05-12T08:26:06.000Z | 2020-05-12T08:26:06.000Z | tests/bot/cogs/test_token_remover.py | Savant-Dev/bot | cfc5720925b6bbc40c45507f8579145a0014a6eb | [
"MIT"
] | 1 | 2021-03-31T19:57:18.000Z | 2021-03-31T19:57:18.000Z | tests/bot/cogs/test_token_remover.py | Savant-Dev/bot | cfc5720925b6bbc40c45507f8579145a0014a6eb | [
"MIT"
] | 1 | 2020-05-23T19:16:49.000Z | 2020-05-23T19:16:49.000Z | import asyncio
import logging
import unittest
from unittest.mock import AsyncMock, MagicMock
from discord import Colour
from bot.cogs.token_remover import (
DELETION_MESSAGE_TEMPLATE,
TokenRemover,
setup as setup_cog,
)
from bot.constants import Channels, Colours, Event, Icons
from tests.helpers import Mo... | 41.454545 | 97 | 0.637427 |
33d2277d9daa9274acbe7e732ea5fa6980671ba4 | 209 | py | Python | tests/test_generic.py | tokibito/django-edamame | 5d2bea6b9f804963678e8492a1d9a9e3e1dd3c48 | [
"MIT"
] | 4 | 2015-05-18T13:49:05.000Z | 2015-05-18T14:45:27.000Z | tests/test_generic.py | tokibito/django-edamame | 5d2bea6b9f804963678e8492a1d9a9e3e1dd3c48 | [
"MIT"
] | null | null | null | tests/test_generic.py | tokibito/django-edamame | 5d2bea6b9f804963678e8492a1d9a9e3e1dd3c48 | [
"MIT"
] | null | null | null | from unittest import TestCase
class ModelViewsTest(TestCase):
def getOne(self):
from edamame import generic
return generic.ModelViews()
def test(self):
views = self.getOne()
| 19 | 35 | 0.665072 |
33d22c49b716883fe7fab89c08673f54762c0c56 | 8,427 | py | Python | asposewordscloud/models/page_stat_data.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | asposewordscloud/models/page_stat_data.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | asposewordscloud/models/page_stat_data.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="page_stat_data.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of th... | 35.556962 | 120 | 0.604486 |
33d25b969dc26d3825ea63c2c6fe8280dd2adfbe | 28 | py | Python | btd6_memory_info/generated/UnityEngine/UIElements/PropagationPaths/propagation_paths.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/UIElements/PropagationPaths/propagation_paths.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/UIElements/PropagationPaths/propagation_paths.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class PropagationPaths: pass | 28 | 28 | 0.892857 |
33d275a6f356b1e21c2804a9705fb3fda82fb227 | 1,125 | py | Python | functions/__init__.py | Brettanda/friday-bot | d103b1c103052b8d6d12f44456fea3823bd22447 | [
"CC0-1.0"
] | 5 | 2021-09-04T09:08:55.000Z | 2022-02-08T00:28:08.000Z | functions/__init__.py | Brettanda/friday-bot | d103b1c103052b8d6d12f44456fea3823bd22447 | [
"CC0-1.0"
] | 2 | 2021-10-11T21:44:08.000Z | 2021-11-05T07:41:23.000Z | functions/__init__.py | Brettanda/friday-bot | d103b1c103052b8d6d12f44456fea3823bd22447 | [
"CC0-1.0"
] | 3 | 2021-09-04T09:12:34.000Z | 2021-12-16T20:02:03.000Z | import os
from .messagecolors import MessageColors
from . import exceptions, checks, config # , queryIntents # , queryGen
from .myembed import embed
from . import cache
from .custom_contexts import MyContext # , FakeInteractionMessage # , MySlashContext
from .reply import msg_reply
from .time import timeit
from .... | 22.959184 | 159 | 0.693333 |
33d29aeca7b11e09e38dbcf48ab8553dad80ea54 | 6,796 | py | Python | leetcode_python/Two_Pointers/minimum-number-of-swaps-to-make-the-string-balanced.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Two_Pointers/minimum-number-of-swaps-to-make-the-string-balanced.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Two_Pointers/minimum-number-of-swaps-to-make-the-string-balanced.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
1963. Minimum Number of Swaps to Make the String Balanced
Medium
You are given a 0-indexed string s of even length n. The string consists of exactly n / 2 opening brackets '[' and n / 2 closing brackets ']'.
A string is called balanced if and only if:
It is the empty string, or
It can be written as AB, where bo... | 33.98 | 311 | 0.562095 |
33d31b26fc996821c03ac1543f8b3bd69e51980f | 4,248 | py | Python | load_memmap.py | idhamari/CapsPix2Pix | 985341666a13e76e47723217df9fcde593bd028a | [
"MIT"
] | 24 | 2019-02-18T07:18:58.000Z | 2020-12-18T06:19:02.000Z | load_memmap.py | idhamari/CapsPix2Pix | 985341666a13e76e47723217df9fcde593bd028a | [
"MIT"
] | 2 | 2019-07-06T20:58:00.000Z | 2022-01-30T18:35:44.000Z | load_memmap.py | idhamari/CapsPix2Pix | 985341666a13e76e47723217df9fcde593bd028a | [
"MIT"
] | 13 | 2019-04-07T22:30:58.000Z | 2022-03-28T04:47:44.000Z | import os as os
import numpy as np
import matplotlib.pyplot as plt
from tempfile import mkdtemp
import os.path as path
# Shape and save data in numpy form
def shape_data(folder, targets=2):
images_original = [img for img in os.listdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), folder, "original"))]
... | 43.793814 | 140 | 0.641008 |
33d32c3184f30ec359bf6d814e255a88e8fb4725 | 486 | py | Python | example/example/urls.py | jerch/django-treewidget | 110ffb2ec771091638347bd5e1ae18ca4ca4d6ed | [
"MIT"
] | null | null | null | example/example/urls.py | jerch/django-treewidget | 110ffb2ec771091638347bd5e1ae18ca4ca4d6ed | [
"MIT"
] | 3 | 2018-03-13T13:04:59.000Z | 2018-03-17T23:26:50.000Z | example/example/urls.py | jerch/django-treewidget | 110ffb2ec771091638347bd5e1ae18ca4ca4d6ed | [
"MIT"
] | 1 | 2018-03-13T13:17:05.000Z | 2018-03-13T13:17:05.000Z | from django.conf.urls import include
from django.contrib import admin
try:
from django.conf.urls import url
except ImportError:
# django 4 and up
from django.urls import re_path as url
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^treewidget/', include('treewidget.urls')),
]
from djan... | 22.090909 | 57 | 0.697531 |
33d32c8e574446df79c7f061bc6ed61c11aa52cf | 487 | py | Python | client/verta/verta/_swagger/_public/uac/model/UacDeleteRole.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 835 | 2017-02-08T20:14:24.000Z | 2020-03-12T17:37:49.000Z | client/verta/verta/_swagger/_public/uac/model/UacDeleteRole.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 651 | 2019-04-18T12:55:07.000Z | 2022-03-31T23:45:09.000Z | client/verta/verta/_swagger/_public/uac/model/UacDeleteRole.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 170 | 2017-02-13T14:49:22.000Z | 2020-02-19T17:59:12.000Z | # THIS FILE IS AUTO-GENERATED. DO NOT EDIT
from verta._swagger.base_type import BaseType
class UacDeleteRole(BaseType):
def __init__(self, id=None):
required = {
"id": False,
}
self.id = id
for k, v in required.items():
if self[k] is None and v:
raise ValueError('attribute {} is ... | 20.291667 | 62 | 0.61191 |
33d339c443ec37e7f94970afaa7a141a2298cc12 | 9,368 | py | Python | src/modules/edge_probing.py | pruksmhc/jiant | 02479be51e128abf5e4f8e0b7eb947de22818cf2 | [
"MIT"
] | null | null | null | src/modules/edge_probing.py | pruksmhc/jiant | 02479be51e128abf5e4f8e0b7eb947de22818cf2 | [
"MIT"
] | null | null | null | src/modules/edge_probing.py | pruksmhc/jiant | 02479be51e128abf5e4f8e0b7eb947de22818cf2 | [
"MIT"
] | null | null | null | # Implementation of edge probing module.
from typing import Dict, Iterable
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from allennlp.modules.span_extractors import EndpointSpanExtractor, SelfAttentiveSpanExtractor
from ..tasks.edge_probing import EdgeProbingTask
from .simple... | 39.694915 | 99 | 0.637169 |
33d3417f721fa725160b55ea87c7cefdd269fc05 | 2,429 | py | Python | libs/applibs/kivymd/progressbar.py | mkbeh/CRyptoLab | 424c938c16c9264e99eff71e4c1a27ca65314d42 | [
"MIT"
] | null | null | null | libs/applibs/kivymd/progressbar.py | mkbeh/CRyptoLab | 424c938c16c9264e99eff71e4c1a27ca65314d42 | [
"MIT"
] | 1 | 2021-06-01T22:30:24.000Z | 2021-06-01T22:30:24.000Z | libs/applibs/kivymd/progressbar.py | mkbeh/CRyptoLab | 424c938c16c9264e99eff71e4c1a27ca65314d42 | [
"MIT"
] | 1 | 2021-05-11T23:06:20.000Z | 2021-05-11T23:06:20.000Z | # -*- coding: utf-8 -*-
from kivy.lang import Builder
from kivy.properties import ListProperty, OptionProperty, BooleanProperty
from kivy.utils import get_color_from_hex
from libs.applibs.kivymd.color_definitions import colors
from libs.applibs.kivymd.theming import ThemableBehavior
from kivy.uix.progressbar import Pr... | 30.3625 | 119 | 0.608069 |
33d35f919eb08e8c49574a3532db316f29d5d5a0 | 2,081 | py | Python | util/wind_rose_plot_example.py | jenkayco/hacknostics | 4f980b17a2648cb6547cd2d8b442ae23253ab5e6 | [
"MIT"
] | 2 | 2019-06-04T20:10:46.000Z | 2021-06-07T21:10:39.000Z | util/wind_rose_plot_example.py | jenkayco/hacknostics | 4f980b17a2648cb6547cd2d8b442ae23253ab5e6 | [
"MIT"
] | 2 | 2019-06-05T03:08:06.000Z | 2019-06-05T15:38:01.000Z | util/wind_rose_plot_example.py | jenkayco/hacknostics | 4f980b17a2648cb6547cd2d8b442ae23253ab5e6 | [
"MIT"
] | 2 | 2019-06-05T03:11:35.000Z | 2019-06-05T05:33:45.000Z | #!/usr/bin/env python
# from the matplotlib docs
# https://matplotlib.org/1.2.1/examples/pylab_examples/polar_bar.html
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
print(f"CHECK: atan2(1,-1) should be 2.36: {np.arctan2(1,-1):.2f}")
# get the data
ds = xr.open_dataset("/Users/brianpm/Dropbox... | 32.015385 | 109 | 0.675637 |
33d3616fffd736ee6840aea7591ae150b299a6b4 | 1,673 | py | Python | python-benchmarking-tools/haste/benchmarking/messaging.py | HASTE-project/benchmarking-tools | 3e65cd4019287051a612bc21fa68e4b1a5bbc745 | [
"BSD-3-Clause"
] | null | null | null | python-benchmarking-tools/haste/benchmarking/messaging.py | HASTE-project/benchmarking-tools | 3e65cd4019287051a612bc21fa68e4b1a5bbc745 | [
"BSD-3-Clause"
] | null | null | null | python-benchmarking-tools/haste/benchmarking/messaging.py | HASTE-project/benchmarking-tools | 3e65cd4019287051a612bc21fa68e4b1a5bbc745 | [
"BSD-3-Clause"
] | null | null | null | import random
import string
from itertools import repeat
import time
RANDOM_1KB = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits)
for _ in range(1000))
RANDOM_100MB = bytearray(''.join(list(repeat(RANDOM_1KB, 100 * 1024))), 'utf-8')
NEWLINE = bytes("\n", 'UT... | 29.875 | 99 | 0.683802 |
33d36eaa7545f5a54c61ea2cb2f667ce349c696a | 977 | py | Python | demo/dom/iterator1.py | jkloth/pyxml | de15b3ad0fe095f6ce36b1c5ad7438046aae8d3d | [
"MIT"
] | 2 | 2018-05-28T23:01:20.000Z | 2018-05-29T03:59:38.000Z | demo/dom/iterator1.py | jkloth/pyxml | de15b3ad0fe095f6ce36b1c5ad7438046aae8d3d | [
"MIT"
] | null | null | null | demo/dom/iterator1.py | jkloth/pyxml | de15b3ad0fe095f6ce36b1c5ad7438046aae8d3d | [
"MIT"
] | null | null | null | """Demonstrates basic walking using DOM level 2 iterators"""
from xml.dom.ext.reader import PyExpat
from xml.dom.NodeFilter import NodeFilter
def Iterate(xml_dom_object):
print "Printing all nodes:"
nit = xml_dom_object.ownerDocument.createNodeIterator(xml_dom_object, NodeFilter.SHOW_ALL, None, 0)
curr_n... | 32.566667 | 108 | 0.718526 |
33d39f3d156618415c01f919a1ca05b8f24ac1a0 | 5,281 | py | Python | alipay/aop/api/domain/RecruitEnrollInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/RecruitEnrollInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/RecruitEnrollInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.RecruitEnrollMerchant import RecruitEnrollMerchant
from alipay.aop.api.domain.RecruitMaterial import RecruitMaterial
from alipay.aop.api.domain.RecruitMiniApp import RecruitMiniApp
... | 35.442953 | 81 | 0.567885 |
33d3ad0d06b56b5bee84e8ff6e4b19c83a428d20 | 10,276 | py | Python | nova/api/openstack/compute/contrib/hypervisors.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | 1 | 2021-09-10T15:29:02.000Z | 2021-09-10T15:29:02.000Z | nova/api/openstack/compute/contrib/hypervisors.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/contrib/hypervisors.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | 1 | 2020-07-24T06:47:54.000Z | 2020-07-24T06:47:54.000Z | # Copyright (c) 2012 OpenStack Foundation
# 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 ... | 37.367273 | 78 | 0.618139 |
33d3b3ebe96acc9b1b8e99f9e78c92a172ee0fe8 | 4,386 | py | Python | jina/types/document/converters.py | HarshCasper/jina | 81ab098b140b74ad1cfdfde9218cec7a40923749 | [
"Apache-2.0"
] | 1 | 2021-02-25T19:28:50.000Z | 2021-02-25T19:28:50.000Z | jina/types/document/converters.py | HarshCasper/jina | 81ab098b140b74ad1cfdfde9218cec7a40923749 | [
"Apache-2.0"
] | 1 | 2021-02-27T05:56:45.000Z | 2021-02-27T05:57:03.000Z | jina/types/document/converters.py | deepampatel/jina | 97f9e97a4a678a28bdeacbc7346eaf7bbd2aeb89 | [
"Apache-2.0"
] | null | null | null | import mimetypes
import struct
import urllib.parse
import urllib.request
import zlib
import numpy as np
def _png_to_buffer_1d(arr: 'np.ndarray', width: int, height: int) -> bytes:
pixels = []
arr = 255 - arr
for p in arr[::-1]:
pixels.extend([p, p, p, 255])
buf = bytearray(pixels)
# reve... | 33.480916 | 241 | 0.634291 |
33d3d0bf6c2b1016d09ab6832b1e45513333ca50 | 6,196 | py | Python | tools/check_logs.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tools/check_logs.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tools/check_logs.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2013 Red Hat, 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
#
... | 31.292929 | 78 | 0.605068 |
33d3d9d0dd2017f725f71c9012f15a5744a14f27 | 294 | py | Python | setup.py | fitzgen/zoolander | 7897a6b1f72c100124ccff6c5965480692668616 | [
"MIT"
] | 7 | 2016-03-01T22:17:26.000Z | 2021-08-05T01:15:44.000Z | setup.py | fitzgen/zoolander | 7897a6b1f72c100124ccff6c5965480692668616 | [
"MIT"
] | null | null | null | setup.py | fitzgen/zoolander | 7897a6b1f72c100124ccff6c5965480692668616 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name="zoolander",
version="0.1",
description="A pure Python DSL for CSS",
author="Nick Fitzgerald",
author_email="fitzgen@gmail.com",
url="http://github.com/fitzgen/zoolander",
packages=["zoolander"],
license="MIT")
| 26.727273 | 48 | 0.642857 |
33d3f4c8ca02af006e66d1ac8d754e14910e2594 | 6,107 | py | Python | models/_wildcat.py | SereneQI/text-image-similarity | 696f28ac9fa6dfe19cbd4e890fe3975ad3fff92e | [
"BSD-3-Clause-Clear"
] | 4 | 2019-11-22T12:46:42.000Z | 2021-03-10T00:20:58.000Z | models/_wildcat.py | Sereene/text-image-similarity | 696f28ac9fa6dfe19cbd4e890fe3975ad3fff92e | [
"BSD-3-Clause-Clear"
] | null | null | null | models/_wildcat.py | Sereene/text-image-similarity | 696f28ac9fa6dfe19cbd4e890fe3975ad3fff92e | [
"BSD-3-Clause-Clear"
] | 1 | 2019-11-22T12:46:45.000Z | 2019-11-22T12:46:45.000Z | import sys
import torch
import torch.nn as nn
import torchvision.models as models
from torch.autograd import Function, Variable
class WildcatPool2dFunction(Function):
def __init__(self, kmax, kmin, alpha):
super(WildcatPool2dFunction, self).__init__()
self.kmax = kmax
self.kmin = kmin
... | 34.897143 | 128 | 0.579335 |
33d3f5dfc420be9ea0be4057f0864ee3f20673ca | 4,849 | py | Python | tests/pycurl_cookie.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 2,266 | 2015-01-01T08:47:33.000Z | 2022-03-21T05:02:55.000Z | tests/pycurl_cookie.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 221 | 2015-01-13T01:55:57.000Z | 2022-02-25T23:23:35.000Z | tests/pycurl_cookie.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 315 | 2015-01-23T06:38:55.000Z | 2022-03-27T08:33:33.000Z | # coding: utf-8
"""
This test case has written to help me
understand how pycurl lib works with cookies
"""
from six.moves.http_cookiejar import CookieJar
from six import BytesIO
from tests.util import BaseGrabTestCase, only_grab_transport
from grab.error import GrabMisuseError
from grab.cookie import create_cookie
#... | 37.882813 | 79 | 0.628171 |
33d41dd8b38a585de976185b3a8d6f64f019c0bf | 3,349 | py | Python | cogs/fun.py | HypixelBot/bot | 672e17c5bbd37b0e7e54581b679051b7e59575d2 | [
"MIT"
] | 10 | 2020-06-06T13:57:46.000Z | 2021-11-08T09:27:42.000Z | cogs/fun.py | HypixelBot/Bot | 672e17c5bbd37b0e7e54581b679051b7e59575d2 | [
"MIT"
] | 7 | 2020-06-06T14:04:05.000Z | 2020-07-05T04:05:37.000Z | cogs/fun.py | HypixelBot/bot | 672e17c5bbd37b0e7e54581b679051b7e59575d2 | [
"MIT"
] | 14 | 2020-06-09T17:12:52.000Z | 2021-07-21T23:24:30.000Z | from discord.ext import commands
import traceback
import discord
import logging
import random
import re
log = logging.getLogger(__name__)
class Fun(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.ball_answers = {}
self.ball = ['It is certain', 'It is decidedly so', 'Without a ... | 41.8625 | 137 | 0.576889 |
33d41f590f541600036ad47968818d45a85f0c18 | 8,006 | py | Python | motion_imitation/examples/whole_body_controller_example.py | hop9999/motion_imitation | 8b87dc619fa8799db5534a2c17a2fd1184d15693 | [
"Apache-2.0"
] | null | null | null | motion_imitation/examples/whole_body_controller_example.py | hop9999/motion_imitation | 8b87dc619fa8799db5534a2c17a2fd1184d15693 | [
"Apache-2.0"
] | null | null | null | motion_imitation/examples/whole_body_controller_example.py | hop9999/motion_imitation | 8b87dc619fa8799db5534a2c17a2fd1184d15693 | [
"Apache-2.0"
] | null | null | null | """Example of whole body controller on A1 robot."""
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0, parentdir)
from absl import app
from absl import flags
from absl import logg... | 33.082645 | 96 | 0.720959 |
33d4333514d4a8af5fe7e352bc64f2bf5d91d757 | 721 | py | Python | server/train.py | cascadianblue/phi-annotator | 0da6c102ec1068e6b15c613e2a90a78f79d15935 | [
"Apache-2.0"
] | 1 | 2021-06-18T02:02:59.000Z | 2021-06-18T02:02:59.000Z | server/train.py | cascadianblue/phi-annotator | 0da6c102ec1068e6b15c613e2a90a78f79d15935 | [
"Apache-2.0"
] | 19 | 2021-07-29T03:14:38.000Z | 2022-03-01T06:03:14.000Z | server/train.py | cascadianblue/person-name-annotator | f83120fa327a89be3b8184f139bf6de2bbea4380 | [
"Apache-2.0"
] | null | null | null | import argparse
from openapi_server.annotator.annotate import Annotator
from openapi_server.annotator.load_data import load_files
parser = argparse.ArgumentParser()
parser.add_argument('model_file', type=argparse.FileType('wb'))
parser.add_argument('data_files', nargs='+', type=argparse.FileType('r'))
args = parser.p... | 31.347826 | 73 | 0.733703 |
33d455bd5fed612bc1abafbb048e0ee50e72ae4b | 165 | py | Python | statistics_helper.py | yishayv/lyacorr | deed114b4cadd4971caec68e2838a5fac39827b1 | [
"MIT"
] | 2 | 2017-03-21T14:18:35.000Z | 2020-03-30T20:51:33.000Z | statistics_helper.py | yishayv/lyacorr | deed114b4cadd4971caec68e2838a5fac39827b1 | [
"MIT"
] | null | null | null | statistics_helper.py | yishayv/lyacorr | deed114b4cadd4971caec68e2838a5fac39827b1 | [
"MIT"
] | null | null | null | import numpy as np
def ivar_average(ar_values, ar_sigma):
ar_weights = np.reciprocal(np.square(ar_sigma))
return np.average(ar_values, weights=ar_weights)
| 23.571429 | 52 | 0.763636 |
33d47def5f481dd3df9a82a76dcb79fa6248e86e | 3,654 | py | Python | colormaps.py | ksopan/Plotting_WRF_NetCDF | cbff4ad4310447db2f31b402202f428cef968f14 | [
"MIT"
] | 1 | 2021-09-01T00:42:32.000Z | 2021-09-01T00:42:32.000Z | colormaps.py | ksopan/Plotting_WRF_NetCDF | cbff4ad4310447db2f31b402202f428cef968f14 | [
"MIT"
] | null | null | null | colormaps.py | ksopan/Plotting_WRF_NetCDF | cbff4ad4310447db2f31b402202f428cef968f14 | [
"MIT"
] | 1 | 2019-06-10T01:21:26.000Z | 2019-06-10T01:21:26.000Z | """
@author: Sopan Kurkute
University of Saskatchewan
colormaps.py
Color maps for plotting wrf outputs
"""
import matplotlib
## COLOR MAPS
# define color maps for when the matplotlib ones arent very good
# color maps created with this amazing online hex gradient color generator
# http://www.strangepla... | 42.988235 | 367 | 0.564587 |
33d4bb6ecdf244d4e780e3db2cb6828b376bad4d | 6,383 | py | Python | tests/test_storing/test_csv.py | OctaveLauby/olutils | 9d0741fe2a3ce527be60be2bf1a6904c3340e488 | [
"Apache-2.0"
] | 1 | 2020-10-23T17:11:42.000Z | 2020-10-23T17:11:42.000Z | tests/test_storing/test_csv.py | OctaveLauby/olutils | 9d0741fe2a3ce527be60be2bf1a6904c3340e488 | [
"Apache-2.0"
] | 4 | 2019-05-09T12:53:33.000Z | 2020-12-03T13:49:26.000Z | tests/test_storing/test_csv.py | OctaveLauby/olutils | 9d0741fe2a3ce527be60be2bf1a6904c3340e488 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
import shutil
from collections import OrderedDict
import olutils.storing as lib
TMP_DIR = "tmp"
MOCK_DIR = os.path.join("tests", "mockups")
def assert_content_equal(path, content):
with open(path) as file:
assert file.read() == content
def readout(capfd):
"""Read output"""... | 27.752174 | 79 | 0.517155 |
33d4bba4e26e7bf521cc118b898d2e0057590242 | 29 | py | Python | update_db.py | amoliski/swgoh_vis | 9d0602e738d270134799b0e6d771e701e8e3ff6c | [
"MIT"
] | null | null | null | update_db.py | amoliski/swgoh_vis | 9d0602e738d270134799b0e6d771e701e8e3ff6c | [
"MIT"
] | null | null | null | update_db.py | amoliski/swgoh_vis | 9d0602e738d270134799b0e6d771e701e8e3ff6c | [
"MIT"
] | 1 | 2018-08-01T11:28:14.000Z | 2018-08-01T11:28:14.000Z | import swgoh
swgoh.capture() | 9.666667 | 15 | 0.793103 |
33d4bbd7cbc59ec717c6b49ef5d6c0d6c168a926 | 2,543 | py | Python | clif/testing/python/shared_ptr_proto_member_test.py | wangxf123456/clif | 9bff8a28f5d266d6ea4f4bb0dc1d9c9a0c9ee5b1 | [
"Apache-2.0"
] | 966 | 2017-04-18T04:14:04.000Z | 2022-03-03T21:22:44.000Z | clif/testing/python/shared_ptr_proto_member_test.py | wangxf123456/clif | 9bff8a28f5d266d6ea4f4bb0dc1d9c9a0c9ee5b1 | [
"Apache-2.0"
] | 48 | 2017-05-02T23:51:29.000Z | 2021-12-06T19:10:11.000Z | clif/testing/python/shared_ptr_proto_member_test.py | wangxf123456/clif | 9bff8a28f5d266d6ea4f4bb0dc1d9c9a0c9ee5b1 | [
"Apache-2.0"
] | 135 | 2017-04-26T06:15:30.000Z | 2022-01-07T02:17:20.000Z | # 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 agreed to in writing, ... | 37.955224 | 79 | 0.736138 |
33d4bcf0669530f254b6b80516019d9d97d92fe9 | 604 | py | Python | website/projects/migrations/0001_initial.py | sai-kamal/personal_website | b3edb2848abcbd3fba92ace00170b09c62fc69e2 | [
"MIT"
] | null | null | null | website/projects/migrations/0001_initial.py | sai-kamal/personal_website | b3edb2848abcbd3fba92ace00170b09c62fc69e2 | [
"MIT"
] | null | null | null | website/projects/migrations/0001_initial.py | sai-kamal/personal_website | b3edb2848abcbd3fba92ace00170b09c62fc69e2 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-07-14 09:55
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Projects',
fields=[
('id', models.AutoField... | 25.166667 | 114 | 0.566225 |
33d4beaefdb5724f975f8280f07651ef7e983d4f | 15,056 | py | Python | qiskit/aqua/components/neural_networks/quantum_generator.py | MetcalfeTom/qiskit-aqua | 1718e1612dba38a3f15309c860fe7875914fe8cc | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/components/neural_networks/quantum_generator.py | MetcalfeTom/qiskit-aqua | 1718e1612dba38a3f15309c860fe7875914fe8cc | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/components/neural_networks/quantum_generator.py | MetcalfeTom/qiskit-aqua | 1718e1612dba38a3f15309c860fe7875914fe8cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 41.59116 | 99 | 0.587009 |
33d4ccaec042a6ca9602bd56cef9b2d1d5b135cc | 1,629 | py | Python | test/unittests/test_SEDFEN.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_SEDFEN.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_SEDFEN.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.BMPs.Stream import SEDFEN
class TestSEDFEN(VariableUnitTest):
def test_SEDFEN(self):
z = self.z
np.testing.assert_array_almost_equal(
SEDFEN.SEDFEN_f(z.NYrs, z.DaysMonth, z.Temp, z.InitSnow_0, z.Prec, z.NRur,... | 65.16 | 120 | 0.599754 |
33d509471400245bd40e5a6d0623eed546bebf67 | 7,117 | py | Python | src/interledger/dil.py | SOFIE-project/interledger-asset-transfer | d1c2e5ff7af564b1ac1775772132b48a46c71280 | [
"Apache-2.0"
] | 4 | 2020-12-11T18:46:35.000Z | 2022-01-07T16:58:43.000Z | src/interledger/dil.py | SOFIE-project/interledger-asset-transfer | d1c2e5ff7af564b1ac1775772132b48a46c71280 | [
"Apache-2.0"
] | 3 | 2021-05-11T23:45:18.000Z | 2021-09-02T18:45:25.000Z | src/interledger/dil.py | SOFIE-project/Interledger | d1c2e5ff7af564b1ac1775772132b48a46c71280 | [
"Apache-2.0"
] | 4 | 2020-11-04T15:36:35.000Z | 2021-08-05T12:38:08.000Z | from typing import Union, List
from uuid import uuid4
import asyncio
from .adapter.interfaces import Initiator, Responder, ILStateManager, LedgerType
from .interledger import Interledger
from .transfer import TransferStatus
class DecentralizedInterledger(Interledger):
"""
Class definition of decentralized ex... | 45.916129 | 113 | 0.634256 |
33d50c23476b44b6ceff5565700b4ca559251081 | 4,742 | py | Python | luafun/game/dota2/valveextensions_pb2.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | 1 | 2021-02-06T06:42:29.000Z | 2021-02-06T06:42:29.000Z | luafun/game/dota2/valveextensions_pb2.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | 6 | 2021-04-08T21:46:06.000Z | 2021-05-09T01:40:04.000Z | luafun/game/dota2/valveextensions_pb2.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: valveextensions.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection a... | 49.915789 | 705 | 0.822227 |
33d50fdabfbe32157f4e9fa9d4c78b2faca97d54 | 87,048 | py | Python | hs_core/views/__init__.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_core/views/__init__.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_core/views/__init__.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | import json
import datetime
import pytz
import logging
from drf_yasg.utils import swagger_auto_schema
from django.core.mail import send_mail
from django.contrib.auth import authenticate, login as auth_login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import Group, User
fr... | 45.266771 | 133 | 0.65712 |
33d51bfc218ab93fb52439b1eefed98a4568c4a1 | 5,885 | py | Python | tensorflow/contrib/gan/python/eval/python/summaries_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/gan/python/eval/python/summaries_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/gan/python/eval/python/summaries_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2017 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... | 39.496644 | 81 | 0.741546 |
33d572f7685a8752813576ac41a65a71cf24e475 | 2,339 | py | Python | sdks/python/appcenter_sdk/models/NewCrashGroupAlertingEvent.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/appcenter_sdk/models/NewCrashGroupAlertingEvent.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/appcenter_sdk/models/NewCrashGroupAlertingEvent.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class NewCrashGroupA... | 28.180723 | 83 | 0.562206 |
33d59d00153a5c7e2584948f386145732e809e96 | 1,846 | py | Python | tame_of_thrones/rule_universe.py | rjrajivjha/tame_of_thrones | a2a6b8070de35b42c74076ee92112424f5ea8131 | [
"MIT"
] | null | null | null | tame_of_thrones/rule_universe.py | rjrajivjha/tame_of_thrones | a2a6b8070de35b42c74076ee92112424f5ea8131 | [
"MIT"
] | null | null | null | tame_of_thrones/rule_universe.py | rjrajivjha/tame_of_thrones | a2a6b8070de35b42c74076ee92112424f5ea8131 | [
"MIT"
] | null | null | null | from seasar_cipher import SeasarCipher
class RuleUniverseCheck:
ALLIANCES_REQUIRED = 3
KINGDOM_CODES = {
'air': 'owl',
'fire': 'dragon',
'ice': 'mammoth',
'land': 'panda',
'space': 'gorilla',
'water': 'octopus'
}
def __init__(self, ruler: str) -> None:
... | 36.196078 | 100 | 0.595883 |
33d5c9709a5ed5d757e17321b68d4cf564a76370 | 34,816 | py | Python | mailpile/crypto/gpgi.py | Sebrowsky/Mailpile | 79ff1dd989a0994758fcaccd9154944a32020c46 | [
"Apache-2.0"
] | null | null | null | mailpile/crypto/gpgi.py | Sebrowsky/Mailpile | 79ff1dd989a0994758fcaccd9154944a32020c46 | [
"Apache-2.0"
] | null | null | null | mailpile/crypto/gpgi.py | Sebrowsky/Mailpile | 79ff1dd989a0994758fcaccd9154944a32020c46 | [
"Apache-2.0"
] | null | null | null | #coding:utf-8
import os
import string
import sys
import fcntl
import time
import re
import StringIO
import tempfile
import select
from email.parser import Parser
from email.message import Message
from gettext import gettext as _
from subprocess import Popen, PIPE
from mailpile.crypto.state import *
from mailpile.crypt... | 36.842328 | 410 | 0.488051 |
33d5e8d07d076b8f2e24a4440a0631f026c07907 | 1,647 | py | Python | reverb/server_executable/server_main.py | wookayin/reverb | c4255f10595d05b189f1e5c81f29c70ac600d41f | [
"Apache-2.0"
] | 569 | 2020-06-01T15:05:06.000Z | 2022-03-30T03:26:37.000Z | reverb/server_executable/server_main.py | wookayin/reverb | c4255f10595d05b189f1e5c81f29c70ac600d41f | [
"Apache-2.0"
] | 90 | 2020-06-01T23:28:01.000Z | 2022-03-23T11:02:57.000Z | reverb/server_executable/server_main.py | wookayin/reverb | c4255f10595d05b189f1e5c81f29c70ac600d41f | [
"Apache-2.0"
] | 58 | 2020-06-01T19:25:22.000Z | 2022-03-29T18:02:22.000Z | # Copyright 2019 DeepMind Technologies 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 agr... | 31.673077 | 74 | 0.777778 |
33d5f1099b55d27de5ce0a2bcbf00cde44962c5d | 703 | py | Python | Python-code-snippets-001-100/037-Control desktop App.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-001-100/037-Control desktop App.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-001-100/037-Control desktop App.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | '''
37-Control A Desktop App
Open a desktop program, Notepad.exe in this example,
and interact with it using Pyautogui.
You may need to "pip install pyautogui".
'''
import subprocess
import time
import pyautogui
# Run Notepad.
subprocess.Popen('notepad.exe')
# Give Notepad a chance to open.
# You could increase this ... | 23.433333 | 70 | 0.751067 |
33d60144fb48af9ecdd0ce8948694ea6b96bbee0 | 31 | py | Python | magicdice/constants.py | emre/magicdice | 326512696b766248cfb8998aec5b0bd8bff393ba | [
"MIT"
] | 5 | 2019-02-26T21:59:21.000Z | 2019-05-28T06:32:06.000Z | magicdice/constants.py | emre/magicdice | 326512696b766248cfb8998aec5b0bd8bff393ba | [
"MIT"
] | null | null | null | magicdice/constants.py | emre/magicdice | 326512696b766248cfb8998aec5b0bd8bff393ba | [
"MIT"
] | null | null | null | MAGICDICE_ACCOUNT = "magicdice" | 31 | 31 | 0.83871 |
33d603895c43161ecc01b42671fca10a021b6da3 | 919 | py | Python | python/geeksforgeeks/trees/check_sum.py | othonreyes/code_problems | 6e65b26120b0b9d6e5ac7342a4d964696b7bd5bf | [
"MIT"
] | null | null | null | python/geeksforgeeks/trees/check_sum.py | othonreyes/code_problems | 6e65b26120b0b9d6e5ac7342a4d964696b7bd5bf | [
"MIT"
] | null | null | null | python/geeksforgeeks/trees/check_sum.py | othonreyes/code_problems | 6e65b26120b0b9d6e5ac7342a4d964696b7bd5bf | [
"MIT"
] | null | null | null | """
https://www.geeksforgeeks.org/check-for-children-sum-property-in-a-binary-tree/
"""
class Node:
def __init__(self, v):
self.left = None
self.right = None
self.value = v
def check_sum(n:Node) -> int:
if not n:
return 0
if not n.left and not n.right:
return n.value
if (check_sum(n.left) ... | 21.372093 | 79 | 0.646355 |
33d60d855186aee6345c0419525aa137384dcc3e | 21,569 | py | Python | pyntejos/fit.py | ntejos/pyntejos | ecac98807c33c58e0ced690231991375b89739c9 | [
"BSD-3-Clause"
] | null | null | null | pyntejos/fit.py | ntejos/pyntejos | ecac98807c33c58e0ced690231991375b89739c9 | [
"BSD-3-Clause"
] | null | null | null | pyntejos/fit.py | ntejos/pyntejos | ecac98807c33c58e0ced690231991375b89739c9 | [
"BSD-3-Clause"
] | null | null | null | """Functions for fitting distributions. Code mostly taken from Neil
Crighton's old astro package
"""
from __future__ import division
import numpy as np
import inspect, os
from scipy.special import gammainc
from scipy.optimize import leastsq
import matplotlib.pyplot as pl
import matplotlib.transforms as mtran
from ... | 32.001484 | 79 | 0.582549 |
33d619546e811ca9ee184a3c5b7a4fcd2f300dca | 2,305 | py | Python | shopkit/contrib/contact/models.py | sakkada/django-shopkit | 35e6f8ac73bf6aa40887aa9b1b860d27db8b2975 | [
"BSD-3-Clause"
] | null | null | null | shopkit/contrib/contact/models.py | sakkada/django-shopkit | 35e6f8ac73bf6aa40887aa9b1b860d27db8b2975 | [
"BSD-3-Clause"
] | null | null | null | shopkit/contrib/contact/models.py | sakkada/django-shopkit | 35e6f8ac73bf6aa40887aa9b1b860d27db8b2975 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from ..utils import countries
class Address(models.Model):
customer = models.ForeignKey('Customer', related_name='addressbook')
alias = models.CharField(_("short alias"), max_length... | 39.067797 | 107 | 0.681562 |
33d6241833a95fe9a39b02d450abb712f095149a | 4,072 | py | Python | asgard/app.py | claudeleveille/asgard | 9d85fbef397c9e87dbd6621c1c97013f8f6e7878 | [
"MIT"
] | null | null | null | asgard/app.py | claudeleveille/asgard | 9d85fbef397c9e87dbd6621c1c97013f8f6e7878 | [
"MIT"
] | null | null | null | asgard/app.py | claudeleveille/asgard | 9d85fbef397c9e87dbd6621c1c97013f8f6e7878 | [
"MIT"
] | null | null | null | """Entrypoint and core functions."""
import argparse
import os
import sys
from asgard._version import __version__
from asgard.git import GitRepo
from asgard.semver import SemVer
from asgard.conventionalcommits import ConventionalCommitMsg
def main(args=sys.argv[1:]):
a = parse_args(args)
if a.version:
... | 29.294964 | 113 | 0.576866 |
33d624e5659527d78006730bdd1f4752ba67d069 | 141,283 | py | Python | old_projects/fourier.py | dezren39/manim | 80d7742446c588dc296bd3afb3465a63b63383db | [
"MIT"
] | 1 | 2020-07-05T12:56:31.000Z | 2020-07-05T12:56:31.000Z | old_projects/fourier.py | smithea3/manim | 1d23a01a3ab8a5aab14163ec5c38e7b30e536e54 | [
"MIT"
] | 3 | 2021-09-08T02:19:38.000Z | 2022-03-12T00:41:00.000Z | old_projects/fourier.py | dezren39/manim | 80d7742446c588dc296bd3afb3465a63b63383db | [
"MIT"
] | 1 | 2020-07-05T12:56:33.000Z | 2020-07-05T12:56:33.000Z | # -*- coding: utf-8 -*-
from constants import *
import scipy
from big_ol_pile_of_manim_imports import *
USE_ALMOST_FOURIER_BY_DEFAULT = True
NUM_SAMPLES_FOR_FFT = 1000
DEFAULT_COMPLEX_TO_REAL_FUNC = lambda z : z.real
def get_fourier_graph(
axes, time_func, t_min, t_max,
n_samples = NUM_SAMPLES_FOR_FFT,
... | 32.917754 | 89 | 0.567421 |
33d63996b149c5adf0fcac9ac706fabb44c6d201 | 595 | py | Python | simapp/template.py | tsherburne/ma_sim | 4082da1c80401dec4293415bc9e9239a6bb8185d | [
"BSD-3-Clause"
] | null | null | null | simapp/template.py | tsherburne/ma_sim | 4082da1c80401dec4293415bc9e9239a6bb8185d | [
"BSD-3-Clause"
] | null | null | null | simapp/template.py | tsherburne/ma_sim | 4082da1c80401dec4293415bc9e9239a6bb8185d | [
"BSD-3-Clause"
] | null | null | null | import simpy
import logging
from simmbse import Function
class Template(Function):
def __init__(self, env: simpy.Environment, logger: logging.Logger,
construct_id: str, systemModel: dict, structureItem: dict):
super(Template, self).__init__(env, logger,
... | 29.75 | 80 | 0.613445 |
33d648c0ebc9066ed0f90a581081b5db6b1d437d | 48,910 | py | Python | paddleslim/nas/ofa/layers_old.py | maxpark/PaddleSlim | f6b827fca5f3d9cc467426b8ef30e3a6d2b012b9 | [
"Apache-2.0"
] | 1 | 2021-12-30T08:23:21.000Z | 2021-12-30T08:23:21.000Z | paddleslim/nas/ofa/layers_old.py | maxpark/PaddleSlim | f6b827fca5f3d9cc467426b8ef30e3a6d2b012b9 | [
"Apache-2.0"
] | null | null | null | paddleslim/nas/ofa/layers_old.py | maxpark/PaddleSlim | f6b827fca5f3d9cc467426b8ef30e3a6d2b012b9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... | 46.759082 | 172 | 0.595666 |
33d65891568cf3e4880293f8fc2ee2f7ff14f4dd | 1,837 | py | Python | catalyst/utils/meters/movingaveragevaluemeter.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 2 | 2021-02-22T12:15:41.000Z | 2021-05-02T15:22:24.000Z | catalyst/utils/meters/movingaveragevaluemeter.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/utils/meters/movingaveragevaluemeter.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | 1 | 2018-12-21T15:56:21.000Z | 2018-12-21T15:56:21.000Z | """
Moving average meter calculates average for moving window of values.
"""
import math
import torch
from . import meter
class MovingAverageValueMeter(meter.Meter):
"""
MovingAverageValueMeter stores mean and standard deviation
for population of array that is handled like a queue during updates.
Qu... | 29.15873 | 77 | 0.600435 |
33d6668d52cbd18270f8df53f3d1a93efd211e84 | 645 | py | Python | asg/grammar/__init__.py | aidangoettsch/asg | 130c292f63a3cf118cb311760b4eba00e8bae445 | [
"MIT"
] | 8 | 2020-10-25T01:26:47.000Z | 2021-12-24T15:32:33.000Z | asg/grammar/__init__.py | aidangoettsch/asg | 130c292f63a3cf118cb311760b4eba00e8bae445 | [
"MIT"
] | 5 | 2020-09-04T18:37:21.000Z | 2021-05-29T17:28:51.000Z | asg/grammar/__init__.py | aidangoettsch/asg | 130c292f63a3cf118cb311760b4eba00e8bae445 | [
"MIT"
] | 2 | 2020-10-21T06:09:58.000Z | 2020-12-31T18:35:11.000Z | class Atom:
def __init__(self, name, children):
self.name = name
self.children = children
if None in children:
raise Exception("none in lisp atom")
def __str__(self):
child_string = " ".join(
[str(e) if type(e) != str else f'"{e}"' for e in self.... | 23.888889 | 76 | 0.542636 |
33d672790eb194be24f23a01ef5f41caf4589597 | 8,516 | py | Python | mitmproxy/addons/core.py | takeratta/mitmproxy | 569d275d763f499cce9673fcf118dcc8d59d2eeb | [
"MIT"
] | null | null | null | mitmproxy/addons/core.py | takeratta/mitmproxy | 569d275d763f499cce9673fcf118dcc8d59d2eeb | [
"MIT"
] | null | null | null | mitmproxy/addons/core.py | takeratta/mitmproxy | 569d275d763f499cce9673fcf118dcc8d59d2eeb | [
"MIT"
] | null | null | null | import typing
from mitmproxy import ctx
from mitmproxy import exceptions
from mitmproxy import command
from mitmproxy import flow
from mitmproxy import optmanager
from mitmproxy.net.http import status_codes
class Core:
@command.command("set")
def set(self, *spec: str) -> None:
"""
Set an ... | 32.503817 | 85 | 0.510686 |
33d695ec79ae77acf9ff61a1b8402f9d313e603f | 2,635 | py | Python | scripts/pointnet++/utils/scene_util.py | roboskel/pointcloud2_segments_tools | e90ab5ecc3586f72ee4f1bf2ec73606b39e27aa0 | [
"BSD-3-Clause"
] | null | null | null | scripts/pointnet++/utils/scene_util.py | roboskel/pointcloud2_segments_tools | e90ab5ecc3586f72ee4f1bf2ec73606b39e27aa0 | [
"BSD-3-Clause"
] | null | null | null | scripts/pointnet++/utils/scene_util.py | roboskel/pointcloud2_segments_tools | e90ab5ecc3586f72ee4f1bf2ec73606b39e27aa0 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
""" BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR) """
import numpy as np
from sklearn.neighbors import NearestNeighbors
from numpy import linalg as la
import scipy.io as sio
#input : matrice avec une ligne par point et 3 colonnes : x,y,z
#en coordonnees cartesien... | 34.220779 | 122 | 0.658444 |
33d6977d54798eb23ec589c76fa4f0afdb0386a9 | 1,637 | py | Python | vyperlogix/handlers/autoload.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | 1 | 2020-09-29T01:36:33.000Z | 2020-09-29T01:36:33.000Z | vyperlogix/handlers/autoload.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | vyperlogix/handlers/autoload.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | """
autoload - load common symbols automatically on demand
When a NameError is raised attempt to find the name in a couple places.
Check to see if it's a name in a list of commonly used modules. If it's
found, import the name. If it's not in the common names try importing it.
In either case (assuming the imports suc... | 31.480769 | 76 | 0.63653 |
33d6a0cea5bacda7f68353f11de0e1a2bd1ecc4f | 399 | py | Python | social_dist/wsgi.py | cmput404-project-2021fall/CMPUT404-project-socialdistribution | bbf002e827cda52b443f610139c7c2c5d6003292 | [
"Apache-2.0"
] | null | null | null | social_dist/wsgi.py | cmput404-project-2021fall/CMPUT404-project-socialdistribution | bbf002e827cda52b443f610139c7c2c5d6003292 | [
"Apache-2.0"
] | 2 | 2021-10-10T17:51:01.000Z | 2021-10-16T16:58:54.000Z | social_dist/wsgi.py | cmput404-project-2021fall/CMPUT404-project-socialdistribution | bbf002e827cda52b443f610139c7c2c5d6003292 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for social_dist project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
33d6b71141e75ee27df7e43c6d5691345d18c0e6 | 858 | py | Python | src/Python3/Q101616/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/Q101616/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/Q101616/exsample.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
def get_response(url):
user_agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36'
return requests.get(url, headers={'User-Agent': user_agent}, timeout=2000)
def main():
... | 29.586207 | 128 | 0.600233 |
33d6e124e01c0234449974939ee7b5cfbc2c7d55 | 3,587 | py | Python | utils/lr_scheduler.py | QianChen98/CCLD-Net | 249b8a0d554f7fb1f2b7e4fbfb627f6d9371fc06 | [
"MIT"
] | null | null | null | utils/lr_scheduler.py | QianChen98/CCLD-Net | 249b8a0d554f7fb1f2b7e4fbfb627f6d9371fc06 | [
"MIT"
] | null | null | null | utils/lr_scheduler.py | QianChen98/CCLD-Net | 249b8a0d554f7fb1f2b7e4fbfb627f6d9371fc06 | [
"MIT"
] | null | null | null | # noinspection PyProtectedMember
from torch.optim.lr_scheduler import _LRScheduler, MultiStepLR, CosineAnnealingLR
# noinspection PyAttributeOutsideInit
class GradualWarmupScheduler(_LRScheduler):
""" Gradually warm-up(increasing) learning rate in optimizer.
Proposed in 'Accurate, Large Minibatch SGD: Train... | 39.855556 | 119 | 0.659325 |
33d6f57749bd71c9c6d5d418d08102f0907967a6 | 1,601 | py | Python | src/olympia/addons/forms.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 3 | 2020-03-05T18:17:14.000Z | 2020-03-09T01:24:38.000Z | src/olympia/addons/forms.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1,398 | 2020-10-08T06:32:26.000Z | 2022-03-31T12:06:24.000Z | src/olympia/addons/forms.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2020-06-04T10:18:59.000Z | 2020-06-04T10:18:59.000Z | from django.forms import ModelForm
from django.forms.models import BaseModelFormSet
import olympia.core.logger
from olympia.files.models import File
admin_log = olympia.core.logger.getLogger('z.addons.admin')
class FileStatusForm(ModelForm):
class Meta:
model = File
fields = ('status',)
de... | 30.788462 | 79 | 0.622111 |
33d716c1c68a6eabfbd792ef46991e44e9e621af | 3,404 | py | Python | salt/modules/solaris_shadow.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 1 | 2016-07-07T18:43:05.000Z | 2016-07-07T18:43:05.000Z | salt/modules/solaris_shadow.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | salt/modules/solaris_shadow.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 1 | 2020-12-04T11:28:06.000Z | 2020-12-04T11:28:06.000Z | '''
Manage the shadow file
'''
# Import python libs
import os
try:
import spwd
except ImportError:
pass
# Import salt libs
import salt.utils
def __virtual__():
'''
Only work on posix-like systems
'''
return 'shadow' if __grains__['kernel'] == 'SunOS' else False
def info(name):
'''
... | 24.141844 | 78 | 0.555523 |
33d71c2a6b2d88987199a8fb2d45b8b4117d01e5 | 10,276 | py | Python | examples/face_recognition_knn.py | rggassner/face_recognition | 78b47d7769f56e44c19e6649dfaa91902194df42 | [
"MIT"
] | null | null | null | examples/face_recognition_knn.py | rggassner/face_recognition | 78b47d7769f56e44c19e6649dfaa91902194df42 | [
"MIT"
] | null | null | null | examples/face_recognition_knn.py | rggassner/face_recognition | 78b47d7769f56e44c19e6649dfaa91902194df42 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
This is an example of using the k-nearest-neighbors (KNN) algorithm for face recognition.
When should I use this example?
This example is useful when you wish to recognize a large set of known people,
and make a prediction for an unknown person in a feasible computation time.
Algorithm Descriptio... | 46.497738 | 170 | 0.67429 |
33d73ee702e792908901d2777d42eab1976eac0d | 2,489 | py | Python | mediapipe/framework/calculator_options_pb2.py | mengfu188/simple-mediapipe | 85dc8a87c9586312c2d057ad587bfccf3b5e2eb6 | [
"Apache-2.0"
] | 5 | 2021-01-01T11:02:41.000Z | 2022-03-11T19:44:29.000Z | mediapipe/framework/calculator_options_pb2.py | mengfu188/simple-mediapipe | 85dc8a87c9586312c2d057ad587bfccf3b5e2eb6 | [
"Apache-2.0"
] | null | null | null | mediapipe/framework/calculator_options_pb2.py | mengfu188/simple-mediapipe | 85dc8a87c9586312c2d057ad587bfccf3b5e2eb6 | [
"Apache-2.0"
] | 1 | 2021-04-12T05:59:46.000Z | 2021-04-12T05:59:46.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/framework/calculator_options.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf impo... | 34.09589 | 292 | 0.787063 |
33d776f6d43369cf569eb5db6625197d7b2de5a7 | 407 | py | Python | code_doc/migrations/0010_auto_20150430_1617.py | coordt/code_doc | c2fac64ac3ad61952a2d9f036727166741f9aff9 | [
"BSD-3-Clause"
] | null | null | null | code_doc/migrations/0010_auto_20150430_1617.py | coordt/code_doc | c2fac64ac3ad61952a2d9f036727166741f9aff9 | [
"BSD-3-Clause"
] | null | null | null | code_doc/migrations/0010_auto_20150430_1617.py | coordt/code_doc | c2fac64ac3ad61952a2d9f036727166741f9aff9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [("code_doc", "0009_auto_20150430_1310")]
operations = [
migrations.AlterField(
model_name="author",
name="home_page... | 22.611111 | 63 | 0.641278 |
33d7823e012548b6323c0054bdec33a90cb35d86 | 2,233 | py | Python | examples/plugin_examples/plugin_templates/general/plugin_template4.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | examples/plugin_examples/plugin_templates/general/plugin_template4.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | examples/plugin_examples/plugin_templates/general/plugin_template4.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | # Copyright 2014 Diamond Light Source 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... | 30.589041 | 77 | 0.69682 |
33d78abf61d75f5535dd2a44605997ab7f352ba0 | 13,689 | py | Python | pytorch/aten/src/ATen/nn_parse.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/aten/src/ATen/nn_parse.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/aten/src/ATen/nn_parse.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | import copy
import re
import common_with_cwrap
import yaml
from collections import OrderedDict, defaultdict
try:
# use faster C loader if available
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
# matches `name`, `params` in `name(params)`
NAME_PARAM_REGEX = r'(\w+)\((.*)\... | 35.190231 | 114 | 0.606692 |
33d7ae8f98f74f595dce04ccfaa8a153f83e6740 | 12,771 | py | Python | packages/python/pyfora/aws/Cluster.py | ufora/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 571 | 2015-11-05T20:07:07.000Z | 2022-01-24T22:31:09.000Z | packages/python/pyfora/aws/Cluster.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 218 | 2015-11-05T20:37:55.000Z | 2021-05-30T03:53:50.000Z | packages/python/pyfora/aws/Cluster.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 40 | 2015-11-07T21:42:19.000Z | 2021-05-23T03:48:19.000Z | import collections
import itertools
from pyfora.aws.Launcher import Launcher
def enum_(*keys):
enums = dict(zip(keys, range(len(keys))))
return type('Enum', (), enums)
_EventTypes = enum_('Launching',
'Launched',
'LaunchFailed',
'InstanceStatus',... | 37.125 | 102 | 0.582726 |
33d7d8d02067765ea836d41c0042ccb9a38796a8 | 13,122 | py | Python | xonsh/ptk_shell/key_bindings.py | deeuu/xonsh | 580b675f1a146e7f029eee1b0c1ccc1d770566ab | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xonsh/ptk_shell/key_bindings.py | deeuu/xonsh | 580b675f1a146e7f029eee1b0c1ccc1d770566ab | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xonsh/ptk_shell/key_bindings.py | deeuu/xonsh | 580b675f1a146e7f029eee1b0c1ccc1d770566ab | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-07-15T01:35:50.000Z | 2020-07-15T01:35:50.000Z | # -*- coding: utf-8 -*-
"""Key bindings for prompt_toolkit xonsh shell."""
import builtins
from prompt_toolkit import search
from prompt_toolkit.application.current import get_app
from prompt_toolkit.enums import DEFAULT_BUFFER
from prompt_toolkit.filters import (
Condition,
IsMultiline,
HasSelection,
... | 33.304569 | 85 | 0.677336 |
33d7f4d8d97750e70c35b7eb2fd9023b301b744c | 4,813 | py | Python | src/data_parser.py | Harish-G007/RSS | 2e920b2714bb0c9ec731df7a2b1d315a4a06ceca | [
"MIT"
] | 14 | 2019-11-20T22:18:43.000Z | 2021-12-12T19:00:59.000Z | src/data_parser.py | Harish-G007/RSS | 2e920b2714bb0c9ec731df7a2b1d315a4a06ceca | [
"MIT"
] | null | null | null | src/data_parser.py | Harish-G007/RSS | 2e920b2714bb0c9ec731df7a2b1d315a4a06ceca | [
"MIT"
] | 4 | 2020-07-28T07:17:32.000Z | 2021-09-20T02:12:18.000Z | from bs4 import BeautifulSoup
import re
import pprint
from content_fetcher import get_response
def get_soup(url):
response = get_response(url)
# print(f"Making soup object for : {url}")
soup = BeautifulSoup(response, 'lxml-xml')#'html.parser')
# print("Returning parseable xml object")
return soup
def parse_rec... | 32.741497 | 82 | 0.688136 |
33d82af268ab3386619399b3fdcab1ad433c5a4b | 2,252 | py | Python | Tools/scripts/smelly.py | masamitsu-murase/stackless | 677b36ffe5cb5a0f4b8d3abfa20982c8d82ffb92 | [
"CNRI-Python-GPL-Compatible"
] | 854 | 2017-09-11T16:42:28.000Z | 2022-03-27T14:17:09.000Z | Tools/scripts/smelly.py | masamitsu-murase/stackless | 677b36ffe5cb5a0f4b8d3abfa20982c8d82ffb92 | [
"CNRI-Python-GPL-Compatible"
] | 164 | 2017-09-24T20:40:32.000Z | 2021-10-30T01:35:05.000Z | Tools/scripts/smelly.py | masamitsu-murase/stackless | 677b36ffe5cb5a0f4b8d3abfa20982c8d82ffb92 | [
"CNRI-Python-GPL-Compatible"
] | 73 | 2017-09-13T18:07:48.000Z | 2022-03-17T13:02:29.000Z | #!/usr/bin/env python
# Script checking that all symbols exported by libpython start with Py or _Py
import subprocess
import sys
import sysconfig
def get_exported_symbols():
LIBRARY = sysconfig.get_config_var('LIBRARY')
if not LIBRARY:
raise Exception("failed to get LIBRARY")
args = ('nm', '-p',... | 26.809524 | 80 | 0.616341 |
33d870042f57db61298b4e5097d9d46c5bce6174 | 2,005 | py | Python | python/phonenumbers/data/region_CU.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 2 | 2019-03-30T02:12:54.000Z | 2021-03-08T18:59:40.000Z | python/phonenumbers/data/region_CU.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/data/region_CU.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 1 | 2018-11-10T03:47:34.000Z | 2018-11-10T03:47:34.000Z | """Auto-generated file, do not edit by hand. CU metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_CU = PhoneMetadata(id='CU', country_code=53, international_prefix='119',
general_desc=PhoneNumberDesc(national_number_pattern='[2-57]\\d{5,7}', possible_number_pattern... | 91.136364 | 215 | 0.741147 |
33d8846662dc05ee542ba5e8b258a183fda0f739 | 4,037 | py | Python | neuralmonkey/processors/editops.py | Simon-Will/neuralmonkey | b686a9d302cb10eda5fca991e1d7ee6b9e84b75a | [
"BSD-3-Clause"
] | 5 | 2017-04-24T21:10:03.000Z | 2019-05-22T13:19:35.000Z | neuralmonkey/processors/editops.py | Simon-Will/neuralmonkey | b686a9d302cb10eda5fca991e1d7ee6b9e84b75a | [
"BSD-3-Clause"
] | null | null | null | neuralmonkey/processors/editops.py | Simon-Will/neuralmonkey | b686a9d302cb10eda5fca991e1d7ee6b9e84b75a | [
"BSD-3-Clause"
] | 5 | 2017-04-25T01:36:44.000Z | 2019-12-13T15:04:03.000Z | from typing import Any, Callable, Dict, Iterable, List
import numpy as np
from neuralmonkey.dataset import Dataset
# pylint: disable=too-few-public-methods
class Preprocess(object):
"""Preprocessor transorming two series into series of edit operations."""
def __init__(self, source_id: str, target_id: str) ... | 30.353383 | 79 | 0.58806 |
33d8a5eb23baffe2e7336538d5863aaa1740e2dc | 873 | py | Python | example/fl2.py | anshul96go/toolbox | f60ba0b885eb0eb4786f6e56260073f923a7f844 | [
"MIT"
] | null | null | null | example/fl2.py | anshul96go/toolbox | f60ba0b885eb0eb4786f6e56260073f923a7f844 | [
"MIT"
] | null | null | null | example/fl2.py | anshul96go/toolbox | f60ba0b885eb0eb4786f6e56260073f923a7f844 | [
"MIT"
] | null | null | null | import qnt.data as qndata
import qnt.stats as qnstats
import qnt.xr_talib as qnxrtalib
import qnt.forward_looking as qnfl
import xarray as xr
# this function will be called twice
# - with the entire data
# - with the data excluding last year
def strategy():
data = qndata.load_cryptocurrency_data()
wma = qnxrt... | 31.178571 | 71 | 0.744559 |
33d8cefb8efb8cf3877c7f01570d65413aa09fc2 | 557 | py | Python | oscar/lib/python2.7/site-packages/faker/providers/company/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/company/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/company/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
from __future__ import unicode_literals
from .. import BaseProvider
localized = True
class Provider(BaseProvider):
formats = ['{{last_name}} {{company_suffix}}', ]
company_suffixes = ['Ltd', ]
def company(self):
"""
:example 'Acme Ltd'
"""
... | 20.62963 | 58 | 0.583483 |
33d9048282f4b100b3207bba8b4b9c83a02ed343 | 120,298 | py | Python | conans/client/command.py | chhitz/conan | f361690beae3608d93a8d79dec7abb24f75ddd85 | [
"MIT"
] | null | null | null | conans/client/command.py | chhitz/conan | f361690beae3608d93a8d79dec7abb24f75ddd85 | [
"MIT"
] | null | null | null | conans/client/command.py | chhitz/conan | f361690beae3608d93a8d79dec7abb24f75ddd85 | [
"MIT"
] | null | null | null | import argparse
import inspect
import json
import os
import signal
import sys
from argparse import ArgumentError
from difflib import get_close_matches
from six.moves import input as user_input
from conans import __version__ as client_version
from conans.client.cmd.frogarian import cmd_frogarian
from conans.client.cmd... | 55.207894 | 101 | 0.557499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.