hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74cef877401662b62cbbeba5e8034a41ed879807 | 4,584 | py | Python | CNN/model_main.py | jasonhuh/CarND-Capstone | 2fad85fc815712c07cdf279040592eaad81d2722 | [
"MIT"
] | null | null | null | CNN/model_main.py | jasonhuh/CarND-Capstone | 2fad85fc815712c07cdf279040592eaad81d2722 | [
"MIT"
] | null | null | null | CNN/model_main.py | jasonhuh/CarND-Capstone | 2fad85fc815712c07cdf279040592eaad81d2722 | [
"MIT"
] | null | null | null | # 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... | 40.928571 | 80 | 0.704407 |
e6380bc50b01cfbc74e4263da2930f3d829c8daf | 4,454 | py | Python | tests/test_simple.py | trimQiu/uiautomator2 | e69ff8985cb7c4bd5898a221ab5a2988d1ddd69d | [
"MIT"
] | null | null | null | tests/test_simple.py | trimQiu/uiautomator2 | e69ff8985cb7c4bd5898a221ab5a2988d1ddd69d | [
"MIT"
] | null | null | null | tests/test_simple.py | trimQiu/uiautomator2 | e69ff8985cb7c4bd5898a221ab5a2988d1ddd69d | [
"MIT"
] | null | null | null | # coding: utf-8
#
# Test apk Download from
# https://github.com/appium/java-client/raw/master/src/test/java/io/appium/java_client/ApiDemos-debug.apk
import uiautomator2 as u2
import unittest
import time
class SimpleTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.d = u2.connect()
... | 32.510949 | 105 | 0.589807 |
e2156dcd650205a2495be1c876512658e0dd13b9 | 1,138 | py | Python | src/airobot/cfgs/yumi_palms_cfg.py | weiqiao/airobot | 5f9c6f239a16f31f8923131e144b360f71a89a93 | [
"MIT"
] | null | null | null | src/airobot/cfgs/yumi_palms_cfg.py | weiqiao/airobot | 5f9c6f239a16f31f8923131e144b360f71a89a93 | [
"MIT"
] | null | null | null | src/airobot/cfgs/yumi_palms_cfg.py | weiqiao/airobot | 5f9c6f239a16f31f8923131e144b360f71a89a93 | [
"MIT"
] | null | null | null | from airobot.cfgs.assets.pybullet_camera import get_sim_cam_cfg
from airobot.cfgs.assets.realsense_camera import get_realsense_cam_cfg
from airobot.cfgs.assets.yumi_dual_arm import get_yumi_dual_arm_cfg
_C = get_yumi_dual_arm_cfg()
_C.ROBOT_DESCRIPTION = '/robot_description'
_C.PYBULLET_URDF = 'yumi_gelslim_palm.urdf... | 33.470588 | 70 | 0.775044 |
c205b97cc317ed396c5c42106a322980a52bd711 | 3,519 | py | Python | python_modules/dagster/dagster/core/storage/runs/schema.py | kyohei3/dagster | 60319ba89d765abdd77a0934ca90eeb154f66a03 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/storage/runs/schema.py | kyohei3/dagster | 60319ba89d765abdd77a0934ca90eeb154f66a03 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/storage/runs/schema.py | kyohei3/dagster | 60319ba89d765abdd77a0934ca90eeb154f66a03 | [
"Apache-2.0"
] | null | null | null | import sqlalchemy as db
from ..sql import MySQLCompatabilityTypes, get_current_timestamp
RunStorageSqlMetadata = db.MetaData()
RunsTable = db.Table(
"runs",
RunStorageSqlMetadata,
db.Column("id", db.Integer, primary_key=True, autoincrement=True),
db.Column("run_id", db.String(255), unique=True),
... | 38.67033 | 97 | 0.716397 |
c93376b41172ed2d017b79837b2dc5373986223b | 388 | py | Python | app/models/__init__.py | Midas0615/react-flask-E-commerce | 0d18409e9b58363b8035cce96b930602ec648fbd | [
"MIT"
] | 54 | 2017-08-22T05:59:11.000Z | 2021-09-28T06:48:23.000Z | app/models/__init__.py | Midas0615/react-flask-E-commerce | 0d18409e9b58363b8035cce96b930602ec648fbd | [
"MIT"
] | 5 | 2021-02-08T20:14:18.000Z | 2021-12-13T19:36:25.000Z | app/models/__init__.py | Midas0615/react-flask-E-commerce | 0d18409e9b58363b8035cce96b930602ec648fbd | [
"MIT"
] | 30 | 2017-10-24T19:36:17.000Z | 2021-11-03T04:41:50.000Z | # -*- coding: utf-8 -*-
from utils import *
from prototype import *
from wallet import *
from mailer import *
from notifications import *
from review import *
from webutils import *
from search import *
from item import *
from collection import *
from user import *
from order import *
from lend import *
from admin imp... | 19.4 | 27 | 0.742268 |
73056252de0c7cf3ca84d8752d14003cf730eea8 | 7,328 | py | Python | asteroids/pages/multiplayer_host.py | rohinivsenthil/Asteroids | 75baf2c65515002c72088695eda54c66bc963eb9 | [
"MIT"
] | 8 | 2019-05-25T19:11:46.000Z | 2019-07-04T14:59:20.000Z | asteroids/pages/multiplayer_host.py | rohinivsenthil/Asteroids | 75baf2c65515002c72088695eda54c66bc963eb9 | [
"MIT"
] | null | null | null | asteroids/pages/multiplayer_host.py | rohinivsenthil/Asteroids | 75baf2c65515002c72088695eda54c66bc963eb9 | [
"MIT"
] | null | null | null | import json
import random
import socket
import pygame
from pygame.locals import *
from ..sprites import AlternativeSpaceship, Asteroid, Spaceship
from .common import collide_asteroids_bullets, do_actions, get_actions, draw
with open("config.json") as configfile:
config = json.load(configfile)
FRAME... | 37.387755 | 95 | 0.458788 |
32252b5fae32b380b5e7bfec39a6bfeb4918bbbb | 4,623 | py | Python | MobileNetV2.py | redwankarimsony/SSD-Mobilenet-People-Detection | 3cd0976c82677912a5dae62fc34b3c7b3980685c | [
"MIT"
] | null | null | null | MobileNetV2.py | redwankarimsony/SSD-Mobilenet-People-Detection | 3cd0976c82677912a5dae62fc34b3c7b3980685c | [
"MIT"
] | null | null | null | MobileNetV2.py | redwankarimsony/SSD-Mobilenet-People-Detection | 3cd0976c82677912a5dae62fc34b3c7b3980685c | [
"MIT"
] | null | null | null | import torch.nn as nn
import math
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def conv_bn(inp, oup, stride):
return nn.Sequential(
nn.Conv2d(inp, oup, 3, stride, 1, bias=False),
nn.BatchNorm2d(oup),
nn.ReLU6(inplace=True)
)
def conv_1x1_bn(inp, ... | 33.5 | 97 | 0.540558 |
898bd1a0389a2a3175559af28bdde7a1e79901de | 1,913 | py | Python | scripts/experimental/pca_data_model_run.py | fpl-analytics/gr_crypto | 2b0ab451c9c205a9f572c4bca23fffbb68ca188f | [
"MIT"
] | null | null | null | scripts/experimental/pca_data_model_run.py | fpl-analytics/gr_crypto | 2b0ab451c9c205a9f572c4bca23fffbb68ca188f | [
"MIT"
] | null | null | null | scripts/experimental/pca_data_model_run.py | fpl-analytics/gr_crypto | 2b0ab451c9c205a9f572c4bca23fffbb68ca188f | [
"MIT"
] | null | null | null | # PCA Data
# Using preprocessed data in R. Taking a PCA (200 cols) of 60 mins of returns
# This worked pretty well in R. Got ~ 75% up/down accuracy
# I want to see how well a neural network will work
import os
import pandas as pd
import numpy as np
import tensorflow as tf
root_folder = os.getcwd() + "\data\working"
pc... | 31.360656 | 77 | 0.642446 |
75a324a7c5cbd4baddc19ff9d3cebd3e2b7f86cb | 420 | py | Python | 0801-0900/0844-Backspace String Compare/0844-Backspace String Compare.py | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 0801-0900/0844-Backspace String Compare/0844-Backspace String Compare.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 0801-0900/0844-Backspace String Compare/0844-Backspace String Compare.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | import itertools
class Solution:
def backspaceCompare(self, S: str, T: str) -> bool:
def getNext(s):
b = 0
for c in reversed(s):
if c == '#':
b += 1
elif b > 0:
b -= 1
else:
yi... | 28 | 84 | 0.4 |
90f0586b50dc64b38f0986bcda0eefddd51c8e4e | 4,572 | py | Python | model/unet.py | arshad2101/adas-tensorflow | 27320a7313e9c4c791f4d60534fbf39819025f60 | [
"MIT"
] | 178 | 2018-02-14T02:23:52.000Z | 2022-03-26T03:44:32.000Z | model/unet.py | arshad2101/adas-tensorflow | 27320a7313e9c4c791f4d60534fbf39819025f60 | [
"MIT"
] | 5 | 2018-03-27T17:42:49.000Z | 2021-01-25T01:39:54.000Z | model/unet.py | arshad2101/adas-tensorflow | 27320a7313e9c4c791f4d60534fbf39819025f60 | [
"MIT"
] | 68 | 2018-03-08T15:12:28.000Z | 2022-03-22T04:20:41.000Z | from keras.models import Model
from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Conv2DTranspose, Activation
from keras.layers import BatchNormalization
from keras.optimizers import Adam
from keras import backend as K
def dice_coef(y_true, y_pred):
return (2. * K.sum(y_true * y_pred) + 1.) / (K.s... | 30.278146 | 94 | 0.6028 |
24c84ed642ee86b201289751857a84bedab8905b | 22,547 | py | Python | statsmodels/tools/grouputils.py | haribharadwaj/statsmodels | 8675b890607fe6f116b1186dcba4c387c5e3778a | [
"BSD-3-Clause"
] | 34 | 2018-07-13T11:30:46.000Z | 2022-01-05T13:48:10.000Z | venv/lib/python3.6/site-packages/statsmodels/tools/grouputils.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 6 | 2015-08-28T16:59:03.000Z | 2019-04-12T22:29:01.000Z | venv/lib/python3.6/site-packages/statsmodels/tools/grouputils.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 28 | 2015-04-01T20:02:25.000Z | 2021-07-03T00:09:28.000Z | # -*- coding: utf-8 -*-
"""Tools for working with groups
This provides several functions to work with groups and a Group class that
keeps track of the different representations and has methods to work more
easily with groups.
Author: Josef Perktold,
Author: Nathaniel Smith, recipe for sparse_dummies on scipy user ma... | 34.213961 | 79 | 0.562514 |
8221769b3762b20adfff7b39da62872158b3ee0c | 421 | py | Python | hammer_systems_project/hammer_systems_project/wsgi.py | ADYason/hammer_systems_test | 19a6235b5d48093e3d2106c771d69f6f0211e861 | [
"MIT"
] | null | null | null | hammer_systems_project/hammer_systems_project/wsgi.py | ADYason/hammer_systems_test | 19a6235b5d48093e3d2106c771d69f6f0211e861 | [
"MIT"
] | null | null | null | hammer_systems_project/hammer_systems_project/wsgi.py | ADYason/hammer_systems_test | 19a6235b5d48093e3d2106c771d69f6f0211e861 | [
"MIT"
] | null | null | null | """
WSGI config for hammer_systems_project 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/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefaul... | 24.764706 | 82 | 0.800475 |
28c96574a24383a72819dd2d21c96ce7258e253f | 4,393 | py | Python | src/OTLMOW/PostenMapping/Model/Post060361416.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/PostenMapping/Model/Post060361416.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/PostenMapping/Model/Post060361416.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | # coding=utf-8
from OTLMOW.PostenMapping.StandaardPost import StandaardPost
from OTLMOW.PostenMapping.StandaardPostMapping import StandaardPostMapping
# Generated with PostenCreator. To modify: extend, do not edit
class Post060361416(StandaardPost):
def __init__(self):
super().__init__(
nummer... | 48.274725 | 143 | 0.575233 |
228cae2f19d54f7ff28e589aaa391cfa99676604 | 8,575 | py | Python | homeassistant/components/facebox/image_processing.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2019-10-15T16:55:31.000Z | 2020-02-18T21:10:31.000Z | homeassistant/components/facebox/image_processing.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | homeassistant/components/facebox/image_processing.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """Component for facial detection and identification via facebox."""
import base64
import logging
import requests
import voluptuous as vol
from homeassistant.const import ATTR_ENTITY_ID, ATTR_NAME
from homeassistant.core import split_entity_id
import homeassistant.helpers.config_validation as cv
from homeassistant.co... | 31.525735 | 87 | 0.634286 |
87d526637859ab5f3087825c5579a1fd0963aeff | 9,286 | py | Python | neutron/tests/tempest/services/botoclients.py | NeCTAR-RC/neutron | acf78cc3c88aff638180819419a65145a9a79695 | [
"Apache-2.0"
] | 1 | 2019-01-13T04:42:21.000Z | 2019-01-13T04:42:21.000Z | neutron/tests/tempest/services/botoclients.py | NeCTAR-RC/neutron | acf78cc3c88aff638180819419a65145a9a79695 | [
"Apache-2.0"
] | null | null | null | neutron/tests/tempest/services/botoclients.py | NeCTAR-RC/neutron | acf78cc3c88aff638180819419a65145a9a79695 | [
"Apache-2.0"
] | null | null | null | # Copyright 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 requ... | 42.792627 | 79 | 0.57129 |
ae59d14aa45d7a5fac9341993a541c0aca11879e | 2,546 | py | Python | SALAMI_download.py | fn2189/cnn-music-structure | 9b89cda68f8974997d7dec3854c75fbbef4e71f4 | [
"MIT"
] | 2 | 2020-06-02T16:09:28.000Z | 2021-01-13T11:40:37.000Z | SALAMI_download.py | fn2189/cnn-music-structure | 9b89cda68f8974997d7dec3854c75fbbef4e71f4 | [
"MIT"
] | null | null | null | SALAMI_download.py | fn2189/cnn-music-structure | 9b89cda68f8974997d7dec3854c75fbbef4e71f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This script downloads all the song files from the URLs included in the
id_index_internetarchive.csv file contained in the SALAMI data set.
The downloaded files will be saved as song_id.mp3.
Usage:
python SALAMI_download.py csv_file output_dir
This program is free software: you can redistr... | 34.876712 | 73 | 0.684603 |
da7427c31e89c1f9fee3e531739bc3c804472090 | 2,469 | py | Python | insta_app/models.py | JeromeMberia/instagram-clone | b635d24fae67374b1eb72e8de93dd072a3e59ead | [
"MIT"
] | null | null | null | insta_app/models.py | JeromeMberia/instagram-clone | b635d24fae67374b1eb72e8de93dd072a3e59ead | [
"MIT"
] | 4 | 2021-06-08T21:41:58.000Z | 2022-03-12T00:32:39.000Z | insta_app/models.py | JeromeMberia/instagram-clone | b635d24fae67374b1eb72e8de93dd072a3e59ead | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from tinymce.models import HTMLField
from cloudinary.models import CloudinaryField
# Create your models here.
class Profile(models.Model):
name = models.ForeignKey(User,on_delete=models.CASCADE)
profile_photo = CloudinaryField('image')
... | 27.433333 | 98 | 0.682868 |
3e376c90f22fc10758616e77fb1c9430b44120b2 | 9,064 | py | Python | airflow/contrib/operators/ecs_operator.py | crunchbase/incubator-airflow | 903e37a09f05f4ab022bb7153be8dc62b3d9da99 | [
"Apache-2.0"
] | null | null | null | airflow/contrib/operators/ecs_operator.py | crunchbase/incubator-airflow | 903e37a09f05f4ab022bb7153be8dc62b3d9da99 | [
"Apache-2.0"
] | 22 | 2019-12-09T23:22:07.000Z | 2021-05-12T23:15:40.000Z | airflow/contrib/operators/ecs_operator.py | crunchbase/incubator-airflow | 903e37a09f05f4ab022bb7153be8dc62b3d9da99 | [
"Apache-2.0"
] | 5 | 2019-11-18T13:19:29.000Z | 2020-03-25T13:20:29.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 41.962963 | 115 | 0.652471 |
552c410668701cd1585658195d593e1b5751e350 | 442 | py | Python | code-everyday-challenge/n159_cyclically_rotate.py | ved93/deliberate-practice-challenges | 2fccdbb9d2baaa16f888055c081a8d04804c0045 | [
"MIT"
] | null | null | null | code-everyday-challenge/n159_cyclically_rotate.py | ved93/deliberate-practice-challenges | 2fccdbb9d2baaa16f888055c081a8d04804c0045 | [
"MIT"
] | null | null | null | code-everyday-challenge/n159_cyclically_rotate.py | ved93/deliberate-practice-challenges | 2fccdbb9d2baaa16f888055c081a8d04804c0045 | [
"MIT"
] | null | null | null |
# https://practice.geeksforgeeks.org/problems/cyclically-rotate-an-array-by-one2614/1
# Given an array, rotate the array by one position in clock-wise direction.
# Input:
# N = 5
# A[] = {1, 2, 3, 4, 5}
# Output:
# 5 1 2 3 4
def rotate_cycle(a):
n = len(a)
tmp = a[-1]
for i in range(1,n):
a[-i] ... | 17.68 | 85 | 0.567873 |
e735adc8a49ad2e01c7fd99cc53bf64c5567bbe3 | 18,953 | py | Python | python/datasources/acs_population.py | jenniebrown/health-equity-tracker | 46a715165eb3997a33f3d180b410dfd2c3ee850f | [
"MIT"
] | null | null | null | python/datasources/acs_population.py | jenniebrown/health-equity-tracker | 46a715165eb3997a33f3d180b410dfd2c3ee850f | [
"MIT"
] | null | null | null | python/datasources/acs_population.py | jenniebrown/health-equity-tracker | 46a715165eb3997a33f3d180b410dfd2c3ee850f | [
"MIT"
] | null | null | null | import pandas
from ingestion.standardized_columns import (HISPANIC_COL, RACE_COL,
STATE_FIPS_COL, COUNTY_FIPS_COL,
STATE_NAME_COL, COUNTY_NAME_COL,
POPULATION_COL, AGE_COL, SEX_COL,
... | 42.400447 | 83 | 0.660107 |
acd448b94726446122de9bd045857c3a42702c61 | 14,117 | py | Python | pygmt/figure.py | ankitdobhal/pygmt | 88fafa5af57d2b182e0dbac7017912f2d8cabfa0 | [
"BSD-3-Clause"
] | null | null | null | pygmt/figure.py | ankitdobhal/pygmt | 88fafa5af57d2b182e0dbac7017912f2d8cabfa0 | [
"BSD-3-Clause"
] | 24 | 2021-02-12T08:12:30.000Z | 2022-02-08T13:04:23.000Z | pygmt/figure.py | claudiodsf/pygmt | 955a55ed98e4aa7c88b9cea27429cd01c1a0d4c6 | [
"BSD-3-Clause"
] | null | null | null | """
Define the Figure class that handles all plotting.
"""
import base64
import os
from tempfile import TemporaryDirectory
try:
from IPython.display import Image
except ImportError:
Image = None
from pygmt.clib import Session
from pygmt.exceptions import GMTError, GMTInvalidInput
from pygmt.helpers import (
... | 35.559194 | 90 | 0.57158 |
1bf196727c0eee745baeb89f461e6d2821379e0f | 8,188 | py | Python | main.py | paper508/ATON | 8bc25e42c97756a2a0929aa80e3dd34b2b2372e8 | [
"MIT"
] | null | null | null | main.py | paper508/ATON | 8bc25e42c97756a2a0929aa80e3dd34b2b2372e8 | [
"MIT"
] | null | null | null | main.py | paper508/ATON | 8bc25e42c97756a2a0929aa80e3dd34b2b2372e8 | [
"MIT"
] | null | null | null | import os
import ast
import glob
import time, datetime
import argparse
import pandas as pd
import numpy as np
from prettytable import PrettyTable
from model_aton.ATON import ATON
from model_aton.ATON_ablation import ATONabla
from model_aton.ATON_ablation2 import ATONabla2
from model_aton.ATON_ablation3 import ATONabla... | 39.177033 | 119 | 0.620176 |
d8209022d159ce9db0c7ba10edebc0981022194d | 126 | py | Python | tests/resources/mockapp/models.py | andreashug/django-ultimatethumb | dcb38eaee399b29fd3d27c7326769f075482ea9f | [
"BSD-3-Clause"
] | 4 | 2015-03-23T15:58:13.000Z | 2020-04-10T00:02:32.000Z | tests/resources/mockapp/models.py | andreashug/django-ultimatethumb | dcb38eaee399b29fd3d27c7326769f075482ea9f | [
"BSD-3-Clause"
] | 23 | 2015-05-12T10:35:01.000Z | 2021-09-08T00:09:01.000Z | tests/resources/mockapp/models.py | stephrdev/django-ultimatethumb | bb14a8d82041453f34439b82cb054a8de7e7bc8b | [
"BSD-3-Clause"
] | 4 | 2015-06-30T09:06:00.000Z | 2021-09-28T13:52:53.000Z | from django.db import models
class ImageModel(models.Model):
file = models.ImageField(upload_to='mockapp/imagemodels/')
| 21 | 62 | 0.769841 |
4e2d265360fdc09d582d3fe717162d0381a69620 | 1,133 | py | Python | tests/test_parser.py | UL-SnT-Serval/python-config-parser | 242585b86d9fccf122ca5866d6a523928a6b910c | [
"MIT"
] | null | null | null | tests/test_parser.py | UL-SnT-Serval/python-config-parser | 242585b86d9fccf122ca5866d6a523928a6b910c | [
"MIT"
] | null | null | null | tests/test_parser.py | UL-SnT-Serval/python-config-parser | 242585b86d9fccf122ca5866d6a523928a6b910c | [
"MIT"
] | null | null | null | import pytest
from config_parser.parser import ConfigFileParser, InlineJsonParser, StrParser
@pytest.mark.parametrize(
"str_input,dic_out",
[
("key1=abc", {"key1": "abc"}),
("key1.key2=3", {"key1": {"key2": 3}}),
("key1=", None),
],
)
def test_str_parser(str_input, dic_out):
s... | 25.177778 | 78 | 0.576346 |
8e6263f471e1092d9bd5d72ea2dd751b0c420938 | 1,487 | py | Python | tests/test_inference.py | BioinfoTongLI/deepBlink | aa819b71f380507f9fcfa0664ab0f5a8eca4b209 | [
"MIT"
] | 13 | 2020-07-02T13:15:55.000Z | 2022-01-17T13:16:27.000Z | tests/test_inference.py | BioinfoTongLI/deepBlink | aa819b71f380507f9fcfa0664ab0f5a8eca4b209 | [
"MIT"
] | 71 | 2020-06-29T08:43:20.000Z | 2022-03-29T12:03:09.000Z | tests/test_inference.py | BioinfoTongLI/deepBlink | aa819b71f380507f9fcfa0664ab0f5a8eca4b209 | [
"MIT"
] | 5 | 2020-09-18T12:32:12.000Z | 2021-11-03T07:33:43.000Z | """Unittests for the deepblink.inference module."""
# pylint: disable=missing-function-docstring,redefined-outer-name
import numpy as np
import pytest
import tensorflow as tf
from deepblink.inference import get_intensities
from deepblink.inference import predict
from deepblink.losses import combined_bce_rmse
from dee... | 27.537037 | 88 | 0.67653 |
277737b01f4765ba89884188f7b02dde86182e4a | 765 | py | Python | migrations/versions/53119f86c67_.py | PyGotham/pygotham | 310508c16dabf2ce9aaf0c2624132d725f71143b | [
"BSD-3-Clause"
] | 19 | 2015-03-03T19:50:55.000Z | 2019-11-19T17:55:33.000Z | migrations/versions/53119f86c67_.py | PyGotham/pygotham | 310508c16dabf2ce9aaf0c2624132d725f71143b | [
"BSD-3-Clause"
] | 124 | 2015-01-23T06:28:44.000Z | 2020-10-03T12:59:30.000Z | migrations/versions/53119f86c67_.py | PyGotham/pygotham | 310508c16dabf2ce9aaf0c2624132d725f71143b | [
"BSD-3-Clause"
] | 21 | 2015-04-15T03:01:07.000Z | 2020-10-03T12:55:38.000Z | """Add cost and limit to sponsor levels.
Revision ID: 53119f86c67
Revises: f34e9df528
Create Date: 2014-07-04 12:11:41.018911
"""
# revision identifiers, used by Alembic.
revision = '53119f86c67'
down_revision = 'f34e9df528'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto gener... | 26.37931 | 84 | 0.698039 |
32825e4338a4085687c7e99123ee1bb3dbcceaed | 4,787 | py | Python | pylabnet/network/client_server/agilent_e4405B.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | 10 | 2020-01-07T23:28:49.000Z | 2022-02-02T19:09:17.000Z | pylabnet/network/client_server/agilent_e4405B.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | 249 | 2019-12-28T19:38:49.000Z | 2022-03-28T16:45:32.000Z | pylabnet/network/client_server/agilent_e4405B.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | 5 | 2020-11-17T19:45:10.000Z | 2022-01-04T18:07:04.000Z |
import pickle
import numpy as np
import matplotlib.pyplot as plt
from pylabnet.network.core.service_base import ServiceBase
from pylabnet.network.core.client_base import ClientBase
class Service(ServiceBase):
def exposed_reset(self):
return self._module.reset()
def exposed_display_off(self):
... | 31.287582 | 146 | 0.669731 |
58a4894a45958f423fdea3ef657c7a3fd9be2d2b | 60 | py | Python | lib/constants/unet_model_args_info.py | sergevkim/ImageEnhancement | b0aa17aa79230ccc9d087b70ea0f31d8a038b9d1 | [
"MIT"
] | null | null | null | lib/constants/unet_model_args_info.py | sergevkim/ImageEnhancement | b0aa17aa79230ccc9d087b70ea0f31d8a038b9d1 | [
"MIT"
] | null | null | null | lib/constants/unet_model_args_info.py | sergevkim/ImageEnhancement | b0aa17aa79230ccc9d087b70ea0f31d8a038b9d1 | [
"MIT"
] | null | null | null | from pathlib import Path
UNET_MODEL_ARGS_INFO = {} #TODO
| 10 | 31 | 0.75 |
ce8636aebd4a720c46a69c8d83738c84b49c119f | 13,802 | py | Python | data/msmarco_data.py | ninjascant/ANCE-reproduction | 39258f5824d00fede624f11caaccab15bc254502 | [
"MIT"
] | 221 | 2020-07-08T10:13:35.000Z | 2022-03-30T13:11:42.000Z | data/msmarco_data.py | playing-code/ANCE | 4a222486de3f50bb1e16a4f959972ece633dd78c | [
"MIT"
] | 13 | 2020-07-10T14:09:14.000Z | 2022-01-07T14:59:16.000Z | data/msmarco_data.py | playing-code/ANCE | 4a222486de3f50bb1e16a4f959972ece633dd78c | [
"MIT"
] | 45 | 2020-07-16T05:04:53.000Z | 2022-03-30T04:25:02.000Z | import sys
import os
import torch
sys.path += ['../']
import gzip
import pickle
from utils.util import pad_input_ids, multi_file_process, numbered_byte_file_generator, EmbeddingCache
import csv
from model.models import MSMarcoConfigDict, ALL_MODELS
from torch.utils.data import DataLoader, Dataset, TensorDatase... | 31.297052 | 163 | 0.569193 |
4fc78d351c5dfbc37ffba1f22bc1f6cf43287f59 | 14,299 | py | Python | sdk/python/pulumi_azure_native/operationalinsights/v20200801/linked_service.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/operationalinsights/v20200801/linked_service.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/operationalinsights/v20200801/linked_service.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 48.636054 | 800 | 0.673823 |
d4bf2baca15e7dabb28f7d3752e67b3576b1fe0a | 4,770 | py | Python | backend/tracim_backend/lib/utils/sanitizer.py | lezardrouge/tracim | 713ff6066767554333e7e0b1de608ec1a7e4229c | [
"MIT"
] | null | null | null | backend/tracim_backend/lib/utils/sanitizer.py | lezardrouge/tracim | 713ff6066767554333e7e0b1de608ec1a7e4229c | [
"MIT"
] | null | null | null | backend/tracim_backend/lib/utils/sanitizer.py | lezardrouge/tracim | 713ff6066767554333e7e0b1de608ec1a7e4229c | [
"MIT"
] | null | null | null | import typing
from bs4 import BeautifulSoup
from bs4 import Tag
from tracim_backend.lib.mail_fetcher.email_processing.sanitizer_config.attrs_whitelist import (
ATTRS_WHITELIST,
)
from tracim_backend.lib.mail_fetcher.email_processing.sanitizer_config.class_blacklist import (
CLASS_BLACKLIST,
)
from tracim_back... | 34.817518 | 95 | 0.619287 |
0705d9f2dcec1fe98fd6f103b6603a0ecd9896cf | 7,307 | py | Python | 2021/day11/2021-day11-part2.py | matt-the-ogre/advent-of-code | 7188089d4db4a99fa09ef8366137fe28d1c28205 | [
"MIT"
] | 1 | 2021-12-03T18:17:54.000Z | 2021-12-03T18:17:54.000Z | 2021/day11/2021-day11-part2.py | matt-the-ogre/advent-of-code | 7188089d4db4a99fa09ef8366137fe28d1c28205 | [
"MIT"
] | null | null | null | 2021/day11/2021-day11-part2.py | matt-the-ogre/advent-of-code | 7188089d4db4a99fa09ef8366137fe28d1c28205 | [
"MIT"
] | null | null | null | # Advent of Code - 2021 - Day 11
# https://adventofcode.com/2021/day/11
# References
# https://stackoverflow.com/questions/339007/how-to-pad-zeroes-to-a-string
import time, math, logging, os, numpy
from operator import add
from matplotlib import pyplot as plt
def readInput(inputTextFileName):
global inputArray
... | 36.353234 | 127 | 0.644451 |
381f611b161122d817c555e8ecb0dc9cef97952f | 710 | py | Python | src/genie/libs/parser/ios/tests/ShowIpv6PimBsrCandidateRp/cli/equal/golden_output_ios_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/ios/tests/ShowIpv6PimBsrCandidateRp/cli/equal/golden_output_ios_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/ios/tests/ShowIpv6PimBsrCandidateRp/cli/equal/golden_output_ios_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
"vrf": {
"default": {
"address_family": {
"ipv6": {
"rp": {
"bsr": {
"rp_candidate_next_advertisement": "00:00:33",
"2001:db8:100::1:1:3": {
... | 30.869565 | 74 | 0.246479 |
01692c94932d8135fd08fb13f807dd6c7b0ceb21 | 223 | py | Python | setup.py | drasmuss/yolov3-tf2 | 8722ab6a45e6aa6e50936040b01a720d891ba776 | [
"MIT"
] | null | null | null | setup.py | drasmuss/yolov3-tf2 | 8722ab6a45e6aa6e50936040b01a720d891ba776 | [
"MIT"
] | null | null | null | setup.py | drasmuss/yolov3-tf2 | 8722ab6a45e6aa6e50936040b01a720d891ba776 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name="yolov3_tf2",
version="0.1",
url="https://github.com/zzh8829/yolov3-tf2",
author="Zihao Zhang",
author_email="zzh8829@gmail.com",
packages=["yolov3_tf2"],
)
| 20.272727 | 48 | 0.659193 |
740ee97a47005d1c369e481184779f32c541aa69 | 15,131 | py | Python | vsphere/datadog_checks/vsphere/api.py | jfmyers9/integrations-core | 8793c784f1d5b2c9541b2dd4214dd91584793ced | [
"BSD-3-Clause"
] | null | null | null | vsphere/datadog_checks/vsphere/api.py | jfmyers9/integrations-core | 8793c784f1d5b2c9541b2dd4214dd91584793ced | [
"BSD-3-Clause"
] | null | null | null | vsphere/datadog_checks/vsphere/api.py | jfmyers9/integrations-core | 8793c784f1d5b2c9541b2dd4214dd91584793ced | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import datetime as dt
import functools
import ssl
from typing import Any, Callable, List, TypeVar, cast
from pyVim import connect
from pyVmomi import SoapAdapter, vim, vmodl
from six import itervalues
from dat... | 42.742938 | 184 | 0.650188 |
ce9a878a497c2368db8e416712efa9918e094253 | 2,309 | py | Python | format_files.py | zendannyy/Test_Scripts | 14040c2182a1e880a7e9d04c6942e71f2dfe049f | [
"MIT"
] | 2 | 2021-12-06T01:57:08.000Z | 2021-12-06T02:27:27.000Z | format_files.py | zendannyy/Test_Scripts | 14040c2182a1e880a7e9d04c6942e71f2dfe049f | [
"MIT"
] | 4 | 2019-08-21T22:28:13.000Z | 2021-03-14T01:45:51.000Z | format_files.py | zendannyy/Test_Scripts | 14040c2182a1e880a7e9d04c6942e71f2dfe049f | [
"MIT"
] | 2 | 2019-10-16T03:53:24.000Z | 2021-12-06T01:57:09.000Z | #!/usr/bin/python3
"""grabbing a list of files, converting timestamps from epoch to human-readable
for files like this
1442530823_1442530758_916_7FBA7677-38AE-4DF6-AC81-409A68A72AC9.txt"""
import argparse
import time
import os
import sys
def convert_time_to_human_readable(stmp):
"""convert timestamps to human reada... | 31.202703 | 112 | 0.730619 |
dfaf0e5d3d41630c1520f62ab2da82e22e56a771 | 1,050 | py | Python | blog/templatetags/blog_extras.py | lingyan2017/blogproject | 5cc907882ac48ea4b78ea14bb52e8a8c94fc653b | [
"MIT"
] | null | null | null | blog/templatetags/blog_extras.py | lingyan2017/blogproject | 5cc907882ac48ea4b78ea14bb52e8a8c94fc653b | [
"MIT"
] | 9 | 2021-03-19T11:20:50.000Z | 2022-03-12T00:34:14.000Z | blog/templatetags/blog_extras.py | lingyan2017/blogproject | 5cc907882ac48ea4b78ea14bb52e8a8c94fc653b | [
"MIT"
] | null | null | null | from django import template
from django.db.models.aggregates import Count
from ..models import Post, Category, Tag
register = template.Library()
@register.inclusion_tag('blog/inclusions/_recent_posts.html', takes_context=True)
def show_recent_posts(context, num=5):
return {
'recent_post_list': Post.obje... | 28.378378 | 94 | 0.728571 |
e4fab1f8d0869b7e9c4b22b51ced3ee61f8ebe7a | 1,400 | py | Python | OOPS_CONCEPT/OOP Principles/class_program_18.py | abhigyan709/dsalgo | 868448834b22e06e572b4a0b4ba85cb1b0c6d7ee | [
"MIT"
] | 1 | 2021-06-03T10:20:50.000Z | 2021-06-03T10:20:50.000Z | OOPS_CONCEPT/OOP Principles/class_program_18.py | abhigyan709/dsalgo | 868448834b22e06e572b4a0b4ba85cb1b0c6d7ee | [
"MIT"
] | null | null | null | OOPS_CONCEPT/OOP Principles/class_program_18.py | abhigyan709/dsalgo | 868448834b22e06e572b4a0b4ba85cb1b0c6d7ee | [
"MIT"
] | null | null | null | # why do we need reference variables:
# बस इतना समझ लीजिए की अगर हीलीअम गैस से भरे गुब्बारे को किसी धागे से नहीं बाँधेंगे तो क्या होगा?
# गुब्बारा इधर-उधर उड़ जाएगा!
class Mobile:
def __init__(self, brand, price):
print("Mobile created using location ID: ", id(self))
self.brand = brand
self... | 29.787234 | 101 | 0.659286 |
e0f7ec3721dcf5a036a304db37cacfea3582aff7 | 37,007 | py | Python | venv/lib/python3.8/site-packages/statsmodels/tsa/tests/test_ar.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 12 | 2018-09-03T14:48:13.000Z | 2021-11-28T13:08:15.000Z | venv/lib/python3.8/site-packages/statsmodels/tsa/tests/test_ar.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 2 | 2018-09-20T10:47:34.000Z | 2018-09-27T10:20:36.000Z | venv/lib/python3.8/site-packages/statsmodels/tsa/tests/test_ar.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 6 | 2018-02-18T12:42:41.000Z | 2020-08-07T10:36:29.000Z | """
Test AR Model
"""
import datetime as dt
from itertools import product
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pandas as pd
from pandas import Index, Series, date_range, period_range
from pandas.testing import assert_series_equal
import pytest
from statsmodels.datas... | 31.229536 | 79 | 0.610641 |
610fe8d90996e218621798490d3b2595e31b4877 | 71 | py | Python | redrugs/controllers/__init__.py | dlmcguinness/redrugs | d49857b1f291c0b3bdd0b25417ba42068ca73c62 | [
"MIT"
] | 5 | 2015-01-23T15:28:59.000Z | 2017-10-23T12:01:36.000Z | redrugs/controllers/__init__.py | dlmcguinness/redrugs | d49857b1f291c0b3bdd0b25417ba42068ca73c62 | [
"MIT"
] | 14 | 2015-02-03T21:20:58.000Z | 2015-10-13T02:32:18.000Z | redrugs/controllers/__init__.py | dlmcguinness/redrugs | d49857b1f291c0b3bdd0b25417ba42068ca73c62 | [
"MIT"
] | 5 | 2015-01-28T17:55:44.000Z | 2018-12-03T02:47:05.000Z | # -*- coding: utf-8 -*-
"""Controllers for the redrugs application."""
| 23.666667 | 46 | 0.633803 |
bffda847231c14ca5f4a01738fe1d0a87a95622e | 4,537 | py | Python | experiments/explorations/experiments/experiment_000302/repetition_000007/experiment_config.py | flowersteam/automated_discovery_of_lenia_patterns | 97cc7cde2120fa95225d1e470e00b8aa8c034e97 | [
"MIT"
] | 10 | 2019-10-05T16:22:11.000Z | 2021-12-30T14:09:42.000Z | experiments/explorations/experiments/experiment_000302/repetition_000007/experiment_config.py | flowersteam/automated_discovery_of_lenia_patterns | 97cc7cde2120fa95225d1e470e00b8aa8c034e97 | [
"MIT"
] | null | null | null | experiments/explorations/experiments/experiment_000302/repetition_000007/experiment_config.py | flowersteam/automated_discovery_of_lenia_patterns | 97cc7cde2120fa95225d1e470e00b8aa8c034e97 | [
"MIT"
] | 2 | 2019-10-14T12:12:38.000Z | 2020-09-16T11:18:26.000Z | import autodisc as ad
def get_system_parameters():
system_parameters = ad.systems.Lenia.default_system_parameters()
system_parameters.size_y = 256
system_parameters.size_x = 256
return system_parameters
def get_explorer_config():
explorer_config = ad.explorers.OnlineLearningGoalExplorer.defaul... | 42.401869 | 225 | 0.735067 |
463af4dd39e245df592fc84a084e670dd468c008 | 8,573 | py | Python | data/io/DOTA/data_crop.py | fellhorn/RetinaNet_Tensorflow_Rotation | 318e38a110888ca0f9e8eb03bd0ab69ac568bd98 | [
"MIT"
] | 333 | 2019-07-23T02:44:04.000Z | 2022-02-26T04:56:59.000Z | data/io/DOTA/data_crop.py | zsh1234567/RetinaNet_Tensorflow_Rotation | 621460c13da648ed65af9d2d49950afcabb97716 | [
"MIT"
] | 82 | 2019-07-23T07:13:18.000Z | 2021-09-24T08:48:46.000Z | data/io/DOTA/data_crop.py | zsh1234567/RetinaNet_Tensorflow_Rotation | 621460c13da648ed65af9d2d49950afcabb97716 | [
"MIT"
] | 97 | 2019-07-23T02:47:22.000Z | 2021-11-29T03:26:54.000Z | import os
import scipy.misc as misc
from xml.dom.minidom import Document
import numpy as np
import copy
import cv2
import sys
sys.path.append('../../..')
from help_utils.tools import mkdir
def save_to_xml(save_path, im_height, im_width, objects_axis, label_name):
im_depth = 0
object_num = len(objects_axis)
... | 38.443946 | 101 | 0.614954 |
860f45f12e353ac955bcd4f568d1045e9d054f6b | 4,471 | py | Python | app/screens/mainscreen.py | tobykurien/pi-tracking-telescope | 6f37d41f3685ad657271707b2ba09dc9e5fcdbdd | [
"MIT"
] | 37 | 2016-01-17T11:21:49.000Z | 2021-07-28T12:23:02.000Z | app/screens/mainscreen.py | tobykurien/pi-tracking-telescope | 6f37d41f3685ad657271707b2ba09dc9e5fcdbdd | [
"MIT"
] | 11 | 2016-04-19T14:59:37.000Z | 2019-04-25T09:08:47.000Z | app/screens/mainscreen.py | tobykurien/pi-tracking-telescope | 6f37d41f3685ad657271707b2ba09dc9e5fcdbdd | [
"MIT"
] | 8 | 2016-03-17T09:46:54.000Z | 2020-11-22T08:29:06.000Z | from datetime import datetime
import pygame
from pygame.rect import Rect
from pygame.locals import *
from modules.focus import ProcessFocus
from modules.stacking import ProcessStacking
from modules.tracking import ProcessTracking
from ui import colours
from ui.widgets.background import LcarsBackgroundImage
from ui.wi... | 34.392308 | 97 | 0.594945 |
ef475c327ed0ef44cf823fe3380e208d0064d948 | 1,771 | py | Python | tests/testTriplify.py | ttm/gmaneLegacy | df9e0926c93358abdb632f7f9ce891330959c835 | [
"Unlicense"
] | 1 | 2019-04-25T16:31:12.000Z | 2019-04-25T16:31:12.000Z | tests/testTriplify.py | ttm/gmaneLegacy | df9e0926c93358abdb632f7f9ce891330959c835 | [
"Unlicense"
] | null | null | null | tests/testTriplify.py | ttm/gmaneLegacy | df9e0926c93358abdb632f7f9ce891330959c835 | [
"Unlicense"
] | null | null | null | import importlib, os
import multiprocessing as mp
from IPython.lib.deepreload import reload as dreload
import gmaneLegacy as g, percolation as P
G=g
importlib.reload(g.listDataStructures)
importlib.reload(g.loadMessages)
importlib.reload(g.triplifyList)
importlib.reload(P.rdf)
importlib.reload(P.utils)
importlib.reloa... | 40.25 | 181 | 0.746471 |
7ef347e3de7e50282d71ea205be453b4f84b6364 | 296 | py | Python | sdk/python/pulumi_azure/hsm/__init__.py | suresh198526/pulumi-azure | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/hsm/__init__.py | suresh198526/pulumi-azure | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/hsm/__init__.py | suresh198526/pulumi-azure | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .module import *
from ._inputs import *
from . import outputs
| 32.888889 | 87 | 0.712838 |
7dbe11513b3cd2c7edf4649eacafa52a57d08156 | 39,151 | py | Python | synapse/storage/databases/main/stream.py | hailzam/synapse | 837293c314b47e988fe9532115476a6536cd6406 | [
"Apache-2.0"
] | null | null | null | synapse/storage/databases/main/stream.py | hailzam/synapse | 837293c314b47e988fe9532115476a6536cd6406 | [
"Apache-2.0"
] | null | null | null | synapse/storage/databases/main/stream.py | hailzam/synapse | 837293c314b47e988fe9532115476a6536cd6406 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2017 Vector Creations Ltd
# Copyright 2018-2019 New Vector Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | 35.462862 | 89 | 0.607239 |
3327eb11e395a3ea327d007df513ee264653edad | 682 | py | Python | src/data/737.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/737.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/737.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | from collections import deque
import sys
def bfs(T, n, D):
D[1] = 0
q = deque([1])
while q:
c = q.popleft()
for i in T[c]:
if D[i] == n:
D[i] = D[c] + 1
q.append(i)
def main():
input = sys.stdin.readline
n, q = map(int, input().split())... | 19.485714 | 40 | 0.407625 |
daf06f63bc8d2f0d2e65192b28ed25d00c881d08 | 1,819 | py | Python | modules/Plan/Time.py | Ankush1122/TripIndia | 9e53c7327df872fcae5365a5f78c3f54acbd138d | [
"MIT"
] | 3 | 2022-01-20T06:15:55.000Z | 2022-02-22T11:41:45.000Z | modules/Plan/Time.py | Ankush1122/TripIndia | 9e53c7327df872fcae5365a5f78c3f54acbd138d | [
"MIT"
] | null | null | null | modules/Plan/Time.py | Ankush1122/TripIndia | 9e53c7327df872fcae5365a5f78c3f54acbd138d | [
"MIT"
] | 1 | 2022-03-11T01:24:44.000Z | 2022-03-11T01:24:44.000Z | from datetime import date
class Time():
def getDuration(self, time1, time2):
hours1 = self.stringToHours(time1)
hours2 = self.stringToHours(time2)
duration = (hours2 // 100 - hours1 // 100) * 60
x1 = hours1 % 100
x2 = hours2 % 100
if(x2 >= x1):
duration ... | 29.33871 | 66 | 0.455195 |
72937a0baac77ec8150b554923b895a79df9f1c2 | 2,160 | py | Python | cruft/_commands/create.py | analog-garage/cruft | 32283c0ed87a3b2806143b51c4e8c68f435e19c2 | [
"MIT"
] | null | null | null | cruft/_commands/create.py | analog-garage/cruft | 32283c0ed87a3b2806143b51c4e8c68f435e19c2 | [
"MIT"
] | null | null | null | cruft/_commands/create.py | analog-garage/cruft | 32283c0ed87a3b2806143b51c4e8c68f435e19c2 | [
"MIT"
] | null | null | null | from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, Dict, Optional
from cookiecutter.generate import generate_files
from .utils import (
example,
generate_cookiecutter_context,
get_cookiecutter_repo,
json_dumps,
resolve_template_url,
)
@example("https://githu... | 30.857143 | 91 | 0.627315 |
5b404d96130c8756d234458c7c38c02e5ad0bf8c | 3,812 | py | Python | sahara/tests/unit/service/test_ntp_service.py | openstack/sahara | c4f4d29847d5bcca83d49ef7e9a3378458462a79 | [
"Apache-2.0"
] | 161 | 2015-01-05T11:46:42.000Z | 2022-01-05T07:41:39.000Z | sahara/tests/unit/service/test_ntp_service.py | openstack/sahara | c4f4d29847d5bcca83d49ef7e9a3378458462a79 | [
"Apache-2.0"
] | 1 | 2021-01-28T06:06:41.000Z | 2021-01-28T06:06:43.000Z | sahara/tests/unit/service/test_ntp_service.py | openstack/sahara | c4f4d29847d5bcca83d49ef7e9a3378458462a79 | [
"Apache-2.0"
] | 118 | 2015-01-29T06:34:35.000Z | 2021-12-06T07:30:09.000Z | # Copyright (c) 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 35.962264 | 77 | 0.671301 |
77d1e020bf3221cb5160064fc69752fa5c836b65 | 4,930 | py | Python | mashcima/__init__.py | Jirka-Mayer/Mashcima | b5333cb0ac5f6defa8e78573f8da6bcbf97b2bad | [
"MIT"
] | 2 | 2022-02-26T14:27:59.000Z | 2022-03-16T20:48:24.000Z | mashcima/__init__.py | Jirka-Mayer/Mashcima | b5333cb0ac5f6defa8e78573f8da6bcbf97b2bad | [
"MIT"
] | null | null | null | mashcima/__init__.py | Jirka-Mayer/Mashcima | b5333cb0ac5f6defa8e78573f8da6bcbf97b2bad | [
"MIT"
] | null | null | null | from mashcima.CanvasOptions import CanvasOptions
from mashcima.Canvas import Canvas
from mashcima.SymbolRepository import SymbolRepository
from mashcima.annotation_to_image import multi_staff_annotation_to_image
from typing import Optional
from mashcima.generate_random_annotation import generate_random_annotation
from ... | 35.985401 | 121 | 0.736105 |
e19a082c9653778a28f0f80a7116669137a5a84c | 10,112 | py | Python | yolox/data/datasets/mosaicdetection.py | sanket-pixel/self-tracker | 5a6cd2524ece817110744e0b230ee6db478466f0 | [
"MIT"
] | null | null | null | yolox/data/datasets/mosaicdetection.py | sanket-pixel/self-tracker | 5a6cd2524ece817110744e0b230ee6db478466f0 | [
"MIT"
] | null | null | null | yolox/data/datasets/mosaicdetection.py | sanket-pixel/self-tracker | 5a6cd2524ece817110744e0b230ee6db478466f0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import cv2
import numpy as np
from yolox.utils import adjust_box_anns
import random
from ..data_augment import box_candidates, random_perspective, augment_hsv
from .datasets_wrapper import Dataset
def get_mosaic_coordin... | 42.133333 | 97 | 0.549941 |
0505c94ee88fcccaa1acc65a126cbfb029a1caa2 | 135 | py | Python | src/features/__init__.py | nbechor/SlipperySlope | 5a456a9632b73e2f5ff0d90fe080aeec1ec3cc3a | [
"MIT"
] | null | null | null | src/features/__init__.py | nbechor/SlipperySlope | 5a456a9632b73e2f5ff0d90fe080aeec1ec3cc3a | [
"MIT"
] | null | null | null | src/features/__init__.py | nbechor/SlipperySlope | 5a456a9632b73e2f5ff0d90fe080aeec1ec3cc3a | [
"MIT"
] | null | null | null | """
__init__.py file for features module.
Defines the __all__ modules.
"""
__all__ = ['weatherClass','eventsClass','identifierClass']
| 19.285714 | 58 | 0.740741 |
41d492fc61a2ecfdbf46b6d8f226ee5eedcab8a1 | 5,739 | py | Python | relretrieval/BREDS/Config.py | knowledge-retrieval/relretrieval | bb9df83bcc4d96623a4e4309d43d0552207552ad | [
"MIT"
] | null | null | null | relretrieval/BREDS/Config.py | knowledge-retrieval/relretrieval | bb9df83bcc4d96623a4e4309d43d0552207552ad | [
"MIT"
] | null | null | null | relretrieval/BREDS/Config.py | knowledge-retrieval/relretrieval | bb9df83bcc4d96623a4e4309d43d0552207552ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import fileinput
import re
from nltk.corpus import stopwords
from nltk import WordNetLemmatizer
from gensim.models import Word2Vec
from BREDS.Seed import Seed
from BREDS.ReVerb import Reverb
__author__ = "David S. Batista"
__email__ = "dsbatista@inesc-id.pt"
class Conf... | 37.509804 | 84 | 0.560899 |
8eb34c7e11ad332458beb896e354487ab4a6d4c7 | 3,722 | py | Python | src/bat/file2package.py | secuof/binaryanalysis | 5937fbb7e55f3a0808f31ee4f9e75b859d98c012 | [
"Apache-2.0"
] | 78 | 2016-09-29T08:26:50.000Z | 2022-02-21T23:41:23.000Z | src/bat/file2package.py | secuof/binaryanalysis | 5937fbb7e55f3a0808f31ee4f9e75b859d98c012 | [
"Apache-2.0"
] | 7 | 2016-10-14T14:32:00.000Z | 2018-03-17T17:28:42.000Z | src/bat/file2package.py | secuof/binaryanalysis | 5937fbb7e55f3a0808f31ee4f9e75b859d98c012 | [
"Apache-2.0"
] | 50 | 2016-10-05T06:22:38.000Z | 2022-02-03T16:08:48.000Z | #!/usr/bin/python
## Binary Analysis Tool
## Copyright 2012-2015 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
'''
This is a plugin for the Binary Analysis Tool. Its purpose is to determine the
package a file belongs to based on the name of a package... | 33.531532 | 141 | 0.735357 |
27ab45f76255802c0b260d8c1a393c820be983f5 | 71,411 | py | Python | tools/bm_runtime/standard/ttypes.py | clickp4/bmv2 | aca47e23c968353a9ffd27e9b6305f41cefadf6b | [
"Apache-2.0"
] | 2 | 2018-08-29T22:58:07.000Z | 2018-08-30T01:44:30.000Z | tools/bm_runtime/standard/ttypes.py | clickp4/bmv2 | aca47e23c968353a9ffd27e9b6305f41cefadf6b | [
"Apache-2.0"
] | null | null | null | tools/bm_runtime/standard/ttypes.py | clickp4/bmv2 | aca47e23c968353a9ffd27e9b6305f41cefadf6b | [
"Apache-2.0"
] | null | null | null | #
# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
tr... | 29.606551 | 188 | 0.646455 |
e9b5b8b31f41eddbf83dd7b99fdc2c0d5cd8ee62 | 241 | py | Python | django_roles_access/admin.py | django-roles-access/master | 066d0d6b99b986eacc736e6973b415cbb9172d46 | [
"MIT"
] | 5 | 2019-03-22T08:08:25.000Z | 2019-04-11T11:46:52.000Z | django_roles_access/admin.py | django-roles-access/master | 066d0d6b99b986eacc736e6973b415cbb9172d46 | [
"MIT"
] | 5 | 2019-04-03T21:53:52.000Z | 2019-05-22T22:41:34.000Z | django_roles_access/admin.py | django-roles-access/master | 066d0d6b99b986eacc736e6973b415cbb9172d46 | [
"MIT"
] | null | null | null | # encoding='utf-8'
from django.contrib import admin
from django_roles_access.models import ViewAccess, TemplateAccess
# admin.site.register(ViewAccess, ViewAccessAdmin)
admin.site.register(ViewAccess)
admin.site.register(TemplateAccess)
| 21.909091 | 65 | 0.825726 |
90b71f02e0659073729ae42b6a75040833635cf8 | 62,321 | py | Python | sockeye/inference.py | a-rios/sockeye | 3e2b0171a3576fe5677ac0f868936b03f4ab4cd5 | [
"Apache-2.0"
] | null | null | null | sockeye/inference.py | a-rios/sockeye | 3e2b0171a3576fe5677ac0f868936b03f4ab4cd5 | [
"Apache-2.0"
] | null | null | null | sockeye/inference.py | a-rios/sockeye | 3e2b0171a3576fe5677ac0f868936b03f4ab4cd5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017--2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | 51.54756 | 136 | 0.638854 |
e7b3e1ba7656d227c28b156384d664406fad8378 | 11,822 | py | Python | MOD_32_VariacionPotencia_H90_3o.py | Marita21/ThermalDesign | 49e0f795264502de5be723bdb1c89441ca0bb109 | [
"MIT"
] | 1 | 2021-09-22T12:43:16.000Z | 2021-09-22T12:43:16.000Z | MOD_32_VariacionPotencia_H90_3o.py | Marita21/ThermalDesign | 49e0f795264502de5be723bdb1c89441ca0bb109 | [
"MIT"
] | null | null | null | MOD_32_VariacionPotencia_H90_3o.py | Marita21/ThermalDesign | 49e0f795264502de5be723bdb1c89441ca0bb109 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
#Global mathematical model of SAC-A with 31 nodes and according to design
# status of March 3, 1997. Equatorial Orbit without inclination in vernal
# equinox (beta=90), at 205 mn (380 km)... | 55.764151 | 86 | 0.566063 |
998f87305d066a80ef605c397e941dbedaaa490b | 1,744 | py | Python | silex_houdini/utils/utils.py | ArtFXDev/silex_houdini | fe73cd6c2a35168a82a3a4b295b64c26686edcc1 | [
"MIT"
] | 3 | 2021-09-24T14:48:53.000Z | 2022-03-07T03:55:54.000Z | silex_houdini/utils/utils.py | ArtFXDev/silex_houdini | fe73cd6c2a35168a82a3a4b295b64c26686edcc1 | [
"MIT"
] | 19 | 2021-09-17T14:18:00.000Z | 2022-03-18T13:06:59.000Z | silex_houdini/utils/utils.py | ArtFXDev/silex_houdini | fe73cd6c2a35168a82a3a4b295b64c26686edcc1 | [
"MIT"
] | null | null | null | import asyncio
import threading
from concurrent import futures
from typing import Callable
import hou
from silex_client.core.context import Context
from silex_client.utils.log import logger
if hou.isUIAvailable():
import hdefereval
class Utils:
@staticmethod
async def wrapped_execute(
action_que... | 31.142857 | 87 | 0.637041 |
39e135683cbea85e2eb03224fa6a1f53b423255d | 699 | py | Python | api/models/tasks.py | edumco/sanguine-scrapy | 72830cbe13f094e00d738599158042ed2f755281 | [
"MIT"
] | 3 | 2018-12-23T15:40:55.000Z | 2019-03-13T14:27:28.000Z | api/models/tasks.py | DavidPierre21/doe-sangue-scrapy | 72830cbe13f094e00d738599158042ed2f755281 | [
"MIT"
] | 14 | 2021-11-01T07:19:12.000Z | 2022-03-31T22:30:55.000Z | api/models/tasks.py | DavidPierre21/doe-sangue-scrapy | 72830cbe13f094e00d738599158042ed2f755281 | [
"MIT"
] | null | null | null | import redis
import rq
from api.app import db
class Task(db.Model):
id = db.Column(db.String(36), primary_key=True)
name = db.Column(db.String(128), index=True)
description = db.Column(db.String(128))
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
complete = db.Column(db.Boolean, defaul... | 31.772727 | 76 | 0.659514 |
f60c0aff76231273d5ae68baecdf769538fb4e04 | 3,988 | py | Python | bruhat/dev/sage_gates.py | punkdit/bruhat | 3231eacc49fd3464542f7eb72684751371d9876c | [
"MIT"
] | 3 | 2020-04-07T13:21:30.000Z | 2020-07-15T02:07:20.000Z | bruhat/dev/sage_gates.py | punkdit/bruhat | 3231eacc49fd3464542f7eb72684751371d9876c | [
"MIT"
] | null | null | null | bruhat/dev/sage_gates.py | punkdit/bruhat | 3231eacc49fd3464542f7eb72684751371d9876c | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
from __future__ import print_function
from bruhat.dev.sage_env import *
from bruhat.argv import argv
d = argv.get("d", 2) # qudit dimension
def dag(op):
op = op.conjugate_transpose()
op.set_immutable() # ARGH!
return op
def mul(a, b):
c = a*b
c.set_immutable() # ARGH!
... | 18.723005 | 56 | 0.511284 |
f0538113c829db88be03ab2de48f445198f7ae26 | 2,100 | py | Python | docs/conf.py | arnavs-0/kivy-cupertino | f4fed8982c4d65e3f6e18b9d0ea5838998aa9917 | [
"MIT"
] | null | null | null | docs/conf.py | arnavs-0/kivy-cupertino | f4fed8982c4d65e3f6e18b9d0ea5838998aa9917 | [
"MIT"
] | null | null | null | docs/conf.py | arnavs-0/kivy-cupertino | f4fed8982c4d65e3f6e18b9d0ea5838998aa9917 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 32.8125 | 79 | 0.667619 |
df1ce6415950659549978cd91a6f08c7c046b16b | 8,845 | py | Python | hardhat/util.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/util.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/util.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | import datetime
from errno import EACCES, EPERM
import hashlib
import importlib
import inspect
import os
import shutil
import ssl
import stat
import sys
import subprocess
import traceback
from threading import Thread
try:
from urllib.request import urlopen, ProxyHandler, build_opener, \
install_opener
exce... | 27.640625 | 79 | 0.567891 |
a186b7f03807f83b8bbbc581bc6bb6193761df9d | 51,665 | py | Python | test/functional/test_framework/messages.py | SpiffCoin/SpiffCoinCore | 6ffda97cd86690f8b374c85e700977a377de4d1e | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | SpiffCoin/SpiffCoinCore | 6ffda97cd86690f8b374c85e700977a377de4d1e | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | SpiffCoin/SpiffCoinCore | 6ffda97cd86690f8b374c85e700977a377de4d1e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... | 28.814835 | 262 | 0.605845 |
6a69420c9e8abee73ae3ae9d4dbddd7f912baf08 | 12,479 | py | Python | mmaction/models/recognizers/base.py | w-sugar/Video-Swin-Transformer | 7b1534dbfff785927e6976de245574a91a5b1c26 | [
"Apache-2.0"
] | 1 | 2021-12-09T23:48:54.000Z | 2021-12-09T23:48:54.000Z | mmaction/models/recognizers/base.py | w-sugar/Video-Swin-Transformer | 7b1534dbfff785927e6976de245574a91a5b1c26 | [
"Apache-2.0"
] | null | null | null | mmaction/models/recognizers/base.py | w-sugar/Video-Swin-Transformer | 7b1534dbfff785927e6976de245574a91a5b1c26 | [
"Apache-2.0"
] | null | null | null | import warnings
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
from mmcv.runner import auto_fp16
from .. import builder
class BaseRecognizer(nn.Module, metaclass=ABCMeta):
"""Base cla... | 37.700906 | 79 | 0.598686 |
c1fbb94722dd67e5e1445d17d4534a476f3339a7 | 713 | py | Python | ch18/min.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2020-10-12T13:33:29.000Z | 2020-10-12T13:33:29.000Z | ch18/min.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | null | null | null | ch18/min.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2016-11-09T07:28:45.000Z | 2016-11-09T07:28:45.000Z | #!/usr/local/bin/python3.3
def min1(*args):
res = args[0]
for arg in args[1:]:
if arg < res:
res = arg
return res
def min2(first, *rest):
for arg in rest:
if arg < first:
first = arg
return first
def min3(*args):
L = list(args)
L.sort()
return L... | 18.282051 | 58 | 0.524544 |
5a84cb4bac2712310e1adc1913fb1dfdc330e45b | 3,821 | py | Python | tuframework/pixelCL/default_configuration.py | Magnety/tuFramework_win | 4c49e1fdb292aaf1945c81d5d9bc57db0eea42b3 | [
"Apache-2.0"
] | null | null | null | tuframework/pixelCL/default_configuration.py | Magnety/tuFramework_win | 4c49e1fdb292aaf1945c81d5d9bc57db0eea42b3 | [
"Apache-2.0"
] | null | null | null | tuframework/pixelCL/default_configuration.py | Magnety/tuFramework_win | 4c49e1fdb292aaf1945c81d5d9bc57db0eea42b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 47.17284 | 124 | 0.684376 |
56e34469595f15e999e31eac6c75c95c84e40a7e | 1,107 | py | Python | pywizlight/tests/test_bulb_hero_1_23_70.py | mikemakaroff/pywizlight | 0b32b917a064d9ca1be0ce9fb24ea68ce89993ed | [
"MIT"
] | 1 | 2022-03-30T22:42:51.000Z | 2022-03-30T22:42:51.000Z | pywizlight/tests/test_bulb_hero_1_23_70.py | mikemakaroff/pywizlight | 0b32b917a064d9ca1be0ce9fb24ea68ce89993ed | [
"MIT"
] | null | null | null | pywizlight/tests/test_bulb_hero_1_23_70.py | mikemakaroff/pywizlight | 0b32b917a064d9ca1be0ce9fb24ea68ce89993ed | [
"MIT"
] | null | null | null | """Tests for the Bulb API with a Hero."""
from typing import AsyncGenerator
import pytest
from pywizlight import wizlight
from pywizlight.bulblibrary import BulbClass, BulbType, Features, KelvinRange
from pywizlight.tests.fake_bulb import startup_bulb
@pytest.fixture()
async def hero() -> AsyncGenerator[wizlight, N... | 29.918919 | 85 | 0.696477 |
4198b79c2a8c6cf6404ea6c00125731ac6f2498d | 324 | py | Python | Python/zamka.py | mimseyedi/Kattis | a99ea2112544e89cc466feb7d81ffe6eb017f7e2 | [
"MIT"
] | null | null | null | Python/zamka.py | mimseyedi/Kattis | a99ea2112544e89cc466feb7d81ffe6eb017f7e2 | [
"MIT"
] | null | null | null | Python/zamka.py | mimseyedi/Kattis | a99ea2112544e89cc466feb7d81ffe6eb017f7e2 | [
"MIT"
] | null | null | null | L = input()
D = input()
X = int(input())
for i in range(int(L), int(D) + 1):
lr = 0
for l in str(i):
lr += int(l)
if lr == X:
print(i)
break
for i in range(int(D), int(L) - 1, -1):
dr = 0
for d in str(i):
dr += int(d)
if dr == X:
print(i)
br... | 15.428571 | 39 | 0.407407 |
93d3bdf97a0a227f00ae46c2c7e38f6b9d993031 | 1,544 | py | Python | day-7/crab_alignment.py | PeterPrice06/advent-of-code-2021 | d1af22ee2e4778372e626debca1ae9dc7f2ad47c | [
"MIT"
] | null | null | null | day-7/crab_alignment.py | PeterPrice06/advent-of-code-2021 | d1af22ee2e4778372e626debca1ae9dc7f2ad47c | [
"MIT"
] | null | null | null | day-7/crab_alignment.py | PeterPrice06/advent-of-code-2021 | d1af22ee2e4778372e626debca1ae9dc7f2ad47c | [
"MIT"
] | null | null | null | from typing import List
class CrabAlignment():
def __init__(self, line_strs: List[str]) -> None:
self.crab_positions = []
self.crab_positions = list(map(int, line_strs[0].split(',')))
self.min = min(self.crab_positions)
self.max = max(self.crab_positions)
self.max_movement ... | 34.311111 | 107 | 0.658679 |
2c513f7351d3bde38aed990b62d09a22da5d78d1 | 113,179 | py | Python | src/Lib/test/test_email/test__header_value_parser.py | NUS-ALSET/ace-react-redux-brython | d009490263c5716a145d9691cd59bfcd5aff837a | [
"MIT"
] | 1 | 2021-08-05T12:45:39.000Z | 2021-08-05T12:45:39.000Z | src/Lib/test/test_email/test__header_value_parser.py | NUS-ALSET/ace-react-redux-brython | d009490263c5716a145d9691cd59bfcd5aff837a | [
"MIT"
] | null | null | null | src/Lib/test/test_email/test__header_value_parser.py | NUS-ALSET/ace-react-redux-brython | d009490263c5716a145d9691cd59bfcd5aff837a | [
"MIT"
] | 1 | 2019-09-05T08:20:07.000Z | 2019-09-05T08:20:07.000Z | import string
import unittest
from email import _header_value_parser as parser
from email import errors
from email import policy
from test.test_email import TestEmailBase, parameterize
class TestTokens(TestEmailBase):
# EWWhiteSpaceTerminal
def test_EWWhiteSpaceTerminal(self):
x = parser.... | 43.766048 | 94 | 0.557886 |
c5518e2603d50a3fa793288f6c0d13deb651ecea | 42,455 | py | Python | tensorflow/examples/image_retraining/retrain.py | wangguizhu27/tensorflow1 | 3462966ac7d3884c2153b1655e8528a0f6bac0f4 | [
"Apache-2.0"
] | 65 | 2016-09-26T01:30:40.000Z | 2021-08-11T17:00:41.000Z | tensorflow/examples/image_retraining/retrain.py | wangguizhu27/tensorflow1 | 3462966ac7d3884c2153b1655e8528a0f6bac0f4 | [
"Apache-2.0"
] | 5 | 2017-02-21T08:37:52.000Z | 2017-03-29T05:46:05.000Z | tensorflow/examples/image_retraining/retrain.py | wangguizhu27/tensorflow1 | 3462966ac7d3884c2153b1655e8528a0f6bac0f4 | [
"Apache-2.0"
] | 10 | 2017-03-28T06:16:10.000Z | 2020-08-25T09:03:44.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... | 40.318139 | 129 | 0.691603 |
03f2e3e209468f0b2f599c167df8884356ea3675 | 2,024 | py | Python | app/conf/development.py | zanielyene/krabacus3 | de985874b4034b13564cfd4af5e58e312fe5d438 | [
"MIT"
] | 2 | 2020-01-24T14:15:04.000Z | 2020-04-10T21:49:18.000Z | app/conf/development.py | zanielyene/krabacus3 | de985874b4034b13564cfd4af5e58e312fe5d438 | [
"MIT"
] | 3 | 2020-02-12T00:31:59.000Z | 2021-06-10T21:33:49.000Z | app/conf/development.py | zanielyene/krabacus3 | de985874b4034b13564cfd4af5e58e312fe5d438 | [
"MIT"
] | 3 | 2020-01-04T19:02:34.000Z | 2020-09-13T20:42:43.000Z | from .common import *
## Database
## Imported from dbsettings file now
## EVE Proxy
import raven
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'krabacus3',
'USER': 'root',
'PASSWORD': 'getfuckedlol',
'HOST': 'localhost', # Or an IP Address tha... | 21.531915 | 75 | 0.653656 |
08ae8f6f5087fa73f9084bc93fa85756bce6bd34 | 373 | py | Python | example/012_matching_one_or_more_repetitions.py | mafda/regex_101 | 085a9ee48829243d87e4bd74bb1baf07abc6481e | [
"MIT"
] | null | null | null | example/012_matching_one_or_more_repetitions.py | mafda/regex_101 | 085a9ee48829243d87e4bd74bb1baf07abc6481e | [
"MIT"
] | null | null | null | example/012_matching_one_or_more_repetitions.py | mafda/regex_101 | 085a9ee48829243d87e4bd74bb1baf07abc6481e | [
"MIT"
] | null | null | null | """
Task
You have a test string S.
Your task is to write a regex that will match S using the following conditions:
S should begin with 1 or more digits.
After that, S should have 1 or more uppercase letters.
S should end with 1 or more lowercase letters.
"""
import re
Regex_Pattern = r'^[\d]+[A-Z]+[a-z]+$'
print(s... | 21.941176 | 79 | 0.713137 |
a2df2509fe51a35ed48ceae9ec629ec3b49c81f3 | 3,293 | py | Python | src/net_utils.py | azmfaridee/strangan-chase-2021 | 4d225ea073a6e890a235e43f5860cd3b8e6eae12 | [
"Apache-2.0"
] | null | null | null | src/net_utils.py | azmfaridee/strangan-chase-2021 | 4d225ea073a6e890a235e43f5860cd3b8e6eae12 | [
"Apache-2.0"
] | null | null | null | src/net_utils.py | azmfaridee/strangan-chase-2021 | 4d225ea073a6e890a235e43f5860cd3b8e6eae12 | [
"Apache-2.0"
] | null | null | null | # %%
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.init as init
import random
# %%
def weight_init(m):
'''
Usage:
model = Model()
model.apply(weight_init)
'''
if isinstance(m, nn.Conv1d):
init.normal_(m.weight.data)
if m.bias is not N... | 29.666667 | 70 | 0.603401 |
9e91df71096fa97890dcf79db280158b5ad8e52c | 2,593 | py | Python | virtualworld/model/Organism.py | mborzyszkowski/VirtualWorldPython | 885bd80235f403ef75e268b152bebf639589ea1a | [
"MIT"
] | null | null | null | virtualworld/model/Organism.py | mborzyszkowski/VirtualWorldPython | 885bd80235f403ef75e268b152bebf639589ea1a | [
"MIT"
] | null | null | null | virtualworld/model/Organism.py | mborzyszkowski/VirtualWorldPython | 885bd80235f403ef75e268b152bebf639589ea1a | [
"MIT"
] | null | null | null | import abc
from abc import ABC, abstractmethod, abstractproperty
from .Position import Position
from .Action import Action
from .ActionEnum import ActionEnum
class Organism(ABC):
def __init__(self, organizm, position, world):
self.__power = None
self.__initiative = None
self.__position = ... | 23.36036 | 103 | 0.61049 |
2d2d29965a195001c5aed88c3f32bb631a6b722e | 20,367 | py | Python | sdk/python/pulumi_azure_native/testbase/package.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/testbase/package.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/testbase/package.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 40.734 | 248 | 0.634949 |
28a3af904869a7e1dfb97f13d03c7e1a3ce80252 | 967 | py | Python | regression/statsmodel_regression.py | McDusia/predictParcels | 7288706628e2c9cb7badee5c82554d33e9607b7e | [
"Apache-2.0"
] | 2 | 2020-02-22T11:58:09.000Z | 2020-03-16T23:11:10.000Z | regression/statsmodel_regression.py | McDusia/predictParcels | 7288706628e2c9cb7badee5c82554d33e9607b7e | [
"Apache-2.0"
] | null | null | null | regression/statsmodel_regression.py | McDusia/predictParcels | 7288706628e2c9cb7badee5c82554d33e9607b7e | [
"Apache-2.0"
] | null | null | null | import logging
import statsmodels.api as sm
from utils.get_basic_train_data import get_basic_data_splited_train_test
from utils.result_stats import get_result_statistics
from configuration.configuration_constants import values_to_omit_in_basic_data_version
def run_statsmodels_regression(x_train_set, x_test_set, y_tra... | 42.043478 | 86 | 0.738366 |
c33365b164f75c3b586baf639897420f075f450e | 316 | py | Python | NucleationModel/losses.py | MFrassek/CommittorEAE | 88a467e4500bc9ab69834209f4eaec9f2d0d7a61 | [
"MIT"
] | null | null | null | NucleationModel/losses.py | MFrassek/CommittorEAE | 88a467e4500bc9ab69834209f4eaec9f2d0d7a61 | [
"MIT"
] | null | null | null | NucleationModel/losses.py | MFrassek/CommittorEAE | 88a467e4500bc9ab69834209f4eaec9f2d0d7a61 | [
"MIT"
] | null | null | null | import tensorflow as tf
def binaryNegLikelihood(y_actual, y_pred):
return -(y_actual * tf.math.log(y_pred)
+ (1-y_actual) * tf.math.log(1-y_pred))
def binomialNegLikelihood(y_actual, y_pred):
return -(2*y_actual * tf.math.log(y_pred)
+ (2*(1-y_actual)) * tf.math.log(1-y_pred))
| 26.333333 | 56 | 0.64557 |
0cb162536aff66e3976fda0576b2b4c2f64ce986 | 1,808 | py | Python | models/han/gru_att.py | stevehamwu/EmotionCauseExtraction | b5a160f35f7b03bf3730b6885096dbc5f958df8b | [
"MIT"
] | 3 | 2022-02-07T12:08:38.000Z | 2022-03-28T04:26:39.000Z | models/han/gru_att.py | stevehamwu/EmotionCauseExtraction | b5a160f35f7b03bf3730b6885096dbc5f958df8b | [
"MIT"
] | null | null | null | models/han/gru_att.py | stevehamwu/EmotionCauseExtraction | b5a160f35f7b03bf3730b6885096dbc5f958df8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/3/5 19:43
# @Author : Steve Wu
# @Site :
# @File : gru_att.py
# @Software: PyCharm
# @Github : https://github.com/stevehamwu
import pickle
import torch
import torch.nn as nn
from .attention import BertSingleAttention
from .word_model import *
fro... | 33.481481 | 118 | 0.60896 |
4d112a68c61da09f7920d49cc0a48b32cfd3762c | 55,088 | py | Python | src/ID_troops.py | faycalki/tainted-paths | 81cecf6c1fba903ec3b8043e22652d222892609d | [
"MIT"
] | 4 | 2019-09-26T21:34:32.000Z | 2021-11-18T19:31:15.000Z | src/ID_troops.py | faycalki/tainted-paths | 81cecf6c1fba903ec3b8043e22652d222892609d | [
"MIT"
] | null | null | null | src/ID_troops.py | faycalki/tainted-paths | 81cecf6c1fba903ec3b8043e22652d222892609d | [
"MIT"
] | null | null | null | trp_player = 0
trp_multiplayer_profile_troop_male = 1
trp_multiplayer_profile_troop_female = 2
trp_temp_troop = 3
trp_find_item_cheat = 4
trp_random_town_sequence = 5
trp_tournament_participants = 6
trp_tutorial_maceman = 7
trp_tutorial_archer = 8
trp_tutorial_swordsman = 9
trp_slot_formation_ally = 10
trp_slot_formati... | 25.131387 | 47 | 0.840909 |
a29301430ea8101bd873a928e0754adde966f934 | 10,885 | py | Python | ckanext/ckanext-statistics/ckanext/statistics/reports.py | Tampere/sixodp-tampere | 975105a5e20e97c54dd7c84c761f91cca1316842 | [
"MIT"
] | 8 | 2016-10-14T14:32:00.000Z | 2022-01-14T16:04:07.000Z | ckanext/ckanext-statistics/ckanext/statistics/reports.py | Tampere/sixodp-tampere | 975105a5e20e97c54dd7c84c761f91cca1316842 | [
"MIT"
] | 42 | 2016-11-11T12:24:54.000Z | 2021-07-12T03:29:18.000Z | ckanext/ckanext-statistics/ckanext/statistics/reports.py | Tampere/sixodp-tampere | 975105a5e20e97c54dd7c84c761f91cca1316842 | [
"MIT"
] | 7 | 2017-03-13T09:21:08.000Z | 2018-01-08T06:40:22.000Z | import datetime
import collections
from ckan.common import OrderedDict, _
from ckanext.report import lib
import ckan.plugins as p
from ckan.plugins import toolkit
def publisher_activity(organization, include_sub_organizations=False):
"""
Contains information about the datasets a specific organization has
... | 45.354167 | 138 | 0.612862 |
57b505c225aeda8712c9f2111f201e03f258cfd3 | 385 | py | Python | changes/api/serializer/models/comment.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | 1 | 2015-11-08T13:00:44.000Z | 2015-11-08T13:00:44.000Z | changes/api/serializer/models/comment.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | changes/api/serializer/models/comment.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | from changes.api.serializer import Serializer, register
from changes.models import Comment
@register(Comment)
class CommentSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'user': instance.user,
'text': instance.text,
... | 27.5 | 61 | 0.641558 |
88033d8cd7dfc137573cf4d6ff2caf2d378efc27 | 7,479 | py | Python | corpustools/c_multiprocessing.py | akki2825/CorpusTools | ba236f55266eceb7e719fa36545985d8453953d3 | [
"BSD-3-Clause"
] | 97 | 2015-07-06T18:58:43.000Z | 2022-03-10T23:00:07.000Z | corpustools/c_multiprocessing.py | akki2825/CorpusTools | ba236f55266eceb7e719fa36545985d8453953d3 | [
"BSD-3-Clause"
] | 443 | 2015-03-10T21:24:39.000Z | 2022-03-22T22:20:13.000Z | corpustools/c_multiprocessing.py | akki2825/CorpusTools | ba236f55266eceb7e719fa36545985d8453953d3 | [
"BSD-3-Clause"
] | 22 | 2015-07-19T18:56:24.000Z | 2020-09-17T17:58:12.000Z |
from multiprocessing import Process, process, Manager, Queue, cpu_count, Value, Lock, Pool, JoinableQueue
from queue import Empty, Full
import time
def pool_filter(func, candidates, num_cores):
pool = Pool(num_cores)
return [c for c, keep in zip(candidates,pool.map(func,candidates)) if keep]
class Counter(... | 26.521277 | 105 | 0.517984 |
bbe943a22976a22767c66a087e4e94f2d8fad06b | 3,056 | py | Python | users/forms.py | khabdrick/realestate-app | 106e161118737ccf8d1fa7ee1f9848631906919c | [
"MIT"
] | null | null | null | users/forms.py | khabdrick/realestate-app | 106e161118737ccf8d1fa7ee1f9848631906919c | [
"MIT"
] | 1 | 2020-09-20T20:23:41.000Z | 2020-09-20T20:23:41.000Z | users/forms.py | khabdrick/realestate-app | 106e161118737ccf8d1fa7ee1f9848631906919c | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import ReadOnlyPasswordHashField
User = get_user_model()
class UserAdminCreationForm(forms.ModelForm):
"""A form for creating new users. Includes all the required
fields, plus a repeated password."""
p... | 32.860215 | 90 | 0.67801 |
66dc387118b018a481287dc34dfe8e3292f4467f | 2,460 | py | Python | lite/tools/convert_arm_sdot_to_machine_code.py | wanglei91/Paddle-Lite | 8b2479f4cdd6970be507203d791bede5a453c09d | [
"Apache-2.0"
] | 1,799 | 2019-08-19T03:29:38.000Z | 2022-03-31T14:30:50.000Z | lite/tools/convert_arm_sdot_to_machine_code.py | wanglei91/Paddle-Lite | 8b2479f4cdd6970be507203d791bede5a453c09d | [
"Apache-2.0"
] | 3,767 | 2019-08-19T03:36:04.000Z | 2022-03-31T14:37:26.000Z | lite/tools/convert_arm_sdot_to_machine_code.py | wanglei91/Paddle-Lite | 8b2479f4cdd6970be507203d791bede5a453c09d | [
"Apache-2.0"
] | 798 | 2019-08-19T02:28:23.000Z | 2022-03-31T08:31:54.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019 PaddlePaddle 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
#
# ... | 39.047619 | 109 | 0.624797 |
721c05368c5af7da8bcd2ac178f2b919f5795475 | 3,969 | py | Python | allennlp/tests/models/semantic_parsing/quarel/quarel_semantic_parser_test.py | YoPatapon/allennlp | d50964b1f5b6887c74855a4fbbd1e948d406d206 | [
"Apache-2.0"
] | 6 | 2019-03-19T02:05:35.000Z | 2019-09-25T07:24:52.000Z | allennlp/tests/models/semantic_parsing/quarel/quarel_semantic_parser_test.py | YoPatapon/allennlp | d50964b1f5b6887c74855a4fbbd1e948d406d206 | [
"Apache-2.0"
] | 1 | 2019-07-08T15:28:04.000Z | 2019-07-08T15:28:04.000Z | allennlp/tests/models/semantic_parsing/quarel/quarel_semantic_parser_test.py | YoPatapon/allennlp | d50964b1f5b6887c74855a4fbbd1e948d406d206 | [
"Apache-2.0"
] | 1 | 2021-06-01T15:10:40.000Z | 2021-06-01T15:10:40.000Z | # pylint: disable=invalid-name,no-self-use,protected-access
from allennlp.common.testing import ModelTestCase
from allennlp.semparse.contexts.quarel_utils import group_worlds, to_qr_spec_string
class QuarelSemanticParserTest(ModelTestCase):
def setUp(self):
super(QuarelSemanticParserTest, self).setUp()
... | 56.7 | 149 | 0.736206 |
4be7041ee1e6d392904718bfa02dca5dc051a56e | 4,991 | py | Python | pan_cnc/tasklibs/docker_utils.py | andrewmallory/pan-cnc | bdd6349820107acf06b607c2dc0154ded468f049 | [
"Apache-2.0"
] | null | null | null | pan_cnc/tasklibs/docker_utils.py | andrewmallory/pan-cnc | bdd6349820107acf06b607c2dc0154ded468f049 | [
"Apache-2.0"
] | null | null | null | pan_cnc/tasklibs/docker_utils.py | andrewmallory/pan-cnc | bdd6349820107acf06b607c2dc0154ded468f049 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import docker
from docker.errors import APIError
from requests.exceptions import ConnectionError
logger = logging.getLogger(__name__)
class DockerHelperException(BaseException):
pass
class DockerHelper:
"""
Simple class to help with working with docker containers
"""
... | 30.066265 | 119 | 0.592667 |
f32ad8181cb40e04323f57c25a0f6b0b0682e496 | 11,241 | py | Python | apprise/plugins/NotifyMSG91.py | linkmauve/apprise | 76700bfa1ddcb2812d9ed14dfa7736125bcd346e | [
"MIT"
] | 4,764 | 2018-02-02T18:17:06.000Z | 2022-03-31T20:41:13.000Z | apprise/plugins/NotifyMSG91.py | linkmauve/apprise | 76700bfa1ddcb2812d9ed14dfa7736125bcd346e | [
"MIT"
] | 504 | 2017-11-26T15:56:14.000Z | 2022-03-31T22:38:49.000Z | apprise/plugins/NotifyMSG91.py | linkmauve/apprise | 76700bfa1ddcb2812d9ed14dfa7736125bcd346e | [
"MIT"
] | 217 | 2018-05-22T14:29:20.000Z | 2022-03-28T06:24:46.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 th... | 31.399441 | 79 | 0.564096 |
3690be980b32248f1d9908866984dfc852750ad7 | 456 | py | Python | Part_2/ch12_excel/12_8_styles.py | hyperpc/AutoStuffWithPython | e05f5e0acb5818d634e4ab84d640848cd4ae7e70 | [
"MIT"
] | null | null | null | Part_2/ch12_excel/12_8_styles.py | hyperpc/AutoStuffWithPython | e05f5e0acb5818d634e4ab84d640848cd4ae7e70 | [
"MIT"
] | null | null | null | Part_2/ch12_excel/12_8_styles.py | hyperpc/AutoStuffWithPython | e05f5e0acb5818d634e4ab84d640848cd4ae7e70 | [
"MIT"
] | null | null | null | import openpyxl
import sys, os
from openpyxl.styles import Font
currentPath = os.path.dirname(sys.argv[0])
excelPath = os.path.join(currentPath, "styles.xlsx")
wb = openpyxl.Workbook()
sheet = wb['Sheet']
font1 = Font(name='Times New Roman', bold=True)
sheet.cell(1, 1).font = font1
sheet.cell(1, 1).value = 'Bold Time... | 28.5 | 52 | 0.719298 |
681714608131c4cf1ead1a03689b1f1fc968680b | 2,345 | py | Python | app.py | Wylarel/RaspberryPiDiscordBot | 678ce33c29e15224d29c5b270c3d34090efa1541 | [
"MIT"
] | 1 | 2020-06-25T22:10:58.000Z | 2020-06-25T22:10:58.000Z | app.py | Wylarel/RaspberryPiDiscordBot | 678ce33c29e15224d29c5b270c3d34090efa1541 | [
"MIT"
] | null | null | null | app.py | Wylarel/RaspberryPiDiscordBot | 678ce33c29e15224d29c5b270c3d34090efa1541 | [
"MIT"
] | null | null | null | try:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
except ImportError:
print("You must run this code on a raspberry pi")
print("Connecting to discord [0%]")
from discord.ext import commands
TOKEN = open("TOKEN", "r").read()
client = commands.Bot(command_prefix='!', case_insensitive=True)
print("Connecti... | 40.431034 | 135 | 0.540299 |
0559230c17e784618e7907f4504116e24d2351b8 | 5,381 | py | Python | external/heng/tgs/pspnet/data.py | liaopeiyuan/ml-arsenal-public | f8938ce3cb58b35fc7cc20d096c39a85ec9780b2 | [
"Apache-2.0"
] | 280 | 2018-10-21T01:07:18.000Z | 2021-12-30T11:29:48.000Z | external/heng/tgs/code/data.py | liaopeiyuan/ml-arsenal-public | f8938ce3cb58b35fc7cc20d096c39a85ec9780b2 | [
"Apache-2.0"
] | 3 | 2018-11-13T08:04:48.000Z | 2020-04-17T09:20:03.000Z | external/heng/tgs/pspnet/data.py | liaopeiyuan/ml-arsenal-public | f8938ce3cb58b35fc7cc20d096c39a85ec9780b2 | [
"Apache-2.0"
] | 59 | 2018-10-21T04:38:23.000Z | 2021-03-29T07:58:47.000Z | from common import *
#DATA_DIR = '/home/alexanderliao/data/Kaggle/competitions/tgs-salt-identification-challenge'
DATA_DIR = '/home/liaop20/salt'
IMAGE_HEIGHT, IMAGE_WIDTH = 101, 101
HEIGHT, WIDTH = 128, 128
DY0, DY1, DX0, DX1 = \
compute_center_pad(IMAGE_HEIGHT, IMAGE_WIDTH, factor=32)
#---------------------... | 29.244565 | 92 | 0.538747 |
2db8b595c268cbdbee42a0d76a874715f0bb7637 | 1,318 | py | Python | utils/pipeline_v2.py | bgroenks96/generative-downscaling | 745ce45a3e62abe4c09cfdb66ed07e6f494a8e82 | [
"MIT"
] | 19 | 2020-06-26T18:20:00.000Z | 2022-02-12T21:59:12.000Z | utils/pipeline_v2.py | bgroenks96/generative-downscaling | 745ce45a3e62abe4c09cfdb66ed07e6f494a8e82 | [
"MIT"
] | 6 | 2022-02-27T15:41:59.000Z | 2022-03-12T20:43:15.000Z | utils/pipeline_v2.py | 6759-Project/generative-downscaling | 803292d0ace8591eae820ca9fa1f44e070937f91 | [
"MIT"
] | 12 | 2020-06-30T15:40:40.000Z | 2022-02-24T20:30:09.000Z | import numpy as np
import xarray as xr
class Pipeline:
def __init__(self, varnames, *ops):
self.varnames = varnames if isinstance(varnames, list) else [varnames]
self.ops = list(ops)
def __call__(self, *inputs):
return self.transform_all(*inputs)
def transform(self... | 29.288889 | 88 | 0.595599 |
49e4b2da0269d19caa3c75b8f8ea97386777db6e | 1,078 | py | Python | dariah_contribute/urls/dev.py | ekoi/dariah_inkind_contribs | fbd0db93860792e904b15a35b703c8936f17be59 | [
"Apache-2.0"
] | null | null | null | dariah_contribute/urls/dev.py | ekoi/dariah_inkind_contribs | fbd0db93860792e904b15a35b703c8936f17be59 | [
"Apache-2.0"
] | null | null | null | dariah_contribute/urls/dev.py | ekoi/dariah_inkind_contribs | fbd0db93860792e904b15a35b703c8936f17be59 | [
"Apache-2.0"
] | null | null | null | """
DARIAH Contribute - DARIAH-EU Contribute: edit your DARIAH contributions.
Copyright 2014 Data Archiving and Networked Services
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 a... | 41.461538 | 131 | 0.774583 |
ad12a12507a41582e9546c9ddabedec33496af67 | 3,238 | py | Python | hub_module/modules/text/semantic_model/slda_news/inference_engine.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | 4 | 2021-02-25T03:27:38.000Z | 2021-05-15T03:20:23.000Z | hub_module/modules/text/semantic_model/slda_news/inference_engine.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | null | null | null | hub_module/modules/text/semantic_model/slda_news/inference_engine.py | 18621579069/PaddleHub-yu | 15e8bcef2addf239081e235bdcfd039de12330e0 | [
"Apache-2.0"
] | 2 | 2021-03-01T07:04:01.000Z | 2021-05-14T05:54:18.000Z | import os
from paddlehub.common.logger import logger
from slda_news.config import ModelConfig
from slda_news.util import load_prototxt, fix_random_seed, rand_k
from slda_news.model import TopicModel
from slda_news.sampler import GibbsSampler, MHSampler
from slda_news.document import LDADoc, SLDADoc, Token, Sentence
f... | 34.084211 | 78 | 0.609018 |
6f3d5f41ef0cf1b268100833878b8435cee76e86 | 1,897 | py | Python | main.py | jasonwho321/Guangxin | 60ce419d1bd8d58c470a2b69ce8baadd0cb1671c | [
"MIT"
] | null | null | null | main.py | jasonwho321/Guangxin | 60ce419d1bd8d58c470a2b69ce8baadd0cb1671c | [
"MIT"
] | null | null | null | main.py | jasonwho321/Guangxin | 60ce419d1bd8d58c470a2b69ce8baadd0cb1671c | [
"MIT"
] | null | null | null | # 这是一个示例 Python 脚本。
# 按 Shift+F10 执行或将其替换为您的代码。
# 按 双击 Shift 在所有地方搜索类、文件、工具窗口、操作和设置。
import xlwings as xw
def print_hi(name):
# 在下面的代码行中使用断点来调试脚本。
print(f'Hi, {name}') # 按 Ctrl+F8 切换断点。
# 按间距中的绿色按钮以运行脚本。
if __name__ == '__main__':
app = xw.App(visible=True,add_book=False)
book = app.books.open(r'E:... | 30.111111 | 105 | 0.539273 |
1d44309575415a427c0070b6849bd4574215369f | 661 | py | Python | service/generateRawInfo.py | jihernrod/cabrera | ddbf792e43669035f26c7e6ae7b509a93e8bfee6 | [
"Unlicense"
] | null | null | null | service/generateRawInfo.py | jihernrod/cabrera | ddbf792e43669035f26c7e6ae7b509a93e8bfee6 | [
"Unlicense"
] | null | null | null | service/generateRawInfo.py | jihernrod/cabrera | ddbf792e43669035f26c7e6ae7b509a93e8bfee6 | [
"Unlicense"
] | null | null | null |
class GenerateRawInfo:
def __init__(self, conf_interface,
md_interface,
algorithms_interface):
self.__md_interface = md_interface
self.__conf_interface = conf_interface
self.__algorithms_interface =algorithms_interface
def d... | 31.47619 | 78 | 0.66112 |
bd6f03f704154ed99847778151d3079c161740c3 | 178 | py | Python | SimpleCV/examples/display/videowriter.py | nikhilgk/SimpleCV | ee64451c16db1f40b4da221115273020a6a7b01a | [
"BSD-3-Clause"
] | 2 | 2018-04-09T09:50:49.000Z | 2021-05-16T20:13:52.000Z | SimpleCV/examples/display/videowriter.py | nikhilgk/SimpleCV | ee64451c16db1f40b4da221115273020a6a7b01a | [
"BSD-3-Clause"
] | null | null | null | SimpleCV/examples/display/videowriter.py | nikhilgk/SimpleCV | ee64451c16db1f40b4da221115273020a6a7b01a | [
"BSD-3-Clause"
] | 2 | 2015-04-16T12:14:55.000Z | 2019-08-07T14:12:04.000Z | #!/usr/bin/python
from SimpleCV import *
import time
c = Camera()
vs = VideoStream("foo.avi")
for i in range(0,500):
c.getImage().edges().invert().save(vs)
time.sleep(0.05)
| 14.833333 | 39 | 0.668539 |
c752dee264e6c7945fd45915786eb749c16fcaa2 | 30,521 | py | Python | tools/data_generators/rbac_dummy_data_generator.py | mabashian/awx | 904cb4af34141ca0cfec6f597eb8016e575a670e | [
"Apache-2.0"
] | null | null | null | tools/data_generators/rbac_dummy_data_generator.py | mabashian/awx | 904cb4af34141ca0cfec6f597eb8016e575a670e | [
"Apache-2.0"
] | null | null | null | tools/data_generators/rbac_dummy_data_generator.py | mabashian/awx | 904cb4af34141ca0cfec6f597eb8016e575a670e | [
"Apache-2.0"
] | 1 | 2019-05-07T13:55:18.000Z | 2019-05-07T13:55:18.000Z | #!/usr/bin/env python
# Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved
import os
import sys
# Python
from collections import defaultdict
from optparse import make_option, OptionParser
from datetime import datetime
import logging
# Django
import django
from django.utils.timezone import now
base_dir = os.pat... | 41.809589 | 136 | 0.488254 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.